@react-grab/visual-edit 0.0.95 → 0.0.97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/client.cjs +64 -63
- package/dist/client.js +64 -63
- package/dist/index.global.js +15 -15
- package/dist/server.cjs +1 -1
- package/dist/server.js +1 -1
- package/package.json +2 -2
package/dist/index.global.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var ReactGrabVisualEdit=(function(exports){'use strict';function Sr(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Tr(){let e=Sr();if(e.__xstate__)return e.__xstate__}var Jt=e=>{if(typeof window>"u")return;let t=Tr();t&&t.register(e);};var Je=class{constructor(t){this._process=t,this._active=false,this._current=null,this._last=null;}start(){this._active=true,this.flush();}clear(){this._current&&(this._current.next=null,this._last=this._current);}enqueue(t){let n={value:t,next:null};if(this._current){this._last.next=n,this._last=n;return}this._current=n,this._last=n,this._active&&this.flush();}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next;}this._last=null;}},Ct=".",Cr="",_t="",_r="#",Ar="*",on="xstate.init",sn="xstate.error",vt="xstate.stop";function Nr(e,t){return {type:`xstate.after.${e}.${t}`}}function wt(e,t){return {type:`xstate.done.state.${e}`,output:t}}function Mr(e,t){return {type:`xstate.done.actor.${e}`,output:t,actorId:e}}function At(e,t){return {type:`xstate.error.actor.${e}`,error:t,actorId:e}}function Nt(e){return {type:on,input:e}}function ie(e){setTimeout(()=>{throw e});}var kr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function an(e,t){let n=Qt(e),r=Qt(t);return typeof r=="string"?typeof n=="string"?r===n:false:typeof n=="string"?n in r:Object.keys(n).every(o=>o in r?an(n[o],r[o]):false)}function et(e){if(cn(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r];}return t.push(n),t}function Qt(e){if(no(e))return e.value;if(typeof e!="string")return e;let t=et(e);return Lr(t)}function Lr(e){if(e.length===1)return e[0];let t={},n=t;for(let r=0;r<e.length-1;r++)if(r===e.length-2)n[e[r]]=e[r+1];else {let o=n;n={},o[e[r]]=n;}return t}function Mt(e,t){let n={},r=Object.keys(e);for(let o=0;o<r.length;o++){let s=r[o];n[s]=t(e[s],s,e,o);}return n}function ln(e){return cn(e)?e:[e]}function se(e){return e===void 0?[]:ln(e)}function xt(e,t,n,r){return typeof e=="function"?e({context:t,event:n,self:r}):e}function cn(e){return Array.isArray(e)}function Ir(e){return e.type.startsWith("xstate.error.actor")}function be(e){return ln(e).map(t=>typeof t>"u"||typeof t=="string"?{target:t}:t)}function un(e){if(!(e===void 0||e===Cr))return se(e)}function Et(e,t,n){let r=typeof e=="object",o=r?e:void 0;return {next:(r?e.next:e)?.bind(o),error:(r?e.error:t)?.bind(o),complete:(r?e.complete:n)?.bind(o)}}function kt(e,t){return `${t}.${e}`}function Re(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,r,o]=n,l=e.getStateNodeById(o).config.invoke;return (Array.isArray(l)?l[r]:l).src}function dn(e,t){if(t===e||t===Ar)return true;if(!t.endsWith(".*"))return false;let n=t.split("."),r=e.split(".");for(let o=0;o<n.length;o++){let s=n[o],l=r[o];if(s==="*")return o===n.length-1;if(s!==l)return false}return true}function en(e,t){return `${e.sessionId}.${t}`}var Or=0;function Pr(e,t){let n=new Map,r=new Map,o=new WeakMap,s=new Set,l={},{clock:c,logger:f}=t,g={schedule:(m,x,A,L,P=Math.random().toString(36).slice(2))=>{let G={source:m,target:x,event:A,delay:L,id:P,startedAt:Date.now()},W=en(m,P);v._snapshot._scheduledEvents[W]=G;let te=c.setTimeout(()=>{delete l[W],delete v._snapshot._scheduledEvents[W],v._relay(m,x,A);},L);l[W]=te;},cancel:(m,x)=>{let A=en(m,x),L=l[A];delete l[A],delete v._snapshot._scheduledEvents[A],L!==void 0&&c.clearTimeout(L);},cancelAll:m=>{for(let x in v._snapshot._scheduledEvents){let A=v._snapshot._scheduledEvents[x];A.source===m&&g.cancel(m,A.id);}}},S=m=>{if(!s.size)return;let x={...m,rootId:e.sessionId};s.forEach(A=>A.next?.(x));},v={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${Or++}`,_register:(m,x)=>(n.set(m,x),m),_unregister:m=>{n.delete(m.sessionId);let x=o.get(m);x!==void 0&&(r.delete(x),o.delete(m));},get:m=>r.get(m),getAll:()=>Object.fromEntries(r.entries()),_set:(m,x)=>{let A=r.get(m);if(A&&A!==x)throw new Error(`Actor with system ID '${m}' already exists.`);r.set(m,x),o.set(x,m);},inspect:m=>{let x=Et(m);return s.add(x),{unsubscribe(){s.delete(x);}}},_sendInspectionEvent:S,_relay:(m,x,A)=>{v._sendInspectionEvent({type:"@xstate.event",sourceRef:m,actorRef:x,event:A}),x._send(A);},scheduler:g,getSnapshot:()=>({_scheduledEvents:{...v._snapshot._scheduledEvents}}),start:()=>{let m=v._snapshot._scheduledEvents;v._snapshot._scheduledEvents={};for(let x in m){let{source:A,target:L,event:P,delay:G,id:W}=m[x];g.schedule(A,L,P,G,W);}},_clock:c,_logger:f};return v}var bt=false,tt=1,Q=(function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e})({}),Dr={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:false},St=class{constructor(t,n){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new Je(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=Q.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let r={...Dr,...n},{clock:o,logger:s,parent:l,syncSnapshot:c,id:f,systemId:g,inspect:S}=r;this.system=l?l.system:Pr(this,{clock:o,logger:s}),S&&!l&&this.system.inspect(Et(S)),this.sessionId=this.system._bookId(),this.id=f??this.sessionId,this.logger=n?.logger??this.system._logger,this.clock=n?.clock??this.system._clock,this._parent=l,this._syncSnapshot=c,this.options=r,this.src=r.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:v=>{this._deferred.push(v);},system:this.system,stopChild:v=>{if(v._parent!==this)throw new Error(`Cannot stop child actor ${v.id} of ${this.id} because it is not a child`);v._stop();},emit:v=>{let m=this.eventListeners.get(v.type),x=this.eventListeners.get("*");if(!m&&!x)return;let A=[...m?m.values():[],...x?x.values():[]];for(let L of A)try{L(v);}catch(P){ie(P);}},actionExecutor:v=>{let m=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:v.type,params:v.params}}),!v.exec)return;let x=bt;try{bt=!0,v.exec(v.info,v.params);}finally{bt=x;}};this._processingStatus===Q.Running?m():this._deferred.push(m);}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),g&&(this.systemId=g,this.system._set(g,this)),this._initState(n?.snapshot??n?.state),g&&this._snapshot.status!=="active"&&this.system._unregister(this);}_initState(t){try{this._snapshot=t?this.logic.restoreSnapshot?this.logic.restoreSnapshot(t,this._actorScope):t:this.logic.getInitialSnapshot(this._actorScope,this.options?.input);}catch(n){this._snapshot={status:"error",output:void 0,error:n};}}update(t,n){this._snapshot=t;let r;for(;r=this._deferred.shift();)try{r();}catch(o){this._deferred.length=0,this._snapshot={...t,status:"error",error:o};}switch(this._snapshot.status){case "active":for(let o of this.observers)try{o.next?.(t);}catch(s){ie(s);}break;case "done":for(let o of this.observers)try{o.next?.(t);}catch(s){ie(s);}this._stopProcedure(),this._complete(),this._doneEvent=Mr(this.id,this._snapshot.output),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case "error":this._error(this._snapshot.error);break}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:n,snapshot:t});}subscribe(t,n,r){let o=Et(t,n,r);if(this._processingStatus!==Q.Stopped)this.observers.add(o);else switch(this._snapshot.status){case "done":try{o.complete?.();}catch(s){ie(s);}break;case "error":{let s=this._snapshot.error;if(!o.error)ie(s);else try{o.error(s);}catch(l){ie(l);}break}}return {unsubscribe:()=>{this.observers.delete(o);}}}on(t,n){let r=this.eventListeners.get(t);r||(r=new Set,this.eventListeners.set(t,r));let o=n.bind(void 0);return r.add(o),{unsubscribe:()=>{r.delete(o);}}}start(){if(this._processingStatus===Q.Running)return this;this._syncSnapshot&&this.subscribe({next:r=>{r.status==="active"&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:r});},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=Q.Running;let t=Nt(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:t}),this._snapshot.status){case "done":return this.update(this._snapshot,t),this;case "error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope);}catch(r){return this._snapshot={...this._snapshot,status:"error",error:r},this._error(r),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let n,r;try{n=this.logic.transition(this._snapshot,t,this._actorScope);}catch(o){r={err:o};}if(r){let{err:o}=r;this._snapshot={...this._snapshot,status:"error",error:o},this._error(o);return}this.update(n,t),t.type===vt&&(this._stopProcedure(),this._complete());}_stop(){return this._processingStatus===Q.Stopped?this:(this.mailbox.clear(),this._processingStatus===Q.NotStarted?(this._processingStatus=Q.Stopped,this):(this.mailbox.enqueue({type:vt}),this))}stop(){if(this._parent)throw new Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.();}catch(n){ie(n);}this.observers.clear();}_reportError(t){if(!this.observers.size){this._parent||ie(t);return}let n=false;for(let r of this.observers){let o=r.error;n||=!o;try{o?.(t);}catch(s){ie(s);}}this.observers.clear(),n&&ie(t);}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,At(this.id,t));}_stopProcedure(){return this._processingStatus!==Q.Running?this:(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new Je(this._process.bind(this)),this._processingStatus=Q.Stopped,this.system._unregister(this),this)}_send(t){this._processingStatus!==Q.Stopped&&this.mailbox.enqueue(t);}send(t){this.system._relay(void 0,this,t);}attachDevTools(){let{devTools:t}=this.options;t&&(typeof t=="function"?t:Jt)(this);}toJSON(){return {xstate$$type:tt,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[kr](){return this}getSnapshot(){return this._snapshot}};function we(e,...[t]){return new St(e,t)}function Rr(e,t,n,r,{sendId:o}){let s=typeof o=="function"?o(n,r):o;return [t,{sendId:s},void 0]}function $r(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId);});}function $e(e){function t(n,r){}return t.type="xstate.cancel",t.sendId=e,t.resolve=Rr,t.execute=$r,t}function Hr(e,t,n,r,{id:o,systemId:s,src:l,input:c,syncSnapshot:f}){let g=typeof l=="string"?Re(t.machine,l):l,S=typeof o=="function"?o(n):o,v,m;return g&&(m=typeof c=="function"?c({context:t.context,event:n.event,self:e.self}):c,v=we(g,{id:S,src:l,parent:e.self,syncSnapshot:f,systemId:s,input:m})),[fe(t,{children:{...t.children,[S]:v}}),{id:o,systemId:s,actorRef:v,src:l,input:m},void 0]}function Br(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==Q.Stopped&&t.start();});}function He(...[e,{id:t,systemId:n,input:r,syncSnapshot:o=false}={}]){function s(l,c){}return s.type="xstate.spawnChild",s.id=t,s.systemId=n,s.src=e,s.input=r,s.syncSnapshot=o,s.resolve=Hr,s.execute=Br,s}function Fr(e,t,n,r,{actorRef:o}){let s=typeof o=="function"?o(n,r):o,l=typeof s=="string"?t.children[s]:s,c=t.children;return l&&(c={...c},delete c[l.id]),[fe(t,{children:c}),l,void 0]}function zr(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==Q.Running){e.stopChild(t);return}e.defer(()=>{e.stopChild(t);});}}function Ae(e){function t(n,r){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=Fr,t.execute=zr,t}function Ne(e,t,n,r){let{machine:o}=r,s=typeof e=="function",l=s?e:o.implementations.guards[typeof e=="string"?e:e.type];if(!s&&!l)throw new Error(`Guard '${typeof e=="string"?e:e.type}' is not implemented.'.`);if(typeof l!="function")return Ne(l,t,n,r);let c={context:t,event:n},f=s||typeof e=="string"?void 0:"params"in e?typeof e.params=="function"?e.params({context:t,event:n}):e.params:void 0;return "check"in l?l.check(r,c,l):l(c,f)}var Lt=e=>e.type==="atomic"||e.type==="final";function Ce(e){return Object.values(e.states).filter(t=>t.type!=="history")}function Be(e,t){let n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function Fe(e){let t=new Set(e),n=fn(t);for(let r of t)if(r.type==="compound"&&(!n.get(r)||!n.get(r).length))tn(r).forEach(o=>t.add(o));else if(r.type==="parallel"){for(let o of Ce(r))if(o.type!=="history"&&!t.has(o)){let s=tn(o);for(let l of s)t.add(l);}}for(let r of t){let o=r.parent;for(;o;)t.add(o),o=o.parent;}return t}function pn(e,t){let n=t.get(e);if(!n)return {};if(e.type==="compound"){let o=n[0];if(o){if(Lt(o))return o.key}else return {}}let r={};for(let o of n)r[o.key]=pn(o,t);return r}function fn(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function hn(e,t){let n=Fe(t);return pn(e,fn(n))}function nt(e,t){return t.type==="compound"?Ce(t).some(n=>n.type==="final"&&e.has(n)):t.type==="parallel"?Ce(t).every(n=>nt(e,n)):t.type==="final"}var ze=e=>e[0]===_r;function mn(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(r=>dn(t,r)).sort((r,o)=>o.length-r.length).flatMap(r=>e.transitions.get(r))}function gn(e){let t=e.config.after;if(!t)return [];let n=o=>{let s=Nr(o,e.id),l=s.type;return e.entry.push(Ve(s,{id:l,delay:o})),e.exit.push($e(l)),l};return Object.keys(t).flatMap(o=>{let s=t[o],l=typeof s=="string"?{target:s}:s,c=Number.isNaN(+o)?o:+o,f=n(c);return se(l).map(g=>({...g,event:f,delay:c}))}).map(o=>{let{delay:s}=o;return {...de(e,o.event,o),delay:s}})}function de(e,t,n){let r=un(n.target),o=n.reenter??false,s=Ur(e,r),l={...n,actions:se(n.actions),guard:n.guard,target:s,source:e,reenter:o,eventType:t,toJSON:()=>({...l,source:`#${e.id}`,target:s?s.map(c=>`#${c.id}`):void 0})};return l}function bn(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(n===_t)throw new Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=e.config.on[n];t.set(n,be(r).map(o=>de(e,n,o)));}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,be(e.config.onDone).map(r=>de(e,n,r)));}for(let n of e.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;t.set(r,be(n.onDone).map(o=>de(e,r,o)));}if(n.onError){let r=`xstate.error.actor.${n.id}`;t.set(r,be(n.onError).map(o=>de(e,r,o)));}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;t.set(r,be(n.onSnapshot).map(o=>de(e,r,o)));}}for(let n of e.after){let r=t.get(n.eventType);r||(r=[],t.set(n.eventType,r)),r.push(n);}return t}function yn(e,t){let n=typeof t=="string"?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw new Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let r={source:e,actions:!t||typeof t=="string"?[]:se(t.actions),eventType:null,reenter:false,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function Ur(e,t){if(t!==void 0)return t.map(n=>{if(typeof n!="string")return n;if(ze(n))return e.machine.getStateNodeById(n);let r=n[0]===Ct;if(r&&!e.parent)return De(e,n.slice(1));let o=r?e.key+n:n;if(e.parent)try{return De(e.parent,o)}catch(s){throw new Error(`Invalid transition definition for state node '${e.id}':
|
|
2
2
|
${s.message}`)}else throw new Error(`Invalid target: "${n}" is not a valid target from the root node. Did you mean ".${n}"?`)})}function vn(e){let t=un(e.config.target);return t?{target:t.map(n=>typeof n=="string"?De(e.parent,n):n)}:e.parent.initial}function ye(e){return e.type==="history"}function tn(e){let t=It(e);for(let n of t)for(let r of Be(n,e))t.add(r);return t}function It(e){let t=new Set;function n(r){if(!t.has(r)){if(t.add(r),r.type==="compound")n(r.initial.target[0]);else if(r.type==="parallel")for(let o of Ce(r))n(o);}}return n(e),t}function _e(e,t){if(ze(t))return e.machine.getStateNodeById(t);if(!e.states)throw new Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw new Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function De(e,t){if(typeof t=="string"&&ze(t))try{return e.machine.getStateNodeById(t)}catch{}let n=et(t).slice(),r=e;for(;n.length;){let o=n.shift();if(!o.length)break;r=_e(r,o);}return r}function Ue(e,t){if(typeof t=="string"){let o=e.states[t];if(!o)throw new Error(`State '${t}' does not exist on '${e.id}'`);return [e,o]}let n=Object.keys(t),r=n.map(o=>_e(e,o)).filter(Boolean);return [e.machine.root,e].concat(r,n.reduce((o,s)=>{let l=_e(e,s);if(!l)return o;let c=Ue(l,t[s]);return o.concat(c)},[]))}function jr(e,t,n,r){let s=_e(e,t).next(n,r);return !s||!s.length?e.next(n,r):s}function Vr(e,t,n,r){let o=Object.keys(t),s=_e(e,o[0]),l=rt(s,t[o[0]],n,r);return !l||!l.length?e.next(n,r):l}function Gr(e,t,n,r){let o=[];for(let s of Object.keys(t)){let l=t[s];if(!l)continue;let c=_e(e,s),f=rt(c,l,n,r);f&&o.push(...f);}return o.length?o:e.next(n,r)}function rt(e,t,n,r){return typeof t=="string"?jr(e,t,n,r):Object.keys(t).length===1?Vr(e,t,n,r):Gr(e,t,n,r)}function Kr(e){return Object.keys(e.states).map(t=>e.states[t]).filter(t=>t.type==="history")}function pe(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function Wr(e,t){let n=new Set(e),r=new Set(t);for(let o of n)if(r.has(o))return true;for(let o of r)if(n.has(o))return true;return false}function wn(e,t,n){let r=new Set;for(let o of e){let s=false,l=new Set;for(let c of r)if(Wr(Tt([o],t,n),Tt([c],t,n)))if(pe(o.source,c.source))l.add(c);else {s=true;break}if(!s){for(let c of l)r.delete(c);r.add(o);}}return Array.from(r)}function qr(e){let[t,...n]=e;for(let r of Be(t,void 0))if(n.every(o=>pe(o,r)))return r}function Ot(e,t){if(!e.target)return [];let n=new Set;for(let r of e.target)if(ye(r))if(t[r.id])for(let o of t[r.id])n.add(o);else for(let o of Ot(vn(r),t))n.add(o);else n.add(r);return [...n]}function xn(e,t){let n=Ot(e,t);if(!n)return;if(!e.reenter&&n.every(o=>o===e.source||pe(o,e.source)))return e.source;let r=qr(n.concat(e.source));if(r)return r;if(!e.reenter)return e.source.machine.root}function Tt(e,t,n){let r=new Set;for(let o of e)if(o.target?.length){let s=xn(o,n);o.reenter&&o.source===s&&r.add(s);for(let l of t)pe(l,s)&&r.add(l);}return [...r]}function Yr(e,t){if(e.length!==t.size)return false;for(let n of e)if(!t.has(n))return false;return true}function Qe(e,t,n,r,o,s){if(!e.length)return t;let l=new Set(t._nodes),c=t.historyValue,f=wn(e,l,c),g=t;o||([g,c]=Qr(g,r,n,f,l,c,s,n.actionExecutor)),g=ve(g,r,n,f.flatMap(v=>v.actions),s,void 0),g=Zr(g,r,n,f,l,s,c,o);let S=[...l];g.status==="done"&&(g=ve(g,r,n,S.sort((v,m)=>m.order-v.order).flatMap(v=>v.exit),s,void 0));try{return c===t.historyValue&&Yr(t._nodes,l)?g:fe(g,{_nodes:S,historyValue:c})}catch(v){throw v}}function Xr(e,t,n,r,o){if(r.output===void 0)return;let s=wt(o.id,o.output!==void 0&&o.parent?xt(o.output,e.context,t,n.self):void 0);return xt(r.output,e.context,s,n.self)}function Zr(e,t,n,r,o,s,l,c){let f=e,g=new Set,S=new Set;Jr(r,l,S,g),c&&S.add(e.machine.root);let v=new Set;for(let m of [...g].sort((x,A)=>x.order-A.order)){o.add(m);let x=[];x.push(...m.entry);for(let A of m.invoke)x.push(He(A.src,{...A,syncSnapshot:!!A.onSnapshot}));if(S.has(m)){let A=m.initial.actions;x.push(...A);}if(f=ve(f,t,n,x,s,m.invoke.map(A=>A.id)),m.type==="final"){let A=m.parent,L=A?.type==="parallel"?A:A?.parent,P=L||m;for(A?.type==="compound"&&s.push(wt(A.id,m.output!==void 0?xt(m.output,f.context,t,n.self):void 0));L?.type==="parallel"&&!v.has(L)&&nt(o,L);)v.add(L),s.push(wt(L.id)),P=L,L=L.parent;if(L)continue;f=fe(f,{status:"done",output:Xr(f,t,n,f.machine.root,P)});}}return f}function Jr(e,t,n,r){for(let o of e){let s=xn(o,t);for(let c of o.target||[])!ye(c)&&(o.source!==c||o.source!==s||o.reenter)&&(r.add(c),n.add(c)),Te(c,t,n,r);let l=Ot(o,t);for(let c of l){let f=Be(c,s);s?.type==="parallel"&&f.push(s),En(r,t,n,f,!o.source.parent&&o.reenter?void 0:s);}}}function Te(e,t,n,r){if(ye(e))if(t[e.id]){let o=t[e.id];for(let s of o)r.add(s),Te(s,t,n,r);for(let s of o)yt(s,e.parent,r,t,n);}else {let o=vn(e);for(let s of o.target)r.add(s),o===e.parent?.initial&&n.add(e.parent),Te(s,t,n,r);for(let s of o.target)yt(s,e.parent,r,t,n);}else if(e.type==="compound"){let[o]=e.initial.target;ye(o)||(r.add(o),n.add(o)),Te(o,t,n,r),yt(o,e,r,t,n);}else if(e.type==="parallel")for(let o of Ce(e).filter(s=>!ye(s)))[...r].some(s=>pe(s,o))||(ye(o)||(r.add(o),n.add(o)),Te(o,t,n,r));}function En(e,t,n,r,o){for(let s of r)if((!o||pe(s,o))&&e.add(s),s.type==="parallel")for(let l of Ce(s).filter(c=>!ye(c)))[...e].some(c=>pe(c,l))||(e.add(l),Te(l,t,n,e));}function yt(e,t,n,r,o){En(n,r,o,Be(e,t));}function Qr(e,t,n,r,o,s,l,c){let f=e,g=Tt(r,o,s);g.sort((v,m)=>m.order-v.order);let S;for(let v of g)for(let m of Kr(v)){let x;m.history==="deep"?x=A=>Lt(A)&&pe(A,v):x=A=>A.parent===v,S??={...s},S[m.id]=Array.from(o).filter(x);}for(let v of g)f=ve(f,t,n,[...v.exit,...v.invoke.map(m=>Ae(m.id))],l,void 0),o.delete(v);return [f,S||s]}function eo(e,t){return e.implementations.actions[t]}function Sn(e,t,n,r,o,s){let{machine:l}=e,c=e;for(let f of r){let g=typeof f=="function",S=g?f:eo(l,typeof f=="string"?f:f.type),v={context:c.context,event:t,self:n.self,system:n.system},m=g||typeof f=="string"?void 0:"params"in f?typeof f.params=="function"?f.params({context:c.context,event:t}):f.params:void 0;if(!S||!("resolve"in S)){n.actionExecutor({type:typeof f=="string"?f:typeof f=="object"?f.type:f.name||"(anonymous)",info:v,params:m,exec:S});continue}let x=S,[A,L,P]=x.resolve(n,c,v,m,S,o);c=A,"retryResolve"in x&&s?.push([x,L]),"execute"in x&&n.actionExecutor({type:x.type,info:v,params:L,exec:x.execute.bind(null,n,L)}),P&&(c=Sn(c,t,n,P,o,s));}return c}function ve(e,t,n,r,o,s){let l=s?[]:void 0,c=Sn(e,t,n,r,{internalQueue:o,deferredActorIds:s},l);return l?.forEach(([f,g])=>{f.retryResolve(n,c,g);}),c}function ot(e,t,n,r){let o=e,s=[];function l(g,S,v){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:S,snapshot:g,_transitions:v}),s.push(g);}if(t.type===vt)return o=fe(nn(o,t,n),{status:"stopped"}),l(o,t,[]),{snapshot:o,microstates:s};let c=t;if(c.type!==on){let g=c,S=Ir(g),v=rn(g,o);if(S&&!v.length)return o=fe(e,{status:"error",error:g.error}),l(o,g,[]),{snapshot:o,microstates:s};o=Qe(v,e,n,c,false,r),l(o,g,v);}let f=true;for(;o.status==="active";){let g=f?to(o,c):[],S=g.length?o:void 0;if(!g.length){if(!r.length)break;c=r.shift(),g=rn(c,o);}o=Qe(g,o,n,c,false,r),f=o!==S,l(o,c,g);}return o.status!=="active"&&nn(o,c,n),{snapshot:o,microstates:s}}function nn(e,t,n){return ve(e,t,n,Object.values(e.children).map(r=>Ae(r)),[],void 0)}function rn(e,t){return t.machine.getTransitionData(t,e)}function to(e,t){let n=new Set,r=e._nodes.filter(Lt);for(let o of r)e:for(let s of [o].concat(Be(o,void 0)))if(s.always){for(let l of s.always)if(l.guard===void 0||Ne(l.guard,e.context,t,e)){n.add(l);break e}}return wn(Array.from(n),new Set(e._nodes),e.historyValue)}function Tn(e,t){let n=Fe(Ue(e,t));return hn(e,[...n])}function no(e){return !!e&&typeof e=="object"&&"machine"in e&&"value"in e}var ro=function(t){return an(t,this.value)},oo=function(t){return this.tags.has(t)},io=function(t){let n=this.machine.getTransitionData(this,t);return !!n?.length&&n.some(r=>r.target!==void 0||r.actions.length)},so=function(){let{_nodes:t,tags:n,machine:r,getMeta:o,toJSON:s,can:l,hasTag:c,matches:f,...g}=this;return {...g,tags:Array.from(n)}},ao=function(){return this._nodes.reduce((t,n)=>(n.meta!==void 0&&(t[n.id]=n.meta),t),{})};function je(e,t){return {status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:hn(t.root,e._nodes),tags:new Set(e._nodes.flatMap(n=>n.tags)),children:e.children,historyValue:e.historyValue||{},matches:ro,hasTag:oo,can:io,getMeta:ao,toJSON:so}}function fe(e,t={}){return je({...e,...t},e.machine)}function lo(e){if(typeof e!="object"||e===null)return {};let t={};for(let n in e){let r=e[n];Array.isArray(r)&&(t[n]=r.map(o=>({id:o.id})));}return t}function Cn(e,t){let{_nodes:n,tags:r,machine:o,children:s,context:l,can:c,hasTag:f,matches:g,getMeta:S,toJSON:v,...m}=e,x={};for(let L in s){let P=s[L];x[L]={snapshot:P.getPersistedSnapshot(t),src:P.src,systemId:P.systemId,syncSnapshot:P._syncSnapshot};}return {...m,context:_n(l),children:x,historyValue:lo(m.historyValue)}}function _n(e){let t;for(let n in e){let r=e[n];if(r&&typeof r=="object")if("sessionId"in r&&"send"in r&&"ref"in r)t??=Array.isArray(e)?e.slice():{...e},t[n]={xstate$$type:tt,id:r.id};else {let o=_n(r);o!==r&&(t??=Array.isArray(e)?e.slice():{...e},t[n]=o);}}return t??e}function co(e,t,n,r,{event:o,id:s,delay:l},{internalQueue:c}){let f=t.machine.implementations.delays;if(typeof o=="string")throw new Error(`Only event objects may be used with raise; use raise({ type: "${o}" }) instead`);let g=typeof o=="function"?o(n,r):o,S;if(typeof l=="string"){let v=f&&f[l];S=typeof v=="function"?v(n,r):v;}else S=typeof l=="function"?l(n,r):l;return typeof S!="number"&&c.push(g),[t,{event:g,id:s,delay:S},void 0]}function uo(e,t){let{event:n,delay:r,id:o}=t;if(typeof r=="number"){e.defer(()=>{let s=e.self;e.system.scheduler.schedule(s,s,n,r,o);});return}}function Ve(e,t){function n(r,o){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=co,n.execute=uo,n}function po(e,{machine:t,context:n},r,o){let s=(l,c)=>{if(typeof l=="string"){let f=Re(t,l);if(!f)throw new Error(`Actor logic '${l}' not implemented in machine '${t.id}'`);let g=we(f,{id:c?.id,parent:e.self,syncSnapshot:c?.syncSnapshot,input:typeof c?.input=="function"?c.input({context:n,event:r,self:e.self}):c?.input,src:l,systemId:c?.systemId});return o[g.id]=g,g}else return we(l,{id:c?.id,parent:e.self,syncSnapshot:c?.syncSnapshot,input:c?.input,src:l,systemId:c?.systemId})};return (l,c)=>{let f=s(l,c);return o[f.id]=f,e.defer(()=>{f._processingStatus!==Q.Stopped&&f.start();}),f}}function fo(e,t,n,r,{assignment:o}){if(!t.context)throw new Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let s={},l={context:t.context,event:n.event,spawn:po(e,t,n.event,s),self:e.self,system:e.system},c={};if(typeof o=="function")c=o(l,r);else for(let g of Object.keys(o)){let S=o[g];c[g]=typeof S=="function"?S(l,r):S;}let f=Object.assign({},t.context,c);return [fe(t,{context:f,children:Object.keys(s).length?{...t.children,...s}:t.children}),void 0,void 0]}function O(e){function t(n,r){}return t.type="xstate.assign",t.assignment=e,t.resolve=fo,t}var Nn=new WeakMap;function Me(e,t,n){let r=Nn.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},Nn.set(e,r)),r[t]}var ho={},Ge=e=>typeof e=="string"?{type:e}:typeof e=="function"?"resolve"in e?{type:e.type}:{type:e.name}:e,it=class e{constructor(t,n){if(this.config=t,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=n._parent,this.key=n._key,this.machine=n._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(Ct),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?Mt(this.config.states,(r,o)=>new e(r,{_parent:this,_key:o,_machine:this.machine})):ho,this.type==="compound"&&!this.config.initial)throw new Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=this.config.history===true?"shallow":this.config.history||false,this.entry=se(this.config.entry).slice(),this.exit=se(this.config.exit).slice(),this.meta=this.config.meta,this.output=this.type==="final"||!this.parent?this.config.output:void 0,this.tags=se(t.tags).slice();}_initialize(){this.transitions=bn(this),this.config.always&&(this.always=be(this.config.always).map(t=>de(this,_t,t))),Object.keys(this.states).forEach(t=>{this.states[t]._initialize();});}get definition(){return {id:this.id,key:this.key,version:this.machine.version,type:this.type,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(Ge),eventType:null,reenter:false,toJSON:()=>({target:this.initial.target.map(t=>`#${t.id}`),source:`#${this.id}`,actions:this.initial.actions.map(Ge),eventType:null})}:void 0,history:this.history,states:Mt(this.states,t=>t.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(t=>({...t,actions:t.actions.map(Ge)})),entry:this.entry.map(Ge),exit:this.exit.map(Ge),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return Me(this,"invoke",()=>se(this.config.invoke).map((t,n)=>{let{src:r,systemId:o}=t,s=t.id??kt(this.id,n),l=typeof r=="string"?r:`xstate.invoke.${kt(this.id,n)}`;return {...t,src:l,id:s,systemId:o,toJSON(){let{onDone:c,onError:f,...g}=t;return {...g,type:"xstate.invoke",src:l,id:s}}}}))}get on(){return Me(this,"on",()=>[...this.transitions].flatMap(([n,r])=>r.map(o=>[n,o])).reduce((n,[r,o])=>(n[r]=n[r]||[],n[r].push(o),n),{}))}get after(){return Me(this,"delayedTransitions",()=>gn(this))}get initial(){return Me(this,"initial",()=>yn(this,this.config.initial))}next(t,n){let r=n.type,o=[],s,l=Me(this,`candidates-${r}`,()=>mn(this,r));for(let c of l){let{guard:f}=c,g=t.context,S=false;try{S=!f||Ne(f,g,n,t);}catch(v){let m=typeof f=="string"?f:typeof f=="object"?f.type:void 0;throw new Error(`Unable to evaluate guard ${m?`'${m}' `:""}in transition for event '${r}' in state node '${this.id}':
|
|
3
|
-
${v.message}`)}if(S){o.push(...c.actions),s=c;break}}return s?[s]:void 0}get events(){return Me(this,"events",()=>{let{states:t}=this,n=new Set(this.ownEvents);if(t)for(let r of Object.keys(t)){let o=t[r];if(o.states)for(let s of o.events)n.add(`${s}`);}return Array.from(n)})}get ownEvents(){let t=Object.keys(Object.fromEntries(this.transitions)),n=new Set(t.filter(r=>this.transitions.get(r).some(o=>!(!o.target&&!o.actions.length&&!o.reenter))));return Array.from(n)}},mo="#",st=class e{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=true,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:n?.actors??{},actions:n?.actions??{},delays:n?.delays??{},guards:n?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new it(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events;}provide(t){let{actions:n,guards:r,actors:o,delays:s}=this.implementations;return new e(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...o,...t.actors},delays:{...s,...t.delays}})}resolveState(t){let n=Tn(this.root,t.value),r=Fe(Ue(this.root,n));return je({_nodes:[...r],context:t.context||{},children:{},status:nt(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return ot(t,n,r,[]).snapshot}microstep(t,n,r){return ot(t,n,r,[]).microstates}getTransitionData(t,n){return rt(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){let{context:o}=this.config,s=je({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?ve(s,n,t,[O(({spawn:c,event:f,self:g})=>o({spawn:c,input:f.input,self:g}))],r,void 0):s}getInitialSnapshot(t,n){let r=Nt(n),o=[],s=this.getPreInitialState(t,r,o),l=Qe([{target:[...It(this.root)],source:this.root,reenter:true,actions:[],eventType:null,toJSON:null}],s,t,r,true,o),{snapshot:c}=ot(l,r,t,o);return c}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start();});}getStateNodeById(t){let n=et(t),r=n.slice(1),o=ze(n[0])?n[0].slice(mo.length):n[0],s=this.idMap.get(o);if(!s)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return De(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return Cn(t,n)}restoreSnapshot(t,n){let r={},o=t.children;Object.keys(o).forEach(v=>{let m=o[v],x=m.snapshot,A=m.src,L=typeof A=="string"?Re(this,A):A;if(!L)return;let P=we(L,{id:v,parent:n.self,syncSnapshot:m.syncSnapshot,snapshot:x,src:A,systemId:m.systemId});r[v]=P;});function s(v,m){if(m instanceof it)return m;try{return v.machine.getStateNodeById(m.id)}catch{}}function l(v,m){if(!m||typeof m!="object")return {};let x={};for(let A in m){let L=m[A];for(let P of L){let G=s(v,P);G&&(x[A]??=[],x[A].push(G));}}return x}let c=l(this.root,t.historyValue),f=je({...t,children:r,_nodes:Array.from(Fe(Ue(this.root,t.value))),historyValue:c},this),g=new Set;function S(v,m){if(!g.has(v)){g.add(v);for(let x in v){let A=v[x];if(A&&typeof A=="object"){if("xstate$$type"in A&&A.xstate$$type===tt){v[x]=m[A.id];continue}S(A,m);}}}}return S(f.context,r),f}};function go(e,t,n,r,{event:o}){let s=typeof o=="function"?o(n,r):o;return [t,{event:s},void 0]}function bo(e,{event:t}){e.defer(()=>e.emit(t));}function Dt(e){function t(n,r){}return t.type="xstate.emit",t.event=e,t.resolve=go,t.execute=bo,t}var Pt=(function(e){return e.Parent="#_parent",e.Internal="#_internal",e})({});function yo(e,t,n,r,{to:o,event:s,id:l,delay:c},f){let g=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);let S=typeof s=="function"?s(n,r):s,v;if(typeof c=="string"){let A=g&&g[c];v=typeof A=="function"?A(n,r):A;}else v=typeof c=="function"?c(n,r):c;let m=typeof o=="function"?o(n,r):o,x;if(typeof m=="string"){if(m===Pt.Parent?x=e.self._parent:m===Pt.Internal?x=e.self:m.startsWith("#_")?x=t.children[m.slice(2)]:x=f.deferredActorIds?.includes(m)?m:t.children[m],!x)throw new Error(`Unable to send event to actor '${m}' from machine '${t.machine.id}'.`)}else x=m||e.self;return [t,{to:x,targetId:typeof m=="string"?m:void 0,event:S,id:l,delay:v},void 0]}function vo(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to]);}function wo(e,t){e.defer(()=>{let{to:n,event:r,delay:o,id:s}=t;if(typeof o=="number"){e.system.scheduler.schedule(e.self,n,r,o,s);return}e.system._relay(e.self,n,r.type===sn?At(e.self.id,r.data):r);});}function at(e,t,n){function r(o,s){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=yo,r.retryResolve=vo,r.execute=wo,r}function xo(e,t){return at(Pt.Parent,e,t)}function Eo(e,t,n,r,{collect:o}){let s=[],l=function(f){s.push(f);};return l.assign=(...c)=>{s.push(O(...c));},l.cancel=(...c)=>{s.push($e(...c));},l.raise=(...c)=>{s.push(Ve(...c));},l.sendTo=(...c)=>{s.push(at(...c));},l.sendParent=(...c)=>{s.push(xo(...c));},l.spawnChild=(...c)=>{s.push(He(...c));},l.stopChild=(...c)=>{s.push(Ae(...c));},l.emit=(...c)=>{s.push(Dt(...c));},o({context:n.context,event:n.event,enqueue:l,check:c=>Ne(c,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,s]}function Mn(e){function t(n,r){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=Eo,t}function So(e,t,n,r,{value:o,label:s}){return [t,{value:typeof o=="function"?o(n,r):o,label:s},void 0]}function To({logger:e},{value:t,label:n}){n?e(n,t):e(t);}function kn(e=({context:n,event:r})=>({context:n,event:r}),t){function n(r,o){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=So,n.execute=To,n}function Co(e,t){return new st(e,t)}function Rt({schemas:e,actors:t,actions:n,guards:r,delays:o}){return {assign:O,sendTo:at,raise:Ve,log:kn,cancel:$e,stopChild:Ae,enqueueActions:Mn,emit:Dt,spawnChild:He,createStateConfig:s=>s,createAction:s=>s,createMachine:s=>Co({...s,schemas:e},{actors:t,actions:n,guards:r,delays:o}),extend:s=>Rt({schemas:e,actors:t,actions:{...n,...s.actions},guards:{...r,...s.guards},delays:{...o,...s.delays}})}}var _o=(e,t)=>e===t,Ln={equals:_o},Ao=qn,Ie=1,ut=2;var ct=null,ke=null,In=null,X=null,J=null,xe=null,ft=0;function No(e,t){t=t?Object.assign({},Ln,t):Ln;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Gn(n,o));return [ko.bind(n),r]}function Mo(e){if(X===null)return e();let t=X;X=null;try{return In?In.untrack(e):e()}finally{X=t;}}No(false);function ko(){let e=ke;if(this.sources&&this.state)if(this.state===Ie)Kn(this);else {let t=J;J=null,ht(()=>dt(this)),J=t;}if(X){let t=this.observers?this.observers.length:0;X.sources?(X.sources.push(this),X.sourceSlots.push(t)):(X.sources=[this],X.sourceSlots=[t]),this.observers?(this.observers.push(X),this.observerSlots.push(X.sources.length-1)):(this.observers=[X],this.observerSlots=[X.sources.length-1]);}return e&&ke.sources.has(this)?this.tValue:this.value}function Gn(e,t,n){let r=e.value;return (!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&ht(()=>{for(let o=0;o<e.observers.length;o+=1){let s=e.observers[o],l=ke&&ke.running;l&&ke.disposed.has(s)||((l?!s.tState:!s.state)&&(s.pure?J.push(s):xe.push(s),s.observers&&Yn(s)),l?s.tState=Ie:s.state=Ie);}if(J.length>1e6)throw J=[],new Error})),t}function Kn(e){if(!e.fn)return;pt(e);let t=ft;Lo(e,e.value,t);}function Lo(e,t,n){let r,o=ct,s=X;X=ct=e;try{r=e.fn(t);}catch(l){return e.pure&&(e.state=Ie,e.owned&&e.owned.forEach(pt),e.owned=null),e.updatedAt=n+1,Xn(l)}finally{X=s,ct=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gn(e,r):e.value=r,e.updatedAt=n);}function Wn(e){if(e.state===0)return;if(e.state===ut)return dt(e);if(e.suspense&&Mo(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ft);)e.state&&n.push(e);for(let r=n.length-1;r>=0;r--)if(e=n[r],e.state===Ie)Kn(e);else if(e.state===ut){let o=J;J=null,ht(()=>dt(e,n[0])),J=o;}}function ht(e,t){if(J)return e();let n=false;(J=[]),xe?n=true:xe=[],ft++;try{let r=e();return Io(n),r}catch(r){n||(xe=null),J=null,Xn(r);}}function Io(e){if(J&&(qn(J),J=null),e)return;let t=xe;xe=null,t.length&&ht(()=>Ao(t));}function qn(e){for(let t=0;t<e.length;t++)Wn(e[t]);}function dt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let r=e.sources[n];if(r.sources){let o=r.state;o===Ie?r!==t&&(!r.updatedAt||r.updatedAt<ft)&&Wn(r):o===ut&&dt(r,t);}}}function Yn(e){for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];!n.state&&(n.state=ut,n.pure?J.push(n):xe.push(n),n.observers&&Yn(n));}}function pt(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let s=o.pop(),l=n.observerSlots.pop();r<o.length&&(s.sourceSlots[l]=r,o[r]=s,n.observerSlots[r]=l);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)pt(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)pt(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Oo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Xn(e,t=ct){throw Oo(e)}var On="_$DX_DELEGATE";function K(e,t,n,r){let o,s=()=>{let c=document.createElement("template");return c.innerHTML=e,c.content.firstChild},l=()=>(o||(o=s())).cloneNode(true);return l.cloneNode=l,l}function Ee(e,t=window.document){let n=t[On]||(t[On]=new Set);for(let r=0,o=e.length;r<o;r++){let s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Po));}}function Po(e){let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=f=>Object.defineProperty(e,"target",{configurable:true,value:f}),l=()=>{let f=t[n];if(f&&!t.disabled){let g=t[`${n}Data`];if(g!==void 0?f.call(t,g,e):f.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),true},c=()=>{for(;l()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let f=e.composedPath();s(f[0]);for(let g=0;g<f.length-2&&(t=f[g],!!l());g++){if(t._$host){t=t._$host,c();break}if(t.parentNode===o)break}}else c();s(r);}var Do="0.0.95";var Ro=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),$o=e=>{let t=e.trim();if(!t)return null;let n=parseFloat(t);return Ro(n)?n:null},Pn=(e,t)=>{let n=e.split(",");if(n.length!==t)return null;let r=[];for(let o of n){let s=$o(o);if(s===null)return null;r.push(s);}return r},Zn=(e,t,n,r)=>e===1&&t===0&&n===0&&r===1,Ho=e=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[15]===1,Bo=e=>{if(!e||e==="none")return "none";if(e.charCodeAt(0)===109)if(e.charCodeAt(6)===51){let t=e.length-1,n=Pn(e.slice(9,t),16);if(n)return n[12]=0,n[13]=0,n[14]=0,Ho(n)?"none":`matrix3d(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]}, ${n[4]}, ${n[5]}, ${n[6]}, ${n[7]}, ${n[8]}, ${n[9]}, ${n[10]}, ${n[11]}, 0, 0, 0, ${n[15]})`}else {let t=e.length-1,n=Pn(e.slice(7,t),6);if(n){let r=n[0],o=n[1],s=n[2],l=n[3];return Zn(r,o,s,l)?"none":`matrix(${r}, ${o}, ${s}, ${l}, 0, 0)`}}return "none"},Fo=e=>e.isIdentity?"none":e.is2D?Zn(e.a,e.b,e.c,e.d)?"none":`matrix(${e.a}, ${e.b}, ${e.c}, ${e.d}, 0, 0)`:e.m11===1&&e.m12===0&&e.m13===0&&e.m14===0&&e.m21===0&&e.m22===1&&e.m23===0&&e.m24===0&&e.m31===0&&e.m32===0&&e.m33===1&&e.m34===0&&e.m44===1?"none":`matrix3d(${e.m11}, ${e.m12}, ${e.m13}, ${e.m14}, ${e.m21}, ${e.m22}, ${e.m23}, ${e.m24}, ${e.m31}, ${e.m32}, ${e.m33}, ${e.m34}, 0, 0, 0, ${e.m44})`,zo=6,Uo=3,jo=(e,t)=>{let n=t&&t!=="none",r=null,o=e.parentElement,s=0;for(;o&&o!==document.documentElement&&s<zo;){let l=window.getComputedStyle(o).transform;if(l&&l!=="none")r=r?new DOMMatrix(l).multiply(r):new DOMMatrix(l);else if(!n&&!r&&s>=Uo)return "none";o=o.parentElement,s++;}return r?(n&&(r=r.multiply(new DOMMatrix(t))),Fo(r)):n?Bo(t):"none"},$t=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=jo(e,n.transform);if(r!=="none"&&e instanceof HTMLElement){let o=e.offsetWidth,s=e.offsetHeight;if(o>0&&s>0){let l=t.left+t.width*.5,c=t.top+t.height*.5;return {borderRadius:n.borderRadius||"0px",height:s,transform:r,width:o,x:l-o*.5,y:c-s*.5}}}return {borderRadius:n.borderRadius||"0px",height:t.height,transform:r,width:t.width,x:t.left,y:t.top}},Vo=e=>({isToggleMode:false,hasAgentProvider:false,keyHoldDuration:200,mousePosition:{x:-1e3,y:-1e3},dragStart:{x:-1e3,y:-1e3},copyStart:{x:-1e3,y:-1e3},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],lastGrabbedElement:null,lastCopiedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:"",pendingClickData:null,replySessionId:null,viewportVersion:0,grabbedBoxes:[],labelInstances:[],agentSessions:new Map,sessionElements:new Map,abortControllers:new Map,isTouchMode:false,theme:e,activationTimestamp:null,previouslyFocusedElement:null,canUndo:false,canRedo:false,isAgentConnected:false,supportsUndo:false,supportsFollowUp:false,dismissButtonText:void 0,pendingAbortSessionId:null}),Go=({context:e})=>e.hasAgentProvider,Ko=({context:e})=>e.frozenElement!==null||e.detectedElement!==null,Wo=({context:e})=>e.inputText.trim().length>0,qo=({context:e})=>e.isToggleMode,Yo=({context:e})=>e.pendingClickData!==null,Xo=({context:e})=>Array.from(e.agentSessions.values()).some(t=>t.isStreaming),Zo=({context:e})=>e.lastCopiedElement!==null&&document.contains(e.lastCopiedElement);Rt({delays:{KEY_HOLD_DURATION:({context:e})=>e.keyHoldDuration,DOUBLE_CLICK_THRESHOLD:250,SUCCESS_LABEL_DURATION:1700,COPIED_LABEL_DURATION:1500},guards:{hasAgentProvider:Go,hasElement:Ko,hasInputText:Wo,isToggleMode:qo,hasPendingClick:Yo,isAgentStreaming:Xo,hasLastCopiedElement:Zo},actions:{setMousePosition:O({mousePosition:({event:e})=>e.type==="MOUSE_MOVE"?e.position:{x:-1e3,y:-1e3}}),setDetectedElement:O({detectedElement:({event:e})=>e.type==="ELEMENT_DETECTED"?e.element:null}),setFrozenElement:O({frozenElement:({event:e})=>e.type==="FREEZE_ELEMENT"?e.element:null,frozenElements:({event:e})=>e.type==="FREEZE_ELEMENT"?[e.element]:[]}),setFrozenElements:O({frozenElements:({event:e})=>e.type==="FREEZE_ELEMENTS"?e.elements:[],frozenElement:({event:e})=>e.type==="FREEZE_ELEMENTS"&&e.elements.length>0?e.elements[0]:null}),clearFrozenElement:O({frozenElement:()=>null,frozenElements:()=>[]}),setDragStart:O({dragStart:({event:e})=>e.type==="DRAG_START"?{x:e.position.x+window.scrollX,y:e.position.y+window.scrollY}:{x:-1e3,y:-1e3}}),resetDragStart:O({dragStart:()=>({x:-1e3,y:-1e3})}),setCopyStart:O({copyStart:({event:e})=>e.type==="SET_COPY_START"?e.position:{x:-1e3,y:-1e3},copyOffsetFromCenterX:({event:e})=>{if(e.type==="SET_COPY_START"&&e.element){let t=$t(e.element),n=t.x+t.width/2;return e.position.x-n}return 0}}),setInputText:O({inputText:({event:e})=>e.type==="INPUT_CHANGE"?e.value:""}),clearInputText:O({inputText:()=>""}),enableToggleMode:O({isToggleMode:()=>true}),disableToggleMode:O({isToggleMode:()=>false}),setToggleMode:O({isToggleMode:({event:e})=>e.type==="SET_TOGGLE_MODE"?e.value:false}),setLastGrabbedElement:O({lastGrabbedElement:({event:e})=>e.type==="SET_LAST_GRABBED"?e.element:null}),setLastCopiedElement:O({lastCopiedElement:({event:e})=>e.type==="SET_LAST_COPIED"||e.type==="COPY_DONE"?e.element??null:null}),clearLastCopiedElement:O({lastCopiedElement:()=>null}),incrementViewportVersion:O({viewportVersion:({context:e})=>e.viewportVersion+1}),addGrabbedBox:O({grabbedBoxes:({context:e,event:t})=>t.type==="ADD_GRABBED_BOX"?[...e.grabbedBoxes,t.box]:e.grabbedBoxes}),removeGrabbedBox:O({grabbedBoxes:({context:e,event:t})=>t.type==="REMOVE_GRABBED_BOX"?e.grabbedBoxes.filter(n=>n.id!==t.boxId):e.grabbedBoxes}),clearGrabbedBoxes:O({grabbedBoxes:()=>[]}),addLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="ADD_LABEL_INSTANCE"?[...e.labelInstances,t.instance]:e.labelInstances}),updateLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="UPDATE_LABEL_INSTANCE"?e.labelInstances.map(n=>n.id===t.instanceId?{...n,status:t.status}:n):e.labelInstances}),removeLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="REMOVE_LABEL_INSTANCE"?e.labelInstances.filter(n=>n.id!==t.instanceId):e.labelInstances}),clearLabelInstances:O({labelInstances:()=>[]}),setTouchMode:O({isTouchMode:({event:e})=>e.type==="SET_TOUCH_MODE"?e.value:false}),setSelectionSource:O({selectionFilePath:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.filePath:null,selectionLineNumber:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.lineNumber:null}),clearSelectionSource:O({selectionFilePath:()=>null,selectionLineNumber:()=>null}),setPendingClickData:O({pendingClickData:({event:e})=>e.type==="SET_PENDING_CLICK"?e.data:null}),clearPendingClickData:O({pendingClickData:()=>null}),setReplySessionId:O({replySessionId:({event:e})=>e.type==="SET_REPLY_SESSION"?e.sessionId:null}),clearReplySessionId:O({replySessionId:()=>null}),addAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.agentSessions;let n=new Map(e.agentSessions);return n.set(t.sessionId,t.session),n}}),setSessionElement:O({sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.sessionElements;let n=new Map(e.sessionElements);return n.set(t.sessionId,t.element),n}}),updateAgentSessionStatus:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_STATUS")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,lastStatus:t.status}),r}}),completeAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_DONE")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,lastStatus:t.status??n.lastStatus}),r}}),setAgentSessionError:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_ERROR")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,error:t.error}),r}}),removeAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.agentSessions;let n=new Map(e.agentSessions);return n.delete(t.sessionId),n},sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.sessionElements;let n=new Map(e.sessionElements);return n.delete(t.sessionId),n}}),storeActivationTimestamp:O({activationTimestamp:()=>Date.now(),previouslyFocusedElement:()=>document.activeElement}),clearActivationTimestamp:O({activationTimestamp:()=>null,previouslyFocusedElement:()=>null}),setKeyHoldDuration:O({keyHoldDuration:({event:e,context:t})=>e.type==="HOLD_START"&&e.duration!==void 0?e.duration:t.keyHoldDuration}),setHasAgentProvider:O({hasAgentProvider:({event:e})=>e.type==="SET_HAS_AGENT_PROVIDER"?e.value:false}),setUndoRedoState:O({canUndo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canUndo:false,canRedo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canRedo:false}),setAgentCapabilities:O({supportsUndo:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsUndo:false,supportsFollowUp:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsFollowUp:false,dismissButtonText:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.dismissButtonText:void 0,isAgentConnected:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.isAgentConnected:false}),setPendingAbortSessionId:O({pendingAbortSessionId:({event:e})=>e.type==="SET_PENDING_ABORT_SESSION"?e.sessionId:null}),resetActivationState:O({isToggleMode:()=>false,inputText:()=>"",frozenElement:()=>null,frozenElements:()=>[],pendingClickData:()=>null,activationTimestamp:()=>null}),updateSessionBounds:O({agentSessions:({context:e})=>{if(e.agentSessions.size===0)return e.agentSessions;let t=new Map(e.agentSessions),n=false;for(let[r,o]of e.agentSessions){let s=e.sessionElements.get(r);if(s&&document.contains(s)){let l=$t(s),c=o.selectionBounds[0],f=o.position;if(c){let g=c.x+c.width/2,S=o.position.x-g,v=l.x+l.width/2;f={...o.position,x:v+S};}t.set(r,{...o,selectionBounds:[l],position:f}),n=true;}}return n?t:e.agentSessions}}),freezeCurrentElement:O({frozenElement:({context:e})=>e.frozenElement??e.detectedElement}),saveInputModePosition:O({copyStart:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.copyStart,copyOffsetFromCenterX:({event:e})=>{if(e.type==="INPUT_MODE_ENTER"&&e.element){let t=$t(e.element),n=t.x+t.width/2;return e.position.x-n}return 0},mousePosition:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.mousePosition,frozenElement:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.element:t.frozenElement})}}).createMachine({id:"grabMachine",type:"parallel",context:({input:e})=>({...Vo(e.theme),hasAgentProvider:e.hasAgentProvider,keyHoldDuration:e.keyHoldDuration}),states:{activation:{initial:"idle",states:{idle:{on:{HOLD_START:{target:"holding",actions:["setKeyHoldDuration"]},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},holding:{after:{KEY_HOLD_DURATION:{target:"active",actions:["storeActivationTimestamp"]}},on:{RELEASE:{target:"idle"},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},active:{initial:"hovering",states:{hovering:{on:{FREEZE:{target:"frozen",actions:["freezeCurrentElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},frozen:{on:{UNFREEZE:{target:"hovering",actions:["clearFrozenElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},dragging:{on:{DRAG_END:{target:"justDragged",actions:["resetDragStart"]},DRAG_CANCEL:{target:"hovering",actions:["resetDragStart"]}}},justDragged:{on:{DRAG_START:{target:"dragging",actions:["setDragStart"]}},after:{SUCCESS_LABEL_DURATION:{target:"hovering"}}}},on:{DEACTIVATE:{target:"idle",actions:["resetActivationState","clearActivationTimestamp"]},MOUSE_MOVE:{actions:["setMousePosition"]},ELEMENT_DETECTED:{actions:["setDetectedElement"]},SET_TOUCH_MODE:{actions:["setTouchMode"]},SET_SELECTION_SOURCE:{actions:["setSelectionSource"]}}}},on:{TOGGLE:[{guard:({context:e})=>e.activationTimestamp!==null,target:".idle",actions:["resetActivationState","clearActivationTimestamp"]},{target:".active",actions:["enableToggleMode","storeActivationTimestamp"]}],VIEWPORT_CHANGE:{actions:["incrementViewportVersion","updateSessionBounds"]},ADD_GRABBED_BOX:{actions:["addGrabbedBox"]},REMOVE_GRABBED_BOX:{actions:["removeGrabbedBox"]},CLEAR_GRABBED_BOXES:{actions:["clearGrabbedBoxes"]},SET_LAST_GRABBED:{actions:["setLastGrabbedElement"]},SET_LAST_COPIED:{actions:["setLastCopiedElement"]},SET_HAS_AGENT_PROVIDER:{actions:["setHasAgentProvider"]},SET_UNDO_REDO_STATE:{actions:["setUndoRedoState"]},SET_AGENT_CAPABILITIES:{actions:["setAgentCapabilities"]},SET_TOGGLE_MODE:{actions:["setToggleMode"]},FREEZE_ELEMENT:{actions:["setFrozenElement"]},FREEZE_ELEMENTS:{actions:["setFrozenElements"]},SET_PENDING_ABORT_SESSION:{actions:["setPendingAbortSessionId"]}}},interaction:{initial:"idle",states:{idle:{on:{CLICK:{target:"awaitingDoubleClick",actions:["setPendingClickData"]},INPUT_MODE_ENTER:{target:"inputMode",actions:["saveInputModePosition","enableToggleMode"]},COPY_START:{target:"copying"}}},awaitingDoubleClick:{after:{DOUBLE_CLICK_THRESHOLD:{target:"copying"}},on:{DOUBLE_CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]},CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]}}},copying:{on:{COPY_DONE:{target:"justCopied",actions:["clearPendingClickData","setLastCopiedElement"]}}},justCopied:{after:{COPIED_LABEL_DURATION:{target:"idle"}}},inputMode:{initial:"typing",states:{typing:{on:{ESC:[{target:"confirmingDismiss",guard:"hasInputText"},{target:"#grabMachine.interaction.idle"}],INPUT_SUBMIT:{target:"#grabMachine.interaction.copying"}}},confirmingDismiss:{on:{CANCEL_DISMISS:{target:"typing"},CONFIRM_DISMISS:{target:"#grabMachine.interaction.idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{INPUT_CHANGE:{actions:["setInputText"]},INPUT_CANCEL:{target:"idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{ADD_LABEL_INSTANCE:{actions:["addLabelInstance"]},UPDATE_LABEL_INSTANCE:{actions:["updateLabelInstance"]},REMOVE_LABEL_INSTANCE:{actions:["removeLabelInstance"]},SET_COPY_START:{actions:["setCopyStart"]},SET_PENDING_CLICK:{actions:["setPendingClickData"]},SET_REPLY_SESSION:{actions:["setReplySessionId"]},DEACTIVATE:{target:".idle",actions:["clearInputText","clearReplySessionId","clearPendingClickData"]}}},agentSessions:{initial:"idle",states:{idle:{on:{SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},streaming:{on:{STREAM_STATUS:{actions:["updateAgentSessionStatus"]},STREAM_DONE:{target:"completed",actions:["completeAgentSession"]},STREAM_ERROR:{target:"error",actions:["setAgentSessionError"]},SESSION_ABORT:{target:"idle",actions:["removeAgentSession"]}}},completed:{on:{SESSION_DISMISS:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},error:{on:{ERROR_ACKNOWLEDGE:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}}},on:{UPDATE_SESSION_BOUNDS:{actions:["updateSessionBounds"]}}}}});var Kt="-",Jo=e=>{let t=ei(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return {getClassGroupId:o=>{let s=o.split(Kt);return s[0]===""&&s.length!==1&&s.shift(),Jn(s,t)||Qo(o)},getConflictingClassGroupIds:(o,s)=>{let l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},Jn=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?Jn(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let s=e.join(Kt);return t.validators.find(({validator:l})=>l(s))?.classGroupId},Dn=/^\[(.+)\]$/,Qo=e=>{if(Dn.test(e)){let t=Dn.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return "arbitrary.."+n}},ei=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ni(Object.entries(e.classGroups),n).forEach(([o,s])=>{zt(s,r,o,t);}),r},zt=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let s=o===""?t:Rn(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ti(o)){zt(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,l])=>{zt(l,Rn(t,s),n,r);});});},Rn=(e,t)=>{let n=e;return t.split(Kt).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r);}),n},ti=e=>e.isThemeGetter,ni=(e,t)=>t?e.map(([n,r])=>{let o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return [n,o]}):e,ri=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map);};return {get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return o(s,l),l},set(s,l){n.has(s)?n.set(s,l):o(s,l);}}},Qn="!",oi=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,l=c=>{let f=[],g=0,S=0,v;for(let P=0;P<c.length;P++){let G=c[P];if(g===0){if(G===o&&(r||c.slice(P,P+s)===t)){f.push(c.slice(S,P)),S=P+s;continue}if(G==="/"){v=P;continue}}G==="["?g++:G==="]"&&g--;}let m=f.length===0?c:c.substring(S),x=m.startsWith(Qn),A=x?m.substring(1):m,L=v&&v>S?v-S:void 0;return {modifiers:f,hasImportantModifier:x,baseClassName:A,maybePostfixModifierPosition:L}};return n?c=>n({className:c,parseClassName:l}):l},ii=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r);}),t.push(...n.sort()),t},si=e=>({cache:ri(e.cacheSize),parseClassName:oi(e),...Jo(e)}),ai=/\s+/,li=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],l=e.trim().split(ai),c="";for(let f=l.length-1;f>=0;f-=1){let g=l[f],{modifiers:S,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:x}=n(g),A=!!x,L=r(A?m.substring(0,x):m);if(!L){if(!A){c=g+(c.length>0?" "+c:c);continue}if(L=r(m),!L){c=g+(c.length>0?" "+c:c);continue}A=false;}let P=ii(S).join(":"),G=v?P+Qn:P,W=G+L;if(s.includes(W))continue;s.push(W);let te=o(L,A);for(let ee=0;ee<te.length;++ee){let Z=te[ee];s.push(G+Z);}c=g+(c.length>0?" "+c:c);}return c};function ci(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=er(t))&&(r&&(r+=" "),r+=n);return r}var er=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=er(e[r]))&&(n&&(n+=" "),n+=t);return n};function ui(e,...t){let n,r,o,s=l;function l(f){let g=t.reduce((S,v)=>v(S),e());return n=si(g),r=n.cache.get,o=n.cache.set,s=c,c(f)}function c(f){let g=r(f);if(g)return g;let S=li(f,n);return o(f,S),S}return function(){return s(ci.apply(null,arguments))}}var q=e=>{let t=n=>n[e]||[];return t.isThemeGetter=true,t},tr=/^\[(?:([a-z-]+):)?(.+)\]$/i,di=/^\d+\/\d+$/,pi=new Set(["px","full","screen"]),fi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=e=>Le(e)||pi.has(e)||di.test(e),he=e=>Oe(e,"length",Ci),Le=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>Oe(e,"number",Le),Ke=e=>!!e&&Number.isInteger(Number(e)),yi=e=>e.endsWith("%")&&Le(e.slice(0,-1)),F=e=>tr.test(e),me=e=>fi.test(e),vi=new Set(["length","size","percentage"]),wi=e=>Oe(e,vi,nr),xi=e=>Oe(e,"position",nr),Ei=new Set(["image","url"]),Si=e=>Oe(e,Ei,Ai),Ti=e=>Oe(e,"",_i),We=()=>true,Oe=(e,t,n)=>{let r=tr.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):false},Ci=e=>hi.test(e)&&!mi.test(e),nr=()=>false,_i=e=>gi.test(e),Ai=e=>bi.test(e),Ni=()=>{let e=q("colors"),t=q("spacing"),n=q("blur"),r=q("brightness"),o=q("borderColor"),s=q("borderRadius"),l=q("borderSpacing"),c=q("borderWidth"),f=q("contrast"),g=q("grayscale"),S=q("hueRotate"),v=q("invert"),m=q("gap"),x=q("gradientColorStops"),A=q("gradientColorStopPositions"),L=q("inset"),P=q("margin"),G=q("opacity"),W=q("padding"),te=q("saturate"),ee=q("scale"),Z=q("sepia"),ce=q("skew"),ue=q("space"),R=q("translate"),j=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",F,t],E=()=>[F,t],y=()=>["",ae,he],T=()=>["auto",Le,F],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",F],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>[Le,F];return {cacheSize:500,separator:":",theme:{colors:[We],spacing:[ae,he],blur:["none","",me,F],brightness:b(),borderColor:[e],borderRadius:["none","","full",me,F],borderSpacing:E(),borderWidth:y(),contrast:b(),grayscale:V(),hueRotate:b(),invert:V(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[yi,he],inset:N(),margin:N(),opacity:b(),padding:E(),saturate:b(),scale:b(),sepia:V(),skew:b(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[me]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),F]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ke,F]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Ke,F]}],"grid-cols":[{"grid-cols":[We]}],"col-start-end":[{col:["auto",{span:["full",Ke,F]},F]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[We]}],"row-start-end":[{row:["auto",{span:[Ke,F]},F]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[W]}],px:[{px:[W]}],py:[{py:[W]}],ps:[{ps:[W]}],pe:[{pe:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[P]}],mx:[{mx:[P]}],my:[{my:[P]}],ms:[{ms:[P]}],me:[{me:[P]}],mt:[{mt:[P]}],mr:[{mr:[P]}],mb:[{mb:[P]}],ml:[{ml:[P]}],"space-x":[{"space-x":[ue]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ue]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[me]},me]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",me,he]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ht]}],"font-family":[{font:[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",Le,Ht]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ae,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[G]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ae,he]}],"underline-offset":[{"underline-offset":["auto",ae,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[G]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),xi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Si]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[G]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[G]}],"divide-style":[{divide:M()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[ae,F]}],"outline-w":[{outline:[ae,he]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[G]}],"ring-offset-w":[{"ring-offset":[ae,he]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",me,Ti]}],"shadow-color":[{shadow:[We]}],opacity:[{opacity:[G]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",me,F]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[v]}],saturate:[{saturate:[te]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[G]}],"backdrop-saturate":[{"backdrop-saturate":[te]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",F]}],duration:[{duration:b()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:b()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[ee]}],"scale-x":[{"scale-x":[ee]}],"scale-y":[{"scale-y":[ee]}],rotate:[{rotate:[Ke,F]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[ce]}],"skew-y":[{"skew-y":[ce]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ae,he,Ht]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};ui(Ni);K("<div style=overflow:visible>");K("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>");K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>');K('<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">');K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6"></path><path d="M11 13l9-9"></path><path d="M15 4h5v5">');K("<div><span>");Ee(["click"]);K("<span class=text-black/50>");K('<div role=button><div class="text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit"><span class=text-black>');Ee(["click"]);K('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-sm -mt-px">');K('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Yes');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Discard?');Ee(["pointerdown","click"]);K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4C7.58 4 4.01 7.58 4.01 12C4.01 16.42 7.58 20 12 20C15.73 20 18.84 17.45 19.73 14H17.65C16.83 16.33 14.61 18 12 18C8.69 18 6 15.31 6 12C6 8.69 8.69 6 12 6C13.66 6 15.14 6.69 16.22 7.78L13 11H20V4L17.65 6.35Z"fill=currentColor>');K('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Retry</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Ok');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-[#B91C1C] text-[13px] leading-4 font-sans font-medium">');Ee(["pointerdown","click"]);K('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Undo');K('<button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">');K('<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums"></span><div class="contain-layout shrink-0 flex items-center gap-[5px] h-fit">');K('<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">');K('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col justify-center items-end rounded-sm bg-white antialiased w-fit h-fit max-w-[280px]">');Ee(["pointerdown","click","input","keydown"]);K('<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-sm gap-[3px]"><span class="text-[13px] leading-4 font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse tabular-nums">');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">');K('<div class="shrink-0 flex items-center gap-0.5 w-full mb-0.5 overflow-hidden"><span class="text-[#a1a1aa] text-[10px] leading-3 shrink-0">>previously:</span><span class="text-[#a1a1aa] text-[10px] leading-3 italic truncate whitespace-nowrap">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="type prompt"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">');K('<div data-react-grab-ignore-events class="fixed font-sans text-[13px] antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-sm bg-white antialiased w-fit h-fit p-0">');Ee(["pointerdown","mousedown","click","pointerup","input","keydown"]);K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=currentColor><path opacity=0.4 d="M7.65631 10.9565C7.31061 10.0014 7.54012 8.96635 8.25592 8.25195C8.74522 7.76615 9.38771 7.49951 10.0694 7.49951C10.3682 7.49951 10.6641 7.55171 10.9483 7.65381L16.0001 9.49902V4.75C16.0001 3.2334 14.7667 2 13.2501 2H4.75012C3.23352 2 2.00012 3.2334 2.00012 4.75V13.25C2.00012 14.7666 3.23352 16 4.75012 16H9.49962L7.65631 10.9565Z"></path><path d="M17.296 11.5694L10.4415 9.06545C10.0431 8.92235 9.61441 9.01658 9.31551 9.31338C9.01671 9.61168 8.92101 10.0429 9.06551 10.4413L11.5704 17.2948C11.7247 17.7191 12.128 18.0004 12.5772 18.0004C12.585 18.0004 12.5918 17.9999 12.5987 17.9999C13.0577 17.9906 13.4591 17.6913 13.5987 17.2543L14.4854 14.4857L17.2559 13.5985C17.6914 13.4589 17.9903 13.057 18 12.599C18.0097 12.141 17.7267 11.7276 17.296 11.5694Z">');K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round><path d="m18 15-6-6-6 6">');K('<div data-react-grab-ignore-events style=z-index:2147483647><div><div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105"></button></div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105">');Ee(["pointerdown","pointermove","pointerup","click"]);var Mi="0.5.27",rr=`bippy-${Mi}`,$n=Object.defineProperty,ki=Object.prototype.hasOwnProperty,Ye=()=>{},or=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},ir=(e=Pe())=>"getFiberRoots"in e,sr=false,Hn,Ut=(e=Pe())=>sr?true:(typeof e.inject=="function"&&(Hn=e.inject.toString()),!!Hn?.includes("(injected)")),jt=new Set,Xe=new Set,Li=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:rr,checkDCE:or,hasUnsupportedRendererAttached:false,inject(o){let s=++n;return t.set(s,o),Xe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,jt.forEach(l=>l())),s},on:Ye,onCommitFiberRoot:Ye,onCommitFiberUnmount:Ye,onPostCommitFiberRoot:Ye,renderers:t,supportsFiber:true,supportsFlight:true};try{$n(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(l){if(l&&typeof l=="object"){let c=r.renderers;r=l,c.size>0&&(c.forEach((f,g)=>{Xe.add(f),l.renderers.set(g,f);}),Vt(e));}}});let o=window.hasOwnProperty,s=!1;$n(window,"hasOwnProperty",{configurable:!0,value:function(...l){try{if(!s&&l[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,s=!0,-0}catch{}return o.apply(this,l)},writable:!0});}catch{Vt(e);}return r},Vt=e=>{try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=or,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=rr,t._instrumentationIsActive=!1;let n=ir(t);if(n||(t.on=Ye),t.renderers.size){t._instrumentationIsActive=!0,jt.forEach(s=>s());return}let r=t.inject,o=Ut(t);o&&!n&&(sr=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=s=>{let l=r(s);return Xe.add(s),o&&t.renderers.set(l,s),t._instrumentationIsActive=!0,jt.forEach(c=>c()),l};}(t.renderers.size||t._instrumentationIsActive||Ut())&&e?.();}catch{}},Ii=()=>ki.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Pe=e=>Ii()?(Vt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Li(e),Oi=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Pi=()=>{try{Oi()&&Pe();}catch{}},Di=0,Ri=1,$i=5,Hi=11,Bi=13,Fi=15,zi=16,Ui=19,ji=26,Vi=27,Gi=28,Ki=30;function Wi(e,t,n=false){if(!e)return null;let r=t(e);if(r instanceof Promise)return (async()=>{if(await r===true)return e;let s=n?e.return:e.child;for(;s;){let l=await lr(s,t,n);if(l)return l;s=n?null:s.sibling;}return null})();if(r===true)return e;let o=n?e.return:e.child;for(;o;){let s=ar(o,t,n);if(s)return s;o=n?null:o.sibling;}return null}var ar=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=ar(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},lr=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await lr(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},cr=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?cr(t.type||t.render):null},Gt=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=cr(t);return r&&(r.displayName||r.name)||null},ur=()=>!!Pe()._instrumentationIsActive||ir()||Ut(),qi=e=>{let t=Pe();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Yi=Object.create,dr=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,Ji=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty,es=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ts=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Zi(t),s=0,l=o.length,c;s<l;s++)c=o[s],!Qi.call(e,c)&&c!==n&&dr(e,c,{get:(f=>t[f]).bind(null,c),enumerable:!(r=Xi(t,c))||r.enumerable});return e},ns=(e,t,n)=>(n=e==null?{}:Yi(Ji(e)),ts(dr(n,"default",{value:e,enumerable:true}),e)),Bn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,rs=["rsc://","file:///","webpack://","webpack-internal://","node:","turbopack://","metro://","/app-pages-browser/"],Fn="about://React/",os=["<anonymous>","eval",""],is=/\.(jsx|tsx|ts|js)$/,ss=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,as=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,pr="(at Server)",ls=/(^|@)\S+:\d+/,cs=/^\s*at .*(\S+:\d+|\(native\))/m,us=/^(eval@)?(\[native code\])?$/,fr=(e,t)=>{{let n=e.split(`
|
|
4
|
-
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let s=ds(o,void 0)[0];s&&r.push(s);}else if(/^\s*in\s+/.test(o)){let s=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({functionName:s,source:o});}else if(o.match(ls)){let s=ps(o,void 0)[0];s&&r.push(s);}return Wt(r,t)}},hr=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t
|
|
3
|
+
${v.message}`)}if(S){o.push(...c.actions),s=c;break}}return s?[s]:void 0}get events(){return Me(this,"events",()=>{let{states:t}=this,n=new Set(this.ownEvents);if(t)for(let r of Object.keys(t)){let o=t[r];if(o.states)for(let s of o.events)n.add(`${s}`);}return Array.from(n)})}get ownEvents(){let t=Object.keys(Object.fromEntries(this.transitions)),n=new Set(t.filter(r=>this.transitions.get(r).some(o=>!(!o.target&&!o.actions.length&&!o.reenter))));return Array.from(n)}},mo="#",st=class e{constructor(t,n){this.config=t,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=true,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=t.id||"(machine)",this.implementations={actors:n?.actors??{},actions:n?.actions??{},delays:n?.delays??{},guards:n?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new it(t,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events;}provide(t){let{actions:n,guards:r,actors:o,delays:s}=this.implementations;return new e(this.config,{actions:{...n,...t.actions},guards:{...r,...t.guards},actors:{...o,...t.actors},delays:{...s,...t.delays}})}resolveState(t){let n=Tn(this.root,t.value),r=Fe(Ue(this.root,n));return je({_nodes:[...r],context:t.context||{},children:{},status:nt(r,this.root)?"done":t.status||"active",output:t.output,error:t.error,historyValue:t.historyValue},this)}transition(t,n,r){return ot(t,n,r,[]).snapshot}microstep(t,n,r){return ot(t,n,r,[]).microstates}getTransitionData(t,n){return rt(this.root,t.value,t,n)||[]}getPreInitialState(t,n,r){let{context:o}=this.config,s=je({context:typeof o!="function"&&o?o:{},_nodes:[this.root],children:{},status:"active"},this);return typeof o=="function"?ve(s,n,t,[O(({spawn:c,event:f,self:g})=>o({spawn:c,input:f.input,self:g}))],r,void 0):s}getInitialSnapshot(t,n){let r=Nt(n),o=[],s=this.getPreInitialState(t,r,o),l=Qe([{target:[...It(this.root)],source:this.root,reenter:true,actions:[],eventType:null,toJSON:null}],s,t,r,true,o),{snapshot:c}=ot(l,r,t,o);return c}start(t){Object.values(t.children).forEach(n=>{n.getSnapshot().status==="active"&&n.start();});}getStateNodeById(t){let n=et(t),r=n.slice(1),o=ze(n[0])?n[0].slice(mo.length):n[0],s=this.idMap.get(o);if(!s)throw new Error(`Child state node '#${o}' does not exist on machine '${this.id}'`);return De(s,r)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(t,n){return Cn(t,n)}restoreSnapshot(t,n){let r={},o=t.children;Object.keys(o).forEach(v=>{let m=o[v],x=m.snapshot,A=m.src,L=typeof A=="string"?Re(this,A):A;if(!L)return;let P=we(L,{id:v,parent:n.self,syncSnapshot:m.syncSnapshot,snapshot:x,src:A,systemId:m.systemId});r[v]=P;});function s(v,m){if(m instanceof it)return m;try{return v.machine.getStateNodeById(m.id)}catch{}}function l(v,m){if(!m||typeof m!="object")return {};let x={};for(let A in m){let L=m[A];for(let P of L){let G=s(v,P);G&&(x[A]??=[],x[A].push(G));}}return x}let c=l(this.root,t.historyValue),f=je({...t,children:r,_nodes:Array.from(Fe(Ue(this.root,t.value))),historyValue:c},this),g=new Set;function S(v,m){if(!g.has(v)){g.add(v);for(let x in v){let A=v[x];if(A&&typeof A=="object"){if("xstate$$type"in A&&A.xstate$$type===tt){v[x]=m[A.id];continue}S(A,m);}}}}return S(f.context,r),f}};function go(e,t,n,r,{event:o}){let s=typeof o=="function"?o(n,r):o;return [t,{event:s},void 0]}function bo(e,{event:t}){e.defer(()=>e.emit(t));}function Dt(e){function t(n,r){}return t.type="xstate.emit",t.event=e,t.resolve=go,t.execute=bo,t}var Pt=(function(e){return e.Parent="#_parent",e.Internal="#_internal",e})({});function yo(e,t,n,r,{to:o,event:s,id:l,delay:c},f){let g=t.machine.implementations.delays;if(typeof s=="string")throw new Error(`Only event objects may be used with sendTo; use sendTo({ type: "${s}" }) instead`);let S=typeof s=="function"?s(n,r):s,v;if(typeof c=="string"){let A=g&&g[c];v=typeof A=="function"?A(n,r):A;}else v=typeof c=="function"?c(n,r):c;let m=typeof o=="function"?o(n,r):o,x;if(typeof m=="string"){if(m===Pt.Parent?x=e.self._parent:m===Pt.Internal?x=e.self:m.startsWith("#_")?x=t.children[m.slice(2)]:x=f.deferredActorIds?.includes(m)?m:t.children[m],!x)throw new Error(`Unable to send event to actor '${m}' from machine '${t.machine.id}'.`)}else x=m||e.self;return [t,{to:x,targetId:typeof m=="string"?m:void 0,event:S,id:l,delay:v},void 0]}function vo(e,t,n){typeof n.to=="string"&&(n.to=t.children[n.to]);}function wo(e,t){e.defer(()=>{let{to:n,event:r,delay:o,id:s}=t;if(typeof o=="number"){e.system.scheduler.schedule(e.self,n,r,o,s);return}e.system._relay(e.self,n,r.type===sn?At(e.self.id,r.data):r);});}function at(e,t,n){function r(o,s){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=yo,r.retryResolve=vo,r.execute=wo,r}function xo(e,t){return at(Pt.Parent,e,t)}function Eo(e,t,n,r,{collect:o}){let s=[],l=function(f){s.push(f);};return l.assign=(...c)=>{s.push(O(...c));},l.cancel=(...c)=>{s.push($e(...c));},l.raise=(...c)=>{s.push(Ve(...c));},l.sendTo=(...c)=>{s.push(at(...c));},l.sendParent=(...c)=>{s.push(xo(...c));},l.spawnChild=(...c)=>{s.push(He(...c));},l.stopChild=(...c)=>{s.push(Ae(...c));},l.emit=(...c)=>{s.push(Dt(...c));},o({context:n.context,event:n.event,enqueue:l,check:c=>Ne(c,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,s]}function Mn(e){function t(n,r){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=Eo,t}function So(e,t,n,r,{value:o,label:s}){return [t,{value:typeof o=="function"?o(n,r):o,label:s},void 0]}function To({logger:e},{value:t,label:n}){n?e(n,t):e(t);}function kn(e=({context:n,event:r})=>({context:n,event:r}),t){function n(r,o){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=So,n.execute=To,n}function Co(e,t){return new st(e,t)}function Rt({schemas:e,actors:t,actions:n,guards:r,delays:o}){return {assign:O,sendTo:at,raise:Ve,log:kn,cancel:$e,stopChild:Ae,enqueueActions:Mn,emit:Dt,spawnChild:He,createStateConfig:s=>s,createAction:s=>s,createMachine:s=>Co({...s,schemas:e},{actors:t,actions:n,guards:r,delays:o}),extend:s=>Rt({schemas:e,actors:t,actions:{...n,...s.actions},guards:{...r,...s.guards},delays:{...o,...s.delays}})}}var _o=(e,t)=>e===t,Ln={equals:_o},Ao=qn,Ie=1,ut=2;var ct=null,ke=null,In=null,X=null,J=null,xe=null,ft=0;function No(e,t){t=t?Object.assign({},Ln,t):Ln;let n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=o=>(typeof o=="function"&&(o=o(n.value)),Gn(n,o));return [ko.bind(n),r]}function Mo(e){if(X===null)return e();let t=X;X=null;try{return In?In.untrack(e):e()}finally{X=t;}}No(false);function ko(){let e=ke;if(this.sources&&this.state)if(this.state===Ie)Kn(this);else {let t=J;J=null,ht(()=>dt(this)),J=t;}if(X){let t=this.observers?this.observers.length:0;X.sources?(X.sources.push(this),X.sourceSlots.push(t)):(X.sources=[this],X.sourceSlots=[t]),this.observers?(this.observers.push(X),this.observerSlots.push(X.sources.length-1)):(this.observers=[X],this.observerSlots=[X.sources.length-1]);}return e&&ke.sources.has(this)?this.tValue:this.value}function Gn(e,t,n){let r=e.value;return (!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&ht(()=>{for(let o=0;o<e.observers.length;o+=1){let s=e.observers[o],l=ke&&ke.running;l&&ke.disposed.has(s)||((l?!s.tState:!s.state)&&(s.pure?J.push(s):xe.push(s),s.observers&&Yn(s)),l?s.tState=Ie:s.state=Ie);}if(J.length>1e6)throw J=[],new Error})),t}function Kn(e){if(!e.fn)return;pt(e);let t=ft;Lo(e,e.value,t);}function Lo(e,t,n){let r,o=ct,s=X;X=ct=e;try{r=e.fn(t);}catch(l){return e.pure&&(e.state=Ie,e.owned&&e.owned.forEach(pt),e.owned=null),e.updatedAt=n+1,Xn(l)}finally{X=s,ct=o;}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?Gn(e,r):e.value=r,e.updatedAt=n);}function Wn(e){if(e.state===0)return;if(e.state===ut)return dt(e);if(e.suspense&&Mo(e.suspense.inFallback))return e.suspense.effects.push(e);let n=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt<ft);)e.state&&n.push(e);for(let r=n.length-1;r>=0;r--)if(e=n[r],e.state===Ie)Kn(e);else if(e.state===ut){let o=J;J=null,ht(()=>dt(e,n[0])),J=o;}}function ht(e,t){if(J)return e();let n=false;(J=[]),xe?n=true:xe=[],ft++;try{let r=e();return Io(n),r}catch(r){n||(xe=null),J=null,Xn(r);}}function Io(e){if(J&&(qn(J),J=null),e)return;let t=xe;xe=null,t.length&&ht(()=>Ao(t));}function qn(e){for(let t=0;t<e.length;t++)Wn(e[t]);}function dt(e,t){e.state=0;for(let n=0;n<e.sources.length;n+=1){let r=e.sources[n];if(r.sources){let o=r.state;o===Ie?r!==t&&(!r.updatedAt||r.updatedAt<ft)&&Wn(r):o===ut&&dt(r,t);}}}function Yn(e){for(let t=0;t<e.observers.length;t+=1){let n=e.observers[t];!n.state&&(n.state=ut,n.pure?J.push(n):xe.push(n),n.observers&&Yn(n));}}function pt(e){let t;if(e.sources)for(;e.sources.length;){let n=e.sources.pop(),r=e.sourceSlots.pop(),o=n.observers;if(o&&o.length){let s=o.pop(),l=n.observerSlots.pop();r<o.length&&(s.sourceSlots[l]=r,o[r]=s,n.observerSlots[r]=l);}}if(e.tOwned){for(t=e.tOwned.length-1;t>=0;t--)pt(e.tOwned[t]);delete e.tOwned;}if(e.owned){for(t=e.owned.length-1;t>=0;t--)pt(e.owned[t]);e.owned=null;}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null;}e.state=0;}function Oo(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function Xn(e,t=ct){throw Oo(e)}var On="_$DX_DELEGATE";function K(e,t,n,r){let o,s=()=>{let c=document.createElement("template");return c.innerHTML=e,c.content.firstChild},l=()=>(o||(o=s())).cloneNode(true);return l.cloneNode=l,l}function Ee(e,t=window.document){let n=t[On]||(t[On]=new Set);for(let r=0,o=e.length;r<o;r++){let s=e[r];n.has(s)||(n.add(s),t.addEventListener(s,Po));}}function Po(e){let t=e.target,n=`$$${e.type}`,r=e.target,o=e.currentTarget,s=f=>Object.defineProperty(e,"target",{configurable:true,value:f}),l=()=>{let f=t[n];if(f&&!t.disabled){let g=t[`${n}Data`];if(g!==void 0?f.call(t,g,e):f.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&s(t.host),true},c=()=>{for(;l()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:true,get(){return t||document}}),e.composedPath){let f=e.composedPath();s(f[0]);for(let g=0;g<f.length-2&&(t=f[g],!!l());g++){if(t._$host){t=t._$host,c();break}if(t.parentNode===o)break}}else c();s(r);}var Do="0.0.97";var Ro=e=>typeof e=="number"&&!Number.isNaN(e)&&Number.isFinite(e),$o=e=>{let t=e.trim();if(!t)return null;let n=parseFloat(t);return Ro(n)?n:null},Pn=(e,t)=>{let n=e.split(",");if(n.length!==t)return null;let r=[];for(let o of n){let s=$o(o);if(s===null)return null;r.push(s);}return r},Zn=(e,t,n,r)=>e===1&&t===0&&n===0&&r===1,Ho=e=>e[0]===1&&e[1]===0&&e[2]===0&&e[3]===0&&e[4]===0&&e[5]===1&&e[6]===0&&e[7]===0&&e[8]===0&&e[9]===0&&e[10]===1&&e[11]===0&&e[15]===1,Bo=e=>{if(!e||e==="none")return "none";if(e.charCodeAt(0)===109)if(e.charCodeAt(6)===51){let t=e.length-1,n=Pn(e.slice(9,t),16);if(n)return n[12]=0,n[13]=0,n[14]=0,Ho(n)?"none":`matrix3d(${n[0]}, ${n[1]}, ${n[2]}, ${n[3]}, ${n[4]}, ${n[5]}, ${n[6]}, ${n[7]}, ${n[8]}, ${n[9]}, ${n[10]}, ${n[11]}, 0, 0, 0, ${n[15]})`}else {let t=e.length-1,n=Pn(e.slice(7,t),6);if(n){let r=n[0],o=n[1],s=n[2],l=n[3];return Zn(r,o,s,l)?"none":`matrix(${r}, ${o}, ${s}, ${l}, 0, 0)`}}return "none"},Fo=e=>e.isIdentity?"none":e.is2D?Zn(e.a,e.b,e.c,e.d)?"none":`matrix(${e.a}, ${e.b}, ${e.c}, ${e.d}, 0, 0)`:e.m11===1&&e.m12===0&&e.m13===0&&e.m14===0&&e.m21===0&&e.m22===1&&e.m23===0&&e.m24===0&&e.m31===0&&e.m32===0&&e.m33===1&&e.m34===0&&e.m44===1?"none":`matrix3d(${e.m11}, ${e.m12}, ${e.m13}, ${e.m14}, ${e.m21}, ${e.m22}, ${e.m23}, ${e.m24}, ${e.m31}, ${e.m32}, ${e.m33}, ${e.m34}, 0, 0, 0, ${e.m44})`,zo=6,Uo=3,jo=(e,t)=>{let n=t&&t!=="none",r=null,o=e.parentElement,s=0;for(;o&&o!==document.documentElement&&s<zo;){let l=window.getComputedStyle(o).transform;if(l&&l!=="none")r=r?new DOMMatrix(l).multiply(r):new DOMMatrix(l);else if(!n&&!r&&s>=Uo)return "none";o=o.parentElement,s++;}return r?(n&&(r=r.multiply(new DOMMatrix(t))),Fo(r)):n?Bo(t):"none"},$t=e=>{let t=e.getBoundingClientRect(),n=window.getComputedStyle(e),r=jo(e,n.transform);if(r!=="none"&&e instanceof HTMLElement){let o=e.offsetWidth,s=e.offsetHeight;if(o>0&&s>0){let l=t.left+t.width*.5,c=t.top+t.height*.5;return {borderRadius:n.borderRadius||"0px",height:s,transform:r,width:o,x:l-o*.5,y:c-s*.5}}}return {borderRadius:n.borderRadius||"0px",height:t.height,transform:r,width:t.width,x:t.left,y:t.top}},Vo=e=>({isToggleMode:false,hasAgentProvider:false,keyHoldDuration:200,mousePosition:{x:-1e3,y:-1e3},dragStart:{x:-1e3,y:-1e3},copyStart:{x:-1e3,y:-1e3},copyOffsetFromCenterX:0,detectedElement:null,frozenElement:null,frozenElements:[],lastGrabbedElement:null,lastCopiedElement:null,selectionFilePath:null,selectionLineNumber:null,inputText:"",pendingClickData:null,replySessionId:null,viewportVersion:0,grabbedBoxes:[],labelInstances:[],agentSessions:new Map,sessionElements:new Map,abortControllers:new Map,isTouchMode:false,theme:e,activationTimestamp:null,previouslyFocusedElement:null,canUndo:false,canRedo:false,isAgentConnected:false,supportsUndo:false,supportsFollowUp:false,dismissButtonText:void 0,pendingAbortSessionId:null}),Go=({context:e})=>e.hasAgentProvider,Ko=({context:e})=>e.frozenElement!==null||e.detectedElement!==null,Wo=({context:e})=>e.inputText.trim().length>0,qo=({context:e})=>e.isToggleMode,Yo=({context:e})=>e.pendingClickData!==null,Xo=({context:e})=>Array.from(e.agentSessions.values()).some(t=>t.isStreaming),Zo=({context:e})=>e.lastCopiedElement!==null&&document.contains(e.lastCopiedElement);Rt({delays:{KEY_HOLD_DURATION:({context:e})=>e.keyHoldDuration,DOUBLE_CLICK_THRESHOLD:250,SUCCESS_LABEL_DURATION:1700,COPIED_LABEL_DURATION:1500},guards:{hasAgentProvider:Go,hasElement:Ko,hasInputText:Wo,isToggleMode:qo,hasPendingClick:Yo,isAgentStreaming:Xo,hasLastCopiedElement:Zo},actions:{setMousePosition:O({mousePosition:({event:e})=>e.type==="MOUSE_MOVE"?e.position:{x:-1e3,y:-1e3}}),setDetectedElement:O({detectedElement:({event:e})=>e.type==="ELEMENT_DETECTED"?e.element:null}),setFrozenElement:O({frozenElement:({event:e})=>e.type==="FREEZE_ELEMENT"?e.element:null,frozenElements:({event:e})=>e.type==="FREEZE_ELEMENT"?[e.element]:[]}),setFrozenElements:O({frozenElements:({event:e})=>e.type==="FREEZE_ELEMENTS"?e.elements:[],frozenElement:({event:e})=>e.type==="FREEZE_ELEMENTS"&&e.elements.length>0?e.elements[0]:null}),clearFrozenElement:O({frozenElement:()=>null,frozenElements:()=>[]}),setDragStart:O({dragStart:({event:e})=>e.type==="DRAG_START"?{x:e.position.x+window.scrollX,y:e.position.y+window.scrollY}:{x:-1e3,y:-1e3}}),resetDragStart:O({dragStart:()=>({x:-1e3,y:-1e3})}),setCopyStart:O({copyStart:({event:e})=>e.type==="SET_COPY_START"?e.position:{x:-1e3,y:-1e3},copyOffsetFromCenterX:({event:e})=>{if(e.type==="SET_COPY_START"&&e.element){let t=$t(e.element),n=t.x+t.width/2;return e.position.x-n}return 0}}),setInputText:O({inputText:({event:e})=>e.type==="INPUT_CHANGE"?e.value:""}),clearInputText:O({inputText:()=>""}),enableToggleMode:O({isToggleMode:()=>true}),disableToggleMode:O({isToggleMode:()=>false}),setToggleMode:O({isToggleMode:({event:e})=>e.type==="SET_TOGGLE_MODE"?e.value:false}),setLastGrabbedElement:O({lastGrabbedElement:({event:e})=>e.type==="SET_LAST_GRABBED"?e.element:null}),setLastCopiedElement:O({lastCopiedElement:({event:e})=>e.type==="SET_LAST_COPIED"||e.type==="COPY_DONE"?e.element??null:null}),clearLastCopiedElement:O({lastCopiedElement:()=>null}),incrementViewportVersion:O({viewportVersion:({context:e})=>e.viewportVersion+1}),addGrabbedBox:O({grabbedBoxes:({context:e,event:t})=>t.type==="ADD_GRABBED_BOX"?[...e.grabbedBoxes,t.box]:e.grabbedBoxes}),removeGrabbedBox:O({grabbedBoxes:({context:e,event:t})=>t.type==="REMOVE_GRABBED_BOX"?e.grabbedBoxes.filter(n=>n.id!==t.boxId):e.grabbedBoxes}),clearGrabbedBoxes:O({grabbedBoxes:()=>[]}),addLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="ADD_LABEL_INSTANCE"?[...e.labelInstances,t.instance]:e.labelInstances}),updateLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="UPDATE_LABEL_INSTANCE"?e.labelInstances.map(n=>n.id===t.instanceId?{...n,status:t.status}:n):e.labelInstances}),removeLabelInstance:O({labelInstances:({context:e,event:t})=>t.type==="REMOVE_LABEL_INSTANCE"?e.labelInstances.filter(n=>n.id!==t.instanceId):e.labelInstances}),clearLabelInstances:O({labelInstances:()=>[]}),setTouchMode:O({isTouchMode:({event:e})=>e.type==="SET_TOUCH_MODE"?e.value:false}),setSelectionSource:O({selectionFilePath:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.filePath:null,selectionLineNumber:({event:e})=>e.type==="SET_SELECTION_SOURCE"?e.lineNumber:null}),clearSelectionSource:O({selectionFilePath:()=>null,selectionLineNumber:()=>null}),setPendingClickData:O({pendingClickData:({event:e})=>e.type==="SET_PENDING_CLICK"?e.data:null}),clearPendingClickData:O({pendingClickData:()=>null}),setReplySessionId:O({replySessionId:({event:e})=>e.type==="SET_REPLY_SESSION"?e.sessionId:null}),clearReplySessionId:O({replySessionId:()=>null}),addAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.agentSessions;let n=new Map(e.agentSessions);return n.set(t.sessionId,t.session),n}}),setSessionElement:O({sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_START")return e.sessionElements;let n=new Map(e.sessionElements);return n.set(t.sessionId,t.element),n}}),updateAgentSessionStatus:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_STATUS")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,lastStatus:t.status}),r}}),completeAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_DONE")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,lastStatus:t.status??n.lastStatus}),r}}),setAgentSessionError:O({agentSessions:({context:e,event:t})=>{if(t.type!=="STREAM_ERROR")return e.agentSessions;let n=e.agentSessions.get(t.sessionId);if(!n)return e.agentSessions;let r=new Map(e.agentSessions);return r.set(t.sessionId,{...n,isStreaming:false,error:t.error}),r}}),removeAgentSession:O({agentSessions:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.agentSessions;let n=new Map(e.agentSessions);return n.delete(t.sessionId),n},sessionElements:({context:e,event:t})=>{if(t.type!=="SESSION_DISMISS"&&t.type!=="ERROR_ACKNOWLEDGE")return e.sessionElements;let n=new Map(e.sessionElements);return n.delete(t.sessionId),n}}),storeActivationTimestamp:O({activationTimestamp:()=>Date.now(),previouslyFocusedElement:()=>document.activeElement}),clearActivationTimestamp:O({activationTimestamp:()=>null,previouslyFocusedElement:()=>null}),setKeyHoldDuration:O({keyHoldDuration:({event:e,context:t})=>e.type==="HOLD_START"&&e.duration!==void 0?e.duration:t.keyHoldDuration}),setHasAgentProvider:O({hasAgentProvider:({event:e})=>e.type==="SET_HAS_AGENT_PROVIDER"?e.value:false}),setUndoRedoState:O({canUndo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canUndo:false,canRedo:({event:e})=>e.type==="SET_UNDO_REDO_STATE"?e.canRedo:false}),setAgentCapabilities:O({supportsUndo:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsUndo:false,supportsFollowUp:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.supportsFollowUp:false,dismissButtonText:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.dismissButtonText:void 0,isAgentConnected:({event:e})=>e.type==="SET_AGENT_CAPABILITIES"?e.isAgentConnected:false}),setPendingAbortSessionId:O({pendingAbortSessionId:({event:e})=>e.type==="SET_PENDING_ABORT_SESSION"?e.sessionId:null}),resetActivationState:O({isToggleMode:()=>false,inputText:()=>"",frozenElement:()=>null,frozenElements:()=>[],pendingClickData:()=>null,activationTimestamp:()=>null}),updateSessionBounds:O({agentSessions:({context:e})=>{if(e.agentSessions.size===0)return e.agentSessions;let t=new Map(e.agentSessions),n=false;for(let[r,o]of e.agentSessions){let s=e.sessionElements.get(r);if(s&&document.contains(s)){let l=$t(s),c=o.selectionBounds[0],f=o.position;if(c){let g=c.x+c.width/2,S=o.position.x-g,v=l.x+l.width/2;f={...o.position,x:v+S};}t.set(r,{...o,selectionBounds:[l],position:f}),n=true;}}return n?t:e.agentSessions}}),freezeCurrentElement:O({frozenElement:({context:e})=>e.frozenElement??e.detectedElement}),saveInputModePosition:O({copyStart:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.copyStart,copyOffsetFromCenterX:({event:e})=>{if(e.type==="INPUT_MODE_ENTER"&&e.element){let t=$t(e.element),n=t.x+t.width/2;return e.position.x-n}return 0},mousePosition:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.position:t.mousePosition,frozenElement:({event:e,context:t})=>e.type==="INPUT_MODE_ENTER"?e.element:t.frozenElement})}}).createMachine({id:"grabMachine",type:"parallel",context:({input:e})=>({...Vo(e.theme),hasAgentProvider:e.hasAgentProvider,keyHoldDuration:e.keyHoldDuration}),states:{activation:{initial:"idle",states:{idle:{on:{HOLD_START:{target:"holding",actions:["setKeyHoldDuration"]},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},holding:{after:{KEY_HOLD_DURATION:{target:"active",actions:["storeActivationTimestamp"]}},on:{RELEASE:{target:"idle"},ACTIVATE:{target:"active",actions:["enableToggleMode","storeActivationTimestamp"]}}},active:{initial:"hovering",states:{hovering:{on:{FREEZE:{target:"frozen",actions:["freezeCurrentElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},frozen:{on:{UNFREEZE:{target:"hovering",actions:["clearFrozenElement"]},DRAG_START:{target:"dragging",actions:["setDragStart"]}}},dragging:{on:{DRAG_END:{target:"justDragged",actions:["resetDragStart"]},DRAG_CANCEL:{target:"hovering",actions:["resetDragStart"]}}},justDragged:{on:{DRAG_START:{target:"dragging",actions:["setDragStart"]}},after:{SUCCESS_LABEL_DURATION:{target:"hovering"}}}},on:{DEACTIVATE:{target:"idle",actions:["resetActivationState","clearActivationTimestamp"]},MOUSE_MOVE:{actions:["setMousePosition"]},ELEMENT_DETECTED:{actions:["setDetectedElement"]},SET_TOUCH_MODE:{actions:["setTouchMode"]},SET_SELECTION_SOURCE:{actions:["setSelectionSource"]}}}},on:{TOGGLE:[{guard:({context:e})=>e.activationTimestamp!==null,target:".idle",actions:["resetActivationState","clearActivationTimestamp"]},{target:".active",actions:["enableToggleMode","storeActivationTimestamp"]}],VIEWPORT_CHANGE:{actions:["incrementViewportVersion","updateSessionBounds"]},ADD_GRABBED_BOX:{actions:["addGrabbedBox"]},REMOVE_GRABBED_BOX:{actions:["removeGrabbedBox"]},CLEAR_GRABBED_BOXES:{actions:["clearGrabbedBoxes"]},SET_LAST_GRABBED:{actions:["setLastGrabbedElement"]},SET_LAST_COPIED:{actions:["setLastCopiedElement"]},SET_HAS_AGENT_PROVIDER:{actions:["setHasAgentProvider"]},SET_UNDO_REDO_STATE:{actions:["setUndoRedoState"]},SET_AGENT_CAPABILITIES:{actions:["setAgentCapabilities"]},SET_TOGGLE_MODE:{actions:["setToggleMode"]},FREEZE_ELEMENT:{actions:["setFrozenElement"]},FREEZE_ELEMENTS:{actions:["setFrozenElements"]},SET_PENDING_ABORT_SESSION:{actions:["setPendingAbortSessionId"]}}},interaction:{initial:"idle",states:{idle:{on:{CLICK:{target:"awaitingDoubleClick",actions:["setPendingClickData"]},INPUT_MODE_ENTER:{target:"inputMode",actions:["saveInputModePosition","enableToggleMode"]},COPY_START:{target:"copying"}}},awaitingDoubleClick:{after:{DOUBLE_CLICK_THRESHOLD:{target:"copying"}},on:{DOUBLE_CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]},CLICK:{target:"inputMode",guard:"hasAgentProvider",actions:["clearPendingClickData","saveInputModePosition"]}}},copying:{on:{COPY_DONE:{target:"justCopied",actions:["clearPendingClickData","setLastCopiedElement"]}}},justCopied:{after:{COPIED_LABEL_DURATION:{target:"idle"}}},inputMode:{initial:"typing",states:{typing:{on:{ESC:[{target:"confirmingDismiss",guard:"hasInputText"},{target:"#grabMachine.interaction.idle"}],INPUT_SUBMIT:{target:"#grabMachine.interaction.copying"}}},confirmingDismiss:{on:{CANCEL_DISMISS:{target:"typing"},CONFIRM_DISMISS:{target:"#grabMachine.interaction.idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{INPUT_CHANGE:{actions:["setInputText"]},INPUT_CANCEL:{target:"idle",actions:["clearInputText","clearReplySessionId"]}}}},on:{ADD_LABEL_INSTANCE:{actions:["addLabelInstance"]},UPDATE_LABEL_INSTANCE:{actions:["updateLabelInstance"]},REMOVE_LABEL_INSTANCE:{actions:["removeLabelInstance"]},SET_COPY_START:{actions:["setCopyStart"]},SET_PENDING_CLICK:{actions:["setPendingClickData"]},SET_REPLY_SESSION:{actions:["setReplySessionId"]},DEACTIVATE:{target:".idle",actions:["clearInputText","clearReplySessionId","clearPendingClickData"]}}},agentSessions:{initial:"idle",states:{idle:{on:{SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},streaming:{on:{STREAM_STATUS:{actions:["updateAgentSessionStatus"]},STREAM_DONE:{target:"completed",actions:["completeAgentSession"]},STREAM_ERROR:{target:"error",actions:["setAgentSessionError"]},SESSION_ABORT:{target:"idle",actions:["removeAgentSession"]}}},completed:{on:{SESSION_DISMISS:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}},error:{on:{ERROR_ACKNOWLEDGE:{target:"idle",actions:["removeAgentSession"]},SESSION_START:{target:"streaming",actions:["addAgentSession","setSessionElement"]}}}},on:{UPDATE_SESSION_BOUNDS:{actions:["updateSessionBounds"]}}}}});var Kt="-",Jo=e=>{let t=ei(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return {getClassGroupId:o=>{let s=o.split(Kt);return s[0]===""&&s.length!==1&&s.shift(),Jn(s,t)||Qo(o)},getConflictingClassGroupIds:(o,s)=>{let l=n[o]||[];return s&&r[o]?[...l,...r[o]]:l}}},Jn=(e,t)=>{if(e.length===0)return t.classGroupId;let n=e[0],r=t.nextPart.get(n),o=r?Jn(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;let s=e.join(Kt);return t.validators.find(({validator:l})=>l(s))?.classGroupId},Dn=/^\[(.+)\]$/,Qo=e=>{if(Dn.test(e)){let t=Dn.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return "arbitrary.."+n}},ei=e=>{let{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return ni(Object.entries(e.classGroups),n).forEach(([o,s])=>{zt(s,r,o,t);}),r},zt=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){let s=o===""?t:Rn(t,o);s.classGroupId=n;return}if(typeof o=="function"){if(ti(o)){zt(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([s,l])=>{zt(l,Rn(t,s),n,r);});});},Rn=(e,t)=>{let n=e;return t.split(Kt).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r);}),n},ti=e=>e.isThemeGetter,ni=(e,t)=>t?e.map(([n,r])=>{let o=r.map(s=>typeof s=="string"?t+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,c])=>[t+l,c])):s);return [n,o]}):e,ri=e=>{if(e<1)return {get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map,o=(s,l)=>{n.set(s,l),t++,t>e&&(t=0,r=n,n=new Map);};return {get(s){let l=n.get(s);if(l!==void 0)return l;if((l=r.get(s))!==void 0)return o(s,l),l},set(s,l){n.has(s)?n.set(s,l):o(s,l);}}},Qn="!",oi=e=>{let{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],s=t.length,l=c=>{let f=[],g=0,S=0,v;for(let P=0;P<c.length;P++){let G=c[P];if(g===0){if(G===o&&(r||c.slice(P,P+s)===t)){f.push(c.slice(S,P)),S=P+s;continue}if(G==="/"){v=P;continue}}G==="["?g++:G==="]"&&g--;}let m=f.length===0?c:c.substring(S),x=m.startsWith(Qn),A=x?m.substring(1):m,L=v&&v>S?v-S:void 0;return {modifiers:f,hasImportantModifier:x,baseClassName:A,maybePostfixModifierPosition:L}};return n?c=>n({className:c,parseClassName:l}):l},ii=e=>{if(e.length<=1)return e;let t=[],n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r);}),t.push(...n.sort()),t},si=e=>({cache:ri(e.cacheSize),parseClassName:oi(e),...Jo(e)}),ai=/\s+/,li=(e,t)=>{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,s=[],l=e.trim().split(ai),c="";for(let f=l.length-1;f>=0;f-=1){let g=l[f],{modifiers:S,hasImportantModifier:v,baseClassName:m,maybePostfixModifierPosition:x}=n(g),A=!!x,L=r(A?m.substring(0,x):m);if(!L){if(!A){c=g+(c.length>0?" "+c:c);continue}if(L=r(m),!L){c=g+(c.length>0?" "+c:c);continue}A=false;}let P=ii(S).join(":"),G=v?P+Qn:P,W=G+L;if(s.includes(W))continue;s.push(W);let te=o(L,A);for(let ee=0;ee<te.length;++ee){let Z=te[ee];s.push(G+Z);}c=g+(c.length>0?" "+c:c);}return c};function ci(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=er(t))&&(r&&(r+=" "),r+=n);return r}var er=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=er(e[r]))&&(n&&(n+=" "),n+=t);return n};function ui(e,...t){let n,r,o,s=l;function l(f){let g=t.reduce((S,v)=>v(S),e());return n=si(g),r=n.cache.get,o=n.cache.set,s=c,c(f)}function c(f){let g=r(f);if(g)return g;let S=li(f,n);return o(f,S),S}return function(){return s(ci.apply(null,arguments))}}var q=e=>{let t=n=>n[e]||[];return t.isThemeGetter=true,t},tr=/^\[(?:([a-z-]+):)?(.+)\]$/i,di=/^\d+\/\d+$/,pi=new Set(["px","full","screen"]),fi=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,hi=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,mi=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,gi=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,bi=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,ae=e=>Le(e)||pi.has(e)||di.test(e),he=e=>Oe(e,"length",Ci),Le=e=>!!e&&!Number.isNaN(Number(e)),Ht=e=>Oe(e,"number",Le),Ke=e=>!!e&&Number.isInteger(Number(e)),yi=e=>e.endsWith("%")&&Le(e.slice(0,-1)),F=e=>tr.test(e),me=e=>fi.test(e),vi=new Set(["length","size","percentage"]),wi=e=>Oe(e,vi,nr),xi=e=>Oe(e,"position",nr),Ei=new Set(["image","url"]),Si=e=>Oe(e,Ei,Ai),Ti=e=>Oe(e,"",_i),We=()=>true,Oe=(e,t,n)=>{let r=tr.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):false},Ci=e=>hi.test(e)&&!mi.test(e),nr=()=>false,_i=e=>gi.test(e),Ai=e=>bi.test(e),Ni=()=>{let e=q("colors"),t=q("spacing"),n=q("blur"),r=q("brightness"),o=q("borderColor"),s=q("borderRadius"),l=q("borderSpacing"),c=q("borderWidth"),f=q("contrast"),g=q("grayscale"),S=q("hueRotate"),v=q("invert"),m=q("gap"),x=q("gradientColorStops"),A=q("gradientColorStopPositions"),L=q("inset"),P=q("margin"),G=q("opacity"),W=q("padding"),te=q("saturate"),ee=q("scale"),Z=q("sepia"),ce=q("skew"),ue=q("space"),R=q("translate"),j=()=>["auto","contain","none"],H=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",F,t],E=()=>[F,t],y=()=>["",ae,he],T=()=>["auto",Le,F],k=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],M=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],$=()=>["start","end","center","between","around","evenly","stretch"],V=()=>["","0",F],z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],b=()=>[Le,F];return {cacheSize:500,separator:":",theme:{colors:[We],spacing:[ae,he],blur:["none","",me,F],brightness:b(),borderColor:[e],borderRadius:["none","","full",me,F],borderSpacing:E(),borderWidth:y(),contrast:b(),grayscale:V(),hueRotate:b(),invert:V(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[yi,he],inset:N(),margin:N(),opacity:b(),padding:E(),saturate:b(),scale:b(),sepia:V(),skew:b(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",F]}],container:["container"],columns:[{columns:[me]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...k(),F]}],overflow:[{overflow:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:j()}],"overscroll-x":[{"overscroll-x":j()}],"overscroll-y":[{"overscroll-y":j()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Ke,F]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",F]}],grow:[{grow:V()}],shrink:[{shrink:V()}],order:[{order:["first","last","none",Ke,F]}],"grid-cols":[{"grid-cols":[We]}],"col-start-end":[{col:["auto",{span:["full",Ke,F]},F]}],"col-start":[{"col-start":T()}],"col-end":[{"col-end":T()}],"grid-rows":[{"grid-rows":[We]}],"row-start-end":[{row:["auto",{span:[Ke,F]},F]}],"row-start":[{"row-start":T()}],"row-end":[{"row-end":T()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",F]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",F]}],gap:[{gap:[m]}],"gap-x":[{"gap-x":[m]}],"gap-y":[{"gap-y":[m]}],"justify-content":[{justify:["normal",...$()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...$(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...$(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[W]}],px:[{px:[W]}],py:[{py:[W]}],ps:[{ps:[W]}],pe:[{pe:[W]}],pt:[{pt:[W]}],pr:[{pr:[W]}],pb:[{pb:[W]}],pl:[{pl:[W]}],m:[{m:[P]}],mx:[{mx:[P]}],my:[{my:[P]}],ms:[{ms:[P]}],me:[{me:[P]}],mt:[{mt:[P]}],mr:[{mr:[P]}],mb:[{mb:[P]}],ml:[{ml:[P]}],"space-x":[{"space-x":[ue]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ue]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",F,t]}],"min-w":[{"min-w":[F,t,"min","max","fit"]}],"max-w":[{"max-w":[F,t,"none","full","min","max","fit","prose",{screen:[me]},me]}],h:[{h:[F,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[F,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[F,t,"auto","min","max","fit"]}],"font-size":[{text:["base",me,he]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ht]}],"font-family":[{font:[We]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",F]}],"line-clamp":[{"line-clamp":["none",Le,Ht]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",ae,F]}],"list-image":[{"list-image":["none",F]}],"list-style-type":[{list:["none","disc","decimal",F]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[G]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...M(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",ae,he]}],"underline-offset":[{"underline-offset":["auto",ae,F]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",F]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",F]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[G]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...k(),xi]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",wi]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Si]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[A]}],"gradient-via-pos":[{via:[A]}],"gradient-to-pos":[{to:[A]}],"gradient-from":[{from:[x]}],"gradient-via":[{via:[x]}],"gradient-to":[{to:[x]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[c]}],"border-w-x":[{"border-x":[c]}],"border-w-y":[{"border-y":[c]}],"border-w-s":[{"border-s":[c]}],"border-w-e":[{"border-e":[c]}],"border-w-t":[{"border-t":[c]}],"border-w-r":[{"border-r":[c]}],"border-w-b":[{"border-b":[c]}],"border-w-l":[{"border-l":[c]}],"border-opacity":[{"border-opacity":[G]}],"border-style":[{border:[...M(),"hidden"]}],"divide-x":[{"divide-x":[c]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[c]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[G]}],"divide-style":[{divide:M()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...M()]}],"outline-offset":[{"outline-offset":[ae,F]}],"outline-w":[{outline:[ae,he]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:y()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[G]}],"ring-offset-w":[{"ring-offset":[ae,he]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",me,Ti]}],"shadow-color":[{shadow:[We]}],opacity:[{opacity:[G]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[f]}],"drop-shadow":[{"drop-shadow":["","none",me,F]}],grayscale:[{grayscale:[g]}],"hue-rotate":[{"hue-rotate":[S]}],invert:[{invert:[v]}],saturate:[{saturate:[te]}],sepia:[{sepia:[Z]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[f]}],"backdrop-grayscale":[{"backdrop-grayscale":[g]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[S]}],"backdrop-invert":[{"backdrop-invert":[v]}],"backdrop-opacity":[{"backdrop-opacity":[G]}],"backdrop-saturate":[{"backdrop-saturate":[te]}],"backdrop-sepia":[{"backdrop-sepia":[Z]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",F]}],duration:[{duration:b()}],ease:[{ease:["linear","in","out","in-out",F]}],delay:[{delay:b()}],animate:[{animate:["none","spin","ping","pulse","bounce",F]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[ee]}],"scale-x":[{"scale-x":[ee]}],"scale-y":[{"scale-y":[ee]}],rotate:[{rotate:[Ke,F]}],"translate-x":[{"translate-x":[R]}],"translate-y":[{"translate-y":[R]}],"skew-x":[{"skew-x":[ce]}],"skew-y":[{"skew-y":[ce]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",F]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",F]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",F]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[ae,he,Ht]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}};ui(Ni);K("<div style=overflow:visible>");K("<canvas style=position:fixed;top:0;left:0;pointer-events:none;z-index:2147483645>");K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 22 19"fill=none><path d="M6.76263 18.6626C7.48251 18.6626 7.95474 18.1682 7.95474 17.4895C7.95474 17.1207 7.80474 16.8576 7.58683 16.6361L5.3018 14.4137L2.84621 12.3589L2.44374 13.0037L5.92137 13.1622H17.9232C20.4842 13.1622 21.593 12.021 21.593 9.47237V3.66983C21.593 1.10875 20.4842 0 17.9232 0H12.5414C11.8179 0 11.3018 0.545895 11.3018 1.21695C11.3018 1.888 11.8179 2.43389 12.5414 2.43389H17.8424C18.7937 2.43389 19.1897 2.83653 19.1897 3.78784V9.35747C19.1897 10.3257 18.7937 10.7314 17.8424 10.7314H5.92137L2.44374 10.8832L2.84621 11.5281L5.3018 9.47993L7.58683 7.2606C7.80474 7.03914 7.95474 6.7693 7.95474 6.40049C7.95474 5.72854 7.48251 5.22747 6.76263 5.22747C6.46129 5.22747 6.12975 5.36905 5.89231 5.6096L0.376815 11.0425C0.134921 11.2777 0 11.6141 0 11.9452C0 12.2728 0.134921 12.6158 0.376815 12.848L5.89231 18.2871C6.12975 18.5276 6.46129 18.6626 6.76263 18.6626Z"fill=currentColor>');K('<div class="absolute w-0 h-0"style="border-left:8px solid transparent;border-right:8px solid transparent">');K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-linecap=round stroke-linejoin=round stroke-width=2><path d="M12 6H6a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-6"></path><path d="M11 13l9-9"></path><path d="M15 4h5v5">');K("<div><span>");Ee(["click"]);K("<span class=text-black/50>");K('<div role=button><div class="text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit"><span class=text-black>');Ee(["click"]);K('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col items-start px-2 py-[5px] w-auto h-fit self-stretch [border-top-width:0.5px] border-t-solid border-t-[#D9D9D9] antialiased rounded-t-none rounded-b-sm -mt-px">');K('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">No</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Yes');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit">Discard?');Ee(["pointerdown","click"]);K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none><path d="M17.65 6.35C16.2 4.9 14.21 4 12 4C7.58 4 4.01 7.58 4.01 12C4.01 16.42 7.58 20 12 20C15.73 20 18.84 17.45 19.73 14H17.65C16.83 16.33 14.61 18 12 18C8.69 18 6 15.31 6 12C6 8.69 8.69 6 12 6C13.66 6 15.14 6.69 16.22 7.78L13 11H20V4L17.65 6.35Z"fill=currentColor>');K('<div class="contain-layout shrink-0 flex items-center justify-end gap-[5px] w-full h-fit"><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Retry</span></button><button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">Ok');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-end gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-full h-fit"><span class="text-[#B91C1C] text-[13px] leading-4 font-sans font-medium">');Ee(["pointerdown","click"]);K('<button class="contain-layout shrink-0 flex items-center justify-center px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#7e0002] cursor-pointer transition-all hover:bg-[#FEF2F2] h-[17px]"><span class="text-[#B91C1C] text-[13px] leading-3.5 font-sans font-medium">Undo');K('<button class="contain-layout shrink-0 flex items-center justify-center gap-1 px-[3px] py-px rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] cursor-pointer transition-all hover:bg-[#F5F5F5] h-[17px]"><span class="text-black text-[13px] leading-3.5 font-sans font-medium">');K('<div class="contain-layout shrink-0 flex items-center justify-between gap-2 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums"></span><div class="contain-layout shrink-0 flex items-center gap-[5px] h-fit">');K('<div class="contain-layout shrink-0 flex items-center gap-1 pt-1.5 pb-1 px-1.5 w-full h-fit"><span class="text-black text-[13px] leading-4 shrink-0 font-sans font-medium w-fit h-fit tabular-nums">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">');K('<div class="[font-synthesis:none] contain-layout shrink-0 flex flex-col justify-center items-end rounded-sm bg-white antialiased w-fit h-fit max-w-[280px]">');Ee(["pointerdown","click","input","keydown"]);K('<button data-react-grab-ignore-events class="contain-layout shrink-0 flex flex-col items-start rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] p-1 size-fit cursor-pointer ml-1 transition-none hover:scale-105"><div data-react-grab-ignore-events class="shrink-0 w-[7px] h-[7px] rounded-[1px] bg-black pointer-events-none">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 opacity-50 wrap-break-word overflow-y-auto"placeholder="type to edit"rows=1 disabled style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none>');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 px-1.5 w-auto h-fit"><div class="contain-layout flex items-center px-0 py-px w-auto h-fit rounded-sm gap-[3px]"><span class="text-[13px] leading-4 font-sans font-medium w-auto h-fit whitespace-normal text-[#71717a] animate-pulse tabular-nums">');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">');K('<div class="shrink-0 flex items-center gap-0.5 w-full mb-0.5 overflow-hidden"><span class="text-[#a1a1aa] text-[10px] leading-3 shrink-0">>previously:</span><span class="text-[#a1a1aa] text-[10px] leading-3 italic truncate whitespace-nowrap">');K('<div class="shrink-0 flex justify-between items-end w-full min-h-4"><textarea data-react-grab-ignore-events class="text-black text-[13px] leading-4 font-medium bg-transparent border-none outline-none resize-none flex-1 p-0 m-0 wrap-break-word overflow-y-auto"placeholder="type prompt"rows=1 style=field-sizing:content;min-height:16px;max-height:95px;scrollbar-width:none></textarea><button class="contain-layout shrink-0 flex flex-col items-start px-[3px] py-[3px] rounded-sm bg-white [border-width:0.5px] border-solid border-[#B3B3B3] size-fit cursor-pointer transition-all hover:scale-105 ml-1">');K('<div class="contain-layout shrink-0 flex flex-col justify-center items-start gap-1 w-fit h-fit max-w-[280px]"><div class="contain-layout shrink-0 flex items-center gap-1 pt-1 w-fit h-fit pl-1.5 pr-1">');K('<div data-react-grab-ignore-events class="fixed font-sans text-[13px] antialiased transition-opacity duration-300 ease-out filter-[drop-shadow(0px_0px_4px_#51515180)] select-none"style=z-index:2147483647><div class="[font-synthesis:none] contain-layout flex items-center gap-[5px] rounded-sm bg-white antialiased w-fit h-fit p-0">');Ee(["pointerdown","mousedown","click","pointerup","input","keydown"]);K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 18 18"fill=currentColor><path opacity=0.4 d="M7.65631 10.9565C7.31061 10.0014 7.54012 8.96635 8.25592 8.25195C8.74522 7.76615 9.38771 7.49951 10.0694 7.49951C10.3682 7.49951 10.6641 7.55171 10.9483 7.65381L16.0001 9.49902V4.75C16.0001 3.2334 14.7667 2 13.2501 2H4.75012C3.23352 2 2.00012 3.2334 2.00012 4.75V13.25C2.00012 14.7666 3.23352 16 4.75012 16H9.49962L7.65631 10.9565Z"></path><path d="M17.296 11.5694L10.4415 9.06545C10.0431 8.92235 9.61441 9.01658 9.31551 9.31338C9.01671 9.61168 8.92101 10.0429 9.06551 10.4413L11.5704 17.2948C11.7247 17.7191 12.128 18.0004 12.5772 18.0004C12.585 18.0004 12.5918 17.9999 12.5987 17.9999C13.0577 17.9906 13.4591 17.6913 13.5987 17.2543L14.4854 14.4857L17.2559 13.5985C17.6914 13.4589 17.9903 13.057 18 12.599C18.0097 12.141 17.7267 11.7276 17.296 11.5694Z">');K('<svg xmlns=http://www.w3.org/2000/svg viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2.5 stroke-linecap=round stroke-linejoin=round><path d="m18 15-6-6-6 6">');K('<div data-react-grab-ignore-events style=z-index:2147483647><div><div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105"></button></div><button data-react-grab-ignore-events class="contain-layout shrink-0 flex items-center justify-center cursor-pointer transition-all hover:scale-105">');Ee(["pointerdown","pointermove","pointerup","click"]);var Mi="0.5.28",rr=`bippy-${Mi}`,$n=Object.defineProperty,ki=Object.prototype.hasOwnProperty,Ye=()=>{},or=e=>{try{Function.prototype.toString.call(e).indexOf("^_^")>-1&&setTimeout(()=>{throw Error("React is running in production mode, but dead code elimination has not been applied. Read how to correctly configure React for production: https://reactjs.org/link/perf-use-production-build")});}catch{}},ir=(e=Pe())=>"getFiberRoots"in e,sr=false,Hn,Ut=(e=Pe())=>sr?true:(typeof e.inject=="function"&&(Hn=e.inject.toString()),!!Hn?.includes("(injected)")),jt=new Set,Xe=new Set,Li=e=>{let t=new Map,n=0,r={_instrumentationIsActive:false,_instrumentationSource:rr,checkDCE:or,hasUnsupportedRendererAttached:false,inject(o){let s=++n;return t.set(s,o),Xe.add(o),r._instrumentationIsActive||(r._instrumentationIsActive=true,jt.forEach(l=>l())),s},on:Ye,onCommitFiberRoot:Ye,onCommitFiberUnmount:Ye,onPostCommitFiberRoot:Ye,renderers:t,supportsFiber:true,supportsFlight:true};try{$n(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__",{configurable:!0,enumerable:!0,get(){return r},set(l){if(l&&typeof l=="object"){let c=r.renderers;r=l,c.size>0&&(c.forEach((f,g)=>{Xe.add(f),l.renderers.set(g,f);}),Vt(e));}}});let o=window.hasOwnProperty,s=!1;$n(window,"hasOwnProperty",{configurable:!0,value:function(...l){try{if(!s&&l[0]==="__REACT_DEVTOOLS_GLOBAL_HOOK__")return globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__=void 0,s=!0,-0}catch{}return o.apply(this,l)},writable:!0});}catch{Vt(e);}return r},Vt=e=>{try{let t=globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!t)return;if(!t._instrumentationSource){t.checkDCE=or,t.supportsFiber=!0,t.supportsFlight=!0,t.hasUnsupportedRendererAttached=!1,t._instrumentationSource=rr,t._instrumentationIsActive=!1;let n=ir(t);if(n||(t.on=Ye),t.renderers.size){t._instrumentationIsActive=!0,jt.forEach(s=>s());return}let r=t.inject,o=Ut(t);o&&!n&&(sr=!0,t.inject({scheduleRefresh(){}})&&(t._instrumentationIsActive=!0)),t.inject=s=>{let l=r(s);return Xe.add(s),o&&t.renderers.set(l,s),t._instrumentationIsActive=!0,jt.forEach(c=>c()),l};}(t.renderers.size||t._instrumentationIsActive||Ut())&&e?.();}catch{}},Ii=()=>ki.call(globalThis,"__REACT_DEVTOOLS_GLOBAL_HOOK__"),Pe=e=>Ii()?(Vt(e),globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__):Li(e),Oi=()=>!!(typeof window<"u"&&(window.document?.createElement||window.navigator?.product==="ReactNative")),Pi=()=>{try{Oi()&&Pe();}catch{}},Di=0,Ri=1,$i=5,Hi=11,Bi=13,Fi=15,zi=16,Ui=19,ji=26,Vi=27,Gi=28,Ki=30;function Wi(e,t,n=false){if(!e)return null;let r=t(e);if(r instanceof Promise)return (async()=>{if(await r===true)return e;let s=n?e.return:e.child;for(;s;){let l=await lr(s,t,n);if(l)return l;s=n?null:s.sibling;}return null})();if(r===true)return e;let o=n?e.return:e.child;for(;o;){let s=ar(o,t,n);if(s)return s;o=n?null:o.sibling;}return null}var ar=(e,t,n=false)=>{if(!e)return null;if(t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=ar(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},lr=async(e,t,n=false)=>{if(!e)return null;if(await t(e)===true)return e;let r=n?e.return:e.child;for(;r;){let o=await lr(r,t,n);if(o)return o;r=n?null:r.sibling;}return null},cr=e=>{let t=e;return typeof t=="function"?t:typeof t=="object"&&t?cr(t.type||t.render):null},Gt=e=>{let t=e;if(typeof t=="string")return t;if(typeof t!="function"&&!(typeof t=="object"&&t))return null;let n=t.displayName||t.name||null;if(n)return n;let r=cr(t);return r&&(r.displayName||r.name)||null},ur=()=>!!Pe()._instrumentationIsActive||ir()||Ut(),qi=e=>{let t=Pe();for(let n of t.renderers.values())try{let r=n.findFiberByHostInstance?.(e);if(r)return r}catch{}if(typeof e=="object"&&e){if("_reactRootContainer"in e)return e._reactRootContainer?._internalRoot?.current?.child;for(let n in e)if(n.startsWith("__reactContainer$")||n.startsWith("__reactInternalInstance$")||n.startsWith("__reactFiber"))return e[n]||null}return null},Yi=Object.create,dr=Object.defineProperty,Xi=Object.getOwnPropertyDescriptor,Zi=Object.getOwnPropertyNames,Ji=Object.getPrototypeOf,Qi=Object.prototype.hasOwnProperty,es=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ts=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(var o=Zi(t),s=0,l=o.length,c;s<l;s++)c=o[s],!Qi.call(e,c)&&c!==n&&dr(e,c,{get:(f=>t[f]).bind(null,c),enumerable:!(r=Xi(t,c))||r.enumerable});return e},ns=(e,t,n)=>(n=e==null?{}:Yi(Ji(e)),ts(dr(n,"default",{value:e,enumerable:true}),e)),Bn=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,rs=["rsc://","file:///","webpack://","webpack-internal://","node:","turbopack://","metro://","/app-pages-browser/"],Fn="about://React/",os=["<anonymous>","eval",""],is=/\.(jsx|tsx|ts|js)$/,ss=/(\.min|bundle|chunk|vendor|vendors|runtime|polyfill|polyfills)\.(js|mjs|cjs)$|(chunk|bundle|vendor|vendors|runtime|polyfill|polyfills|framework|app|main|index)[-_.][A-Za-z0-9_-]{4,}\.(js|mjs|cjs)$|[\da-f]{8,}\.(js|mjs|cjs)$|[-_.][\da-f]{20,}\.(js|mjs|cjs)$|\/dist\/|\/build\/|\/.next\/|\/out\/|\/node_modules\/|\.webpack\.|\.vite\.|\.turbopack\./i,as=/^\?[\w~.\-]+(?:=[^&#]*)?(?:&[\w~.\-]+(?:=[^&#]*)?)*$/,pr="(at Server)",ls=/(^|@)\S+:\d+/,cs=/^\s*at .*(\S+:\d+|\(native\))/m,us=/^(eval@)?(\[native code\])?$/,fr=(e,t)=>{{let n=e.split(`
|
|
4
|
+
`),r=[];for(let o of n)if(/^\s*at\s+/.test(o)){let s=ds(o,void 0)[0];s&&r.push(s);}else if(/^\s*in\s+/.test(o)){let s=o.replace(/^\s*in\s+/,"").replace(/\s*\(at .*\)$/,"");r.push({functionName:s,source:o});}else if(o.match(ls)){let s=ps(o,void 0)[0];s&&r.push(s);}return Wt(r,t)}},hr=e=>{if(!e.includes(":"))return [e,void 0,void 0];let t=e.startsWith("(")&&/:\d+\)$/.test(e),n=t?e.slice(1,-1):e,r=/(.+?)(?::(\d+))?(?::(\d+))?$/,o=r.exec(n);return o?[o[1],o[2]||void 0,o[3]||void 0]:[n,void 0,void 0]},Wt=(e,t)=>t&&t.slice!=null?Array.isArray(t.slice)?e.slice(t.slice[0],t.slice[1]):e.slice(0,t.slice):e,ds=(e,t)=>Wt(e.split(`
|
|
5
5
|
`).filter(n=>!!n.match(cs)),t).map(n=>{let r=n;r.includes("(eval ")&&(r=r.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let o=r.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),s=o.match(/ (\(.+\)$)/);o=s?o.replace(s[0],""):o;let l=hr(s?s[1]:o),c=s&&o||void 0,f=["eval","<anonymous>"].includes(l[0])?void 0:l[0];return {functionName:c,fileName:f,lineNumber:l[1]?+l[1]:void 0,columnNumber:l[2]?+l[2]:void 0,source:r}}),ps=(e,t)=>Wt(e.split(`
|
|
6
6
|
`).filter(n=>!n.match(us)),t).map(n=>{let r=n;if(r.includes(" > eval")&&(r=r.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),!r.includes("@")&&!r.includes(":"))return {functionName:r};{let o=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,s=r.match(o),l=s&&s[1]?s[1]:void 0,c=hr(r.replace(o,""));return {functionName:l,fileName:c[0],lineNumber:c[1]?+c[1]:void 0,columnNumber:c[2]?+c[2]:void 0,source:r}}}),fs=es((e,t)=>{(function(n,r){typeof e=="object"&&t!==void 0?r(e):typeof define=="function"&&define.amd?define(["exports"],r):(n=typeof globalThis<"u"?globalThis:n||self,r(n.sourcemapCodec={}));})(void 0,function(n){let r=44,o=59,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l=new Uint8Array(64),c=new Uint8Array(128);for(let N=0;N<s.length;N++){let E=s.charCodeAt(N);l[N]=E,c[E]=N;}function f(N,E){let y=0,T=0,k=0;do{let B=N.next();k=c[B],y|=(k&31)<<T,T+=5;}while(k&32);let M=y&1;return y>>>=1,M&&(y=-2147483648|-y),E+y}function g(N,E,y){let T=E-y;T=T<0?-T<<1|1:T<<1;do{let k=T&31;T>>>=5,T>0&&(k|=32),N.write(l[k]);}while(T>0);return E}function S(N,E){return N.pos>=E?false:N.peek()!==r}let v=1024*16,m=typeof TextDecoder<"u"?new TextDecoder:typeof Buffer<"u"?{decode(N){return Buffer.from(N.buffer,N.byteOffset,N.byteLength).toString()}}:{decode(N){let E="";for(let y=0;y<N.length;y++)E+=String.fromCharCode(N[y]);return E}};class x{constructor(){this.pos=0,this.out="",this.buffer=new Uint8Array(v);}write(E){let{buffer:y}=this;y[this.pos++]=E,this.pos===v&&(this.out+=m.decode(y),this.pos=0);}flush(){let{buffer:E,out:y,pos:T}=this;return T>0?y+m.decode(E.subarray(0,T)):y}}class A{constructor(E){this.pos=0,this.buffer=E;}next(){return this.buffer.charCodeAt(this.pos++)}peek(){return this.buffer.charCodeAt(this.pos)}indexOf(E){let{buffer:y,pos:T}=this,k=y.indexOf(E,T);return k===-1?y.length:k}}let L=[];function P(N){let{length:E}=N,y=new A(N),T=[],k=[],M=0;for(;y.pos<E;y.pos++){M=f(y,M);let B=f(y,0);if(!S(y,E)){let p=k.pop();p[2]=M,p[3]=B;continue}let $=f(y,0),V=f(y,0),z=V&1,b=z?[M,B,0,0,$,f(y,0)]:[M,B,0,0,$],_=L;if(S(y,E)){_=[];do{let p=f(y,0);_.push(p);}while(S(y,E))}b.vars=_,T.push(b),k.push(b);}return T}function G(N){let E=new x;for(let y=0;y<N.length;)y=W(N,y,E,[0]);return E.flush()}function W(N,E,y,T){let k=N[E],{0:M,1:B,2:$,3:V,4:z,vars:b}=k;E>0&&y.write(r),T[0]=g(y,M,T[0]),g(y,B,0),g(y,z,0);let _=k.length===6?1:0;g(y,_,0),k.length===6&&g(y,k[5],0);for(let p of b)g(y,p,0);for(E++;E<N.length;){let p=N[E],{0:i,1:a}=p;if(i>$||i===$&&a>=V)break;E=W(N,E,y,T);}return y.write(r),T[0]=g(y,$,T[0]),g(y,V,0),E}function te(N){let{length:E}=N,y=new A(N),T=[],k=[],M=0,B=0,$=0,V=0,z=0,b=0,_=0,p=0;do{let i=y.indexOf(";"),a=0;for(;y.pos<i;y.pos++){if(a=f(y,a),!S(y,i)){let I=k.pop();I[2]=M,I[3]=a;continue}let u=f(y,0),d=u&1,h=u&2,w=u&4,C=null,D=L,U;if(d){let I=f(y,B);$=f(y,B===I?$:0),B=I,U=[M,a,0,0,I,$];}else U=[M,a,0,0];if(U.isScope=!!w,h){let I=V,ne=z;V=f(y,V);let oe=I===V;z=f(y,oe?z:0),b=f(y,oe&&ne===z?b:0),C=[V,z,b];}if(U.callsite=C,S(y,i)){D=[];do{_=M,p=a;let I=f(y,0),ne;if(I<-1){ne=[[f(y,0)]];for(let oe=-1;oe>I;oe--){let Se=_;_=f(y,_),p=f(y,_===Se?p:0);let gt=f(y,0);ne.push([gt,_,p]);}}else ne=[[I]];D.push(ne);}while(S(y,i))}U.bindings=D,T.push(U),k.push(U);}M++,y.pos=i+1;}while(y.pos<E);return T}function ee(N){if(N.length===0)return "";let E=new x;for(let y=0;y<N.length;)y=Z(N,y,E,[0,0,0,0,0,0,0]);return E.flush()}function Z(N,E,y,T){let k=N[E],{0:M,1:B,2:$,3:V,isScope:z,callsite:b,bindings:_}=k;T[0]<M?(ce(y,T[0],M),T[0]=M,T[1]=0):E>0&&y.write(r),T[1]=g(y,k[1],T[1]);let p=(k.length===6?1:0)|(b?2:0)|(z?4:0);if(g(y,p,0),k.length===6){let{4:i,5:a}=k;i!==T[2]&&(T[3]=0),T[2]=g(y,i,T[2]),T[3]=g(y,a,T[3]);}if(b){let{0:i,1:a,2:u}=k.callsite;i===T[4]?a!==T[5]&&(T[6]=0):(T[5]=0,T[6]=0),T[4]=g(y,i,T[4]),T[5]=g(y,a,T[5]),T[6]=g(y,u,T[6]);}if(_)for(let i of _){i.length>1&&g(y,-i.length,0);let a=i[0][0];g(y,a,0);let u=M,d=B;for(let h=1;h<i.length;h++){let w=i[h];u=g(y,w[1],u),d=g(y,w[2],d),g(y,w[0],0);}}for(E++;E<N.length;){let i=N[E],{0:a,1:u}=i;if(a>$||a===$&&u>=V)break;E=Z(N,E,y,T);}return T[0]<$?(ce(y,T[0],$),T[0]=$,T[1]=0):y.write(r),T[1]=g(y,V,T[1]),E}function ce(N,E,y){do N.write(o);while(++E<y)}function ue(N){let{length:E}=N,y=new A(N),T=[],k=0,M=0,B=0,$=0,V=0;do{let z=y.indexOf(";"),b=[],_=true,p=0;for(k=0;y.pos<z;){let i;k=f(y,k),k<p&&(_=false),p=k,S(y,z)?(M=f(y,M),B=f(y,B),$=f(y,$),S(y,z)?(V=f(y,V),i=[k,M,B,$,V]):i=[k,M,B,$]):i=[k],b.push(i),y.pos++;}_||R(b),T.push(b),y.pos=z+1;}while(y.pos<=E);return T}function R(N){N.sort(j);}function j(N,E){return N[0]-E[0]}function H(N){let E=new x,y=0,T=0,k=0,M=0;for(let B=0;B<N.length;B++){let $=N[B];if(B>0&&E.write(o),$.length===0)continue;let V=0;for(let z=0;z<$.length;z++){let b=$[z];z>0&&E.write(r),V=g(E,b[0],V),b.length!==1&&(y=g(E,b[1],y),T=g(E,b[2],T),k=g(E,b[3],k),b.length!==4&&(M=g(E,b[4],M)));}}return E.flush()}n.decode=ue,n.decodeGeneratedRanges=te,n.decodeOriginalScopes=P,n.encode=H,n.encodeGeneratedRanges=ee,n.encodeOriginalScopes=G,Object.defineProperty(n,"__esModule",{value:true});});}),mr=ns(fs()),gr=/^[a-zA-Z][a-zA-Z\d+\-.]*:/,hs=/^data:application\/json[^,]+base64,/,ms=/(?:\/\/[@#][ \t]+sourceMappingURL=([^\s'"]+?)[ \t]*$)|(?:\/\*[@#][ \t]+sourceMappingURL=([^*]+?)[ \t]*(?:\*\/)[ \t]*$)/,br=typeof WeakRef<"u",qe=new Map,lt=new Map,gs=e=>br&&e instanceof WeakRef,zn=(e,t,n,r)=>{if(n<0||n>=e.length)return null;let o=e[n];if(!o||o.length===0)return null;let s=null;for(let S of o)if(S[0]<=r)s=S;else break;if(!s||s.length<4)return null;let[,l,c,f]=s;if(l===void 0||c===void 0||f===void 0)return null;let g=t[l];return g?{columnNumber:f,fileName:g,lineNumber:c+1}:null},bs=(e,t,n)=>{if(e.sections){let r=null;for(let l of e.sections)if(t>l.offset.line||t===l.offset.line&&n>=l.offset.column)r=l;else break;if(!r)return null;let o=t-r.offset.line,s=t===r.offset.line?n-r.offset.column:n;return zn(r.map.mappings,r.map.sources,o,s)}return zn(e.mappings,e.sources,t-1,n)},ys=(e,t)=>{let n=t.split(`
|
|
7
|
-
`),r;for(let s=n.length-1;s>=0&&!r;s--){let l=n[s].match(ms);l&&(r=l[1]||l[2]);}if(!r)return null;let o=gr.test(r);if(!(hs.test(r)||o||r.startsWith("/"))){let s=e.split("/");s[s.length-1]=r,r=s.join("/");}return r},vs=e=>({file:e.file,mappings:(0, mr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),ws=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, mr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Un=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(gr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},xs=async(e,t=fetch)=>{if(!Un(e))return null;let n;try{
|
|
7
|
+
`),r;for(let s=n.length-1;s>=0&&!r;s--){let l=n[s].match(ms);l&&(r=l[1]||l[2]);}if(!r)return null;let o=gr.test(r);if(!(hs.test(r)||o||r.startsWith("/"))){let s=e.split("/");s[s.length-1]=r,r=s.join("/");}return r},vs=e=>({file:e.file,mappings:(0, mr.decode)(e.mappings),names:e.names,sourceRoot:e.sourceRoot,sources:e.sources,sourcesContent:e.sourcesContent,version:3}),ws=e=>{let t=e.sections.map(({map:r,offset:o})=>({map:{...r,mappings:(0, mr.decode)(r.mappings)},offset:o})),n=new Set;for(let r of t)for(let o of r.map.sources)n.add(o);return {file:e.file,mappings:[],names:[],sections:t,sourceRoot:void 0,sources:Array.from(n),sourcesContent:void 0,version:3}},Un=e=>{if(!e)return false;let t=e.trim();if(!t)return false;let n=t.match(gr);if(!n)return true;let r=n[0].toLowerCase();return r==="http:"||r==="https:"},xs=async(e,t=fetch)=>{if(!Un(e))return null;let n;try{let o=await t(e);if(!o.ok)return null;n=await o.text();}catch{return null}if(!n)return null;let r=ys(e,n);if(!r||!Un(r))return null;try{let o=await t(r);if(!o.ok)return null;let s=await o.json();return "sections"in s?ws(s):vs(s)}catch{return null}},Es=async(e,t=true,n)=>{if(t&&qe.has(e)){let s=qe.get(e);if(s==null)return null;if(gs(s)){let l=s.deref();if(l)return l;qe.delete(e);}else return s}if(t&<.has(e))return lt.get(e);let r=xs(e,n);t&<.set(e,r);let o=await r;return t&<.delete(e),t&&(o===null?qe.set(e,null):qe.set(e,br?new WeakRef(o):o)),o},Ss=async(e,t=true,n)=>await Promise.all(e.map(async r=>{if(!r.fileName)return r;let o=await Es(r.fileName,t,n);if(!o||typeof r.lineNumber!="number"||typeof r.columnNumber!="number")return r;let s=bs(o,r.lineNumber,r.columnNumber);return s?{...r,source:s.fileName&&r.source?r.source.replace(r.fileName,s.fileName):r.source,fileName:s.fileName,lineNumber:s.lineNumber,columnNumber:s.columnNumber,isSymbolicated:true}:r})),Ts=e=>e._debugStack instanceof Error&&typeof e._debugStack?.stack=="string",Cs=()=>{let e=Pe();for(let t of [...Array.from(Xe),...Array.from(e.renderers.values())]){let n=t.currentDispatcherRef;if(n&&typeof n=="object")return "H"in n?n.H:n.current}return null},jn=e=>{for(let t of Xe){let n=t.currentDispatcherRef;n&&typeof n=="object"&&("H"in n?n.H=e:n.current=e);}},le=e=>`
|
|
8
8
|
in ${e}`,_s=(e,t)=>{let n=le(e);return t&&(n+=` (at ${t})`),n},Bt=false,Ft=(e,t)=>{if(!e||Bt)return "";let n=Error.prepareStackTrace;Error.prepareStackTrace=void 0,Bt=true;let r=Cs();jn(null);let o=console.error,s=console.warn;console.error=()=>{},console.warn=()=>{};try{let c={DetermineComponentFrameRoot(){let S;try{if(t){let v=function(){throw Error()};if(Object.defineProperty(v.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(v,[]);}catch(m){S=m;}Reflect.construct(e,[],v);}else {try{v.call();}catch(m){S=m;}e.call(v.prototype);}}else {try{throw Error()}catch(m){S=m;}let v=e();v&&typeof v.catch=="function"&&v.catch(()=>{});}}catch(v){if(v instanceof Error&&S instanceof Error&&typeof v.stack=="string")return [v.stack,S.stack]}return [null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot",Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name")?.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});let[f,g]=c.DetermineComponentFrameRoot();if(f&&g){let S=f.split(`
|
|
9
9
|
`),v=g.split(`
|
|
10
10
|
`),m=0,x=0;for(;m<S.length&&!S[m].includes("DetermineComponentFrameRoot");)m++;for(;x<v.length&&!v[x].includes("DetermineComponentFrameRoot");)x++;if(m===S.length||x===v.length)for(m=S.length-1,x=v.length-1;m>=1&&x>=0&&S[m]!==v[x];)x--;for(;m>=1&&x>=0;m--,x--)if(S[m]!==v[x]){if(m!==1||x!==1)do if(m--,x--,x<0||S[m]!==v[x]){let A=`
|
|
@@ -13,20 +13,20 @@ Error generating stack: ${t.message}
|
|
|
13
13
|
${t.stack}`:""}},Ms=e=>{let t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;let n=e;if(!n)return "";Error.prepareStackTrace=t,n.startsWith(`Error: react-stack-top-frame
|
|
14
14
|
`)&&(n=n.slice(29));let r=n.indexOf(`
|
|
15
15
|
`);if(r!==-1&&(n=n.slice(r+1)),r=Math.max(n.indexOf("react_stack_bottom_frame"),n.indexOf("react-stack-bottom-frame")),r!==-1&&(r=n.lastIndexOf(`
|
|
16
|
-
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},ks=e=>!!(e.fileName?.startsWith("rsc://")&&e.functionName),Ls=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Is=e=>{let t=new Map;for(let n of e)for(let r of n.stackFrames){if(!ks(r))continue;let o=r.functionName,s=t.get(o)??[];s.some(l=>Ls(l,r))||(s.push(r),t.set(o,s));}return t},Os=(e,t,n)=>{if(!e.functionName)return {...e,isServer:true};let r=t.get(e.functionName);if(!r||r.length===0)return {...e,isServer:true};let o=n.get(e.functionName)??0,s=r[o%r.length];return n.set(e.functionName,o+1),{...e,isServer:true,fileName:s.fileName,lineNumber:s.lineNumber,columnNumber:s.columnNumber,source:e.source?.replace(pr,`(${s.fileName}:${s.lineNumber}:${s.columnNumber})`)}},Ps=e=>{let t=[];return Wi(e,n=>{if(!Ts(n))return;let r=typeof n.type=="string"?n.type:Gt(n.type)||"<anonymous>";t.push({componentName:r,stackFrames:fr(Ms(n._debugStack?.stack))});},true),t},Ds=async(e,t=true,n)=>{let r=Ps(e),o=fr(Ns(e)),s=Is(r),l=new Map,c=o.map(g=>g.source?.includes(pr)??false?Os(g,s,l):g),f=c.filter((g,S,v)=>{if(S===0)return true;let m=v[S-1];return g.functionName!==m.functionName});return Ss(f,t,n)},yr=e=>{if(!e||os.some(o=>o===e))return "";let t=e;if(t.startsWith("http://")||t.startsWith("https://"))try{t=new URL(t).pathname;}catch{}if(t.startsWith(Fn)){let o=t.slice(Fn.length),s=o.indexOf("/"),l=o.indexOf(":");t=s!==-1&&(l===-1||s<l)?o.slice(s+1):o;}let n=true;for(;n;){n=false;for(let o of rs)if(t.startsWith(o)){t=t.slice(o.length),o==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`),n=true;break}}if(Bn.test(t)){let o=t.match(Bn);o&&(t=t.slice(o[0].length));}if(t.startsWith("//")){let o=t.indexOf("/",2);t=o===-1?"":t.slice(o);}let r=t.indexOf("?");if(r!==-1){let o=t.slice(r);as.test(o)&&(t=t.slice(0,r));}return t},Rs=e=>{let t=yr(e);return !(!t||!is.test(t)||ss.test(t))},$s=e=>e.length>0&&/^[A-Z]/.test(e);Pi();var Hs=new Set(["InnerLayoutRouter","RedirectErrorBoundary","RedirectBoundary","HTTPAccessFallbackErrorBoundary","HTTPAccessFallbackBoundary","LoadingBoundary","ErrorBoundary","InnerScrollAndFocusHandler","ScrollAndFocusHandler","RenderFromTemplateContext","OuterLayoutRouter","body","html","DevRootHTTPAccessFallbackBoundary","AppDevOverlayErrorBoundary","AppDevOverlay","HotReload","Router","ErrorBoundaryHandler","AppRouter","ServerRoot","SegmentStateProvider","RootErrorBoundary","LoadableComponent","MotionDOMComponent"]),Bs=()=>typeof document>"u"?false:!!(document.getElementById("__NEXT_DATA__")||document.querySelector("nextjs-portal")),Fs=e=>!!(e.startsWith("_")||Hs.has(e)),Vn=e=>!(e.length<=1||Fs(e)||!$s(e)||e.startsWith("Primitive.")||e.includes("Provider")&&e.includes("Context")),
|
|
16
|
+
`,r)),r!==-1)n=n.slice(0,r);else return "";return n},ks=e=>!!(e.fileName?.startsWith("rsc://")&&e.functionName),Ls=(e,t)=>e.fileName===t.fileName&&e.lineNumber===t.lineNumber&&e.columnNumber===t.columnNumber,Is=e=>{let t=new Map;for(let n of e)for(let r of n.stackFrames){if(!ks(r))continue;let o=r.functionName,s=t.get(o)??[];s.some(l=>Ls(l,r))||(s.push(r),t.set(o,s));}return t},Os=(e,t,n)=>{if(!e.functionName)return {...e,isServer:true};let r=t.get(e.functionName);if(!r||r.length===0)return {...e,isServer:true};let o=n.get(e.functionName)??0,s=r[o%r.length];return n.set(e.functionName,o+1),{...e,isServer:true,fileName:s.fileName,lineNumber:s.lineNumber,columnNumber:s.columnNumber,source:e.source?.replace(pr,`(${s.fileName}:${s.lineNumber}:${s.columnNumber})`)}},Ps=e=>{let t=[];return Wi(e,n=>{if(!Ts(n))return;let r=typeof n.type=="string"?n.type:Gt(n.type)||"<anonymous>";t.push({componentName:r,stackFrames:fr(Ms(n._debugStack?.stack))});},true),t},Ds=async(e,t=true,n)=>{let r=Ps(e),o=fr(Ns(e)),s=Is(r),l=new Map,c=o.map(g=>g.source?.includes(pr)??false?Os(g,s,l):g),f=c.filter((g,S,v)=>{if(S===0)return true;let m=v[S-1];return g.functionName!==m.functionName});return Ss(f,t,n)},yr=e=>{if(!e||os.some(o=>o===e))return "";let t=e;if(t.startsWith("http://")||t.startsWith("https://"))try{t=new URL(t).pathname;}catch{}if(t.startsWith(Fn)){let o=t.slice(Fn.length),s=o.indexOf("/"),l=o.indexOf(":");t=s!==-1&&(l===-1||s<l)?o.slice(s+1):o;}let n=true;for(;n;){n=false;for(let o of rs)if(t.startsWith(o)){t=t.slice(o.length),o==="file:///"&&(t=`/${t.replace(/^\/+/,"")}`),n=true;break}}if(Bn.test(t)){let o=t.match(Bn);o&&(t=t.slice(o[0].length));}if(t.startsWith("//")){let o=t.indexOf("/",2);t=o===-1?"":t.slice(o);}let r=t.indexOf("?");if(r!==-1){let o=t.slice(r);as.test(o)&&(t=t.slice(0,r));}return t},Rs=e=>{let t=yr(e);return !(!t||!is.test(t)||ss.test(t))},$s=e=>e.length>0&&/^[A-Z]/.test(e);Pi();var Hs=new Set(["InnerLayoutRouter","RedirectErrorBoundary","RedirectBoundary","HTTPAccessFallbackErrorBoundary","HTTPAccessFallbackBoundary","LoadingBoundary","ErrorBoundary","InnerScrollAndFocusHandler","ScrollAndFocusHandler","RenderFromTemplateContext","OuterLayoutRouter","body","html","DevRootHTTPAccessFallbackBoundary","AppDevOverlayErrorBoundary","AppDevOverlay","HotReload","Router","ErrorBoundaryHandler","AppRouter","ServerRoot","SegmentStateProvider","RootErrorBoundary","LoadableComponent","MotionDOMComponent"]),Bs=()=>typeof document>"u"?false:!!(document.getElementById("__NEXT_DATA__")||document.querySelector("nextjs-portal")),Fs=e=>!!(e.startsWith("_")||Hs.has(e)),Vn=e=>!(e.length<=1||Fs(e)||!$s(e)||e.startsWith("Primitive.")||e.includes("Provider")&&e.includes("Context")),vr=async e=>{if(!ur())return [];try{let t=qi(e);return t?await Ds(t):null}catch{return null}};var qt=async(e,t={})=>{let{maxLines:n=3}=t,r=zs(e),o=await vr(e),s=Bs(),l=[];if(o)for(let c of o){if(l.length>=n)break;if(c.isServer&&(!c.functionName||Vn(c.functionName))){l.push(`
|
|
17
17
|
in ${c.functionName||"<anonymous>"} (at Server)`);continue}if(c.fileName&&Rs(c.fileName)){let f=`
|
|
18
|
-
in `,g=c.functionName&&Vn(c.functionName);g&&(f+=`${c.functionName} (at `),f+=yr(c.fileName),s&&c.lineNumber&&c.columnNumber&&(f+=`:${c.lineNumber}:${c.columnNumber}`),g&&(f+=")"),l.push(f);}}return `${r}${l.join("")}`},
|
|
18
|
+
in `,g=c.functionName&&Vn(c.functionName);g&&(f+=`${c.functionName} (at `),f+=yr(c.fileName),s&&c.lineNumber&&c.columnNumber&&(f+=`:${c.lineNumber}:${c.columnNumber}`),g&&(f+=")"),l.push(f);}}return `${r}${l.join("")}`},zs=e=>{let t=e.tagName.toLowerCase();if(!(e instanceof HTMLElement))return `<${t} />`;let n=e.innerText?.trim()??e.textContent?.trim()??"",r="",o=Array.from(e.attributes);for(let x of o){let A=x.name,L=x.value;L.length>20&&(L=`${L.slice(0,20)}...`),r+=` ${A}="${L}"`;}let s=[],l=[],c=false,f=Array.from(e.childNodes);for(let x of f)x.nodeType!==Node.COMMENT_NODE&&(x.nodeType===Node.TEXT_NODE?x.textContent&&x.textContent.trim().length>0&&(c=true):x instanceof Element&&(c?l.push(x):s.push(x)));let g=x=>x.length===0?"":x.length<=2?x.map(A=>`<${A.tagName.toLowerCase()} ...>`).join(`
|
|
19
19
|
`):`(${x.length} elements)`,S="",v=g(s);if(v&&(S+=`
|
|
20
20
|
${v}`),n.length>0){let x=n.length>100?`${n.slice(0,100)}...`:n;S+=`
|
|
21
21
|
${x}`;}let m=g(l);return m&&(S+=`
|
|
22
22
|
${m}`),S.length>0?`<${t}${r}>${S}
|
|
23
|
-
</${t}>`:`<${t}${r} />`};var js="application/x-react-grab",Yt=(e,t)=>{let n=JSON.stringify({version:Do,content:e,timestamp:Date.now(),...t?.prompt}),r=s=>{s.preventDefault(),s.clipboardData?.setData("text/plain",e),s.clipboardData?.setData(js,n);};document.addEventListener("copy",r);let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.left="-9999px",o.ariaHidden="true",document.body.appendChild(o),o.select();try{let s=document.execCommand("copy");return s&&t?.onSuccess?.(),s}finally{document.removeEventListener("copy",r),o.remove();}};var Vs=new Set(["parentElement","parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling"]),Gs=new Set(["querySelector","closest"]),Ks=new Set(["querySelectorAll","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS"]),Ws=new Set(["setAttribute","removeAttribute","toggleAttribute","setAttributeNS","removeAttributeNS","setAttributeNode","removeAttributeNode","appendChild","removeChild","insertBefore","replaceChild","remove","append","prepend","after","before","replaceWith","replaceChildren","insertAdjacentHTML","insertAdjacentElement","insertAdjacentText","setHTML","normalize","cloneNode","addEventListener","removeEventListener","attachShadow","animate","showModal","show","close","showPopover","hidePopover","togglePopover","scrollTo","scrollBy","scrollIntoView","setSelectionRange","setRangeText","splitText","appendData","deleteData","insertData","replaceData","focus","blur","reset","submit","requestSubmit","setCustomValidity","insertRow","deleteRow","insertCell","deleteCell","createTHead","deleteTHead","createTFoot","deleteTFoot","createTBody","createCaption","deleteCaption","add","stepUp","stepDown","play","pause","load","fastSeek","setPointerCapture","webkitMatchesSelector","contains","compareDocumentPosition","getRootNode","isEqualNode","isSameNode"]),qs=new Set(["scrollTop","scrollLeft"]),Ys=new Set(["value","checked","selected","selectedIndex","disabled","readOnly","required","defaultValue","defaultChecked"]),Xs=new Set(["hidden","tabIndex","title","lang","dir","contentEditable","draggable","spellcheck","inert","slot","id","className","accessKey","autocapitalize","enterKeyHint","inputMode","nonce","popover","open","returnValue","indeterminate","type","name","placeholder","pattern","min","max","step","multiple","accept","src","href","alt","loading","crossOrigin","referrerPolicy","download","cols","rows","wrap","srcdoc","allowFullscreen","allow","rel","target","hreflang","media","sizes","srcset","decoding","fetchPriority","isMap","useMap","formAction","formEnctype","formMethod","formNoValidate","formTarget","maxLength","minLength","size","autocomplete","autofocus","dirName","list","noValidate","action","enctype","method","acceptCharset","cite","dateTime","label","span","headers","scope","abbr","colSpan","rowSpan","start","reversed","high","low","optimum","default","kind","srclang","integrity","as","blocking","async","defer","noModule","htmlFor","httpEquiv","content","charset","coords","shape","ping","seamless","width","height","data","form","summary","nodeValue"]),Zs=new Set(["currentTime","volume","muted","playbackRate","defaultPlaybackRate","autoplay","loop","controls","preload","poster","playsInline","disableRemotePlayback","preservesPitch","defaultMuted"]),Js=new Set(["nodeName","nodeType","tagName","localName","namespaceURI","prefix","baseURI","isConnected","ownerDocument","offsetWidth","offsetHeight","offsetTop","offsetLeft","offsetParent","clientWidth","clientHeight","clientTop","clientLeft","scrollWidth","scrollHeight","computedStyleMap","assignedSlot","sheet","naturalWidth","naturalHeight","complete","currentSrc","videoWidth","videoHeight","duration","paused","ended","seeking","readyState","networkState","buffered","played","seekable","error","textTracks","audioTracks","videoTracks","mediaKeys","validity","validationMessage","willValidate","files","labels","form","selectionStart","selectionEnd","selectionDirection","textLength","options","selectedOptions","length","tHead","tFoot","tBodies","caption","rowIndex","sectionRowIndex","cellIndex","cells","control","internals","part"]),wr=new Set(["relList","sandbox","controlsList","part"]),mt=e=>{let t=[],n=b=>t.push(b),r=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,g=new WeakMap,S=new WeakMap,m=b=>r.get(b)??b,A=b=>b.map(_=>typeof _=="string"?_:m(_)),L=b=>({parent:b.parentNode,nextSibling:b.nextSibling}),P=(b,_)=>{_.parent&&_.parent.insertBefore(b,_.nextSibling);},G=b=>b instanceof DocumentFragment?Array.from(b.childNodes):[],W=(b,_)=>((...p)=>{let i=A(p),a=new Map;for(let w of i)typeof w!="string"&&!(w instanceof DocumentFragment)&&w.parentNode&&a.set(w,L(w));let u=_();b(...i);let h=_().filter(w=>!u.includes(w));n(()=>{for(let w of h)w.parentNode?.removeChild(w);for(let[w,C]of a)P(w,C);});}),te=b=>{let _=s.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="setProperty")return (d,h,w)=>{let C=i.getPropertyValue(d),D=i.getPropertyPriority(d);i.setProperty(d,h,w),n(()=>i.setProperty(d,C,D));};if(a==="removeProperty")return d=>{let h=i.getPropertyValue(d),w=i.getPropertyPriority(d),C=i.removeProperty(d);return h&&n(()=>i.setProperty(d,h,w)),C};let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(typeof a=="string"){let d=i.getPropertyValue(a)||i[a]||"";n(()=>{i[a]=d;});}return Reflect.set(i,a,u)}});return s.set(b,p),p},ee=b=>{let _=l.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="add")return (...d)=>{let h=d.filter(w=>!i.contains(w));return n(()=>i.remove(...h)),i.add(...d)};if(a==="remove")return (...d)=>{let h=d.filter(w=>i.contains(w));return n(()=>i.add(...h)),i.remove(...d)};if(a==="toggle")return (d,h)=>{let w=i.contains(d),C=i.toggle(d,h);return n(()=>w?i.add(d):i.remove(d)),C};if(a==="replace")return (d,h)=>{let w=i.contains(d),C=i.contains(h),D=i.replace(d,h);return w&&n(()=>{C||i.remove(h),i.add(d);}),D};if(a==="value")return i.value;let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(a==="value"){let d=i.value;n(()=>{i.value=d;});}return Reflect.set(i,a,u)}});return l.set(b,p),p},Z=b=>{let _=c.get(b);if(_)return _;let p=new Proxy(b,{set(i,a,u){if(typeof a=="string"){let d=i[a],h=a in i;n(()=>h?i[a]=d:delete i[a]);}return Reflect.set(i,a,u)},deleteProperty(i,a){if(typeof a=="string"&&a in i){let u=i[a];n(()=>{i[a]=u;});}return Reflect.deleteProperty(i,a)}});return c.set(b,p),p},ce=b=>{let _=f.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(typeof a=="string"&&!isNaN(Number(a))){let d=i[Number(a)];return d?R(d):void 0}if(a==="item")return d=>{let h=i.item(d);return h?R(h):null};if(a==="getNamedItem")return d=>{let h=i.getNamedItem(d);return h?R(h):null};if(a==="getNamedItemNS")return (d,h)=>{let w=i.getNamedItemNS(d,h);return w?R(w):null};if(a==="setNamedItem")return d=>{let h=i.getNamedItem(d.name),w=h?.value,C=i.setNamedItem(d);return n(()=>{h&&w!==void 0?(h.value=w,i.setNamedItem(h)):i.removeNamedItem(d.name);}),C};if(a==="setNamedItemNS")return d=>{let h=i.getNamedItemNS(d.namespaceURI,d.localName),w=h?.value,C=i.setNamedItemNS(d);return n(()=>{h&&w!==void 0?(h.value=w,i.setNamedItemNS(h)):d.namespaceURI?i.removeNamedItemNS(d.namespaceURI,d.localName):i.removeNamedItem(d.name);}),C};if(a==="removeNamedItem")return d=>{let h=i.getNamedItem(d);if(h){let w=h.value,C=i.removeNamedItem(d);return n(()=>{let D=document.createAttribute(d);D.value=w,i.setNamedItem(D);}),C}return i.removeNamedItem(d)};if(a==="removeNamedItemNS")return (d,h)=>{let w=i.getNamedItemNS(d,h);if(w){let C=w.value,D=w.name,U=i.removeNamedItemNS(d,h);return n(()=>{let I=d?document.createAttributeNS(d,D):document.createAttribute(h);I.value=C,d?i.setNamedItemNS(I):i.setNamedItem(I);}),U}return i.removeNamedItemNS(d,h)};if(a===Symbol.iterator)return function*(){for(let d=0;d<i.length;d++)yield R(i[d]);};let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u}});return f.set(b,p),p},ue=new WeakMap,R=b=>{let _=ue.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(a==="value"){let d=i.value;n(()=>{i.value=d;});}return Reflect.set(i,a,u)}});return ue.set(b,p),p},j=b=>{let _=g.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="set")return (d,...h)=>{let w=i.get(d);i.set(d,...h),n(()=>{w?i.set(d,w):i.delete(d);});};if(a==="delete")return d=>{let h=i.get(d);i.delete(d),h&&n(()=>i.set(d,h));};if(a==="append")return (d,...h)=>{let w=i.getAll(d);i.append(d,...h),n(()=>{i.delete(d);for(let C of w)i.append(d,C);});};if(a==="clear")return ()=>{let d=[];i.forEach((h,w)=>{d.push([w,i.getAll(w)]);}),i.clear(),n(()=>{for(let[h,w]of d)for(let C of w)i.append(h,C);});};if(a===Symbol.iterator)return i[Symbol.iterator].bind(i);let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u}});return g.set(b,p),p},H=b=>new Proxy(b,{get(_,p){if(typeof p=="string"&&!isNaN(Number(p)))return M(_[Number(p)]??null);if(p==="item")return a=>M(_.item(a));if(p===Symbol.iterator)return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};if(p==="forEach")return (a,u)=>{_.forEach((d,h,w)=>{a.call(u,M(d),h,w);});};if(p==="entries")return function*(){for(let a=0;a<_.length;a++)yield [a,M(_[a])];};if(p==="keys")return _.keys.bind(_);if(p==="values")return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};let i=Reflect.get(_,p);return typeof i=="function"?i.bind(_):i}}),N=b=>b?new Proxy(b,{get(_,p){if(typeof p=="string"&&!isNaN(Number(p)))return M(_[Number(p)]??null);if(p==="item")return a=>M(_.item(a));if(p==="namedItem"&&"namedItem"in _)return a=>M(_.namedItem(a));if(p===Symbol.iterator)return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};let i=Reflect.get(_,p);return typeof i=="function"?i.bind(_):i}}):null,E=(b,_)=>{let p=S.get(b);if(p)return p;let i=new Proxy(b,{get(a,u){if(typeof u=="string"&&!isNaN(Number(u)))return M(a[Number(u)]??null);if(u==="item")return h=>M(a.item(h));if(u==="namedItem")return h=>M(a.namedItem(h));if(u==="add")return (h,w)=>{let C=m(h),D=typeof w=="number"||w==null?w:m(w);a.add(C,D),n(()=>C.parentNode?.removeChild(C));};if(u==="remove")return h=>{let w=a[h];if(w){let C=w.outerHTML,D=h;a.remove(h),n(()=>{let U=document.createElement("div");U.innerHTML=C;let I=U.firstChild;I&&(D>=a.length?_.appendChild(I):_.insertBefore(I,a[D]));});}};if(u==="selectedIndex")return a.selectedIndex;if(u==="length")return a.length;if(u===Symbol.iterator)return function*(){for(let h=0;h<a.length;h++)yield M(a[h]);};let d=Reflect.get(a,u);return typeof d=="function"?d.bind(a):d},set(a,u,d){if(u==="selectedIndex"){let h=a.selectedIndex;n(()=>{a.selectedIndex=h;});}if(u==="length"){let h=[];for(let w=0;w<a.length;w++)h.push(a[w].outerHTML);n(()=>{for(;a.length>0;)a.remove(0);for(let w of h){let C=document.createElement("div");C.innerHTML=w;let D=C.firstChild;D&&_.appendChild(D);}});}return Reflect.set(a,u,d)}});return S.set(b,i),i},y=(b,_)=>{let p=b;switch(_){case "setAttribute":return (i,a)=>{let u=p.hasAttribute(i),d=p.getAttribute(i);return n(()=>u?p.setAttribute(i,d):p.removeAttribute(i)),p.setAttribute(i,a)};case "removeAttribute":return i=>{if(p.hasAttribute(i)){let a=p.getAttribute(i);n(()=>p.setAttribute(i,a));}return p.removeAttribute(i)};case "toggleAttribute":return (i,a)=>{let u=p.hasAttribute(i),d=u?p.getAttribute(i):null,h=p.toggleAttribute(i,a);return n(()=>{u?p.setAttribute(i,d):p.removeAttribute(i);}),h};case "setAttributeNS":return (i,a,u)=>{let d=a.includes(":")?a.split(":")[1]:a,h=p.hasAttributeNS(i,d),w=p.getAttributeNS(i,d),C=p.getAttributeNodeNS(i,d)?.name??d;return n(()=>h?p.setAttributeNS(i,C,w):p.removeAttributeNS(i,d)),p.setAttributeNS(i,a,u)};case "removeAttributeNS":return (i,a)=>{if(p.hasAttributeNS(i,a)){let u=p.getAttributeNS(i,a),d=p.getAttributeNodeNS(i,a)?.name??a;n(()=>p.setAttributeNS(i,d,u));}return p.removeAttributeNS(i,a)};case "setAttributeNode":return i=>{let a=p.getAttributeNode(i.name),u=a?.value,d=p.setAttributeNode(i);return n(()=>{a&&u!==void 0?(a.value=u,p.setAttributeNode(a)):p.removeAttribute(i.name);}),d};case "removeAttributeNode":return i=>{let a=i.value,u=i.name,d=p.removeAttributeNode(i);return n(()=>{let h=document.createAttribute(u);h.value=a,p.setAttributeNode(h);}),d};case "appendChild":return i=>{let a=m(i),u=a.parentNode?L(a):null,d=G(a),h=p.appendChild(a);return n(()=>{if(d.length>0)for(let w of d)w.parentNode?.removeChild(w);else a.parentNode?.removeChild(a);u&&P(a,u);}),M(h)};case "removeChild":return i=>{let a=m(i),u=a.nextSibling,d=p.removeChild(a);return n(()=>p.insertBefore(a,u)),M(d)};case "insertBefore":return (i,a)=>{let u=m(i),d=a?m(a):null,h=u.parentNode?L(u):null,w=G(u),C=p.insertBefore(u,d);return n(()=>{if(w.length>0)for(let D of w)D.parentNode?.removeChild(D);else u.parentNode?.removeChild(u);h&&P(u,h);}),M(C)};case "replaceChild":return (i,a)=>{let u=m(i),d=m(a),h=d.nextSibling,w=u.parentNode?L(u):null,C=G(u),D=p.replaceChild(u,d);return n(()=>{if(C.length>0){let U=C[0];U?.parentNode&&U.parentNode.replaceChild(d,U);for(let I=1;I<C.length;I++)C[I].parentNode?.removeChild(C[I]);}else p.replaceChild(d,u);h&&h.parentNode===p&&d.nextSibling!==h&&p.insertBefore(d,h),w&&P(u,w);}),M(D)};case "remove":return ()=>{let i=b.parentNode,a=b.nextSibling;p.remove(),n(()=>i?.insertBefore(b,a));};case "append":return W(p.append.bind(p),()=>Array.from(p.childNodes));case "prepend":return W(p.prepend.bind(p),()=>Array.from(p.childNodes));case "after":return W(p.after.bind(p),()=>p.parentNode?Array.from(p.parentNode.childNodes):[]);case "before":return W(p.before.bind(p),()=>p.parentNode?Array.from(p.parentNode.childNodes):[]);case "replaceWith":return (...i)=>{let a=A(i),u=b.parentNode,d=b.nextSibling,h=new Map;for(let U of a)typeof U!="string"&&!(U instanceof DocumentFragment)&&U.parentNode&&h.set(U,L(U));let w=u?Array.from(u.childNodes):[];p.replaceWith(...a);let D=(u?Array.from(u.childNodes):[]).filter(U=>!w.includes(U));n(()=>{let U=D[0];if(u){u.insertBefore(b,U??d);for(let I of D)I!==b&&I.parentNode?.removeChild(I);}for(let[I,ne]of h)P(I,ne);});};case "replaceChildren":return (...i)=>{let a=A(i),u=Array.from(p.childNodes),d=new Map;for(let h of a)typeof h!="string"&&h.parentNode&&h.parentNode!==p&&d.set(h,L(h));p.replaceChildren(...a),n(()=>{p.replaceChildren(...u);for(let[h,w]of d)P(h,w);});};case "insertAdjacentHTML":return (i,a)=>{let u=Array.from(p.childNodes),d=p.parentNode?Array.from(p.parentNode.childNodes):[];p.insertAdjacentHTML(i,a);let h=Array.from(p.childNodes).filter(C=>!u.includes(C)),w=p.parentNode?Array.from(p.parentNode.childNodes).filter(C=>!d.includes(C)):[];n(()=>[...h,...w].forEach(C=>C.parentNode?.removeChild(C)));};case "insertAdjacentElement":return (i,a)=>{let u=m(a),d=u.parentNode?L(u):null,h=p.insertAdjacentElement(i,u);return h&&n(()=>{h.parentNode?.removeChild(h),d&&P(u,d);}),h?M(h):null};case "insertAdjacentText":return (i,a)=>{let u=Array.from(p.childNodes),d=p.parentNode?Array.from(p.parentNode.childNodes):[];p.insertAdjacentText(i,a);let h=Array.from(p.childNodes).filter(C=>!u.includes(C)),w=p.parentNode?Array.from(p.parentNode.childNodes).filter(C=>!d.includes(C)):[];n(()=>[...h,...w].forEach(C=>C.parentNode?.removeChild(C)));};case "setHTML":return (i,a)=>{if("setHTML"in p){let u=p.innerHTML;p.setHTML(i,a),n(()=>{p.innerHTML=u;});}};case "normalize":return ()=>{let i=[],a=document.createTreeWalker(p,NodeFilter.SHOW_TEXT),u=a.nextNode();for(;u;){let C=u.nextSibling;for(;C&&C.nodeType===Node.TEXT_NODE;)C=C.nextSibling;i.push({parent:u.parentNode,data:u.data,nextNonTextSibling:C}),u=a.nextNode();}p.normalize();let d=[],h=document.createTreeWalker(p,NodeFilter.SHOW_TEXT),w=h.nextNode();for(;w;)d.push(w),w=h.nextNode();n(()=>{for(let I of d)I.parentNode?.removeChild(I);let C=null,D=null,U;for(let{parent:I,data:ne,nextNonTextSibling:oe}of i){let Se=document.createTextNode(ne);I===D&&oe===U&&C?I.insertBefore(Se,C.nextSibling):I.insertBefore(Se,oe),C=Se,D=I,U=oe;}});};case "cloneNode":return i=>{let a=p.cloneNode(i);return M(a)};case "addEventListener":return (i,a,u)=>{p.addEventListener(i,a,u),n(()=>p.removeEventListener(i,a,u));};case "removeEventListener":return (i,a,u)=>{p.removeEventListener(i,a,u),n(()=>p.addEventListener(i,a,u));};case "attachShadow":return i=>{let a=p.attachShadow(i);return n(()=>{a.innerHTML="";}),M(a)};case "animate":return (i,a)=>{let u=p.animate(i,a);return n(()=>u.cancel()),u};case "showModal":return ()=>{let i=b;if("showModal"in i){let a=i.open;i.showModal(),a||n(()=>i.close());}};case "show":return ()=>{let i=b;if("show"in i){let a=i.open;i.show(),a||n(()=>i.close());}};case "close":return i=>{let a=b;if("close"in a){let u=a.open,d=a.matches(":modal"),h=a.returnValue;a.close(i),u&&n(()=>{a.returnValue=h,d?a.showModal():a.show();});}};case "showPopover":return ()=>{if("showPopover"in p&&"hidePopover"in p){let i=p,a=p.matches(":popover-open");i.showPopover(),a||n(()=>i.hidePopover());}};case "hidePopover":return ()=>{if("hidePopover"in p&&"showPopover"in p){let i=p,a=p.matches(":popover-open");i.hidePopover(),a&&n(()=>i.showPopover());}};case "togglePopover":return i=>{if("togglePopover"in p){let a=p,u=p.matches(":popover-open"),d=a.togglePopover(i);return n(()=>a.togglePopover(u)),d}return false};case "scrollTo":return (i,a)=>{let u=p.scrollLeft,d=p.scrollTop;typeof i=="number"?p.scrollTo(i,a??p.scrollTop):p.scrollTo(i),n(()=>p.scrollTo(u,d));};case "scrollBy":return (i,a)=>{let u=p.scrollLeft,d=p.scrollTop;typeof i=="number"?p.scrollBy(i,a??0):p.scrollBy(i),n(()=>p.scrollTo(u,d));};case "scrollIntoView":return i=>{let a=T(p),u=a?.scrollLeft??0,d=a?.scrollTop??0;p.scrollIntoView(i),a&&n(()=>a.scrollTo(u,d));};case "setSelectionRange":return (i,a,u)=>{let d=b;if("setSelectionRange"in d){let h=d.selectionStart,w=d.selectionEnd,C=d.selectionDirection;d.setSelectionRange(i,a,u),n(()=>d.setSelectionRange(h,w,C??void 0));}};case "setRangeText":return (i,a,u,d)=>{let h=b;if("setRangeText"in h){let w=h.value,C=h.selectionStart,D=h.selectionEnd;a!==void 0&&u!==void 0?h.setRangeText(i,a,u,d):h.setRangeText(i),n(()=>{h.value=w,h.setSelectionRange(C,D);});}};case "splitText":return i=>{let a=b;if("splitText"in a){let u=a.data,d=a.splitText(i);return n(()=>{a.data=u,d.parentNode?.removeChild(d);}),M(d)}return null};case "appendData":return i=>{let a=b;if("appendData"in a){let u=a.length;a.appendData(i),n(()=>a.deleteData(u,i.length));}};case "deleteData":return (i,a)=>{let u=b;if("deleteData"in u){let d=u.substringData(i,a);u.deleteData(i,a),n(()=>u.insertData(i,d));}};case "insertData":return (i,a)=>{let u=b;"insertData"in u&&(u.insertData(i,a),n(()=>u.deleteData(i,a.length)));};case "replaceData":return (i,a,u)=>{let d=b;if("replaceData"in d){let h=d.substringData(i,a);d.replaceData(i,a,u),n(()=>d.replaceData(i,u.length,h));}};case "focus":return i=>{let a=document.activeElement;p.focus(i),n(()=>{a&&a!==document.body&&"focus"in a?a.focus():p.blur();});};case "blur":return ()=>{let i=document.activeElement===p;p.blur(),i&&n(()=>p.focus());};case "reset":return ()=>{let i=b;if("reset"in i&&"elements"in i){let a=new Map;for(let u=0;u<i.elements.length;u++){let d=i.elements[u];if("value"in d)if(d instanceof HTMLInputElement&&(d.type==="checkbox"||d.type==="radio"))a.set(d,d.checked);else if(d instanceof HTMLSelectElement)if(d.multiple){let h=[];for(let w=0;w<d.options.length;w++)h.push(d.options[w].selected);a.set(d,h);}else a.set(d,d.selectedIndex);else a.set(d,d.value);}i.reset(),n(()=>{for(let[u,d]of a)if(u instanceof HTMLInputElement&&(u.type==="checkbox"||u.type==="radio"))u.checked=d;else if(u instanceof HTMLSelectElement)if(u.multiple){let h=d;for(let w=0;w<u.options.length;w++)u.options[w].selected=h[w]??false;}else u.selectedIndex=d;else "value"in u&&(u.value=d);});}};case "submit":return ()=>{let i=b;"submit"in i&&i.submit();};case "requestSubmit":return i=>{let a=b;if("requestSubmit"in a){let u=i&&m(i);a.requestSubmit(u);}};case "setCustomValidity":return i=>{let a=b;if("setCustomValidity"in a){let d=a.validity.customError?a.validationMessage:"";a.setCustomValidity(i),n(()=>a.setCustomValidity(d));}};case "insertRow":return i=>{let a=b;if("insertRow"in a){let u=a.insertRow(i);return n(()=>u.parentNode?.removeChild(u)),M(u)}return null};case "deleteRow":return i=>{let a=b;if("deleteRow"in a&&"rows"in a){let u=i<0?a.rows.length+i:i,d=a.rows[u];if(d){let h=d.outerHTML;a.deleteRow(i),n(()=>{let w=document.createElement("table");w.innerHTML=h;let C=w.rows[0];C&&(u>=a.rows.length?a.appendChild(C):a.insertBefore(C,a.rows[u]));});}}};case "insertCell":return i=>{let a=b;if("insertCell"in a){let u=a.insertCell(i);return n(()=>u.parentNode?.removeChild(u)),M(u)}return null};case "deleteCell":return i=>{let a=b;if("deleteCell"in a&&"cells"in a){let u=i<0?a.cells.length+i:i,d=a.cells[u];if(d){let h=d.outerHTML;a.deleteCell(i),n(()=>{let w=document.createElement("tr");w.innerHTML=h;let C=w.cells[0];C&&(u>=a.cells.length?a.appendChild(C):a.insertBefore(C,a.cells[u]));});}}};case "createTHead":return ()=>{let i=b;if("createTHead"in i){let a=i.tHead,u=i.createTHead();return a||n(()=>i.deleteTHead()),M(u)}return null};case "deleteTHead":return ()=>{let i=b;if("deleteTHead"in i&&i.tHead){let a=i.tHead.outerHTML;i.deleteTHead(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.tHead;d&&(i.firstChild?i.insertBefore(d,i.firstChild):i.appendChild(d));});}};case "createTFoot":return ()=>{let i=b;if("createTFoot"in i){let a=i.tFoot,u=i.createTFoot();return a||n(()=>i.deleteTFoot()),M(u)}return null};case "deleteTFoot":return ()=>{let i=b;if("deleteTFoot"in i&&i.tFoot){let a=i.tFoot.outerHTML;i.deleteTFoot(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.tFoot;d&&i.appendChild(d);});}};case "createTBody":return ()=>{let i=b;if("createTBody"in i){let a=i.createTBody();return n(()=>a.parentNode?.removeChild(a)),M(a)}return null};case "createCaption":return ()=>{let i=b;if("createCaption"in i){let a=i.caption,u=i.createCaption();return a||n(()=>i.deleteCaption()),M(u)}return null};case "deleteCaption":return ()=>{let i=b;if("deleteCaption"in i&&i.caption){let a=i.caption.outerHTML;i.deleteCaption(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.caption;d&&(i.firstChild?i.insertBefore(d,i.firstChild):i.appendChild(d));});}};case "add":return (i,a)=>{let u=b;if("add"in u&&"options"in u){let d=m(i),h=typeof a=="number"||a==null?a:m(a);u.add(d,h),n(()=>d.parentNode?.removeChild(d));}};case "stepUp":return i=>{let a=b;if("stepUp"in a){let u=a.value;a.stepUp(i),n(()=>{a.value=u;});}};case "stepDown":return i=>{let a=b;if("stepDown"in a){let u=a.value;a.stepDown(i),n(()=>{a.value=u;});}};case "play":return ()=>{let i=b;if("play"in i){let a=i.paused,u=i.currentTime,d=i.play();return a&&n(()=>{i.pause(),i.currentTime=u;}),d}return Promise.resolve()};case "pause":return ()=>{let i=b;if("pause"in i){let a=i.paused,u=i.currentTime;i.pause(),a||n(()=>{i.currentTime=u,i.play();});}};case "load":return ()=>{let i=b;if("load"in i){let a=i.currentTime,u=i.src;i.load(),n(()=>{i.src===u&&(i.currentTime=a);});}};case "fastSeek":return i=>{let a=b;if("fastSeek"in a){let u=a.currentTime;a.fastSeek(i),n(()=>{a.currentTime=u;});}};case "setPointerCapture":return i=>{let a=b;"setPointerCapture"in a&&(a.setPointerCapture(i),n(()=>{try{a.releasePointerCapture(i);}catch{}}));};case "webkitMatchesSelector":return i=>{let a=b,u=a;return u.webkitMatchesSelector?u.webkitMatchesSelector(i):a.matches(i)};case "contains":return i=>b.contains(i?m(i):null);case "compareDocumentPosition":return i=>b.compareDocumentPosition(m(i));case "getRootNode":return i=>M(b.getRootNode(i));case "isEqualNode":return i=>b.isEqualNode(i?m(i):null);case "isSameNode":return i=>b.isSameNode(i?m(i):null);default:return null}},T=b=>{let _=b.parentElement;for(;_;){let{overflow:p,overflowY:i,overflowX:a}=getComputedStyle(_);if(p==="auto"||p==="scroll"||i==="auto"||i==="scroll"||a==="auto"||a==="scroll")return _;_=_.parentElement;}return document.documentElement},k=(b,_)=>{if(typeof _=="symbol")return false;if(Js.has(_))return true;let p=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(b),_);return !!(p&&p.get&&!p.set)},M=b=>{if(!b)return null;let _=o.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a===Symbol.toStringTag)return i[Symbol.toStringTag];if(a===Symbol.toPrimitive)return i[Symbol.toPrimitive]?.bind(i);if(a===Symbol.iterator&&Symbol.iterator in i)return i[Symbol.iterator].bind(i);if(a==="constructor")return i.constructor;let u=i;if(a==="style"&&"style"in i)return te(u.style);if(a==="classList"&&"classList"in i)return ee(u.classList);if(a==="dataset"&&"dataset"in i)return Z(u.dataset);if(a==="attributes"&&"attributes"in i)return ce(u.attributes);if(a==="attributeStyleMap"&&"attributeStyleMap"in i)return j(u.attributeStyleMap);if(a==="shadowRoot"&&"shadowRoot"in i)return u.shadowRoot?M(u.shadowRoot):null;if(a==="content"&&i instanceof HTMLTemplateElement)return M(i.content);if(typeof a=="string"&&wr.has(a)&&a in i){let h=i[a];if(h instanceof DOMTokenList)return ee(h)}if(a==="options"&&i instanceof HTMLSelectElement)return E(i.options,i);if(typeof a=="string"&&Vs.has(a))return M(i[a]);if(a==="children"||a==="childNodes")return N(i[a]);if(typeof a=="string"&&Gs.has(a)){let h=i;return w=>{let C=h[a]?.(w);return C?M(C):null}}if(typeof a=="string"&&Ks.has(a)){let h=i;if(a==="querySelectorAll")return w=>H(h.querySelectorAll(w));if(a==="getElementsByClassName")return w=>N(h.getElementsByClassName(w));if(a==="getElementsByTagName")return w=>N(h.getElementsByTagName(w));if(a==="getElementsByTagNameNS")return (w,C)=>N(h.getElementsByTagNameNS(w,C))}if(typeof a=="string"&&Ws.has(a)){let h=y(i,a);if(h)return h}let d=Reflect.get(i,a);return typeof d=="function"?d.bind(i):d},set(i,a,u){if(k(i,a))return Reflect.set(i,a,u);let d=typeof a=="string"?a:String(a),h=i,w=()=>{let C=h[d];n(()=>{h[d]=C;});};if(qs.has(d))w();else if(Ys.has(d)&&B(i))w();else if(d==="innerText"||d==="textContent"||d==="innerHTML"){let C=i,D=C.innerHTML;n(()=>{C.innerHTML=D;});}else if(wr.has(d)&&d in i){let C=h[d];if(C instanceof DOMTokenList){let D=C.value;n(()=>{h[d]=D;});}else w();}else if(Xs.has(d))w();else if(Zs.has(d)&&$(i))w();else if(d==="outerHTML"){let C=i,D=C.parentNode,U=C.nextSibling,I=C.outerHTML,ne=D?Array.from(D.childNodes):[],oe=Reflect.set(i,a,u),gt=(D?Array.from(D.childNodes):[]).filter(re=>!ne.includes(re));return n(()=>{for(let Y of gt)Y.parentNode?.removeChild(Y);let re=C.tagName.toLowerCase(),ge=null;if(re==="tr"){let Y=document.createElement("table");Y.innerHTML=I,ge=Y.querySelector("tr");}else if(re==="td"||re==="th"){let Y=document.createElement("table");Y.innerHTML=`<tbody><tr>${I}</tr></tbody>`,ge=Y.querySelector(re);}else if(re==="thead"||re==="tbody"||re==="tfoot"||re==="caption"||re==="colgroup"){let Y=document.createElement("table");Y.innerHTML=I,ge=Y.querySelector(re);}else if(re==="col"){let Y=document.createElement("table");Y.innerHTML=`<colgroup>${I}</colgroup>`,ge=Y.querySelector("col");}else {let Y=document.createElement("div");Y.innerHTML=I,ge=Y.firstChild;}ge&&D&&D.insertBefore(ge,U);}),oe}else w();return Reflect.set(i,a,u)}});return r.set(p,b),o.set(b,p),p},B=b=>b instanceof HTMLInputElement||b instanceof HTMLTextAreaElement||b instanceof HTMLSelectElement||b instanceof HTMLOptionElement,$=b=>b instanceof HTMLMediaElement;return {proxy:M(e),undo:()=>{for(let b=t.length-1;b>=0;b--)t[b]();}}},Qs=e=>{let t=e.cloneNode(false),n=document.createElement("div");n.appendChild(t);let r=n.innerHTML,o=r.match(/<\/[^>]+>$/);return o?r.slice(0,-o[0].length):r},ea=e=>`</${e.tagName.toLowerCase()}>`,xr=e=>{let t=document.createElement("div");t.innerHTML=e;let n=t.querySelectorAll("svg");for(let r of n){let o=document.createElementNS("http://www.w3.org/2000/svg","svg");r.hasAttribute("class")&&o.setAttribute("class",r.getAttribute("class")),r.hasAttribute("id")&&o.setAttribute("id",r.getAttribute("id")),o.textContent="...",r.replaceWith(o);}return t.innerHTML},Ze=e=>{let t=[],n=e.parentElement;for(let c=0;c<5&&n&&!(n===document.body||n===document.documentElement);c++)t.push(n),n=n.parentElement;if(t.length===0)return xr(e.outerHTML);t.reverse();let r="",o="";for(let c of t)r+=`${o}${Qs(c)}
|
|
23
|
+
</${t}>`:`<${t}${r} />`};var Us="application/x-react-grab",Yt=(e,t)=>{let n=JSON.stringify({version:Do,content:e,timestamp:Date.now(),...t?.prompt}),r=s=>{s.preventDefault(),s.clipboardData?.setData("text/plain",e),s.clipboardData?.setData(Us,n);};document.addEventListener("copy",r);let o=document.createElement("textarea");o.value=e,o.style.position="fixed",o.style.left="-9999px",o.ariaHidden="true",document.body.appendChild(o),o.select();try{let s=document.execCommand("copy");return s&&t?.onSuccess?.(),s}finally{document.removeEventListener("copy",r),o.remove();}};var js=new Set(["parentElement","parentNode","firstChild","lastChild","nextSibling","previousSibling","firstElementChild","lastElementChild","nextElementSibling","previousElementSibling"]),Vs=new Set(["querySelector","closest"]),Gs=new Set(["querySelectorAll","getElementsByClassName","getElementsByTagName","getElementsByTagNameNS"]),Ks=new Set(["setAttribute","removeAttribute","toggleAttribute","setAttributeNS","removeAttributeNS","setAttributeNode","removeAttributeNode","appendChild","removeChild","insertBefore","replaceChild","remove","append","prepend","after","before","replaceWith","replaceChildren","insertAdjacentHTML","insertAdjacentElement","insertAdjacentText","setHTML","normalize","cloneNode","addEventListener","removeEventListener","attachShadow","animate","showModal","show","close","showPopover","hidePopover","togglePopover","scrollTo","scrollBy","scrollIntoView","setSelectionRange","setRangeText","splitText","appendData","deleteData","insertData","replaceData","focus","blur","reset","submit","requestSubmit","setCustomValidity","insertRow","deleteRow","insertCell","deleteCell","createTHead","deleteTHead","createTFoot","deleteTFoot","createTBody","createCaption","deleteCaption","add","stepUp","stepDown","play","pause","load","fastSeek","setPointerCapture","webkitMatchesSelector","contains","compareDocumentPosition","getRootNode","isEqualNode","isSameNode"]),Ws=new Set(["scrollTop","scrollLeft"]),qs=new Set(["value","checked","selected","selectedIndex","disabled","readOnly","required","defaultValue","defaultChecked"]),Ys=new Set(["hidden","tabIndex","title","lang","dir","contentEditable","draggable","spellcheck","inert","slot","id","className","accessKey","autocapitalize","enterKeyHint","inputMode","nonce","popover","open","returnValue","indeterminate","type","name","placeholder","pattern","min","max","step","multiple","accept","src","href","alt","loading","crossOrigin","referrerPolicy","download","cols","rows","wrap","srcdoc","allowFullscreen","allow","rel","target","hreflang","media","sizes","srcset","decoding","fetchPriority","isMap","useMap","formAction","formEnctype","formMethod","formNoValidate","formTarget","maxLength","minLength","size","autocomplete","autofocus","dirName","list","noValidate","action","enctype","method","acceptCharset","cite","dateTime","label","span","headers","scope","abbr","colSpan","rowSpan","start","reversed","high","low","optimum","default","kind","srclang","integrity","as","blocking","async","defer","noModule","htmlFor","httpEquiv","content","charset","coords","shape","ping","seamless","width","height","data","form","summary","nodeValue"]),Xs=new Set(["currentTime","volume","muted","playbackRate","defaultPlaybackRate","autoplay","loop","controls","preload","poster","playsInline","disableRemotePlayback","preservesPitch","defaultMuted"]),Zs=new Set(["nodeName","nodeType","tagName","localName","namespaceURI","prefix","baseURI","isConnected","ownerDocument","offsetWidth","offsetHeight","offsetTop","offsetLeft","offsetParent","clientWidth","clientHeight","clientTop","clientLeft","scrollWidth","scrollHeight","computedStyleMap","assignedSlot","sheet","naturalWidth","naturalHeight","complete","currentSrc","videoWidth","videoHeight","duration","paused","ended","seeking","readyState","networkState","buffered","played","seekable","error","textTracks","audioTracks","videoTracks","mediaKeys","validity","validationMessage","willValidate","files","labels","form","selectionStart","selectionEnd","selectionDirection","textLength","options","selectedOptions","length","tHead","tFoot","tBodies","caption","rowIndex","sectionRowIndex","cellIndex","cells","control","internals","part"]),wr=new Set(["relList","sandbox","controlsList","part"]),mt=e=>{let t=[],n=b=>t.push(b),r=new WeakMap,o=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,f=new WeakMap,g=new WeakMap,S=new WeakMap,m=b=>r.get(b)??b,A=b=>b.map(_=>typeof _=="string"?_:m(_)),L=b=>({parent:b.parentNode,nextSibling:b.nextSibling}),P=(b,_)=>{_.parent&&_.parent.insertBefore(b,_.nextSibling);},G=b=>b instanceof DocumentFragment?Array.from(b.childNodes):[],W=(b,_)=>((...p)=>{let i=A(p),a=new Map;for(let w of i)typeof w!="string"&&!(w instanceof DocumentFragment)&&w.parentNode&&a.set(w,L(w));let u=_();b(...i);let h=_().filter(w=>!u.includes(w));n(()=>{for(let w of h)w.parentNode?.removeChild(w);for(let[w,C]of a)P(w,C);});}),te=b=>{let _=s.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="setProperty")return (d,h,w)=>{let C=i.getPropertyValue(d),D=i.getPropertyPriority(d);i.setProperty(d,h,w),n(()=>i.setProperty(d,C,D));};if(a==="removeProperty")return d=>{let h=i.getPropertyValue(d),w=i.getPropertyPriority(d),C=i.removeProperty(d);return h&&n(()=>i.setProperty(d,h,w)),C};let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(typeof a=="string"){let d=i.getPropertyValue(a)||i[a]||"";n(()=>{i[a]=d;});}return Reflect.set(i,a,u)}});return s.set(b,p),p},ee=b=>{let _=l.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="add")return (...d)=>{let h=d.filter(w=>!i.contains(w));return n(()=>i.remove(...h)),i.add(...d)};if(a==="remove")return (...d)=>{let h=d.filter(w=>i.contains(w));return n(()=>i.add(...h)),i.remove(...d)};if(a==="toggle")return (d,h)=>{let w=i.contains(d),C=i.toggle(d,h);return n(()=>w?i.add(d):i.remove(d)),C};if(a==="replace")return (d,h)=>{let w=i.contains(d),C=i.contains(h),D=i.replace(d,h);return w&&n(()=>{C||i.remove(h),i.add(d);}),D};if(a==="value")return i.value;let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(a==="value"){let d=i.value;n(()=>{i.value=d;});}return Reflect.set(i,a,u)}});return l.set(b,p),p},Z=b=>{let _=c.get(b);if(_)return _;let p=new Proxy(b,{set(i,a,u){if(typeof a=="string"){let d=i[a],h=a in i;n(()=>h?i[a]=d:delete i[a]);}return Reflect.set(i,a,u)},deleteProperty(i,a){if(typeof a=="string"&&a in i){let u=i[a];n(()=>{i[a]=u;});}return Reflect.deleteProperty(i,a)}});return c.set(b,p),p},ce=b=>{let _=f.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(typeof a=="string"&&!isNaN(Number(a))){let d=i[Number(a)];return d?R(d):void 0}if(a==="item")return d=>{let h=i.item(d);return h?R(h):null};if(a==="getNamedItem")return d=>{let h=i.getNamedItem(d);return h?R(h):null};if(a==="getNamedItemNS")return (d,h)=>{let w=i.getNamedItemNS(d,h);return w?R(w):null};if(a==="setNamedItem")return d=>{let h=i.getNamedItem(d.name),w=h?.value,C=i.setNamedItem(d);return n(()=>{h&&w!==void 0?(h.value=w,i.setNamedItem(h)):i.removeNamedItem(d.name);}),C};if(a==="setNamedItemNS")return d=>{let h=i.getNamedItemNS(d.namespaceURI,d.localName),w=h?.value,C=i.setNamedItemNS(d);return n(()=>{h&&w!==void 0?(h.value=w,i.setNamedItemNS(h)):d.namespaceURI?i.removeNamedItemNS(d.namespaceURI,d.localName):i.removeNamedItem(d.name);}),C};if(a==="removeNamedItem")return d=>{let h=i.getNamedItem(d);if(h){let w=h.value,C=i.removeNamedItem(d);return n(()=>{let D=document.createAttribute(d);D.value=w,i.setNamedItem(D);}),C}return i.removeNamedItem(d)};if(a==="removeNamedItemNS")return (d,h)=>{let w=i.getNamedItemNS(d,h);if(w){let C=w.value,D=w.name,U=i.removeNamedItemNS(d,h);return n(()=>{let I=d?document.createAttributeNS(d,D):document.createAttribute(h);I.value=C,d?i.setNamedItemNS(I):i.setNamedItem(I);}),U}return i.removeNamedItemNS(d,h)};if(a===Symbol.iterator)return function*(){for(let d=0;d<i.length;d++)yield R(i[d]);};let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u}});return f.set(b,p),p},ue=new WeakMap,R=b=>{let _=ue.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u},set(i,a,u){if(a==="value"){let d=i.value;n(()=>{i.value=d;});}return Reflect.set(i,a,u)}});return ue.set(b,p),p},j=b=>{let _=g.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a==="set")return (d,...h)=>{let w=i.get(d);i.set(d,...h),n(()=>{w?i.set(d,w):i.delete(d);});};if(a==="delete")return d=>{let h=i.get(d);i.delete(d),h&&n(()=>i.set(d,h));};if(a==="append")return (d,...h)=>{let w=i.getAll(d);i.append(d,...h),n(()=>{i.delete(d);for(let C of w)i.append(d,C);});};if(a==="clear")return ()=>{let d=[];i.forEach((h,w)=>{d.push([w,i.getAll(w)]);}),i.clear(),n(()=>{for(let[h,w]of d)for(let C of w)i.append(h,C);});};if(a===Symbol.iterator)return i[Symbol.iterator].bind(i);let u=Reflect.get(i,a);return typeof u=="function"?u.bind(i):u}});return g.set(b,p),p},H=b=>new Proxy(b,{get(_,p){if(typeof p=="string"&&!isNaN(Number(p)))return M(_[Number(p)]??null);if(p==="item")return a=>M(_.item(a));if(p===Symbol.iterator)return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};if(p==="forEach")return (a,u)=>{_.forEach((d,h,w)=>{a.call(u,M(d),h,w);});};if(p==="entries")return function*(){for(let a=0;a<_.length;a++)yield [a,M(_[a])];};if(p==="keys")return _.keys.bind(_);if(p==="values")return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};let i=Reflect.get(_,p);return typeof i=="function"?i.bind(_):i}}),N=b=>b?new Proxy(b,{get(_,p){if(typeof p=="string"&&!isNaN(Number(p)))return M(_[Number(p)]??null);if(p==="item")return a=>M(_.item(a));if(p==="namedItem"&&"namedItem"in _)return a=>M(_.namedItem(a));if(p===Symbol.iterator)return function*(){for(let a=0;a<_.length;a++)yield M(_[a]);};let i=Reflect.get(_,p);return typeof i=="function"?i.bind(_):i}}):null,E=(b,_)=>{let p=S.get(b);if(p)return p;let i=new Proxy(b,{get(a,u){if(typeof u=="string"&&!isNaN(Number(u)))return M(a[Number(u)]??null);if(u==="item")return h=>M(a.item(h));if(u==="namedItem")return h=>M(a.namedItem(h));if(u==="add")return (h,w)=>{let C=m(h),D=typeof w=="number"||w==null?w:m(w);a.add(C,D),n(()=>C.parentNode?.removeChild(C));};if(u==="remove")return h=>{let w=a[h];if(w){let C=w.outerHTML,D=h;a.remove(h),n(()=>{let U=document.createElement("div");U.innerHTML=C;let I=U.firstChild;I&&(D>=a.length?_.appendChild(I):_.insertBefore(I,a[D]));});}};if(u==="selectedIndex")return a.selectedIndex;if(u==="length")return a.length;if(u===Symbol.iterator)return function*(){for(let h=0;h<a.length;h++)yield M(a[h]);};let d=Reflect.get(a,u);return typeof d=="function"?d.bind(a):d},set(a,u,d){if(u==="selectedIndex"){let h=a.selectedIndex;n(()=>{a.selectedIndex=h;});}if(u==="length"){let h=[];for(let w=0;w<a.length;w++)h.push(a[w].outerHTML);n(()=>{for(;a.length>0;)a.remove(0);for(let w of h){let C=document.createElement("div");C.innerHTML=w;let D=C.firstChild;D&&_.appendChild(D);}});}return Reflect.set(a,u,d)}});return S.set(b,i),i},y=(b,_)=>{let p=b;switch(_){case "setAttribute":return (i,a)=>{let u=p.hasAttribute(i),d=p.getAttribute(i);return n(()=>u?p.setAttribute(i,d):p.removeAttribute(i)),p.setAttribute(i,a)};case "removeAttribute":return i=>{if(p.hasAttribute(i)){let a=p.getAttribute(i);n(()=>p.setAttribute(i,a));}return p.removeAttribute(i)};case "toggleAttribute":return (i,a)=>{let u=p.hasAttribute(i),d=u?p.getAttribute(i):null,h=p.toggleAttribute(i,a);return n(()=>{u?p.setAttribute(i,d):p.removeAttribute(i);}),h};case "setAttributeNS":return (i,a,u)=>{let d=a.includes(":")?a.split(":")[1]:a,h=p.hasAttributeNS(i,d),w=p.getAttributeNS(i,d),C=p.getAttributeNodeNS(i,d)?.name??d;return n(()=>h?p.setAttributeNS(i,C,w):p.removeAttributeNS(i,d)),p.setAttributeNS(i,a,u)};case "removeAttributeNS":return (i,a)=>{if(p.hasAttributeNS(i,a)){let u=p.getAttributeNS(i,a),d=p.getAttributeNodeNS(i,a)?.name??a;n(()=>p.setAttributeNS(i,d,u));}return p.removeAttributeNS(i,a)};case "setAttributeNode":return i=>{let a=p.getAttributeNode(i.name),u=a?.value,d=p.setAttributeNode(i);return n(()=>{a&&u!==void 0?(a.value=u,p.setAttributeNode(a)):p.removeAttribute(i.name);}),d};case "removeAttributeNode":return i=>{let a=i.value,u=i.name,d=p.removeAttributeNode(i);return n(()=>{let h=document.createAttribute(u);h.value=a,p.setAttributeNode(h);}),d};case "appendChild":return i=>{let a=m(i),u=a.parentNode?L(a):null,d=G(a),h=p.appendChild(a);return n(()=>{if(d.length>0)for(let w of d)w.parentNode?.removeChild(w);else a.parentNode?.removeChild(a);u&&P(a,u);}),M(h)};case "removeChild":return i=>{let a=m(i),u=a.nextSibling,d=p.removeChild(a);return n(()=>p.insertBefore(a,u)),M(d)};case "insertBefore":return (i,a)=>{let u=m(i),d=a?m(a):null,h=u.parentNode?L(u):null,w=G(u),C=p.insertBefore(u,d);return n(()=>{if(w.length>0)for(let D of w)D.parentNode?.removeChild(D);else u.parentNode?.removeChild(u);h&&P(u,h);}),M(C)};case "replaceChild":return (i,a)=>{let u=m(i),d=m(a),h=d.nextSibling,w=u.parentNode?L(u):null,C=G(u),D=p.replaceChild(u,d);return n(()=>{if(C.length>0){let U=C[0];U?.parentNode&&U.parentNode.replaceChild(d,U);for(let I=1;I<C.length;I++)C[I].parentNode?.removeChild(C[I]);}else p.replaceChild(d,u);h&&h.parentNode===p&&d.nextSibling!==h&&p.insertBefore(d,h),w&&P(u,w);}),M(D)};case "remove":return ()=>{let i=b.parentNode,a=b.nextSibling;p.remove(),n(()=>i?.insertBefore(b,a));};case "append":return W(p.append.bind(p),()=>Array.from(p.childNodes));case "prepend":return W(p.prepend.bind(p),()=>Array.from(p.childNodes));case "after":return W(p.after.bind(p),()=>p.parentNode?Array.from(p.parentNode.childNodes):[]);case "before":return W(p.before.bind(p),()=>p.parentNode?Array.from(p.parentNode.childNodes):[]);case "replaceWith":return (...i)=>{let a=A(i),u=b.parentNode,d=b.nextSibling,h=new Map;for(let U of a)typeof U!="string"&&!(U instanceof DocumentFragment)&&U.parentNode&&h.set(U,L(U));let w=u?Array.from(u.childNodes):[];p.replaceWith(...a);let D=(u?Array.from(u.childNodes):[]).filter(U=>!w.includes(U));n(()=>{let U=D[0];if(u){u.insertBefore(b,U??d);for(let I of D)I!==b&&I.parentNode?.removeChild(I);}for(let[I,ne]of h)P(I,ne);});};case "replaceChildren":return (...i)=>{let a=A(i),u=Array.from(p.childNodes),d=new Map;for(let h of a)typeof h!="string"&&h.parentNode&&h.parentNode!==p&&d.set(h,L(h));p.replaceChildren(...a),n(()=>{p.replaceChildren(...u);for(let[h,w]of d)P(h,w);});};case "insertAdjacentHTML":return (i,a)=>{let u=Array.from(p.childNodes),d=p.parentNode?Array.from(p.parentNode.childNodes):[];p.insertAdjacentHTML(i,a);let h=Array.from(p.childNodes).filter(C=>!u.includes(C)),w=p.parentNode?Array.from(p.parentNode.childNodes).filter(C=>!d.includes(C)):[];n(()=>[...h,...w].forEach(C=>C.parentNode?.removeChild(C)));};case "insertAdjacentElement":return (i,a)=>{let u=m(a),d=u.parentNode?L(u):null,h=p.insertAdjacentElement(i,u);return h&&n(()=>{h.parentNode?.removeChild(h),d&&P(u,d);}),h?M(h):null};case "insertAdjacentText":return (i,a)=>{let u=Array.from(p.childNodes),d=p.parentNode?Array.from(p.parentNode.childNodes):[];p.insertAdjacentText(i,a);let h=Array.from(p.childNodes).filter(C=>!u.includes(C)),w=p.parentNode?Array.from(p.parentNode.childNodes).filter(C=>!d.includes(C)):[];n(()=>[...h,...w].forEach(C=>C.parentNode?.removeChild(C)));};case "setHTML":return (i,a)=>{if("setHTML"in p){let u=p.innerHTML;p.setHTML(i,a),n(()=>{p.innerHTML=u;});}};case "normalize":return ()=>{let i=[],a=document.createTreeWalker(p,NodeFilter.SHOW_TEXT),u=a.nextNode();for(;u;){let C=u.nextSibling;for(;C&&C.nodeType===Node.TEXT_NODE;)C=C.nextSibling;i.push({parent:u.parentNode,data:u.data,nextNonTextSibling:C}),u=a.nextNode();}p.normalize();let d=[],h=document.createTreeWalker(p,NodeFilter.SHOW_TEXT),w=h.nextNode();for(;w;)d.push(w),w=h.nextNode();n(()=>{for(let I of d)I.parentNode?.removeChild(I);let C=null,D=null,U;for(let{parent:I,data:ne,nextNonTextSibling:oe}of i){let Se=document.createTextNode(ne);I===D&&oe===U&&C?I.insertBefore(Se,C.nextSibling):I.insertBefore(Se,oe),C=Se,D=I,U=oe;}});};case "cloneNode":return i=>{let a=p.cloneNode(i);return M(a)};case "addEventListener":return (i,a,u)=>{p.addEventListener(i,a,u),n(()=>p.removeEventListener(i,a,u));};case "removeEventListener":return (i,a,u)=>{p.removeEventListener(i,a,u),n(()=>p.addEventListener(i,a,u));};case "attachShadow":return i=>{let a=p.attachShadow(i);return n(()=>{a.innerHTML="";}),M(a)};case "animate":return (i,a)=>{let u=p.animate(i,a);return n(()=>u.cancel()),u};case "showModal":return ()=>{let i=b;if("showModal"in i){let a=i.open;i.showModal(),a||n(()=>i.close());}};case "show":return ()=>{let i=b;if("show"in i){let a=i.open;i.show(),a||n(()=>i.close());}};case "close":return i=>{let a=b;if("close"in a){let u=a.open,d=a.matches(":modal"),h=a.returnValue;a.close(i),u&&n(()=>{a.returnValue=h,d?a.showModal():a.show();});}};case "showPopover":return ()=>{if("showPopover"in p&&"hidePopover"in p){let i=p,a=p.matches(":popover-open");i.showPopover(),a||n(()=>i.hidePopover());}};case "hidePopover":return ()=>{if("hidePopover"in p&&"showPopover"in p){let i=p,a=p.matches(":popover-open");i.hidePopover(),a&&n(()=>i.showPopover());}};case "togglePopover":return i=>{if("togglePopover"in p){let a=p,u=p.matches(":popover-open"),d=a.togglePopover(i);return n(()=>a.togglePopover(u)),d}return false};case "scrollTo":return (i,a)=>{let u=p.scrollLeft,d=p.scrollTop;typeof i=="number"?p.scrollTo(i,a??p.scrollTop):p.scrollTo(i),n(()=>p.scrollTo(u,d));};case "scrollBy":return (i,a)=>{let u=p.scrollLeft,d=p.scrollTop;typeof i=="number"?p.scrollBy(i,a??0):p.scrollBy(i),n(()=>p.scrollTo(u,d));};case "scrollIntoView":return i=>{let a=T(p),u=a?.scrollLeft??0,d=a?.scrollTop??0;p.scrollIntoView(i),a&&n(()=>a.scrollTo(u,d));};case "setSelectionRange":return (i,a,u)=>{let d=b;if("setSelectionRange"in d){let h=d.selectionStart,w=d.selectionEnd,C=d.selectionDirection;d.setSelectionRange(i,a,u),n(()=>d.setSelectionRange(h,w,C??void 0));}};case "setRangeText":return (i,a,u,d)=>{let h=b;if("setRangeText"in h){let w=h.value,C=h.selectionStart,D=h.selectionEnd;a!==void 0&&u!==void 0?h.setRangeText(i,a,u,d):h.setRangeText(i),n(()=>{h.value=w,h.setSelectionRange(C,D);});}};case "splitText":return i=>{let a=b;if("splitText"in a){let u=a.data,d=a.splitText(i);return n(()=>{a.data=u,d.parentNode?.removeChild(d);}),M(d)}return null};case "appendData":return i=>{let a=b;if("appendData"in a){let u=a.length;a.appendData(i),n(()=>a.deleteData(u,i.length));}};case "deleteData":return (i,a)=>{let u=b;if("deleteData"in u){let d=u.substringData(i,a);u.deleteData(i,a),n(()=>u.insertData(i,d));}};case "insertData":return (i,a)=>{let u=b;"insertData"in u&&(u.insertData(i,a),n(()=>u.deleteData(i,a.length)));};case "replaceData":return (i,a,u)=>{let d=b;if("replaceData"in d){let h=d.substringData(i,a);d.replaceData(i,a,u),n(()=>d.replaceData(i,u.length,h));}};case "focus":return i=>{let a=document.activeElement;p.focus(i),n(()=>{a&&a!==document.body&&"focus"in a?a.focus():p.blur();});};case "blur":return ()=>{let i=document.activeElement===p;p.blur(),i&&n(()=>p.focus());};case "reset":return ()=>{let i=b;if("reset"in i&&"elements"in i){let a=new Map;for(let u=0;u<i.elements.length;u++){let d=i.elements[u];if("value"in d)if(d instanceof HTMLInputElement&&(d.type==="checkbox"||d.type==="radio"))a.set(d,d.checked);else if(d instanceof HTMLSelectElement)if(d.multiple){let h=[];for(let w=0;w<d.options.length;w++)h.push(d.options[w].selected);a.set(d,h);}else a.set(d,d.selectedIndex);else a.set(d,d.value);}i.reset(),n(()=>{for(let[u,d]of a)if(u instanceof HTMLInputElement&&(u.type==="checkbox"||u.type==="radio"))u.checked=d;else if(u instanceof HTMLSelectElement)if(u.multiple){let h=d;for(let w=0;w<u.options.length;w++)u.options[w].selected=h[w]??false;}else u.selectedIndex=d;else "value"in u&&(u.value=d);});}};case "submit":return ()=>{let i=b;"submit"in i&&i.submit();};case "requestSubmit":return i=>{let a=b;if("requestSubmit"in a){let u=i&&m(i);a.requestSubmit(u);}};case "setCustomValidity":return i=>{let a=b;if("setCustomValidity"in a){let d=a.validity.customError?a.validationMessage:"";a.setCustomValidity(i),n(()=>a.setCustomValidity(d));}};case "insertRow":return i=>{let a=b;if("insertRow"in a){let u=a.insertRow(i);return n(()=>u.parentNode?.removeChild(u)),M(u)}return null};case "deleteRow":return i=>{let a=b;if("deleteRow"in a&&"rows"in a){let u=i<0?a.rows.length+i:i,d=a.rows[u];if(d){let h=d.outerHTML;a.deleteRow(i),n(()=>{let w=document.createElement("table");w.innerHTML=h;let C=w.rows[0];C&&(u>=a.rows.length?a.appendChild(C):a.insertBefore(C,a.rows[u]));});}}};case "insertCell":return i=>{let a=b;if("insertCell"in a){let u=a.insertCell(i);return n(()=>u.parentNode?.removeChild(u)),M(u)}return null};case "deleteCell":return i=>{let a=b;if("deleteCell"in a&&"cells"in a){let u=i<0?a.cells.length+i:i,d=a.cells[u];if(d){let h=d.outerHTML;a.deleteCell(i),n(()=>{let w=document.createElement("tr");w.innerHTML=h;let C=w.cells[0];C&&(u>=a.cells.length?a.appendChild(C):a.insertBefore(C,a.cells[u]));});}}};case "createTHead":return ()=>{let i=b;if("createTHead"in i){let a=i.tHead,u=i.createTHead();return a||n(()=>i.deleteTHead()),M(u)}return null};case "deleteTHead":return ()=>{let i=b;if("deleteTHead"in i&&i.tHead){let a=i.tHead.outerHTML;i.deleteTHead(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.tHead;d&&(i.firstChild?i.insertBefore(d,i.firstChild):i.appendChild(d));});}};case "createTFoot":return ()=>{let i=b;if("createTFoot"in i){let a=i.tFoot,u=i.createTFoot();return a||n(()=>i.deleteTFoot()),M(u)}return null};case "deleteTFoot":return ()=>{let i=b;if("deleteTFoot"in i&&i.tFoot){let a=i.tFoot.outerHTML;i.deleteTFoot(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.tFoot;d&&i.appendChild(d);});}};case "createTBody":return ()=>{let i=b;if("createTBody"in i){let a=i.createTBody();return n(()=>a.parentNode?.removeChild(a)),M(a)}return null};case "createCaption":return ()=>{let i=b;if("createCaption"in i){let a=i.caption,u=i.createCaption();return a||n(()=>i.deleteCaption()),M(u)}return null};case "deleteCaption":return ()=>{let i=b;if("deleteCaption"in i&&i.caption){let a=i.caption.outerHTML;i.deleteCaption(),n(()=>{let u=document.createElement("table");u.innerHTML=a;let d=u.caption;d&&(i.firstChild?i.insertBefore(d,i.firstChild):i.appendChild(d));});}};case "add":return (i,a)=>{let u=b;if("add"in u&&"options"in u){let d=m(i),h=typeof a=="number"||a==null?a:m(a);u.add(d,h),n(()=>d.parentNode?.removeChild(d));}};case "stepUp":return i=>{let a=b;if("stepUp"in a){let u=a.value;a.stepUp(i),n(()=>{a.value=u;});}};case "stepDown":return i=>{let a=b;if("stepDown"in a){let u=a.value;a.stepDown(i),n(()=>{a.value=u;});}};case "play":return ()=>{let i=b;if("play"in i){let a=i.paused,u=i.currentTime,d=i.play();return a&&n(()=>{i.pause(),i.currentTime=u;}),d}return Promise.resolve()};case "pause":return ()=>{let i=b;if("pause"in i){let a=i.paused,u=i.currentTime;i.pause(),a||n(()=>{i.currentTime=u,i.play();});}};case "load":return ()=>{let i=b;if("load"in i){let a=i.currentTime,u=i.src;i.load(),n(()=>{i.src===u&&(i.currentTime=a);});}};case "fastSeek":return i=>{let a=b;if("fastSeek"in a){let u=a.currentTime;a.fastSeek(i),n(()=>{a.currentTime=u;});}};case "setPointerCapture":return i=>{let a=b;"setPointerCapture"in a&&(a.setPointerCapture(i),n(()=>{try{a.releasePointerCapture(i);}catch{}}));};case "webkitMatchesSelector":return i=>{let a=b,u=a;return u.webkitMatchesSelector?u.webkitMatchesSelector(i):a.matches(i)};case "contains":return i=>b.contains(i?m(i):null);case "compareDocumentPosition":return i=>b.compareDocumentPosition(m(i));case "getRootNode":return i=>M(b.getRootNode(i));case "isEqualNode":return i=>b.isEqualNode(i?m(i):null);case "isSameNode":return i=>b.isSameNode(i?m(i):null);default:return null}},T=b=>{let _=b.parentElement;for(;_;){let{overflow:p,overflowY:i,overflowX:a}=getComputedStyle(_);if(p==="auto"||p==="scroll"||i==="auto"||i==="scroll"||a==="auto"||a==="scroll")return _;_=_.parentElement;}return document.documentElement},k=(b,_)=>{if(typeof _=="symbol")return false;if(Zs.has(_))return true;let p=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(b),_);return !!(p&&p.get&&!p.set)},M=b=>{if(!b)return null;let _=o.get(b);if(_)return _;let p=new Proxy(b,{get(i,a){if(a===Symbol.toStringTag)return i[Symbol.toStringTag];if(a===Symbol.toPrimitive)return i[Symbol.toPrimitive]?.bind(i);if(a===Symbol.iterator&&Symbol.iterator in i)return i[Symbol.iterator].bind(i);if(a==="constructor")return i.constructor;let u=i;if(a==="style"&&"style"in i)return te(u.style);if(a==="classList"&&"classList"in i)return ee(u.classList);if(a==="dataset"&&"dataset"in i)return Z(u.dataset);if(a==="attributes"&&"attributes"in i)return ce(u.attributes);if(a==="attributeStyleMap"&&"attributeStyleMap"in i)return j(u.attributeStyleMap);if(a==="shadowRoot"&&"shadowRoot"in i)return u.shadowRoot?M(u.shadowRoot):null;if(a==="content"&&i instanceof HTMLTemplateElement)return M(i.content);if(typeof a=="string"&&wr.has(a)&&a in i){let h=i[a];if(h instanceof DOMTokenList)return ee(h)}if(a==="options"&&i instanceof HTMLSelectElement)return E(i.options,i);if(typeof a=="string"&&js.has(a))return M(i[a]);if(a==="children"||a==="childNodes")return N(i[a]);if(typeof a=="string"&&Vs.has(a)){let h=i;return w=>{let C=h[a]?.(w);return C?M(C):null}}if(typeof a=="string"&&Gs.has(a)){let h=i;if(a==="querySelectorAll")return w=>H(h.querySelectorAll(w));if(a==="getElementsByClassName")return w=>N(h.getElementsByClassName(w));if(a==="getElementsByTagName")return w=>N(h.getElementsByTagName(w));if(a==="getElementsByTagNameNS")return (w,C)=>N(h.getElementsByTagNameNS(w,C))}if(typeof a=="string"&&Ks.has(a)){let h=y(i,a);if(h)return h}let d=Reflect.get(i,a);return typeof d=="function"?d.bind(i):d},set(i,a,u){if(k(i,a))return Reflect.set(i,a,u);let d=typeof a=="string"?a:String(a),h=i,w=()=>{let C=h[d];n(()=>{h[d]=C;});};if(Ws.has(d))w();else if(qs.has(d)&&B(i))w();else if(d==="innerText"||d==="textContent"||d==="innerHTML"){let C=i,D=C.innerHTML;n(()=>{C.innerHTML=D;});}else if(wr.has(d)&&d in i){let C=h[d];if(C instanceof DOMTokenList){let D=C.value;n(()=>{h[d]=D;});}else w();}else if(Ys.has(d))w();else if(Xs.has(d)&&$(i))w();else if(d==="outerHTML"){let C=i,D=C.parentNode,U=C.nextSibling,I=C.outerHTML,ne=D?Array.from(D.childNodes):[],oe=Reflect.set(i,a,u),gt=(D?Array.from(D.childNodes):[]).filter(re=>!ne.includes(re));return n(()=>{for(let Y of gt)Y.parentNode?.removeChild(Y);let re=C.tagName.toLowerCase(),ge=null;if(re==="tr"){let Y=document.createElement("table");Y.innerHTML=I,ge=Y.querySelector("tr");}else if(re==="td"||re==="th"){let Y=document.createElement("table");Y.innerHTML=`<tbody><tr>${I}</tr></tbody>`,ge=Y.querySelector(re);}else if(re==="thead"||re==="tbody"||re==="tfoot"||re==="caption"||re==="colgroup"){let Y=document.createElement("table");Y.innerHTML=I,ge=Y.querySelector(re);}else if(re==="col"){let Y=document.createElement("table");Y.innerHTML=`<colgroup>${I}</colgroup>`,ge=Y.querySelector("col");}else {let Y=document.createElement("div");Y.innerHTML=I,ge=Y.firstChild;}ge&&D&&D.insertBefore(ge,U);}),oe}else w();return Reflect.set(i,a,u)}});return r.set(p,b),o.set(b,p),p},B=b=>b instanceof HTMLInputElement||b instanceof HTMLTextAreaElement||b instanceof HTMLSelectElement||b instanceof HTMLOptionElement,$=b=>b instanceof HTMLMediaElement;return {proxy:M(e),undo:()=>{for(let b=t.length-1;b>=0;b--)t[b]();}}},Js=e=>{let t=e.cloneNode(false),n=document.createElement("div");n.appendChild(t);let r=n.innerHTML,o=r.match(/<\/[^>]+>$/);return o?r.slice(0,-o[0].length):r},Qs=e=>`</${e.tagName.toLowerCase()}>`,xr=e=>{let t=document.createElement("div");t.innerHTML=e;let n=t.querySelectorAll("svg");for(let r of n){let o=document.createElementNS("http://www.w3.org/2000/svg","svg");r.hasAttribute("class")&&o.setAttribute("class",r.getAttribute("class")),r.hasAttribute("id")&&o.setAttribute("id",r.getAttribute("id")),o.textContent="...",r.replaceWith(o);}return t.innerHTML},Ze=e=>{let t=[],n=e.parentElement;for(let c=0;c<5&&n&&!(n===document.body||n===document.documentElement);c++)t.push(n),n=n.parentElement;if(t.length===0)return xr(e.outerHTML);t.reverse();let r="",o="";for(let c of t)r+=`${o}${Js(c)}
|
|
24
24
|
`,o+=" ";r+=`${o}<!-- START $el -->
|
|
25
25
|
`;let l=xr(e.outerHTML).split(`
|
|
26
26
|
`);for(let c of l)r+=`${o}${c}
|
|
27
27
|
`;r+=`${o}<!-- END $el -->
|
|
28
|
-
`;for(let c=t.length-1;c>=0;c--)o=" ".repeat(c),r+=`${o}${
|
|
29
|
-
`;return r.trim()};var
|
|
28
|
+
`;for(let c=t.length-1;c>=0;c--)o=" ".repeat(c),r+=`${o}${Qs(t[c])}
|
|
29
|
+
`;return r.trim()};var ea=[/\beval\s*\(/,/\bFunction\s*\(/,/\bdocument\.cookie\b/,/\bfetch\s*\(/,/\bXMLHttpRequest\b/],ta=e=>e.replace(/[\u2018\u2019\u2032\u2035]/g,"'").replace(/[\u201C\u201D\u2033\u2036]/g,'"').replace(/[\u2014\u2013\u2212]/g,"-").replace(/\u2026/g,"...").replace(/[\u00A0\u2000-\u200A\u202F\u205F]/g," ").replace(/[\u200B-\u200D\uFEFF]/g,""),Xt=e=>{let t=ta(e);try{new Function("$el",t);}catch(n){return {isValid:false,error:`Invalid JavaScript syntax${n instanceof Error?`: ${n.message}`:""}`,sanitizedCode:t}}for(let n of ea)if(n.test(t))return {isValid:false,error:`Potentially unsafe code detected: ${n.source}`,sanitizedCode:t};return {isValid:true,sanitizedCode:t}};var Er=async(e,t,n)=>{let r=await qt(e),s=document.contains(e)?e.outerHTML:"(removed)",l=n.length>0?`Prompts:
|
|
30
30
|
${n.join(`
|
|
31
31
|
`)}
|
|
32
32
|
|
|
@@ -36,7 +36,7 @@ ${s}`;return `${l}${r}
|
|
|
36
36
|
|
|
37
37
|
${c}
|
|
38
38
|
|
|
39
|
-
${f}`};var
|
|
39
|
+
${f}`};var na=e=>{let t=e.trim();if(t.startsWith("{")&&t.endsWith("}"))try{let n=JSON.parse(t);if(typeof n=="object"&&"code"in n)return n}catch{}return t},ra=(e,t,n)=>n?`Here is the HTML to modify:
|
|
40
40
|
|
|
41
41
|
${t}
|
|
42
42
|
|
|
@@ -48,13 +48,13 @@ You can either:
|
|
|
48
48
|
|
|
49
49
|
When iterating, the code will be executed and you'll see the updated HTML to refine further.`:`Follow-up modification request: ${e}
|
|
50
50
|
|
|
51
|
-
Remember: Output ONLY the JavaScript code for this modification. The $el variable still references the same element.`,
|
|
51
|
+
Remember: Output ONLY the JavaScript code for this modification. The $el variable still references the same element.`,oa=(e,t)=>{let n=`Here is the updated HTML after executing your code:
|
|
52
52
|
|
|
53
53
|
${e}`;return t&&(n+=`
|
|
54
54
|
|
|
55
55
|
Execution result: ${t}`),n+=`
|
|
56
56
|
|
|
57
|
-
Continue modifying or output final JavaScript code (without JSON wrapper) when done.`,n},
|
|
57
|
+
Continue modifying or output final JavaScript code (without JSON wrapper) when done.`,n},ia="https://www.react-grab.com/api/visual-edit",sa="https://www.react-grab.com/api/check-visual-edit",aa=(e={})=>{let t=e.apiEndpoint??ia,n=e.maxIterations??3,r=new Map,o=new Map,s=new Map,l=new Map,c=new Map,f=new Map,g=new Map,S=new Map,v=[],m=[],x=new Map,A=null,L=()=>({requestId:`req-${Date.now()}-${Math.random().toString(36).slice(2)}`}),P=(R,j)=>{let H=R.context.options?.requestId;if(!H||j.length===0)return;let N=j.map(T=>Ze(T)),E=j.map(T=>T.outerHTML);r.set(H,N),o.set(H,E),s.set(H,j);let y=R.id;y&&!S.has(y)&&S.set(y,E);},G=async function*(R,j){let H=null,N=null,E=Date.now(),y=fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:R}),signal:j}).then(T=>{H=T;}).catch(T=>{N=T;});for(;!H&&!N;){let T=(Date.now()-E)/1e3;yield T>=.1?`Generating\u2026 ${T.toFixed(1)}s`:"Generating\u2026",await Promise.race([y,new Promise(k=>setTimeout(k,100))]);}if(N)throw N;if(!H.ok){let T=await H.text().catch(()=>"Unknown error"),k=T;try{let M=JSON.parse(T);M.error&&(k=typeof M.error=="string"?M.error:JSON.stringify(M.error));}catch{}throw new Error(k)}return yield await H.text(),""},W=(R,j)=>{if(!document.contains(R))return {success:false,result:"Element was removed from DOM",updatedHtml:"",undo:()=>{},elementRemoved:true};let{isValid:H,error:N,sanitizedCode:E}=Xt(j);if(!H)return {success:false,result:N??"Invalid code",updatedHtml:Ze(R),undo:()=>{},elementRemoved:false};let{proxy:y,undo:T}=mt(R);try{let k=new Function("$el",E).bind(null)(y),M=k!==void 0?String(k):null,B=document.contains(R);return {success:!0,result:M,updatedHtml:B?Ze(R):"",undo:T,elementRemoved:!B}}catch(k){return T(),{success:false,result:k instanceof Error?k.message:"Execution failed",updatedHtml:Ze(R),undo:()=>{},elementRemoved:false}}},te=async function*(R,j,H,N,E,y,T,k,M){let B=N&&!M?f.get(N)??[]:[],$=B.length===0,V=ra(H,j,$),z=[...B,{role:"user",content:V}],b=0,_=null,p=[];for(;b<=n;){let i="";for await(let I of G(z,y))typeof I=="string"&&!I.startsWith("{")&&(yield `${k>1?`[${T+1}/${k}] `:""}${I}`),i=I;let a=na(i);if(typeof a=="string"){_=a,z.push({role:"assistant",content:i});break}if(!a.iterate){_=a.code,z.push({role:"assistant",content:i});break}z.push({role:"assistant",content:i}),yield `${k>1?`[${T+1}/${k}] `:""}Applying\u2026`;let{success:d,result:h,updatedHtml:w,undo:C,elementRemoved:D}=W(R,a.code);if(p.push(C),D){for(let I=p.length-1;I>=0;I--)p[I]();throw new Error("Element was removed from the page during editing. This can happen if the page re-rendered.")}let U=oa(w,d?h:`Error: ${h}`);z.push({role:"user",content:U}),b++;}for(let i=p.length-1;i>=0;i--)p[i]();return f.set(N??E,z),_},ee={send:async function*(R,j){let H=R.options?.requestId??"",N=R.sessionId,E=r.get(H),y=s.get(H);if(!E||!y||y.length===0)throw new Error("Could not capture element HTML");for(let $ of y)if(!document.contains($))throw new Error("Element was removed from the page. This can happen if the page re-rendered.");let T=N?g.get(N)??[]:[],k=T.length===0,M=[...T,R.prompt];A=Date.now();let B=[];for(let $=0;$<y.length;$++){let V=y[$],z=E[$];y.length>1&&(yield `Processing element ${$+1} of ${y.length}...`);let b=yield*te(V,z,R.prompt,N,H,j,$,y.length,k);if(b===null)throw new Error(`Max iterations reached without final code for element ${$+1}`);B.push(b);}l.set(H,JSON.stringify(B)),g.set(N??H,M),yield "Applying changes\u2026";},undo:async()=>{let R=v.pop();if(!R)return;let j=c.get(R);if(j)try{j(),m.push(R);}finally{c.delete(R);}},canUndo:()=>v.length>0,redo:async()=>{let R=m.pop();if(!R)return;let j=x.get(R);if(!j)return;let{code:H,elements:N}=j,E=JSON.parse(H),y=[];for(let T=0;T<N.length;T++){let k=N[T],M=E[T];if(!document.contains(k)||!M)continue;let{proxy:B,undo:$}=mt(k);try{new Function("$el",M).bind(null)(B),y.push($);}catch{$();}}y.length>0&&(c.set(R,()=>{for(let T=y.length-1;T>=0;T--)y[T]();}),v.push(R));},canRedo:()=>m.length>0,supportsFollowUp:true,dismissButtonText:"Keep",getCompletionMessage:()=>A===null?void 0:`Completed in ${((Date.now()-A)/1e3).toFixed(1)}s`},Z=R=>{r.delete(R),o.delete(R),s.delete(R),l.delete(R);};return {provider:ee,getOptions:L,onStart:P,onComplete:async(R,j)=>{let H=R.context.options?.requestId;if(!H)return;let N=l.get(H);if(!N)return;let E;try{E=JSON.parse(N);}catch{return Z(H),{error:"Failed to edit: invalid code format"}}if(j.length===0)return Z(H),{error:"Failed to edit: no elements found"};for(let p of j)if(!document.contains(p))return Z(H),{error:"Failed to edit: element was removed from the page. This can happen if the page re-rendered."};let y=R.id,T=(y?S.get(y):null)??o.get(H)??[],k=[],M=[],B=[];for(let p=0;p<j.length;p++){let i=j[p],a=E[p]?.trim()??"";if(a==="")continue;let{isValid:u,error:d,sanitizedCode:h}=Xt(a);if(!u){for(let D=k.length-1;D>=0;D--)k[D]();return Z(H),{error:`Failed to edit element ${p+1}: ${d??"invalid code"}`}}let{proxy:w,undo:C}=mt(i);try{new Function("$el",h).bind(null)(w),k.push(C),M.push(h),B.push(i);}catch(D){C();for(let I=k.length-1;I>=0;I--)k[I]();Z(H);let U=D instanceof Error?D.message:"Execution failed";return {error:`Failed to edit element ${p+1}: ${U}`}}}let $=()=>{for(let p=k.length-1;p>=0;p--)k[p]();};c.set(H,$),v.push(H),x.set(H,{code:JSON.stringify(M),elements:B}),m.length=0;let V=g.get(y??H)??[],z=j[0],b=T[0]??"",_=await Er(z,b,V);Yt(_),Z(H);},onUndo:(R,j)=>{}}},Zt=e=>typeof e=="object"&&e!==null&&"setAgent"in e,la=async()=>{let e=new AbortController,t=setTimeout(()=>e.abort(),1e3);try{let n=await fetch(sa,{method:"GET",signal:e.signal});return clearTimeout(t),n.ok?(await n.json().catch(()=>null))?.healthy===!0:!1}catch{return clearTimeout(t),false}},ca=async()=>{if(typeof window>"u"||!await la())return;let{provider:t,getOptions:n,onStart:r,onComplete:o,onUndo:s}=aa(),l=g=>{g.setAgent({provider:t,getOptions:n,onStart:r,onComplete:o,onUndo:s});},c=window.__REACT_GRAB__;if(Zt(c)){l(c);return}window.addEventListener("react-grab:init",g=>{g instanceof CustomEvent&&Zt(g.detail)&&l(g.detail);},{once:true});let f=window.__REACT_GRAB__;Zt(f)&&l(f);};ca();/**
|
|
58
58
|
* @license MIT
|
|
59
59
|
*
|
|
60
60
|
* Copyright (c) 2025 Aiden Bai
|
|
@@ -64,7 +64,7 @@ Continue modifying or output final JavaScript code (without JSON wrapper) when d
|
|
|
64
64
|
*/
|
|
65
65
|
/*! Bundled license information:
|
|
66
66
|
|
|
67
|
-
bippy/dist/rdt-hook-
|
|
67
|
+
bippy/dist/rdt-hook-5L_ky0r0.js:
|
|
68
68
|
(**
|
|
69
69
|
* @license bippy
|
|
70
70
|
*
|
|
@@ -74,7 +74,7 @@ bippy/dist/rdt-hook-BZMdLD7S.js:
|
|
|
74
74
|
* LICENSE file in the root directory of this source tree.
|
|
75
75
|
*)
|
|
76
76
|
|
|
77
|
-
bippy/dist/core-
|
|
77
|
+
bippy/dist/core-U1d648PH.js:
|
|
78
78
|
(**
|
|
79
79
|
* @license bippy
|
|
80
80
|
*
|
|
@@ -94,7 +94,7 @@ bippy/dist/source.js:
|
|
|
94
94
|
* LICENSE file in the root directory of this source tree.
|
|
95
95
|
*)
|
|
96
96
|
|
|
97
|
-
bippy/dist/install-hook-only-
|
|
97
|
+
bippy/dist/install-hook-only-CgvoC7AQ.js:
|
|
98
98
|
(**
|
|
99
99
|
* @license bippy
|
|
100
100
|
*
|
|
@@ -113,4 +113,4 @@ bippy/dist/index.js:
|
|
|
113
113
|
* This source code is licensed under the MIT license found in the
|
|
114
114
|
* LICENSE file in the root directory of this source tree.
|
|
115
115
|
*)
|
|
116
|
-
*/exports.attachAgent=
|
|
116
|
+
*/exports.attachAgent=ca;exports.createVisualEditAgentProvider=aa;return exports;})({});
|