dispach 0.1.2 → 0.2.0-pilot.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +196 -118
- package/dist/APEv2Parser-2wqk09q7.js +5 -0
- package/dist/APEv2Parser-2wqk09q7.js.map +9 -0
- package/dist/AiffParser-zw4g2bdd.js +5 -0
- package/dist/AiffParser-zw4g2bdd.js.map +12 -0
- package/dist/App-ez7ve0yp.js +11 -0
- package/dist/{App-b1yrwrcq.js.map → App-ez7ve0yp.js.map} +6 -7
- package/dist/AsfParser-2hfcf5z2.js +5 -0
- package/dist/AsfParser-2hfcf5z2.js.map +14 -0
- package/dist/ConfigEditor-aamadrx3.js +6 -0
- package/dist/{ConfigEditor-n8hdw6r7.js.map → ConfigEditor-aamadrx3.js.map} +2 -2
- package/dist/DsdiffParser-n8smktvb.js +5 -0
- package/dist/DsdiffParser-n8smktvb.js.map +11 -0
- package/dist/DsfParser-npmjp4vr.js +5 -0
- package/dist/DsfParser-npmjp4vr.js.map +11 -0
- package/dist/FlacParser-xpbs2zmb.js +5 -0
- package/dist/FlacParser-xpbs2zmb.js.map +9 -0
- package/dist/KeyProbe-4fp152yv.js +5 -0
- package/dist/{KeyProbe-9jjeze5r.js.map → KeyProbe-4fp152yv.js.map} +2 -2
- package/dist/MP4Parser-es3afcmw.js +5 -0
- package/dist/MP4Parser-es3afcmw.js.map +12 -0
- package/dist/MatroskaParser-kxysj649.js +5 -0
- package/dist/MatroskaParser-kxysj649.js.map +13 -0
- package/dist/MpegParser-b3rr7b0f.js +5 -0
- package/dist/MpegParser-b3rr7b0f.js.map +13 -0
- package/dist/MusepackParser-sgjzmq0r.js +5 -0
- package/dist/MusepackParser-sgjzmq0r.js.map +16 -0
- package/dist/OggParser-x8h54ynf.js +5 -0
- package/dist/OggParser-x8h54ynf.js.map +18 -0
- package/dist/Picker-rq015kzc.js +5 -0
- package/dist/{Picker-hfeh1g6m.js.map → Picker-rq015kzc.js.map} +2 -2
- package/dist/SessionPicker-03zyvd2f.js +5 -0
- package/dist/{SessionPicker-zyqkg4dn.js.map → SessionPicker-03zyvd2f.js.map} +2 -2
- package/dist/SkillBrowser-8s8rjv98.js +5 -0
- package/dist/{SkillBrowser-3qdp8080.js.map → SkillBrowser-8s8rjv98.js.map} +2 -2
- package/dist/WavPackParser-w515nnw2.js +5 -0
- package/dist/WavPackParser-w515nnw2.js.map +11 -0
- package/dist/WaveParser-sb0w9m20.js +5 -0
- package/dist/WaveParser-sb0w9m20.js.map +13 -0
- package/dist/WizardApp-wr1tftcr.js +5 -0
- package/dist/{WizardApp-vzpbydy3.js.map → WizardApp-wr1tftcr.js.map} +3 -3
- package/dist/agents.d.ts +19 -3
- package/dist/agents.d.ts.map +1 -1
- package/dist/channels-gx951qdp.js +31 -0
- package/dist/channels-gx951qdp.js.map +10 -0
- package/dist/channels.d.ts +26 -0
- package/dist/channels.d.ts.map +1 -0
- package/dist/client.js +11 -11
- package/dist/client.js.map +3 -3
- package/dist/config-wvjeejgd.js +24 -0
- package/dist/{config-g7za9x13.js.map → config-wvjeejgd.js.map} +2 -2
- package/dist/credential-10dn3fxj.js +19 -0
- package/dist/{credential-npr6z8c8.js.map → credential-10dn3fxj.js.map} +1 -1
- package/dist/daemon.d.ts.map +1 -1
- package/dist/index-10009hp8.js +11 -0
- package/dist/index-10009hp8.js.map +11 -0
- package/dist/index-1xwrkwh5.js +14 -0
- package/dist/index-1xwrkwh5.js.map +50 -0
- package/dist/index-34p39yfc.js +47 -0
- package/dist/index-34p39yfc.js.map +15 -0
- package/dist/index-3y96s740.js +6 -0
- package/dist/{index-hwpvhaza.js.map → index-3y96s740.js.map} +1 -1
- package/dist/index-4ybeefmn.js +6 -0
- package/dist/index-4ybeefmn.js.map +11 -0
- package/dist/index-59z88wrb.js +6 -0
- package/dist/{index-h9mw7b9d.js.map → index-59z88wrb.js.map} +2 -2
- package/dist/index-5fwzn21m.js +6 -0
- package/dist/{index-gz9x25tz.js.map → index-5fwzn21m.js.map} +2 -2
- package/dist/index-6dvnfk8y.js +6 -0
- package/dist/index-6dvnfk8y.js.map +10 -0
- package/dist/index-6p70fnb7.js +153 -0
- package/dist/index-6p70fnb7.js.map +20 -0
- package/dist/index-6s471ydn.js +12 -0
- package/dist/{index-j55s3ehk.js.map → index-6s471ydn.js.map} +2 -2
- package/dist/index-87wcawta.js +6 -0
- package/dist/{index-0d93hyfc.js.map → index-87wcawta.js.map} +2 -2
- package/dist/index-92gfcbw0.js +6 -0
- package/dist/index-92gfcbw0.js.map +9 -0
- package/dist/index-a0h0p20f.js +991 -0
- package/dist/{index-tv4yv7d2.js.map → index-a0h0p20f.js.map} +27 -23
- package/dist/index-bamw24xc.js +6 -0
- package/dist/{index-6q4wf8e3.js.map → index-bamw24xc.js.map} +1 -1
- package/dist/index-c8ge88a9.js +12 -0
- package/dist/{index-258d8bzg.js.map → index-c8ge88a9.js.map} +4 -3
- package/dist/index-cb2q8nae.js +6 -0
- package/dist/index-cb2q8nae.js.map +13 -0
- package/dist/index-ct6bw0a6.js +6 -0
- package/dist/{index-4z7axw4r.js.map → index-ct6bw0a6.js.map} +1 -1
- package/dist/index-cz6yjxyz.js +10 -0
- package/dist/index-cz6yjxyz.js.map +42 -0
- package/dist/index-d0c5abkw.js +6 -0
- package/dist/{index-vgc3y3rm.js.map → index-d0c5abkw.js.map} +3 -3
- package/dist/index-d0vagham.js +31 -0
- package/dist/index-d0vagham.js.map +188 -0
- package/dist/index-d0zxvr99.js +90 -0
- package/dist/index-d0zxvr99.js.map +13 -0
- package/dist/{index-s9mbq7h6.js → index-d9c97ver.js} +4 -4
- package/dist/{index-s9mbq7h6.js.map → index-d9c97ver.js.map} +1 -1
- package/dist/index-e508e0vt.js +6 -0
- package/dist/{index-tf71ap9v.js.map → index-e508e0vt.js.map} +1 -1
- package/dist/index-esq0knqx.js +6 -0
- package/dist/index-esq0knqx.js.map +10 -0
- package/dist/index-featyhps.js +6 -0
- package/dist/index-featyhps.js.map +10 -0
- package/dist/index-fnq44zdt.js +45 -0
- package/dist/index-fnq44zdt.js.map +74 -0
- package/dist/index-gmn80dwc.js +7 -0
- package/dist/{index-02dn6m2j.js.map → index-gmn80dwc.js.map} +2 -2
- package/dist/index-gwhx69qs.js +66 -0
- package/dist/index-gwhx69qs.js.map +12 -0
- package/dist/index-kjgzhf3w.js +9 -0
- package/dist/{index-6p999cx4.js.map → index-kjgzhf3w.js.map} +4 -6
- package/dist/index-m68cd91a.js +12 -0
- package/dist/index-m68cd91a.js.map +23 -0
- package/dist/{index-3g3ny01d.js → index-mhmgw54j.js} +4 -4
- package/dist/{index-3g3ny01d.js.map → index-mhmgw54j.js.map} +1 -1
- package/dist/{index-gme2egyq.js → index-qm612hwa.js} +4 -4
- package/dist/{index-gme2egyq.js.map → index-qm612hwa.js.map} +1 -1
- package/dist/{index-j7gyr5nx.js → index-qwntpbwe.js} +7 -7
- package/dist/{index-j7gyr5nx.js.map → index-qwntpbwe.js.map} +1 -1
- package/dist/index-qx3xdk4x.js +6 -0
- package/dist/{index-d4x6yvqh.js.map → index-qx3xdk4x.js.map} +3 -4
- package/dist/{index-4cf6v9nb.js → index-rh0meegk.js} +4 -4
- package/dist/{index-4cf6v9nb.js.map → index-rh0meegk.js.map} +1 -1
- package/dist/index-ryb159ff.js +9 -0
- package/dist/{index-ff514z3y.js.map → index-ryb159ff.js.map} +3 -5
- package/dist/{index-ammv5st7.js → index-s6zfpyqa.js} +6 -6
- package/dist/{index-ammv5st7.js.map → index-s6zfpyqa.js.map} +1 -1
- package/dist/index-s9va2kmc.js +429 -0
- package/dist/index-s9va2kmc.js.map +11 -0
- package/dist/index-v5dmsgpx.js +7 -0
- package/dist/index-v5dmsgpx.js.map +11 -0
- package/dist/index-vaj3mn3a.js +6 -0
- package/dist/index-vaj3mn3a.js.map +14 -0
- package/dist/index-vy0rbzws.js +6 -0
- package/dist/{index-fex44816.js.map → index-vy0rbzws.js.map} +2 -2
- package/dist/index-w0s77wfx.js +6 -0
- package/dist/{index-v8e92nfw.js.map → index-w0s77wfx.js.map} +1 -1
- package/dist/index-wx1jzjzr.js +6 -0
- package/dist/{index-qdbq8crg.js.map → index-wx1jzjzr.js.map} +2 -2
- package/dist/index-xbn26c8g.js +126 -0
- package/dist/index-xbn26c8g.js.map +14 -0
- package/dist/index-ytvwyp6k.js +6 -0
- package/dist/{index-9r0wyj6w.js.map → index-ytvwyp6k.js.map} +2 -2
- package/dist/{index-cqqb6gaq.js → index-yvnwpxbb.js} +5 -5
- package/dist/{index-cqqb6gaq.js.map → index-yvnwpxbb.js.map} +1 -1
- package/dist/index.js +379 -448
- package/dist/index.js.map +26 -28
- package/dist/init.d.ts.map +1 -1
- package/dist/lib/agent-secrets.d.ts +38 -0
- package/dist/lib/agent-secrets.d.ts.map +1 -0
- package/dist/lib/agent-template.d.ts +54 -0
- package/dist/lib/agent-template.d.ts.map +1 -0
- package/dist/lib/channel-actions.d.ts +103 -0
- package/dist/lib/channel-actions.d.ts.map +1 -0
- package/dist/lib/chat-frame.d.ts +12 -1
- package/dist/lib/chat-frame.d.ts.map +1 -1
- package/dist/lib/commands.d.ts +13 -0
- package/dist/lib/commands.d.ts.map +1 -1
- package/dist/lib/const.d.ts +1 -1
- package/dist/lib/daemon-plan.d.ts.map +1 -1
- package/dist/lib/help.d.ts.map +1 -1
- package/dist/lib/host-actions.d.ts +121 -0
- package/dist/lib/host-actions.d.ts.map +1 -0
- package/dist/lib/init-flow.d.ts +32 -0
- package/dist/lib/init-flow.d.ts.map +1 -1
- package/dist/lib/init-whatsapp.d.ts +52 -0
- package/dist/lib/init-whatsapp.d.ts.map +1 -0
- package/dist/lib/plugin-install.d.ts +120 -0
- package/dist/lib/plugin-install.d.ts.map +1 -0
- package/dist/lib/providers.d.ts.map +1 -1
- package/dist/lib/provision.d.ts +13 -0
- package/dist/lib/provision.d.ts.map +1 -1
- package/dist/lib/readme-table.d.ts +15 -0
- package/dist/lib/readme-table.d.ts.map +1 -0
- package/dist/lib/sandbox.d.ts +17 -0
- package/dist/lib/sandbox.d.ts.map +1 -1
- package/dist/lib/schema.d.ts +34 -1
- package/dist/lib/schema.d.ts.map +1 -1
- package/dist/lib/subcommand.d.ts.map +1 -1
- package/dist/lib/web-url.d.ts +15 -0
- package/dist/lib/web-url.d.ts.map +1 -0
- package/dist/lib/wizard.d.ts.map +1 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/model.d.ts.map +1 -1
- package/dist/plugins.d.ts +27 -8
- package/dist/plugins.d.ts.map +1 -1
- package/dist/restart.d.ts +21 -0
- package/dist/restart.d.ts.map +1 -0
- package/dist/run.d.ts.map +1 -1
- package/dist/schedules.d.ts.map +1 -1
- package/dist/serve.d.ts.map +1 -1
- package/dist/sessions.d.ts.map +1 -1
- package/dist/skills.d.ts.map +1 -1
- package/dist/status.d.ts +16 -0
- package/dist/status.d.ts.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/validate.d.ts.map +1 -1
- package/dist/web-61cjhpv2.js +14 -0
- package/dist/{web-vkb16r62.js.map → web-61cjhpv2.js.map} +3 -3
- package/dist/web.d.ts +2 -13
- package/dist/web.d.ts.map +1 -1
- package/dist/workspace.d.ts.map +1 -1
- package/dist/wrapper-9msjh1xg.js +5 -0
- package/dist/wrapper-9msjh1xg.js.map +9 -0
- package/package.json +6 -3
- package/dist/App-b1yrwrcq.js +0 -11
- package/dist/ConfigEditor-n8hdw6r7.js +0 -6
- package/dist/KeyProbe-9jjeze5r.js +0 -5
- package/dist/Picker-hfeh1g6m.js +0 -5
- package/dist/SessionPicker-zyqkg4dn.js +0 -5
- package/dist/SkillBrowser-3qdp8080.js +0 -5
- package/dist/WizardApp-vzpbydy3.js +0 -5
- package/dist/config-g7za9x13.js +0 -24
- package/dist/credential-npr6z8c8.js +0 -19
- package/dist/index-02dn6m2j.js +0 -7
- package/dist/index-0d93hyfc.js +0 -6
- package/dist/index-1c5113t4.js +0 -66
- package/dist/index-1c5113t4.js.map +0 -12
- package/dist/index-258d8bzg.js +0 -12
- package/dist/index-4z7axw4r.js +0 -6
- package/dist/index-6p999cx4.js +0 -9
- package/dist/index-6q4wf8e3.js +0 -6
- package/dist/index-9r0wyj6w.js +0 -6
- package/dist/index-d4x6yvqh.js +0 -6
- package/dist/index-fecm8xe7.js +0 -77
- package/dist/index-fecm8xe7.js.map +0 -12
- package/dist/index-fex44816.js +0 -6
- package/dist/index-ff514z3y.js +0 -14
- package/dist/index-gz9x25tz.js +0 -6
- package/dist/index-h9mw7b9d.js +0 -6
- package/dist/index-hwpvhaza.js +0 -6
- package/dist/index-j55s3ehk.js +0 -12
- package/dist/index-mtn0g9vc.js +0 -7
- package/dist/index-mtn0g9vc.js.map +0 -11
- package/dist/index-qdbq8crg.js +0 -6
- package/dist/index-tf71ap9v.js +0 -6
- package/dist/index-ttwyrdjs.js +0 -427
- package/dist/index-ttwyrdjs.js.map +0 -11
- package/dist/index-tv4yv7d2.js +0 -903
- package/dist/index-ty24n0jh.js +0 -167
- package/dist/index-ty24n0jh.js.map +0 -19
- package/dist/index-v8e92nfw.js +0 -6
- package/dist/index-vgc3y3rm.js +0 -6
- package/dist/index-whaw4b18.js +0 -6
- package/dist/index-whaw4b18.js.map +0 -10
- package/dist/web-vkb16r62.js +0 -14
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{lt,de,Be,NA,pA,No,To,Ro,fr,mn,hr,Qr,yr,oi,mr,TA,Sn,Dn,Dr,RA,wr,wn,ri,Or,br,Mr,Nr}from"./index-gwhx69qs.js";import{Pe,gi,ci,kr,_r,o,l,F,b,I,yA,ee,R,Ft}from"./index-a0h0p20f.js";import{readFile as Ke}from"node:fs/promises";var qe=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function e(u){return t[u]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},c={nan:"NaN"};return(u)=>{switch(u.code){case"invalid_type":{let f=c[u.expected]??u.expected,y=kr(u.input),x=c[y]??y;return`Invalid input: expected ${f}, received ${x}`}case"invalid_value":if(u.values.length===1)return`Invalid input: expected ${ci(u.values[0])}`;return`Invalid option: expected one of ${gi(u.values,"|")}`;case"too_big":{let f=u.inclusive?"<=":"<",y=e(u.origin);if(y)return`Too big: expected ${u.origin??"value"} to have ${f}${u.maximum.toString()} ${y.unit??"elements"}`;return`Too big: expected ${u.origin??"value"} to be ${f}${u.maximum.toString()}`}case"too_small":{let f=u.inclusive?">=":">",y=e(u.origin);if(y)return`Too small: expected ${u.origin} to have ${f}${u.minimum.toString()} ${y.unit}`;return`Too small: expected ${u.origin} to be ${f}${u.minimum.toString()}`}case"invalid_format":{let f=u;if(f.format==="starts_with")return`Invalid string: must start with "${f.prefix}"`;if(f.format==="ends_with")return`Invalid string: must end with "${f.suffix}"`;if(f.format==="includes")return`Invalid string: must include "${f.includes}"`;if(f.format==="regex")return`Invalid string: must match pattern ${f.pattern}`;return`Invalid ${r[f.format]??u.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${u.divisor}`;case"unrecognized_keys":return`Unrecognized key${u.keys.length>1?"s":""}: ${gi(u.keys,", ")}`;case"invalid_key":return`Invalid key in ${u.origin}`;case"invalid_union":if(u.options&&Array.isArray(u.options)&&u.options.length>0)return`Invalid discriminator value. Expected ${u.options.map((y)=>`'${y}'`).join(" | ")}`;return"Invalid input";case"invalid_element":return`Invalid value in ${u.origin}`;default:return"Invalid input"}}};function te(){return{localeError:qe()}}Pe(te());function Ai(t={}){let e=t.now??(()=>new Date),r=new Map;return{approver:(u)=>new Promise((f)=>{let y={pending:{approvalId:u.approvalId,agentId:u.agentId,slug:u.slug,callId:u.callId,match:u.match,mutating:u.mutating,reason:u.reason,requestedAt:e().toISOString()},settle:(x)=>{r.delete(u.approvalId),f(x)}};r.set(u.approvalId,y),u.signal.addEventListener("abort",()=>y.settle(!1),{once:!0})}),pending:(u)=>[...r.values()].map((f)=>f.pending).filter((f)=>f.agentId===u).sort((f,y)=>f.requestedAt.localeCompare(y.requestedAt)),resolve:(u,f)=>{let y=r.get(u);if(y===void 0)return!1;return y.settle(f),!0},get size(){return r.size}}}function m(t,e,r={}){return new Response(JSON.stringify({error:t}),{status:e,headers:{"content-type":"application/json; charset=utf-8",...r}})}function ce(){return m({code:"unauthorized",message:"Missing or invalid bearer token.",hint:"Send Authorization: Bearer <token>, where the token is either the value of the variable named by server.tokenEnv or an operator key from POST /v1/keys. A revoked key, an expired one and a wrong one answer the same way on purpose."},401)}function _e(){return m({code:"claim_spent",message:"That claim has already been exchanged.",hint:"A claim is good for one key. Use the key it minted; if it is lost, restart with --claim to print a new one — a claim lives in the process rather than the database, so it never outlives the boot that printed it."},401)}function Ve(t,e){return m({code:"capability_required",message:`This credential cannot ${e}.`,hint:`The key is scoped, and "${t}" is not among its capabilities. GET /v1/keys shows what each key may do; mint another with POST /v1/keys, or use the server token. An unscoped key has all four.`,field:"scope.can"},403)}function fe(t,e){if(t.length!==e.length)return!1;let r=0;for(let c=0;c<t.length;c+=1)r|=t.charCodeAt(c)^e.charCodeAt(c);return r===0}function We(t){let e=t.headers.get("authorization")??"";return e.startsWith("Bearer ")?e.slice(7):""}async function Qe(t){let e=We(t.request);if(t.expected!==void 0&&fe(e,t.expected))return{kind:"token"};if(e!==""){let r=await t.keys.findLive(await To(e),new Date(t.at).toISOString());if(r!==void 0)return await t.keys.touch(r.keyId,new Date(t.at).toISOString()),{kind:"key",keyId:r.keyId,...r.scope===void 0?{}:{scope:r.scope}};if(t.claim!==void 0&&fe(e,t.claim.token)){if(t.request.method!=="POST"||t.pathname!=="/v1/keys")return ce();if(!t.claim.live())return _e();return{kind:"claim"}}}return ce()}var je="dispach.bearer";function Ye(t){let e=t.headers.get("sec-websocket-protocol");if(e===null)return;let r=e.split(",").map((u)=>u.trim()),c=r.indexOf(je);return c===-1?void 0:r[c+1]??""}function Je(t,e){let r=new Headers(t.headers);return r.set("authorization",`Bearer ${e}`),new Request(t.url,{method:t.method,headers:r})}function j(t,e){return t.meta({...e})}function Q(t,e){return t.meta({description:e})}var Xe=I({id:j(o().trim().min(1),{code:"sender_invalid",hint:'Send { "from": { "id": "agent:ops-bot", "kind": "agent" } }, or omit it entirely for a turn the token-holder is sending itself.',description:"Stable identifier for the sender. Appears on the turn row and in events."}),kind:j(R(TA,{error:(t)=>{let e=typeof t.input==="string"?t.input:void 0,r=e===void 0?void 0:lt(e,TA);return`from.kind must be one of: ${TA.join(", ")}.${r===void 0?"":` Did you mean "${r}"?`}`}}),{code:"sender_invalid",hint:'This field decides the trust boundary — "agent" fences the message and blocks mutating tools for the turn, "user" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits "from".',description:'The trust boundary. "agent" fences the text as data and blocks mutating tools for the whole turn.'}),name:j(o().optional(),{code:"sender_invalid",hint:"A display name, shown beside the sender id. Omit it rather than sending an empty string.",description:"Human-readable name for the sender."})}).meta({description:"Attribution for a turn somebody other than the token-holder is sending. Omit for your own."}),Ze=j(yA([Ft("none"),I({channel:o().min(1),to:o().min(1)})]),{code:"deliver_invalid",hint:'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { "channel": "tg", "to": "12345" }, or "none" to read the reply from the event stream.',description:'Where the reply goes. "none" leaves it on the event stream and in the store.'}),Ae=I({text:j(o().trim().min(1),{code:"message_text_required",hint:'Send { "text": "..." }. An empty turn would be billed for a full prompt and produce nothing.',description:"What to say to the agent."}),sessionKey:Q(o().min(1).optional(),"Which conversation this belongs to. Defaults to `api:default`."),deliver:Ze.optional(),from:Xe.optional(),stream:Q(F().optional(),"Stream the turn's events inline as SSE rather than returning a handle."),chunks:Q(F().optional(),"Include per-token `model.chunk` frames. Off by default — the reader decides.")}),ze=I({granted:j(F(),{code:"approval_decision_required",hint:'Send { "granted": true } or { "granted": false }. There is no default: one direction would deny a call over a typo and the other would grant one, and neither is a decision anybody made.',description:"Whether the blocked tool call may proceed."})}),et=I({agents:b(o().min(1)).optional().meta({code:"key_scope_agents_invalid",hint:'Send { "agents": ["milo"] } — a list of agent ids. Omit it for a key that reaches every agent. An id naming no agent on this server is reported rather than silently matching nothing.',description:"Agent ids this key may reach. Absent means all of them."}),sessions:o().min(1).optional().meta({code:"key_scope_sessions_invalid",hint:'Send { "sessions": "team_42:" } — a session-key prefix, with an optional trailing "*". A prefix rather than a list, because the conversations this key will cover do not exist yet when it is minted.',description:"Session-key prefix. Absent means every session."}),can:b(R(["read","chat","write","admin"])).optional().meta({code:"key_scope_can_invalid",hint:'Send { "can": ["chat", "read"] }. The four are read (every GET), chat (send a message, answer an approval, stop a turn), write (schedules, phase, clearing a session) and admin (keys, provisioning, start/stop/reload). Absent means all four; an empty array means none, and is honoured as written.',description:"Capabilities this key may exercise. Absent means all four."}),expiresIn:l().int().positive().optional().meta({code:"key_scope_expires_invalid",hint:'Send { "expiresIn": 3600 } — whole seconds from now, as a number. Relative rather than an absolute instant, because that would need the caller and this server to agree about the clock; the response reports the absolute expiresAt this server computed.',description:"Seconds until this key stops authenticating. Absent means never."})}),Ie=I({label:j(o(),{code:"key_label_required",hint:'Send { "label": "my browser" }. A label is required rather than defaulted because it is the only thing distinguishing two credentials in a listing, and "key 2" is a name nobody can act on when deciding which to revoke.',description:"How this credential is shown in a listing. Required; see `keyLabelProblem`."}),scope:et.optional().meta({code:"key_scope_invalid",hint:'Send { "scope": { "agents": ["milo"], "can": ["chat"] } }, or omit it entirely for a key that reaches everything — which is what every key minted before scopes existed does.',description:"Opt-in narrowing. Absent is an unscoped key."})}),Oe=I({phase:j(o().min(1),{code:"phase_invalid",hint:"Send the name of a phase this agent's manifest declares. `GET /v1/agents/:id` lists them.",description:"The phase to move this session into."})}),Re=I({reason:j(o().optional(),{code:"agent_stop_invalid",hint:"A short note, recorded on the row and shown wherever the agent is reported as off.",description:"Why, for whoever reads the listing later."})}),tt=I({path:j(o().min(1),{code:"config_path_unknown",hint:"GET /v1/agents/:id/config lists every field this surface may change, with what each one does.",description:"A dotted path, exactly as it appears in the manifest — `tools.pinned`, `model.main.id`."}),value:j(o(),{code:"config_value_unreadable",hint:'Text, the way it is typed at a terminal: a bare word, a number, true or false, a list as ["a", "b"], or a map as {k: v}. Quote anything containing a colon or a "#".',description:"The new value, as text. Read by the same parser the `config` command uses."}),confirm:Q(F().optional(),"Required only for a field whose own row carries a `confirm` sentence. Absent is not consent.")}),nt=I({enabled:Q(F().optional(),"Switch the channel on or off. It takes effect at the agent's next start, because a channel is constructed at boot."),credential:j(o().min(1).optional(),{code:"channel_credential_unreadable",hint:"The value goes into the .env beside the manifest at 0600, under the variable that channel's own entry names. Send a non-empty string; an empty one fails the load exactly as a missing variable does.",description:"The channel's credential — a Telegram bot token. Never returned by any route; only whether it is set."})}),Le=I({answers:j(ee(o(),j(o(),{code:"provision_answer_invalid",hint:"Answers arrive as strings from the terminal and from here, and are validated per step. Send the value as a string — including a boolean-looking choice, whose values are named in GET /v1/provision.",description:"One answer. Always text, whatever the step's type looks like."})).optional(),{code:"provision_answers_required",hint:'Send { "answers": { "name": "milo", … } }. Every step you leave out takes its default, exactly as `init --yes` does with flags; GET /v1/provision lists them.',description:"A subset of the wizard's steps, as strings. `GET /v1/provision` lists every step with its prompt, default and choices. Send this or `template`, not both."}),template:j(o().min(1).optional(),{code:"provision_template_invalid",hint:"Send the template's name as a string. GET /v1/templates lists what this server has.",description:"Create the agent from a template in this server's sandbox instead of from answers. Needs `name`; takes `vars`."}),name:j(o().optional(),{code:"provision_name_required",hint:'Send { "template": "…", "name": "Acme store" }. The id every route keys on is derived from it.',description:"The new agent's name, with `template`. Its slug becomes the id; the template sees both as {{agent.name}} and {{agent.id}}."}),vars:j(ee(o(),j(o(),{code:"template_value_invalid",hint:"Template values are one line of text, sent as strings.",description:"One variable's value."})).optional(),{code:"template_value_invalid",hint:`Send { "vars": { "store": "Acme" } }, every value a string. GET /v1/templates lists each template's variables.`,description:"Values for the template's declared variables. A secret variable's value goes to the agent's .env and is never returned."})}),De=I({url:j(o().min(1),{code:"webhook_url_invalid",hint:"Send an absolute https:// URL. A receiver on a private network needs the operator to allow it in WEBHOOK_ALLOW.",description:"Where deliveries are POSTed. Checked against every address it resolves to, at subscribe and at every send."}),types:j(b(o()).min(1),{code:"webhook_types_required",hint:'Send { "types": ["turn.end", "approval.requested"] }. Any event type except model.chunk; the wire spec lists them.',description:"The event types to deliver. `model.chunk` is not deliverable."}),agents:j(b(o()).min(1).optional(),{code:"webhook_scope_invalid",hint:"Send agent ids this credential can reach, or leave agents out to hear every agent it can reach.",description:"Narrow the subscription to these agents. It can never hear more than the creating credential reaches."})}),Me=I({values:j(ee(o(),j(o(),{code:"secret_value_invalid",hint:"Send each value as a non-empty string.",description:"One variable's value. Written to the agent's .env at 0600; never returned."})),{code:"secrets_values_required",hint:'Send { "values": { "MODEL_API_KEY": "…" } }. GET /v1/agents/:id/secrets lists the variables this agent reads.',description:"Variables to write into the agent's .env, keyed by name. Only names the agent's manifest reads are accepted."})});function G(t,e){let r=t.safeParse(e??{});if(r.success)return{ok:!0,value:r.data};let c=r.error.issues[0],u=(c?.path??[]).filter((x)=>typeof x==="string"),f=rt(t,u);return{ok:!1,error:{...{code:"request_body_invalid",message:u.length===0?c?.message??"The request body is invalid.":`${u.join(".")}: ${c?.message}`,hint:"The field above is the one to fix. GET /v1/openapi.json describes every body this server accepts, including the error code each field produces."},...f?.code===void 0?{}:{code:f.code},...f?.hint===void 0?{}:{hint:f.hint},...u.length===0?{}:{field:u.join(".")}}}}function rt(t,e){let r=t,c=he(t);for(let u of e){if(r=at(r,u),r===void 0)break;c=he(r)??c}return c}function he(t){let e=t?.meta();if(e?.code===void 0&&e?.hint===void 0)return;return e}function at(t,e){let r=ne(t),c=r?.shape;if(c?.[e]!==void 0)return ne(c[e]);let u=r?.def?.valueType;return u===void 0?void 0:ne(u)}function ne(t){let e=t;for(let r=0;r<8&&e!==void 0;r+=1){let c=e.def?.innerType;if(c===void 0)return e;e=c}return e}var it={"GET /v1/health":{summary:"Liveness, the version, and how many agents are hosted."},"GET /v1/ready":{summary:"Whether a turn can be served yet.",statuses:[{code:503,when:"still starting; channels may still be connecting"}]},"GET /v1/activity":{summary:"Whether the process is idle, and when it must next be woken. For an external waker.",statuses:[{code:403,when:"the key is scoped to agents or sessions"}]},"GET /v1/agents":{summary:"Every agent this server knows about, hosted or switched off."},"GET /v1/agents/:id":{summary:"One agent, with its dialect, window, counts and warnings."},"POST /v1/agents/:id/reload":{summary:"Re-read the manifest by replacing the agent with a new instance.",statuses:[{code:409,when:"a turn is running — it is not aborted to apply a change"},{code:400,when:"a team member, which has no manifest of its own"}]},"GET /v1/provision":{summary:"The questions creating an agent asks, and whether this server can answer them."},"POST /v1/agents":{summary:"Create an agent, from answers or from a template, and adopt it into this host, live.",body:Le,statuses:[{code:201,when:"created; `adopted` is empty with an `error` if it is not running"},{code:403,when:"not a loopback bind"},{code:501,when:"this server has no provisioner"}]},"POST /v1/webhooks":{summary:"Subscribe a URL to event types. The signing secret is returned once.",body:De,statuses:[{code:201,when:"created; `secret` is in this response and no other"},{code:400,when:"a refused URL, an undeliverable type, or agents outside this key's reach"}]},"GET /v1/webhooks":{summary:"The subscriptions this credential can see, with their delivery health. Never a secret."},"DELETE /v1/webhooks/:webhookId":{summary:"Delete a subscription and anything it still owed.",statuses:[{code:404,when:"no such subscription, or one outside this key's reach"}]},"GET /v1/usage":{summary:"What every agent in scope cost, per model call, grouped by agent, model, day or sender.",statuses:[{code:400,when:"an unknown grouping or a date that does not parse"}]},"GET /v1/agents/:id/usage":{summary:"What this agent cost, from the meter.",statuses:[{code:400,when:"an unknown grouping or a date that does not parse"}]},"GET /v1/agents/:id/turns":{summary:"Every turn this agent has taken, newest first, across sessions, paged by `before`.",statuses:[{code:400,when:"`limit` or `before` is not a positive whole number"}]},"GET /v1/templates":{summary:"The templates an agent can be created from, and the variables each declares."},"GET /v1/agents/:id/secrets":{summary:"Which variables the agent's manifest reads, and whether each is set. Never a value.",statuses:[{code:501,when:"this server has no credential writer"}]},"PUT /v1/agents/:id/secrets":{summary:"Write the agent's credentials into its .env and apply them: reload or adopt.",body:Me,statuses:[{code:200,when:"written; `applied` says whether the agent is running on them"},{code:400,when:"a variable the manifest does not read, or an empty value"},{code:501,when:"this server has no credential writer"}]},"POST /v1/agents/:id/stop":{summary:"Switch an agent off durably and drop it from this host now.",body:Re,statuses:[{code:409,when:"a turn is running"}]},"POST /v1/agents/:id/start":{summary:"Switch it back on and have this host adopt it.",statuses:[{code:501,when:"this server cannot look up manifests"}]},"POST /v1/agents/:id/messages":{summary:"Start a turn. Returns once accepted; the turn runs detached.",body:Ae,statuses:[{code:202,when:"accepted"},{code:429,when:"over limits.maxConcurrentTurns or limits.tokens; nothing recorded"}]},"POST /v1/agents/:id/turns/:turnId/stop":{summary:"Cooperatively stop a turn this API started.",statuses:[{code:409,when:"no cancel handle — a channel or schedule started it"}]},"GET /v1/agents/:id/turns/:turnId/stream":{summary:"One turn's events as SSE, replayed from the start and then live.",query:[{name:"chunks",about:"Include per-token frames. Off by default."},{name:"types",about:"Narrow to these event types, comma-separated."}],statuses:[{code:200,when:"an event stream; see the event table in the wire spec"}]},"GET /v1/events":{summary:"Every event this process emits, as SSE. The firehose.",query:[{name:"agentId",about:"Narrow to one agent."},{name:"sessionKey",about:"Narrow to one conversation."},{name:"chunks",about:"Include per-token frames. Off by default."},{name:"types",about:"Narrow to these event types, comma-separated."}],statuses:[{code:200,when:"an event stream; see the event table in the wire spec"}]},"GET /v1/agents/:id/approvals":{summary:"Questions waiting on a person, oldest first."},"POST /v1/agents/:id/approvals/:approvalId":{summary:"Answer one blocked tool call.",body:ze},"POST /v1/keys":{summary:"Mint an operator key. The secret is returned once and never again.",body:Ie,statuses:[{code:201,when:"minted"}]},"GET /v1/keys":{summary:"Every key, live and revoked. Never a secret."},"DELETE /v1/keys/:keyId":{summary:"Revoke a key. A soft delete; the row survives."},"GET /v1/agents/:id/turns/:turnId":{summary:"One turn's stored row."},"GET /v1/agents/:id/sessions":{summary:"Conversations, most recently active first."},"GET /v1/agents/:id/sessions/:key":{summary:"One conversation's summary."},"GET /v1/agents/:id/sessions/:key/messages":{summary:"A page of a conversation's messages.",query:[{name:"limit",about:"How many to return."},{name:"before",about:"Page backwards from this message id."}]},"DELETE /v1/agents/:id/sessions/:key":{summary:"Drop a conversation's history, turns and derived index."},"POST /v1/agents/:id/sessions/:key/phase":{summary:"Move a session into a declared phase.",body:Oe},"GET /v1/agents/:id/config":{summary:"Every manifest field this surface may set, what it does, and its current value."},"PATCH /v1/agents/:id/config":{summary:"Set one manifest field, then replace the agent so it takes effect.",statuses:[{code:409,when:"the field carries a confirm sentence and `confirm` was not true"},{code:409,when:"the agent came from an object, so there is no manifest to edit"},{code:400,when:"the path is not settable here, or the result would not validate"}]},"PATCH /v1/agents/:id/channels/:channelId":{summary:"Connect or disconnect a channel, and set its credential.",statuses:[{code:400,when:"neither `enabled` nor `credential` was sent, or the channel is unknown"},{code:409,when:"the agent came from an object, so there is no manifest to edit"},{code:501,when:"the host supplied no channel actions"}]},"POST /v1/agents/:id/channels/:channelId/unpair":{summary:"Forget a channel's stored pairing, so the next start offers a new code.",statuses:[{code:404,when:"this agent has no such channel"},{code:409,when:"the channel stores no pairing — a typed credential is a PATCH"}]},"GET /v1/agents/:id/schedules":{summary:"Every schedule, from the store."},"POST /v1/agents/:id/schedules":{summary:"Create a schedule. Validated by the manifest's own schedule rules.",statuses:[{code:201,when:"created"}]},"GET /v1/agents/:id/schedules/:sid":{summary:"One schedule's row."},"PATCH /v1/agents/:id/schedules/:sid":{summary:"Replace a schedule the API created.",statuses:[{code:409,when:"the manifest declares it, so reconciliation would undo the write"}]},"DELETE /v1/agents/:id/schedules/:sid":{summary:"Delete a schedule the API created.",statuses:[{code:409,when:"the manifest declares it, so the next boot would re-create it"}]},"POST /v1/agents/:id/schedules/:sid/run":{summary:"Fire a schedule now, out of band.",statuses:[{code:429,when:"over a governor limit; nothing recorded"}]},"GET /v1/agents/:id/tools":{summary:"The resolved catalogue, with trust and phases."},"GET /v1/agents/:id/skills":{summary:"What the skills index holds."},"GET /v1/agents/:id/context":{summary:"The prompt the next turn would be given, without running one.",query:[{name:"sessionKey",about:"Which conversation to assemble for."},{name:"input",about:"Pretend this is the next message."}]},"POST /v1/channels/:channelId/webhook/:agentId":{summary:"A channel provider's webhook. Open by design; the provider authenticates itself."},"GET /v1/openapi.json":{summary:"This document."},"GET /docs":{summary:"A browser reference over this document."}};function ot(t){return t.startsWith("/v1/")||t==="/docs"}function st(t){let e={};for(let r of t.routes){if(!ot(r.pattern))continue;let c=it[`${r.method} ${r.pattern}`];if(c===void 0)continue;let u=r.pattern.replace(/:([A-Za-z0-9_]+)/g,"{$1}"),f=[...r.pattern.matchAll(/:([A-Za-z0-9_]+)/g)].map((C)=>({name:C[1],in:"path",required:!0,schema:{type:"string"}})),y=(c.query??[]).map((C)=>({name:C.name,in:"query",required:!1,description:C.about,schema:{type:"string"}})),x={};for(let C of c.statuses??[])x[String(C.code)]={description:C.when};if(x["200"]===void 0&&x["201"]===void 0){if(x["202"]===void 0)x["200"]={description:"OK"}}if(x["401"]={description:"No credential, or one this server does not accept."},r.pattern.includes(":id"))x["404"]={description:"No such agent, or it is switched off."};e[u]??={};let D={summary:c.summary,...f.length+y.length===0?{}:{parameters:[...f,...y]},responses:x};if(c.body!==void 0)D.requestBody={required:!0,content:{"application/json":{schema:_r(c.body,{target:"draft-2020-12",io:"input"})}}};e[u][r.method.toLowerCase()]=D}return{openapi:"3.1.0",info:{title:"Dispach agent server",version:NA,description:"Generated from the router table and the request schemas — see openapi.ts. The binding contract is docs/04-SPEC-WIRE.md, which is checked against the code; @dispach/client's types are the response reference."},...t.serverUrl===void 0?{}:{servers:[{url:t.serverUrl}]},components:{securitySchemes:{bearer:{type:"http",scheme:"bearer",description:"An operator key or the configured token."}},schemas:{Error:{type:"object",description:"Every failure has this shape. `hint` is never absent — it is the part that says what to do.",properties:{error:{type:"object",required:["code","message","hint"],properties:{code:{type:"string"},message:{type:"string"},hint:{type:"string"},field:{type:"string"}}}}}}},security:[{bearer:[]}],paths:e}}var ut=new Set(["127.0.0.1","::1","localhost","[::1]"]);function J(t){return ut.has(t.toLowerCase())}function K(t){let e=t.trim();if(e===""||e.toLowerCase()==="null")return;try{return new URL(e.includes("://")?e:`http://${e}`).hostname.toLowerCase().replace(/^\[|\]$/g,"")}catch{return}}function pe(t){return J(t)||/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(t)}function X(t,e){let r=J(e.host),c=t.headers.get("host"),u=t.headers.get("origin");if(r){let y=c===null?void 0:K(c),x=e.allowedHosts??[];if(!(y!==void 0&&(pe(y)||x.some((C)=>K(C)===y))))return{code:"host_not_allowed",message:`This server does not answer to the host ${c??"(absent)"}.`,hint:"It is bound to loopback, so only a loopback name or address can legitimately reach it — a request addressed to any other name arrived through DNS pointed at this machine, which is how a web page reaches a local server it was never given access to. Add the name to server.allowedHosts if a proxy on this machine needs it.",field:"server.allowedHosts"}}if(u===null)return;let f=K(u);if(f!==void 0){if(pe(f))return;if((e.allowedOrigins??[]).some((y)=>K(y)===f))return;if(!r&&c!==null&&K(c)===f)return}return{code:"origin_not_allowed",message:`Refusing a request from the origin ${u}.`,hint:r?"This server is bound to loopback, so a page served from anywhere else has no business calling it. Add the origin to server.allowedOrigins if you meant to allow it.":"Only a page served from this server's own host may call it. Add the origin to server.allowedOrigins if you meant to allow it — there is no wildcard, deliberately.",field:"server.allowedOrigins"}}function ct(t,e){let r=t.headers.get("origin");if(r===null)return{};if(X(t,e)!==void 0)return{};return{"access-control-allow-origin":r,vary:"Origin"}}function dt(t,e){let r=t.headers.get("access-control-request-headers");return{"access-control-allow-methods":e.join(", "),"access-control-allow-headers":r??"authorization, content-type","access-control-max-age":"600"}}function me(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.can;return r===void 0||r.includes(e)}function H(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.agents;return r===void 0||r.includes(e)}function Z(t,e){if(t.kind!=="key")return t.kind!=="claim";let r=t.scope?.sessions;if(r===void 0)return!0;return e.startsWith(r.endsWith("*")?r.slice(0,-1):r)}function W(t){if(t.kind==="claim")return{agentIds:[]};if(t.kind!=="key")return{};let e=t.scope?.agents,r=t.scope?.sessions;return{...e===void 0?{}:{agentIds:e},...r===void 0?{}:{sessionPrefix:r.endsWith("*")?r.slice(0,-1):r}}}function $e(t){if(t.kind!=="key")return!1;let e=t.scope;return e!==void 0&&(e.agents!==void 0||e.sessions!==void 0||e.can!==void 0)}class Ue{#e=[];add(t,e,r,c){return this.#e.push({method:t.toUpperCase(),pattern:e,handler:r,capability:c.capability,streaming:c.streaming===!0,segments:ge(e)}),this}routes(){return this.#e.map(({method:t,pattern:e,handler:r,streaming:c,capability:u})=>({method:t,pattern:e,handler:r,streaming:c,capability:u}))}match(t,e){let r=ge(e),c=[];for(let u of this.#e){let f=ft(u.segments,r);if(f===void 0)continue;if(c.push(u),u.method===t.toUpperCase())return{kind:"found",handler:u.handler,params:f,streaming:u.streaming,capability:u.capability}}if(c.length>0)return{kind:"method",allowed:[...new Set(c.map((u)=>u.method))]};return{kind:"none"}}}function ge(t){return t.split("/").filter((e)=>e!=="")}function ft(t,e){if(t.length!==e.length)return;let r={};for(let[c,u]of t.entries()){let f=e[c];if(f===void 0)return;if(u.startsWith(":")){try{r[u.slice(1)]=decodeURIComponent(f)}catch{return}continue}if(u!==f)return}return r}var Fe=15000;function ht(t){let e=[];if(t.event!==void 0)e.push(`event: ${t.event}`);if(t.id!==void 0)e.push(`id: ${t.id}`);let r=typeof t.data==="string"?t.data:JSON.stringify(t.data);for(let c of r.split(`
|
|
3
|
+
`))e.push(`data: ${c}`);return`${e.join(`
|
|
4
|
+
`)}
|
|
5
|
+
|
|
6
|
+
`}function se(t){let e=new TextEncoder,r,c,u=!1,f=new ReadableStream({start(y){let x=()=>{if(u)return;if(u=!0,c!==void 0)clearInterval(c);r?.(),r=void 0;try{y.close()}catch{}},D=(k)=>{if(u)return;try{y.enqueue(e.encode(ht(k)))}catch{x()}};t.signal?.addEventListener("abort",x,{once:!0});let C=t.start({send:D,close:x});if(u){C?.();return}r=C,c=setInterval(()=>{if(u)return;try{y.enqueue(e.encode(`: ping
|
|
7
|
+
|
|
8
|
+
`))}catch{x()}},t.heartbeatMs??Fe),c.unref?.()},cancel(){if(u)return;if(u=!0,c!==void 0)clearInterval(c);r?.(),r=void 0}});return new Response(f,{status:t.status??200,headers:{"content-type":"text/event-stream; charset=utf-8","cache-control":"no-cache, no-transform",connection:"keep-alive","x-accel-buffering":"no"}})}var pt=':root{--ground: #0b0b0c;--raised: #151517;--line: #26262a;--text: #e8e6e3;--dim: #8b8b93;--accent: #7aa2f7;--warn: #e0af68;--bad: #f7768e;--ok: #9ece6a;--mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif}*{box-sizing:border-box}body{margin:0;background:var(--ground);color:var(--text);font:14px / 1.55 var(--sans);-webkit-font-smoothing:antialiased}button{font:inherit;color:inherit;background:var(--raised);border:1px solid var(--line);border-radius:6px;padding:5px 11px;cursor:pointer}button:hover:not(:disabled){border-color:var(--dim)}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--accent);border-color:var(--accent);color:#0b0b0c;font-weight:600}button.bad{color:var(--bad)}input,textarea{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}input:focus,textarea:focus{outline:none;border-color:var(--accent)}.shell{display:grid;grid-template-columns:240px 1fr;height:100vh}.side{background:var(--raised);border-right:1px solid var(--line);display:flex;flex-direction:column;min-height:0}.side header{padding:14px 16px;border-bottom:1px solid var(--line)}.brand{font-weight:650;letter-spacing:.01em}.side nav{padding:8px;overflow-y:auto;flex:1;min-height:0}.side footer{padding:10px 12px;border-top:1px solid var(--line);display:flex;gap:8px;align-items:center}.row-button{display:block;width:100%;text-align:left;background:none;border:none;border-radius:6px;padding:7px 9px;font-family:var(--mono);font-size:12px}.row-button:hover{background:var(--ground)}.row-button[aria-current=true]{background:var(--ground);color:var(--accent)}.group{font-size:11px;text-transform:uppercase;letter-spacing:.08em;color:var(--dim);padding:12px 9px 5px}.main{display:flex;flex-direction:column;min-height:0}.bar{display:flex;gap:14px;align-items:baseline;padding:12px 20px;border-bottom:1px solid var(--line);font-size:12px;color:var(--dim);min-height:44px}.bar strong{color:var(--text);font-size:14px;font-weight:600}.bar .spacer{flex:1}.scroll{flex:1;overflow-y:auto;min-height:0;padding:20px}.pad{max-width:780px;margin:0 auto}.row{margin:0 0 16px;white-space:pre-wrap;overflow-wrap:anywhere}.row.user{background:var(--raised);border:1px solid var(--line);border-radius:8px;padding:10px 13px}.label{font-family:var(--mono);font-size:11px;color:var(--dim);margin-bottom:4px}.tool{border-left:2px solid var(--line);padding-left:11px;font-family:var(--mono);font-size:12px}.tool .slug{color:var(--accent)}.tool .out{color:var(--dim);max-height:13em;overflow-y:auto;margin-top:5px}.tool.failed .slug{color:var(--bad)}.tool .mut{color:var(--warn);font-size:11px}.tool .out{display:inline}.fence{border:1px dashed var(--warn);border-radius:6px;padding:7px 9px;margin-top:5px}.fence .why{color:var(--warn);font-size:11px;margin-bottom:4px}.payload-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:28px;font-weight:600;letter-spacing:.18em;margin:10px 0;-webkit-user-select:all;user-select:all}.channel-input.stale .payload-code{opacity:.35}.payload-qr{display:block;width:240px;max-width:100%;height:auto;border-radius:6px;margin:8px 0}.channel-input.stale .payload-qr{opacity:.35}.note{font-size:12px;color:var(--dim);border-left:2px solid var(--line);padding-left:11px;white-space:pre-wrap}.note.bad{color:var(--bad);border-left-color:var(--bad)}.ask{border:1px solid var(--warn);border-radius:8px;padding:12px 14px;background:#17140e}.ask .what{font-family:var(--mono);font-size:12px;margin:6px 0 10px;white-space:pre-wrap;overflow-wrap:anywhere}.ask .buttons{display:flex;gap:8px}.ask .settled{font-size:12px;color:var(--dim)}details.fold summary{cursor:pointer;color:var(--dim);font-family:var(--mono);font-size:11px}details.fold[open] summary{margin-bottom:5px}details.fold .body{color:var(--dim);font-size:13px}.composer{border-top:1px solid var(--line);padding:12px 20px}.composer .inner{max-width:780px;margin:0 auto;display:flex;gap:9px;align-items:flex-end}.composer textarea{resize:none;min-height:40px;max-height:190px;font-family:var(--sans)}.hint{font-size:11px;color:var(--dim);max-width:780px;margin:6px auto 0}.card{border:1px solid var(--line);border-radius:8px;padding:16px 18px;margin-bottom:14px;background:var(--raised)}.card h2{margin:0 0 4px;font-size:15px}.card p{margin:0 0 12px;color:var(--dim);font-size:13px}table{width:100%;border-collapse:collapse;font-size:13px}th{text-align:left;font-size:11px;text-transform:uppercase;letter-spacing:.07em;color:var(--dim);font-weight:500;padding:0 10px 7px 0}td{padding:8px 10px 8px 0;border-top:1px solid var(--line);font-family:var(--mono);font-size:12px}td.revoked{color:var(--dim);text-decoration:line-through}.secret{font-family:var(--mono);font-size:12px;background:var(--ground);border:1px solid var(--ok);border-radius:6px;padding:9px 11px;overflow-wrap:anywhere;margin-bottom:8px}.gate{display:grid;place-items:center;height:100vh;padding:20px}.gate .card{max-width:460px;width:100%}.dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:var(--dim)}.dot.live{background:var(--ok)}.dot.busy{background:var(--warn)}@media(max-width:720px){.shell{grid-template-columns:1fr}.side{display:none}}.agent-row{display:block}.agent-row .row-button:disabled{color:var(--dim);cursor:default}.agent-off{color:var(--warn);font-size:11px}.agent-note{display:flex;gap:6px;align-items:baseline;padding:0 9px 6px;font-size:11px;color:var(--dim)}.link{background:none;border:none;padding:0;color:var(--accent);font-size:11px;text-decoration:underline;cursor:pointer}.link:disabled{color:var(--dim);cursor:default;text-decoration:none}.empty{color:var(--dim);font-size:13px;max-width:60ch}.panel-table{width:100%;border-collapse:collapse;font-size:12px}.panel-table th{text-align:left;font-weight:500;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--dim);padding:6px 10px 6px 0;border-bottom:1px solid var(--line)}.panel-table td{padding:9px 10px 9px 0;border-bottom:1px solid var(--line);vertical-align:top}.panel-table tr.off td{color:var(--dim)}.sub{color:var(--dim);font-size:11px;margin-top:2px;max-width:52ch}.channel{border:1px solid var(--line);border-radius:8px;padding:12px 14px;margin-bottom:12px}.channel h3{margin:0 0 6px;font-size:13px;font-weight:500}.status{margin:0;font-size:12px}.status-connected{color:var(--ok)}.status-error,.status-disconnected{color:var(--bad)}.status-needs_input{color:var(--warn)}.channel-input{margin-top:10px;padding:10px;border-radius:6px;background:var(--ground)}.payload{margin:0;font-family:var(--mono);font-size:11px;white-space:pre-wrap;word-break:break-all;max-height:9em;overflow-y:auto}.channel-input.stale .payload{opacity:.45}.warn{color:var(--warn);font-size:12px;margin:0 0 6px}select{font:inherit;color:inherit;background:var(--ground);border:1px solid var(--line);border-radius:6px;padding:8px 10px;width:100%}select:focus{outline:none;border-color:var(--accent)}.provision{display:flex;flex-direction:column;gap:16px;max-width:60ch}.provision>button[type=submit]{align-self:flex-start}.field label{display:block;font-size:12px;color:var(--dim);margin-bottom:5px}.field.invalid input,.field.invalid select{border-color:var(--bad)}.sub{color:var(--dim);font-size:11px}.error{color:var(--bad);font-size:13px;max-width:60ch}.ok{color:var(--ok);font-size:13px}.created{max-width:66ch;font-size:13px}.created h3{font-size:15px;font-weight:600;margin:0 0 10px}.created p{margin:0 0 10px}.blank-secrets{border:1px solid var(--warn);border-radius:6px;padding:11px 13px;margin:14px 0}.blank-secrets p{margin:0 0 6px}.blank-secrets p:last-child{margin:0}.config-row{border-bottom:1px solid var(--line);padding:14px 0;max-width:72ch}.config-row:first-of-type{padding-top:0}.config-head{display:flex;align-items:baseline;gap:8px}.config-row .sub{margin:4px 0 8px;max-width:68ch}.config-row input[type=text],.config-row input:not([type]),.config-row textarea{width:100%;font-family:var(--mono);font-size:12px}.config-row button{margin-top:8px}.config-row label input[type=checkbox]{width:auto;margin-right:4px;vertical-align:baseline}.form-grid{display:grid;grid-template-columns:6em 1fr;gap:8px 12px;align-items:start;max-width:60ch}.form-grid label{font-size:12px;color:var(--dim);padding-top:9px}.form-grid input,.form-grid select{width:100%}.form-grid>div>input+input{margin-top:6px}.warnings{border:1px solid var(--warn);border-radius:6px;padding:.75rem 1rem;margin-bottom:1rem}.warnings h3{margin:0;color:var(--warn)}.warnings .sub{margin:.25rem 0 .75rem;opacity:.8}.warning{margin-top:.5rem}.warning-message{margin:0}.warning .hint{margin:.15rem 0 0;opacity:.75}.channel-actions{display:flex;flex-wrap:wrap;gap:.5rem;align-items:center;margin-top:.5rem}.channel-actions form{display:flex;gap:.35rem}.channel-actions input{min-width:14rem}.status-off{opacity:.7}\n',mt=`(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))s(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const v of h.addedNodes)v.tagName==="LINK"&&v.rel==="modulepreload"&&s(v)}).observe(document,{childList:!0,subtree:!0});function r(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function s(d){if(d.ep)return;d.ep=!0;const h=r(d);fetch(d.href,h)}})();function Lg(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Us={exports:{}},Za={};var bh;function Gg(){if(bh)return Za;bh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(s,d,h){var v=null;if(h!==void 0&&(v=""+h),d.key!==void 0&&(v=""+d.key),"key"in d){h={};for(var A in d)A!=="key"&&(h[A]=d[A])}else h=d;return d=h.ref,{$$typeof:i,type:s,key:v,ref:d!==void 0?d:null,props:h}}return Za.Fragment=c,Za.jsx=r,Za.jsxs=r,Za}var Sh;function Qg(){return Sh||(Sh=1,Us.exports=Gg()),Us.exports}var m=Qg(),Rs={exports:{}},oe={};var ph;function Xg(){if(ph)return oe;ph=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),v=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),j=Symbol.iterator;function B(b){return b===null||typeof b!="object"?null:(b=j&&b[j]||b["@@iterator"],typeof b=="function"?b:null)}var X={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,fe={};function L(b,U,Q){this.props=b,this.context=U,this.refs=fe,this.updater=Q||X}L.prototype.isReactComponent={},L.prototype.setState=function(b,U){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,U,"setState")},L.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function ce(){}ce.prototype=L.prototype;function I(b,U,Q){this.props=b,this.context=U,this.refs=fe,this.updater=Q||X}var $=I.prototype=new ce;$.constructor=I,D($,L.prototype),$.isPureReactComponent=!0;var Ae=Array.isArray;function Z(){}var Y={H:null,A:null,T:null,S:null},K=Object.prototype.hasOwnProperty;function V(b,U,Q){var W=Q.ref;return{$$typeof:i,type:b,key:U,ref:W!==void 0?W:null,props:Q}}function ne(b,U){return V(b.type,U,b.props)}function q(b){return typeof b=="object"&&b!==null&&b.$$typeof===i}function F(b){var U={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(Q){return U[Q]})}var ee=/\\/+/g;function ue(b,U){return typeof b=="object"&&b!==null&&b.key!=null?F(""+b.key):U.toString(36)}function Ye(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(Z,Z):(b.status="pending",b.then(function(U){b.status==="pending"&&(b.status="fulfilled",b.value=U)},function(U){b.status==="pending"&&(b.status="rejected",b.reason=U)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function M(b,U,Q,W,se){var re=typeof b;(re==="undefined"||re==="boolean")&&(b=null);var de=!1;if(b===null)de=!0;else switch(re){case"bigint":case"string":case"number":de=!0;break;case"object":switch(b.$$typeof){case i:case c:de=!0;break;case N:return de=b._init,M(de(b._payload),U,Q,W,se)}}if(de)return se=se(b),de=W===""?"."+ue(b,0):W,Ae(se)?(Q="",de!=null&&(Q=de.replace(ee,"$&/")+"/"),M(se,U,Q,"",function(nt){return nt})):se!=null&&(q(se)&&(se=ne(se,Q+(se.key==null||b&&b.key===se.key?"":(""+se.key).replace(ee,"$&/")+"/")+de)),U.push(se)),1;de=0;var Me=W===""?".":W+":";if(Ae(b))for(var Ne=0;Ne<b.length;Ne++)W=b[Ne],re=Me+ue(W,Ne),de+=M(W,U,Q,re,se);else if(Ne=B(b),typeof Ne=="function")for(b=Ne.call(b),Ne=0;!(W=b.next()).done;)W=W.value,re=Me+ue(W,Ne++),de+=M(W,U,Q,re,se);else if(re==="object"){if(typeof b.then=="function")return M(Ye(b),U,Q,W,se);throw U=String(b),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return de}function G(b,U,Q){if(b==null)return b;var W=[],se=0;return M(b,W,"","",function(re){return U.call(Q,re,se++)}),W}function ae(b){if(b._status===-1){var U=b._result;U=U(),U.then(function(Q){(b._status===0||b._status===-1)&&(b._status=1,b._result=Q)},function(Q){(b._status===0||b._status===-1)&&(b._status=2,b._result=Q)}),b._status===-1&&(b._status=0,b._result=U)}if(b._status===1)return b._result.default;throw b._result}var Te=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)},be={map:G,forEach:function(b,U,Q){G(b,function(){U.apply(this,arguments)},Q)},count:function(b){var U=0;return G(b,function(){U++}),U},toArray:function(b){return G(b,function(U){return U})||[]},only:function(b){if(!q(b))throw Error("React.Children.only expected to receive a single React element child.");return b}};return oe.Activity=E,oe.Children=be,oe.Component=L,oe.Fragment=r,oe.Profiler=d,oe.PureComponent=I,oe.StrictMode=s,oe.Suspense=p,oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,oe.__COMPILER_RUNTIME={__proto__:null,c:function(b){return Y.H.useMemoCache(b)}},oe.cache=function(b){return function(){return b.apply(null,arguments)}},oe.cacheSignal=function(){return null},oe.cloneElement=function(b,U,Q){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var W=D({},b.props),se=b.key;if(U!=null)for(re in U.key!==void 0&&(se=""+U.key),U)!K.call(U,re)||re==="key"||re==="__self"||re==="__source"||re==="ref"&&U.ref===void 0||(W[re]=U[re]);var re=arguments.length-2;if(re===1)W.children=Q;else if(1<re){for(var de=Array(re),Me=0;Me<re;Me++)de[Me]=arguments[Me+2];W.children=de}return V(b.type,se,W)},oe.createContext=function(b){return b={$$typeof:v,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:h,_context:b},b},oe.createElement=function(b,U,Q){var W,se={},re=null;if(U!=null)for(W in U.key!==void 0&&(re=""+U.key),U)K.call(U,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(se[W]=U[W]);var de=arguments.length-2;if(de===1)se.children=Q;else if(1<de){for(var Me=Array(de),Ne=0;Ne<de;Ne++)Me[Ne]=arguments[Ne+2];se.children=Me}if(b&&b.defaultProps)for(W in de=b.defaultProps,de)se[W]===void 0&&(se[W]=de[W]);return V(b,re,se)},oe.createRef=function(){return{current:null}},oe.forwardRef=function(b){return{$$typeof:A,render:b}},oe.isValidElement=q,oe.lazy=function(b){return{$$typeof:N,_payload:{_status:-1,_result:b},_init:ae}},oe.memo=function(b,U){return{$$typeof:g,type:b,compare:U===void 0?null:U}},oe.startTransition=function(b){var U=Y.T,Q={};Y.T=Q;try{var W=b(),se=Y.S;se!==null&&se(Q,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(Z,Te)}catch(re){Te(re)}finally{U!==null&&Q.types!==null&&(U.types=Q.types),Y.T=U}},oe.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},oe.use=function(b){return Y.H.use(b)},oe.useActionState=function(b,U,Q){return Y.H.useActionState(b,U,Q)},oe.useCallback=function(b,U){return Y.H.useCallback(b,U)},oe.useContext=function(b){return Y.H.useContext(b)},oe.useDebugValue=function(){},oe.useDeferredValue=function(b,U){return Y.H.useDeferredValue(b,U)},oe.useEffect=function(b,U){return Y.H.useEffect(b,U)},oe.useEffectEvent=function(b){return Y.H.useEffectEvent(b)},oe.useId=function(){return Y.H.useId()},oe.useImperativeHandle=function(b,U,Q){return Y.H.useImperativeHandle(b,U,Q)},oe.useInsertionEffect=function(b,U){return Y.H.useInsertionEffect(b,U)},oe.useLayoutEffect=function(b,U){return Y.H.useLayoutEffect(b,U)},oe.useMemo=function(b,U){return Y.H.useMemo(b,U)},oe.useOptimistic=function(b,U){return Y.H.useOptimistic(b,U)},oe.useReducer=function(b,U,Q){return Y.H.useReducer(b,U,Q)},oe.useRef=function(b){return Y.H.useRef(b)},oe.useState=function(b){return Y.H.useState(b)},oe.useSyncExternalStore=function(b,U,Q){return Y.H.useSyncExternalStore(b,U,Q)},oe.useTransition=function(){return Y.H.useTransition()},oe.version="19.2.8",oe}var Eh;function yf(){return Eh||(Eh=1,Rs.exports=Xg()),Rs.exports}var k=yf(),Os={exports:{}},Va={},Ds={exports:{}},Bs={};var Th;function Kg(){return Th||(Th=1,(function(i){function c(M,G){var ae=M.length;M.push(G);e:for(;0<ae;){var Te=ae-1>>>1,be=M[Te];if(0<d(be,G))M[Te]=G,M[ae]=be,ae=Te;else break e}}function r(M){return M.length===0?null:M[0]}function s(M){if(M.length===0)return null;var G=M[0],ae=M.pop();if(ae!==G){M[0]=ae;e:for(var Te=0,be=M.length,b=be>>>1;Te<b;){var U=2*(Te+1)-1,Q=M[U],W=U+1,se=M[W];if(0>d(Q,ae))W<be&&0>d(se,Q)?(M[Te]=se,M[W]=ae,Te=W):(M[Te]=Q,M[U]=ae,Te=U);else if(W<be&&0>d(se,ae))M[Te]=se,M[W]=ae,Te=W;else break e}}return G}function d(M,G){var ae=M.sortIndex-G.sortIndex;return ae!==0?ae:M.id-G.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;i.unstable_now=function(){return h.now()}}else{var v=Date,A=v.now();i.unstable_now=function(){return v.now()-A}}var p=[],g=[],N=1,E=null,j=3,B=!1,X=!1,D=!1,fe=!1,L=typeof setTimeout=="function"?setTimeout:null,ce=typeof clearTimeout=="function"?clearTimeout:null,I=typeof setImmediate<"u"?setImmediate:null;function $(M){for(var G=r(g);G!==null;){if(G.callback===null)s(g);else if(G.startTime<=M)s(g),G.sortIndex=G.expirationTime,c(p,G);else break;G=r(g)}}function Ae(M){if(D=!1,$(M),!X)if(r(p)!==null)X=!0,Z||(Z=!0,F());else{var G=r(g);G!==null&&Ye(Ae,G.startTime-M)}}var Z=!1,Y=-1,K=5,V=-1;function ne(){return fe?!0:!(i.unstable_now()-V<K)}function q(){if(fe=!1,Z){var M=i.unstable_now();V=M;var G=!0;try{e:{X=!1,D&&(D=!1,ce(Y),Y=-1),B=!0;var ae=j;try{t:{for($(M),E=r(p);E!==null&&!(E.expirationTime>M&&ne());){var Te=E.callback;if(typeof Te=="function"){E.callback=null,j=E.priorityLevel;var be=Te(E.expirationTime<=M);if(M=i.unstable_now(),typeof be=="function"){E.callback=be,$(M),G=!0;break t}E===r(p)&&s(p),$(M)}else s(p);E=r(p)}if(E!==null)G=!0;else{var b=r(g);b!==null&&Ye(Ae,b.startTime-M),G=!1}}break e}finally{E=null,j=ae,B=!1}G=void 0}}finally{G?F():Z=!1}}}var F;if(typeof I=="function")F=function(){I(q)};else if(typeof MessageChannel<"u"){var ee=new MessageChannel,ue=ee.port2;ee.port1.onmessage=q,F=function(){ue.postMessage(null)}}else F=function(){L(q,0)};function Ye(M,G){Y=L(function(){M(i.unstable_now())},G)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(M){M.callback=null},i.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):K=0<M?Math.floor(1e3/M):5},i.unstable_getCurrentPriorityLevel=function(){return j},i.unstable_next=function(M){switch(j){case 1:case 2:case 3:var G=3;break;default:G=j}var ae=j;j=G;try{return M()}finally{j=ae}},i.unstable_requestPaint=function(){fe=!0},i.unstable_runWithPriority=function(M,G){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var ae=j;j=M;try{return G()}finally{j=ae}},i.unstable_scheduleCallback=function(M,G,ae){var Te=i.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?Te+ae:Te):ae=Te,M){case 1:var be=-1;break;case 2:be=250;break;case 5:be=1073741823;break;case 4:be=1e4;break;default:be=5e3}return be=ae+be,M={id:N++,callback:G,priorityLevel:M,startTime:ae,expirationTime:be,sortIndex:-1},ae>Te?(M.sortIndex=ae,c(g,M),r(p)===null&&M===r(g)&&(D?(ce(Y),Y=-1):D=!0,Ye(Ae,ae-Te))):(M.sortIndex=be,c(p,M),X||B||(X=!0,Z||(Z=!0,F()))),M},i.unstable_shouldYield=ne,i.unstable_wrapCallback=function(M){var G=j;return function(){var ae=j;j=G;try{return M.apply(this,arguments)}finally{j=ae}}}})(Bs)),Bs}var Ah;function Zg(){return Ah||(Ah=1,Ds.exports=Kg()),Ds.exports}var Hs={exports:{}},at={};var zh;function Vg(){if(zh)return at;zh=1;var i=yf();function c(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)g+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var s={d:{f:r,r:function(){throw Error(c(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(p,g,N){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:""+E,children:p,containerInfo:g,implementation:N}}var v=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function A(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return at.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,at.createPortal=function(p,g){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return h(p,g,null,N)},at.flushSync=function(p){var g=v.T,N=s.p;try{if(v.T=null,s.p=2,p)return p()}finally{v.T=g,s.p=N,s.d.f()}},at.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,s.d.C(p,g))},at.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},at.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var N=g.as,E=A(N,g.crossOrigin),j=typeof g.integrity=="string"?g.integrity:void 0,B=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;N==="style"?s.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:E,integrity:j,fetchPriority:B}):N==="script"&&s.d.X(p,{crossOrigin:E,integrity:j,fetchPriority:B,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},at.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var N=A(g.as,g.crossOrigin);s.d.M(p,{crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&s.d.M(p)},at.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var N=g.as,E=A(N,g.crossOrigin);s.d.L(p,N,{crossOrigin:E,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},at.preloadModule=function(p,g){if(typeof p=="string")if(g){var N=A(g.as,g.crossOrigin);s.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:N,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else s.d.m(p)},at.requestFormReset=function(p){s.d.r(p)},at.unstable_batchedUpdates=function(p,g){return p(g)},at.useFormState=function(p,g,N){return v.H.useFormState(p,g,N)},at.useFormStatus=function(){return v.H.useHostTransitionStatus()},at.version="19.2.8",at}var Ch;function kg(){if(Ch)return Hs.exports;Ch=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Hs.exports=Vg(),Hs.exports}var Nh;function Jg(){if(Nh)return Va;Nh=1;var i=Zg(),c=yf(),r=kg();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function v(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function A(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(h(e)!==e)throw Error(s(188))}function g(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(s(188));return t!==e?null:e}for(var n=e,l=t;;){var a=n.return;if(a===null)break;var u=a.alternate;if(u===null){if(l=a.return,l!==null){n=l;continue}break}if(a.child===u.child){for(u=a.child;u;){if(u===n)return p(a),e;if(u===l)return p(a),t;u=u.sibling}throw Error(s(188))}if(n.return!==l.return)n=a,l=u;else{for(var f=!1,o=a.child;o;){if(o===n){f=!0,n=a,l=u;break}if(o===l){f=!0,l=a,n=u;break}o=o.sibling}if(!f){for(o=u.child;o;){if(o===n){f=!0,n=u,l=a;break}if(o===l){f=!0,l=u,n=a;break}o=o.sibling}if(!f)throw Error(s(189))}}if(n.alternate!==l)throw Error(s(190))}if(n.tag!==3)throw Error(s(188));return n.stateNode.current===n?e:t}function N(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=N(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,j=Symbol.for("react.element"),B=Symbol.for("react.transitional.element"),X=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),fe=Symbol.for("react.strict_mode"),L=Symbol.for("react.profiler"),ce=Symbol.for("react.consumer"),I=Symbol.for("react.context"),$=Symbol.for("react.forward_ref"),Ae=Symbol.for("react.suspense"),Z=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),K=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),ne=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(e){return e===null||typeof e!="object"?null:(e=q&&e[q]||e["@@iterator"],typeof e=="function"?e:null)}var ee=Symbol.for("react.client.reference");function ue(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ee?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case D:return"Fragment";case L:return"Profiler";case fe:return"StrictMode";case Ae:return"Suspense";case Z:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case X:return"Portal";case I:return e.displayName||"Context";case ce:return(e._context.displayName||"Context")+".Consumer";case $:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:ue(e.type)||"Memo";case K:t=e._payload,e=e._init;try{return ue(e(t))}catch{}}return null}var Ye=Array.isArray,M=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},Te=[],be=-1;function b(e){return{current:e}}function U(e){0>be||(e.current=Te[be],Te[be]=null,be--)}function Q(e,t){be++,Te[be]=e.current,e.current=t}var W=b(null),se=b(null),re=b(null),de=b(null);function Me(e,t){switch(Q(re,t),Q(se,e),Q(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Gd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Gd(t),e=Qd(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(W),Q(W,e)}function Ne(){U(W),U(se),U(re)}function nt(e){e.memoizedState!==null&&Q(de,e);var t=W.current,n=Qd(t,e.type);t!==n&&(Q(se,e),Q(W,n))}function al(e){se.current===e&&(U(W),U(se)),de.current===e&&(U(de),Ga._currentValue=ae)}var At,Fl;function zt(e){if(At===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\\n( *(at )?)/);At=t&&t[1]||"",Fl=-1<n.stack.indexOf(\`
|
|
9
|
+
at\`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return\`
|
|
10
|
+
\`+At+e+Fl}var ul=!1;function Wl(e,t){if(!e||ul)return"";ul=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(_){var x=_}Reflect.construct(e,[],O)}else{try{O.call()}catch(_){x=_}e.call(O.prototype)}}else{try{throw Error()}catch(_){x=_}(O=e())&&typeof O.catch=="function"&&O.catch(function(){})}}catch(_){if(_&&x&&typeof _.stack=="string")return[_.stack,x.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var a=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");a&&a.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=l.DetermineComponentFrameRoot(),f=u[0],o=u[1];if(f&&o){var y=f.split(\`
|
|
11
|
+
\`),C=o.split(\`
|
|
12
|
+
\`);for(a=l=0;l<y.length&&!y[l].includes("DetermineComponentFrameRoot");)l++;for(;a<C.length&&!C[a].includes("DetermineComponentFrameRoot");)a++;if(l===y.length||a===C.length)for(l=y.length-1,a=C.length-1;1<=l&&0<=a&&y[l]!==C[a];)a--;for(;1<=l&&0<=a;l--,a--)if(y[l]!==C[a]){if(l!==1||a!==1)do if(l--,a--,0>a||y[l]!==C[a]){var w=\`
|
|
13
|
+
\`+y[l].replace(" at new "," at ");return e.displayName&&w.includes("<anonymous>")&&(w=w.replace("<anonymous>",e.displayName)),w}while(1<=l&&0<=a);break}}}finally{ul=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?zt(n):""}function Wa(e,t){switch(e.tag){case 26:case 27:case 5:return zt(e.type);case 16:return zt("Lazy");case 13:return e.child!==t&&t!==null?zt("Suspense Fallback"):zt("Suspense");case 19:return zt("SuspenseList");case 0:case 15:return Wl(e.type,!1);case 11:return Wl(e.type.render,!1);case 1:return Wl(e.type,!0);case 31:return zt("Activity");default:return""}}function Ia(e){try{var t="",n=null;do t+=Wa(e,n),n=e,e=e.return;while(e);return t}catch(l){return\`
|
|
14
|
+
Error generating stack: \`+l.message+\`
|
|
15
|
+
\`+l.stack}}var il=Object.prototype.hasOwnProperty,cl=i.unstable_scheduleCallback,sl=i.unstable_cancelCallback,Si=i.unstable_shouldYield,fl=i.unstable_requestPaint,ut=i.unstable_now,H=i.unstable_getCurrentPriorityLevel,J=i.unstable_ImmediatePriority,he=i.unstable_UserBlockingPriority,De=i.unstable_NormalPriority,lt=i.unstable_LowPriority,rl=i.unstable_IdlePriority,Il=i.log,A0=i.unstable_setDisableYieldValue,Pl=null,mt=null;function on(e){if(typeof Il=="function"&&A0(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Pl,e)}catch{}}var gt=Math.clz32?Math.clz32:N0,z0=Math.log,C0=Math.LN2;function N0(e){return e>>>=0,e===0?32:31-(z0(e)/C0|0)|0}var Pa=256,eu=262144,tu=4194304;function Hn(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&261888;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 nu(e,t,n){var l=e.pendingLanes;if(l===0)return 0;var a=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var o=l&134217727;return o!==0?(l=o&~u,l!==0?a=Hn(l):(f&=o,f!==0?a=Hn(f):n||(n=o&~e,n!==0&&(a=Hn(n))))):(o=l&~u,o!==0?a=Hn(o):f!==0?a=Hn(f):n||(n=l&~e,n!==0&&(a=Hn(n)))),a===0?0:t!==0&&t!==a&&(t&u)===0&&(u=a&-a,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:a}function ea(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function j0(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 Ef(){var e=tu;return tu<<=1,(tu&62914560)===0&&(tu=4194304),e}function pi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ta(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function x0(e,t,n,l,a,u){var f=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 o=e.entanglements,y=e.expirationTimes,C=e.hiddenUpdates;for(n=f&~n;0<n;){var w=31-gt(n),O=1<<w;o[w]=0,y[w]=-1;var x=C[w];if(x!==null)for(C[w]=null,w=0;w<x.length;w++){var _=x[w];_!==null&&(_.lane&=-536870913)}n&=~O}l!==0&&Tf(e,l,0),u!==0&&a===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function Tf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-gt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|n&261930}function Af(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var l=31-gt(n),a=1<<l;a&t|e[l]&t&&(e[l]|=t),n&=~a}}function zf(e,t){var n=t&-t;return n=(n&42)!==0?1:Ei(n),(n&(e.suspendedLanes|t))!==0?0:n}function Ei(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 Ti(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Cf(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:oh(e.type))}function Nf(e,t){var n=G.p;try{return G.p=e,t()}finally{G.p=n}}var dn=Math.random().toString(36).slice(2),We="__reactFiber$"+dn,ct="__reactProps$"+dn,ol="__reactContainer$"+dn,Ai="__reactEvents$"+dn,_0="__reactListeners$"+dn,M0="__reactHandles$"+dn,jf="__reactResources$"+dn,na="__reactMarker$"+dn;function zi(e){delete e[We],delete e[ct],delete e[Ai],delete e[_0],delete e[M0]}function dl(e){var t=e[We];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ol]||n[We]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=$d(e);e!==null;){if(n=e[We])return n;e=$d(e)}return t}e=n,n=e.parentNode}return null}function hl(e){if(e=e[We]||e[ol]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function la(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function ml(e){var t=e[jf];return t||(t=e[jf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function $e(e){e[na]=!0}var xf=new Set,_f={};function qn(e,t){gl(e,t),gl(e+"Capture",t)}function gl(e,t){for(_f[e]=t,e=0;e<t.length;e++)xf.add(t[e])}var w0=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]*$"),Mf={},wf={};function U0(e){return il.call(wf,e)?!0:il.call(Mf,e)?!1:w0.test(e)?wf[e]=!0:(Mf[e]=!0,!1)}function lu(e,t,n){if(U0(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function au(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 Vt(e,t,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+l)}}function Ct(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Uf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function R0(e,t,n){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var a=l.get,u=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(f){n=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ci(e){if(!e._valueTracker){var t=Uf(e)?"checked":"value";e._valueTracker=R0(e,t,""+e[t])}}function Rf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),l="";return e&&(l=Uf(e)?e.checked?"true":"false":e.value),e=l,e!==n?(t.setValue(e),!0):!1}function uu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var O0=/[\\n"\\\\]/g;function Nt(e){return e.replace(O0,function(t){return"\\\\"+t.charCodeAt(0).toString(16)+" "})}function Ni(e,t,n,l,a,u,f,o){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Ct(t)):e.value!==""+Ct(t)&&(e.value=""+Ct(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?ji(e,f,Ct(t)):n!=null?ji(e,f,Ct(n)):l!=null&&e.removeAttribute("value"),a==null&&u!=null&&(e.defaultChecked=!!u),a!=null&&(e.checked=a&&typeof a!="function"&&typeof a!="symbol"),o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"?e.name=""+Ct(o):e.removeAttribute("name")}function Of(e,t,n,l,a,u,f,o){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){Ci(e);return}n=n!=null?""+Ct(n):"",t=t!=null?""+Ct(t):n,o||t===e.value||(e.value=t),e.defaultValue=t}l=l??a,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=o?e.checked:!!l,e.defaultChecked=!!l,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Ci(e)}function ji(e,t,n){t==="number"&&uu(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function yl(e,t,n,l){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&l&&(e[n].defaultSelected=!0)}else{for(n=""+Ct(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,l&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function Df(e,t,n){if(t!=null&&(t=""+Ct(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+Ct(n):""}function Bf(e,t,n,l){if(t==null){if(l!=null){if(n!=null)throw Error(s(92));if(Ye(l)){if(1<l.length)throw Error(s(93));l=l[0]}n=l}n==null&&(n=""),t=n}n=Ct(t),e.defaultValue=n,l=e.textContent,l===n&&l!==""&&l!==null&&(e.value=l),Ci(e)}function vl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var D0=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 Hf(e,t,n){var l=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,n):typeof n!="number"||n===0||D0.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function qf(e,t,n){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,n!=null){for(var l in n)!n.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var a in t)l=t[a],t.hasOwnProperty(a)&&n[a]!==l&&Hf(e,a,l)}else for(var u in t)t.hasOwnProperty(u)&&Hf(e,u,t[u])}function xi(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 B0=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"],["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"]]),H0=/^[\\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 iu(e){return H0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function kt(){}var _i=null;function Mi(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bl=null,Sl=null;function Yf(e){var t=hl(e);if(t&&(e=t.stateNode)){var n=e[ct]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ni(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="'+Nt(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var l=n[t];if(l!==e&&l.form===e.form){var a=l[ct]||null;if(!a)throw Error(s(90));Ni(l,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)l=n[t],l.form===e.form&&Rf(l)}break e;case"textarea":Df(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&yl(e,!!n.multiple,t,!1)}}}var wi=!1;function Lf(e,t,n){if(wi)return e(t,n);wi=!0;try{var l=e(t);return l}finally{if(wi=!1,(bl!==null||Sl!==null)&&(ku(),bl&&(t=bl,e=Sl,Sl=bl=null,Yf(t),e)))for(t=0;t<e.length;t++)Yf(e[t])}}function aa(e,t){var n=e.stateNode;if(n===null)return null;var l=n[ct]||null;if(l===null)return null;n=l[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(s(231,t,typeof n));return n}var Jt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ui=!1;if(Jt)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){Ui=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{Ui=!1}var hn=null,Ri=null,cu=null;function Gf(){if(cu)return cu;var e,t=Ri,n=t.length,l,a="value"in hn?hn.value:hn.textContent,u=a.length;for(e=0;e<n&&t[e]===a[e];e++);var f=n-e;for(l=1;l<=f&&t[n-l]===a[u-l];l++);return cu=a.slice(e,1<l?1-l:void 0)}function su(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 fu(){return!0}function Qf(){return!1}function st(e){function t(n,l,a,u,f){this._reactName=n,this._targetInst=a,this.type=l,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var o in e)e.hasOwnProperty(o)&&(n=e[o],this[o]=n?n(u):u[o]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?fu:Qf,this.isPropagationStopped=Qf,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=fu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=fu)},persist:function(){},isPersistent:fu}),t}var Yn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ru=st(Yn),ia=E({},Yn,{view:0,detail:0}),q0=st(ia),Oi,Di,ca,ou=E({},ia,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hi,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!==ca&&(ca&&e.type==="mousemove"?(Oi=e.screenX-ca.screenX,Di=e.screenY-ca.screenY):Di=Oi=0,ca=e),Oi)},movementY:function(e){return"movementY"in e?e.movementY:Di}}),Xf=st(ou),Y0=E({},ou,{dataTransfer:0}),L0=st(Y0),G0=E({},ia,{relatedTarget:0}),Bi=st(G0),Q0=E({},Yn,{animationName:0,elapsedTime:0,pseudoElement:0}),X0=st(Q0),K0=E({},Yn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Z0=st(K0),V0=E({},Yn,{data:0}),Kf=st(V0),k0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},J0={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"},$0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F0(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=$0[e])?!!t[e]:!1}function Hi(){return F0}var W0=E({},ia,{key:function(e){if(e.key){var t=k0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=su(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?J0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hi,charCode:function(e){return e.type==="keypress"?su(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?su(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),I0=st(W0),P0=E({},ou,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Zf=st(P0),em=E({},ia,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hi}),tm=st(em),nm=E({},Yn,{propertyName:0,elapsedTime:0,pseudoElement:0}),lm=st(nm),am=E({},ou,{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}),um=st(am),im=E({},Yn,{newState:0,oldState:0}),cm=st(im),sm=[9,13,27,32],qi=Jt&&"CompositionEvent"in window,sa=null;Jt&&"documentMode"in document&&(sa=document.documentMode);var fm=Jt&&"TextEvent"in window&&!sa,Vf=Jt&&(!qi||sa&&8<sa&&11>=sa),kf=" ",Jf=!1;function $f(e,t){switch(e){case"keyup":return sm.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ff(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pl=!1;function rm(e,t){switch(e){case"compositionend":return Ff(t);case"keypress":return t.which!==32?null:(Jf=!0,kf);case"textInput":return e=t.data,e===kf&&Jf?null:e;default:return null}}function om(e,t){if(pl)return e==="compositionend"||!qi&&$f(e,t)?(e=Gf(),cu=Ri=hn=null,pl=!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 Vf&&t.locale!=="ko"?null:t.data;default:return null}}var dm={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 Wf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!dm[e.type]:t==="textarea"}function If(e,t,n,l){bl?Sl?Sl.push(l):Sl=[l]:bl=l,t=ei(t,"onChange"),0<t.length&&(n=new ru("onChange","change",null,n,l),e.push({event:n,listeners:t}))}var fa=null,ra=null;function hm(e){Dd(e,0)}function du(e){var t=la(e);if(Rf(t))return e}function Pf(e,t){if(e==="change")return t}var er=!1;if(Jt){var Yi;if(Jt){var Li="oninput"in document;if(!Li){var tr=document.createElement("div");tr.setAttribute("oninput","return;"),Li=typeof tr.oninput=="function"}Yi=Li}else Yi=!1;er=Yi&&(!document.documentMode||9<document.documentMode)}function nr(){fa&&(fa.detachEvent("onpropertychange",lr),ra=fa=null)}function lr(e){if(e.propertyName==="value"&&du(ra)){var t=[];If(t,ra,e,Mi(e)),Lf(hm,t)}}function mm(e,t,n){e==="focusin"?(nr(),fa=t,ra=n,fa.attachEvent("onpropertychange",lr)):e==="focusout"&&nr()}function gm(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return du(ra)}function ym(e,t){if(e==="click")return du(t)}function vm(e,t){if(e==="input"||e==="change")return du(t)}function bm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var yt=typeof Object.is=="function"?Object.is:bm;function oa(e,t){if(yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),l=Object.keys(t);if(n.length!==l.length)return!1;for(l=0;l<n.length;l++){var a=n[l];if(!il.call(t,a)||!yt(e[a],t[a]))return!1}return!0}function ar(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ur(e,t){var n=ar(e);e=0;for(var l;n;){if(n.nodeType===3){if(l=e+n.textContent.length,e<=t&&l>=t)return{node:n,offset:t-e};e=l}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ar(n)}}function ir(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ir(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function cr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=uu(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=uu(e.document)}return t}function Gi(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 Sm=Jt&&"documentMode"in document&&11>=document.documentMode,El=null,Qi=null,da=null,Xi=!1;function sr(e,t,n){var l=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Xi||El==null||El!==uu(l)||(l=El,"selectionStart"in l&&Gi(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),da&&oa(da,l)||(da=l,l=ei(Qi,"onSelect"),0<l.length&&(t=new ru("onSelect","select",null,t,n),e.push({event:t,listeners:l}),t.target=El)))}function Ln(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Tl={animationend:Ln("Animation","AnimationEnd"),animationiteration:Ln("Animation","AnimationIteration"),animationstart:Ln("Animation","AnimationStart"),transitionrun:Ln("Transition","TransitionRun"),transitionstart:Ln("Transition","TransitionStart"),transitioncancel:Ln("Transition","TransitionCancel"),transitionend:Ln("Transition","TransitionEnd")},Ki={},fr={};Jt&&(fr=document.createElement("div").style,"AnimationEvent"in window||(delete Tl.animationend.animation,delete Tl.animationiteration.animation,delete Tl.animationstart.animation),"TransitionEvent"in window||delete Tl.transitionend.transition);function Gn(e){if(Ki[e])return Ki[e];if(!Tl[e])return e;var t=Tl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in fr)return Ki[e]=t[n];return e}var rr=Gn("animationend"),or=Gn("animationiteration"),dr=Gn("animationstart"),pm=Gn("transitionrun"),Em=Gn("transitionstart"),Tm=Gn("transitioncancel"),hr=Gn("transitionend"),mr=new Map,Zi="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error 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(" ");Zi.push("scrollEnd");function Dt(e,t){mr.set(e,t),qn(t,[e])}var hu=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!==null&&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)},jt=[],Al=0,Vi=0;function mu(){for(var e=Al,t=Vi=Al=0;t<e;){var n=jt[t];jt[t++]=null;var l=jt[t];jt[t++]=null;var a=jt[t];jt[t++]=null;var u=jt[t];if(jt[t++]=null,l!==null&&a!==null){var f=l.pending;f===null?a.next=a:(a.next=f.next,f.next=a),l.pending=a}u!==0&&gr(n,a,u)}}function gu(e,t,n,l){jt[Al++]=e,jt[Al++]=t,jt[Al++]=n,jt[Al++]=l,Vi|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function ki(e,t,n,l){return gu(e,t,n,l),yu(e)}function Qn(e,t){return gu(e,null,null,t),yu(e)}function gr(e,t,n){e.lanes|=n;var l=e.alternate;l!==null&&(l.lanes|=n);for(var a=!1,u=e.return;u!==null;)u.childLanes|=n,l=u.alternate,l!==null&&(l.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(a=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,a&&t!==null&&(a=31-gt(n),e=u.hiddenUpdates,l=e[a],l===null?e[a]=[t]:l.push(t),t.lane=n|536870912),u):null}function yu(e){if(50<Oa)throw Oa=0,ns=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zl={};function Am(e,t,n,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,t,n,l){return new Am(e,t,n,l)}function Ji(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $t(e,t){var n=e.alternate;return n===null?(n=vt(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&65011712,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 yr(e,t){e.flags&=65011714;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 vu(e,t,n,l,a,u){var f=0;if(l=e,typeof e=="function")Ji(e)&&(f=1);else if(typeof e=="string")f=xg(e,n,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=vt(31,n,t,a),e.elementType=V,e.lanes=u,e;case D:return Xn(n.children,a,u,t);case fe:f=8,a|=24;break;case L:return e=vt(12,n,t,a|2),e.elementType=L,e.lanes=u,e;case Ae:return e=vt(13,n,t,a),e.elementType=Ae,e.lanes=u,e;case Z:return e=vt(19,n,t,a),e.elementType=Z,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case I:f=10;break e;case ce:f=9;break e;case $:f=11;break e;case Y:f=14;break e;case K:f=16,l=null;break e}f=29,n=Error(s(130,e===null?"null":typeof e,"")),l=null}return t=vt(f,n,t,a),t.elementType=e,t.type=l,t.lanes=u,t}function Xn(e,t,n,l){return e=vt(7,e,l,t),e.lanes=n,e}function $i(e,t,n){return e=vt(6,e,null,t),e.lanes=n,e}function vr(e){var t=vt(18,null,null,0);return t.stateNode=e,t}function Fi(e,t,n){return t=vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var br=new WeakMap;function xt(e,t){if(typeof e=="object"&&e!==null){var n=br.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ia(t)},br.set(e,t),t)}return{value:e,source:t,stack:Ia(t)}}var Cl=[],Nl=0,bu=null,ha=0,_t=[],Mt=0,mn=null,Yt=1,Lt="";function Ft(e,t){Cl[Nl++]=ha,Cl[Nl++]=bu,bu=e,ha=t}function Sr(e,t,n){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,mn=e;var l=Yt;e=Lt;var a=32-gt(l)-1;l&=~(1<<a),n+=1;var u=32-gt(t)+a;if(30<u){var f=a-a%5;u=(l&(1<<f)-1).toString(32),l>>=f,a-=f,Yt=1<<32-gt(t)+a|n<<a|l,Lt=u+e}else Yt=1<<u|n<<a|l,Lt=e}function Wi(e){e.return!==null&&(Ft(e,1),Sr(e,1,0))}function Ii(e){for(;e===bu;)bu=Cl[--Nl],Cl[Nl]=null,ha=Cl[--Nl],Cl[Nl]=null;for(;e===mn;)mn=_t[--Mt],_t[Mt]=null,Lt=_t[--Mt],_t[Mt]=null,Yt=_t[--Mt],_t[Mt]=null}function pr(e,t){_t[Mt++]=Yt,_t[Mt++]=Lt,_t[Mt++]=mn,Yt=t.id,Lt=t.overflow,mn=e}var Ie=null,Be=null,Ee=!1,gn=null,wt=!1,Pi=Error(s(519));function yn(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ma(xt(t,e)),Pi}function Er(e){var t=e.stateNode,n=e.type,l=e.memoizedProps;switch(t[We]=e,t[ct]=l,n){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(n=0;n<Ba.length;n++)ve(Ba[n],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),Of(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),Bf(t,l.value,l.defaultValue,l.children)}n=l.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||l.suppressHydrationWarning===!0||Yd(t.textContent,n)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=kt),t=!0):t=!1,t||yn(e,!0)}function Tr(e){for(Ie=e.return;Ie;)switch(Ie.tag){case 5:case 31:case 13:wt=!1;return;case 27:case 3:wt=!0;return;default:Ie=Ie.return}}function jl(e){if(e!==Ie)return!1;if(!Ee)return Tr(e),Ee=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||vs(e.type,e.memoizedProps)),n=!n),n&&Be&&yn(e),Tr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Be=Jd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Be=Jd(e)}else t===27?(t=Be,Mn(e.type)?(e=Ts,Ts=null,Be=e):Be=t):Be=Ie?Rt(e.stateNode.nextSibling):null;return!0}function Kn(){Be=Ie=null,Ee=!1}function ec(){var e=gn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),gn=null),e}function ma(e){gn===null?gn=[e]:gn.push(e)}var tc=b(null),Zn=null,Wt=null;function vn(e,t,n){Q(tc,t._currentValue),t._currentValue=n}function It(e){e._currentValue=tc.current,U(tc)}function nc(e,t,n){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===n)break;e=e.return}}function lc(e,t,n,l){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var u=a.dependencies;if(u!==null){var f=a.child;u=u.firstContext;e:for(;u!==null;){var o=u;u=a;for(var y=0;y<t.length;y++)if(o.context===t[y]){u.lanes|=n,o=u.alternate,o!==null&&(o.lanes|=n),nc(u.return,n,e),l||(f=null);break e}u=o.next}}else if(a.tag===18){if(f=a.return,f===null)throw Error(s(341));f.lanes|=n,u=f.alternate,u!==null&&(u.lanes|=n),nc(f,n,e),f=null}else f=a.child;if(f!==null)f.return=a;else for(f=a;f!==null;){if(f===e){f=null;break}if(a=f.sibling,a!==null){a.return=f.return,f=a;break}f=f.return}a=f}}function xl(e,t,n,l){e=null;for(var a=t,u=!1;a!==null;){if(!u){if((a.flags&524288)!==0)u=!0;else if((a.flags&262144)!==0)break}if(a.tag===10){var f=a.alternate;if(f===null)throw Error(s(387));if(f=f.memoizedProps,f!==null){var o=a.type;yt(a.pendingProps.value,f.value)||(e!==null?e.push(o):e=[o])}}else if(a===de.current){if(f=a.alternate,f===null)throw Error(s(387));f.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e!==null?e.push(Ga):e=[Ga])}a=a.return}e!==null&&lc(t,e,n,l),t.flags|=262144}function Su(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Vn(e){Zn=e,Wt=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pe(e){return Ar(Zn,e)}function pu(e,t){return Zn===null&&Vn(e),Ar(e,t)}function Ar(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Wt===null){if(e===null)throw Error(s(308));Wt=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Wt=Wt.next=t;return n}var zm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},Cm=i.unstable_scheduleCallback,Nm=i.unstable_NormalPriority,Ke={$$typeof:I,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ac(){return{controller:new zm,data:new Map,refCount:0}}function ga(e){e.refCount--,e.refCount===0&&Cm(Nm,function(){e.controller.abort()})}var ya=null,uc=0,_l=0,Ml=null;function jm(e,t){if(ya===null){var n=ya=[];uc=0,_l=ss(),Ml={status:"pending",value:void 0,then:function(l){n.push(l)}}}return uc++,t.then(zr,zr),t}function zr(){if(--uc===0&&ya!==null){Ml!==null&&(Ml.status="fulfilled");var e=ya;ya=null,_l=0,Ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function xm(e,t){var n=[],l={status:"pending",value:null,reason:null,then:function(a){n.push(a)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var a=0;a<n.length;a++)(0,n[a])(t)},function(a){for(l.status="rejected",l.reason=a,a=0;a<n.length;a++)(0,n[a])(void 0)}),l}var Cr=M.S;M.S=function(e,t){fd=ut(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&jm(e,t),Cr!==null&&Cr(e,t)};var kn=b(null);function ic(){var e=kn.current;return e!==null?e:Oe.pooledCache}function Eu(e,t){t===null?Q(kn,kn.current):Q(kn,t.pool)}function Nr(){var e=ic();return e===null?null:{parent:Ke._currentValue,pool:e}}var wl=Error(s(460)),cc=Error(s(474)),Tu=Error(s(542)),Au={then:function(){}};function jr(e){return e=e.status,e==="fulfilled"||e==="rejected"}function xr(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(kt,kt),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mr(e),e;default:if(typeof t.status=="string")t.then(kt,kt);else{if(e=Oe,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var a=t;a.status="fulfilled",a.value=l}},function(l){if(t.status==="pending"){var a=t;a.status="rejected",a.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Mr(e),e}throw $n=t,wl}}function Jn(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?($n=n,wl):n}}var $n=null;function _r(){if($n===null)throw Error(s(459));var e=$n;return $n=null,e}function Mr(e){if(e===wl||e===Tu)throw Error(s(483))}var Ul=null,va=0;function zu(e){var t=va;return va+=1,Ul===null&&(Ul=[]),xr(Ul,e,t)}function ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cu(e,t){throw t.$$typeof===j?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function wr(e){function t(T,S){if(e){var z=T.deletions;z===null?(T.deletions=[S],T.flags|=16):z.push(S)}}function n(T,S){if(!e)return null;for(;S!==null;)t(T,S),S=S.sibling;return null}function l(T){for(var S=new Map;T!==null;)T.key!==null?S.set(T.key,T):S.set(T.index,T),T=T.sibling;return S}function a(T,S){return T=$t(T,S),T.index=0,T.sibling=null,T}function u(T,S,z){return T.index=z,e?(z=T.alternate,z!==null?(z=z.index,z<S?(T.flags|=67108866,S):z):(T.flags|=67108866,S)):(T.flags|=1048576,S)}function f(T){return e&&T.alternate===null&&(T.flags|=67108866),T}function o(T,S,z,R){return S===null||S.tag!==6?(S=$i(z,T.mode,R),S.return=T,S):(S=a(S,z),S.return=T,S)}function y(T,S,z,R){var le=z.type;return le===D?w(T,S,z.props.children,R,z.key):S!==null&&(S.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Jn(le)===S.type)?(S=a(S,z.props),ba(S,z),S.return=T,S):(S=vu(z.type,z.key,z.props,null,T.mode,R),ba(S,z),S.return=T,S)}function C(T,S,z,R){return S===null||S.tag!==4||S.stateNode.containerInfo!==z.containerInfo||S.stateNode.implementation!==z.implementation?(S=Fi(z,T.mode,R),S.return=T,S):(S=a(S,z.children||[]),S.return=T,S)}function w(T,S,z,R,le){return S===null||S.tag!==7?(S=Xn(z,T.mode,R,le),S.return=T,S):(S=a(S,z),S.return=T,S)}function O(T,S,z){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=$i(""+S,T.mode,z),S.return=T,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case B:return z=vu(S.type,S.key,S.props,null,T.mode,z),ba(z,S),z.return=T,z;case X:return S=Fi(S,T.mode,z),S.return=T,S;case K:return S=Jn(S),O(T,S,z)}if(Ye(S)||F(S))return S=Xn(S,T.mode,z,null),S.return=T,S;if(typeof S.then=="function")return O(T,zu(S),z);if(S.$$typeof===I)return O(T,pu(T,S),z);Cu(T,S)}return null}function x(T,S,z,R){var le=S!==null?S.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return le!==null?null:o(T,S,""+z,R);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case B:return z.key===le?y(T,S,z,R):null;case X:return z.key===le?C(T,S,z,R):null;case K:return z=Jn(z),x(T,S,z,R)}if(Ye(z)||F(z))return le!==null?null:w(T,S,z,R,null);if(typeof z.then=="function")return x(T,S,zu(z),R);if(z.$$typeof===I)return x(T,S,pu(T,z),R);Cu(T,z)}return null}function _(T,S,z,R,le){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return T=T.get(z)||null,o(S,T,""+R,le);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case B:return T=T.get(R.key===null?z:R.key)||null,y(S,T,R,le);case X:return T=T.get(R.key===null?z:R.key)||null,C(S,T,R,le);case K:return R=Jn(R),_(T,S,z,R,le)}if(Ye(R)||F(R))return T=T.get(z)||null,w(S,T,R,le,null);if(typeof R.then=="function")return _(T,S,z,zu(R),le);if(R.$$typeof===I)return _(T,S,z,pu(S,R),le);Cu(S,R)}return null}function P(T,S,z,R){for(var le=null,ze=null,te=S,ge=S=0,pe=null;te!==null&&ge<z.length;ge++){te.index>ge?(pe=te,te=null):pe=te.sibling;var Ce=x(T,te,z[ge],R);if(Ce===null){te===null&&(te=pe);break}e&&te&&Ce.alternate===null&&t(T,te),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce,te=pe}if(ge===z.length)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;ge<z.length;ge++)te=O(T,z[ge],R),te!==null&&(S=u(te,S,ge),ze===null?le=te:ze.sibling=te,ze=te);return Ee&&Ft(T,ge),le}for(te=l(te);ge<z.length;ge++)pe=_(te,T,ge,z[ge],R),pe!==null&&(e&&pe.alternate!==null&&te.delete(pe.key===null?ge:pe.key),S=u(pe,S,ge),ze===null?le=pe:ze.sibling=pe,ze=pe);return e&&te.forEach(function(Dn){return t(T,Dn)}),Ee&&Ft(T,ge),le}function ie(T,S,z,R){if(z==null)throw Error(s(151));for(var le=null,ze=null,te=S,ge=S=0,pe=null,Ce=z.next();te!==null&&!Ce.done;ge++,Ce=z.next()){te.index>ge?(pe=te,te=null):pe=te.sibling;var Dn=x(T,te,Ce.value,R);if(Dn===null){te===null&&(te=pe);break}e&&te&&Dn.alternate===null&&t(T,te),S=u(Dn,S,ge),ze===null?le=Dn:ze.sibling=Dn,ze=Dn,te=pe}if(Ce.done)return n(T,te),Ee&&Ft(T,ge),le;if(te===null){for(;!Ce.done;ge++,Ce=z.next())Ce=O(T,Ce.value,R),Ce!==null&&(S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return Ee&&Ft(T,ge),le}for(te=l(te);!Ce.done;ge++,Ce=z.next())Ce=_(te,T,ge,Ce.value,R),Ce!==null&&(e&&Ce.alternate!==null&&te.delete(Ce.key===null?ge:Ce.key),S=u(Ce,S,ge),ze===null?le=Ce:ze.sibling=Ce,ze=Ce);return e&&te.forEach(function(Yg){return t(T,Yg)}),Ee&&Ft(T,ge),le}function Re(T,S,z,R){if(typeof z=="object"&&z!==null&&z.type===D&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case B:e:{for(var le=z.key;S!==null;){if(S.key===le){if(le=z.type,le===D){if(S.tag===7){n(T,S.sibling),R=a(S,z.props.children),R.return=T,T=R;break e}}else if(S.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===K&&Jn(le)===S.type){n(T,S.sibling),R=a(S,z.props),ba(R,z),R.return=T,T=R;break e}n(T,S);break}else t(T,S);S=S.sibling}z.type===D?(R=Xn(z.props.children,T.mode,R,z.key),R.return=T,T=R):(R=vu(z.type,z.key,z.props,null,T.mode,R),ba(R,z),R.return=T,T=R)}return f(T);case X:e:{for(le=z.key;S!==null;){if(S.key===le)if(S.tag===4&&S.stateNode.containerInfo===z.containerInfo&&S.stateNode.implementation===z.implementation){n(T,S.sibling),R=a(S,z.children||[]),R.return=T,T=R;break e}else{n(T,S);break}else t(T,S);S=S.sibling}R=Fi(z,T.mode,R),R.return=T,T=R}return f(T);case K:return z=Jn(z),Re(T,S,z,R)}if(Ye(z))return P(T,S,z,R);if(F(z)){if(le=F(z),typeof le!="function")throw Error(s(150));return z=le.call(z),ie(T,S,z,R)}if(typeof z.then=="function")return Re(T,S,zu(z),R);if(z.$$typeof===I)return Re(T,S,pu(T,z),R);Cu(T,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,S!==null&&S.tag===6?(n(T,S.sibling),R=a(S,z),R.return=T,T=R):(n(T,S),R=$i(z,T.mode,R),R.return=T,T=R),f(T)):n(T,S)}return function(T,S,z,R){try{va=0;var le=Re(T,S,z,R);return Ul=null,le}catch(te){if(te===wl||te===Tu)throw te;var ze=vt(29,te,null,T.mode);return ze.lanes=R,ze.return=T,ze}finally{}}}var Fn=wr(!0),Ur=wr(!1),bn=!1;function sc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function fc(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 Sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pn(e,t,n){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var a=l.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),l.pending=t,t=yu(e),gr(e,null,n),t}return gu(e,l,t,n),yu(e)}function Sa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Af(e,n)}}function rc(e,t){var n=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,n===l)){var a=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?a=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?a=u=t:u=u.next=t}else a=u=t;n={baseState:l.baseState,firstBaseUpdate:a,lastBaseUpdate:u,shared:l.shared,callbacks:l.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var oc=!1;function pa(){if(oc){var e=Ml;if(e!==null)throw e}}function Ea(e,t,n,l){oc=!1;var a=e.updateQueue;bn=!1;var u=a.firstBaseUpdate,f=a.lastBaseUpdate,o=a.shared.pending;if(o!==null){a.shared.pending=null;var y=o,C=y.next;y.next=null,f===null?u=C:f.next=C,f=y;var w=e.alternate;w!==null&&(w=w.updateQueue,o=w.lastBaseUpdate,o!==f&&(o===null?w.firstBaseUpdate=C:o.next=C,w.lastBaseUpdate=y))}if(u!==null){var O=a.baseState;f=0,w=C=y=null,o=u;do{var x=o.lane&-536870913,_=x!==o.lane;if(_?(Se&x)===x:(l&x)===x){x!==0&&x===_l&&(oc=!0),w!==null&&(w=w.next={lane:0,tag:o.tag,payload:o.payload,callback:null,next:null});e:{var P=e,ie=o;x=t;var Re=n;switch(ie.tag){case 1:if(P=ie.payload,typeof P=="function"){O=P.call(Re,O,x);break e}O=P;break e;case 3:P.flags=P.flags&-65537|128;case 0:if(P=ie.payload,x=typeof P=="function"?P.call(Re,O,x):P,x==null)break e;O=E({},O,x);break e;case 2:bn=!0}}x=o.callback,x!==null&&(e.flags|=64,_&&(e.flags|=8192),_=a.callbacks,_===null?a.callbacks=[x]:_.push(x))}else _={lane:x,tag:o.tag,payload:o.payload,callback:o.callback,next:null},w===null?(C=w=_,y=O):w=w.next=_,f|=x;if(o=o.next,o===null){if(o=a.shared.pending,o===null)break;_=o,o=_.next,_.next=null,a.lastBaseUpdate=_,a.shared.pending=null}}while(!0);w===null&&(y=O),a.baseState=y,a.firstBaseUpdate=C,a.lastBaseUpdate=w,u===null&&(a.shared.lanes=0),Cn|=f,e.lanes=f,e.memoizedState=O}}function Rr(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Or(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Rr(n[e],t)}var Rl=b(null),Nu=b(0);function Dr(e,t){e=sn,Q(Nu,e),Q(Rl,t),sn=e|t.baseLanes}function dc(){Q(Nu,sn),Q(Rl,Rl.current)}function hc(){sn=Nu.current,U(Rl),U(Nu)}var bt=b(null),Ut=null;function En(e){var t=e.alternate;Q(Qe,Qe.current&1),Q(bt,e),Ut===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(Ut=e)}function mc(e){Q(Qe,Qe.current),Q(bt,e),Ut===null&&(Ut=e)}function Br(e){e.tag===22?(Q(Qe,Qe.current),Q(bt,e),Ut===null&&(Ut=e)):Tn()}function Tn(){Q(Qe,Qe.current),Q(bt,bt.current)}function St(e){U(bt),Ut===e&&(Ut=null),U(Qe)}var Qe=b(0);function ju(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ps(n)||Es(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 Pt=0,me=null,we=null,Ze=null,xu=!1,Ol=!1,Wn=!1,_u=0,Ta=0,Dl=null,_m=0;function Le(){throw Error(s(321))}function gc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yt(e[n],t[n]))return!1;return!0}function yc(e,t,n,l,a,u){return Pt=u,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?po:wc,Wn=!1,u=n(l,a),Wn=!1,Ol&&(u=qr(t,n,l,a)),Hr(e),u}function Hr(e){M.H=Ca;var t=we!==null&&we.next!==null;if(Pt=0,Ze=we=me=null,xu=!1,Ta=0,Dl=null,t)throw Error(s(300));e===null||Ve||(e=e.dependencies,e!==null&&Su(e)&&(Ve=!0))}function qr(e,t,n,l){me=e;var a=0;do{if(Ol&&(Dl=null),Ta=0,Ol=!1,25<=a)throw Error(s(301));if(a+=1,Ze=we=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}M.H=Eo,u=t(n,l)}while(Ol);return u}function Mm(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Aa(t):t,e=e.useState()[0],(we!==null?we.memoizedState:null)!==e&&(me.flags|=1024),t}function vc(){var e=_u!==0;return _u=0,e}function bc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Sc(e){if(xu){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xu=!1}Pt=0,Ze=we=me=null,Ol=!1,Ta=_u=0,Dl=null}function it(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e,Ze}function Xe(){if(we===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=we.next;var t=Ze===null?me.memoizedState:Ze.next;if(t!==null)Ze=t,we=e;else{if(e===null)throw me.alternate===null?Error(s(467)):Error(s(310));we=e,e={memoizedState:we.memoizedState,baseState:we.baseState,baseQueue:we.baseQueue,queue:we.queue,next:null},Ze===null?me.memoizedState=Ze=e:Ze=Ze.next=e}return Ze}function Mu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Aa(e){var t=Ta;return Ta+=1,Dl===null&&(Dl=[]),e=xr(Dl,e,t),t=me,(Ze===null?t.memoizedState:Ze.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?po:wc),e}function wu(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Aa(e);if(e.$$typeof===I)return Pe(e)}throw Error(s(438,String(e)))}function pc(e){var t=null,n=me.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var l=me.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(a){return a.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Mu(),me.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),l=0;l<e;l++)n[l]=ne;return t.index++,n}function en(e,t){return typeof t=="function"?t(e):t}function Uu(e){var t=Xe();return Ec(t,we,e)}function Ec(e,t,n){var l=e.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=n;var a=e.baseQueue,u=l.pending;if(u!==null){if(a!==null){var f=a.next;a.next=u.next,u.next=f}t.baseQueue=a=u,l.pending=null}if(u=e.baseState,a===null)e.memoizedState=u;else{t=a.next;var o=f=null,y=null,C=t,w=!1;do{var O=C.lane&-536870913;if(O!==C.lane?(Se&O)===O:(Pt&O)===O){var x=C.revertLane;if(x===0)y!==null&&(y=y.next={lane:0,revertLane:0,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null}),O===_l&&(w=!0);else if((Pt&x)===x){C=C.next,x===_l&&(w=!0);continue}else O={lane:0,revertLane:C.revertLane,gesture:null,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},y===null?(o=y=O,f=u):y=y.next=O,me.lanes|=x,Cn|=x;O=C.action,Wn&&n(u,O),u=C.hasEagerState?C.eagerState:n(u,O)}else x={lane:O,revertLane:C.revertLane,gesture:C.gesture,action:C.action,hasEagerState:C.hasEagerState,eagerState:C.eagerState,next:null},y===null?(o=y=x,f=u):y=y.next=x,me.lanes|=O,Cn|=O;C=C.next}while(C!==null&&C!==t);if(y===null?f=u:y.next=o,!yt(u,e.memoizedState)&&(Ve=!0,w&&(n=Ml,n!==null)))throw n;e.memoizedState=u,e.baseState=f,e.baseQueue=y,l.lastRenderedState=u}return a===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Tc(e){var t=Xe(),n=t.queue;if(n===null)throw Error(s(311));n.lastRenderedReducer=e;var l=n.dispatch,a=n.pending,u=t.memoizedState;if(a!==null){n.pending=null;var f=a=a.next;do u=e(u,f.action),f=f.next;while(f!==a);yt(u,t.memoizedState)||(Ve=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,l]}function Yr(e,t,n){var l=me,a=Xe(),u=Ee;if(u){if(n===void 0)throw Error(s(407));n=n()}else n=t();var f=!yt((we||a).memoizedState,n);if(f&&(a.memoizedState=n,Ve=!0),a=a.queue,Cc(Qr.bind(null,l,a,e),[e]),a.getSnapshot!==t||f||Ze!==null&&Ze.memoizedState.tag&1){if(l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,a,n,t),null),Oe===null)throw Error(s(349));u||(Pt&127)!==0||Lr(l,t,n)}return n}function Lr(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t=Mu(),me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Gr(e,t,n,l){t.value=n,t.getSnapshot=l,Xr(t)&&Kr(e)}function Qr(e,t,n){return n(function(){Xr(t)&&Kr(e)})}function Xr(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yt(e,n)}catch{return!0}}function Kr(e){var t=Qn(e,2);t!==null&&ht(t,e,2)}function Ac(e){var t=it();if(typeof e=="function"){var n=e;if(e=n(),Wn){on(!0);try{n()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},t}function Zr(e,t,n,l){return e.baseState=n,Ec(e,we,typeof l=="function"?l:en)}function wm(e,t,n,l,a){if(Du(e))throw Error(s(485));if(e=t.action,e!==null){var u={payload:a,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};M.T!==null?n(!0):u.isTransition=!1,l(u),n=t.pending,n===null?(u.next=t.pending=u,Vr(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Vr(e,t){var n=t.action,l=t.payload,a=e.state;if(t.isTransition){var u=M.T,f={};M.T=f;try{var o=n(a,l),y=M.S;y!==null&&y(f,o),kr(e,t,o)}catch(C){zc(e,t,C)}finally{u!==null&&f.types!==null&&(u.types=f.types),M.T=u}}else try{u=n(a,l),kr(e,t,u)}catch(C){zc(e,t,C)}}function kr(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(l){Jr(e,t,l)},function(l){return zc(e,t,l)}):Jr(e,t,n)}function Jr(e,t,n){t.status="fulfilled",t.value=n,$r(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Vr(e,n)))}function zc(e,t,n){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=n,$r(t),t=t.next;while(t!==l)}e.action=null}function $r(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Fr(e,t){return t}function Wr(e,t){if(Ee){var n=Oe.formState;if(n!==null){e:{var l=me;if(Ee){if(Be){t:{for(var a=Be,u=wt;a.nodeType!==8;){if(!u){a=null;break t}if(a=Rt(a.nextSibling),a===null){a=null;break t}}u=a.data,a=u==="F!"||u==="F"?a:null}if(a){Be=Rt(a.nextSibling),l=a.data==="F!";break e}}yn(l)}l=!1}l&&(t=n[0])}}return n=it(),n.memoizedState=n.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fr,lastRenderedState:t},n.queue=l,n=vo.bind(null,me,l),l.dispatch=n,l=Ac(!1),u=Mc.bind(null,me,!1,l.queue),l=it(),a={state:t,dispatch:null,action:e,pending:null},l.queue=a,n=wm.bind(null,me,a,u,n),a.dispatch=n,l.memoizedState=e,[t,n,!1]}function Ir(e){var t=Xe();return Pr(t,we,e)}function Pr(e,t,n){if(t=Ec(e,t,Fr)[0],e=Uu(en)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Aa(t)}catch(f){throw f===wl?Tu:f}else l=t;t=Xe();var a=t.queue,u=a.dispatch;return n!==t.memoizedState&&(me.flags|=2048,Bl(9,{destroy:void 0},Um.bind(null,a,n),null)),[l,u,e]}function Um(e,t){e.action=t}function eo(e){var t=Xe(),n=we;if(n!==null)return Pr(t,n,e);Xe(),t=t.memoizedState,n=Xe();var l=n.queue.dispatch;return n.memoizedState=e,[t,l,!1]}function Bl(e,t,n,l){return e={tag:e,create:n,deps:l,inst:t,next:null},t=me.updateQueue,t===null&&(t=Mu(),me.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(l=n.next,n.next=e,e.next=l,t.lastEffect=e),e}function to(){return Xe().memoizedState}function Ru(e,t,n,l){var a=it();me.flags|=e,a.memoizedState=Bl(1|t,{destroy:void 0},n,l===void 0?null:l)}function Ou(e,t,n,l){var a=Xe();l=l===void 0?null:l;var u=a.memoizedState.inst;we!==null&&l!==null&&gc(l,we.memoizedState.deps)?a.memoizedState=Bl(t,u,n,l):(me.flags|=e,a.memoizedState=Bl(1|t,u,n,l))}function no(e,t){Ru(8390656,8,e,t)}function Cc(e,t){Ou(2048,8,e,t)}function Rm(e){me.flags|=4;var t=me.updateQueue;if(t===null)t=Mu(),me.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function lo(e){var t=Xe().memoizedState;return Rm({ref:t,nextImpl:e}),function(){if((je&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function ao(e,t){return Ou(4,2,e,t)}function uo(e,t){return Ou(4,4,e,t)}function io(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 co(e,t,n){n=n!=null?n.concat([e]):null,Ou(4,4,io.bind(null,t,e),n)}function Nc(){}function so(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;return t!==null&&gc(t,l[1])?l[0]:(n.memoizedState=[e,t],e)}function fo(e,t){var n=Xe();t=t===void 0?null:t;var l=n.memoizedState;if(t!==null&&gc(t,l[1]))return l[0];if(l=e(),Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l}function jc(e,t,n){return n===void 0||(Pt&1073741824)!==0&&(Se&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=od(),me.lanes|=e,Cn|=e,n)}function ro(e,t,n,l){return yt(n,t)?n:Rl.current!==null?(e=jc(e,n,l),yt(e,t)||(Ve=!0),e):(Pt&42)===0||(Pt&1073741824)!==0&&(Se&261930)===0?(Ve=!0,e.memoizedState=n):(e=od(),me.lanes|=e,Cn|=e,t)}function oo(e,t,n,l,a){var u=G.p;G.p=u!==0&&8>u?u:8;var f=M.T,o={};M.T=o,Mc(e,!1,t,n);try{var y=a(),C=M.S;if(C!==null&&C(o,y),y!==null&&typeof y=="object"&&typeof y.then=="function"){var w=xm(y,l);za(e,t,w,Tt(e))}else za(e,t,l,Tt(e))}catch(O){za(e,t,{then:function(){},status:"rejected",reason:O},Tt())}finally{G.p=u,f!==null&&o.types!==null&&(f.types=o.types),M.T=f}}function Om(){}function xc(e,t,n,l){if(e.tag!==5)throw Error(s(476));var a=ho(e).queue;oo(e,a,t,ae,n===null?Om:function(){return mo(e),n(l)})}function ho(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:ae},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function mo(e){var t=ho(e);t.next===null&&(t=e.alternate.memoizedState),za(e,t.next.queue,{},Tt())}function _c(){return Pe(Ga)}function go(){return Xe().memoizedState}function yo(){return Xe().memoizedState}function Dm(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Tt();e=Sn(n);var l=pn(t,e,n);l!==null&&(ht(l,t,n),Sa(l,t,n)),t={cache:ac()},e.payload=t;return}t=t.return}}function Bm(e,t,n){var l=Tt();n={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Du(e)?bo(t,n):(n=ki(e,t,n,l),n!==null&&(ht(n,e,l),So(n,t,l)))}function vo(e,t,n){var l=Tt();za(e,t,n,l)}function za(e,t,n,l){var a={lane:l,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Du(e))bo(t,a);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,o=u(f,n);if(a.hasEagerState=!0,a.eagerState=o,yt(o,f))return gu(e,t,a,0),Oe===null&&mu(),!1}catch{}finally{}if(n=ki(e,t,a,l),n!==null)return ht(n,e,l),So(n,t,l),!0}return!1}function Mc(e,t,n,l){if(l={lane:2,revertLane:ss(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Du(e)){if(t)throw Error(s(479))}else t=ki(e,n,l,2),t!==null&&ht(t,e,2)}function Du(e){var t=e.alternate;return e===me||t!==null&&t===me}function bo(e,t){Ol=xu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function So(e,t,n){if((n&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,n|=l,t.lanes=n,Af(e,n)}}var Ca={readContext:Pe,use:wu,useCallback:Le,useContext:Le,useEffect:Le,useImperativeHandle:Le,useLayoutEffect:Le,useInsertionEffect:Le,useMemo:Le,useReducer:Le,useRef:Le,useState:Le,useDebugValue:Le,useDeferredValue:Le,useTransition:Le,useSyncExternalStore:Le,useId:Le,useHostTransitionStatus:Le,useFormState:Le,useActionState:Le,useOptimistic:Le,useMemoCache:Le,useCacheRefresh:Le};Ca.useEffectEvent=Le;var po={readContext:Pe,use:wu,useCallback:function(e,t){return it().memoizedState=[e,t===void 0?null:t],e},useContext:Pe,useEffect:no,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ru(4194308,4,io.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ru(4194308,4,e,t)},useInsertionEffect:function(e,t){Ru(4,2,e,t)},useMemo:function(e,t){var n=it();t=t===void 0?null:t;var l=e();if(Wn){on(!0);try{e()}finally{on(!1)}}return n.memoizedState=[l,t],l},useReducer:function(e,t,n){var l=it();if(n!==void 0){var a=n(t);if(Wn){on(!0);try{n(t)}finally{on(!1)}}}else a=t;return l.memoizedState=l.baseState=a,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:a},l.queue=e,e=e.dispatch=Bm.bind(null,me,e),[l.memoizedState,e]},useRef:function(e){var t=it();return e={current:e},t.memoizedState=e},useState:function(e){e=Ac(e);var t=e.queue,n=vo.bind(null,me,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Nc,useDeferredValue:function(e,t){var n=it();return jc(n,e,t)},useTransition:function(){var e=Ac(!1);return e=oo.bind(null,me,e.queue,!0,!1),it().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var l=me,a=it();if(Ee){if(n===void 0)throw Error(s(407));n=n()}else{if(n=t(),Oe===null)throw Error(s(349));(Se&127)!==0||Lr(l,t,n)}a.memoizedState=n;var u={value:n,getSnapshot:t};return a.queue=u,no(Qr.bind(null,l,u,e),[e]),l.flags|=2048,Bl(9,{destroy:void 0},Gr.bind(null,l,u,n,t),null),n},useId:function(){var e=it(),t=Oe.identifierPrefix;if(Ee){var n=Lt,l=Yt;n=(l&~(1<<32-gt(l)-1)).toString(32)+n,t="_"+t+"R_"+n,n=_u++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=_m++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:_c,useFormState:Wr,useActionState:Wr,useOptimistic:function(e){var t=it();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,me,!0,n),n.dispatch=t,[e,t]},useMemoCache:pc,useCacheRefresh:function(){return it().memoizedState=Dm.bind(null,me)},useEffectEvent:function(e){var t=it(),n={impl:e};return t.memoizedState=n,function(){if((je&2)!==0)throw Error(s(440));return n.impl.apply(void 0,arguments)}}},wc={readContext:Pe,use:wu,useCallback:so,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:fo,useReducer:Uu,useRef:to,useState:function(){return Uu(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Uu(en)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:Ir,useActionState:Ir,useOptimistic:function(e,t){var n=Xe();return Zr(n,we,e,t)},useMemoCache:pc,useCacheRefresh:yo};wc.useEffectEvent=lo;var Eo={readContext:Pe,use:wu,useCallback:so,useContext:Pe,useEffect:Cc,useImperativeHandle:co,useInsertionEffect:ao,useLayoutEffect:uo,useMemo:fo,useReducer:Tc,useRef:to,useState:function(){return Tc(en)},useDebugValue:Nc,useDeferredValue:function(e,t){var n=Xe();return we===null?jc(n,e,t):ro(n,we.memoizedState,e,t)},useTransition:function(){var e=Tc(en)[0],t=Xe().memoizedState;return[typeof e=="boolean"?e:Aa(e),t]},useSyncExternalStore:Yr,useId:go,useHostTransitionStatus:_c,useFormState:eo,useActionState:eo,useOptimistic:function(e,t){var n=Xe();return we!==null?Zr(n,we,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:pc,useCacheRefresh:yo};Eo.useEffectEvent=lo;function Uc(e,t,n,l){t=e.memoizedState,n=n(l,t),n=n==null?t:E({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Rc={enqueueSetState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var l=Tt(),a=Sn(l);a.tag=1,a.payload=t,n!=null&&(a.callback=n),t=pn(e,a,l),t!==null&&(ht(t,e,l),Sa(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Tt(),l=Sn(n);l.tag=2,t!=null&&(l.callback=t),t=pn(e,l,n),t!==null&&(ht(t,e,n),Sa(t,e,n))}};function To(e,t,n,l,a,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,u,f):t.prototype&&t.prototype.isPureReactComponent?!oa(n,l)||!oa(a,u):!0}function Ao(e,t,n,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,l),t.state!==e&&Rc.enqueueReplaceState(t,t.state,null)}function In(e,t){var n=t;if("ref"in t){n={};for(var l in t)l!=="ref"&&(n[l]=t[l])}if(e=e.defaultProps){n===t&&(n=E({},n));for(var a in e)n[a]===void 0&&(n[a]=e[a])}return n}function zo(e){hu(e)}function Co(e){console.error(e)}function No(e){hu(e)}function Bu(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function jo(e,t,n){try{var l=e.onCaughtError;l(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(a){setTimeout(function(){throw a})}}function Oc(e,t,n){return n=Sn(n),n.tag=3,n.payload={element:null},n.callback=function(){Bu(e,t)},n}function xo(e){return e=Sn(e),e.tag=3,e}function _o(e,t,n,l){var a=n.type.getDerivedStateFromError;if(typeof a=="function"){var u=l.value;e.payload=function(){return a(u)},e.callback=function(){jo(t,n,l)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){jo(t,n,l),typeof a!="function"&&(Nn===null?Nn=new Set([this]):Nn.add(this));var o=l.stack;this.componentDidCatch(l.value,{componentStack:o!==null?o:""})})}function Hm(e,t,n,l,a){if(n.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=n.alternate,t!==null&&xl(t,n,a,!0),n=bt.current,n!==null){switch(n.tag){case 31:case 13:return Ut===null?Ju():n.alternate===null&&Ge===0&&(Ge=3),n.flags&=-257,n.flags|=65536,n.lanes=a,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([l]):t.add(l),us(e,l,a)),!1;case 22:return n.flags|=65536,l===Au?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([l]):n.add(l)),us(e,l,a)),!1}throw Error(s(435,n.tag))}return us(e,l,a),Ju(),!1}if(Ee)return t=bt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=a,l!==Pi&&(e=Error(s(422),{cause:l}),ma(xt(e,n)))):(l!==Pi&&(t=Error(s(423),{cause:l}),ma(xt(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,l=xt(l,n),a=Oc(e.stateNode,l,a),rc(e,a),Ge!==4&&(Ge=2)),!1;var u=Error(s(520),{cause:l});if(u=xt(u,n),Ra===null?Ra=[u]:Ra.push(u),Ge!==4&&(Ge=2),t===null)return!0;l=xt(l,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=Oc(n.stateNode,l,e),rc(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Nn===null||!Nn.has(u))))return n.flags|=65536,a&=-a,n.lanes|=a,a=xo(a),_o(a,e,n,l),rc(n,a),!1}n=n.return}while(n!==null);return!1}var Dc=Error(s(461)),Ve=!1;function et(e,t,n,l){t.child=e===null?Ur(t,null,n,l):Fn(t,e.child,n,l)}function Mo(e,t,n,l,a){n=n.render;var u=t.ref;if("ref"in l){var f={};for(var o in l)o!=="ref"&&(f[o]=l[o])}else f=l;return Vn(t),l=yc(e,t,n,f,u,a),o=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&o&&Wi(t),t.flags|=1,et(e,t,l,a),t.child)}function wo(e,t,n,l,a){if(e===null){var u=n.type;return typeof u=="function"&&!Ji(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,Uo(e,t,u,l,a)):(e=vu(n.type,null,l,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!Xc(e,a)){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:oa,n(f,l)&&e.ref===t.ref)return tn(e,t,a)}return t.flags|=1,e=$t(u,l),e.ref=t.ref,e.return=t,t.child=e}function Uo(e,t,n,l,a){if(e!==null){var u=e.memoizedProps;if(oa(u,l)&&e.ref===t.ref)if(Ve=!1,t.pendingProps=l=u,Xc(e,a))(e.flags&131072)!==0&&(Ve=!0);else return t.lanes=e.lanes,tn(e,t,a)}return Bc(e,t,n,l,a)}function Ro(e,t,n,l){var a=l.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(l=t.child=e.child,a=0;l!==null;)a=a|l.lanes|l.childLanes,l=l.sibling;l=a&~u}else l=0,t.child=null;return Oo(e,t,u,n,l)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Eu(t,u!==null?u.cachePool:null),u!==null?Dr(t,u):dc(),Br(t);else return l=t.lanes=536870912,Oo(e,t,u!==null?u.baseLanes|n:n,n,l)}else u!==null?(Eu(t,u.cachePool),Dr(t,u),Tn(),t.memoizedState=null):(e!==null&&Eu(t,null),dc(),Tn());return et(e,t,a,n),t.child}function Na(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Oo(e,t,n,l,a){var u=ic();return u=u===null?null:{parent:Ke._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Eu(t,null),dc(),Br(t),e!==null&&xl(e,t,l,!0),t.childLanes=a,null}function Hu(e,t){return t=Yu({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Do(e,t,n){return Fn(t,e.child,null,n),e=Hu(t,t.pendingProps),e.flags|=2,St(t),t.memoizedState=null,e}function qm(e,t,n){var l=t.pendingProps,a=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(l.mode==="hidden")return e=Hu(t,l),t.lanes=536870912,Na(null,e);if(mc(t),(e=Be)?(e=kd(e,wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return t.lanes=536870912,null}return Hu(t,l)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(mc(t),a)if(t.flags&256)t.flags&=-257,t=Do(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(Ve||xl(e,t,n,!1),a=(n&e.childLanes)!==0,Ve||a){if(l=Oe,l!==null&&(f=zf(l,n),f!==0&&f!==u.retryLane))throw u.retryLane=f,Qn(e,f),ht(l,e,f),Dc;Ju(),t=Do(e,t,n)}else e=u.treeContext,Be=Rt(f.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Hu(t,l),t.flags|=4096;return t}return e=$t(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function qu(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(s(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function Bc(e,t,n,l,a){return Vn(t),n=yc(e,t,n,l,void 0,a),l=vc(),e!==null&&!Ve?(bc(e,t,a),tn(e,t,a)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,a),t.child)}function Bo(e,t,n,l,a,u){return Vn(t),t.updateQueue=null,n=qr(t,l,n,a),Hr(e),l=vc(),e!==null&&!Ve?(bc(e,t,u),tn(e,t,u)):(Ee&&l&&Wi(t),t.flags|=1,et(e,t,n,u),t.child)}function Ho(e,t,n,l,a){if(Vn(t),t.stateNode===null){var u=zl,f=n.contextType;typeof f=="object"&&f!==null&&(u=Pe(f)),u=new n(l,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=Rc,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=l,u.state=t.memoizedState,u.refs={},sc(t),f=n.contextType,u.context=typeof f=="object"&&f!==null?Pe(f):zl,u.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(Uc(t,n,f,l),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(f=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),f!==u.state&&Rc.enqueueReplaceState(u,u.state,null),Ea(t,l,u,a),pa(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){u=t.stateNode;var o=t.memoizedProps,y=In(n,o);u.props=y;var C=u.context,w=n.contextType;f=zl,typeof w=="object"&&w!==null&&(f=Pe(w));var O=n.getDerivedStateFromProps;w=typeof O=="function"||typeof u.getSnapshotBeforeUpdate=="function",o=t.pendingProps!==o,w||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(o||C!==f)&&Ao(t,u,l,f),bn=!1;var x=t.memoizedState;u.state=x,Ea(t,l,u,a),pa(),C=t.memoizedState,o||x!==C||bn?(typeof O=="function"&&(Uc(t,n,O,l),C=t.memoizedState),(y=bn||To(t,n,y,l,x,C,f))?(w||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=C),u.props=l,u.state=C,u.context=f,l=y):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{u=t.stateNode,fc(e,t),f=t.memoizedProps,w=In(n,f),u.props=w,O=t.pendingProps,x=u.context,C=n.contextType,y=zl,typeof C=="object"&&C!==null&&(y=Pe(C)),o=n.getDerivedStateFromProps,(C=typeof o=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f!==O||x!==y)&&Ao(t,u,l,y),bn=!1,x=t.memoizedState,u.state=x,Ea(t,l,u,a),pa();var _=t.memoizedState;f!==O||x!==_||bn||e!==null&&e.dependencies!==null&&Su(e.dependencies)?(typeof o=="function"&&(Uc(t,n,o,l),_=t.memoizedState),(w=bn||To(t,n,w,l,x,_,y)||e!==null&&e.dependencies!==null&&Su(e.dependencies))?(C||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(l,_,y),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(l,_,y)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=_),u.props=l,u.state=_,u.context=y,l=w):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),l=!1)}return u=l,qu(e,t),l=(t.flags&128)!==0,u||l?(u=t.stateNode,n=l&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&l?(t.child=Fn(t,e.child,null,a),t.child=Fn(t,null,n,a)):et(e,t,n,a),t.memoizedState=u.state,e=t.child):e=tn(e,t,a),e}function qo(e,t,n,l){return Kn(),t.flags|=256,et(e,t,n,l),t.child}var Hc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function qc(e){return{baseLanes:e,cachePool:Nr()}}function Yc(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=Et),e}function Yo(e,t,n){var l=t.pendingProps,a=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(Qe.current&2)!==0),f&&(a=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(a?En(t):Tn(),(e=Be)?(e=kd(e,wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:mn!==null?{id:Yt,overflow:Lt}:null,retryLane:536870912,hydrationErrors:null},n=vr(e),n.return=t,t.child=n,Ie=t,Be=null)):e=null,e===null)throw yn(t);return Es(e)?t.lanes=32:t.lanes=536870912,null}var o=l.children;return l=l.fallback,a?(Tn(),a=t.mode,o=Yu({mode:"hidden",children:o},a),l=Xn(l,a,n,null),o.return=t,l.return=t,o.sibling=l,t.child=o,l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,f,n),t.memoizedState=Hc,Na(null,l)):(En(t),Lc(t,o))}var y=e.memoizedState;if(y!==null&&(o=y.dehydrated,o!==null)){if(u)t.flags&256?(En(t),t.flags&=-257,t=Gc(e,t,n)):t.memoizedState!==null?(Tn(),t.child=e.child,t.flags|=128,t=null):(Tn(),o=l.fallback,a=t.mode,l=Yu({mode:"visible",children:l.children},a),o=Xn(o,a,n,null),o.flags|=2,l.return=t,o.return=t,l.sibling=o,t.child=l,Fn(t,e.child,null,n),l=t.child,l.memoizedState=qc(n),l.childLanes=Yc(e,f,n),t.memoizedState=Hc,t=Na(null,l));else if(En(t),Es(o)){if(f=o.nextSibling&&o.nextSibling.dataset,f)var C=f.dgst;f=C,l=Error(s(419)),l.stack="",l.digest=f,ma({value:l,source:null,stack:null}),t=Gc(e,t,n)}else if(Ve||xl(e,t,n,!1),f=(n&e.childLanes)!==0,Ve||f){if(f=Oe,f!==null&&(l=zf(f,n),l!==0&&l!==y.retryLane))throw y.retryLane=l,Qn(e,l),ht(f,e,l),Dc;ps(o)||Ju(),t=Gc(e,t,n)}else ps(o)?(t.flags|=192,t.child=e.child,t=null):(e=y.treeContext,Be=Rt(o.nextSibling),Ie=t,Ee=!0,gn=null,wt=!1,e!==null&&pr(t,e),t=Lc(t,l.children),t.flags|=4096);return t}return a?(Tn(),o=l.fallback,a=t.mode,y=e.child,C=y.sibling,l=$t(y,{mode:"hidden",children:l.children}),l.subtreeFlags=y.subtreeFlags&65011712,C!==null?o=$t(C,o):(o=Xn(o,a,n,null),o.flags|=2),o.return=t,l.return=t,l.sibling=o,t.child=l,Na(null,l),l=t.child,o=e.child.memoizedState,o===null?o=qc(n):(a=o.cachePool,a!==null?(y=Ke._currentValue,a=a.parent!==y?{parent:y,pool:y}:a):a=Nr(),o={baseLanes:o.baseLanes|n,cachePool:a}),l.memoizedState=o,l.childLanes=Yc(e,f,n),t.memoizedState=Hc,Na(e.child,l)):(En(t),n=e.child,e=n.sibling,n=$t(n,{mode:"visible",children:l.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function Lc(e,t){return t=Yu({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yu(e,t){return e=vt(22,e,null,t),e.lanes=0,e}function Gc(e,t,n){return Fn(t,e.child,null,n),e=Lc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Lo(e,t,n){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),nc(e.return,t,n)}function Qc(e,t,n,l,a,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:n,tailMode:a,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=l,f.tail=n,f.tailMode=a,f.treeForkCount=u)}function Go(e,t,n){var l=t.pendingProps,a=l.revealOrder,u=l.tail;l=l.children;var f=Qe.current,o=(f&2)!==0;if(o?(f=f&1|2,t.flags|=128):f&=1,Q(Qe,f),et(e,t,l,n),l=Ee?ha:0,!o&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Lo(e,n,t);else if(e.tag===19)Lo(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&ju(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),Qc(t,!1,a,n,u,l);break;case"backwards":case"unstable_legacy-backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&ju(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}Qc(t,!0,n,null,u,l);break;case"together":Qc(t,!1,null,null,void 0,l);break;default:t.memoizedState=null}return t.child}function tn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Cn|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(xl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,n=$t(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=$t(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Xc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Su(e)))}function Ym(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),vn(t,Ke,e.memoizedState.cache),Kn();break;case 27:case 5:nt(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mc(t),null;break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(En(t),t.flags|=128,null):(n&t.child.childLanes)!==0?Yo(e,t,n):(En(t),e=tn(e,t,n),e!==null?e.sibling:null);En(t);break;case 19:var a=(e.flags&128)!==0;if(l=(n&t.childLanes)!==0,l||(xl(e,t,n,!1),l=(n&t.childLanes)!==0),a){if(l)return Go(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),Q(Qe,Qe.current),l)break;return null;case 22:return t.lanes=0,Ro(e,t,n,t.pendingProps);case 24:vn(t,Ke,e.memoizedState.cache)}return tn(e,t,n)}function Qo(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ve=!0;else{if(!Xc(e,n)&&(t.flags&128)===0)return Ve=!1,Ym(e,t,n);Ve=(e.flags&131072)!==0}else Ve=!1,Ee&&(t.flags&1048576)!==0&&Sr(t,ha,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=Jn(t.elementType),t.type=e,typeof e=="function")Ji(e)?(l=In(e,l),t.tag=1,t=Ho(null,t,e,l,n)):(t.tag=0,t=Bc(null,t,e,l,n));else{if(e!=null){var a=e.$$typeof;if(a===$){t.tag=11,t=Mo(null,t,e,l,n);break e}else if(a===Y){t.tag=14,t=wo(null,t,e,l,n);break e}}throw t=ue(e)||e,Error(s(306,t,""))}}return t;case 0:return Bc(e,t,t.type,t.pendingProps,n);case 1:return l=t.type,a=In(l,t.pendingProps),Ho(e,t,l,a,n);case 3:e:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(s(387));l=t.pendingProps;var u=t.memoizedState;a=u.element,fc(e,t),Ea(t,l,null,n);var f=t.memoizedState;if(l=f.cache,vn(t,Ke,l),l!==u.cache&&lc(t,[Ke],n,!0),pa(),l=f.element,u.isDehydrated)if(u={element:l,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=qo(e,t,l,n);break e}else if(l!==a){a=xt(Error(s(424)),t),ma(a),t=qo(e,t,l,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Be=Rt(e.firstChild),Ie=t,Ee=!0,gn=null,wt=!0,n=Ur(t,null,l,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Kn(),l===a){t=tn(e,t,n);break e}et(e,t,l,n)}t=t.child}return t;case 26:return qu(e,t),e===null?(n=Pd(t.type,null,t.pendingProps,null))?t.memoizedState=n:Ee||(n=t.type,e=t.pendingProps,l=ti(re.current).createElement(n),l[We]=t,l[ct]=e,tt(l,n,e),$e(l),t.stateNode=l):t.memoizedState=Pd(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return nt(t),e===null&&Ee&&(l=t.stateNode=Fd(t.type,t.pendingProps,re.current),Ie=t,wt=!0,a=Be,Mn(t.type)?(Ts=a,Be=Rt(l.firstChild)):Be=a),et(e,t,t.pendingProps.children,n),qu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((a=l=Be)&&(l=gg(l,t.type,t.pendingProps,wt),l!==null?(t.stateNode=l,Ie=t,Be=Rt(l.firstChild),wt=!1,a=!0):a=!1),a||yn(t)),nt(t),a=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,l=u.children,vs(a,u)?l=null:f!==null&&vs(a,f)&&(t.flags|=32),t.memoizedState!==null&&(a=yc(e,t,Mm,null,null,n),Ga._currentValue=a),qu(e,t),et(e,t,l,n),t.child;case 6:return e===null&&Ee&&((e=n=Be)&&(n=yg(n,t.pendingProps,wt),n!==null?(t.stateNode=n,Ie=t,Be=null,e=!0):e=!1),e||yn(t)),null;case 13:return Yo(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=Fn(t,null,l,n):et(e,t,l,n),t.child;case 11:return Mo(e,t,t.type,t.pendingProps,n);case 7:return et(e,t,t.pendingProps,n),t.child;case 8:return et(e,t,t.pendingProps.children,n),t.child;case 12:return et(e,t,t.pendingProps.children,n),t.child;case 10:return l=t.pendingProps,vn(t,t.type,l.value),et(e,t,l.children,n),t.child;case 9:return a=t.type._context,l=t.pendingProps.children,Vn(t),a=Pe(a),l=l(a),t.flags|=1,et(e,t,l,n),t.child;case 14:return wo(e,t,t.type,t.pendingProps,n);case 15:return Uo(e,t,t.type,t.pendingProps,n);case 19:return Go(e,t,n);case 31:return qm(e,t,n);case 22:return Ro(e,t,n,t.pendingProps);case 24:return Vn(t),l=Pe(Ke),e===null?(a=ic(),a===null&&(a=Oe,u=ac(),a.pooledCache=u,u.refCount++,u!==null&&(a.pooledCacheLanes|=n),a=u),t.memoizedState={parent:l,cache:a},sc(t),vn(t,Ke,a)):((e.lanes&n)!==0&&(fc(e,t),Ea(t,null,null,n),pa()),a=e.memoizedState,u=t.memoizedState,a.parent!==l?(a={parent:l,cache:l},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),vn(t,Ke,l)):(l=u.cache,vn(t,Ke,l),l!==a.cache&&lc(t,[Ke],n,!0))),et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function nn(e){e.flags|=4}function Kc(e,t,n,l,a){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(a&335544128)===a)if(e.stateNode.complete)e.flags|=8192;else if(gd())e.flags|=8192;else throw $n=Au,cc}else e.flags&=-16777217}function Xo(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!ah(t))if(gd())e.flags|=8192;else throw $n=Au,cc}function Lu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ef():536870912,e.lanes|=t,Ll|=t)}function ja(e,t){if(!Ee)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function He(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,l=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags&65011712,l|=a.flags&65011712,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,l|=a.subtreeFlags,l|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=l,e.childLanes=n,t}function Lm(e,t,n){var l=t.pendingProps;switch(Ii(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return He(t),null;case 1:return He(t),null;case 3:return n=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),It(Ke),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(jl(t)?nn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,ec())),He(t),null;case 26:var a=t.type,u=t.memoizedState;return e===null?(nn(t),u!==null?(He(t),Xo(t,u)):(He(t),Kc(t,a,null,l,n))):u?u!==e.memoizedState?(nn(t),He(t),Xo(t,u)):(He(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&nn(t),He(t),Kc(t,a,e,l,n)),null;case 27:if(al(t),n=re.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return He(t),null}e=W.current,jl(t)?Er(t):(e=Fd(a,l,n),t.stateNode=e,nn(t))}return He(t),null;case 5:if(al(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(!l){if(t.stateNode===null)throw Error(s(166));return He(t),null}if(u=W.current,jl(t))Er(t);else{var f=ti(re.current);switch(u){case 1:u=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:u=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":u=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":u=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":u=f.createElement("div"),u.innerHTML="<script><\\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?u.multiple=!0:l.size&&(u.size=l.size);break;default:u=typeof l.is=="string"?f.createElement(a,{is:l.is}):f.createElement(a)}}u[We]=t,u[ct]=l;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(tt(u,a,l),a){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&nn(t)}}return He(t),Kc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&nn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(s(166));if(e=re.current,jl(t)){if(e=t.stateNode,n=t.memoizedProps,l=null,a=Ie,a!==null)switch(a.tag){case 27:case 5:l=a.memoizedProps}e[We]=t,e=!!(e.nodeValue===n||l!==null&&l.suppressHydrationWarning===!0||Yd(e.nodeValue,n)),e||yn(t,!0)}else e=ti(e).createTextNode(l),e[We]=t,t.stateNode=e}return He(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(l=jl(t),n!==null){if(e===null){if(!l)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),e=!1}else n=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(St(t),t):(St(t),null);if((t.flags&128)!==0)throw Error(s(558))}return He(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=jl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!a)throw Error(s(318));if(a=t.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));a[We]=t}else Kn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;He(t),a=!1}else a=ec(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(St(t),t):(St(t),null)}return St(t),(t.flags&128)!==0?(t.lanes=n,t):(n=l!==null,e=e!==null&&e.memoizedState!==null,n&&(l=t.child,a=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(a=l.alternate.memoizedState.cachePool.pool),u=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(u=l.memoizedState.cachePool.pool),u!==a&&(l.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Lu(t,t.updateQueue),He(t),null);case 4:return Ne(),e===null&&ds(t.stateNode.containerInfo),He(t),null;case 10:return It(t.type),He(t),null;case 19:if(U(Qe),l=t.memoizedState,l===null)return He(t),null;if(a=(t.flags&128)!==0,u=l.rendering,u===null)if(a)ja(l,!1);else{if(Ge!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=ju(e),u!==null){for(t.flags|=128,ja(l,!1),e=u.updateQueue,t.updateQueue=e,Lu(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)yr(n,e),n=n.sibling;return Q(Qe,Qe.current&1|2),Ee&&Ft(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ut()>Zu&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304)}else{if(!a)if(e=ju(u),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Lu(t,e),ja(l,!0),l.tail===null&&l.tailMode==="hidden"&&!u.alternate&&!Ee)return He(t),null}else 2*ut()-l.renderingStartTime>Zu&&n!==536870912&&(t.flags|=128,a=!0,ja(l,!1),t.lanes=4194304);l.isBackwards?(u.sibling=t.child,t.child=u):(e=l.last,e!==null?e.sibling=u:t.child=u,l.last=u)}return l.tail!==null?(e=l.tail,l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ut(),e.sibling=null,n=Qe.current,Q(Qe,a?n&1|2:n&1),Ee&&Ft(t,l.treeForkCount),e):(He(t),null);case 22:case 23:return St(t),hc(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(n&536870912)!==0&&(t.flags&128)===0&&(He(t),t.subtreeFlags&6&&(t.flags|=8192)):He(t),n=t.updateQueue,n!==null&&Lu(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==n&&(t.flags|=2048),e!==null&&U(kn),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),It(Ke),He(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function Gm(e,t){switch(Ii(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return It(Ke),Ne(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return al(t),null;case 31:if(t.memoizedState!==null){if(St(t),t.alternate===null)throw Error(s(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(St(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Kn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Qe),null;case 4:return Ne(),null;case 10:return It(t.type),null;case 22:case 23:return St(t),hc(),e!==null&&U(kn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return It(Ke),null;case 25:return null;default:return null}}function Ko(e,t){switch(Ii(t),t.tag){case 3:It(Ke),Ne();break;case 26:case 27:case 5:al(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&St(t);break;case 13:St(t);break;case 19:U(Qe);break;case 10:It(t.type);break;case 22:case 23:St(t),hc(),e!==null&&U(kn);break;case 24:It(Ke)}}function xa(e,t){try{var n=t.updateQueue,l=n!==null?n.lastEffect:null;if(l!==null){var a=l.next;n=a;do{if((n.tag&e)===e){l=void 0;var u=n.create,f=n.inst;l=u(),f.destroy=l}n=n.next}while(n!==a)}}catch(o){_e(t,t.return,o)}}function An(e,t,n){try{var l=t.updateQueue,a=l!==null?l.lastEffect:null;if(a!==null){var u=a.next;l=u;do{if((l.tag&e)===e){var f=l.inst,o=f.destroy;if(o!==void 0){f.destroy=void 0,a=t;var y=n,C=o;try{C()}catch(w){_e(a,y,w)}}}l=l.next}while(l!==u)}}catch(w){_e(t,t.return,w)}}function Zo(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Or(t,n)}catch(l){_e(e,e.return,l)}}}function Vo(e,t,n){n.props=In(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(l){_e(e,t,l)}}function _a(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:l=e.stateNode;break;default:l=e.stateNode}typeof n=="function"?e.refCleanup=n(l):n.current=l}}catch(a){_e(e,t,a)}}function Gt(e,t){var n=e.ref,l=e.refCleanup;if(n!==null)if(typeof l=="function")try{l()}catch(a){_e(e,t,a)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(a){_e(e,t,a)}else n.current=null}function ko(e){var t=e.type,n=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&l.focus();break e;case"img":n.src?l.src=n.src:n.srcSet&&(l.srcset=n.srcSet)}}catch(a){_e(e,e.return,a)}}function Zc(e,t,n){try{var l=e.stateNode;fg(l,e.type,n,t),l[ct]=t}catch(a){_e(e,e.return,a)}}function Jo(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Mn(e.type)||e.tag===4}function Vc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Jo(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&&Mn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kc(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=kt));else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(kc(e,t,n),e=e.sibling;e!==null;)kc(e,t,n),e=e.sibling}function Gu(e,t,n){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(l!==4&&(l===27&&Mn(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Gu(e,t,n),e=e.sibling;e!==null;)Gu(e,t,n),e=e.sibling}function $o(e){var t=e.stateNode,n=e.memoizedProps;try{for(var l=e.type,a=t.attributes;a.length;)t.removeAttributeNode(a[0]);tt(t,l,n),t[We]=e,t[ct]=n}catch(u){_e(e,e.return,u)}}var ln=!1,ke=!1,Jc=!1,Fo=typeof WeakSet=="function"?WeakSet:Set,Fe=null;function Qm(e,t){if(e=e.containerInfo,gs=si,e=cr(e),Gi(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var l=n.getSelection&&n.getSelection();if(l&&l.rangeCount!==0){n=l.anchorNode;var a=l.anchorOffset,u=l.focusNode;l=l.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,o=-1,y=-1,C=0,w=0,O=e,x=null;t:for(;;){for(var _;O!==n||a!==0&&O.nodeType!==3||(o=f+a),O!==u||l!==0&&O.nodeType!==3||(y=f+l),O.nodeType===3&&(f+=O.nodeValue.length),(_=O.firstChild)!==null;)x=O,O=_;for(;;){if(O===e)break t;if(x===n&&++C===a&&(o=f),x===u&&++w===l&&(y=f),(_=O.nextSibling)!==null)break;O=x,x=O.parentNode}O=_}n=o===-1||y===-1?null:{start:o,end:y}}else n=null}n=n||{start:0,end:0}}else n=null;for(ys={focusedElem:e,selectionRange:n},si=!1,Fe=t;Fe!==null;)if(t=Fe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Fe=e;else for(;Fe!==null;){switch(t=Fe,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,a=u.memoizedProps,u=u.memoizedState,l=n.stateNode;try{var P=In(n.type,a);e=l.getSnapshotBeforeUpdate(P,u),l.__reactInternalSnapshotBeforeUpdate=e}catch(ie){_e(n,n.return,ie)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Ss(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ss(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,Fe=e;break}Fe=t.return}}function Wo(e,t,n){var l=n.flags;switch(n.tag){case 0:case 11:case 15:un(e,n),l&4&&xa(5,n);break;case 1:if(un(e,n),l&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){_e(n,n.return,f)}else{var a=In(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(a,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){_e(n,n.return,f)}}l&64&&Zo(n),l&512&&_a(n,n.return);break;case 3:if(un(e,n),l&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{Or(e,t)}catch(f){_e(n,n.return,f)}}break;case 27:t===null&&l&4&&$o(n);case 26:case 5:un(e,n),t===null&&l&4&&ko(n),l&512&&_a(n,n.return);break;case 12:un(e,n);break;case 31:un(e,n),l&4&&ed(e,n);break;case 13:un(e,n),l&4&&td(e,n),l&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Wm.bind(null,n),vg(e,n))));break;case 22:if(l=n.memoizedState!==null||ln,!l){t=t!==null&&t.memoizedState!==null||ke,a=ln;var u=ke;ln=l,(ke=t)&&!u?cn(e,n,(n.subtreeFlags&8772)!==0):un(e,n),ln=a,ke=u}break;case 30:break;default:un(e,n)}}function Io(e){var t=e.alternate;t!==null&&(e.alternate=null,Io(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zi(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 qe=null,ft=!1;function an(e,t,n){for(n=n.child;n!==null;)Po(e,t,n),n=n.sibling}function Po(e,t,n){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Pl,n)}catch{}switch(n.tag){case 26:ke||Gt(n,t),an(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:ke||Gt(n,t);var l=qe,a=ft;Mn(n.type)&&(qe=n.stateNode,ft=!1),an(e,t,n),qa(n.stateNode),qe=l,ft=a;break;case 5:ke||Gt(n,t);case 6:if(l=qe,a=ft,qe=null,an(e,t,n),qe=l,ft=a,qe!==null)if(ft)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(n.stateNode)}catch(u){_e(n,t,u)}else try{qe.removeChild(n.stateNode)}catch(u){_e(n,t,u)}break;case 18:qe!==null&&(ft?(e=qe,Zd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Jl(e)):Zd(qe,n.stateNode));break;case 4:l=qe,a=ft,qe=n.stateNode.containerInfo,ft=!0,an(e,t,n),qe=l,ft=a;break;case 0:case 11:case 14:case 15:An(2,n,t),ke||An(4,n,t),an(e,t,n);break;case 1:ke||(Gt(n,t),l=n.stateNode,typeof l.componentWillUnmount=="function"&&Vo(n,t,l)),an(e,t,n);break;case 21:an(e,t,n);break;case 22:ke=(l=ke)||n.memoizedState!==null,an(e,t,n),ke=l;break;default:an(e,t,n)}}function ed(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jl(e)}catch(n){_e(t,t.return,n)}}}function td(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jl(e)}catch(n){_e(t,t.return,n)}}function Xm(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Fo),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Fo),t;default:throw Error(s(435,e.tag))}}function Qu(e,t){var n=Xm(e);t.forEach(function(l){if(!n.has(l)){n.add(l);var a=Im.bind(null,e,l);l.then(a,a)}})}function rt(e,t){var n=t.deletions;if(n!==null)for(var l=0;l<n.length;l++){var a=n[l],u=e,f=t,o=f;e:for(;o!==null;){switch(o.tag){case 27:if(Mn(o.type)){qe=o.stateNode,ft=!1;break e}break;case 5:qe=o.stateNode,ft=!1;break e;case 3:case 4:qe=o.stateNode.containerInfo,ft=!0;break e}o=o.return}if(qe===null)throw Error(s(160));Po(u,f,a),qe=null,ft=!1,u=a.alternate,u!==null&&(u.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)nd(t,e),t=t.sibling}var Bt=null;function nd(e,t){var n=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:rt(t,e),ot(e),l&4&&(An(3,e,e.return),xa(3,e),An(5,e,e.return));break;case 1:rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),l&64&&ln&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?l:n.concat(l))));break;case 26:var a=Bt;if(rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),l&4){var u=n!==null?n.memoizedState:null;if(l=e.memoizedState,n===null)if(l===null)if(e.stateNode===null){e:{l=e.type,n=e.memoizedProps,a=a.ownerDocument||a;t:switch(l){case"title":u=a.getElementsByTagName("title")[0],(!u||u[na]||u[We]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=a.createElement(l),a.head.insertBefore(u,a.querySelector("head > title"))),tt(u,l,n),u[We]=e,$e(u),l=u;break e;case"link":var f=nh("link","href",a).get(l+(n.href||""));if(f){for(var o=0;o<f.length;o++)if(u=f[o],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;case"meta":if(f=nh("meta","content",a).get(l+(n.content||""))){for(o=0;o<f.length;o++)if(u=f[o],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(o,1);break t}}u=a.createElement(l),tt(u,l,n),a.head.appendChild(u);break;default:throw Error(s(468,l))}u[We]=e,$e(u),l=u}e.stateNode=l}else lh(a,e.type,e.stateNode);else e.stateNode=th(a,l,e.memoizedProps);else u!==l?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,l===null?lh(a,e.type,e.stateNode):th(a,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Zc(e,e.memoizedProps,n.memoizedProps)}break;case 27:rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),n!==null&&l&4&&Zc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(rt(t,e),ot(e),l&512&&(ke||n===null||Gt(n,n.return)),e.flags&32){a=e.stateNode;try{vl(a,"")}catch(P){_e(e,e.return,P)}}l&4&&e.stateNode!=null&&(a=e.memoizedProps,Zc(e,a,n!==null?n.memoizedProps:a)),l&1024&&(Jc=!0);break;case 6:if(rt(t,e),ot(e),l&4){if(e.stateNode===null)throw Error(s(162));l=e.memoizedProps,n=e.stateNode;try{n.nodeValue=l}catch(P){_e(e,e.return,P)}}break;case 3:if(ai=null,a=Bt,Bt=ni(t.containerInfo),rt(t,e),Bt=a,ot(e),l&4&&n!==null&&n.memoizedState.isDehydrated)try{Jl(t.containerInfo)}catch(P){_e(e,e.return,P)}Jc&&(Jc=!1,ld(e));break;case 4:l=Bt,Bt=ni(e.stateNode.containerInfo),rt(t,e),ot(e),Bt=l;break;case 12:rt(t,e),ot(e);break;case 31:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 13:rt(t,e),ot(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(Ku=ut()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 22:a=e.memoizedState!==null;var y=n!==null&&n.memoizedState!==null,C=ln,w=ke;if(ln=C||a,ke=w||y,rt(t,e),ke=w,ln=C,ot(e),l&8192)e:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||y||ln||ke||Pn(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){y=n=t;try{if(u=y.stateNode,a)f=u.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{o=y.stateNode;var O=y.memoizedProps.style,x=O!=null&&O.hasOwnProperty("display")?O.display:null;o.style.display=x==null||typeof x=="boolean"?"":(""+x).trim()}}catch(P){_e(y,y.return,P)}}}else if(t.tag===6){if(n===null){y=t;try{y.stateNode.nodeValue=a?"":y.memoizedProps}catch(P){_e(y,y.return,P)}}}else if(t.tag===18){if(n===null){y=t;try{var _=y.stateNode;a?Vd(_,!0):Vd(y.stateNode,!1)}catch(P){_e(y,y.return,P)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(n=l.retryQueue,n!==null&&(l.retryQueue=null,Qu(e,n))));break;case 19:rt(t,e),ot(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,Qu(e,l)));break;case 30:break;case 21:break;default:rt(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{for(var n,l=e.return;l!==null;){if(Jo(l)){n=l;break}l=l.return}if(n==null)throw Error(s(160));switch(n.tag){case 27:var a=n.stateNode,u=Vc(e);Gu(e,u,a);break;case 5:var f=n.stateNode;n.flags&32&&(vl(f,""),n.flags&=-33);var o=Vc(e);Gu(e,o,f);break;case 3:case 4:var y=n.stateNode.containerInfo,C=Vc(e);kc(e,C,y);break;default:throw Error(s(161))}}catch(w){_e(e,e.return,w)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ld(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ld(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Wo(e,t.alternate,t),t=t.sibling}function Pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:An(4,t,t.return),Pn(t);break;case 1:Gt(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&Vo(t,t.return,n),Pn(t);break;case 27:qa(t.stateNode);case 26:case 5:Gt(t,t.return),Pn(t);break;case 22:t.memoizedState===null&&Pn(t);break;case 30:Pn(t);break;default:Pn(t)}e=e.sibling}}function cn(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,a=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:cn(a,u,n),xa(4,u);break;case 1:if(cn(a,u,n),l=u,a=l.stateNode,typeof a.componentDidMount=="function")try{a.componentDidMount()}catch(C){_e(l,l.return,C)}if(l=u,a=l.updateQueue,a!==null){var o=l.stateNode;try{var y=a.shared.hiddenCallbacks;if(y!==null)for(a.shared.hiddenCallbacks=null,a=0;a<y.length;a++)Rr(y[a],o)}catch(C){_e(l,l.return,C)}}n&&f&64&&Zo(u),_a(u,u.return);break;case 27:$o(u);case 26:case 5:cn(a,u,n),n&&l===null&&f&4&&ko(u),_a(u,u.return);break;case 12:cn(a,u,n);break;case 31:cn(a,u,n),n&&f&4&&ed(a,u);break;case 13:cn(a,u,n),n&&f&4&&td(a,u);break;case 22:u.memoizedState===null&&cn(a,u,n),_a(u,u.return);break;case 30:break;default:cn(a,u,n)}t=t.sibling}}function $c(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&&ga(n))}function Fc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e))}function Ht(e,t,n,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)ad(e,t,n,l),t=t.sibling}function ad(e,t,n,l){var a=t.flags;switch(t.tag){case 0:case 11:case 15:Ht(e,t,n,l),a&2048&&xa(9,t);break;case 1:Ht(e,t,n,l);break;case 3:Ht(e,t,n,l),a&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ga(e)));break;case 12:if(a&2048){Ht(e,t,n,l),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,o=u.onPostCommit;typeof o=="function"&&o(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(y){_e(t,t.return,y)}}else Ht(e,t,n,l);break;case 31:Ht(e,t,n,l);break;case 13:Ht(e,t,n,l);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?Ht(e,t,n,l):Ma(e,t):u._visibility&2?Ht(e,t,n,l):(u._visibility|=2,Hl(e,t,n,l,(t.subtreeFlags&10256)!==0||!1)),a&2048&&$c(f,t);break;case 24:Ht(e,t,n,l),a&2048&&Fc(t.alternate,t);break;default:Ht(e,t,n,l)}}function Hl(e,t,n,l,a){for(a=a&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,o=n,y=l,C=f.flags;switch(f.tag){case 0:case 11:case 15:Hl(u,f,o,y,a),xa(8,f);break;case 23:break;case 22:var w=f.stateNode;f.memoizedState!==null?w._visibility&2?Hl(u,f,o,y,a):Ma(u,f):(w._visibility|=2,Hl(u,f,o,y,a)),a&&C&2048&&$c(f.alternate,f);break;case 24:Hl(u,f,o,y,a),a&&C&2048&&Fc(f.alternate,f);break;default:Hl(u,f,o,y,a)}t=t.sibling}}function Ma(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,l=t,a=l.flags;switch(l.tag){case 22:Ma(n,l),a&2048&&$c(l.alternate,l);break;case 24:Ma(n,l),a&2048&&Fc(l.alternate,l);break;default:Ma(n,l)}t=t.sibling}}var wa=8192;function ql(e,t,n){if(e.subtreeFlags&wa)for(e=e.child;e!==null;)ud(e,t,n),e=e.sibling}function ud(e,t,n){switch(e.tag){case 26:ql(e,t,n),e.flags&wa&&e.memoizedState!==null&&_g(n,Bt,e.memoizedState,e.memoizedProps);break;case 5:ql(e,t,n);break;case 3:case 4:var l=Bt;Bt=ni(e.stateNode.containerInfo),ql(e,t,n),Bt=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=wa,wa=16777216,ql(e,t,n),wa=l):ql(e,t,n));break;default:ql(e,t,n)}}function id(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 Ua(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,sd(l,e)}id(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)cd(e),e=e.sibling}function cd(e){switch(e.tag){case 0:case 11:case 15:Ua(e),e.flags&2048&&An(9,e,e.return);break;case 3:Ua(e);break;case 12:Ua(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Xu(e)):Ua(e);break;default:Ua(e)}}function Xu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var l=t[n];Fe=l,sd(l,e)}id(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:An(8,t,t.return),Xu(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Xu(t));break;default:Xu(t)}e=e.sibling}}function sd(e,t){for(;Fe!==null;){var n=Fe;switch(n.tag){case 0:case 11:case 15:An(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var l=n.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:ga(n.memoizedState.cache)}if(l=n.child,l!==null)l.return=n,Fe=l;else e:for(n=e;Fe!==null;){l=Fe;var a=l.sibling,u=l.return;if(Io(l),l===n){Fe=null;break e}if(a!==null){a.return=u,Fe=a;break e}Fe=u}}}var Km={getCacheForType:function(e){var t=Pe(Ke),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Pe(Ke).controller.signal}},Zm=typeof WeakMap=="function"?WeakMap:Map,je=0,Oe=null,ye=null,Se=0,xe=0,pt=null,zn=!1,Yl=!1,Wc=!1,sn=0,Ge=0,Cn=0,el=0,Ic=0,Et=0,Ll=0,Ra=null,dt=null,Pc=!1,Ku=0,fd=0,Zu=1/0,Vu=null,Nn=null,Je=0,jn=null,Gl=null,fn=0,es=0,ts=null,rd=null,Oa=0,ns=null;function Tt(){return(je&2)!==0&&Se!==0?Se&-Se:M.T!==null?ss():Cf()}function od(){if(Et===0)if((Se&536870912)===0||Ee){var e=eu;eu<<=1,(eu&3932160)===0&&(eu=262144),Et=e}else Et=536870912;return e=bt.current,e!==null&&(e.flags|=32),Et}function ht(e,t,n){(e===Oe&&(xe===2||xe===9)||e.cancelPendingCommit!==null)&&(Ql(e,0),xn(e,Se,Et,!1)),ta(e,n),((je&2)===0||e!==Oe)&&(e===Oe&&((je&2)===0&&(el|=n),Ge===4&&xn(e,Se,Et,!1)),Qt(e))}function dd(e,t,n){if((je&6)!==0)throw Error(s(327));var l=!n&&(t&127)===0&&(t&e.expiredLanes)===0||ea(e,t),a=l?Jm(e,t):as(e,t,!0),u=l;do{if(a===0){Yl&&!l&&xn(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!Vm(n)){a=as(e,t,!1),u=!1;continue}if(a===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var o=e;a=Ra;var y=o.current.memoizedState.isDehydrated;if(y&&(Ql(o,f).flags|=256),f=as(o,f,!1),f!==2){if(Wc&&!y){o.errorRecoveryDisabledLanes|=u,el|=u,a=4;break e}u=dt,dt=a,u!==null&&(dt===null?dt=u:dt.push.apply(dt,u))}a=f}if(u=!1,a!==2)continue}}if(a===1){Ql(e,0),xn(e,t,0,!0);break}e:{switch(l=e,u=a,u){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:xn(l,t,Et,!zn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(a=Ku+300-ut(),10<a)){if(xn(l,t,Et,!zn),nu(l,0,!0)!==0)break e;fn=t,l.timeoutHandle=Xd(hd.bind(null,l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,"Throttled",-0,0),a);break e}hd(l,n,dt,Vu,Pc,t,Et,el,Ll,zn,u,null,-0,0)}}break}while(!0);Qt(e)}function hd(e,t,n,l,a,u,f,o,y,C,w,O,x,_){if(e.timeoutHandle=-1,O=t.subtreeFlags,O&8192||(O&16785408)===16785408){O={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:kt},ud(t,u,O);var P=(u&62914560)===u?Ku-ut():(u&4194048)===u?fd-ut():0;if(P=Mg(O,P),P!==null){fn=u,e.cancelPendingCommit=P(Ed.bind(null,e,t,u,n,l,a,f,o,y,w,O,null,x,_)),xn(e,u,f,!C);return}}Ed(e,t,u,n,l,a,f,o,y)}function Vm(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 l=0;l<n.length;l++){var a=n[l],u=a.getSnapshot;a=a.value;try{if(!yt(u(),a))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 xn(e,t,n,l){t&=~Ic,t&=~el,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var a=t;0<a;){var u=31-gt(a),f=1<<u;l[u]=-1,a&=~f}n!==0&&Tf(e,n,t)}function ku(){return(je&6)===0?(Da(0),!1):!0}function ls(){if(ye!==null){if(xe===0)var e=ye.return;else e=ye,Wt=Zn=null,Sc(e),Ul=null,va=0,e=ye;for(;e!==null;)Ko(e.alternate,e),e=e.return;ye=null}}function Ql(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,dg(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),fn=0,ls(),Oe=e,ye=n=$t(e.current,null),Se=t,xe=0,pt=null,zn=!1,Yl=ea(e,t),Wc=!1,Ll=Et=Ic=el=Cn=Ge=0,dt=Ra=null,Pc=!1,(t&8)!==0&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var a=31-gt(l),u=1<<a;t|=e[a],l&=~u}return sn=t,mu(),n}function md(e,t){me=null,M.H=Ca,t===wl||t===Tu?(t=_r(),xe=3):t===cc?(t=_r(),xe=4):xe=t===Dc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pt=t,ye===null&&(Ge=1,Bu(e,xt(t,e.current)))}function gd(){var e=bt.current;return e===null?!0:(Se&4194048)===Se?Ut===null:(Se&62914560)===Se||(Se&536870912)!==0?e===Ut:!1}function yd(){var e=M.H;return M.H=Ca,e===null?Ca:e}function vd(){var e=M.A;return M.A=Km,e}function Ju(){Ge=4,zn||(Se&4194048)!==Se&&bt.current!==null||(Yl=!0),(Cn&134217727)===0&&(el&134217727)===0||Oe===null||xn(Oe,Se,Et,!1)}function as(e,t,n){var l=je;je|=2;var a=yd(),u=vd();(Oe!==e||Se!==t)&&(Vu=null,Ql(e,t)),t=!1;var f=Ge;e:do try{if(xe!==0&&ye!==null){var o=ye,y=pt;switch(xe){case 8:ls(),f=6;break e;case 3:case 2:case 9:case 6:bt.current===null&&(t=!0);var C=xe;if(xe=0,pt=null,Xl(e,o,y,C),n&&Yl){f=0;break e}break;default:C=xe,xe=0,pt=null,Xl(e,o,y,C)}}km(),f=Ge;break}catch(w){md(e,w)}while(!0);return t&&e.shellSuspendCounter++,Wt=Zn=null,je=l,M.H=a,M.A=u,ye===null&&(Oe=null,Se=0,mu()),f}function km(){for(;ye!==null;)bd(ye)}function Jm(e,t){var n=je;je|=2;var l=yd(),a=vd();Oe!==e||Se!==t?(Vu=null,Zu=ut()+500,Ql(e,t)):Yl=ea(e,t);e:do try{if(xe!==0&&ye!==null){t=ye;var u=pt;t:switch(xe){case 1:xe=0,pt=null,Xl(e,t,u,1);break;case 2:case 9:if(jr(u)){xe=0,pt=null,Sd(t);break}t=function(){xe!==2&&xe!==9||Oe!==e||(xe=7),Qt(e)},u.then(t,t);break e;case 3:xe=7;break e;case 4:xe=5;break e;case 7:jr(u)?(xe=0,pt=null,Sd(t)):(xe=0,pt=null,Xl(e,t,u,7));break;case 5:var f=null;switch(ye.tag){case 26:f=ye.memoizedState;case 5:case 27:var o=ye;if(f?ah(f):o.stateNode.complete){xe=0,pt=null;var y=o.sibling;if(y!==null)ye=y;else{var C=o.return;C!==null?(ye=C,$u(C)):ye=null}break t}}xe=0,pt=null,Xl(e,t,u,5);break;case 6:xe=0,pt=null,Xl(e,t,u,6);break;case 8:ls(),Ge=6;break e;default:throw Error(s(462))}}$m();break}catch(w){md(e,w)}while(!0);return Wt=Zn=null,M.H=l,M.A=a,je=n,ye!==null?0:(Oe=null,Se=0,mu(),Ge)}function $m(){for(;ye!==null&&!Si();)bd(ye)}function bd(e){var t=Qo(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Sd(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Bo(n,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=Bo(n,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Sc(t);default:Ko(n,t),t=ye=yr(t,sn),t=Qo(n,t,sn)}e.memoizedProps=e.pendingProps,t===null?$u(e):ye=t}function Xl(e,t,n,l){Wt=Zn=null,Sc(t),Ul=null,va=0;var a=t.return;try{if(Hm(e,a,t,n,Se)){Ge=1,Bu(e,xt(n,e.current)),ye=null;return}}catch(u){if(a!==null)throw ye=a,u;Ge=1,Bu(e,xt(n,e.current)),ye=null;return}t.flags&32768?(Ee||l===1?e=!0:Yl||(Se&536870912)!==0?e=!1:(zn=e=!0,(l===2||l===9||l===3||l===6)&&(l=bt.current,l!==null&&l.tag===13&&(l.flags|=16384))),pd(t,e)):$u(t)}function $u(e){var t=e;do{if((t.flags&32768)!==0){pd(t,zn);return}e=t.return;var n=Lm(t.alternate,t,sn);if(n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);Ge===0&&(Ge=5)}function pd(e,t){do{var n=Gm(e.alternate,e);if(n!==null){n.flags&=32767,ye=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){ye=e;return}ye=e=n}while(e!==null);Ge=6,ye=null}function Ed(e,t,n,l,a,u,f,o,y){e.cancelPendingCommit=null;do Fu();while(Je!==0);if((je&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(u=t.lanes|t.childLanes,u|=Vi,x0(e,n,u,f,o,y),e===Oe&&(ye=Oe=null,Se=0),Gl=t,jn=e,fn=n,es=u,ts=a,rd=l,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Pm(De,function(){return Nd(),null})):(e.callbackNode=null,e.callbackPriority=0),l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=M.T,M.T=null,a=G.p,G.p=2,f=je,je|=4;try{Qm(e,t,n)}finally{je=f,G.p=a,M.T=l}}Je=1,Td(),Ad(),zd()}}function Td(){if(Je===1){Je=0;var e=jn,t=Gl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{nd(t,e);var u=ys,f=cr(e.containerInfo),o=u.focusedElem,y=u.selectionRange;if(f!==o&&o&&o.ownerDocument&&ir(o.ownerDocument.documentElement,o)){if(y!==null&&Gi(o)){var C=y.start,w=y.end;if(w===void 0&&(w=C),"selectionStart"in o)o.selectionStart=C,o.selectionEnd=Math.min(w,o.value.length);else{var O=o.ownerDocument||document,x=O&&O.defaultView||window;if(x.getSelection){var _=x.getSelection(),P=o.textContent.length,ie=Math.min(y.start,P),Re=y.end===void 0?ie:Math.min(y.end,P);!_.extend&&ie>Re&&(f=Re,Re=ie,ie=f);var T=ur(o,ie),S=ur(o,Re);if(T&&S&&(_.rangeCount!==1||_.anchorNode!==T.node||_.anchorOffset!==T.offset||_.focusNode!==S.node||_.focusOffset!==S.offset)){var z=O.createRange();z.setStart(T.node,T.offset),_.removeAllRanges(),ie>Re?(_.addRange(z),_.extend(S.node,S.offset)):(z.setEnd(S.node,S.offset),_.addRange(z))}}}}for(O=[],_=o;_=_.parentNode;)_.nodeType===1&&O.push({element:_,left:_.scrollLeft,top:_.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<O.length;o++){var R=O[o];R.element.scrollLeft=R.left,R.element.scrollTop=R.top}}si=!!gs,ys=gs=null}finally{je=a,G.p=l,M.T=n}}e.current=t,Je=2}}function Ad(){if(Je===2){Je=0;var e=jn,t=Gl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=M.T,M.T=null;var l=G.p;G.p=2;var a=je;je|=4;try{Wo(e,t.alternate,t)}finally{je=a,G.p=l,M.T=n}}Je=3}}function zd(){if(Je===4||Je===3){Je=0,fl();var e=jn,t=Gl,n=fn,l=rd;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Je=5:(Je=0,Gl=jn=null,Cd(e,e.pendingLanes));var a=e.pendingLanes;if(a===0&&(Nn=null),Ti(n),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Pl,t,void 0,(t.current.flags&128)===128)}catch{}if(l!==null){t=M.T,a=G.p,G.p=2,M.T=null;try{for(var u=e.onRecoverableError,f=0;f<l.length;f++){var o=l[f];u(o.value,{componentStack:o.stack})}}finally{M.T=t,G.p=a}}(fn&3)!==0&&Fu(),Qt(e),a=e.pendingLanes,(n&261930)!==0&&(a&42)!==0?e===ns?Oa++:(Oa=0,ns=e):Oa=0,Da(0)}}function Cd(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ga(t)))}function Fu(){return Td(),Ad(),zd(),Nd()}function Nd(){if(Je!==5)return!1;var e=jn,t=es;es=0;var n=Ti(fn),l=M.T,a=G.p;try{G.p=32>n?32:n,M.T=null,n=ts,ts=null;var u=jn,f=fn;if(Je=0,Gl=jn=null,fn=0,(je&6)!==0)throw Error(s(331));var o=je;if(je|=4,cd(u.current),ad(u,u.current,f,n),je=o,Da(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Pl,u)}catch{}return!0}finally{G.p=a,M.T=l,Cd(e,t)}}function jd(e,t,n){t=xt(n,t),t=Oc(e.stateNode,t,2),e=pn(e,t,2),e!==null&&(ta(e,2),Qt(e))}function _e(e,t,n){if(e.tag===3)jd(e,e,n);else for(;t!==null;){if(t.tag===3){jd(t,e,n);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(Nn===null||!Nn.has(l))){e=xt(n,e),n=xo(2),l=pn(t,n,2),l!==null&&(_o(n,l,t,e),ta(l,2),Qt(l));break}}t=t.return}}function us(e,t,n){var l=e.pingCache;if(l===null){l=e.pingCache=new Zm;var a=new Set;l.set(t,a)}else a=l.get(t),a===void 0&&(a=new Set,l.set(t,a));a.has(n)||(Wc=!0,a.add(n),e=Fm.bind(null,e,t,n),t.then(e,e))}function Fm(e,t,n){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Oe===e&&(Se&n)===n&&(Ge===4||Ge===3&&(Se&62914560)===Se&&300>ut()-Ku?(je&2)===0&&Ql(e,0):Ic|=n,Ll===Se&&(Ll=0)),Qt(e)}function xd(e,t){t===0&&(t=Ef()),e=Qn(e,t),e!==null&&(ta(e,t),Qt(e))}function Wm(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xd(e,n)}function Im(e,t){var n=0;switch(e.tag){case 31:case 13:var l=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(t),xd(e,n)}function Pm(e,t){return cl(e,t)}var Wu=null,Kl=null,is=!1,Iu=!1,cs=!1,_n=0;function Qt(e){e!==Kl&&e.next===null&&(Kl===null?Wu=Kl=e:Kl=Kl.next=e),Iu=!0,is||(is=!0,tg())}function Da(e,t){if(!cs&&Iu){cs=!0;do for(var n=!1,l=Wu;l!==null;){if(e!==0){var a=l.pendingLanes;if(a===0)var u=0;else{var f=l.suspendedLanes,o=l.pingedLanes;u=(1<<31-gt(42|e)+1)-1,u&=a&~(f&~o),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,Ud(l,u))}else u=Se,u=nu(l,l===Oe?u:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(u&3)===0||ea(l,u)||(n=!0,Ud(l,u));l=l.next}while(n);cs=!1}}function eg(){_d()}function _d(){Iu=is=!1;var e=0;_n!==0&&og()&&(e=_n);for(var t=ut(),n=null,l=Wu;l!==null;){var a=l.next,u=Md(l,t);u===0?(l.next=null,n===null?Wu=a:n.next=a,a===null&&(Kl=n)):(n=l,(e!==0||(u&3)!==0)&&(Iu=!0)),l=a}Je!==0&&Je!==5||Da(e),_n!==0&&(_n=0)}function Md(e,t){for(var n=e.suspendedLanes,l=e.pingedLanes,a=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-gt(u),o=1<<f,y=a[f];y===-1?((o&n)===0||(o&l)!==0)&&(a[f]=j0(o,t)):y<=t&&(e.expiredLanes|=o),u&=~o}if(t=Oe,n=Se,n=nu(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,n===0||e===t&&(xe===2||xe===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&sl(l),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||ea(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(l!==null&&sl(l),Ti(n)){case 2:case 8:n=he;break;case 32:n=De;break;case 268435456:n=rl;break;default:n=De}return l=wd.bind(null,e),n=cl(n,l),e.callbackPriority=t,e.callbackNode=n,t}return l!==null&&l!==null&&sl(l),e.callbackPriority=2,e.callbackNode=null,2}function wd(e,t){if(Je!==0&&Je!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Fu()&&e.callbackNode!==n)return null;var l=Se;return l=nu(e,e===Oe?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(dd(e,l,t),Md(e,ut()),e.callbackNode!=null&&e.callbackNode===n?wd.bind(null,e):null)}function Ud(e,t){if(Fu())return null;dd(e,t,!0)}function tg(){hg(function(){(je&6)!==0?cl(J,eg):_d()})}function ss(){if(_n===0){var e=_l;e===0&&(e=Pa,Pa<<=1,(Pa&261888)===0&&(Pa=256)),_n=e}return _n}function Rd(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:iu(""+e)}function Od(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function ng(e,t,n,l,a){if(t==="submit"&&n&&n.stateNode===a){var u=Rd((a[ct]||null).action),f=l.submitter;f&&(t=(t=f[ct]||null)?Rd(t.formAction):f.getAttribute("formAction"),t!==null&&(u=t,f=null));var o=new ru("action","action",null,l,a);e.push({event:o,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(_n!==0){var y=f?Od(a,f):new FormData(a);xc(n,{pending:!0,data:y,method:a.method,action:u},null,y)}}else typeof u=="function"&&(o.preventDefault(),y=f?Od(a,f):new FormData(a),xc(n,{pending:!0,data:y,method:a.method,action:u},u,y))},currentTarget:a}]})}}for(var fs=0;fs<Zi.length;fs++){var rs=Zi[fs],lg=rs.toLowerCase(),ag=rs[0].toUpperCase()+rs.slice(1);Dt(lg,"on"+ag)}Dt(rr,"onAnimationEnd"),Dt(or,"onAnimationIteration"),Dt(dr,"onAnimationStart"),Dt("dblclick","onDoubleClick"),Dt("focusin","onFocus"),Dt("focusout","onBlur"),Dt(pm,"onTransitionRun"),Dt(Em,"onTransitionStart"),Dt(Tm,"onTransitionCancel"),Dt(hr,"onTransitionEnd"),gl("onMouseEnter",["mouseout","mouseover"]),gl("onMouseLeave",["mouseout","mouseover"]),gl("onPointerEnter",["pointerout","pointerover"]),gl("onPointerLeave",["pointerout","pointerover"]),qn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),qn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),qn("onBeforeInput",["compositionend","keypress","textInput","paste"]),qn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),qn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ba="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(" "),ug=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ba));function Dd(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var l=e[n],a=l.event;l=l.listeners;e:{var u=void 0;if(t)for(var f=l.length-1;0<=f;f--){var o=l[f],y=o.instance,C=o.currentTarget;if(o=o.listener,y!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=y}else for(f=0;f<l.length;f++){if(o=l[f],y=o.instance,C=o.currentTarget,o=o.listener,y!==u&&a.isPropagationStopped())break e;u=o,a.currentTarget=C;try{u(a)}catch(w){hu(w)}a.currentTarget=null,u=y}}}}function ve(e,t){var n=t[Ai];n===void 0&&(n=t[Ai]=new Set);var l=e+"__bubble";n.has(l)||(Bd(t,e,2,!1),n.add(l))}function os(e,t,n){var l=0;t&&(l|=4),Bd(n,e,l,t)}var Pu="_reactListening"+Math.random().toString(36).slice(2);function ds(e){if(!e[Pu]){e[Pu]=!0,xf.forEach(function(n){n!=="selectionchange"&&(ug.has(n)||os(n,!1,e),os(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Pu]||(t[Pu]=!0,os("selectionchange",!1,t))}}function Bd(e,t,n,l){switch(oh(t)){case 2:var a=Rg;break;case 8:a=Og;break;default:a=js}n=a.bind(null,t,n,e),a=void 0,!Ui||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),l?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function hs(e,t,n,l,a){var u=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var f=l.tag;if(f===3||f===4){var o=l.stateNode.containerInfo;if(o===a)break;if(f===4)for(f=l.return;f!==null;){var y=f.tag;if((y===3||y===4)&&f.stateNode.containerInfo===a)return;f=f.return}for(;o!==null;){if(f=dl(o),f===null)return;if(y=f.tag,y===5||y===6||y===26||y===27){l=u=f;continue e}o=o.parentNode}}l=l.return}Lf(function(){var C=u,w=Mi(n),O=[];e:{var x=mr.get(e);if(x!==void 0){var _=ru,P=e;switch(e){case"keypress":if(su(n)===0)break e;case"keydown":case"keyup":_=I0;break;case"focusin":P="focus",_=Bi;break;case"focusout":P="blur",_=Bi;break;case"beforeblur":case"afterblur":_=Bi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":_=Xf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":_=L0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":_=tm;break;case rr:case or:case dr:_=X0;break;case hr:_=lm;break;case"scroll":case"scrollend":_=q0;break;case"wheel":_=um;break;case"copy":case"cut":case"paste":_=Z0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":_=Zf;break;case"toggle":case"beforetoggle":_=cm}var ie=(t&4)!==0,Re=!ie&&(e==="scroll"||e==="scrollend"),T=ie?x!==null?x+"Capture":null:x;ie=[];for(var S=C,z;S!==null;){var R=S;if(z=R.stateNode,R=R.tag,R!==5&&R!==26&&R!==27||z===null||T===null||(R=aa(S,T),R!=null&&ie.push(Ha(S,R,z))),Re)break;S=S.return}0<ie.length&&(x=new _(x,P,null,n,w),O.push({event:x,listeners:ie}))}}if((t&7)===0){e:{if(x=e==="mouseover"||e==="pointerover",_=e==="mouseout"||e==="pointerout",x&&n!==_i&&(P=n.relatedTarget||n.fromElement)&&(dl(P)||P[ol]))break e;if((_||x)&&(x=w.window===w?w:(x=w.ownerDocument)?x.defaultView||x.parentWindow:window,_?(P=n.relatedTarget||n.toElement,_=C,P=P?dl(P):null,P!==null&&(Re=h(P),ie=P.tag,P!==Re||ie!==5&&ie!==27&&ie!==6)&&(P=null)):(_=null,P=C),_!==P)){if(ie=Xf,R="onMouseLeave",T="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(ie=Zf,R="onPointerLeave",T="onPointerEnter",S="pointer"),Re=_==null?x:la(_),z=P==null?x:la(P),x=new ie(R,S+"leave",_,n,w),x.target=Re,x.relatedTarget=z,R=null,dl(w)===C&&(ie=new ie(T,S+"enter",P,n,w),ie.target=z,ie.relatedTarget=Re,R=ie),Re=R,_&&P)t:{for(ie=ig,T=_,S=P,z=0,R=T;R;R=ie(R))z++;R=0;for(var le=S;le;le=ie(le))R++;for(;0<z-R;)T=ie(T),z--;for(;0<R-z;)S=ie(S),R--;for(;z--;){if(T===S||S!==null&&T===S.alternate){ie=T;break t}T=ie(T),S=ie(S)}ie=null}else ie=null;_!==null&&Hd(O,x,_,ie,!1),P!==null&&Re!==null&&Hd(O,Re,P,ie,!0)}}e:{if(x=C?la(C):window,_=x.nodeName&&x.nodeName.toLowerCase(),_==="select"||_==="input"&&x.type==="file")var ze=Pf;else if(Wf(x))if(er)ze=vm;else{ze=gm;var te=mm}else _=x.nodeName,!_||_.toLowerCase()!=="input"||x.type!=="checkbox"&&x.type!=="radio"?C&&xi(C.elementType)&&(ze=Pf):ze=ym;if(ze&&(ze=ze(e,C))){If(O,ze,n,w);break e}te&&te(e,x,C),e==="focusout"&&C&&x.type==="number"&&C.memoizedProps.value!=null&&ji(x,"number",x.value)}switch(te=C?la(C):window,e){case"focusin":(Wf(te)||te.contentEditable==="true")&&(El=te,Qi=C,da=null);break;case"focusout":da=Qi=El=null;break;case"mousedown":Xi=!0;break;case"contextmenu":case"mouseup":case"dragend":Xi=!1,sr(O,n,w);break;case"selectionchange":if(Sm)break;case"keydown":case"keyup":sr(O,n,w)}var ge;if(qi)e:{switch(e){case"compositionstart":var pe="onCompositionStart";break e;case"compositionend":pe="onCompositionEnd";break e;case"compositionupdate":pe="onCompositionUpdate";break e}pe=void 0}else pl?$f(e,n)&&(pe="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(pe="onCompositionStart");pe&&(Vf&&n.locale!=="ko"&&(pl||pe!=="onCompositionStart"?pe==="onCompositionEnd"&&pl&&(ge=Gf()):(hn=w,Ri="value"in hn?hn.value:hn.textContent,pl=!0)),te=ei(C,pe),0<te.length&&(pe=new Kf(pe,e,null,n,w),O.push({event:pe,listeners:te}),ge?pe.data=ge:(ge=Ff(n),ge!==null&&(pe.data=ge)))),(ge=fm?rm(e,n):om(e,n))&&(pe=ei(C,"onBeforeInput"),0<pe.length&&(te=new Kf("onBeforeInput","beforeinput",null,n,w),O.push({event:te,listeners:pe}),te.data=ge)),ng(O,e,C,n,w)}Dd(O,t)})}function Ha(e,t,n){return{instance:e,listener:t,currentTarget:n}}function ei(e,t){for(var n=t+"Capture",l=[];e!==null;){var a=e,u=a.stateNode;if(a=a.tag,a!==5&&a!==26&&a!==27||u===null||(a=aa(e,n),a!=null&&l.unshift(Ha(e,a,u)),a=aa(e,t),a!=null&&l.push(Ha(e,a,u))),e.tag===3)return l;e=e.return}return[]}function ig(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Hd(e,t,n,l,a){for(var u=t._reactName,f=[];n!==null&&n!==l;){var o=n,y=o.alternate,C=o.stateNode;if(o=o.tag,y!==null&&y===l)break;o!==5&&o!==26&&o!==27||C===null||(y=C,a?(C=aa(n,u),C!=null&&f.unshift(Ha(n,C,y))):a||(C=aa(n,u),C!=null&&f.push(Ha(n,C,y)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var cg=/\\r\\n?/g,sg=/\\u0000|\\uFFFD/g;function qd(e){return(typeof e=="string"?e:""+e).replace(cg,\`
|
|
16
|
+
\`).replace(sg,"")}function Yd(e,t){return t=qd(t),qd(e)===t}function Ue(e,t,n,l,a,u){switch(n){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||vl(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&vl(e,""+l);break;case"className":au(e,"class",l);break;case"tabIndex":au(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":au(e,n,l);break;case"style":qf(e,l,u);break;case"data":if(t!=="object"){au(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=iu(""+l),e.setAttribute(n,l);break;case"action":case"formAction":if(typeof l=="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}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&Ue(e,t,"name",a.name,a,null),Ue(e,t,"formEncType",a.formEncType,a,null),Ue(e,t,"formMethod",a.formMethod,a,null),Ue(e,t,"formTarget",a.formTarget,a,null)):(Ue(e,t,"encType",a.encType,a,null),Ue(e,t,"method",a.method,a,null),Ue(e,t,"target",a.target,a,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(n);break}l=iu(""+l),e.setAttribute(n,l);break;case"onClick":l!=null&&(e.onclick=kt);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}n=iu(""+l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""+l):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":l===!0?e.setAttribute(n,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(n,l):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(n,l):e.removeAttribute(n);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(n):e.setAttribute(n,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),lu(e,"popover",l);break;case"xlinkActuate":Vt(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":Vt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":Vt(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":Vt(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":Vt(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":Vt(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":Vt(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":lu(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=B0.get(n)||n,lu(e,n,l))}}function ms(e,t,n,l,a,u){switch(n){case"style":qf(e,l,u);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(n=l.__html,n!=null){if(a.children!=null)throw Error(s(60));e.innerHTML=n}}break;case"children":typeof l=="string"?vl(e,l):(typeof l=="number"||typeof l=="bigint")&&vl(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=kt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!_f.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(a=n.endsWith("Capture"),t=n.slice(2,a?n.length-7:void 0),u=e[ct]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,a),typeof l=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,l,a);break e}n in e?e[n]=l:l===!0?e.setAttribute(n,""):lu(e,n,l)}}}function tt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,a=!1,u;for(u in n)if(n.hasOwnProperty(u)){var f=n[u];if(f!=null)switch(u){case"src":l=!0;break;case"srcSet":a=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ue(e,t,u,f,n,null)}}a&&Ue(e,t,"srcSet",n.srcSet,n,null),l&&Ue(e,t,"src",n.src,n,null);return;case"input":ve("invalid",e);var o=u=f=a=null,y=null,C=null;for(l in n)if(n.hasOwnProperty(l)){var w=n[l];if(w!=null)switch(l){case"name":a=w;break;case"type":f=w;break;case"checked":y=w;break;case"defaultChecked":C=w;break;case"value":u=w;break;case"defaultValue":o=w;break;case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(137,t));break;default:Ue(e,t,l,w,n,null)}}Of(e,u,o,y,C,f,a,!1);return;case"select":ve("invalid",e),l=f=u=null;for(a in n)if(n.hasOwnProperty(a)&&(o=n[a],o!=null))switch(a){case"value":u=o;break;case"defaultValue":f=o;break;case"multiple":l=o;default:Ue(e,t,a,o,n,null)}t=u,n=f,e.multiple=!!l,t!=null?yl(e,!!l,t,!1):n!=null&&yl(e,!!l,n,!0);return;case"textarea":ve("invalid",e),u=a=l=null;for(f in n)if(n.hasOwnProperty(f)&&(o=n[f],o!=null))switch(f){case"value":l=o;break;case"defaultValue":a=o;break;case"children":u=o;break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(s(91));break;default:Ue(e,t,f,o,n,null)}Bf(e,l,a,u);return;case"option":for(y in n)if(n.hasOwnProperty(y)&&(l=n[y],l!=null))switch(y){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Ue(e,t,y,l,n,null)}return;case"dialog":ve("beforetoggle",e),ve("toggle",e),ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Ba.length;l++)ve(Ba[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("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(C in n)if(n.hasOwnProperty(C)&&(l=n[C],l!=null))switch(C){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ue(e,t,C,l,n,null)}return;default:if(xi(t)){for(w in n)n.hasOwnProperty(w)&&(l=n[w],l!==void 0&&ms(e,t,w,l,n,void 0));return}}for(o in n)n.hasOwnProperty(o)&&(l=n[o],l!=null&&Ue(e,t,o,l,n,null))}function fg(e,t,n,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var a=null,u=null,f=null,o=null,y=null,C=null,w=null;for(_ in n){var O=n[_];if(n.hasOwnProperty(_)&&O!=null)switch(_){case"checked":break;case"value":break;case"defaultValue":y=O;default:l.hasOwnProperty(_)||Ue(e,t,_,null,l,O)}}for(var x in l){var _=l[x];if(O=n[x],l.hasOwnProperty(x)&&(_!=null||O!=null))switch(x){case"type":u=_;break;case"name":a=_;break;case"checked":C=_;break;case"defaultChecked":w=_;break;case"value":f=_;break;case"defaultValue":o=_;break;case"children":case"dangerouslySetInnerHTML":if(_!=null)throw Error(s(137,t));break;default:_!==O&&Ue(e,t,x,_,l,O)}}Ni(e,f,o,y,C,w,u,a);return;case"select":_=f=o=x=null;for(u in n)if(y=n[u],n.hasOwnProperty(u)&&y!=null)switch(u){case"value":break;case"multiple":_=y;default:l.hasOwnProperty(u)||Ue(e,t,u,null,l,y)}for(a in l)if(u=l[a],y=n[a],l.hasOwnProperty(a)&&(u!=null||y!=null))switch(a){case"value":x=u;break;case"defaultValue":o=u;break;case"multiple":f=u;default:u!==y&&Ue(e,t,a,u,l,y)}t=o,n=f,l=_,x!=null?yl(e,!!n,x,!1):!!l!=!!n&&(t!=null?yl(e,!!n,t,!0):yl(e,!!n,n?[]:"",!1));return;case"textarea":_=x=null;for(o in n)if(a=n[o],n.hasOwnProperty(o)&&a!=null&&!l.hasOwnProperty(o))switch(o){case"value":break;case"children":break;default:Ue(e,t,o,null,l,a)}for(f in l)if(a=l[f],u=n[f],l.hasOwnProperty(f)&&(a!=null||u!=null))switch(f){case"value":x=a;break;case"defaultValue":_=a;break;case"children":break;case"dangerouslySetInnerHTML":if(a!=null)throw Error(s(91));break;default:a!==u&&Ue(e,t,f,a,l,u)}Df(e,x,_);return;case"option":for(var P in n)if(x=n[P],n.hasOwnProperty(P)&&x!=null&&!l.hasOwnProperty(P))switch(P){case"selected":e.selected=!1;break;default:Ue(e,t,P,null,l,x)}for(y in l)if(x=l[y],_=n[y],l.hasOwnProperty(y)&&x!==_&&(x!=null||_!=null))switch(y){case"selected":e.selected=x&&typeof x!="function"&&typeof x!="symbol";break;default:Ue(e,t,y,x,l,_)}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 ie in n)x=n[ie],n.hasOwnProperty(ie)&&x!=null&&!l.hasOwnProperty(ie)&&Ue(e,t,ie,null,l,x);for(C in l)if(x=l[C],_=n[C],l.hasOwnProperty(C)&&x!==_&&(x!=null||_!=null))switch(C){case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(s(137,t));break;default:Ue(e,t,C,x,l,_)}return;default:if(xi(t)){for(var Re in n)x=n[Re],n.hasOwnProperty(Re)&&x!==void 0&&!l.hasOwnProperty(Re)&&ms(e,t,Re,void 0,l,x);for(w in l)x=l[w],_=n[w],!l.hasOwnProperty(w)||x===_||x===void 0&&_===void 0||ms(e,t,w,x,l,_);return}}for(var T in n)x=n[T],n.hasOwnProperty(T)&&x!=null&&!l.hasOwnProperty(T)&&Ue(e,t,T,null,l,x);for(O in l)x=l[O],_=n[O],!l.hasOwnProperty(O)||x===_||x==null&&_==null||Ue(e,t,O,x,l,_)}function Ld(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rg(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),l=0;l<n.length;l++){var a=n[l],u=a.transferSize,f=a.initiatorType,o=a.duration;if(u&&o&&Ld(f)){for(f=0,o=a.responseEnd,l+=1;l<n.length;l++){var y=n[l],C=y.startTime;if(C>o)break;var w=y.transferSize,O=y.initiatorType;w&&Ld(O)&&(y=y.responseEnd,f+=w*(y<o?1:(o-C)/(y-C)))}if(--l,t+=8*(u+f)/(a.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 gs=null,ys=null;function ti(e){return e.nodeType===9?e:e.ownerDocument}function Gd(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 Qd(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 vs(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 bs=null;function og(){var e=window.event;return e&&e.type==="popstate"?e===bs?!1:(bs=e,!0):(bs=null,!1)}var Xd=typeof setTimeout=="function"?setTimeout:void 0,dg=typeof clearTimeout=="function"?clearTimeout:void 0,Kd=typeof Promise=="function"?Promise:void 0,hg=typeof queueMicrotask=="function"?queueMicrotask:typeof Kd<"u"?function(e){return Kd.resolve(null).then(e).catch(mg)}:Xd;function mg(e){setTimeout(function(){throw e})}function Mn(e){return e==="head"}function Zd(e,t){var n=t,l=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"||n==="/&"){if(l===0){e.removeChild(a),Jl(t);return}l--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")l++;else if(n==="html")qa(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,qa(n);for(var u=n.firstChild;u;){var f=u.nextSibling,o=u.nodeName;u[na]||o==="SCRIPT"||o==="STYLE"||o==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=f}}else n==="body"&&qa(e.ownerDocument.body);n=a}while(n);Jl(t)}function Vd(e,t){var n=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(n=l.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=l}while(n)}function Ss(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":Ss(n),zi(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function gg(e,t,n,l){for(;e.nodeType===1;){var a=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[na])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==a.rel||e.getAttribute("href")!==(a.href==null||a.href===""?null:a.href)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin)||e.getAttribute("title")!==(a.title==null?null:a.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(a.src==null?null:a.src)||e.getAttribute("type")!==(a.type==null?null:a.type)||e.getAttribute("crossorigin")!==(a.crossOrigin==null?null:a.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=a.name==null?null:""+a.name;if(a.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=Rt(e.nextSibling),e===null)break}return null}function yg(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rt(e.nextSibling),e===null))return null;return e}function kd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rt(e.nextSibling),e===null))return null;return e}function ps(e){return e.data==="$?"||e.data==="$~"}function Es(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function vg(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var l=function(){t(),n.removeEventListener("DOMContentLoaded",l)};n.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Rt(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 Ts=null;function Jd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rt(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function $d(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 Fd(e,t,n){switch(t=ti(n),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function qa(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zi(e)}var Ot=new Map,Wd=new Set;function ni(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rn=G.d;G.d={f:bg,r:Sg,D:pg,C:Eg,L:Tg,m:Ag,X:Cg,S:zg,M:Ng};function bg(){var e=rn.f(),t=ku();return e||t}function Sg(e){var t=hl(e);t!==null&&t.tag===5&&t.type==="form"?mo(t):rn.r(e)}var Zl=typeof document>"u"?null:document;function Id(e,t,n){var l=Zl;if(l&&typeof t=="string"&&t){var a=Nt(t);a='link[rel="'+e+'"][href="'+a+'"]',typeof n=="string"&&(a+='[crossorigin="'+n+'"]'),Wd.has(a)||(Wd.add(a),e={rel:e,crossOrigin:n,href:t},l.querySelector(a)===null&&(t=l.createElement("link"),tt(t,"link",e),$e(t),l.head.appendChild(t)))}}function pg(e){rn.D(e),Id("dns-prefetch",e,null)}function Eg(e,t){rn.C(e,t),Id("preconnect",e,t)}function Tg(e,t,n){rn.L(e,t,n);var l=Zl;if(l&&e&&t){var a='link[rel="preload"][as="'+Nt(t)+'"]';t==="image"&&n&&n.imageSrcSet?(a+='[imagesrcset="'+Nt(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(a+='[imagesizes="'+Nt(n.imageSizes)+'"]')):a+='[href="'+Nt(e)+'"]';var u=a;switch(t){case"style":u=Vl(e);break;case"script":u=kl(e)}Ot.has(u)||(e=E({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),Ot.set(u,e),l.querySelector(a)!==null||t==="style"&&l.querySelector(Ya(u))||t==="script"&&l.querySelector(La(u))||(t=l.createElement("link"),tt(t,"link",e),$e(t),l.head.appendChild(t)))}}function Ag(e,t){rn.m(e,t);var n=Zl;if(n&&e){var l=t&&typeof t.as=="string"?t.as:"script",a='link[rel="modulepreload"][as="'+Nt(l)+'"][href="'+Nt(e)+'"]',u=a;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=kl(e)}if(!Ot.has(u)&&(e=E({rel:"modulepreload",href:e},t),Ot.set(u,e),n.querySelector(a)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(La(u)))return}l=n.createElement("link"),tt(l,"link",e),$e(l),n.head.appendChild(l)}}}function zg(e,t,n){rn.S(e,t,n);var l=Zl;if(l&&e){var a=ml(l).hoistableStyles,u=Vl(e);t=t||"default";var f=a.get(u);if(!f){var o={loading:0,preload:null};if(f=l.querySelector(Ya(u)))o.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},n),(n=Ot.get(u))&&As(e,n);var y=f=l.createElement("link");$e(y),tt(y,"link",e),y._p=new Promise(function(C,w){y.onload=C,y.onerror=w}),y.addEventListener("load",function(){o.loading|=1}),y.addEventListener("error",function(){o.loading|=2}),o.loading|=4,li(f,t,l)}f={type:"stylesheet",instance:f,count:1,state:o},a.set(u,f)}}}function Cg(e,t){rn.X(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=kl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0},t),(t=Ot.get(a))&&zs(e,t),u=n.createElement("script"),$e(u),tt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(a,u))}}function Ng(e,t){rn.M(e,t);var n=Zl;if(n&&e){var l=ml(n).hoistableScripts,a=kl(e),u=l.get(a);u||(u=n.querySelector(La(a)),u||(e=E({src:e,async:!0,type:"module"},t),(t=Ot.get(a))&&zs(e,t),u=n.createElement("script"),$e(u),tt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},l.set(a,u))}}function Pd(e,t,n,l){var a=(a=re.current)?ni(a):null;if(!a)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Vl(n.href),n=ml(a).hoistableStyles,l=n.get(t),l||(l={type:"style",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Vl(n.href);var u=ml(a).hoistableStyles,f=u.get(e);if(f||(a=a.ownerDocument||a,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=a.querySelector(Ya(e)))&&!u._p&&(f.instance=u,f.state.loading=5),Ot.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Ot.set(e,n),u||jg(a,e,n,f.state))),t&&l===null)throw Error(s(528,""));return f}if(t&&l!==null)throw Error(s(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=kl(n),n=ml(a).hoistableScripts,l=n.get(t),l||(l={type:"script",instance:null,count:0,state:null},n.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Vl(e){return'href="'+Nt(e)+'"'}function Ya(e){return'link[rel="stylesheet"]['+e+"]"}function eh(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function jg(e,t,n,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),tt(t,"link",n),$e(t),e.head.appendChild(t))}function kl(e){return'[src="'+Nt(e)+'"]'}function La(e){return"script[async]"+e}function th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Nt(n.href)+'"]');if(l)return t.instance=l,$e(l),l;var a=E({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),$e(l),tt(l,"style",a),li(l,n.precedence,e),t.instance=l;case"stylesheet":a=Vl(n.href);var u=e.querySelector(Ya(a));if(u)return t.state.loading|=4,t.instance=u,$e(u),u;l=eh(n),(a=Ot.get(a))&&As(l,a),u=(e.ownerDocument||e).createElement("link"),$e(u);var f=u;return f._p=new Promise(function(o,y){f.onload=o,f.onerror=y}),tt(u,"link",l),t.state.loading|=4,li(u,n.precedence,e),t.instance=u;case"script":return u=kl(n.src),(a=e.querySelector(La(u)))?(t.instance=a,$e(a),a):(l=n,(a=Ot.get(u))&&(l=E({},n),zs(l,a)),e=e.ownerDocument||e,a=e.createElement("script"),$e(a),tt(a,"link",l),e.head.appendChild(a),t.instance=a);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,li(l,n.precedence,e));return t.instance}function li(e,t,n){for(var l=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),a=l.length?l[l.length-1]:null,u=a,f=0;f<l.length;f++){var o=l[f];if(o.dataset.precedence===t)u=o;else if(u!==a)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function As(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function zs(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var ai=null;function nh(e,t,n){if(ai===null){var l=new Map,a=ai=new Map;a.set(n,l)}else a=ai,l=a.get(n),l||(l=new Map,a.set(n,l));if(l.has(e))return l;for(l.set(e,null),n=n.getElementsByTagName(e),a=0;a<n.length;a++){var u=n[a];if(!(u[na]||u[We]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var f=u.getAttribute(t)||"";f=e+f;var o=l.get(f);o?o.push(u):l.set(f,[u])}}return l}function lh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function xg(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 ah(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function _g(e,t,n,l){if(n.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var a=Vl(l.href),u=t.querySelector(Ya(a));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ui.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,$e(u);return}u=t.ownerDocument||t,l=eh(l),(a=Ot.get(a))&&As(l,a),u=u.createElement("link"),$e(u);var f=u;f._p=new Promise(function(o,y){f.onload=o,f.onerror=y}),tt(u,"link",l),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=ui.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var Cs=0;function Mg(e,t){return e.stylesheets&&e.count===0&&ci(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var l=setTimeout(function(){if(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&Cs===0&&(Cs=62500*rg());var a=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ci(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>Cs?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(a)}}:null}function ui(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ci(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ii=null;function ci(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ii=new Map,t.forEach(wg,e),ii=null,ui.call(e))}function wg(e,t){if(!(t.state.loading&4)){var n=ii.get(e);if(n)var l=n.get(null);else{n=new Map,ii.set(e,n);for(var a=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<a.length;u++){var f=a[u];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),l=f)}l&&n.set(null,l)}a=t.instance,f=a.getAttribute("data-precedence"),u=n.get(f)||l,u===l&&n.set(null,a),n.set(f,a),this.count++,l=ui.bind(this),a.addEventListener("load",l),a.addEventListener("error",l),u?u.parentNode.insertBefore(a,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(a,e.firstChild)),t.state.loading|=4}}var Ga={$$typeof:I,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function Ug(e,t,n,l,a,u,f,o,y){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=pi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pi(0),this.hiddenUpdates=pi(null),this.identifierPrefix=l,this.onUncaughtError=a,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=y,this.incompleteTransitions=new Map}function uh(e,t,n,l,a,u,f,o,y,C,w,O){return e=new Ug(e,t,n,f,y,C,w,O,o),t=1,u===!0&&(t|=24),u=vt(3,null,null,t),e.current=u,u.stateNode=e,t=ac(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:l,isDehydrated:n,cache:t},sc(u),e}function ih(e){return e?(e=zl,e):zl}function ch(e,t,n,l,a,u){a=ih(a),l.context===null?l.context=a:l.pendingContext=a,l=Sn(t),l.payload={element:n},u=u===void 0?null:u,u!==null&&(l.callback=u),n=pn(e,l,t),n!==null&&(ht(n,e,t),Sa(n,e,t))}function sh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Ns(e,t){sh(e,t),(e=e.alternate)&&sh(e,t)}function fh(e){if(e.tag===13||e.tag===31){var t=Qn(e,67108864);t!==null&&ht(t,e,67108864),Ns(e,67108864)}}function rh(e){if(e.tag===13||e.tag===31){var t=Tt();t=Ei(t);var n=Qn(e,t);n!==null&&ht(n,e,t),Ns(e,t)}}var si=!0;function Rg(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=2,js(e,t,n,l)}finally{G.p=u,M.T=a}}function Og(e,t,n,l){var a=M.T;M.T=null;var u=G.p;try{G.p=8,js(e,t,n,l)}finally{G.p=u,M.T=a}}function js(e,t,n,l){if(si){var a=xs(l);if(a===null)hs(e,t,l,fi,n),dh(e,l);else if(Bg(a,e,t,n,l))l.stopPropagation();else if(dh(e,l),t&4&&-1<Dg.indexOf(e)){for(;a!==null;){var u=hl(a);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=Hn(u.pendingLanes);if(f!==0){var o=u;for(o.pendingLanes|=2,o.entangledLanes|=2;f;){var y=1<<31-gt(f);o.entanglements[1]|=y,f&=~y}Qt(u),(je&6)===0&&(Zu=ut()+500,Da(0))}}break;case 31:case 13:o=Qn(u,2),o!==null&&ht(o,u,2),ku(),Ns(u,2)}if(u=xs(l),u===null&&hs(e,t,l,fi,n),u===a)break;a=u}a!==null&&l.stopPropagation()}else hs(e,t,l,null,n)}}function xs(e){return e=Mi(e),_s(e)}var fi=null;function _s(e){if(fi=null,e=dl(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=v(t),e!==null)return e;e=null}else if(n===31){if(e=A(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 fi=e,null}function oh(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"resize":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"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"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(H()){case J:return 2;case he:return 8;case De:case lt:return 32;case rl:return 268435456;default:return 32}default:return 32}}var Ms=!1,wn=null,Un=null,Rn=null,Qa=new Map,Xa=new Map,On=[],Dg="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 dh(e,t){switch(e){case"focusin":case"focusout":wn=null;break;case"dragenter":case"dragleave":Un=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":Qa.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Xa.delete(t.pointerId)}}function Ka(e,t,n,l,a,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:l,nativeEvent:u,targetContainers:[a]},t!==null&&(t=hl(t),t!==null&&fh(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function Bg(e,t,n,l,a){switch(t){case"focusin":return wn=Ka(wn,e,t,n,l,a),!0;case"dragenter":return Un=Ka(Un,e,t,n,l,a),!0;case"mouseover":return Rn=Ka(Rn,e,t,n,l,a),!0;case"pointerover":var u=a.pointerId;return Qa.set(u,Ka(Qa.get(u)||null,e,t,n,l,a)),!0;case"gotpointercapture":return u=a.pointerId,Xa.set(u,Ka(Xa.get(u)||null,e,t,n,l,a)),!0}return!1}function hh(e){var t=dl(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=v(n),t!==null){e.blockedOn=t,Nf(e.priority,function(){rh(n)});return}}else if(t===31){if(t=A(n),t!==null){e.blockedOn=t,Nf(e.priority,function(){rh(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 ri(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=xs(e.nativeEvent);if(n===null){n=e.nativeEvent;var l=new n.constructor(n.type,n);_i=l,n.target.dispatchEvent(l),_i=null}else return t=hl(n),t!==null&&fh(t),e.blockedOn=n,!1;t.shift()}return!0}function mh(e,t,n){ri(e)&&n.delete(t)}function Hg(){Ms=!1,wn!==null&&ri(wn)&&(wn=null),Un!==null&&ri(Un)&&(Un=null),Rn!==null&&ri(Rn)&&(Rn=null),Qa.forEach(mh),Xa.forEach(mh)}function oi(e,t){e.blockedOn===t&&(e.blockedOn=null,Ms||(Ms=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Hg)))}var di=null;function gh(e){di!==e&&(di=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){di===e&&(di=null);for(var t=0;t<e.length;t+=3){var n=e[t],l=e[t+1],a=e[t+2];if(typeof l!="function"){if(_s(l||n)===null)continue;break}var u=hl(n);u!==null&&(e.splice(t,3),t-=3,xc(u,{pending:!0,data:a,method:n.method,action:l},l,a))}}))}function Jl(e){function t(y){return oi(y,e)}wn!==null&&oi(wn,e),Un!==null&&oi(Un,e),Rn!==null&&oi(Rn,e),Qa.forEach(t),Xa.forEach(t);for(var n=0;n<On.length;n++){var l=On[n];l.blockedOn===e&&(l.blockedOn=null)}for(;0<On.length&&(n=On[0],n.blockedOn===null);)hh(n),n.blockedOn===null&&On.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(l=0;l<n.length;l+=3){var a=n[l],u=n[l+1],f=a[ct]||null;if(typeof u=="function")f||gh(n);else if(f){var o=null;if(u&&u.hasAttribute("formAction")){if(a=u,f=u[ct]||null)o=f.formAction;else if(_s(a)!==null)continue}else o=f.action;typeof o=="function"?n[l+1]=o:(n.splice(l,3),l-=3),gh(n)}}}function yh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(f){return a=f})},focusReset:"manual",scroll:"manual"})}function t(){a!==null&&(a(),a=null),l||setTimeout(n,20)}function n(){if(!l&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,a=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),a!==null&&(a(),a=null)}}}function ws(e){this._internalRoot=e}hi.prototype.render=ws.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var n=t.current,l=Tt();ch(n,l,e,t,null,null)},hi.prototype.unmount=ws.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ch(e.current,2,null,e,null,null),ku(),t[ol]=null}};function hi(e){this._internalRoot=e}hi.prototype.unstable_scheduleHydration=function(e){if(e){var t=Cf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<On.length&&t!==0&&t<On[n].priority;n++);On.splice(n,0,e),n===0&&hh(e)}};var vh=c.version;if(vh!=="19.2.8")throw Error(s(527,vh,"19.2.8"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=g(t),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var qg={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mi.isDisabled&&mi.supportsFiber)try{Pl=mi.inject(qg),mt=mi}catch{}}return Va.createRoot=function(e,t){if(!d(e))throw Error(s(299));var n=!1,l="",a=zo,u=Co,f=No;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(a=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=uh(e,1,!1,null,null,n,l,null,a,u,f,yh),e[ol]=t.current,ds(e),new ws(t)},Va.hydrateRoot=function(e,t,n){if(!d(e))throw Error(s(299));var l=!1,a="",u=zo,f=Co,o=No,y=null;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(a=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(o=n.onRecoverableError),n.formState!==void 0&&(y=n.formState)),t=uh(e,1,!0,t,n??null,l,a,y,u,f,o,yh),t.context=ih(null),n=t.current,l=Tt(),l=Ei(l),a=Sn(l),a.callback=null,pn(n,a,l),n=l,t.current.lanes=n,ta(t,n),Qt(t),e[ol]=t.current,ds(e),new hi(t)},Va.version="19.2.8",Va}var jh;function $g(){if(jh)return Os.exports;jh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Os.exports=Jg(),Os.exports}var Fg=$g(),Wg=["runtime.ready","store.ready","runtime.stopping","agent.loaded","agent.disposed","agent.warning","plugin.loaded","plugin.slow","approval.requested","approval.resolved","handoff.start","handoff.result","turn.start","context.assembled","context.dropped","context.pressure","compaction.stage","context.reset","phase.changed","model.call","model.chunk","model.retry","model.result","tool.call","tool.result","tool.gated","tool.repair","tools.refreshed","agent.channel.status","agent.channel.error","agent.channel.rejected","delivery.sent","delivery.retry","delivery.failed","delivery.uncertain","runtime.released","schedules.reconciled","schedule.fired","schedule.skipped","schedule.deferred","schedule.error","turn.end","error"],Ig=/\\r\\n\\r\\n|\\n\\n|\\r\\r/;function xh(i){const c=[];let r,s,d;for(const h of i.split(/\\r\\n|\\n|\\r/)){if(h===""||h.startsWith(":"))continue;const v=h.indexOf(":"),A=v===-1?h:h.slice(0,v);let p=v===-1?"":h.slice(v+1);switch(p.startsWith(" ")&&(p=p.slice(1)),A){case"data":c.push(p);break;case"event":r=p;break;case"id":s=p;break;case"retry":{const g=Number.parseInt(p,10);Number.isFinite(g)&&(d=g);break}}}if(!(c.length===0&&r===void 0))return{...r===void 0?{}:{event:r},data:c.join(\`
|
|
17
|
+
\`),...s===void 0?{}:{id:s},...d===void 0?{}:{retry:d}}}async function*Pg(i){const c=new TextDecoder;let r="";for await(const s of i)for(r+=typeof s=="string"?s:c.decode(s,{stream:!0});;){const d=Ig.exec(r);if(d===null)break;const h=r.slice(0,d.index);r=r.slice(d.index+d[0].length);const v=xh(h);v!==void 0&&(yield v)}if(r+=c.decode(),r.trim()!==""){const s=xh(r);s!==void 0&&(yield s)}}function s0(){return{push:i=>i,endStep:()=>"",end:()=>""}}function ey(i){return i!=="final"&&i!=="stopped"}function ty(i,c={}){switch(i){case"final":return;case"max_steps":return\`stopped\${c.steps===void 0?"":\` after \${c.steps} steps\`} without finishing — say "continue" to carry on, or raise limits.maxSteps\`;case"no_progress":return'stopped: the same tool call was repeated with no change — say "continue" with more to go on, or check whether that tool is telling it anything useful';case"truncated":return"the reply was cut off at the output limit — raise model.<role>.maxTokens, or ask for less";case"timeout":return\`timed out\${c.durationMs===void 0?"":\` after \${c.durationMs} ms\`} — raise limits.turnTimeoutMs\`;case"stopped":return c.cancelledAfterMs===void 0?"cancelled":\`cancelled after \${c.cancelledAfterMs.toFixed(0)} ms\`;case"error":return}}var ny="<<<",ly=">>>",$a=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?<?\\s*action\\s*:\\s*(.+?)\\s*>?\\s*$/i,ay=/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?([A-Za-z_][\\w.-]*?)\\s*:\\s*(.*)$/,hf=/^\\s*\`{3,}\\s*[\\w+-]*\\s*$/,qs=/^\\s*end\\s*$/i,uy=/^\\s*<\\s*action\\s*>\\s*$/i,_h=/^\\s*<\\s*\\/\\s*action\\s*>\\s*$/i,iy=/^\\s*<\\/?\\s*[A-Za-z_][\\w.:-]*\\s*\\/?\\s*>\\s*$/;function Ys(i){return i.replace(/^[\`'"*<]+/,"").replace(/[\`'"*>]+$/,"").replace(/[.,;:]+$/,"").trim()}function f0(i,c,r){const s=i.fields.get(c);s===void 0?i.fields.set(c,[r]):s.push(r)}function r0(i){if(i.block===void 0||i.heredocKey===void 0)return;const c=[...i.heredocLines];c[c.length-1]===""&&c.pop(),f0(i.block,i.heredocKey,c.join(\`
|
|
18
|
+
\`)),i.block.wrapped.add(i.heredocKey),i.heredocKey=void 0,i.heredocLines=[]}function tl(i){r0(i),i.block!==void 0&&i.blocks.push(i.block),i.block=void 0,i.openKey=void 0,i.awaitingSlug=!1}function Mh(){return{block:void 0,openKey:void 0,severedKey:void 0,severedPending:void 0,heredocKey:void 0,heredocLines:[],justClosed:!1,awaitingSlug:!1,text:[],blocks:[]}}function cy(i,c,r){const s=c.trim();if(i.heredocKey!==void 0){if(s===ly){r0(i);return}if(qs.test(s)){tl(i),i.justClosed=!0;return}if($a.test(c)){tl(i);const v=$a.exec(c),A=Ys(v?.[1]??"");A!==""&&(i.block={slug:A,fields:new Map,wrapped:new Set,severed:new Set});return}i.heredocLines.push(c);return}const d=$a.exec(c);if(d!==null){const v=Ys(d[1]??"");if(tl(i),v==="")return;i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set};return}if(uy.test(c)){tl(i),i.awaitingSlug=!0;return}if(i.awaitingSlug){if(s==="")return;if(_h.test(c)){i.awaitingSlug=!1;return}const v=Ys(s);i.awaitingSlug=!1,v!==""&&(i.block={slug:v,fields:new Map,wrapped:new Set,severed:new Set});return}if(_h.test(c)){i.block!==void 0&&(tl(i),i.justClosed=!0);return}if(iy.test(c))return;if(i.block===void 0){if(hf.test(c)&&(i.justClosed||r())){i.justClosed=!1;return}if(qs.test(s)&&i.severedPending!==void 0){i.severedPending.block.severed.add(i.severedPending.key),i.severedPending=void 0;return}$a.test(c)&&(i.severedPending=void 0),i.text.push(c),s!==""&&(i.justClosed=!1);return}if(s===""){i.openKey!==void 0&&(i.severedKey=i.openKey),i.openKey=void 0;return}if(qs.test(s)){i.severedKey=void 0,tl(i),i.justClosed=!0;return}if(hf.test(c))return;const h=ay.exec(c);if(h!==null){const v=(h[1]??"").trim(),A=(h[2]??"").trim();i.severedKey=void 0,A===ny?(i.heredocKey=v,i.heredocLines=[],i.openKey=void 0):(f0(i.block,v,A),i.openKey=v);return}if(i.openKey!==void 0){const v=i.block.fields.get(i.openKey),A=v?.[v.length-1];v!==void 0&&A!==void 0&&(v[v.length-1]=A===""?s:\`\${A}
|
|
19
|
+
\${s}\`);return}i.severedKey!==void 0&&(i.severedPending={block:i.block,key:i.severedKey},i.severedKey=void 0),tl(i),i.text.push(c)}function sy(i){if(/^\\s*(?:[-*+]|\\d+[.)]?)?\\s*$/.test(i))return!0;const c=i.replace(/^\\s*(?:[-*+]\\s+|\\d+[.)]\\s+)?/,"").toLowerCase(),r=c.startsWith("<")?c.slice(1):c;return"action:".startsWith(r)||r.startsWith("action:")||/^<\\/?$/.test(c)||/^<\\/?[a-z_][\\w.:-]*>?$/.test(c)?!0:/^\`{1,3}[\\w+-]*$/.test(c)}function Ls(i){return i.endsWith("\\r")?i.slice(0,-1):i}function fy(){let i=Mh(),c="",r=0,s,d="",h=!1;const v=E=>{if(E==="")return"";if(E.trim()==="")return d+=E,"";const j=d+E;return d="",h?j:(h=!0,j.replace(/^\\s+/,""))},A=(E,j)=>{const B=i.text.length;return cy(i,E,()=>j!==void 0&&$a.test(j)),i.text.length>B?E:void 0},p=(E,j,B)=>{const X=A(E,j);return X===void 0?"":v(X.slice(B))+v(\`
|
|
20
|
+
\`)},g=E=>{if(s===void 0)return"";const j=s;return s=void 0,p(j,E,0)};return{push(E){let j="";c+=E;let B=c.indexOf(\`
|
|
21
|
+
\`);for(;B!==-1;){const D=Ls(c.slice(0,B));c=c.slice(B+1),j+=g(D),i.block===void 0&&hf.test(D)&&!i.justClosed?s=D:j+=p(D,void 0,r),r=0,B=c.indexOf(\`
|
|
22
|
+
\`)}const X=Ls(c);return i.block===void 0&&!i.awaitingSlug&&s===void 0&&!sy(X)&&(j+=v(X.slice(r)),r=X.length),j},endStep(){const E=N();return d=\`
|
|
23
|
+
|
|
24
|
+
\`,i=Mh(),E},end:N};function N(){let E=g(void 0);const j=Ls(c);if(j!==""){const B=A(j,void 0);B!==void 0&&(E+=v(B.slice(r)))}return c="",r=0,s=void 0,E}}class Zt extends Error{code;hint;field;status;request;constructor(c,r={}){super(c.hint===void 0?c.message:\`\${c.message}
|
|
25
|
+
hint: \${c.hint}\`),this.name="DispachError",this.code=c.code,this.hint=c.hint??"",this.field=c.field,this.status=r.status,this.request=r.method===void 0||r.path===void 0?void 0:{method:r.method,path:r.path},r.cause!==void 0&&(this.cause=r.cause)}}function ry(i,c){const r=i instanceof Error?i.message:String(i);return new Zt({code:"transport_failed",message:\`\${c.method} \${c.path} did not reach \${c.baseUrl}: \${r}\`,hint:"Check the base URL, that the server is running, and that nothing between you and it is refusing the connection. \`GET /v1/health\` needs no token and is the cheapest probe."},{...c,cause:i})}async function oy(i,c){let r;try{const s=await i.json();typeof s.error?.code=="string"&&typeof s.error.message=="string"&&(r={code:s.error.code,message:s.error.message,...s.error.hint===void 0?{}:{hint:s.error.hint},...s.error.field===void 0?{}:{field:s.error.field}})}catch{}return new Zt(r??{code:\`http_\${i.status}\`,message:\`\${c.method} \${c.path} returned \${i.status} with no error body.\`,hint:"This is not a response this server produces, so something between you and it answered — a proxy, a gateway, or a load balancer. Check the URL and what is in front of it."},{status:i.status,...c})}var o0=new Set(Wg);async function*d0(i){for await(const c of Pg(dy(i))){if(c.event===void 0||c.data==="")continue;let r;try{r=JSON.parse(c.data)}catch{continue}yield{name:c.event,data:r}}}async function*dy(i){const c=i.getReader();try{for(;;){const{done:r,value:s}=await c.read();if(r)return;s!==void 0&&(yield s)}}finally{c.releaseLock()}}async function*hy(i){for await(const{name:c,data:r}of d0(i)){if(o0.has(c)){yield{kind:"event",event:r};continue}const s=r??{};switch(c){case"turn.accepted":yield{kind:"accepted",turnId:String(s.turnId??""),sessionKey:String(s.sessionKey??"")};break;case"stream.replay":yield{kind:"replay",report:{state:s.state==="ended"?"ended":"running",events:Number(s.events??0),truncated:s.truncated===!0,dropped:Number(s.dropped??0),chunks:s.chunks==="start"||s.chunks==="partial"?s.chunks:"none"}};break;case"stream.ended":yield{kind:"ended",turnId:String(s.turnId??""),status:String(s.status??"unknown"),steps:typeof s.steps=="number"?s.steps:void 0,errorCode:typeof s.errorCode=="string"?s.errorCode:void 0};break;case"stream.unavailable":yield{kind:"unavailable",turnId:String(s.turnId??""),reason:String(s.reason??"not observable from this process")};break}}}async function*my(i){for await(const{name:c,data:r}of d0(i)){if(o0.has(c)){yield{kind:"event",event:r};continue}if(c==="stream.subscribed"){const s=r??{};yield{kind:"subscribed",report:{agentId:typeof s.agentId=="string"?s.agentId:null,types:Array.isArray(s.types)?s.types:null,chunks:s.chunks===!0,implied:typeof s.implied=="string"?s.implied:void 0}}}}}async function*gy(i,c={}){for await(const r of i){if(r.kind==="replay"&&r.report.truncated&&c.allowTruncated!==!0)throw new Zt({code:"replay_truncated",message:\`This turn's replay is missing its oldest \${r.report.dropped} event(s), so the text reconstructed from it would be incomplete.\`,hint:"Read the finished text from GET /v1/agents/:id/turns/:turnId, or pass { allowTruncated: true } to accept a fragment. Streaming from the start of a turn is never truncated — this only happens when reattaching to one that has already produced more events than the buffer holds."});if(r.kind==="unavailable")throw new Zt({code:"turn_not_observable",message:\`Turn \${r.turnId} is recorded as running but is not observable here: \${r.reason}.\`,hint:"Its events are buffered in whichever process is executing it. Poll GET /v1/agents/:id/turns/:turnId for the outcome."});if(r.kind!=="event"||r.event.type!=="model.chunk")continue;const s=r.event.data;s.kind!=="reasoning"&&typeof s.delta=="string"&&(yield s.delta)}}function yy(i){const c=i.baseUrl.replace(/\\/+$/,""),r=i.fetch??fetch,s=(g={})=>({...i.token===void 0?{}:{authorization:\`Bearer \${i.token}\`},...g});async function d(g,N,E={}){let j;try{j=await r(\`\${c}\${N}\`,{method:g,headers:s({...E.body===void 0?{}:{"content-type":"application/json"},...E.accept===void 0?{}:{accept:E.accept},...E.headers}),...E.body===void 0?{}:{body:JSON.stringify(E.body)},...E.signal===void 0?{}:{signal:E.signal}})}catch(B){throw ry(B,{method:g,path:N,baseUrl:c})}if(!j.ok)throw await oy(j,{method:g,path:N});return j}async function h(g,N,E){return await(await d(g,N,E??{})).json()}async function v(g,N){const E=await d("GET",g,{accept:"text/event-stream",...N===void 0?{}:{signal:N}});if(E.body===null)throw new Zt({code:"no_response_body",message:\`GET \${g} returned \${E.status} with no body to read.\`,hint:"An SSE route always has a body. A missing one means something between you and the server buffered the response — commonly a proxy without streaming enabled."},{status:E.status,method:"GET",path:g});return E.body}function A(g,N,E,j={}){const B=D=>D?.chunks===!0?"?chunks=true":"",X={turnId:N,sessionKey:E,replayed:j.replayed===!0,async*stream(D){const fe=await v(\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(N)}/stream\${B(D)}\`,D?.signal);yield*hy(fe)},async*tokens(D){yield*gy(X.stream({chunks:!0,...D}),{...D?.allowTruncated===void 0?{}:{allowTruncated:D.allowTruncated}})},async text(){for await(const D of X.stream())if(D.kind==="ended"||D.kind==="unavailable"||D.kind==="event"&&D.event.type==="turn.end")break;return(await X.get()).text},get:()=>h("GET",\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(N)}\`),async stop(){await d("POST",\`/v1/agents/\${encodeURIComponent(g)}/turns/\${encodeURIComponent(N)}/stop\`)}};return X}function p(g){const N=E=>\`/v1/agents/\${encodeURIComponent(g)}\${E}\`;return{id:g,async send(E,j){const B=await h("POST",N("/messages"),{body:{text:E,...j?.sessionKey===void 0?{}:{sessionKey:j.sessionKey},...j?.deliver===void 0?{}:{deliver:j.deliver},...j?.from===void 0?{}:{from:j.from}},...j?.idempotencyKey===void 0?{}:{headers:{"idempotency-key":j.idempotencyKey}},...j?.signal===void 0?{}:{signal:j.signal}});return A(g,B.turnId,B.sessionKey,{replayed:B.replayed===!0})},turn:E=>A(g,E,""),describe:()=>h("GET",N("")),tools:()=>h("GET",N("/tools")),skills:()=>h("GET",N("/skills")),sessions:()=>h("GET",N("/sessions")),messages:(E,j)=>{const B=new URLSearchParams;j?.before!==void 0&&B.set("before",String(j.before)),j?.limit!==void 0&&B.set("limit",String(j.limit));const X=B.size===0?"":\`?\${B.toString()}\`;return h("GET",N(\`/sessions/\${encodeURIComponent(E)}/messages\${X}\`))},clearSession:E=>h("DELETE",N(\`/sessions/\${encodeURIComponent(E)}\`)),reload:()=>h("POST",N("/reload"),{body:{}}),usage:E=>h("GET",N(\`/usage\${wh(E)}\`)),turns:E=>{const j=new URLSearchParams;E?.limit!==void 0&&j.set("limit",String(E.limit)),E?.before!==void 0&&j.set("before",String(E.before));const B=j.size===0?"":\`?\${j.toString()}\`;return h("GET",N(\`/turns\${B}\`))},secrets:async()=>(await h("GET",N("/secrets"))).secrets,setSecrets:E=>h("PUT",N("/secrets"),{body:{values:E}}),schedules:async()=>(await h("GET",N("/schedules"))).schedules,approvals:async()=>(await h("GET",N("/approvals"))).approvals,createSchedule:E=>h("POST",N("/schedules"),{body:E}),updateSchedule:(E,j)=>h("PATCH",N(\`/schedules/\${encodeURIComponent(E)}\`),{body:j}),deleteSchedule:async E=>{await h("DELETE",N(\`/schedules/\${encodeURIComponent(E)}\`))},runSchedule:E=>h("POST",N(\`/schedules/\${encodeURIComponent(E)}/run\`),{body:{}}),config:()=>h("GET",N("/config")),setConfig:(E,j,B)=>h("PATCH",N("/config"),{body:{path:E,value:j,...B?.confirm===void 0?{}:{confirm:B.confirm}}}),setChannel:(E,j)=>h("PATCH",N(\`/channels/\${encodeURIComponent(E)}\`),{body:{...j}}),unpairChannel:E=>h("POST",N(\`/channels/\${encodeURIComponent(E)}/unpair\`)),session:E=>h("GET",N(\`/sessions/\${encodeURIComponent(E)}\`)),setPhase:(E,j)=>h("POST",N(\`/sessions/\${encodeURIComponent(E)}/phase\`),{body:{phase:j}}),approve:async(E,j)=>{await h("POST",N(\`/approvals/\${encodeURIComponent(E)}\`),{body:{granted:j}})},stop:E=>h("POST",N("/stop"),{body:E===void 0?{}:{reason:E}}),start:()=>h("POST",N("/start"),{body:{}}),context:E=>{const j=new URLSearchParams;E?.sessionKey!==void 0&&j.set("sessionKey",E.sessionKey),E?.input!==void 0&&j.set("input",E.input);const B=j.size===0?"":\`?\${j.toString()}\`;return h("GET",N(\`/context\${B}\`))}}}return{agent:p,agents:()=>h("GET","/v1/agents"),health:()=>h("GET","/v1/health"),async ready(){try{return await d("GET","/v1/ready"),!0}catch(g){if(g instanceof Zt&&g.status===503)return!1;throw g}},provision:()=>h("GET","/v1/provision"),keys:()=>h("GET","/v1/keys"),createKey:g=>h("POST","/v1/keys",{body:g}),revokeKey:g=>h("DELETE",\`/v1/keys/\${encodeURIComponent(g)}\`),createAgent:g=>h("POST","/v1/agents",{body:{answers:g}}),usage:g=>h("GET",\`/v1/usage\${wh(g)}\`),activity:()=>h("GET","/v1/activity"),webhooks:async()=>(await h("GET","/v1/webhooks")).webhooks,createWebhook:g=>h("POST","/v1/webhooks",{body:g}),deleteWebhook:g=>h("DELETE",\`/v1/webhooks/\${encodeURIComponent(g)}\`),templates:async()=>(await h("GET","/v1/templates")).templates,createAgentFromTemplate:g=>h("POST","/v1/agents",{body:g}),async*events(g){const N=new URLSearchParams;g?.agentId!==void 0&&N.set("agentId",g.agentId),g?.types!==void 0&&g.types.length>0&&N.set("types",g.types.join(",")),g?.chunks===!0&&N.set("chunks","true");const E=N.size===0?"":\`?\${N.toString()}\`,j=await v(\`/v1/events\${E}\`,g?.signal);yield*my(j)}}}function wh(i){const c=new URLSearchParams;return i?.by!==void 0&&c.set("by",i.by.join(",")),i?.from!==void 0&&c.set("from",i.from),i?.to!==void 0&&c.set("to",i.to),c.size===0?"":\`?\${c.toString()}\`}function vy(i){return m.jsxs(m.Fragment,{children:[i.state.truncated?m.jsx("p",{className:"row note bad",children:"This turn produced more than the server keeps for a reattach, so the beginning of the reply is missing. The stored turn has all of it."}):null,i.state.rows.map(c=>m.jsx(by,{row:c,onAnswer:i.onAnswer},c.id)),i.state.liveReasoning===""?null:m.jsx(h0,{label:"thinking",text:i.state.liveReasoning,open:!0}),i.state.live===""?null:m.jsx("p",{className:"row",children:i.state.live})]})}function by(i){const c=i.row;switch(c.kind){case"user":return m.jsx("p",{className:"row user",children:c.text});case"reply":return m.jsx("p",{className:"row",children:c.text});case"reasoning":return m.jsx(h0,{label:"thinking",text:c.text});case"tool":return m.jsxs("div",{className:\`row tool\${c.ok===!1?" failed":""}\`,children:[m.jsx("span",{className:"slug",children:c.slug}),c.mutating?m.jsx("span",{className:"mut",children:" changes things"}):null,m.jsx("span",{className:"out",children:Sy(c)}),c.untrusted===!0?m.jsx("div",{className:"fence",children:m.jsx("div",{className:"why",children:"this result came from outside the agent — treated as data, and mutating tools are blocked for the rest of the turn"})}):null]});case"approval":return m.jsxs("div",{className:"row ask",children:[m.jsxs("div",{children:[m.jsx("strong",{children:c.slug})," needs permission — ",c.reason]}),c.match===void 0?null:m.jsx("div",{className:"what",children:c.match}),c.settled===void 0?m.jsxs("div",{className:"buttons",children:[m.jsx("button",{type:"button",className:"primary",onClick:()=>i.onAnswer(c.approvalId,!0),children:"Allow once"}),m.jsx("button",{type:"button",onClick:()=>i.onAnswer(c.approvalId,!1),children:"Refuse"})]}):m.jsx("div",{className:"settled",children:py(c.settled)})]});case"note":return m.jsx("p",{className:\`row note\${c.bad?" bad":""}\`,children:c.text})}}function Sy(i){if(i.ok===void 0)return" running…";const c=i.bytes===void 0?"":\` · \${i.bytes} bytes\`,r=i.truncated===!0?" · truncated to fit the observation budget":"",s=i.latencyMs===void 0?"":\` · \${i.latencyMs} ms\`;return\`\${i.ok?" ok":" failed"}\${c}\${s}\${r}\`}function py(i){switch(i){case"granted":return"Allowed — the call ran.";case"denied":return"Refused. The model was told a person declined it.";case"abandoned":return"The turn ended while this was waiting, so the call did not run. Nobody declined it.";case"error":return"The approver itself failed, so the call was refused. That says nothing about what anybody wanted."}}function h0(i){return m.jsxs("details",{className:"row fold",open:i.open===!0,children:[m.jsxs("summary",{children:[i.label," · ",i.text.length," chars"]}),m.jsx("div",{className:"body",children:i.text})]})}function Ey(i){const c=k.useRef(null);return k.useEffect(()=>{const r=c.current;r!==null&&(r.style.height="auto",r.style.height=\`\${Math.min(r.scrollHeight,190)}px\`)},[i.value]),m.jsxs("div",{className:"composer",children:[m.jsxs("div",{className:"inner",children:[m.jsx("textarea",{ref:c,value:i.value,placeholder:"Ask the agent something",onChange:r=>i.onChange(r.target.value),onKeyDown:r=>{r.key==="Enter"&&!r.shiftKey&&(r.preventDefault(),i.onSend())}}),i.busy?m.jsx("button",{type:"button",onClick:i.onStop,children:"Stop"}):m.jsx("button",{type:"button",className:"primary",disabled:i.value.trim()==="",onClick:i.onSend,children:"Send"})]}),m.jsx("p",{className:"hint",children:i.busy?"Running. Closing this page does not stop it — the turn is detached, and reopening reattaches.":"Enter sends · shift-enter for a new line"})]})}const vf="dispach.key";function Ty(){const i=new URL(window.location.href),c=i.searchParams.get("claim");if(!(c===null||c===""))return i.searchParams.delete("claim"),window.history.replaceState({},"",i.pathname+i.search+i.hash),c}function mf(){try{return window.localStorage.getItem(vf)??void 0}catch{return}}function bf(i){try{window.localStorage.setItem(vf,i)}catch{}}function Sf(){try{window.localStorage.removeItem(vf)}catch{}}async function m0(i,c){const r=await fetch(\`\${i}/v1/keys\`,{method:"POST",headers:{"content-type":"application/json",authorization:\`Bearer \${c}\`},body:JSON.stringify({label:Ay()})}),s=await r.json();if(!r.ok||typeof s.secret!="string")throw new Error(s.error?.message??\`The claim was refused (\${r.status}).\`);return s.secret}function Ay(){const i=navigator.userAgent;return\`\${/Firefox\\//.test(i)?"Firefox":/Edg\\//.test(i)?"Edge":/Chrome\\//.test(i)?"Chrome":/Safari\\//.test(i)?"Safari":"browser"} · \${new Date().toISOString().slice(0,10)}\`}async function zy(i){const c=Ty();if(c!==void 0)try{const s=await m0(i,c);return bf(s),{kind:"key",secret:s}}catch(s){const d=s instanceof Error?s.message:String(s);if(mf()===void 0)return{kind:"needed",because:d}}const r=mf();return r!==void 0&&await Uh(i,r)?{kind:"key",secret:r}:(r!==void 0&&Sf(),await Uh(i,void 0)?{kind:"open"}:{kind:"needed",because:r===void 0?"This server needs a credential.":"The key this browser held no longer works — it was revoked, or this is a different server."})}async function Uh(i,c){try{return await g0(i,c).agents(),!0}catch(r){if(r instanceof Zt&&r.code==="unauthorized")return!1;throw r}}function g0(i,c){return yy({baseUrl:i,...c===void 0?{}:{token:c}})}function Cy(i,c){const r=[i.scope?.agents===void 0?"every agent":i.scope.agents.join(", "),...i.scope?.sessions===void 0?[]:[\`sessions \${i.scope.sessions}\`],i.scope?.can===void 0?"all capabilities":i.scope.can.join("+")];return i.expiresAt!==void 0&&r.push(Date.parse(i.expiresAt)<=c?"expired":\`until \${vi(i.expiresAt)}\`),r.join(" · ")}function Ny(i){const[c,r]=k.useState([]),[s,d]=k.useState(),[h,v]=k.useState(""),[A,p]=k.useState(),[g,N]=k.useState(),E=k.useCallback((D={})=>({...D,...i.token===void 0?{}:{authorization:\`Bearer \${i.token}\`}}),[i.token]),j=k.useCallback(async()=>{try{const D=await fetch(\`\${i.baseUrl}/v1/keys\`,{headers:E()}),fe=await D.json();if(!D.ok)throw new Error(fe.error?.message??\`HTTP \${D.status}\`);r(fe.keys??[]),d(fe.scope)}catch(D){N(D instanceof Error?D.message:String(D))}},[i.baseUrl,E]);k.useEffect(()=>{j()},[j]);const B=async()=>{N(void 0);try{const D=await fetch(\`\${i.baseUrl}/v1/keys\`,{method:"POST",headers:E({"content-type":"application/json"}),body:JSON.stringify({label:h.trim()})}),fe=await D.json();if(!D.ok||fe.secret===void 0)throw new Error(fe.error?.message??\`HTTP \${D.status}\`);p(fe.secret),v(""),await j()}catch(D){N(D instanceof Error?D.message:String(D))}},X=async D=>{if(N(void 0),!window.confirm(\`Revoke "\${D.label}"? If it is the key this browser is using, you will be signed out of this page. There is no way to tell from here — the listing carries no secrets.\`))return;const fe=mf();try{const L=await fetch(\`\${i.baseUrl}/v1/keys/\${D.keyId}\`,{method:"DELETE",headers:E()});if(!L.ok){const ce=await L.json();throw new Error(ce.error?.message??\`HTTP \${L.status}\`)}if(fe!==void 0&&!await jy(i.baseUrl,fe)){Sf(),window.location.reload();return}await j()}catch(L){N(L instanceof Error?L.message:String(L))}};return m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:"Issue a key"}),m.jsx("p",{children:"A key is shown once and never again — the server stores a hash of it, so there is no way to recover one. Label it for the browser or machine that will hold it."}),A===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"secret",children:A}),m.jsxs("p",{className:"hint",style:{margin:"0 0 12px"},children:["Copy it now. This is the only time it is readable."," ",m.jsx("button",{type:"button",style:{padding:"2px 8px",fontSize:11},onClick:()=>{bf(A),window.location.reload()},children:"use it in this browser"})]})]}),m.jsxs("div",{style:{display:"flex",gap:8},children:[m.jsx("input",{value:h,placeholder:"my laptop",onChange:D=>v(D.target.value)}),m.jsx("button",{type:"button",className:"primary",disabled:h.trim()==="",onClick:()=>void B(),children:"Issue"})]})]}),m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:"Keys"}),m.jsx("p",{children:s??"…"}),g===void 0?null:m.jsx("p",{className:"note bad",children:g}),m.jsxs("table",{children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"Label"}),m.jsx("th",{children:"Created"}),m.jsx("th",{children:"Reaches"}),m.jsx("th",{children:"Last used"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:c.map(D=>m.jsxs("tr",{children:[m.jsx("td",{className:D.revokedAt===void 0?"":"revoked",children:D.label}),m.jsx("td",{children:vi(D.createdAt)}),m.jsx("td",{className:"sub",children:Cy(D,Date.now())}),m.jsx("td",{children:D.revokedAt!==void 0?\`revoked \${vi(D.revokedAt)}\`:D.lastUsedAt===void 0?"never":vi(D.lastUsedAt)}),m.jsx("td",{children:D.revokedAt===void 0?m.jsx("button",{type:"button",className:"bad",style:{padding:"2px 9px",fontSize:11},onClick:()=>void X(D),children:"revoke"}):null})]},D.keyId))})]}),c.length===0?m.jsx("p",{className:"hint",style:{marginTop:10},children:"No keys. This server is open to anyone who can reach the port — issuing the first key is what closes it."}):null]})]})}async function jy(i,c){try{return(await fetch(\`\${i}/v1/agents\`,{headers:{authorization:\`Bearer \${c}\`}})).ok}catch{return!0}}function vi(i){const c=new Date(i);return Number.isNaN(c.getTime())?i:c.toISOString().slice(0,10)}const xy=["chat","new","tools","schedules","channels","config","keys"];function _y(i){return i!==null&&xy.includes(i)}function My(i){const c=new URL(i).searchParams,r=c.get("agent"),s=c.get("panel");return{...r===null||r===""?{}:{agentId:r},panel:_y(s)?s:"chat"}}function wy(i,c){const r=new URL(i);return c.agentId===void 0||c.agentId===""?r.searchParams.delete("agent"):r.searchParams.set("agent",c.agentId),c.panel==="chat"?r.searchParams.delete("panel"):r.searchParams.set("panel",c.panel),\`\${r.pathname}\${r.search}\`}function Uy(){let i,c;return{begin(r){if(i!==r)return c?.abort(),i=r,c=new AbortController,c.signal},finish(r){i===r&&(i=void 0,c=void 0)},abort(){c?.abort()},following:()=>i,aborted:()=>c?.signal.aborted??!1}}function Ry(i){const c={};for(const r of i)c[r.step]=r.fallback;return c}const Oy=8;function Dy(i,c,r){let s=c;for(let d=0;d<Oy;d+=1){if(s===void 0)return!1;const h=s.requires;if(h===void 0)return!0;if(r[h.step]!==h.value)return!1;s=i.find(v=>v.step===h.step)}return!1}function bi(i,c){return i.filter(r=>Dy(i,r,c))}function y0(i,c){return bi(i,c).filter(r=>r.optional!==!0&&(c[r.step]??"").trim()==="")}function By(i,c){const r={};for(const s of bi(i,c)){const d=(c[s.step]??"").trim();d!==""&&(r[s.step]=d)}return r}function Hy(i,c){return bi(i,c).filter(r=>r.secret&&(c[r.step]??"").trim()==="")}function qy(i){return{...Fa,filter:i==="nlt"?fy():s0()}}const Fa={filter:s0(),rows:[],live:"",liveReasoning:"",running:!1,truncated:!1};let Rh=0;function Kt(){return Rh+=1,\`r\${Rh}\`}function Yy(i,c){return{...i,rows:[...i.rows,{kind:"user",id:Kt(),text:c}],running:!0}}function Ly(i,c){switch(c.kind){case"accepted":return i;case"replay":return c.report.truncated?{...i,truncated:!0}:i;case"ended":return{...i,running:!1,rows:[...i.rows,{kind:"note",id:Kt(),text:\`This turn finished before the page attached — \${c.status}. Its reply is stored.\`,bad:c.status!=="final"}]};case"unavailable":return{...i,running:!1,rows:[...i.rows,{kind:"note",id:Kt(),text:c.reason,bad:!0}]};case"event":return Gy(i,c.event)}}function Gy(i,c){switch(c.type){case"turn.start":return{...i,running:!0};case"model.chunk":{const r=c.data;if(r.kind==="reasoning")return{...i,liveReasoning:i.liveReasoning+r.delta};const s=i.filter.push(r.delta);return s===""?i:{...i,live:i.live+s}}case"model.result":return ka({...i,live:i.live+i.filter.endStep()});case"tool.call":{const r=c.data,s=ka(i);return{...s,rows:[...s.rows,{kind:"tool",id:Kt(),callId:r.callId,slug:r.slug,mutating:r.mutating}]}}case"tool.result":{const r=c.data,s=i.rows.findIndex(v=>v.kind==="tool"&&v.callId===r.callId);if(s===-1)return i;const d=i.rows[s];if(d===void 0||d.kind!=="tool")return i;const h=[...i.rows];return h[s]={...d,ok:r.ok,bytes:r.bytes,truncated:r.truncated,latencyMs:r.latencyMs,...r.trust==="untrusted"?{untrusted:!0}:{}},{...i,rows:h}}case"approval.requested":{const r=c.data,s=ka(i);return{...s,rows:[...s.rows,{kind:"approval",id:Kt(),approvalId:r.approvalId,slug:r.slug,...r.match===void 0?{}:{match:r.match},reason:r.reason}]}}case"approval.resolved":{const r=c.data,s=i.rows.findIndex(v=>v.kind==="approval"&&v.approvalId===r.approvalId);if(s===-1)return i;const d=i.rows[s];if(d===void 0||d.kind!=="approval")return i;const h=[...i.rows];return h[s]={...d,settled:r.by==="abandoned"?"abandoned":r.by==="error"?"error":r.granted?"granted":"denied"},{...i,rows:h}}case"error":{const r=c.data,s=ka({...i,live:i.live+i.filter.end()});return{...s,running:!1,rows:[...s.rows,{kind:"note",id:Kt(),text:\`\${r.code}: \${r.message}
|
|
26
|
+
hint: \${r.hint}\`,bad:!0}]}}case"agent.warning":{const r=c.data;return{...i,rows:[...i.rows,{kind:"note",id:Kt(),text:r.message??"",bad:!1}]}}case"turn.end":{const r=c.data,s=ka({...i,live:i.live+i.filter.end()}),d=ty(r.reason,{steps:r.steps});return{...s,running:!1,rows:d===void 0?s.rows:[...s.rows,{kind:"note",id:Kt(),text:d,bad:ey(r.reason)}]}}default:return i}}function ka(i){if(i.live===""&&i.liveReasoning==="")return i;const c=[...i.rows],r=i.liveReasoning.trim();r!==""&&c.push({kind:"reasoning",id:Kt(),text:r});const s=i.live.trim();return s!==""&&c.push({kind:"reply",id:Kt(),text:s}),{...i,rows:c,live:"",liveReasoning:""}}function Qy(i){if(!i.available)return m.jsxs("p",{className:"empty",children:["This server has no provisioner, so it cannot create an agent — the case for an embedder mounting the API over its own agent store. Run ",m.jsx("code",{children:"dispach init"})," ","where the sandbox is, or mount an agent directory."]});if(!i.allowed)return m.jsxs("p",{className:"empty",children:["Creating an agent needs a loopback bind or a credential with the ",m.jsx("code",{children:"admin"})," ","capability, and this request has neither. On a server reachable from elsewhere, set"," ",m.jsx("code",{children:"server.tokenEnv"})," or present an operator key minted with"," ",m.jsx("code",{children:"can: [admin]"})," — or mount a written agent at ",m.jsx("code",{children:"/agent"}),"."]})}function Xy(i){const{step:c,value:r}=i,s=\`provision-\${c.step}\`;return m.jsxs("div",{className:i.invalid?"field invalid":"field",children:[m.jsxs("label",{htmlFor:s,children:[c.prompt,c.optional?m.jsx("span",{className:"sub",children:" optional"}):null,c.secret?m.jsx("span",{className:"sub",children:" · written to .env, never read back"}):null]}),c.choices===void 0?m.jsx("input",{id:s,name:c.step,type:c.secret?"password":"text",value:r,disabled:i.disabled,autoComplete:c.secret?"new-password":"off",spellCheck:!1,onChange:d=>i.onChange(d.target.value)}):m.jsx("select",{id:s,name:c.step,value:r,disabled:i.disabled,onChange:d=>i.onChange(d.target.value),children:c.choices.map(d=>m.jsx("option",{value:d.value,children:d.hint===void 0?d.label:\`\${d.label} — \${d.hint}\`},d.value))}),i.invalid?m.jsx("div",{className:"sub error",children:"needs an answer"}):null]})}function Ky(i){const c=i.result.adopted.includes(i.result.id);return m.jsxs("div",{className:"created",children:[m.jsxs("h3",{children:["Created ",m.jsx("code",{children:i.result.id})]}),m.jsxs("p",{children:[m.jsx("code",{children:i.result.dir}),m.jsxs("span",{className:"sub",children:[" · ",i.result.files.length," files"]})]}),c?m.jsx("p",{className:"ok",children:"adopted · live on this host, with its channels and schedules"}):m.jsxs("p",{className:"error",children:["written, and ",m.jsx("strong",{children:"not running"}),i.result.error===void 0?null:m.jsxs(m.Fragment,{children:[": ",i.result.error.message,i.result.error.hint===void 0?null:m.jsxs("span",{className:"sub",children:[" ",i.result.error.hint]})]})]}),i.blank.length===0?null:m.jsxs("div",{className:"blank-secrets",children:[m.jsxs("p",{children:["Left empty, and needed before this works:"," ",i.blank.map(r=>r.prompt).join(", "),"."]}),m.jsxs("p",{className:"sub",children:["Fill them in ",m.jsxs("code",{children:[i.result.dir,"/.env"]})," at a terminal —"," ",m.jsx("code",{children:".env"})," is a protected path, so neither the agent nor this API can write it. The file names each variable in its own comments."]})]}),c?m.jsxs("button",{type:"button",onClick:()=>i.onOpen(i.result.id),children:["open ",i.result.id]}):null]})}function Zy(i){if(i.result!==void 0)return m.jsx(Ky,{result:i.result,blank:Hy(i.offer.steps,i.answers),onOpen:i.onOpen});const c=Qy(i.offer);if(c!==void 0)return c;const r=bi(i.offer.steps,i.answers),s=y0(i.offer.steps,i.answers),d=new Set(s.map(h=>h.step));return m.jsxs("form",{className:"provision",onSubmit:h=>{h.preventDefault(),i.onSubmit()},children:[m.jsxs("p",{className:"sub",children:["The same questions ",m.jsx("code",{children:"dispach init"})," asks, served from the same walk. What you leave alone takes its default. The agent is adopted into this server as it is created — there is no second command."]}),r.map(h=>m.jsx(Xy,{step:h,value:i.answers[h.step]??"",invalid:i.touched&&d.has(h.step),disabled:i.busy,onChange:v=>i.onAnswer(h.step,v)},h.step)),i.error===void 0?null:m.jsx("p",{className:"error",children:i.error}),m.jsx("button",{type:"submit",disabled:i.busy,children:i.busy?"creating…":"create agent"}),i.touched&&s.length>0?m.jsxs("p",{className:"sub error",children:[s.map(h=>h.prompt).join(", ")," — still needed."]}):null]})}var $l={},Gs,Oh;function Vy(){return Oh||(Oh=1,Gs=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Gs}var Qs={},Bn={},Dh;function nl(){if(Dh)return Bn;Dh=1;let i;const c=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Bn.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},Bn.getSymbolTotalCodewords=function(s){return c[s]},Bn.getBCHDigit=function(r){let s=0;for(;r!==0;)s++,r>>>=1;return s},Bn.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');i=s},Bn.isKanjiModeEnabled=function(){return typeof i<"u"},Bn.toSJIS=function(s){return i(s)},Bn}var Xs={},Bh;function pf(){return Bh||(Bh=1,(function(i){i.L={bit:1},i.M={bit:0},i.Q={bit:3},i.H={bit:2};function c(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return i.L;case"m":case"medium":return i.M;case"q":case"quartile":return i.Q;case"h":case"high":return i.H;default:throw new Error("Unknown EC Level: "+r)}}i.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},i.from=function(s,d){if(i.isValid(s))return s;try{return c(s)}catch{return d}}})(Xs)),Xs}var Ks,Hh;function ky(){if(Hh)return Ks;Hh=1;function i(){this.buffer=[],this.length=0}return i.prototype={get:function(c){const r=Math.floor(c/8);return(this.buffer[r]>>>7-c%8&1)===1},put:function(c,r){for(let s=0;s<r;s++)this.putBit((c>>>r-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(c){const r=Math.floor(this.length/8);this.buffer.length<=r&&this.buffer.push(0),c&&(this.buffer[r]|=128>>>this.length%8),this.length++}},Ks=i,Ks}var Zs,qh;function Jy(){if(qh)return Zs;qh=1;function i(c){if(!c||c<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=c,this.data=new Uint8Array(c*c),this.reservedBit=new Uint8Array(c*c)}return i.prototype.set=function(c,r,s,d){const h=c*this.size+r;this.data[h]=s,d&&(this.reservedBit[h]=!0)},i.prototype.get=function(c,r){return this.data[c*this.size+r]},i.prototype.xor=function(c,r,s){this.data[c*this.size+r]^=s},i.prototype.isReserved=function(c,r){return this.reservedBit[c*this.size+r]},Zs=i,Zs}var Vs={},Yh;function $y(){return Yh||(Yh=1,(function(i){const c=nl().getSymbolSize;i.getRowColCoords=function(s){if(s===1)return[];const d=Math.floor(s/7)+2,h=c(s),v=h===145?26:Math.ceil((h-13)/(2*d-2))*2,A=[h-7];for(let p=1;p<d-1;p++)A[p]=A[p-1]-v;return A.push(6),A.reverse()},i.getPositions=function(s){const d=[],h=i.getRowColCoords(s),v=h.length;for(let A=0;A<v;A++)for(let p=0;p<v;p++)A===0&&p===0||A===0&&p===v-1||A===v-1&&p===0||d.push([h[A],h[p]]);return d}})(Vs)),Vs}var ks={},Lh;function Fy(){if(Lh)return ks;Lh=1;const i=nl().getSymbolSize,c=7;return ks.getPositions=function(s){const d=i(s);return[[0,0],[d-c,0],[0,d-c]]},ks}var Js={},Gh;function Wy(){return Gh||(Gh=1,(function(i){i.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const c={N1:3,N2:3,N3:40,N4:10};i.isValid=function(d){return d!=null&&d!==""&&!isNaN(d)&&d>=0&&d<=7},i.from=function(d){return i.isValid(d)?parseInt(d,10):void 0},i.getPenaltyN1=function(d){const h=d.size;let v=0,A=0,p=0,g=null,N=null;for(let E=0;E<h;E++){A=p=0,g=N=null;for(let j=0;j<h;j++){let B=d.get(E,j);B===g?A++:(A>=5&&(v+=c.N1+(A-5)),g=B,A=1),B=d.get(j,E),B===N?p++:(p>=5&&(v+=c.N1+(p-5)),N=B,p=1)}A>=5&&(v+=c.N1+(A-5)),p>=5&&(v+=c.N1+(p-5))}return v},i.getPenaltyN2=function(d){const h=d.size;let v=0;for(let A=0;A<h-1;A++)for(let p=0;p<h-1;p++){const g=d.get(A,p)+d.get(A,p+1)+d.get(A+1,p)+d.get(A+1,p+1);(g===4||g===0)&&v++}return v*c.N2},i.getPenaltyN3=function(d){const h=d.size;let v=0,A=0,p=0;for(let g=0;g<h;g++){A=p=0;for(let N=0;N<h;N++)A=A<<1&2047|d.get(g,N),N>=10&&(A===1488||A===93)&&v++,p=p<<1&2047|d.get(N,g),N>=10&&(p===1488||p===93)&&v++}return v*c.N3},i.getPenaltyN4=function(d){let h=0;const v=d.data.length;for(let p=0;p<v;p++)h+=d.data[p];return Math.abs(Math.ceil(h*100/v/5)-10)*c.N4};function r(s,d,h){switch(s){case i.Patterns.PATTERN000:return(d+h)%2===0;case i.Patterns.PATTERN001:return d%2===0;case i.Patterns.PATTERN010:return h%3===0;case i.Patterns.PATTERN011:return(d+h)%3===0;case i.Patterns.PATTERN100:return(Math.floor(d/2)+Math.floor(h/3))%2===0;case i.Patterns.PATTERN101:return d*h%2+d*h%3===0;case i.Patterns.PATTERN110:return(d*h%2+d*h%3)%2===0;case i.Patterns.PATTERN111:return(d*h%3+(d+h)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}i.applyMask=function(d,h){const v=h.size;for(let A=0;A<v;A++)for(let p=0;p<v;p++)h.isReserved(p,A)||h.xor(p,A,r(d,p,A))},i.getBestMask=function(d,h){const v=Object.keys(i.Patterns).length;let A=0,p=1/0;for(let g=0;g<v;g++){h(g),i.applyMask(g,d);const N=i.getPenaltyN1(d)+i.getPenaltyN2(d)+i.getPenaltyN3(d)+i.getPenaltyN4(d);i.applyMask(g,d),N<p&&(p=N,A=g)}return A}})(Js)),Js}var gi={},Qh;function v0(){if(Qh)return gi;Qh=1;const i=pf(),c=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],r=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return gi.getBlocksCount=function(d,h){switch(h){case i.L:return c[(d-1)*4+0];case i.M:return c[(d-1)*4+1];case i.Q:return c[(d-1)*4+2];case i.H:return c[(d-1)*4+3];default:return}},gi.getTotalCodewordsCount=function(d,h){switch(h){case i.L:return r[(d-1)*4+0];case i.M:return r[(d-1)*4+1];case i.Q:return r[(d-1)*4+2];case i.H:return r[(d-1)*4+3];default:return}},gi}var $s={},Ja={},Xh;function Iy(){if(Xh)return Ja;Xh=1;const i=new Uint8Array(512),c=new Uint8Array(256);return(function(){let s=1;for(let d=0;d<255;d++)i[d]=s,c[s]=d,s<<=1,s&256&&(s^=285);for(let d=255;d<512;d++)i[d]=i[d-255]})(),Ja.log=function(s){if(s<1)throw new Error("log("+s+")");return c[s]},Ja.exp=function(s){return i[s]},Ja.mul=function(s,d){return s===0||d===0?0:i[c[s]+c[d]]},Ja}var Kh;function Py(){return Kh||(Kh=1,(function(i){const c=Iy();i.mul=function(s,d){const h=new Uint8Array(s.length+d.length-1);for(let v=0;v<s.length;v++)for(let A=0;A<d.length;A++)h[v+A]^=c.mul(s[v],d[A]);return h},i.mod=function(s,d){let h=new Uint8Array(s);for(;h.length-d.length>=0;){const v=h[0];for(let p=0;p<d.length;p++)h[p]^=c.mul(d[p],v);let A=0;for(;A<h.length&&h[A]===0;)A++;h=h.slice(A)}return h},i.generateECPolynomial=function(s){let d=new Uint8Array([1]);for(let h=0;h<s;h++)d=i.mul(d,new Uint8Array([1,c.exp(h)]));return d}})($s)),$s}var Fs,Zh;function ev(){if(Zh)return Fs;Zh=1;const i=Py();function c(r){this.genPoly=void 0,this.degree=r,this.degree&&this.initialize(this.degree)}return c.prototype.initialize=function(s){this.degree=s,this.genPoly=i.generateECPolynomial(this.degree)},c.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const d=new Uint8Array(s.length+this.degree);d.set(s);const h=i.mod(d,this.genPoly),v=this.degree-h.length;if(v>0){const A=new Uint8Array(this.degree);return A.set(h,v),A}return h},Fs=c,Fs}var Ws={},Is={},Ps={},Vh;function b0(){return Vh||(Vh=1,Ps.isValid=function(c){return!isNaN(c)&&c>=1&&c<=40}),Ps}var Xt={},kh;function S0(){if(kh)return Xt;kh=1;const i="[0-9]+",c="[A-Z $%*+\\\\-./:]+";let r="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";r=r.replace(/u/g,"\\\\u");const s="(?:(?![A-Z0-9 $%*+\\\\-./:]|"+r+\`)(?:.|[\\r
|
|
27
|
+
]))+\`;Xt.KANJI=new RegExp(r,"g"),Xt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\\\-./:]+","g"),Xt.BYTE=new RegExp(s,"g"),Xt.NUMERIC=new RegExp(i,"g"),Xt.ALPHANUMERIC=new RegExp(c,"g");const d=new RegExp("^"+r+"$"),h=new RegExp("^"+i+"$"),v=new RegExp("^[A-Z0-9 $%*+\\\\-./:]+$");return Xt.testKanji=function(p){return d.test(p)},Xt.testNumeric=function(p){return h.test(p)},Xt.testAlphanumeric=function(p){return v.test(p)},Xt}var Jh;function ll(){return Jh||(Jh=1,(function(i){const c=b0(),r=S0();i.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},i.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},i.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},i.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},i.MIXED={bit:-1},i.getCharCountIndicator=function(h,v){if(!h.ccBits)throw new Error("Invalid mode: "+h);if(!c.isValid(v))throw new Error("Invalid version: "+v);return v>=1&&v<10?h.ccBits[0]:v<27?h.ccBits[1]:h.ccBits[2]},i.getBestModeForData=function(h){return r.testNumeric(h)?i.NUMERIC:r.testAlphanumeric(h)?i.ALPHANUMERIC:r.testKanji(h)?i.KANJI:i.BYTE},i.toString=function(h){if(h&&h.id)return h.id;throw new Error("Invalid mode")},i.isValid=function(h){return h&&h.bit&&h.ccBits};function s(d){if(typeof d!="string")throw new Error("Param is not a string");switch(d.toLowerCase()){case"numeric":return i.NUMERIC;case"alphanumeric":return i.ALPHANUMERIC;case"kanji":return i.KANJI;case"byte":return i.BYTE;default:throw new Error("Unknown mode: "+d)}}i.from=function(h,v){if(i.isValid(h))return h;try{return s(h)}catch{return v}}})(Is)),Is}var $h;function tv(){return $h||($h=1,(function(i){const c=nl(),r=v0(),s=pf(),d=ll(),h=b0(),v=7973,A=c.getBCHDigit(v);function p(j,B,X){for(let D=1;D<=40;D++)if(B<=i.getCapacity(D,X,j))return D}function g(j,B){return d.getCharCountIndicator(j,B)+4}function N(j,B){let X=0;return j.forEach(function(D){const fe=g(D.mode,B);X+=fe+D.getBitsLength()}),X}function E(j,B){for(let X=1;X<=40;X++)if(N(j,X)<=i.getCapacity(X,B,d.MIXED))return X}i.from=function(B,X){return h.isValid(B)?parseInt(B,10):X},i.getCapacity=function(B,X,D){if(!h.isValid(B))throw new Error("Invalid QR Code version");typeof D>"u"&&(D=d.BYTE);const fe=c.getSymbolTotalCodewords(B),L=r.getTotalCodewordsCount(B,X),ce=(fe-L)*8;if(D===d.MIXED)return ce;const I=ce-g(D,B);switch(D){case d.NUMERIC:return Math.floor(I/10*3);case d.ALPHANUMERIC:return Math.floor(I/11*2);case d.KANJI:return Math.floor(I/13);case d.BYTE:default:return Math.floor(I/8)}},i.getBestVersionForData=function(B,X){let D;const fe=s.from(X,s.M);if(Array.isArray(B)){if(B.length>1)return E(B,fe);if(B.length===0)return 1;D=B[0]}else D=B;return p(D.mode,D.getLength(),fe)},i.getEncodedBits=function(B){if(!h.isValid(B)||B<7)throw new Error("Invalid QR Code version");let X=B<<12;for(;c.getBCHDigit(X)-A>=0;)X^=v<<c.getBCHDigit(X)-A;return B<<12|X}})(Ws)),Ws}var ef={},Fh;function nv(){if(Fh)return ef;Fh=1;const i=nl(),c=1335,r=21522,s=i.getBCHDigit(c);return ef.getEncodedBits=function(h,v){const A=h.bit<<3|v;let p=A<<10;for(;i.getBCHDigit(p)-s>=0;)p^=c<<i.getBCHDigit(p)-s;return(A<<10|p)^r},ef}var tf={},nf,Wh;function lv(){if(Wh)return nf;Wh=1;const i=ll();function c(r){this.mode=i.NUMERIC,this.data=r.toString()}return c.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(s){let d,h,v;for(d=0;d+3<=this.data.length;d+=3)h=this.data.substr(d,3),v=parseInt(h,10),s.put(v,10);const A=this.data.length-d;A>0&&(h=this.data.substr(d),v=parseInt(h,10),s.put(v,A*3+1))},nf=c,nf}var lf,Ih;function av(){if(Ih)return lf;Ih=1;const i=ll(),c=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function r(s){this.mode=i.ALPHANUMERIC,this.data=s}return r.getBitsLength=function(d){return 11*Math.floor(d/2)+6*(d%2)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(d){let h;for(h=0;h+2<=this.data.length;h+=2){let v=c.indexOf(this.data[h])*45;v+=c.indexOf(this.data[h+1]),d.put(v,11)}this.data.length%2&&d.put(c.indexOf(this.data[h]),6)},lf=r,lf}var af,Ph;function uv(){if(Ph)return af;Ph=1;const i=ll();function c(r){this.mode=i.BYTE,typeof r=="string"?this.data=new TextEncoder().encode(r):this.data=new Uint8Array(r)}return c.getBitsLength=function(s){return s*8},c.prototype.getLength=function(){return this.data.length},c.prototype.getBitsLength=function(){return c.getBitsLength(this.data.length)},c.prototype.write=function(r){for(let s=0,d=this.data.length;s<d;s++)r.put(this.data[s],8)},af=c,af}var uf,e0;function iv(){if(e0)return uf;e0=1;const i=ll(),c=nl();function r(s){this.mode=i.KANJI,this.data=s}return r.getBitsLength=function(d){return d*13},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let d;for(d=0;d<this.data.length;d++){let h=c.toSJIS(this.data[d]);if(h>=33088&&h<=40956)h-=33088;else if(h>=57408&&h<=60351)h-=49472;else throw new Error("Invalid SJIS character: "+this.data[d]+\`
|
|
28
|
+
Make sure your charset is UTF-8\`);h=(h>>>8&255)*192+(h&255),s.put(h,13)}},uf=r,uf}var cf={exports:{}},t0;function cv(){return t0||(t0=1,(function(i){var c={single_source_shortest_paths:function(r,s,d){var h={},v={};v[s]=0;var A=c.PriorityQueue.make();A.push(s,0);for(var p,g,N,E,j,B,X,D,fe;!A.empty();){p=A.pop(),g=p.value,E=p.cost,j=r[g]||{};for(N in j)j.hasOwnProperty(N)&&(B=j[N],X=E+B,D=v[N],fe=typeof v[N]>"u",(fe||D>X)&&(v[N]=X,A.push(N,X),h[N]=g))}if(typeof d<"u"&&typeof v[d]>"u"){var L=["Could not find a path from ",s," to ",d,"."].join("");throw new Error(L)}return h},extract_shortest_path_from_predecessor_list:function(r,s){for(var d=[],h=s;h;)d.push(h),r[h],h=r[h];return d.reverse(),d},find_path:function(r,s,d){var h=c.single_source_shortest_paths(r,s,d);return c.extract_shortest_path_from_predecessor_list(h,d)},PriorityQueue:{make:function(r){var s=c.PriorityQueue,d={},h;r=r||{};for(h in s)s.hasOwnProperty(h)&&(d[h]=s[h]);return d.queue=[],d.sorter=r.sorter||s.default_sorter,d},default_sorter:function(r,s){return r.cost-s.cost},push:function(r,s){var d={value:r,cost:s};this.queue.push(d),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};i.exports=c})(cf)),cf.exports}var n0;function sv(){return n0||(n0=1,(function(i){const c=ll(),r=lv(),s=av(),d=uv(),h=iv(),v=S0(),A=nl(),p=cv();function g(L){return unescape(encodeURIComponent(L)).length}function N(L,ce,I){const $=[];let Ae;for(;(Ae=L.exec(I))!==null;)$.push({data:Ae[0],index:Ae.index,mode:ce,length:Ae[0].length});return $}function E(L){const ce=N(v.NUMERIC,c.NUMERIC,L),I=N(v.ALPHANUMERIC,c.ALPHANUMERIC,L);let $,Ae;return A.isKanjiModeEnabled()?($=N(v.BYTE,c.BYTE,L),Ae=N(v.KANJI,c.KANJI,L)):($=N(v.BYTE_KANJI,c.BYTE,L),Ae=[]),ce.concat(I,$,Ae).sort(function(Y,K){return Y.index-K.index}).map(function(Y){return{data:Y.data,mode:Y.mode,length:Y.length}})}function j(L,ce){switch(ce){case c.NUMERIC:return r.getBitsLength(L);case c.ALPHANUMERIC:return s.getBitsLength(L);case c.KANJI:return h.getBitsLength(L);case c.BYTE:return d.getBitsLength(L)}}function B(L){return L.reduce(function(ce,I){const $=ce.length-1>=0?ce[ce.length-1]:null;return $&&$.mode===I.mode?(ce[ce.length-1].data+=I.data,ce):(ce.push(I),ce)},[])}function X(L){const ce=[];for(let I=0;I<L.length;I++){const $=L[I];switch($.mode){case c.NUMERIC:ce.push([$,{data:$.data,mode:c.ALPHANUMERIC,length:$.length},{data:$.data,mode:c.BYTE,length:$.length}]);break;case c.ALPHANUMERIC:ce.push([$,{data:$.data,mode:c.BYTE,length:$.length}]);break;case c.KANJI:ce.push([$,{data:$.data,mode:c.BYTE,length:g($.data)}]);break;case c.BYTE:ce.push([{data:$.data,mode:c.BYTE,length:g($.data)}])}}return ce}function D(L,ce){const I={},$={start:{}};let Ae=["start"];for(let Z=0;Z<L.length;Z++){const Y=L[Z],K=[];for(let V=0;V<Y.length;V++){const ne=Y[V],q=""+Z+V;K.push(q),I[q]={node:ne,lastCount:0},$[q]={};for(let F=0;F<Ae.length;F++){const ee=Ae[F];I[ee]&&I[ee].node.mode===ne.mode?($[ee][q]=j(I[ee].lastCount+ne.length,ne.mode)-j(I[ee].lastCount,ne.mode),I[ee].lastCount+=ne.length):(I[ee]&&(I[ee].lastCount=ne.length),$[ee][q]=j(ne.length,ne.mode)+4+c.getCharCountIndicator(ne.mode,ce))}}Ae=K}for(let Z=0;Z<Ae.length;Z++)$[Ae[Z]].end=0;return{map:$,table:I}}function fe(L,ce){let I;const $=c.getBestModeForData(L);if(I=c.from(ce,$),I!==c.BYTE&&I.bit<$.bit)throw new Error('"'+L+'" cannot be encoded with mode '+c.toString(I)+\`.
|
|
29
|
+
Suggested mode is: \`+c.toString($));switch(I===c.KANJI&&!A.isKanjiModeEnabled()&&(I=c.BYTE),I){case c.NUMERIC:return new r(L);case c.ALPHANUMERIC:return new s(L);case c.KANJI:return new h(L);case c.BYTE:return new d(L)}}i.fromArray=function(ce){return ce.reduce(function(I,$){return typeof $=="string"?I.push(fe($,null)):$.data&&I.push(fe($.data,$.mode)),I},[])},i.fromString=function(ce,I){const $=E(ce,A.isKanjiModeEnabled()),Ae=X($),Z=D(Ae,I),Y=p.find_path(Z.map,"start","end"),K=[];for(let V=1;V<Y.length-1;V++)K.push(Z.table[Y[V]].node);return i.fromArray(B(K))},i.rawSplit=function(ce){return i.fromArray(E(ce,A.isKanjiModeEnabled()))}})(tf)),tf}var l0;function fv(){if(l0)return Qs;l0=1;const i=nl(),c=pf(),r=ky(),s=Jy(),d=$y(),h=Fy(),v=Wy(),A=v0(),p=ev(),g=tv(),N=nv(),E=ll(),j=sv();function B(Z,Y){const K=Z.size,V=h.getPositions(Y);for(let ne=0;ne<V.length;ne++){const q=V[ne][0],F=V[ne][1];for(let ee=-1;ee<=7;ee++)if(!(q+ee<=-1||K<=q+ee))for(let ue=-1;ue<=7;ue++)F+ue<=-1||K<=F+ue||(ee>=0&&ee<=6&&(ue===0||ue===6)||ue>=0&&ue<=6&&(ee===0||ee===6)||ee>=2&&ee<=4&&ue>=2&&ue<=4?Z.set(q+ee,F+ue,!0,!0):Z.set(q+ee,F+ue,!1,!0))}}function X(Z){const Y=Z.size;for(let K=8;K<Y-8;K++){const V=K%2===0;Z.set(K,6,V,!0),Z.set(6,K,V,!0)}}function D(Z,Y){const K=d.getPositions(Y);for(let V=0;V<K.length;V++){const ne=K[V][0],q=K[V][1];for(let F=-2;F<=2;F++)for(let ee=-2;ee<=2;ee++)F===-2||F===2||ee===-2||ee===2||F===0&&ee===0?Z.set(ne+F,q+ee,!0,!0):Z.set(ne+F,q+ee,!1,!0)}}function fe(Z,Y){const K=Z.size,V=g.getEncodedBits(Y);let ne,q,F;for(let ee=0;ee<18;ee++)ne=Math.floor(ee/3),q=ee%3+K-8-3,F=(V>>ee&1)===1,Z.set(ne,q,F,!0),Z.set(q,ne,F,!0)}function L(Z,Y,K){const V=Z.size,ne=N.getEncodedBits(Y,K);let q,F;for(q=0;q<15;q++)F=(ne>>q&1)===1,q<6?Z.set(q,8,F,!0):q<8?Z.set(q+1,8,F,!0):Z.set(V-15+q,8,F,!0),q<8?Z.set(8,V-q-1,F,!0):q<9?Z.set(8,15-q-1+1,F,!0):Z.set(8,15-q-1,F,!0);Z.set(V-8,8,1,!0)}function ce(Z,Y){const K=Z.size;let V=-1,ne=K-1,q=7,F=0;for(let ee=K-1;ee>0;ee-=2)for(ee===6&&ee--;;){for(let ue=0;ue<2;ue++)if(!Z.isReserved(ne,ee-ue)){let Ye=!1;F<Y.length&&(Ye=(Y[F]>>>q&1)===1),Z.set(ne,ee-ue,Ye),q--,q===-1&&(F++,q=7)}if(ne+=V,ne<0||K<=ne){ne-=V,V=-V;break}}}function I(Z,Y,K){const V=new r;K.forEach(function(ue){V.put(ue.mode.bit,4),V.put(ue.getLength(),E.getCharCountIndicator(ue.mode,Z)),ue.write(V)});const ne=i.getSymbolTotalCodewords(Z),q=A.getTotalCodewordsCount(Z,Y),F=(ne-q)*8;for(V.getLengthInBits()+4<=F&&V.put(0,4);V.getLengthInBits()%8!==0;)V.putBit(0);const ee=(F-V.getLengthInBits())/8;for(let ue=0;ue<ee;ue++)V.put(ue%2?17:236,8);return $(V,Z,Y)}function $(Z,Y,K){const V=i.getSymbolTotalCodewords(Y),ne=A.getTotalCodewordsCount(Y,K),q=V-ne,F=A.getBlocksCount(Y,K),ee=V%F,ue=F-ee,Ye=Math.floor(V/F),M=Math.floor(q/F),G=M+1,ae=Ye-M,Te=new p(ae);let be=0;const b=new Array(F),U=new Array(F);let Q=0;const W=new Uint8Array(Z.buffer);for(let Ne=0;Ne<F;Ne++){const nt=Ne<ue?M:G;b[Ne]=W.slice(be,be+nt),U[Ne]=Te.encode(b[Ne]),be+=nt,Q=Math.max(Q,nt)}const se=new Uint8Array(V);let re=0,de,Me;for(de=0;de<Q;de++)for(Me=0;Me<F;Me++)de<b[Me].length&&(se[re++]=b[Me][de]);for(de=0;de<ae;de++)for(Me=0;Me<F;Me++)se[re++]=U[Me][de];return se}function Ae(Z,Y,K,V){let ne;if(Array.isArray(Z))ne=j.fromArray(Z);else if(typeof Z=="string"){let Ye=Y;if(!Ye){const M=j.rawSplit(Z);Ye=g.getBestVersionForData(M,K)}ne=j.fromString(Z,Ye||40)}else throw new Error("Invalid data");const q=g.getBestVersionForData(ne,K);if(!q)throw new Error("The amount of data is too big to be stored in a QR Code");if(!Y)Y=q;else if(Y<q)throw new Error(\`
|
|
30
|
+
The chosen QR Code version cannot contain this amount of data.
|
|
31
|
+
Minimum version required to store current data is: \`+q+\`.
|
|
32
|
+
\`);const F=I(Y,K,ne),ee=i.getSymbolSize(Y),ue=new s(ee);return B(ue,Y),X(ue),D(ue,Y),L(ue,K,0),Y>=7&&fe(ue,Y),ce(ue,F),isNaN(V)&&(V=v.getBestMask(ue,L.bind(null,ue,K))),v.applyMask(V,ue),L(ue,K,V),{modules:ue,version:Y,errorCorrectionLevel:K,maskPattern:V,segments:ne}}return Qs.create=function(Y,K){if(typeof Y>"u"||Y==="")throw new Error("No input text");let V=c.M,ne,q;return typeof K<"u"&&(V=c.from(K.errorCorrectionLevel,c.M),ne=g.from(K.version),q=v.from(K.maskPattern),K.toSJISFunc&&i.setToSJISFunction(K.toSJISFunc)),Ae(Y,ne,V,q)},Qs}var sf={},ff={},a0;function p0(){return a0||(a0=1,(function(i){function c(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let s=r.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+r);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(h){return[h,h]}))),s.length===6&&s.push("F","F");const d=parseInt(s.join(""),16);return{r:d>>24&255,g:d>>16&255,b:d>>8&255,a:d&255,hex:"#"+s.slice(0,6).join("")}}i.getOptions=function(s){s||(s={}),s.color||(s.color={});const d=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,h=s.width&&s.width>=21?s.width:void 0,v=s.scale||4;return{width:h,scale:h?4:v,margin:d,color:{dark:c(s.color.dark||"#000000ff"),light:c(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},i.getScale=function(s,d){return d.width&&d.width>=s+d.margin*2?d.width/(s+d.margin*2):d.scale},i.getImageWidth=function(s,d){const h=i.getScale(s,d);return Math.floor((s+d.margin*2)*h)},i.qrToImageData=function(s,d,h){const v=d.modules.size,A=d.modules.data,p=i.getScale(v,h),g=Math.floor((v+h.margin*2)*p),N=h.margin*p,E=[h.color.light,h.color.dark];for(let j=0;j<g;j++)for(let B=0;B<g;B++){let X=(j*g+B)*4,D=h.color.light;if(j>=N&&B>=N&&j<g-N&&B<g-N){const fe=Math.floor((j-N)/p),L=Math.floor((B-N)/p);D=E[A[fe*v+L]?1:0]}s[X++]=D.r,s[X++]=D.g,s[X++]=D.b,s[X]=D.a}}})(ff)),ff}var u0;function rv(){return u0||(u0=1,(function(i){const c=p0();function r(d,h,v){d.clearRect(0,0,h.width,h.height),h.style||(h.style={}),h.height=v,h.width=v,h.style.height=v+"px",h.style.width=v+"px"}function s(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}i.render=function(h,v,A){let p=A,g=v;typeof p>"u"&&(!v||!v.getContext)&&(p=v,v=void 0),v||(g=s()),p=c.getOptions(p);const N=c.getImageWidth(h.modules.size,p),E=g.getContext("2d"),j=E.createImageData(N,N);return c.qrToImageData(j.data,h,p),r(E,g,N),E.putImageData(j,0,0),g},i.renderToDataURL=function(h,v,A){let p=A;typeof p>"u"&&(!v||!v.getContext)&&(p=v,v=void 0),p||(p={});const g=i.render(h,v,p),N=p.type||"image/png",E=p.rendererOpts||{};return g.toDataURL(N,E.quality)}})(sf)),sf}var rf={},i0;function ov(){if(i0)return rf;i0=1;const i=p0();function c(d,h){const v=d.a/255,A=h+'="'+d.hex+'"';return v<1?A+" "+h+'-opacity="'+v.toFixed(2).slice(1)+'"':A}function r(d,h,v){let A=d+h;return typeof v<"u"&&(A+=" "+v),A}function s(d,h,v){let A="",p=0,g=!1,N=0;for(let E=0;E<d.length;E++){const j=Math.floor(E%h),B=Math.floor(E/h);!j&&!g&&(g=!0),d[E]?(N++,E>0&&j>0&&d[E-1]||(A+=g?r("M",j+v,.5+B+v):r("m",p,0),p=0,g=!1),j+1<h&&d[E+1]||(A+=r("h",N),N=0)):p++}return A}return rf.render=function(h,v,A){const p=i.getOptions(v),g=h.modules.size,N=h.modules.data,E=g+p.margin*2,j=p.color.light.a?"<path "+c(p.color.light,"fill")+' d="M0 0h'+E+"v"+E+'H0z"/>':"",B="<path "+c(p.color.dark,"stroke")+' d="'+s(N,g,p.margin)+'"/>',X='viewBox="0 0 '+E+" "+E+'"',fe='<svg xmlns="http://www.w3.org/2000/svg" '+(p.width?'width="'+p.width+'" height="'+p.width+'" ':"")+X+' shape-rendering="crispEdges">'+j+B+\`</svg>
|
|
33
|
+
\`;return typeof A=="function"&&A(null,fe),fe},rf}var c0;function dv(){if(c0)return $l;c0=1;const i=Vy(),c=fv(),r=rv(),s=ov();function d(h,v,A,p,g){const N=[].slice.call(arguments,1),E=N.length,j=typeof N[E-1]=="function";if(!j&&!i())throw new Error("Callback required as last argument");if(j){if(E<2)throw new Error("Too few arguments provided");E===2?(g=A,A=v,v=p=void 0):E===3&&(v.getContext&&typeof g>"u"?(g=p,p=void 0):(g=p,p=A,A=v,v=void 0))}else{if(E<1)throw new Error("Too few arguments provided");return E===1?(A=v,v=p=void 0):E===2&&!v.getContext&&(p=A,A=v,v=void 0),new Promise(function(B,X){try{const D=c.create(A,p);B(h(D,v,p))}catch(D){X(D)}})}try{const B=c.create(A,p);g(null,h(B,v,p))}catch(B){g(B)}}return $l.create=c.create,$l.toCanvas=d.bind(null,r.render),$l.toDataURL=d.bind(null,r.renderToDataURL),$l.toString=d.bind(null,function(h,v,A){return s.render(h,A)}),$l}var hv=dv();const mv=Lg(hv);function E0(i){return i==null?"":typeof i=="string"?i:typeof i=="number"||typeof i=="boolean"?String(i):JSON.stringify(i)}function gv(i){return!(i.text.trim()===""||i.text===E0(i.setting.value)||i.setting.confirm!==void 0&&!i.confirmed)}function yv(i){return i.agents.length===0?m.jsx("div",{className:"empty",style:{fontSize:12,padding:"4px 8px"},children:"no agents on this server"}):m.jsx(m.Fragment,{children:i.agents.map(c=>{const r=c.status==="disabled";return m.jsxs("div",{className:"agent-row",children:[m.jsxs("button",{type:"button",className:"row-button","aria-current":c.id===i.current,disabled:r,onClick:()=>i.onSelect(c.id),children:[c.name,r?m.jsx("span",{className:"agent-off",children:" · stopped"}):null]}),r?m.jsxs("div",{className:"agent-note",children:[c.reason??"switched off",m.jsx("button",{type:"button",className:"link",disabled:i.starting===c.id,onClick:()=>i.onStart(c.id),children:i.starting===c.id?"starting…":"start"})]}):null]},c.id)})})}function vv(i){return i.tools.length===0?m.jsxs("p",{className:"empty",children:["No tools are pinned. An agent with none can still hold a conversation; a manifest's"," ",m.jsx("code",{children:"tools.pinned"})," is what grants the rest."]}):m.jsxs("table",{className:"panel-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"tool"}),m.jsx("th",{children:"provider"}),m.jsx("th",{children:"writes"}),m.jsx("th",{children:"trust"})]})}),m.jsx("tbody",{children:i.tools.map(c=>m.jsxs("tr",{children:[m.jsxs("td",{children:[m.jsx("code",{children:c.slug}),m.jsx("div",{className:"sub",children:c.summary})]}),m.jsx("td",{children:c.provider}),m.jsx("td",{children:c.mutating?"yes":"no"}),m.jsxs("td",{children:[c.trust,c.trustReason===void 0?null:m.jsx("div",{className:"sub",children:c.trustReason})]})]},c.slug))})]})}function bv(i){return m.jsxs(m.Fragment,{children:[i.schedules.length===0?m.jsxs("p",{className:"empty",children:["No schedules. Add one below, or declare it in the manifest's"," ",m.jsx("code",{children:"schedules:"})," block — a declared one survives a rebuild and shows up in a diff."]}):m.jsxs("table",{className:"panel-table",children:[m.jsx("thead",{children:m.jsxs("tr",{children:[m.jsx("th",{children:"schedule"}),m.jsx("th",{children:"when"}),m.jsx("th",{children:"next"}),m.jsx("th",{children:"delivers to"}),m.jsx("th",{children:"declared in"}),m.jsx("th",{})]})}),m.jsx("tbody",{children:i.schedules.map(c=>{const r=c.origin==="manifest",s=i.busy===c.id;return m.jsxs("tr",{className:c.enabled?"":"off",children:[m.jsxs("td",{children:[m.jsx("code",{children:c.id}),m.jsx("div",{className:"sub",children:c.task})]}),m.jsxs("td",{children:[c.kind," ",c.expr,c.timezone===void 0?null:m.jsx("div",{className:"sub",children:c.timezone})]}),m.jsx("td",{children:c.enabled?c.nextRunAt??"never again — a spent one-shot":"disabled"}),m.jsx("td",{children:c.deliverChannel===void 0?"this session only":\`\${c.deliverChannel}\${c.deliverTo===void 0?"":\` → \${c.deliverTo}\`}\`}),m.jsxs("td",{children:[r?"agent.yaml":"the API",r?m.jsxs("div",{className:"sub",children:["the manifest decides it — edit the file, or the"," ",m.jsx("code",{children:"schedules"})," field under config"]}):null]}),m.jsxs("td",{style:{whiteSpace:"nowrap"},children:[i.onRun===void 0?null:m.jsx("button",{type:"button",disabled:s,onClick:()=>i.onRun?.(c.id),children:"run now"}),i.onToggle===void 0||r?null:m.jsx("button",{type:"button",disabled:s,onClick:()=>i.onToggle?.(c.id,!c.enabled),children:c.enabled?"disable":"enable"}),i.onDelete===void 0||r?null:m.jsx("button",{type:"button",disabled:s,onClick:()=>i.onDelete?.(c.id),children:"delete"})]})]},c.id)})})]}),i.onCreate===void 0?null:m.jsx(Sv,{onCreate:i.onCreate})]})}function Sv(i){const[c,r]=k.useState(""),[s,d]=k.useState("cron"),[h,v]=k.useState(""),[A,p]=k.useState(""),[g,N]=k.useState(""),[E,j]=k.useState(""),B=c.trim()!==""&&h.trim()!==""&&A.trim()!=="";return m.jsxs("section",{style:{marginTop:24},children:[m.jsx("h3",{style:{fontSize:13,margin:"0 0 8px"},children:"Add a schedule"}),m.jsxs("div",{className:"form-grid",children:[m.jsx("label",{htmlFor:"sched-id",children:"id"}),m.jsx("input",{id:"sched-id",value:c,placeholder:"morning-brief",onChange:X=>r(X.target.value)}),m.jsx("label",{htmlFor:"sched-kind",children:"kind"}),m.jsxs("select",{id:"sched-kind",value:s,onChange:X=>d(X.target.value),children:[m.jsx("option",{value:"cron",children:"cron — a 5- or 6-field expression"}),m.jsx("option",{value:"every",children:"every — a duration like 15m"}),m.jsx("option",{value:"at",children:"at — one ISO instant, once"})]}),m.jsx("label",{htmlFor:"sched-expr",children:"expr"}),m.jsx("input",{id:"sched-expr",value:h,placeholder:s==="cron"?"0 8 * * *":s==="every"?"15m":"",onChange:X=>v(X.target.value)}),m.jsx("label",{htmlFor:"sched-task",children:"task"}),m.jsx("input",{id:"sched-task",value:A,placeholder:"Summarise today's calendar.",onChange:X=>p(X.target.value)}),m.jsx("label",{htmlFor:"sched-channel",children:"deliver"}),m.jsxs("div",{children:[m.jsx("input",{id:"sched-channel",value:g,placeholder:"channel id — blank for this session only",onChange:X=>N(X.target.value)}),g.trim()===""?null:m.jsxs(m.Fragment,{children:[m.jsx("input",{value:E,placeholder:"address",onChange:X=>j(X.target.value)}),m.jsxs("p",{className:"sub",children:["The address a reply is ",m.jsx("em",{children:"sent"})," to — on Telegram the numeric chat id, never an ",m.jsx("code",{children:"@handle"}),", which addresses a channel and not a person. It is the id inbound messages arrive on."]})]})]})]}),m.jsx("button",{type:"button",disabled:!B,style:{marginTop:10},onClick:()=>i.onCreate({id:c.trim(),kind:s,expr:h.trim(),task:A.trim(),deliver:g.trim()===""?"none":{channel:g.trim(),to:E.trim()}}),children:"add"})]})}function pv(i){return i.editable?m.jsxs(m.Fragment,{children:[m.jsxs("p",{className:"sub",style:{marginTop:0},children:[i.file===void 0?null:m.jsxs(m.Fragment,{children:[m.jsx("code",{children:i.file}),"."," "]}),"An agent's settings are fixed for its instance's lifetime, so saving one replaces the agent — the conversation history is in the store and survives it."]}),i.note===void 0?null:m.jsx("p",{className:"row note",children:i.note}),i.settings.map(c=>m.jsx(Ev,{setting:c,busy:i.busy===c.path,onSet:i.onSet},c.path))]}):m.jsx("p",{className:"empty",children:"This agent was loaded from an object rather than a file, so there is no manifest to change. An embedder holding new settings passes the new object to its runtime."})}function Ev(i){const c=E0(i.setting.value),[r,s]=k.useState(c),[d,h]=k.useState(!1),[v,A]=k.useState(c);v!==c&&(A(c),s(c),h(!1));const p=gv({setting:i.setting,text:r,confirmed:d}),g=c.length>48||c.includes("{")||c.includes("[");return m.jsxs("section",{className:"config-row",children:[m.jsxs("div",{className:"config-head",children:[m.jsx("code",{children:i.setting.path}),i.setting.value===void 0?m.jsx("span",{className:"sub",children:" not set"}):null]}),m.jsx("p",{className:"sub",children:i.setting.means}),g?m.jsx("textarea",{rows:2,value:r,"aria-label":i.setting.path,onChange:N=>s(N.target.value)}):m.jsx("input",{value:r,"aria-label":i.setting.path,onChange:N=>s(N.target.value)}),i.setting.confirm===void 0?null:m.jsxs("label",{className:"row note bad",style:{display:"block"},children:[m.jsx("input",{type:"checkbox",checked:d,onChange:N=>h(N.target.checked)})," ",i.setting.confirm]}),m.jsx("button",{type:"button",disabled:!p||i.busy,onClick:()=>i.onSet(i.setting.path,r,{confirm:d}),children:i.busy?"saving…":"save"})]})}function Tv(i){return i.warnings.length===0?null:m.jsxs("section",{className:"warnings",children:[m.jsxs("h3",{children:[i.warnings.length," thing",i.warnings.length===1?"":"s"," this agent could not set up"]}),m.jsx("p",{className:"sub",children:"It is running. Each of these is a capability it does not have — fix the cause and restart the agent."}),i.warnings.map(c=>m.jsxs("div",{className:"warning",children:[m.jsxs("p",{className:"warning-message",children:[c.field===void 0?null:m.jsx("code",{children:c.field})," ",c.message]}),c.hint===void 0?null:m.jsx("p",{className:"hint",children:c.hint})]},\`\${c.code}:\${c.message}\`))]})}function Av(i){return i.channels.length===0?m.jsx("p",{className:"empty",children:"No channels. This agent is reached through this page and the HTTP API only."}):m.jsxs("div",{className:"channels",children:[i.channels.map(c=>{const r=c.input,s=r?.expiresAt!==void 0&&Date.parse(r.expiresAt)<=i.now;return m.jsxs("section",{className:"channel",children:[m.jsxs("h3",{children:[m.jsx("code",{children:c.id})," ",m.jsx("span",{className:"sub",children:c.type})]}),m.jsxs("p",{className:\`status status-\${c.status??"off"}\`,children:[c.enabled===!1?"disconnected":c.status??"not started here",c.detail===void 0?null:\` — \${c.detail}\`]}),c.credentialEnv===void 0?null:m.jsxs("p",{className:c.credentialSet===!0?"sub":"warn",children:[m.jsx("code",{children:c.credentialEnv})," ",c.credentialSet===!0?"is set":"is NOT set"]}),r===void 0?null:m.jsxs("div",{className:\`channel-input \${s?"stale":"fresh"}\`,children:[s?m.jsx("p",{className:"warn",children:"this expired — the channel will issue another"}):null,m.jsx(Nv,{kind:r.kind,payload:r.payload}),m.jsxs("p",{className:"sub",children:[r.kind," · issued ",r.issuedAt,r.expiresAt===void 0?" · no expiry reported":\` · expires \${r.expiresAt}\`]})]}),i.actions===void 0?null:m.jsx(zv,{channel:c,actions:i.actions})]},c.id)}),i.actions?.note===void 0?null:m.jsx("p",{className:"row note",children:i.actions.note})]})}function zv(i){const[c,r]=k.useState(""),{channel:s,actions:d}=i,h=d.busy===s.id,v=s.enabled!==!1,A=s.input!==void 0||s.type==="whatsapp";return m.jsxs("div",{className:"channel-actions",children:[m.jsx("button",{type:"button",disabled:h,onClick:()=>d.onConnect(s.id,!v),children:v?"disconnect":"connect"}),A?m.jsx("button",{type:"button",disabled:h,onClick:()=>d.onUnpair(s.id),children:"unpair"}):null,s.credentialEnv===void 0?null:m.jsxs("form",{onSubmit:p=>{p.preventDefault(),c!==""&&(d.onCredential(s.id,c),r(""))},children:[m.jsx("input",{type:"password",autoComplete:"new-password",placeholder:s.credentialEnv,value:c,disabled:h,onChange:p=>r(p.target.value)}),m.jsx("button",{type:"submit",disabled:h||c==="",children:s.credentialSet===!0?"replace":"set"})]}),h?m.jsx("span",{className:"sub",children:"working…"}):null]})}const Cv=[{panel:"tools",label:"tools"},{panel:"schedules",label:"schedules"},{panel:"channels",label:"channels"},{panel:"config",label:"config"},{panel:"keys",label:"keys"}];function Nv(i){if(i.kind==="pairing_code")return m.jsx("p",{className:"payload-code","data-kind":i.kind,children:i.payload.length===8?\`\${i.payload.slice(0,4)} \${i.payload.slice(4)}\`:i.payload});const c=i.kind==="qr"?jv(i.payload):void 0;return c===void 0?m.jsx("pre",{className:"payload","data-kind":i.kind,children:i.payload}):m.jsxs("svg",{className:"payload-qr",viewBox:\`0 0 \${c.extent} \${c.extent}\`,"data-kind":i.kind,"data-modules":c.size,shapeRendering:"crispEdges",role:"img","aria-label":"Scan this code from WhatsApp, under Linked devices",children:[m.jsx("rect",{width:c.extent,height:c.extent,fill:"#fff"}),m.jsx("path",{d:c.d,fill:"#000"})]})}const of=4;function jv(i){try{const{modules:c}=mv.create(i,{errorCorrectionLevel:"L"}),r=c.size;let s="";for(let d=0;d<r;d+=1)for(let h=0;h<r;h+=1)c.data[d*r+h]===1&&(s+=\`M\${h+of},\${d+of}h1v1h-1z\`);return s===""?void 0:{d:s,size:r,extent:r+of*2}}catch{return}}const df="dispach.turn";function xv(i){const[c,r]=k.useState(),[s,d]=k.useState();return k.useEffect(()=>{zy(i.baseUrl).then(r).catch(h=>d(h instanceof Error?h.message:String(h)))},[i.baseUrl]),s!==void 0?m.jsxs(gf,{title:"Cannot reach the server",children:[m.jsx("p",{children:s}),m.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Try again"})]}):c===void 0?m.jsx(gf,{title:"Connecting…"}):c.kind==="needed"?m.jsx(_v,{baseUrl:i.baseUrl,because:c.because}):m.jsx(wv,{baseUrl:i.baseUrl,token:c.kind==="key"?c.secret:void 0})}function gf(i){return m.jsx("div",{className:"gate",children:m.jsxs("div",{className:"card",children:[m.jsx("h2",{children:i.title}),i.children]})})}function _v(i){const[c,r]=k.useState(""),[s,d]=k.useState(),[h,v]=k.useState(!1),A=async p=>{v(!0),d(void 0);try{const g=p?await m0(i.baseUrl,c.trim()):c.trim();bf(g),window.location.reload()}catch(g){d(g instanceof Error?g.message:String(g)),v(!1)}};return m.jsxs(gf,{title:"This server needs a credential",children:[m.jsx("p",{children:i.because}),m.jsx("input",{value:c,placeholder:"paste a claim or an operator key",onChange:p=>r(p.target.value)}),m.jsxs("p",{className:"hint",style:{margin:"8px 0 12px"},children:[m.jsx("code",{children:"dispach serve"})," prints a one-time claim at boot while no key exists. A claim is exchanged for a key this browser keeps; a key is used directly."]}),m.jsx("div",{className:"ask",children:m.jsxs("div",{className:"buttons",children:[m.jsx("button",{type:"button",className:"primary",disabled:h||c.trim()==="",onClick:()=>A(!0),children:"Exchange a claim"}),m.jsx("button",{type:"button",disabled:h||c.trim()==="",onClick:()=>A(!1),children:"Use as a key"})]})}),s===void 0?null:m.jsx("p",{className:"note bad",style:{marginTop:12},children:s})]})}const yi=i=>i instanceof Zt&&i.status===404,Mv={new:"New agent",tools:"Tools",schedules:"Schedules",channels:"Channels",config:"Settings",keys:"Operator keys"};function wv(i){const c=k.useRef(g0(i.baseUrl,i.token)),[r,s]=k.useState([]),[d,h]=k.useState(),[v,A]=k.useState(),[p,g]=k.useState(),[N,E]=k.useState([]),j=k.useCallback(async()=>{h(void 0),A(void 0),E([]),K("this agent is no longer running on this server — start it from the list");try{s(await c.current.agents())}catch{}},[]),[B,X]=k.useState([]),[D,fe]=k.useState(),[L,ce]=k.useState(()=>My(window.location.href).panel),[I,$]=k.useState(Fa),[Ae,Z]=k.useState(""),[Y,K]=k.useState(),V=k.useRef(void 0),ne=k.useRef(Uy());k.useEffect(()=>{const H=new URL(window.location.href).searchParams.get("agent")??void 0;c.current.agents().then(J=>{s(J);const he=J.filter(lt=>lt.status!=="disabled"),De=he.find(lt=>lt.id===H)??he[0];if(De===void 0){new URL(window.location.href).searchParams.get("panel")===null&&ce("new");return}h(De.id),A(De.name),$(lt=>({...lt,filter:qy(De.dialect??"nlt").filter})),document.title=\`\${De.name} · Dispach\`}).catch(J=>K(qt(J)))},[]);const q=k.useMemo(()=>d===void 0?void 0:c.current.agent(d),[d]),F=k.useCallback(async()=>{if(q!==void 0)try{X(await q.sessions()),K(void 0)}catch(H){yi(H)?j():K(qt(H))}},[q,j]);k.useEffect(()=>{F()},[F]);const ee=k.useCallback(async(H,J)=>{const he=ne.current,De=he.begin(H);if(De===void 0)return;const lt=J.turn(H);V.current=()=>lt.stop();try{sessionStorage.setItem(df,H);for await(const rl of lt.stream({chunks:!0,signal:De}))$(Il=>Ly(Il,rl))}catch(rl){De.aborted||(K(qt(rl)),$(Il=>({...Il,running:!1})))}finally{he.finish(H),sessionStorage.removeItem(df),V.current=void 0,De.aborted||F()}},[F]);k.useEffect(()=>{if(q===void 0)return;const H=sessionStorage.getItem(df);if(H!==null)return $(J=>({...J,running:!0})),ee(H,q),()=>ne.current.abort()},[q,ee]),k.useEffect(()=>{if(q===void 0)return;let H=!0;const J=()=>{q.approvals().then(De=>{H&&E(De)}).catch(De=>{H&&yi(De)&&j()})};J();const he=window.setInterval(J,5e3);return()=>{H=!1,window.clearInterval(he)}},[q,j]);const ue=async()=>{const H=Ae.trim();if(!(H===""||q===void 0)){Z(""),K(void 0),$(J=>Yy(J,H));try{const J=await q.send(H,{...D===void 0?{}:{sessionKey:D}});D===void 0&&fe(J.sessionKey),await ee(J.turnId,q)}catch(J){K(qt(J)),$(he=>({...he,running:!1}))}}},Ye=async(H,J)=>{if(q!==void 0)try{await q.approve(H,J)}catch(he){he instanceof Zt&&he.code==="approval_not_found"||K(qt(he))}},M=async H=>{if(ne.current.abort(),ce("chat"),fe(H),$(Fa),Z(""),!(H===void 0||q===void 0))try{const J=await Rv(i.baseUrl,i.token,d??"",H);$({...Fa,rows:J})}catch(J){K(qt(J))}},[G,ae]=k.useState({tools:[],schedules:[],channels:[],warnings:[]}),[Te,be]=k.useState(void 0),[b,U]=k.useState(void 0),Q=k.useCallback(async H=>{const[J,he,De,lt]=await Promise.all([H.tools(),H.schedules(),H.describe(),H.config()]);ae({tools:J,schedules:he,channels:De.channels??[],warnings:De.warnings??[],config:lt})},[]),W=k.useCallback(async(H,J)=>{if(q!==void 0){be(H),U(void 0);try{const he=await q.setChannel(H,J);U([...he.notes,...he.applied?[]:[\`Not in force yet: \${he.pending?.message??"restart to apply"}\`]].join(" ")),await Q(q)}catch(he){U(he instanceof Error?he.message:String(he))}finally{be(void 0)}}},[q,Q]),se=k.useCallback(async H=>{if(q!==void 0){be(H),U(void 0);try{U((await q.unpairChannel(H)).note),await Q(q)}catch(J){U(J instanceof Error?J.message:String(J))}finally{be(void 0)}}},[q,Q]);k.useEffect(()=>{if(q===void 0||L!=="tools"&&L!=="schedules"&&L!=="channels"&&L!=="config")return;let H=!1;return(async()=>{try{if(await Q(q),H)return}catch(J){if(H)return;yi(J)?j():K(qt(J))}})(),()=>{H=!0}},[q,L,j,Q]);const[re,de]=k.useState(),[Me,Ne]=k.useState(),nt=k.useCallback(async(H,J)=>{if(q!==void 0){de(H),K(void 0),Ne(void 0);try{const he=await J(q);Ne(he),await Q(q)}catch(he){yi(he)?j():K(qt(he))}finally{de(void 0)}}},[q,j,Q]),al=k.useCallback((H,J,he)=>void nt(H,async De=>{const lt=await De.setConfig(H,J,{...he.confirm?{confirm:!0}:{}});return lt.applied?lt.reflowed?\`\${H} saved. The manifest was re-serialised, so its comments have moved — worth a look at the diff.\`:void 0:\`\${H} was written to the manifest and is not in force yet: \${lt.pending?.message??"the agent could not be replaced"} It takes effect at the next start.\`}),[nt]),[At,Fl]=k.useState(),[zt,ul]=k.useState({}),[Wl,Wa]=k.useState(!1),[Ia,il]=k.useState(!1),[cl,sl]=k.useState();k.useEffect(()=>{if(L!=="new"||At!==void 0)return;let H=!1;return(async()=>{try{const J=await c.current.provision();if(H)return;Fl(J),ul(Ry(J.steps))}catch(J){H||K(qt(J))}})(),()=>{H=!0}},[L,At]);const Si=k.useCallback(async()=>{if(At!==void 0&&(Wa(!0),!(y0(At.steps,zt).length>0))){il(!0),K(void 0);try{const H=await c.current.createAgent(By(At.steps,zt));sl(H),s(await c.current.agents())}catch(H){K(qt(H))}finally{il(!1)}}},[At,zt]),fl=k.useCallback(H=>{const J=H.panel??L,he=H.agentId??d;ce(J),H.agentId!==void 0&&H.agentId!==d&&(h(H.agentId),A(r.find(De=>De.id===H.agentId)?.name),fe(void 0),$(Fa),Z("")),window.history.replaceState(null,"",wy(window.location.href,{...he===void 0?{}:{agentId:he},panel:J}))},[d,r,L]),ut=k.useCallback(async H=>{g(H);try{await c.current.agent(H).start(),s(await c.current.agents())}catch(J){K(qt(J))}finally{g(void 0)}},[]);return m.jsxs("div",{className:"shell",children:[m.jsxs("aside",{className:"side",children:[m.jsxs("header",{children:[m.jsx("div",{className:"brand",children:"Dispach"}),m.jsx("div",{style:{fontSize:12,color:"var(--dim)"},children:v??"…"})]}),m.jsxs("nav",{children:[r.length>1||r.some(H=>H.status==="disabled")?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"group",children:"Agents"}),m.jsx(yv,{agents:r,current:d,onSelect:H=>fl({agentId:H}),onStart:H=>void ut(H),...p===void 0?{}:{starting:p}})]}):null,m.jsx("div",{className:"group",children:"Conversation"}),m.jsx("button",{type:"button",className:"row-button","aria-current":L==="chat"&&D===void 0,onClick:()=>void M(void 0),children:"+ new"}),B.map(H=>m.jsx("button",{type:"button",className:"row-button","aria-current":L==="chat"&&D===H.sessionKey,onClick:()=>void M(H.sessionKey),children:H.sessionKey},H.sessionKey)),m.jsx("div",{className:"group",children:"Server"}),m.jsx("button",{type:"button",className:"row-button","aria-current":L==="new",onClick:()=>fl({panel:"new"}),children:"+ new agent"}),Cv.map(H=>m.jsx("button",{type:"button",className:"row-button","aria-current":L===H.panel,onClick:()=>fl({panel:H.panel}),children:H.label},H.panel))]}),m.jsxs("footer",{children:[m.jsx("span",{className:\`dot \${I.running?"busy":"live"}\`}),m.jsx("span",{style:{fontSize:11,color:"var(--dim)"},children:I.running?"working":"ready"}),i.token===void 0?m.jsx("span",{style:{fontSize:11,color:"var(--warn)",marginLeft:"auto"},children:"unauthenticated"}):m.jsx("button",{type:"button",style:{marginLeft:"auto",padding:"3px 8px",fontSize:11},onClick:()=>{Sf(),window.location.reload()},children:"forget key"})]})]}),m.jsxs("main",{className:"main",children:[m.jsxs("div",{className:"bar",children:[m.jsx("strong",{children:L==="chat"?v??"":Mv[L]}),L==="chat"?m.jsx("span",{children:D??"new conversation"}):null,m.jsx("span",{className:"spacer"}),N.length>0?m.jsxs("span",{style:{color:"var(--warn)"},children:[N.length," waiting on you"]}):null]}),L!=="chat"?m.jsx("div",{className:"scroll",children:m.jsxs("div",{className:"pad",children:[Y===void 0?null:m.jsx("p",{className:"row note bad",children:Y}),m.jsx(Tv,{warnings:G.warnings}),L==="new"?At===void 0?m.jsx("p",{className:"empty",children:"reading this server's questions…"}):m.jsx(Zy,{offer:At,answers:zt,busy:Ia,touched:Wl,...Y===void 0?{}:{error:Y},...cl===void 0?{}:{result:cl},onAnswer:(H,J)=>ul(he=>({...he,[H]:J})),onSubmit:()=>void Si(),onOpen:H=>{sl(void 0),Fl(void 0),Wa(!1),fl({agentId:H,panel:"chat"})}}):null,L==="keys"?m.jsx(Ny,{client:c.current,baseUrl:i.baseUrl,token:i.token}):null,L==="tools"?m.jsx(vv,{tools:G.tools}):null,L==="schedules"?m.jsx(bv,{schedules:G.schedules,...re===void 0?{}:{busy:re},onCreate:H=>void nt(String(H.id),J=>J.createSchedule(H).then(()=>{})),onDelete:H=>void nt(H,J=>J.deleteSchedule(H).then(()=>{})),onRun:H=>void nt(H,async J=>{const he=await J.runSchedule(H);return\`\${H} fired out of band as \${he.turnId} — its next scheduled run has not moved.\`}),onToggle:(H,J)=>void nt(H,he=>he.updateSchedule(H,{enabled:J}).then(()=>{}))}):null,L==="config"?G.config===void 0?m.jsx("p",{className:"empty",children:"reading this agent's settings…"}):m.jsx(pv,{settings:G.config.settings,editable:G.config.editable,...G.config.file===void 0?{}:{file:G.config.file},...re===void 0?{}:{busy:re},...Me===void 0?{}:{note:Me},onSet:al}):null,L==="channels"?m.jsx(Av,{channels:G.channels,now:Date.now(),actions:{onConnect:(H,J)=>void W(H,{enabled:J}),onCredential:(H,J)=>void W(H,{credential:J}),onUnpair:H=>void se(H),...Te===void 0?{}:{busy:Te},...b===void 0?{}:{note:b}}}):null]})}):m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"scroll",children:m.jsxs("div",{className:"pad",children:[Y===void 0?null:m.jsx("p",{className:"row note bad",children:Y}),m.jsx(vy,{state:I,onAnswer:(H,J)=>void Ye(H,J)}),m.jsx(Uv,{state:I})]})}),m.jsx(Ey,{value:Ae,busy:I.running,onChange:Z,onSend:()=>void ue(),onStop:()=>void V.current?.()})]})]})]})}function Uv(i){const c=k.useRef(null),r=i.state.rows.length+i.state.live.length;return k.useEffect(()=>{const s=c.current,d=s?.closest(".scroll");if(s===null||d===null||d===void 0)return;d.scrollHeight-d.scrollTop-d.clientHeight<40&&s.scrollIntoView({block:"end"})},[r]),m.jsx("div",{ref:c})}async function Rv(i,c,r,s){const d=await fetch(\`\${i}/v1/agents/\${r}/sessions/\${encodeURIComponent(s)}/messages?limit=200\`,{headers:c===void 0?{}:{authorization:\`Bearer \${c}\`}});return d.ok?[...(await d.json()).messages??[]].reverse().filter(v=>v.origin===void 0&&(v.role==="user"||v.role==="assistant")&&(v.content??"")!=="").map((v,A)=>({kind:v.role==="user"?"user":"reply",id:\`h\${A}\`,text:v.content??""})):[]}function qt(i){return i instanceof Zt||i instanceof Error?i.message:String(i)}const T0=document.getElementById("root");if(T0===null)throw new Error("no #root in the document");Fg.createRoot(T0).render(m.jsx(k.StrictMode,{children:m.jsx(xv,{baseUrl:window.location.origin})}));
|
|
34
|
+
`;var gt=`<!doctype html>
|
|
35
|
+
<html lang="en">
|
|
36
|
+
<head>
|
|
37
|
+
<meta charset="utf-8" />
|
|
38
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
39
|
+
<!--
|
|
40
|
+
An inline SVG data URI rather than a file, and that is a constraint rather than a
|
|
41
|
+
flourish: the server embeds these assets as *text* (decision 11.200), so a binary
|
|
42
|
+
favicon would be the one thing in the build that could not ride inside the bundle.
|
|
43
|
+
-->
|
|
44
|
+
<link
|
|
45
|
+
rel="icon"
|
|
46
|
+
href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Crect width='32' height='32' rx='7' fill='%230b0b0c'/%3E%3Cpath d='M9 8h7a8 8 0 0 1 0 16H9z' fill='none' stroke='%23e8e6e3' stroke-width='2.5'/%3E%3C/svg%3E"
|
|
47
|
+
/>
|
|
48
|
+
<title>Dispach</title>
|
|
49
|
+
<!--
|
|
50
|
+
No title text beyond the brand. The page sets \`document.title\` from the agent it is
|
|
51
|
+
actually talking to once it knows, because a tab saying "Dispach" next to three others
|
|
52
|
+
saying "Dispach" is a tab nobody can find.
|
|
53
|
+
-->
|
|
54
|
+
<script type="module" crossorigin src="./assets/app.js"></script>
|
|
55
|
+
<link rel="stylesheet" crossorigin href="./assets/app.css">
|
|
56
|
+
</head>
|
|
57
|
+
<body>
|
|
58
|
+
<div id="root"></div>
|
|
59
|
+
</body>
|
|
60
|
+
</html>
|
|
61
|
+
`;function yt(t){let e=2166136261;for(let r=0;r<t.length;r+=1)e^=t.charCodeAt(r),e=Math.imul(e,16777619)>>>0;return`"${e.toString(36)}-${t.length.toString(36)}"`}function re(t,e){return{body:t,contentType:e,etag:yt(t)}}var He={"/":re(gt,"text/html; charset=utf-8"),"/assets/app.js":re(mt,"text/javascript; charset=utf-8"),"/assets/app.css":re(pt,"text/css; charset=utf-8")},vt=Object.keys(He);function bt(t,e){let r=He[t];if(r===void 0)return;let c={"content-type":r.contentType,etag:r.etag,"cache-control":"no-cache"};if(e.headers.get("if-none-match")===r.etag)return new Response(null,{status:304,headers:c});return new Response(r.body,{status:200,headers:c})}var Y=1e6,ye=256,wt=128,ae=255,kt=`<!doctype html>
|
|
62
|
+
<html lang="en">
|
|
63
|
+
<head>
|
|
64
|
+
<meta charset="utf-8">
|
|
65
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
66
|
+
<title>Dispach API</title>
|
|
67
|
+
</head>
|
|
68
|
+
<body style="margin:0">
|
|
69
|
+
<noscript style="display:block;font:14px/1.5 system-ui;padding:2rem;max-width:40rem">
|
|
70
|
+
<h1 style="font-size:1rem">This page needs JavaScript and a network</h1>
|
|
71
|
+
<p>It loads the reference viewer from a CDN. The document itself is served locally and needs
|
|
72
|
+
neither: <a href="/v1/openapi.json">/v1/openapi.json</a>.</p>
|
|
73
|
+
</noscript>
|
|
74
|
+
<div id="app"></div>
|
|
75
|
+
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
|
|
76
|
+
<script>
|
|
77
|
+
Scalar.createApiReference('#app', { url: '/v1/openapi.json', theme: 'default' })
|
|
78
|
+
</script>
|
|
79
|
+
</body>
|
|
80
|
+
</html>
|
|
81
|
+
`;function St(t){let{runtime:e}=t,r=t.token,c=t.now??(()=>Date.now()),u=c();if(r===void 0&&t.allowUnauthenticated!==!0)throw new Be({code:"server_token_missing",message:"createHandler was called with no token and no allowUnauthenticated.",hint:"Pass token, or pass allowUnauthenticated: true to state that this handler is mounted somewhere already protected. Defaulting to open would make the safe configuration the one you have to remember."});let f=t.running??new Map,y=t.approvals??Ai(),x=()=>t.origin!==void 0&&J(t.origin.host),D=(a)=>x()||a.kind!=="open"&&me(a,"admin"),C=(a)=>{if(t.origin===void 0)return;let n=X(a,t.origin);return n===void 0?void 0:m(n,403)},k=(a,n)=>{if(t.origin===void 0)return n;let i=ct(a,t.origin);if(Object.keys(i).length===0)return n;let s=new Headers(n.headers);for(let[d,h]of Object.entries(i))s.set(d,h);return new Response(n.body,{status:n.status,statusText:n.statusText,headers:s})},O=!1,E=async()=>{if(r!==void 0||O)return!0;return O=await e.store.operatorKeys.liveCount()>0,O},N=async(a,n,i)=>{if(xt(n)||!await E())return{kind:"open"};let s=await Qe({request:a,expected:r,keys:e.store.operatorKeys,claim:t.claim,pathname:n,at:c()});if(s instanceof Response)return s;if(s.kind==="claim")return s;if(i!=="open"&&!me(s,i))return Ve(i,`${a.method} ${n}`);return s},p=new Ue;return p.add("GET","/v1/health",()=>S({status:"ok",version:NA,uptimeMs:c()-u,agents:e.list().length}),{capability:"open"}),p.add("GET","/v1/ready",()=>{if(e.ready)return S({status:"ready",agents:e.list().length});return S({status:"starting",agents:e.list().length},503)},{capability:"open"}),p.add("GET","/v1/activity",async(a)=>{let n=a.principal;if(n.kind==="key"&&n.scope!==void 0&&(n.scope.agents!==void 0||n.scope.sessions!==void 0))return m({code:"activity_needs_unscoped_key",message:"Activity covers every agent on this server, and this key is scoped.",hint:"Call this with the server token or an operator key minted with no agents or sessions scope — it is meant for whatever suspends and wakes the process, not for a tenant."},403);return S(await e.activity(c()))},{capability:"admin"}),p.add("GET","/v1/agents",async(a)=>{let n=e.list().map((d)=>Ce(e,d)),i=new Set(n.map((d)=>d.id)),s=(await e.store.agentState.list()).filter((d)=>!d.enabled&&!i.has(d.agentId)).map((d)=>({id:d.agentId,name:d.agentId,status:"disabled",...d.reason===void 0?{}:{reason:d.reason},...d.disabledAt===void 0?{}:{disabledAt:d.disabledAt}}));return S(Nt(a.principal,[...n,...s]))},{capability:"read"}),p.add("GET","/v1/agents/:id",(a)=>T(e,a,async(n)=>{let i=await n.store.schedules.list(n.id),s=e.team(n.id);return S({...Ce(e,n),dialect:n.describe().dialect,window:n.window,tools:n.tools.size,catalogueTokens:n.describe().catalogueTokens,skills:n.skills?.skills.length??0,schedules:i.length,...s.length===0?{}:{team:s.map((d)=>({id:d.id,task:d.task,artifact:Object.keys(d.artifact.properties)}))},warnings:[...n.warnings,...n.tools.warnings]})}),{capability:"read"}),p.add("POST","/v1/agents/:id/reload",(a)=>T(e,a,async(n)=>{try{let i=await e.replace(n.id);return S({id:n.id,status:"loaded",adopted:i.map((s)=>s.id)})}catch(i){if(de(i))return m({code:i.code,message:i.message,hint:i.hint,...i.field===void 0?{}:{field:i.field}},i.code==="agent_turn_in_flight"?409:400);throw i}}),{capability:"admin"}),p.add("GET","/v1/openapi.json",(a)=>S(st({routes:p.routes(),serverUrl:`${a.url.protocol}//${a.url.host}`})),{capability:"open"}),p.add("GET","/docs",()=>new Response(kt,{status:200,headers:{"content-type":"text/html; charset=utf-8"}}),{capability:"open"}),p.add("GET","/v1/provision",(a)=>S({available:t.provision!==void 0,local:x(),allowed:D(a.principal),steps:t.provision?.steps()??[]}),{capability:"read"}),p.add("POST","/v1/agents",async(a)=>{let n=t.provision;if(n===void 0)return m({code:"provisioning_not_supported",message:"This server cannot create agents.",hint:"Creating one writes a directory of files from a question set this process was not given — an embedder mounting this handler over its own agent store is the case that lands here. Run `init` where the sandbox is, or mount an agent directory."},501);if(!D(a.principal))return m({code:"provisioning_not_local",message:"Creating an agent needs either a loopback bind or a credential with the admin capability.",hint:"This route writes files and starts an agent. A token-less loopback server is a supported configuration, so on a non-loopback bind it asks for a credential instead — set server.tokenEnv (the container's DISPACH_API_TOKEN does this) or present an operator key minted with `can: [admin]`. What is refused is provisioning on a server that required no credential at all and is reachable from the network."},403);let i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(Le,i.value);if(!s.ok)return m(s.error,400);let{answers:d,template:h}=s.value;if(d!==void 0&&h!==void 0)return m({code:"provision_body_ambiguous",message:"The body has both answers and a template.",hint:"Send answers to create an agent the way init does, or template with name and vars to create one from a template in this server's sandbox. Not both.",field:"template"},400);if(d===void 0&&h===void 0)return m({code:"provision_answers_required",message:"The body has neither answers nor a template.",hint:'Send { "answers": { "name": "milo", … } } (GET /v1/provision lists the steps), or { "template": "…", "name": "…", "vars": {…} } (GET /v1/templates lists the templates).',field:"answers"},400);let g;try{g=h===void 0?n.create(d??{}):n.createFromTemplate({template:h,name:s.value.name??"",vars:s.value.vars??{}})}catch(w){if(de(w))return m(w.toDetail(),400);throw w}try{let w=await e.adopt(g.manifestPath);return S({id:g.agentId,dir:g.dir,files:g.files,adopted:w.map((v)=>v.id)},201)}catch(w){return S({id:g.agentId,dir:g.dir,files:g.files,adopted:[],error:de(w)?w.toDetail():{code:"provision_adopt_failed",message:w instanceof Error?w.message:String(w),hint:"The agent was written and is not running. Fix what the message names and `start` it, or restart the host."}},201)}},{capability:"admin"}),p.add("GET","/v1/templates",()=>S({templates:t.provision?.templates()??[]}),{capability:"read"}),p.add("GET","/v1/agents/:id/secrets",async(a)=>{let n=ke(e,t,a);if(n.kind==="response")return n.response;return S({id:n.id,secrets:n.admin.status(n.manifestPath)})},{capability:"admin"}),p.add("PUT","/v1/agents/:id/secrets",async(a)=>{let n=ke(e,t,a);if(n.kind==="response")return n.response;let i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(Me,i.value);if(!s.ok)return m(s.error,400);let d;try{d=n.admin.write(n.manifestPath,s.value.values)}catch(v){if(de(v))return m(v.toDetail(),400);throw v}let h={id:n.id,written:d.written,shadowed:d.shadowed},g=e.list().some((v)=>v.id===n.id),w=await e.store.agentState.get(n.id);if(!g&&w?.enabled===!1)return S({...h,applied:"none",adopted:[],stopped:!0});try{let v=g?await e.replace(n.id):await e.adopt(n.manifestPath);return S({...h,applied:g?"reloaded":"adopted",adopted:v.map((_)=>_.id)})}catch(v){return S({...h,applied:"none",adopted:[],error:de(v)?v.toDetail():{code:"secrets_apply_failed",message:v instanceof Error?v.message:String(v),hint:"The values were written and the agent is not running on them yet. Fix what the message names and reload or start it."}})}},{capability:"admin"}),p.add("POST","/v1/agents/:id/stop",async(a)=>{let n=a.params.id??"";if(!H(a.principal,n))return z("agent",n);let i=e.list().some((v)=>v.id===n),s=await e.store.agentState.get(n);if(!i&&s===void 0)return z("agent",n);let d=await B(a.request);if(d.kind==="error")return m(d.error,400);let h=G(Re,d.value);if(!h.ok)return m(h.error,400);let g=h.value.reason?.trim(),w=await e.store.agentState.disable(n,new Date(t.now?.()??Date.now()).toISOString(),g===void 0||g===""?void 0:g);if(i)try{await e.dispose(n,"stopped")}catch(v){if(de(v)&&v.code==="agent_turn_in_flight")return m(v.toDetail(),409);throw v}return S({id:n,status:"disabled",...oe(w)})},{capability:"admin"}),p.add("POST","/v1/agents/:id/start",async(a)=>{let n=a.params.id??"";if(!H(a.principal,n))return z("agent",n);if(e.list().some((h)=>h.id===n)){let h=await e.store.agentState.enable(n);return S({id:n,status:"loaded",...oe(h)})}let i=t.resolveAgent;if(i===void 0)return m({code:"start_not_supported",message:"This server cannot look up a manifest for an agent it is not hosting.",hint:"Starting a stopped agent needs its manifest, which lives wherever agents live — the sandbox for the CLI, a mounted path for a container. This process was built without that lookup, so pass the agent to `serve` and restart it instead."},501);let s=i(n);if(s===void 0)return z("agent",n);let d=await e.store.agentState.enable(n);try{let h=await e.adopt(s);return S({id:n,status:"loaded",...oe(d),adopted:h.map((g)=>g.id)})}catch(h){if(await e.store.agentState.disable(n,new Date(t.now?.()??Date.now()).toISOString(),"start failed"),de(h))return m(h.toDetail(),400);throw h}},{capability:"admin"}),p.add("POST","/v1/agents/:id/messages",async(a)=>T(e,a,async(n)=>{let i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(Ae,i.value);if(!s.ok)return m(s.error,400);let d=s.value,h=d.chunks===!0,g=d.text,w=d.sessionKey??"api:default",v=V(a,w);if(v!==void 0)return v;let _=zt(d.deliver);if(_.kind==="error")return m(_.error,400);let A=jt(d.from);if(A.kind==="error")return m(A.error,400);let P=At(a.request);if(P.kind==="error")return m(P.error,400);let U=await n.admit();if(!U.ok)return m(U.error.toDetail(),429);let M=mn();if(P.key!==void 0){let q=await n.store.turns.claimInboundKey({agentId:n.id,key:P.key,turnId:M,inputHash:await Pt(w,g),now:new Date});if(q.kind!=="claimed")U.release();if(q.kind==="replay")return S({turnId:q.turnId,sessionKey:w,replayed:!0},200);if(q.kind==="mismatch")return m({code:"idempotency_key_reused",message:`Idempotency-Key "${P.key}" was already used for a different message.`,hint:`It belongs to turn ${q.turnId}, whose text or session differed from this request's. Nothing was run. Use a fresh key for a new message, or resend the original text byte for byte to get that turn back. A key is remembered for 24 hours.`,field:"Idempotency-Key"},409)}let le=new AbortController;f.set(M,le),e.streams.open(M,{chunks:h});let Lt=n.send(g,{admission:U,sessionKey:w,turnId:M,source:"api",...A.from===void 0?{}:{from:A.from},signal:le.signal}).then(async(q)=>{if(_.target===void 0||q.text.trim()==="")return;await e.channels.deliver({agentId:n.id,sessionKey:w,channelId:_.target.channel,recipient:_.target.to,turnId:M,text:q.text})}).catch(()=>{}).finally(()=>{f.delete(M)});if(d.stream!==!0)return S({turnId:M,sessionKey:w},202);return Ne(e,M,{accepted:{turnId:M,sessionKey:w},status:202,chunks:h})}),{capability:"chat"}),p.add("GET","/v1/agents/:id/turns/:turnId/stream",(a)=>T(e,a,async(n)=>{let i=a.params.turnId??"";if(e.streams.state(i)===void 0){let s=await n.store.turns.get(i);if(s===void 0)return z("turn",i,"No turn with this id has ever run on this agent. A turn id is the `turnId` from POST /v1/agents/:id/messages — check the agent in the path too, since a turn belongs to one.");return It(s)}return Ne(e,i,{chunks:a.url.searchParams.get("chunks")==="true"})}),{capability:"read",streaming:!0}),p.add("POST","/v1/agents/:id/turns/:turnId/stop",(a)=>T(e,a,()=>{let n=a.params.turnId??"",i=f.get(n);if(i===void 0)return m({code:"turn_not_running",message:`No cancel handle for turn ${n} on this API.`,hint:"This surface can stop a turn it started. A turn that has already finished cannot be stopped at all — read its final state from GET /v1/agents/:id/turns/:turnId. A turn started by a channel, a schedule, or another process is running without a handle here."},409);return i.abort(),S({turnId:n,stopping:!0},202)}),{capability:"chat"}),p.add("GET","/v1/agents/:id/approvals",(a)=>T(e,a,async(n)=>S({approvals:y.pending(n.id)})),{capability:"read"}),p.add("POST","/v1/agents/:id/approvals/:approvalId",(a)=>T(e,a,async()=>{let n=await B(a.request);if(n.kind==="error")return m(n.error,400);let i=G(ze,n.value);if(!i.ok)return m(i.error,400);let s=i.value,d=a.params.approvalId??"";if(!y.resolve(d,s.granted))return m({code:"approval_not_found",message:`No approval with id ${d} is waiting.`,hint:'It was answered already, or its turn ended while it waited — a stopped or timed-out turn abandons its question, and `approval.resolved` reports that as `by: "abandoned"`. GET /v1/agents/:id/approvals lists what is actually waiting. Nothing about a settled approval is kept, so this is also the answer for an id that was never real.'},404);return S({approvalId:d,granted:s.granted})}),{capability:"chat"}),p.add("GET","/",(a)=>ie("/",a),{capability:"open"}),p.add("GET","/assets/app.js",(a)=>ie("/assets/app.js",a),{capability:"open"}),p.add("GET","/assets/app.css",(a)=>ie("/assets/app.css",a),{capability:"open"}),p.add("POST","/v1/keys",async(a)=>{let n=t.claim!==void 0&&Ct(a.request)===t.claim.token,i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(Ie,i.value);if(!s.ok)return m(s.error,400);let d=s.value,h=fr(d.label);if(h!==void 0)return m({code:"key_label_invalid",message:h,hint:`A label is shown in a listing and in the UI, so it is at most ${Ro} printable characters on one line. It is a display name, not a description.`,field:"label"},400);if(n&&t.claim?.spend()!==!0)return _e();let g=d.scope;if(g?.agents!==void 0){let P=new Set(e.list().map((M)=>M.id));for(let M of await e.store.agentState.list())P.add(M.agentId);let U=g.agents.filter((M)=>!P.has(M));if(U.length>0)return m({code:"key_scope_agent_unknown",message:`No agent ${U.map((M)=>JSON.stringify(M)).join(", ")} on this server.`,hint:"A key scoped to an agent that does not exist authenticates and then reaches nothing, which looks exactly like a working credential until it is used. GET /v1/agents lists what this server holds, stopped agents included.",field:"scope.agents"},400)}let w=g?.expiresIn===void 0?void 0:new Date(c()+g.expiresIn*1000).toISOString(),v=g===void 0?void 0:{...g.agents===void 0?{}:{agents:g.agents},...g.sessions===void 0?{}:{sessions:g.sessions},...g.can===void 0?{}:{can:g.can}},_=No(),A=await e.store.operatorKeys.issue({keyId:Qr(c()),label:d.label.trim(),fingerprint:await To(_),createdAt:new Date(c()).toISOString(),...v===void 0||Object.keys(v).length===0?{}:{scope:v},...w===void 0?{}:{expiresAt:w}});return S({...A,secret:_},201)},{capability:"admin"}),p.add("GET","/v1/keys",async()=>{let a=await e.store.operatorKeys.list();return S({keys:a,scope:"A key with no scope authenticates every route for every agent this server holds. A scope narrows an already-authenticated caller — it names agents, a session prefix and capabilities, and it is not an identity: there are no users, teams or roles here."})},{capability:"admin"}),p.add("DELETE","/v1/keys/:keyId",async(a)=>{let n=a.params.keyId??"",i=await e.store.operatorKeys.revoke(n,new Date(c()).toISOString());if(i===void 0)return z("key",n,"The id is the `keyId` from POST /v1/keys, not the secret — GET /v1/keys lists them. An already-revoked key is a 200 carrying its original stamp, so this really does mean no such key exists.");return S(i)},{capability:"admin"}),p.add("POST","/v1/webhooks",async(a)=>{let n=await B(a.request);if(n.kind==="error")return m(n.error,400);let i=G(De,n.value);if(!i.ok)return m(i.error,400);let s=i.value,d=s.types.filter((A)=>!pA.includes(A)||!br(A));if(d.length>0)return m({code:"webhook_type_invalid",message:`Cannot deliver ${d.join(", ")}.`,hint:"Any type from the event stream except model.chunk, which is one request per token. The wire spec's event table lists them.",field:"types"},400);let h=W(a.principal);if(s.agents!==void 0){let A=new Set([...e.list().map((U)=>U.id),...(await e.store.agentState.list()).map((U)=>U.agentId)]),P=s.agents.filter((U)=>!H(a.principal,U)||!A.has(U));if(P.length>0)return m({code:"webhook_scope_invalid",message:`This credential cannot subscribe to ${P.join(", ")}.`,hint:"A subscription hears at most what the key creating it reaches, and only agents this server holds. GET /v1/agents lists them.",field:"agents"},400)}let g=s.agents??h.agentIds,w={...g===void 0?{}:{agents:[...g]},...h.sessionPrefix===void 0?{}:{sessionPrefix:h.sessionPrefix}};try{await e.webhooks.check(s.url)}catch(A){if(de(A))return m(A.toDetail(),400);throw A}let v=Or(),_=await e.store.webhooks.create({subscriptionId:`wh_${crypto.randomUUID().replaceAll("-","").slice(0,20)}`,url:s.url,secret:v,types:[...new Set(s.types)],...Object.keys(w).length===0?{}:{scope:w},createdAt:new Date(t.now?.()??Date.now()).toISOString()});return await e.webhooks.changed(),S({...Se(_),secret:v},201)},{capability:"admin"}),p.add("GET","/v1/webhooks",async(a)=>{let n=await e.store.webhooks.list();return S({webhooks:n.filter((i)=>xe(a.principal,i)).map(Se)})},{capability:"admin"}),p.add("DELETE","/v1/webhooks/:webhookId",async(a)=>{let n=a.params.webhookId??"",i=await e.store.webhooks.get(n);if(i===void 0||!xe(a.principal,i))return m({code:"webhook_not_found",message:`No webhook with id "${n}".`,hint:"GET /v1/webhooks lists the subscriptions this credential can see."},404);return await e.store.webhooks.delete(n),await e.webhooks.changed(),S({id:n,deleted:!0})},{capability:"admin"}),p.add("GET","/v1/usage",async(a)=>{let n=Te(a.url);if(n.kind==="error")return m(n.error,400);let i=W(a.principal);return S(await e.store.usage.report({...n.value,...i}))},{capability:"read"}),p.add("GET","/v1/agents/:id/usage",(a)=>T(e,a,async(n)=>{let i=Te(a.url);if(i.kind==="error")return m(i.error,400);let s=W(a.principal).sessionPrefix;return S({id:n.id,...await e.store.usage.report({...i.value,agentIds:[n.id],...s===void 0?{}:{sessionPrefix:s}})})}),{capability:"read"}),p.add("GET","/v1/agents/:id/turns",(a)=>T(e,a,async(n)=>{let i=Ee(a.url,"limit"),s=Ee(a.url,"before");if(i===null||s===null)return m({code:"turns_page_invalid",message:"`limit` and `before` must be positive whole numbers.",hint:"Pass `before` exactly as the previous page's `nextBefore` returned it, and a `limit` up to 200."},400);let d=W(a.principal).sessionPrefix,h=await e.store.turns.listForAgent(n.id,{limit:Math.min(i??50,200),...s===void 0?{}:{before:s},...d===void 0?{}:{sessionPrefix:d}});return S({id:n.id,...h})}),{capability:"read"}),p.add("GET","/v1/agents/:id/turns/:turnId",(a)=>T(e,a,async(n)=>{let i=await n.store.turns.get(a.params.turnId??"");if(i===void 0)return z("turn",a.params.turnId??"");return S(i)}),{capability:"read"}),p.add("GET","/v1/agents/:id/sessions",(a)=>T(e,a,async(n)=>S(_t(a.principal,await n.store.sessions.list(n.id)))),{capability:"read"}),p.add("GET","/v1/agents/:id/sessions/:key",(a)=>T(e,a,async(n)=>{let i=a.params.key??"",s=V(a,i);if(s!==void 0)return s;let d=await n.store.sessions.get(n.id,i);if(d===void 0)return z("session",i);return S(d)}),{capability:"read"}),p.add("GET","/v1/agents/:id/sessions/:key/messages",(a)=>T(e,a,async(n)=>{let i=a.url.searchParams.get("before"),s=a.url.searchParams.get("limit"),d=V(a,a.params.key??"");if(d!==void 0)return d;let h=await n.store.messages.page(n.id,a.params.key??"",{...i===null?{}:{before:Number.parseInt(i,10)},...s===null?{}:{limit:Number.parseInt(s,10)}});return S(h)}),{capability:"read"}),p.add("DELETE","/v1/agents/:id/sessions/:key",(a)=>T(e,a,async(n)=>{let i=V(a,a.params.key??"");if(i!==void 0)return i;return await n.store.sessions.clear(n.id,a.params.key??""),S({cleared:a.params.key??"",memoryFilesKept:!0})}),{capability:"write"}),p.add("POST","/v1/agents/:id/sessions/:key/phase",(a)=>T(e,a,async(n)=>{let i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(Oe,i.value);if(!s.ok)return m(s.error,400);let d=s.value.phase;if(typeof d!=="string"&&d!==null)return m({code:"phase_invalid",message:"phase must be a string, or null to clear it.",hint:'Send { "phase": "triage" }. Phase-scoped tool visibility arrives in Phase 7; the column is written now so a session carries the value across a restart.',field:"phase"},400);let h=V(a,a.params.key??"");if(h!==void 0)return h;return await n.store.sessions.setPhase(n.id,a.params.key??"",d===null?void 0:d),S({phase:d})}),{capability:"write"}),p.add("GET","/v1/agents/:id/schedules",(a)=>T(e,a,async(n)=>{let i=a.url.searchParams.get("enabled"),s=await n.store.schedules.list(n.id,i===null?{}:{enabled:i==="true"});return S({schedules:s})}),{capability:"read"}),p.add("POST","/v1/agents/:id/schedules",(a)=>T(e,a,async(n)=>{let i=await B(a.request);if(i.kind==="error")return m(i.error,400);return be(e,n,i.value,void 0)}),{capability:"write"}),p.add("GET","/v1/agents/:id/schedules/:sid",(a)=>T(e,a,async(n)=>{let i=a.params.sid??"",s=await n.store.schedules.get(n.id,i);return s===void 0?z("schedule",i):S(s)}),{capability:"read"}),p.add("PATCH","/v1/agents/:id/schedules/:sid",(a)=>T(e,a,async(n)=>{let i=a.params.sid??"",s=await n.store.schedules.get(n.id,i);if(s===void 0)return z("schedule",i);let d=ve(s);if(d!==void 0)return d;let h=await B(a.request);if(h.kind==="error")return m(h.error,400);let g=h.value===null||typeof h.value!=="object"||Array.isArray(h.value)?{}:h.value,{id:w,...v}=g,_={kind:s.kind,expr:s.expr,task:s.task,deliver:s.deliverChannel===void 0||s.deliverTo===void 0?"none":{channel:s.deliverChannel,to:s.deliverTo},session:s.sessionMode,enabled:s.enabled,...s.timezone===void 0?{}:{timezone:s.timezone},...s.role===void 0?{}:{role:s.role},...v,id:s.id};return be(e,n,_,s)}),{capability:"write"}),p.add("DELETE","/v1/agents/:id/schedules/:sid",(a)=>T(e,a,async(n)=>{let i=a.params.sid??"",s=await n.store.schedules.get(n.id,i);if(s===void 0)return z("schedule",i);let d=ve(s);if(d!==void 0)return d;if(!await n.store.schedules.remove(n.id,i))return z("schedule",i);return e.scheduler.changed(),S({removed:i})}),{capability:"write"}),p.add("POST","/v1/agents/:id/schedules/:sid/run",(a)=>T(e,a,async(n)=>{let i=a.params.sid??"",s=await n.store.schedules.get(n.id,i);if(s===void 0)return z("schedule",i);let d=await n.admit();if(!d.ok)return m(d.error.toDetail(),429);let h=hr(),g=Mr(s.sessionMode,s.id,h),w=mn();return e.streams.open(w),n.send(s.task,{admission:d,sessionKey:g,turnId:w,source:`schedule:${s.id}:manual`,...s.role===void 0?{}:{role:s.role}}).catch(()=>{}),S({scheduleId:s.id,turnId:w,sessionKey:g,outOfBand:!0},202)}),{capability:"write"}),p.add("GET","/v1/agents/:id/config",(a)=>T(e,a,async(n)=>{let i=e.sourceOf(n.id),s=typeof i==="string"?i:void 0,d=s===void 0?void 0:await Ke(s,"utf8");return S({...s===void 0?{editable:!1}:{editable:!0,file:s},settings:RA.filter((h)=>wn.includes(h.path)).map((h)=>({path:h.path,means:h.means,...h.confirm===void 0?{}:{confirm:h.confirm},...d===void 0?{}:{value:Dr(d,h.path.split("."))}}))})}),{capability:"admin"}),p.add("PATCH","/v1/agents/:id/config",(a)=>T(e,a,async(n)=>{let i=await B(a.request);if(i.kind==="error")return m(i.error,400);let s=G(tt,i.value);if(!s.ok)return m(s.error,400);let d=e.sourceOf(n.id);if(typeof d!=="string")return m({code:"config_not_editable",message:`"${n.id}" was loaded from an object, not from a file, so it has no manifest to change.`,hint:"An embedder holding new settings passes the new object to dispose() and adopt(). This route edits a manifest on disk."},409);let h=wr(s.value.path);if(h===void 0||!wn.includes(h.path))return m({code:"config_path_unknown",message:h?.via===void 0?`"${s.value.path}" is not a field this surface sets.`:`"${s.value.path}" is set by \`${h.via}\`, not by a dotted path.`,hint:h?.via===void 0?`GET /v1/agents/:id/config lists every one. Nearest: ${lt(s.value.path,wn)??wn.join(", ")}.`:"It is a key inside a list entry, and the source editor matches a key at an indent — it cannot index a sequence. That action also validates the handle against the service that issues it.",field:"path"},400);if(h.confirm!==void 0&&s.value.confirm!==!0)return m({code:"config_confirm_required",message:h.confirm,hint:'Send { "confirm": true } beside the value to make this change anyway. Nothing has been written.',field:"confirm"},409);let g;try{g=await Sn({file:d,path:h.path.split("."),value:Dn(s.value.value)})}catch(v){if(de(v))return m(v.toDetail(),400);throw v}let w;try{await e.replace(n.id)}catch(v){if(!de(v))throw v;w=v.toDetail()}return S({path:h.path,before:g.before,after:g.after,reflowed:g.reflowed,...w===void 0?{applied:!0}:{applied:!1,pending:w}})}),{capability:"admin"}),p.add("PATCH","/v1/agents/:id/channels/:channelId",(a)=>T(e,a,async(n)=>{let i=t.channels;if(i===void 0)return m({code:"channels_not_supported",message:"This server cannot change a channel.",hint:"The host did not supply the channel actions — a library caller embedding this handler has to pass them. `dispach serve` does."},501);let s=e.sourceOf(n.id);if(typeof s!=="string")return m({code:"config_not_editable",message:`Agent "${n.id}" was loaded from an object, so it has no manifest to edit.`,hint:"Only an agent loaded from a file can be changed here."},409);let d=await B(a.request);if(d.kind==="error")return m(d.error,400);let h=G(nt,d.value);if(!h.ok)return m(h.error,400);let{enabled:g,credential:w}=h.value;if(g===void 0&&w===void 0)return m({code:"channel_patch_empty",message:"Nothing to change.",hint:'Send { "enabled": true | false } to connect or disconnect it, { "credential": "…" } to set its token, or both.'},400);let v=a.params.channelId??"",_=[];try{if(w!==void 0)_.push(i.setCredential(s,v,w).note);if(g!==void 0)_.push((await i.setEnabled(s,v,g)).note)}catch(P){if(!de(P))throw P;return m(P.toDetail(),400)}let A;try{await e.replace(n.id)}catch(P){if(!de(P))throw P;A=P.toDetail()}return S({channelId:v,notes:_,...A===void 0?{applied:!0}:{applied:!1,pending:A}})}),{capability:"admin"}),p.add("POST","/v1/agents/:id/channels/:channelId/unpair",(a)=>T(e,a,async(n)=>{let i=a.params.channelId??"",s=await e.channels.reset(n.id,i);if(s==="reset")return S({channelId:i,note:"Pairing forgotten. The channel offers a new code to scan; the old device may still be listed on the phone, which is the only place it can be removed.",restarted:!1});let d=t.channels,h=e.sourceOf(n.id);if(d===void 0||typeof h!=="string")return m({code:s==="unsupported"?"channel_has_no_pairing":"channel_unknown",message:s==="unsupported"?`Channel "${i}" stores no pairing.`:`Agent "${n.id}" has no channel "${i}" registered.`,hint:"Only a channel linked by scanning a code has one to forget. A credential somebody typed is changed with PATCH on this channel, and a channel is switched off with { enabled: false }.",field:"channelId"},s==="unsupported"?409:404);try{return S({channelId:i,...d.unpair(h,i),restarted:!1})}catch(g){if(!de(g))throw g;return m(g.toDetail(),g.code==="channel_unknown"?404:409)}}),{capability:"admin"}),p.add("GET","/v1/agents/:id/tools",(a)=>T(e,a,(n)=>{let i=n.manifest.phases,s=oi(i);return S(n.tools.specs().map((d)=>({slug:d.slug,summary:d.summary,mutating:d.mutating,trust:d.trust,...d.trustReason===void 0?{}:{trustReason:d.trustReason},provider:d.provider??"local",tags:d.tags,...s?{phases:mr(i,d)}:{}})))}),{capability:"read"}),p.add("GET","/v1/agents/:id/skills",(a)=>T(e,a,(n)=>{let i=n.skills;if(i===void 0)return S({skills:[],configured:!1});return S({configured:!0,maxActive:i.maxActive,threshold:i.threshold,cached:i.cached,skills:i.skills.map((s)=>({name:s.name,description:s.frontmatter.description,tokens:s.tokens,...s.frontmatter.whenNotToUse===void 0?{}:{whenNotToUse:s.frontmatter.whenNotToUse},scripts:s.scripts.map((d)=>d.slug)}))})}),{capability:"read"}),p.add("GET","/v1/agents/:id/context",(a)=>T(e,a,async(n)=>{let i=a.url.searchParams.get("sessionKey"),s=a.url.searchParams.get("input");return S(await n.previewContext({...i===null?{}:{sessionKey:i},...s===null?{}:{input:s}}))}),{capability:"read"}),p.add("POST","/v1/channels/:channelId/webhook/:agentId",async(a)=>{let n=await B(a.request);if(n.kind==="error")return m(n.error,400);let i={};a.request.headers.forEach((d,h)=>{i[h.toLowerCase()]=d});let s=await e.channels.handleWebhook(a.params.agentId??"",a.params.channelId??"",{body:n.value,headers:i});return new Response(s.detail??"",{status:s.status,headers:{"content-type":"text/plain; charset=utf-8"}})},{capability:"open"}),p.add("GET","/v1/events",(a)=>{let n=a.url.searchParams.get("agentId");if(n!==null&&!H(a.principal,n))return z("agent",n);let i=a.url.searchParams.get("types")?.split(",").filter(Boolean),s=a.url.searchParams.get("chunks")==="true",d=i?.includes("model.chunk")===!0,h=s||d,g=i?.filter((w)=>!pA.includes(w));if(g!==void 0&&g.length>0){let w=lt(g[0]??"",pA);return m({code:"unknown_event_type",message:`No such event type: ${g.join(", ")}.`,hint:w===void 0?"The full catalogue is the event table in docs/04-SPEC-WIRE.md. Omit ?types= to receive every event.":`Did you mean "${w}"? The full catalogue is the event table in docs/04-SPEC-WIRE.md.`,field:"types"},400)}return se({...a.request.signal===void 0?{}:{signal:a.request.signal},start:({send:w})=>(w({event:"stream.subscribed",data:{agentId:n??null,types:i??null,chunks:h,...h&&!s?{implied:"types names model.chunk"}:{}}}),e.bus.on("*",(v)=>{if(n!==null&&v.agentId!==n)return;if(v.agentId!==void 0&&!H(a.principal,v.agentId))return;if(v.sessionKey!==void 0&&!Z(a.principal,v.sessionKey))return;if(i!==void 0&&i.length>0&&!i.includes(v.type))return;w({event:v.type,data:v})},{chunks:h}))})},{capability:"read",streaming:!0}),Object.assign(async(a)=>{let n;try{n=new URL(a.url)}catch{return m({code:"bad_request_url",message:"The request URL could not be parsed.",hint:"This usually means the server was handed a relative URL. A handler mounted inside another framework needs an absolute request.url."},400)}let i=a.method.toUpperCase();if(i==="OPTIONS"){let g=p.match("OPTIONS",n.pathname);if(g.kind==="method"){let v=p.match("HEAD",n.pathname).kind==="method"&&Et(p,n.pathname),_=[...g.allowed,...g.allowed.includes("GET")&&!v?["HEAD"]:[],"OPTIONS"];return k(a,new Response(null,{status:204,headers:{allow:_.join(", "),...t.origin===void 0?{}:dt(a,_)}}))}}if(i==="HEAD"){let g=p.match("GET",n.pathname);if(g.kind==="found"){if(g.streaming)return m({code:"method_not_allowed",message:`HEAD is not allowed on ${n.pathname}.`,hint:"This path answers with an open event stream. A HEAD would have to start one and then throw the body away, leaving a subscription nothing ever closes — so it is refused rather than leaked. Use GET, or GET /v1/health to check the server is up."},405,{allow:"GET, OPTIONS"});let w=C(a);if(w!==void 0)return w;let v=await N(a,n.pathname,g.capability);if(v instanceof Response)return v;let _=await we(g.handler,{request:a,url:n,params:g.params,principal:v});return k(a,new Response(null,{status:_.status,headers:_.headers}))}}let s=p.match(i,n.pathname);if(s.kind==="method")return m({code:"method_not_allowed",message:`${i} is not allowed on ${n.pathname}.`,hint:`This path accepts ${s.allowed.join(", ")}.`},405,{allow:s.allowed.join(", ")});if(s.kind==="none")return m({code:"not_found",message:`No route for ${a.method} ${n.pathname}.`,hint:"Every path is under /v1. See docs/04-SPEC-WIRE.md for the surface."},404);let d=C(a);if(d!==void 0)return d;let h=await N(a,n.pathname,s.capability);if(h instanceof Response)return h;return k(a,await we(s.handler,{request:a,url:n,params:s.params,principal:h}))},{authenticate:(a)=>N(a,"/v1/ws","read")})}function ve(t){if(t.origin!=="manifest")return;return m({code:"schedule_manifest_owned",message:`Schedule "${t.id}" is declared in this agent's manifest, so the manifest decides it.`,hint:"Writing it here would last until the next start — reconciliation restores every field from the file, enabled included. Change the `schedules:` entry instead, with PATCH /v1/agents/:id/config, or create a separate schedule through this route."},409)}async function be(t,e,r,c){if(r===null||typeof r!=="object"||Array.isArray(r))return m({code:"schedule_invalid",message:"A schedule must be a JSON object.",hint:"Send { id, kind, expr, task, deliver } — see docs/02-SPEC-MANIFEST.md."},400);try{let u=Nr({agentId:e.id,body:r,channelIds:e.manifest.channels.map((y)=>y.id),roleNames:Object.keys(e.manifest.model),now:Date.now(),origin:"api",...c===void 0?{}:{existing:c}}),f=await e.store.schedules.upsert(u);return t.scheduler.changed(),S(f,c===void 0?201:200)}catch(u){let f=de(u)?u.toDetail():{code:"schedule_invalid",message:u instanceof Error?u.message:String(u),hint:"See docs/02-SPEC-MANIFEST.md for the schedule fields."};return m(f,400)}}function ie(t,e){let r=bt(t,e.request);if(r===void 0)throw new Be({code:"web_asset_missing",message:`No web asset for ${t}.`,hint:"The routes in handler.ts and the table in web.ts have diverged, which spec.test.ts asserts cannot happen — so this build is inconsistent. Rebuild with `bun run build`."});return r}function S(t,e=200){return new Response(JSON.stringify(t),{status:e,headers:{"content-type":"application/json; charset=utf-8"}})}function xt(t){return t==="/v1/health"||t==="/v1/ready"||t.startsWith("/v1/channels/")||vt.includes(t)||t==="/docs"||t==="/v1/openapi.json"}function Et(t,e){let r=t.match("GET",e);return r.kind==="found"&&r.streaming}async function we(t,e){try{return await t(e)}catch(r){if(de(r))return m(r.toDetail(),400);return m({code:"internal_error",message:r instanceof Error?r.message:String(r),hint:"An unexpected failure in the server. The runtime's event stream carries what happened around it."},500)}}function z(t,e,r){return m({code:`${t}_not_found`,message:`No ${t} "${e}".`,hint:r??"Check the id — it is case-sensitive, and a session key includes its channel segment."},404)}function Ct(t){let e=t.headers.get("authorization")??"";if(!e.startsWith("Bearer "))return;let r=e.slice(7);return r===""?void 0:r}function ke(t,e,r){let c=r.params.id??"";if(!H(r.principal,c))return{kind:"response",response:z("agent",c)};let u=e.secrets;if(u===void 0)return{kind:"response",response:m({code:"secrets_not_supported",message:"This server cannot write an agent's credentials.",hint:"Credentials go into the .env beside an agent's manifest, and this process was built without a writer for it. Set them where the agent lives, with `config env`, and reload it."},501)};let f=t.sourceOf(c),y=typeof f==="string"?f:e.resolveAgent?.(c);if(y===void 0)return{kind:"response",response:z("agent",c)};return{kind:"found",id:c,manifestPath:y,admin:u}}function Se(t){return{...t,failing:t.consecutiveFailures>0}}function xe(t,e){let r=W(t);if(r.agentIds!==void 0){let c=e.scope?.agents;if(c===void 0||!c.every((u)=>r.agentIds?.includes(u)))return!1}if(r.sessionPrefix!==void 0){let c=e.scope?.sessionPrefix;if(c===void 0||!c.startsWith(r.sessionPrefix))return!1}return!0}function Ee(t,e){let r=t.searchParams.get(e);if(r===null)return;let c=Number(r);return Number.isSafeInteger(c)&&c>0?c:null}function Te(t){let e=t.searchParams.get("by"),r=e===null?["agent","model"]:e.split(",").filter((f)=>f!==""),c=r.filter((f)=>!ri.includes(f));if(c.length>0)return{kind:"error",error:{code:"usage_group_invalid",message:`Cannot group usage by ${c.join(", ")}.`,hint:`Group by any of ${ri.join(", ")}, comma-separated, or pass by= for one total.`,field:"by"}};let u={};for(let f of["from","to"]){let y=t.searchParams.get(f);if(y===null)continue;let x=Date.parse(y);if(Number.isNaN(x))return{kind:"error",error:{code:"usage_range_invalid",message:`${f} is ${JSON.stringify(y)}, which is not a date.`,hint:"Send ISO-8601, like 2026-09-01 or 2026-09-01T00:00:00Z. `from` is inclusive and `to` exclusive, so a month is from=2026-09-01&to=2026-10-01.",field:f}};u[f]=new Date(x).toISOString()}return{kind:"ok",value:{by:r,...u}}}function T(t,e,r){let c=e.params.id??"",u=t.list().find((f)=>f.id===c);if(u===void 0)return z("agent",c);if(!H(e.principal,c))return z("agent",c);return r(u)}function Nt(t,e){if(!$e(t))return e;return e.filter((r)=>H(t,r.id))}function _t(t,e){if(!$e(t))return e;return e.filter((r)=>Z(t,r.sessionKey))}function V(t,e){return Z(t.principal,e)?void 0:z("session",e)}function Ce(t,e){let r=e.manifest.phases,c=oi(r);return{id:e.id,name:e.manifest.name??e.id,status:"loaded",model:e.manifest.model.main.id,channels:e.manifest.channels.map((u)=>{let f=t.channels.statusOf(e.id).find((x)=>x.id===u.id),y=typeof u.tokenEnv==="string"?u.tokenEnv:void 0;return{...f??{},id:u.id,type:u.type,enabled:u.enabled,...y===void 0?{}:{credentialEnv:y,credentialSet:e.hasEnv(y)}}}),entryPhase:c?yr(r)??null:null,...c?{phases:Object.keys(r)}:{}}}function oe(t){return{...t.disabledAt===void 0?{}:{disabledAt:t.disabledAt},...t.reason===void 0?{}:{reason:t.reason}}}async function B(t){let e=Number.parseInt(t.headers.get("content-length")??"0",10);if(Number.isFinite(e)&&e>Y)return{kind:"error",error:{code:"body_too_large",message:`The request body declares ${e} bytes; the limit is ${Y}.`,hint:"This cap is enforced before a channel plugin sees anything, so a plugin never has to defend against a large POST."}};let r=await t.text();if(r.length>Y)return{kind:"error",error:{code:"body_too_large",message:`The request body is ${r.length} bytes; the limit is ${Y}.`,hint:"Send less. A message longer than this is not a message."}};if(r==="")return{kind:"ok",value:{}};try{return{kind:"ok",value:JSON.parse(r)}}catch(c){return{kind:"error",error:{code:"body_not_json",message:`The request body is not valid JSON: ${c instanceof Error?c.message:String(c)}`,hint:"Send application/json. A shell quoting mistake is the usual cause — check for unescaped quotes inside the payload."}}}}function jt(t){if(t===void 0||t===null)return{kind:"ok",from:void 0};let e=(c,u,f="from")=>({kind:"error",error:{code:"sender_invalid",message:c,hint:u,field:f}});if(typeof t!=="object")return e("from must be an object.",'Send { "from": { "id": "agent:ops-bot", "kind": "agent" } }, or omit it entirely for a turn the token-holder is sending itself.');let r=t;if(typeof r.id!=="string"||r.id.trim()==="")return e("from.id is required and must be a non-empty string.","Use a stable identity in your own namespace — `agent:ops-bot`, `user:018f…`, an email address. It is opaque to this runtime and is recorded on the turn so an audit can answer who asked.","from.id");if(r.id.length>ye)return e(`from.id is ${r.id.length} characters, over the ${ye} limit.`,"A sender id is an identifier, not a payload. It is rendered into the prompt's fence label, so an unbounded one spends the context window the message needs.","from.id");if(typeof r.kind!=="string"||!TA.includes(r.kind)){let c=typeof r.kind==="string"?lt(r.kind,TA):void 0;return e(`from.kind must be one of: ${TA.join(", ")}.`,`${c===void 0?"":`Did you mean "${c}"? `}This field decides the trust boundary — "agent" fences the message and blocks mutating tools for the turn, "user" does not — so there is no default and an unknown value is refused rather than guessed at. A turn the token-holder is sending itself omits "from".`,"from.kind")}if(r.name!==void 0&&typeof r.name!=="string")return e("from.name must be a string when present.","It is a display name only and is rendered inside the fence, never above it. Omit it if you have none.","from.name");return{kind:"ok",from:{id:r.id,kind:r.kind,...r.name===void 0?{}:{name:r.name.slice(0,wt)}}}}function At(t){let e=t.headers.get("idempotency-key");if(e===null)return{kind:"ok",key:void 0};let r=e.trim(),c=(u)=>({kind:"error",error:{code:"idempotency_key_invalid",message:u,hint:`Send 1-${ae} printable ASCII characters that are unique per logical request — a UUID is the usual choice. Omit the header entirely to accept that a retry runs the turn again. Printable ASCII because the key is a database key, and node:sqlite truncates a bound string at a NUL byte where bun:sqlite stores it whole.`,field:"Idempotency-Key"}});if(r==="")return c("Idempotency-Key is present but empty.");if(r.length>ae)return c(`Idempotency-Key is ${r.length} characters, over the ${ae} limit.`);if(!/^[\x20-\x7e]+$/.test(r))return c("Idempotency-Key contains characters that are not printable ASCII.");return{kind:"ok",key:r}}async function Pt(t,e){let r=new TextEncoder().encode(`${t}\x00${e}`),c=await crypto.subtle.digest("SHA-256",r);return Array.from(new Uint8Array(c)).map((u)=>u.toString(16).padStart(2,"0")).join("")}function zt(t){if(t===void 0||t===null||t==="none")return{kind:"ok",target:void 0};if(typeof t==="object"){let e=t;if(typeof e.channel==="string"&&typeof e.to==="string")return{kind:"ok",target:{channel:e.channel,to:e.to}}}return{kind:"error",error:{code:"deliver_invalid",message:'deliver must be "none" or { channel, to }.',hint:'A bare channel id is not enough on an API turn: the request has no originating conversation, so there is no recipient to infer. Send { "channel": "tg", "to": "12345" }, or "none" to read the reply from the event stream.',field:"deliver"}}}function It(t){let e=t.status==="running";return se({start:({send:r,close:c})=>{r({event:e?"stream.unavailable":"stream.ended",data:{turnId:t.turnId,status:t.status,sessionKey:t.sessionKey,...e?{reason:"no buffer for this turn in this process",hint:"The turn is recorded as running but is not observable here — its events are buffered in whichever process is executing it, and buffers are in-memory and per-process. Poll GET /v1/agents/:id/turns/:turnId for the outcome."}:{steps:t.steps,...t.errorCode===void 0?{}:{errorCode:t.errorCode},hint:"This turn finished before you attached and its buffer has been evicted. Its full text is in GET /v1/agents/:id/turns/:turnId."}}}),c();return}})}function Ne(t,e,r){return se({...r?.status===void 0?{}:{status:r.status},start:({send:c,close:u})=>{if(r?.accepted!==void 0)c({event:"turn.accepted",data:r.accepted});let f=t.streams.attach(e,(y)=>{if(c({event:y.type,data:y}),y.type==="turn.end")u()},{chunks:r?.chunks===!0});if(f===void 0){c({event:"stream.unavailable",data:{turnId:e,reason:"no buffer for this turn in this process",hint:"Read the final state from GET /v1/agents/:id/turns/:turnId. Buffers are in-memory and are evicted after a turn ends."}}),u();return}c({event:"stream.replay",data:{turnId:e,state:f.state,events:f.replay.length,truncated:f.truncated,dropped:f.dropped,chunks:f.chunks,...f.truncated?{hint:`The oldest ${f.dropped} event(s) of this turn were discarded to stay under the buffer cap, so this replay starts mid-turn. The turn's final text is complete in GET /v1/agents/:id/turns/:turnId.`}:{}}});for(let y of f.replay)c({event:y.type,data:y});if(f.state==="ended")u();return()=>f.unsubscribe()}})}function nr(){let t=No(),e=!1;return{token:t,live:()=>!e,spend:()=>{if(e)return!1;return e=!0,!0}}}function Tt(t){let e=t.startsWith("[")&&t.endsWith("]")?t.slice(1,-1):t,r=e==="0.0.0.0"||e==="::"||e===""?"127.0.0.1":e;return r.includes(":")?`[${r}]`:r}function or(t,e,r){return`http://${Tt(t)}:${e}/?claim=${r}`}function ir(t,e,r){return`curl -sX POST http://${Tt(t)}:${e}/v1/keys -H 'Authorization: Bearer ${r}' -H 'content-type: application/json' -d '{"label":"my browser"}'`}function Ge(t,e,r=new Map){let c=new Set,u,f=0,y,x=(k)=>{let O=k.type==="model.chunk";for(let E of c){if(E.data.agentId!==void 0&&k.agentId!==E.data.agentId)continue;if(k.agentId!==void 0&&!H(E.data.principal,k.agentId))continue;if(k.sessionKey!==void 0&&!Z(E.data.principal,k.sessionKey))continue;if(O&&!E.data.chunks)continue;try{E.send(JSON.stringify(k))}catch{}}},D=()=>{if(f+=1,y===void 0)y=t.bus.on("model.chunk",x)},C=()=>{if(f===0)return;if(f-=1,f===0)y?.(),y=void 0};return{async accept(k){let O=new URL(k.url),E=Ye(k),N=O.searchParams.get("token"),L=await e(Je(k,E??N??""));if(L instanceof Response)return{kind:"reject",response:L};let a=O.searchParams.get("agentId");if(a!==null&&!H(L,a))return{kind:"reject",response:new Response(JSON.stringify({error:{code:"agent_not_found",message:`No agent "${a}".`,hint:"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees."}}),{status:404,headers:{"content-type":"application/json"}})};return{kind:"accept",session:{agentId:a??void 0,chunks:O.searchParams.get("chunks")==="true",principal:L},...E===void 0?{}:{protocol:je}}},handlers:{open(k){if(c.add(k),u===void 0)u=t.bus.on("*",x);if(k.data.chunks)D();k.send(JSON.stringify({type:"ws.open",agentId:k.data.agentId??null,chunks:k.data.chunks}))},message(k,O){let E;try{E=JSON.parse(typeof O==="string"?O:new TextDecoder().decode(O))}catch{k.send(JSON.stringify({type:"ws.error",code:"frame_not_json"}));return}if(E.type==="ping"){k.send(JSON.stringify({type:"pong"}));return}if(E.type==="subscribe"){if(E.agentId===void 0&&E.sessionKey!==void 0){k.send(JSON.stringify({type:"ws.error",code:"subscribe_needs_agent_id",hint:"Send { type: 'subscribe', agentId: '<agent>' }. A socket filters on the agent an event carries; sessionKey names a conversation and can never match one, so a socket pointed with it receives nothing."}));return}let i=typeof E.chunks==="boolean"?E.chunks:k.data.chunks;if(i&&!k.data.chunks)D();else if(!i&&k.data.chunks)C();let s=E.agentId??k.data.agentId;if(s!==void 0&&!H(k.data.principal,s)){k.send(JSON.stringify({type:"ws.error",error:{code:"agent_not_found",message:`No agent "${s}".`,hint:"Check the id — it is case-sensitive. A key scoped away from an agent sees exactly what a caller asking for one that does not exist sees."}}));return}k.data={agentId:s,chunks:i,principal:k.data.principal},k.send(JSON.stringify({type:"ws.subscribed",agentId:k.data.agentId??null,chunks:k.data.chunks}));return}if(E.type==="stop"){let i=E.turnId===void 0?void 0:r.get(E.turnId);i?.abort(),k.send(JSON.stringify({type:"ws.stopping",turnId:E.turnId??null,found:i!==void 0}));return}if(E.type!=="message"){k.send(JSON.stringify({type:"ws.error",code:"unknown_frame_type"}));return}let N=k.data.agentId,p=t.list().find((i)=>i.id===N);if(p===void 0){k.send(JSON.stringify({type:"ws.error",code:"agent_not_found"}));return}let L=E.text??"";if(L.trim()===""){k.send(JSON.stringify({type:"ws.error",code:"message_text_required"}));return}let a=(i)=>{if(!i.ok){k.send(JSON.stringify({type:"ws.error",...i.error.toDetail()}));return}let s=mn(),d=new AbortController;r.set(s,d),k.send(JSON.stringify({type:"ws.accepted",turnId:s})),p.send(L,{admission:i,sessionKey:E.sessionKey??"api:default",turnId:s,source:"ws",signal:d.signal}).catch(()=>{}).finally(()=>r.delete(s))},n=p.admitNow();if(n!==void 0){a(n);return}p.admit().then(a,(i)=>{k.send(JSON.stringify({type:"ws.error",code:"internal_error",message:i instanceof Error?i.message:String(i)}))})},close(k){if(c.delete(k)&&k.data.chunks)C();if(c.size===0)u?.(),u=void 0}},closeAll(){for(let k of c)try{k.close(1001,"server stopping")}catch{}c.clear(),u?.(),u=void 0,y?.(),y=void 0,f=0}}}async function rr(t){let{host:e,port:r,runtime:c}=t;if(!J(e)&&t.token===void 0)throw new Be({code:"server_public_without_token",message:`Refusing to bind ${e}:${r} with no API token.`,hint:"Set the variable named by server.tokenEnv, or bind 127.0.0.1. A public bind with no token exposes every endpoint — including the ones that start a turn — to anyone who can reach the port, and behaves identically to a safe one until someone finds it.",field:"server.host"});let u=new Map,f=St({runtime:c,...t.token===void 0?{}:{token:t.token},...t.token===void 0?{allowUnauthenticated:!0}:{},...t.now===void 0?{}:{now:t.now},running:u,...t.approvals===void 0?{}:{approvals:t.approvals},...t.claim===void 0?{}:{claim:t.claim},...t.resolveAgent===void 0?{}:{resolveAgent:t.resolveAgent},...t.provision===void 0?{}:{provision:t.provision},...t.channels===void 0?{}:{channels:t.channels},...t.secrets===void 0?{}:{secrets:t.secrets},origin:{host:t.host,...t.allowedOrigins===void 0?{}:{allowedOrigins:t.allowedOrigins},...t.allowedHosts===void 0?{}:{allowedHosts:t.allowedHosts}}});if(t.engine==="bun"||t.engine===void 0&&typeof Bun<"u"&&typeof Bun.serve==="function")return Ot(f,t,u);return Rt(f,t,u)}function Ot(t,e,r){let c=Ge(e.runtime,t.authenticate,r),u=Bun.serve({port:e.port,hostname:e.host,idleTimeout:Math.min(255,Math.ceil(Fe/1000*3)),fetch:async(f,y)=>{if(new URL(f.url).pathname!=="/v1/ws")return t(f);let D=X(f,{host:e.host,...e.allowedOrigins===void 0?{}:{allowedOrigins:e.allowedOrigins},...e.allowedHosts===void 0?{}:{allowedHosts:e.allowedHosts}});if(D!==void 0)return new Response(JSON.stringify({error:D}),{status:403,headers:{"content-type":"application/json; charset=utf-8"}});let C=await c.accept(f);if(C.kind==="reject")return C.response;if(y.upgrade(f,{data:C.session,...C.protocol===void 0?{}:{headers:{"sec-websocket-protocol":C.protocol}}}))return;return new Response("upgrade failed",{status:400})},websocket:{open:(f)=>c.handlers.open(f),message:(f,y)=>c.handlers.message(f,y),close:(f)=>c.handlers.close(f)}});return{url:`http://${e.host}:${u.port}`,port:u.port??e.port,host:e.host,websocket:!0,stop:async()=>{c.closeAll(),await u.stop(!0)}}}async function Rt(t,e,r){let{createServer:c}=await import("node:http"),{WebSocketServer:u}=await import("./wrapper-9msjh1xg.js"),f=Ge(e.runtime,t.authenticate,r),y=(N,p)=>{let L=`http://${N.headers.host??`${e.host}:${e.port}`}${N.url??"/"}`,a=new Headers;for(let[i,s]of Object.entries(N.headers))if(typeof s==="string")a.set(i,s);else if(Array.isArray(s))a.set(i,s.join(", "));let n=N.method??"GET";return new Request(L,{method:n,headers:a,...n==="GET"||n==="HEAD"||p===void 0?{}:{body:p}})},x=c((N,p)=>{(async()=>{let L=[];for await(let s of N)L.push(s);let a=await t(y(N,Buffer.concat(L))),n={};if(a.headers.forEach((s,d)=>{n[d]=s}),p.writeHead(a.status,n),a.body===null){p.end();return}let i=a.body.getReader();p.on("close",()=>void i.cancel().catch(()=>{}));for(;;){let{done:s,value:d}=await i.read();if(s)break;p.write(Buffer.from(d))}p.end()})().catch(()=>{if(!p.headersSent)p.writeHead(500);p.end()})}),D=new WeakMap,C=new u({noServer:!0,handleProtocols:(N,p)=>D.get(p)??!1}),k=(N,p,L)=>{N.end(`HTTP/1.1 ${p} Refused\r
|
|
82
|
+
content-type: application/json; charset=utf-8\r
|
|
83
|
+
content-length: ${Buffer.byteLength(L)}\r
|
|
84
|
+
connection: close\r
|
|
85
|
+
\r
|
|
86
|
+
${L}`)};x.on("upgrade",(N,p,L)=>{(async()=>{let a=y(N);if(new URL(a.url).pathname!=="/v1/ws"){p.destroy();return}let n=X(a,{host:e.host,...e.allowedOrigins===void 0?{}:{allowedOrigins:e.allowedOrigins},...e.allowedHosts===void 0?{}:{allowedHosts:e.allowedHosts}});if(n!==void 0){k(p,403,JSON.stringify({error:n}));return}let i=await f.accept(a);if(i.kind==="reject"){k(p,i.response.status,await i.response.text());return}if(i.protocol!==void 0)D.set(N,i.protocol);C.handleUpgrade(N,p,L,(s)=>{let d={data:i.session,send:(h)=>s.send(h),close:(h,g)=>s.close(h,g)};s.on("message",(h,g)=>{let w=Array.isArray(h)?Buffer.concat(h):h instanceof ArrayBuffer?Buffer.from(h):h;f.handlers.message(d,g?new Uint8Array(w):w.toString("utf8"))}),s.on("close",()=>f.handlers.close(d)),f.handlers.open(d)})})().catch(()=>p.destroy())}),await new Promise((N,p)=>{x.once("error",p),x.listen(e.port,e.host,()=>{x.removeListener("error",p),N()})});let O=x.address(),E=typeof O==="object"&&O!==null?O.port:e.port;return{url:`http://${e.host}:${E}`,port:E,host:e.host,websocket:!0,stop:()=>new Promise((N)=>{f.closeAll(),C.close(),x.closeAllConnections?.(),x.close(()=>N())})}}function MA(t,e){let r=new URL(t);if(r.pathname="/",r.hostname=Tt(r.hostname),e!==void 0&&e!=="")r.searchParams.set("agent",e);return r.toString()}
|
|
87
|
+
export{Ai,nr,Tt,or,ir,rr,MA};
|
|
88
|
+
|
|
89
|
+
//# debugId=4EB87E24B7639E7F64756E2164756E21
|
|
90
|
+
//# sourceMappingURL=index-d0zxvr99.js.map
|