PageSourceSearch

https://www.sindri.ai/_next/static/chunks/3c3c6ebddb61e736.js

js sindri.ai collected 2026-10-05 15:50:50 UTC 67,628 bytes, 2 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,389740,484399,225490,24040,t=>{"use strict";var e,n,r;let i=e=>{if("u"<typeof window)return;let n=function(){let e="u">typeof globalThis?globalThis:"u">typeof self?self:"u">typeof window?window:t.g;if(e.__xstate__)return e.__xstate__}();n&&n.register(e)};t.s(["devToolsAdapter",()=>i],484399);class o{constructor(t){this._process=t,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(t){let e={value:t,next:null};if(this._current){this._last.next=e,this._last=e;return}this._current=e,this._last=e,this._active&&this.flush()}flush(){for(;this._current;){let t=this._current;this._process(t.value),this._current=t.next}this._last=null}}let s="xstate.init",a="xstate.stop";function u(t,e){return{type:`xstate.done.state.${t}`,output:e}}function l(t,e){return{type:`xstate.error.actor.${t}`,error:e,actorId:t}}function c(t){return{type:s,input:t}}function d(t){setTimeout(()=>{throw t})}let f="function"==typeof Symbol&&Symbol.observable||"@@observable";function p(t){if(v(t))return t;let e=[],n="";for(let r=0;r<t.length;r++){switch(t.charCodeAt(r)){case 92:n+=t[r+1],r++;continue;case 46:e.push(n),n="";continue}n+=t[r]}return e.push(n),e}function h(t){var e;return(e=t)&&"object"==typeof e&&"machine"in e&&"value"in e?t.value:"string"!=typeof t?t:function(t){if(1===t.length)return t[0];let e={},n=e;for(let e=0;e<t.length-1;e++)if(e===t.length-2)n[t[e]]=t[e+1];else{let r=n;n={},r[t[e]]=n}return e}(p(t))}function y(t,e){let n={},r=Object.keys(t);for(let i=0;i<r.length;i++){let o=r[i];n[o]=e(t[o],o,t,i)}return n}function m(t){var e;return void 0===t?[]:v(e=t)?e:[e]}function g(t,e,n,r){return"function"==typeof t?t({context:e,event:n,self:r}):t}function v(t){return Array.isArray(t)}function b(t){var e;return(v(e=t)?e:[e]).map(t=>void 0===t||"string"==typeof t?{target:t}:t)}function w(t){if(void 0!==t&&""!==t)return m(t)}function x(t,e,n){let r="object"==typeof t,i=r?t:void 0;return{next:(r?t.next:t)?.bind(i),error:(r?t.error:e)?.bind(i),complete:(r?t.complete:n)?.bind(i)}}function _(t,e){return`${e}.${t}`}function E(t,e){let n=e.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return t.implementations.actors[e];let[,r,i]=n,o=t.getStateNodeById(i).config.invoke;return(Array.isArray(o)?o[r]:o).src}function S(t,e){if(e===t||"*"===e)return!0;if(!e.endsWith(".*"))return!1;let n=e.split("."),r=t.split(".");for(let t=0;t<n.length;t++){let e=n[t],i=r[t];if("*"===e)return t===n.length-1;if(e!==i)return!1}return!0}function k(t,e){return`${t.sessionId}.${e}`}let I=0,A=!1,$=((e={})[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e),O={clock:{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t)},logger:console.log.bind(console),devTools:!1};class T{constructor(t,e){this.logic=t,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new o(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=$.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=[];const n={...O,...e},{clock:r,logger:i,parent:s,syncSnapshot:a,id:u,systemId:l,inspect:c}=n;this.system=s?s.system:function(t,e){let n=new Map,r=new Map,i=new WeakMap,o=new Set,s={},{clock:a,logger:u}=e,l={schedule:(t,e,n,r,i=Math.random().toString(36).slice(2))=>{let o={source:t,target:e,event:n,delay:r,id:i,startedAt:Date.now()},u=k(t,i);c._snapshot._scheduledEvents[u]=o;let l=a.setTimeout(()=>{delete s[u],delete c._snapshot._scheduledEvents[u],c._relay(t,e,n)},r);s[u]=l},cancel:(t,e)=>{let n=k(t,e),r=s[n];delete s[n],delete c._snapshot._scheduledEvents[n],void 0!==r&&a.clearTimeout(r)},cancelAll:t=>{for(let e in c._snapshot._scheduledEvents){let n=c._snapshot._scheduledEvents[e];n.source===t&&l.cancel(t,n.id)}}},c={_snapshot:{_scheduledEvents:(e?.snapshot&&e.snapshot.scheduler)??{}},_bookId:()=>`x:${I++}`,_register:(t,e)=>(n.set(t,e),t),_unregister:t=>{n.delete(t.sessionId);let e=i.get(t);void 0!==e&&(r.delete(e),i.delete(t))},get:t=>r.get(t),getAll:()=>Object.fromEntries(r.entries()),_set:(t,e)=>{let n=r.get(t);if(n&&n!==e)throw Error(`Actor with system ID '${t}' already exists.`);r.set(t,e),i.set(e,t)},inspect:t=>{let e=x(t);return o.add(e),{unsubscribe(){o.delete(e)}}},_sendInspectionEvent:e=>{if(!o.size)return;let n={...e,rootId:t.sessionId};o.forEach(t=>t.next?.(n))},_relay:(t,e,n)=>{c._sendInspectionEvent({type:"@xstate.event",sourceRef:t,actorRef:e,event:n}),e._send(n)},scheduler:l,getSnapshot:()=>({_scheduledEvents:{...c._snapshot._scheduledEvents}}),start:()=>{let t=c._snapshot._scheduledEvents;for(let e in c._snapshot._scheduledEvents={},t){let{source:n,target:r,event:i,delay:o,id:s}=t[e];l.schedule(n,r,i,o,s)}},_clock:a,_logger:u};return c}(this,{clock:r,logger:i}),c&&!s&&this.system.inspect(x(c)),this.sessionId=this.system._bookId(),this.id=u??this.sessionId,this.logger=e?.logger??this.system._logger,this.clock=e?.clock??this.system._clock,this._parent=s,this._syncSnapshot=a,this.options=n,this.src=n.src??t,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:t=>{this._deferred.push(t)},system:this.system,stopChild:t=>{if(t._parent!==this)throw Error(`Cannot stop child actor ${t.id} of ${this.id} because it is not a child`);t._stop()},emit:t=>{let e=this.eventListeners.get(t.type),n=this.eventListeners.get("*");if(e||n)for(let r of[...e?e.values():[],...n?n.values():[]])try{r(t)}catch(t){d(t)}},actionExecutor:t=>{let e=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:t.type,params:t.params}}),!t.exec)return;let e=A;try{A=!0,t.exec(t.info,t.params)}finally{A=e}};this._processingStatus===$.Running?e():this._deferred.push(e)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),l&&(this.systemId=l,this.system._set(l,this)),this._initState(e?.snapshot??e?.state),l&&"active"!==this._snapshot.status&&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(t){this._snapshot={status:"error",output:void 0,error:t}}}update(t,e){let n;for(this._snapshot=t;n=this._deferred.shift();)try{n()}catch(e){this._deferred.length=0,this._snapshot={...t,status:"error",error:e}}switch(this._snapshot.status){case"active":for(let e of this.observers)try{e.
1next?.(t)}catch(t){d(t)}break;case"done":var r;for(let e of this.observers)try{e.next?.(t)}catch(t){d(t)}this._stopProcedure(),this._complete(),this._doneEvent=(r=this.id,{type:`xstate.done.actor.${r}`,output:this._snapshot.output,actorId:r}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:e,snapshot:t})}subscribe(t,e,n){let r=x(t,e,n);if(this._processingStatus!==$.Stopped)this.observers.add(r);else switch(this._snapshot.status){case"done":try{r.complete?.()}catch(t){d(t)}break;case"error":{let t=this._snapshot.error;if(r.error)try{r.error(t)}catch(t){d(t)}else d(t)}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(t,e){let n=this.eventListeners.get(t);n||(n=new Set,this.eventListeners.set(t,n));let r=e.bind(void 0);return n.add(r),{unsubscribe:()=>{n.delete(r)}}}start(){if(this._processingStatus===$.Running)return this;this._syncSnapshot&&this.subscribe({next:t=>{"active"===t.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:t})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=$.Running;let t=c(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(t){return this._snapshot={...this._snapshot,status:"error",error:t},this._error(t),this}return this.update(this._snapshot,t),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(t){let e,n;try{e=this.logic.transition(this._snapshot,t,this._actorScope)}catch(t){n={err:t}}if(n){let{err:t}=n;this._snapshot={...this._snapshot,status:"error",error:t},this._error(t);return}this.update(e,t),t.type===a&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===$.Stopped||((this.mailbox.clear(),this._processingStatus===$.NotStarted)?this._processingStatus=$.Stopped:this.mailbox.enqueue({type:a})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let t of this.observers)try{t.complete?.()}catch(t){d(t)}this.observers.clear(),this.eventListeners.clear()}_reportError(t){if(!this.observers.size){this._parent||d(t),this.eventListeners.clear();return}let e=!1;for(let n of this.observers){let r=n.error;e||=!r;try{r?.(t)}catch(t){d(t)}}this.observers.clear(),this.eventListeners.clear(),e&&d(t)}_error(t){this._stopProcedure(),this._reportError(t),this._parent&&this.system._relay(this,this._parent,l(this.id,t))}_stopProcedure(){return this._processingStatus!==$.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new o(this._process.bind(this)),this._processingStatus=$.Stopped,this.system._unregister(this)),this}_send(t){this._processingStatus!==$.Stopped&&this.mailbox.enqueue(t)}send(t){this.system._relay(void 0,this,t)}attachDevTools(){let{devTools:t}=this.options;t&&("function"==typeof t?t:i)(this)}toJSON(){return{xstate$$type:1,id:this.id}}getPersistedSnapshot(t){return this.logic.getPersistedSnapshot(this._snapshot,t)}[f](){return this}getSnapshot(){return this._snapshot}}function M(t,...[e]){return new T(t,e)}function N(t,e,n,r,{sendId:i}){return[e,{sendId:"function"==typeof i?i(n,r):i},void 0]}function j(t,e){t.defer(()=>{t.system.scheduler.cancel(t.self,e.sendId)})}function P(t){function e(t,e){}return e.type="xstate.cancel",e.sendId=t,e.resolve=N,e.execute=j,e}function L(t,e,n,r,{id:i,systemId:o,src:s,input:a,syncSnapshot:u}){let l,c,d="string"==typeof s?E(e.machine,s):s,f="function"==typeof i?i(n):i;return d&&(c="function"==typeof a?a({context:e.context,event:n.event,self:t.self}):a,l=M(d,{id:f,src:s,parent:t.self,syncSnapshot:u,systemId:o,input:c})),[tA(e,{children:{...e.children,[f]:l}}),{id:i,systemId:o,actorRef:l,src:s,input:c},void 0]}function R(t,{actorRef:e}){e&&t.defer(()=>{e._processingStatus!==$.Stopped&&e.start()})}function C(...[t,{id:e,systemId:n,input:r,syncSnapshot:i=!1}={}]){function o(t,e){}return o.type="xstate.spawnChild",o.id=e,o.systemId=n,o.src=t,o.input=r,o.syncSnapshot=i,o.resolve=L,o.execute=R,o}function D(t,e,n,r,{actorRef:i}){let o="function"==typeof i?i(n,r):i,s="string"==typeof o?e.children[o]:o,a=e.children;return s&&(a={...a},delete a[s.id]),[tA(e,{children:a}),s,void 0]}function U(t,e){if(e){if(!function t(e,n){let r=n.getSnapshot();if(r&&"children"in r)for(let n of Object.values(r.children))t(e,n);e.system._unregister(n)}(t,e),e._processingStatus!==$.Running)return void t.stopChild(e);t.defer(()=>{t.stopChild(e)})}}function V(t){function e(t,e){}return e.type="xstate.stopChild",e.actorRef=t,e.resolve=D,e.execute=U,e}function q(t,e,n,r){let{machine:i}=r,o="function"==typeof t,s=o?t:i.implementations.guards["string"==typeof t?t:t.type];if(!o&&!s)throw Error(`Guard '${"string"==typeof t?t:t.type}' is not implemented.'.`);if("function"!=typeof s)return q(s,e,n,r);let a={context:e,event:n},u=o||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:e,event:n}):t.params:void 0;return"check"in s?s.check(r,a,s):s(a,u)}let z=t=>"atomic"===t.type||"final"===t.type;function G(t){return Object.values(t.states).filter(t=>"history"!==t.type)}function W(t,e){let n=[];if(e===t)return n;let r=t.parent;for(;r&&r!==e;)n.push(r),r=r.parent;return n}function J(t){let e=new Set(t),n=Y(e);for(let t of e)if("compound"!==t.type||n.get(t)&&n.get(t).length){if("parallel"===t.type){for(let n of G(t))if("history"!==n.type&&!e.has(n))for(let t of tr(n))e.add(t)}}else tr(t).forEach(t=>e.add(t));for(let t of e){let n=t.parent;for(;n;)e.add(n),n=n.parent}return e}function Y(t){let e=new Map;for(let n of t)e.has(n)||e.set(n,[]),n.parent&&(e.has(n.parent)||e.set(n.parent,[]),e.get(n.parent).push(n));return e}function B(t,e){return function t(e,n){let r=n.get(e);if(!r)return{};if("compound"===e.type){let t=r[0];if(!t)return{};if(z(t))return t.key}let i={};for(let e of r)i[e.key]=t(e,n);return i}(t,Y(J(e)))}function H(t,e){return"compound"===e.type?G(e).some(e=>"final"===e.type&&t.has(e)):"parallel"===e.type?G(e).every(e=>H(t,e)):"final"===e.type}let K=t=>"#"===t[0];function X(t,e){return t.transitions.get(e)||[...t.transitions.keys()].filter(t=>S(e,t)).sort((t,e)=>e.length-t.length).flatMap(e=>t.transitions.get(e))}function F(t){let e=t.config.after;return e?Object.keys(e).flatMap(n=>{var r;let i,o,s=e[n],a=Number.isNaN(+n)?n:+n,u=(r=t.id,o=(i={type:`xstate.after.${a}.${r}`}).type,t.entry.push(tM(i,{id:o,delay:a})),t.exit.push(P(o)),o);return m("string"==typeof s?{target:s}:s).map(t=>({...t,event:u,delay:a}))}).map(e=>{let{delay:n}=e;return{...Q(t,e.event,e),delay:n}}):[]}function Q(t,e,n){let r=w(n.target),i=n.reenter??!1,o=function(t,e){if(void 0!==e)return e.map(e=>{if("string"!=typeof e)return e;if(K(e))return t.machine.getStateNodeById(e);let n="."===e[0];if(n&&!t.parent)return ts(t,e.slice(1));let r=n?t.key+e:e;if(t.parent)try{return ts(t.parent,r)}catch(e){throw Error(`Invalid transition definition for state node '${t.id}':
2${e.message}`)}throw Error(`Invalid target: "${e}" is not a valid target from the root node. Did you mean ".${e}"?`)})}(t,r),s={...n,actions:m(n.actions),guard:n.guard,target:o,source:t,reenter
2:i,eventType:e,toJSON:()=>({...s,source:`#${t.id}`,target:o?o.map(t=>`#${t.id}`):void 0})};return s}function Z(t){let e=new Map;if(t.config.on)for(let n of Object.keys(t.config.on)){if(""===n)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=t.config.on[n];e.set(n,b(r).map(e=>Q(t,n,e)))}if(t.config.onDone){let n=`xstate.done.state.${t.id}`;e.set(n,b(t.config.onDone).map(e=>Q(t,n,e)))}for(let n of t.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;e.set(r,b(n.onDone).map(e=>Q(t,r,e)))}if(n.onError){let r=`xstate.error.actor.${n.id}`;e.set(r,b(n.onError).map(e=>Q(t,r,e)))}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;e.set(r,b(n.onSnapshot).map(e=>Q(t,r,e)))}}for(let n of t.after){let t=e.get(n.eventType);t||(t=[],e.set(n.eventType,t)),t.push(n)}return e}function tt(t,e){let n="string"==typeof e?t.states[e]:e?t.states[e.target]:void 0;if(!n&&e)throw Error(`Initial state node "${e}" not found on parent state node #${t.id}`);let r={source:t,actions:e&&"string"!=typeof e?m(e.actions):[],eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${t.id}`,target:n?[`#${n.id}`]:[]})};return r}function te(t){let e=w(t.config.target);return e?{target:e.map(e=>"string"==typeof e?ts(t.parent,e):e)}:t.parent.initial}function tn(t){return"history"===t.type}function tr(t){let e=ti(t);for(let n of e)for(let r of W(n,t))e.add(r);return e}function ti(t){let e=new Set;return!function t(n){if(!e.has(n)){if(e.add(n),"compound"===n.type)t(n.initial.target[0]);else if("parallel"===n.type)for(let e of G(n))t(e)}}(t),e}function to(t,e){if(K(e))return t.machine.getStateNodeById(e);if(!t.states)throw Error(`Unable to retrieve child state '${e}' from '${t.id}'; no child states exist.`);let n=t.states[e];if(!n)throw Error(`Child state '${e}' does not exist on '${t.id}'`);return n}function ts(t,e){if("string"==typeof e&&K(e))try{return t.machine.getStateNodeById(e)}catch{}let n=p(e).slice(),r=t;for(;n.length;){let t=n.shift();if(!t.length)break;r=to(r,t)}return r}function ta(t,e){if("string"==typeof e){let n=t.states[e];if(!n)throw Error(`State '${e}' does not exist on '${t.id}'`);return[t,n]}let n=Object.keys(e),r=n.map(e=>to(t,e)).filter(Boolean);return[t.machine.root,t].concat(r,n.reduce((n,r)=>{let i=to(t,r);if(!i)return n;let o=ta(i,e[r]);return n.concat(o)},[]))}function tu(t,e){let n=t;for(;n.parent&&n.parent!==e;)n=n.parent;return n.parent===e}function tl(t,e,n){let r=new Set;for(let i of t){let t=!1,o=new Set;for(let s of r)if(function(t,e){let n=new Set(t),r=new Set(e);for(let t of n)if(r.has(t))return!0;for(let t of r)if(n.has(t))return!0;return!1}(tf([i],e,n),tf([s],e,n)))if(tu(i.source,s.source))o.add(s);else{t=!0;break}if(!t){for(let t of o)r.delete(t);r.add(i)}}return Array.from(r)}function tc(t,e){if(!t.target)return[];let n=new Set;for(let r of t.target)if(tn(r))if(e[r.id])for(let t of e[r.id])n.add(t);else for(let t of tc(te(r),e))n.add(t);else n.add(r);return[...n]}function td(t,e){let n=tc(t,e);if(!n)return;if(!t.reenter&&n.every(e=>e===t.source||tu(e,t.source)))return t.source;let r=function(t){let[e,...n]=t;for(let t of W(e,void 0))if(n.every(e=>tu(e,t)))return t}(n.concat(t.source));return r||(t.reenter?void 0:t.source.machine.root)}function tf(t,e,n){let r=new Set;for(let i of t)if(i.target?.length){let t=td(i,n);for(let n of(i.reenter&&i.source===t&&r.add(t),e))tu(n,t)&&r.add(n)}return[...r]}function tp(t,e,n,r,i,o){if(!t.length)return e;let s=new Set(e._nodes),a=e.historyValue,l=tl(t,s,a),c=e;i||([c,a]=function(t,e,n,r,i,o,s,a){let u,l=t,c=tf(r,i,o);for(let t of(c.sort((t,e)=>e.order-t.order),c))for(let e of function(t){return Object.keys(t.states).map(e=>t.states[e]).filter(t=>"history"===t.type)}(t)){let n;n="deep"===e.history?e=>z(e)&&tu(e,t):e=>e.parent===t,(u??={...o})[e.id]=Array.from(i).filter(n)}for(let t of c)l=tm(l,e,n,[...t.exit,...t.invoke.map(t=>V(t.id))],s,void 0),i.delete(t);return[l,u||o]}(c,r,n,l,s,a,o,n.actionExecutor)),c=function(t,e,n,r,i,o,s,a){let l=t,c=new Set,d=new Set;(function(t,e,n,r){for(let i of t){let t=td(i,e);for(let o of i.target||[])!tn(o)&&(i.source!==o||i.source!==t||i.reenter)&&(r.add(o),n.add(o)),th(o,e,n,r);for(let o of tc(i,e)){let s=W(o,t);t?.type==="parallel"&&s.push(t),ty(r,e,n,s,!i.source.parent&&i.reenter?void 0:t)}}})(r,s,d,c),a&&d.add(t.machine.root);let f=new Set;for(let t of[...c].sort((t,e)=>t.order-e.order)){i.add(t);let r=[];for(let e of(r.push(...t.entry),t.invoke))r.push(C(e.src,{...e,syncSnapshot:!!e.onSnapshot}));if(d.has(t)){let e=t.initial.actions;r.push(...e)}if(l=tm(l,e,n,r,o,t.invoke.map(t=>
2t.id)),"final"===t.type){let r=t.parent,s=r?.type==="parallel"?r:r?.parent,a=s||t;for(r?.type==="compound"&&o.push(u(r.id,void 0!==t.output?g(t.output,l.context,e,n.self):void 0));s?.type==="parallel"&&!f.has(s)&&H(i,s);)f.add(s),o.push(u(s.id)),a=s,s=s.parent;if(s)continue;l=tA(l,{status:"done",output:function(t,e,n,r,i){if(void 0===r.output)return;let o=u(i.id,void 0!==i.output&&i.parent?g(i.output,t.context,e,n.self):void 0);return g(r.output,t.context,o,n.self)}(l,e,n,l.machine.root,a)})}}return l}(c=tm(c,r,n,l.flatMap(t=>t.actions),o,void 0),r,n,l,s,o,a,i);let d=[...s];"done"===c.status&&(c=tm(c,r,n,d.sort((t,e)=>e.order-t.order).flatMap(t=>t.exit),o,void 0));try{if(a===e.historyValue&&function(t,e){if(t.length!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}(e._nodes,s))return c;return tA(c,{_nodes:d,historyValue:a})}catch(t){throw t}}function th(t,e,n,r){var i,o,s,a;if(tn(t))if(e[t.id]){let s=e[t.id];for(let t of s)r.add(t),th(t,e,n,r);for(let a of s){i=a,o=t.parent,ty(r,e,n,W(i,o))}}else{let i=te(t);for(let o of i.target)r.add(o),i===t.parent?.initial&&n.add(t.parent),th(o,e,n,r);for(let o of i.target){s=o,a=t.parent,ty(r,e,n,W(s,a))}}else if("compound"===t.type){let[i]=t.initial.target;tn(i)||(r.add(i),n.add(i)),th(i,e,n,r),ty(r,e,n,W(i,t))}else if("parallel"===t.type)for(let i of G(t).filter(t=>!tn(t)))[...r].some(t=>tu(t,i))||(tn(i)||(r.add(i),n.add(i)),th(i,e,n,r))}function ty(t,e,n,r,i){for(let o of r)if((!i||tu(o,i))&&t.add(o),"parallel"===o.type)for(let r of G(o).filter(t=>!tn(t)))[...t].some(t=>tu(t,r))||(t.add(r),th(r,e,n,t))}function tm(t,e,n,r,i,o){let s=o?[]:void 0,a=function t(e,n,r,i,o,s){let{machine:a}=e,u=e;for(let e of i){var l;let i="function"==typeof e,c=i?e:(l="string"==typeof e?e:e.type,a.implementations.actions[l]),d={context:u.context,event:n,self:r.self,system:r.system},f=i||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:u.context,event:n}):e.params:void 0;if(!c||!("resolve"in c)){r.actionExecutor({type:"string"==typeof e?e:"object"==typeof e?e.type:e.name||"(anonymous)",info:d,params:f,exec:c});continue}let[p,h,y]=c.resolve(r,u,d,f,c,o);u=p,"retryResolve"in c&&s?.push([c,h]),"execute"in c&&r.actionExecutor({type:c.type,info:d,params:h,exec:c.execute.bind(null,r,h)}),y&&(u=t(u,n,r,y,o,s))}return u}(t,e,n,r,{internalQueue:i,deferredActorIds:o},s);return s?.forEach(([t,e])=>{t.retryResolve(n,a,e)}),a}function tg(t,e,n,r){let i=t,o=[];function u(t,e,r){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:e,snapshot:t,_transitions:r}),o.push(t)}if(e.type===a)return u(i=tA(tv(i,e,n),{status:"stopped"}),e,[]),{snapshot:i,microstates:o};let l=e;if(l.type!==s){let e=l,s=e.type.startsWith("xstate.error.actor"),a=tb(e,i);if(s&&!a.length)return u(i=tA(t,{status:"error",error:e.error}),e,[]),{snapshot:i,microstates:o};u(i=tp(a,t,n,l,!1,r),e,a)}let c=!0;for(;"active"===i.status;){let t=c?function(t,e){let n=new Set;for(let r of t._nodes.filter(z))t:for(let i of[r].concat(W(r,void 0)))if(i.always){for(let r of i.always)if(void 0===r.guard||q(r.guard,t.context,e,t)){n.add(r);break t}}return tl(Array.from(n),new Set(t._nodes),t.historyValue)}(i,l):[],e=t.length?i:void 0;if(!t.length){if(!r.length)break;t=tb(l=r.shift(),i)}c=(i=tp(t,i,n,l,!1,r))!==e,u(i,l,t)}return"active"!==i.status&&tv(i,l,n),{snapshot:i,microstates:o}}function tv(t,e,n){return tm(t,e,n,Object.values(t.children).map(t=>V(t)),[],void 0)}function tb(t,e){return e.machine.getTransitionData(e,t)}function tw(t,e){let n=J(ta(t,e));return B(t,[...n])}let tx=function(t){return function t(e,n){let r=h(e),i=h(n);return"string"==typeof i?"string"==typeof r&&i===r:"string"==typeof r?r in i:Object.keys(r).every(e=>e in i&&t(r[e],i[e]))}(t,this.value)},t_=function(t){return this.tags.has(t)},tE=function(t){let e=this.machine.getTransitionData(this,t);return!!e?.length&&e.some(t=>void 0!==t.target||t.actions.length)},tS=function(){let{_nodes:t,tags:e,machine:n,getMeta:r,toJSON:i,can:o,hasTag:s,matches:a,...u}=this;return{...u,tags:Array.from(e)}},tk=function(){return this._nodes.reduce((t,e)=>(void 0!==e.meta&&(t[e.id]=e.meta),t),{})};function tI(t,e){return{status:t.status,output:t.output,error:t.error,machine:e,context:t.context,_nodes:t._nodes,value:B(e.root,t._nodes),tags:new Set(t._nodes.flatMap(t=>t.tags)),children:t.children,historyValue:t.historyValue||{},matches:tx,hasTag:t_,can:tE,getMeta:tk,toJSON:tS}}function tA(t,e={}){return tI({...t,...e},t.machine)}function t$(t,e){let{_nodes:n,tags:r,machine:i,children:o,context:s,can:a,hasTag:u,matches:l,getMeta:c,toJSON:d,...f}=t,p={};for(let t in o){let n=o[t];p[t]={snapshot:n.getPersistedSnapshot(e),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...f,context:function t(e){let n;for(let r in e){let i=e[r];if(i&&"object"==typeof i)if("sessionId"in i&&"send"in i&&"ref"in i)(n??=Array.isArray(e)?e.slice():{...e})[r]={xstate$$type:1,id:i.id};else{let o=t(i);o!==i&&((n??=Array.isArray(e)?e.slice():{...e})[r]=o)}}return n??e}(s),children:p,historyValue:function(t){if("object"!=typeof t||null===t)return{};let e={};for(let n in t){let r=t[n];Array.isArray(r)&&(e[n]=r.map(t=>({id:t.id})))}return e}(f.historyValue)}}function tO(t,e,n,r,{event:i,id:o,delay:s},{internalQueue:a}){let u,l=e.machine.implementations.delays;if("string"==typeof i)throw Error(`Only event objects may be used with raise; use raise({ type: "${i}" }) instead`);let c="function"==typeof i?i(n,r):i;if("string"==typeof s){let t=l&&l[s];u="function"==typeof t?t(n,r):t}else u="function"==typeof s?s(n,r):s;return"number"!=typeof u&&a.push(c),[e,{event:c,id:o,delay:u},void 0]}function tT(t,e){let{event:n,delay:r,id:i}=e;if("number"==typeof r)return void t.defer(()=>{let e=t.self;t.system.scheduler.schedule(e,e,n,r,i)})}function tM(t,e){function n(t,e){}return n.type="xstate.raise",n.event=t,n.id=e?.id,n.delay=e?.delay,n.resolve=tO,n.execute=tT,n}t.s(["$",()=>1,"B",()=>tt,"C",()=>X,"D",()=>tw,"E",()=>J,"F",()=>tI,"G",()=>H,"H",()=>tg,"I",()=>function t(e,n,r,i){if("string"==typeof n){let t;return(t=to(e,n).next(r,i))&&t.length?t:e.next(r,i)}if(1===Object.keys(n).length){let o,s;return(s=t(to(e,(o=Object.keys(n))[0]),n[o[0]],r,i))&&s.length?s:e.next(r,i)}let o=[];for(let s of Object.keys(n)){let a=n[s];if(!a)continue;let u=t(to(e,s),a,r,i);u&&o.push(...u)}return o.length?o:e.next(r,i)},"J",()=>tm,"K",()=>c,"L",()=>tp,"M",()=>ti,"N",()=>"","O",()=>p,"P",()=>K,"Q",()=>ts,"R",()=>t$,"S",()=>".","T",()=>E,"U",()=>"xstate.error","V",()=>l,"W",()=>$,"X",()=>a,"Y",()=>tA,"a",()=>P,"b",()=>C,"c",()=>M,"g",()=>ta,"m",()=>S,"q",()=>y,"r",()=>tM,"s",()=>V,"t",()=>m,"u",()=>Z,"v",()=>b,"w",()=>Q,"x",()=>q,"y",()=>_,"z",()=>F],225490);let tN="xstate.observable.error",tj="xstate.observable.complete";function tP(t){return{config:t,transition:(t,e)=>{if("active"!==t.status)return t;switch(e.type){case tN:return{...t,status:"error",error:e.data,input:void 0,_subscription:void 0};case tj:return{...t,status:"done",input:void 0,_subscription:void 0};case a:return t._subscription.unsubscribe(),{...t,status:"stopped",input:void 0,_subscription:void 0};default:return t}},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:void 0,input:e,_subscription:void 0}),start:(e,{self:n,system:r,emit:i})=>{"done"!==e.status&&(e._subscription=t({input:e.input,system:r,self:n,emit:i}).subscribe({next:t=>{n._parent&&r._relay(n,n._parent,t)},error:t=>{r._relay(n,n,{type:tN,data:t})},complete:()=>{r._relay(n,n,{type:tj})}}))},getPersistedSnapshot:({_subscription:t,...e})=>e,restoreSnapshot:t=>({...t,_subscription:void 0})}}let tL="xstate.promise.resolve",tR="xstate.promise.reject",tC=new WeakMap;function tD(t){return{config:t,transition:(t,e,n)=>{if("active"!==t.status)return t;switch(e.type){case tL:{let n=e.data;return{...t,status:"done",output:n,input:void 0}}case tR:return{...t,status:"error",error:e.data,input:void 0};case a:return tC.get(n.self)?.abort(),tC.delete(n.self),{...t,status:"stopped",input:void 0};default:return t}},start:(e,{self:n,system:r,emit:i})=>{if("active"!==e.status)return;let o=new AbortController;tC.set(n,o),Promise.resolve(t({input:e.input,system:r,self:n,signal:o.signal,emit:i})).then(t=>
2{"active"===n.getSnapshot().status&&(tC.delete(n),r._relay(n,n,{type:tL,data:t}))},t=>{"active"===n.getSnapshot().status&&(tC.delete(n),r._relay(n,n,{type:tR,data:t}))})},getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,input:e}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t}}let tU=(r=void 0,{config:n=t=>void 0,transition:(t,e,r)=>({...t,context:n(t.context,e,r)}),getInitialSnapshot:(t,e)=>({status:"active",output:void 0,error:void 0,context:"function"==typeof r?r({input:e}):r}),getPersistedSnapshot:t=>t,restoreSnapshot:t=>t});function tV(){return M(tU)}t.s(["createEmptyActor",()=>tV,"fromEventObservable",()=>tP,"fromPromise",()=>tD],24040);let tq=tV(),tz=tq,tG=new Set;function tW(t){return t===tq}function tJ(t){for(let e of(tz=t,tG))e()}t.s(["actor",()=>tz,"emptyActor",()=>tq,"isEmptyActor",()=>tW,"listeners",()=>tG,"setActor",()=>tJ],389740)},859152,t=>{"use strict";function e(t){return t.split(/[[.\]]/g).filter(Boolean).map(t=>{var e;return t.includes("==")?function(t){let[e,n]=t.split("==");if("_key"!==e)throw Error(`Currently only "_key" is supported as path segment. Found ${e}`);if(typeof n>"u")throw Error('Invalid path segment, expected `key=="value"`');return{_key:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(t):n.test(e=t)?Number(e):e})}let n=/^-?\d+$/,r=/^[a-z_$]+/;function i(t){return t.map((t,e)=>{var n;return n=0===e,Array.isArray(t)?`[${t[0]}:${t[1]||""}]`:"number"==typeof t?`[${t}]`:"object"==typeof t&&"_key"in t&&"string"==typeof t._key?`[_key==${JSON.stringify(t._key)}]`:"string"==typeof t&&r.test(t)?n?t:`.${t}`:`['${t}']`}).join("")}function o(t){if("createIfNotExists"in t)return{type:"createIfNotExists",document:t.createIfNotExists};if("createOrReplace"in t)return{type:"createOrReplace",document:t.createOrReplace};if("create"in t)return{type:"create",document:t.create};if("delete"in t)return{id:t.delete.id,type:"delete"};if("patch"in t){var n,r,i,o,a,u;return{type:"patch",id:t.patch.id,patches:[..."set"in(r=n=t.patch)?Object.keys(r.set).map(t=>({path:e(t),op:{type:"set",value:r.set[t]}})):[],..."setIfMissing"in(i=n)?Object.keys(i.setIfMissing).map(t=>({path:e(t),op:{type:"setIfMissing",value:i.setIfMissing[t]}})):[],..."unset"in(o=n)?o.unset.map(t=>({path:e(t),op:{type:"unset"}})):[],..."inc"in(a=n)?Object.keys(a.inc).map(t=>({path:e(t),op:{type:"inc",amount:a.inc[t]}})):[],..."inc"in(u=n)?Object.keys(u.dec).map(t=>({path:e(t),op:{type:"dec",amount:u.dec[t]}})):[],...function(t){if(!("insert"in t))return[];let n=function(t){let e=s.filter(e=>e in t);if(e.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${s.join(", ")}, instead found ${e.join(", ")}`);return e[0]}(t.insert);if(!n)throw Error("Insert patch missing position");let r=e(t.insert[n]),i=r.pop();return[{path:r,op:{type:"insert",position:n,referenceItem:i,items:t.insert.items}}]}(n)]}}throw Error(`Unknown mutation: ${JSON.stringify(t)}`)}let s=["before","replace","after"];function a(t){return l(t)}function u(t){return t.flatMap(a)}function l(t){if("create"===t.type||"createIfNotExists"===t.type||"createOrReplace"===t.type)return{[t.type]:t.document};
2if("delete"===t.type)return{delete:{id:t.id}};let e=t.options?.ifRevision;return t.patches.map(n=>({patch:{id:t.id,...e&&{ifRevisionID:e},...function(t){let{path:e,op:n}=t;if("unset"===n.type)return{unset:[i(e)]};if("insert"===n.type)return{insert:{[n.position]:i([...e,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[i(e)]:n.value}};if("inc"===n.type)return{inc:{[i(e)]:n.amount}};if("dec"===n.type)return{dec:{[i(e)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[i(e)]:n.value}};if("truncate"===n.type){let t=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${i(e)}[${t}]`]}}if("upsert"===n.type)return{unset:n.items.map(t=>i([...e,{_key:t._key}])),insert:{[n.position]:i([...e,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(t=>[i(e.concat(t)),n.value[t]]))};if("unassign"===n.type)return{unset:n.keys.map(t=>i(e.concat(t)))};if("replace"===n.type)return{insert:{replace:i(e.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[i(e.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}function c(t){return Array.isArray(t)?t:[t]}var d=Object.freeze({__proto__:null,decode:function(t){return o(t)},decodeAll:function(t){return t.map(o)},encode:a,encodeAll:u,encodeMutation:l,encodeTransaction:function(t){return{transactionId:t.id,mutations:u(t.mutations)}}});function f(t,e,n){return{type:"insert",referenceItem:n,position:e,items:c(t)}}function p(t,e){return{type:"truncate",startIndex:t,endIndex:e}}function h(t){return{type:"remove",referenceItem:t}}function y(t,e,n){return{type:"patch",id:t,patches:c(e),...n?{options:n}:{}}}function m(t,n){return{path:"string"==typeof t?e(t):t,op:n}}function g(t){return{type:"createIfNotExists",document:t}}t.s(["SanityEncoder",()=>d,"at",()=>m,"createIfNotExists",()=>g,"insert",()=>f,"patch",()=>y,"remove",()=>h,"truncate",()=>p],859152)},523694,662966,989955,t=>{"use strict";let e,n,r,i,o,s;var a,u=t.i(500932),l=t.i(216024),c=t.i(271645),d=t.i(389740),f=t.i(859152),p=t.i(636536);let h=/_key\s*==\s*['"](.*)['"]/,y=/^\d*:\d*$/;function m(t){return"number"==typeof t||"string"==typeof t&&/^\[\d+\]$/.test(t)}function g(t){return"string"==typeof t?h.test(t.trim()):"object"==typeof t&&"_key"in t}let v=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,b=/_key\s*==\s*['"](.*)['"]/;function w(t,e,n){let r="string"==typeof e?function(t){if("string"!=typeof t)throw Error("Path is not a string");let e=t.match(v);if(!e)throw Error("Invalid path string");return e.map(x)}(e):e;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=t;for(let t=0;t<r.length;t++){let e=r[t];if(m(e)){if(!Array.isArray(i))return n;i=i[e]}if(g(e)){if(!Array.isArray(i))return n;i=i.find(t=>t._key===e._key)}if("string"==typeof e&&(i="object"==typeof i&&null!==i?i[e]:void 0),typeof i>"u")return n}return i}function x(t){return m(t)?Number(t.replace(/[^\d]/g,"")):g(t)?{_key:t.match(b)[1]}:!function(t){if("string"==typeof t&&y.test(t))return!0;if(!Array.isArray(t)||2!==t.length)return!1;let[e,n]=t;return("number"==typeof e||""===e)&&("number"==typeof n||""===n)}(t)?t:function(t){let[e,n]=t.split(":").map(t=>""===t?t:Number(t));return[e,n]}(t)}function _(){return(0,c.useSyncExternalStore)(k,S,E)}function E(){return d.emptyActor}function S(){return d.actor}function k(t){return d.listeners.add(t),()=>d.listeners.delete(t)}function I(){let t,e=(0,u.c)(2),n=_();return e[0]!==n?(t=(0,d.isEmptyActor)(n),e[0]=n,e[1]=t):t=e[1],!t}function A(t,e){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{t.apply(t,r)},e)}}function $(t,e){let n=(0,p.isMaybePreviewIframe)(),r=(0,p.isMaybePreviewWindow)();if((0,d.isEmptyActor)(e)||!n&&!r)throw Error("The `useDocuments` hook cannot be used in this context");let i=(0,l.getDraftId)(t),o=(0,l.getPublishedId)(t),s=e.getSnapshot().context?.documents,a=s?.[i],u=s?.[o],c=a||u;if(!c)throw Error(`Document "${t}" not found`);let f=a.getSnapshot().context?.local||u.getSnapshot().context?.local,h=new Promise(t=>{if(f)t(f);else{let e=c.on("ready",n=>{let{snapshot:r}=n;t(r||null),e.unsubscribe()})}});return{draftDoc:a,draftId:i,getSnapshot:()=>h,publishedDoc:u,publishedId:o,get snapshot(){if(!f)throw Error(`Snapshot for document "${t}" not found`);return f}}}function O(){let t,e,n,r=(0,u.c)(7),i=_();r[0]!==i?(t=t=>({id:t,commit:()=>{let{draftDoc:e}=$(t,i);e.send({type:"submit"})},get:e=>{let{snapshot:n}=$(t,i);return e?w(n,e):n},getSnapshot:function(t,e){let{getSnapshot:n}=$(t,e);return n}(t,i),patch:async(e,n)=>{let r=$(t,i),{draftDoc:o,draftId:s,getSnapshot:a,publishedId:u}=r,{commit:l=!0}=n||{},c=await ("function"==typeof e?e({draftId:s,publishedId:u,get snapshot(){return r.snapshot},getSnapshot:a}):e),d=await a();if(!d)throw Error(`Snapshot for document "${t}" not found`);o.send({type:"mutate",mutations:[(0,f.createIfNotExists)({...d,_id:s}),(0,f.patch)(s,c)]}),l&&("object"==typeof l&&"debounce"in l?A(()=>o.send({type:"submit"}),l.debounce)():o.send({type:"submit"}))}}),r[0]=i,r[1]=t):t=r[1];let o=t;r[2]!==i?(e=(t,e,n)=>{let{draftDoc:r}=$(t,i),{commit:o}=n||{},s=void 0===o||o;r.send({type:"mutate",mutations:e}),s&&("object"==typeof s&&"debounce"in s?A(()=>r.send({type:"submit"}),s.debounce)():r.send({type:"submit"}))},r[2]=i,r[3]=e):e=r[3];let s=e;return r[4]!==o||r[5]!==s?(n={getDocument:o,mutateDocument:s},r[4]=o,r[5]=s,r[6]=n):n=r[6],n}function T(t){let e=(()=>
2{if(s)return s;s=[];for(let t=0;t<256;++t)s[t]=(t+256).toString(16).slice(1);return s})();return(function(t=16){let e=new Uint8Array(t);return crypto.getRandomValues(e),e})(t).reduce((t,n)=>t+e[n],"").slice(0,t)}function M(t){let e,n,r="string"==typeof t?t:t.path,i=r.lastIndexOf("."),o=r.substring(i+1,r.length);if(!o.indexOf("["))throw Error("Invalid path: not an array");let s=r.lastIndexOf("["),a=r.substring(0,s);if(o.includes("_key")){let t=o.indexOf('"')+1,r=o.indexOf('"',t);e=o.substring(t,r),n=!0}else{let t=o.indexOf("[")+1,r=o.indexOf("]",t);e=o.substring(t,r),n=!1}if(!a||!e)throw Error("Invalid path");return{path:a,key:e,hasExplicitKey:n}}function N(t,e,n="after"){let{path:r,key:i}=M(t),o={...w(e,t.path),_key:T()};return[(0,f.at)(r,(0,f.insert)(o,n,{_key:i}))]}function j(t,e){let{path:n,key:r}=M(t),i=w(e,n).findIndex(t=>t._key===r);return[(0,f.at)(n,(0,f.truncate)(i,i+1))]}function P(t,e,n){let{path:r,key:i}=M(t),o=T();return[(0,f.at)(r,(0,f.insert)([{_type:e,_key:o}],n,{_key:i}))]}async function L(t,e,n){if(!t.type)throw Error("Node type is missing");let{path:r,key:i}=M(t),o=await e.getSnapshot(),s=w(o,r),a=w(o,t.path),u=s.findIndex(t=>t._key===i),l=-1,c="before";if("first"===n){if(0===u)return[];l=0,c="before"}else if("last"===n){if(u===s.length-1)return[];l=-1,c="after"}else if("next"===n){if(u===s.length-1)return[];l=u,c="after"}else if("previous"===n){if(0===u)return[];l=u-1,c="before"}return[(0,f.at)(r,(0,f.truncate)(u,u+1)),(0,f.at)(r,(0,f.insert)(a,c,l))]}function R(t){return{lang:t?.lang??e?.lang,message:t?.message,abortEarly:t?.abortEarly??e?.abortEarly,abortPipeEarly:t?.abortPipeEarly??e?.abortPipeEarly}}function C(t,e,o,s,a){var u,l,c,d;let f,p=a&&"input"in a?a.input:o.value,h=a?.expected??t.expects??null,y=a?.received??("string"==(f=typeof p)?`"${p}"`:"number"===f||"bigint"===f||"boolean"===f?`${p}`:"object"===f||"function"===f?(p&&Object.getPrototypeOf(p)?.constructor?.name)??"null":f),m={kind:t.kind,type:t.type,input:p,expected:h,received:y,message:`Invalid ${e}: ${h?`Expected ${h} but r`:"R"}eceived ${y}`,requirement:t.requirement,path:a?.path,issues:a?.issues,lang:s.lang,abortEarly:s.abortEarly,abortPipeEarly:s.abortPipeEarly},g="schema"===t.kind,v=a?.message??t.message??(u=t.reference,l=m.lang,i?.get(u)?.get(l))??(g?(c=m.lang,r?.get(c)):null)??s.message??(d=m.lang,n?.get(d));void 0!==v&&(m.message="function"==typeof v?v(m):v),g&&(o.typed=!1),o.issues?o.issues.push(m):o.issues=[m]}function D(t){return{version:1,vendor:"valibot",validate:e=>t["~run"]({value:e},R())}}t.s(["get",()=>w,"getArrayDuplicatePatches",()=>N,"getArrayInsertPatches",()=>P,"getArrayItemKeyAndParentPath",()=>M,"getArrayMovePatches",()=>L,"getArrayRemovePatches",()=>j,"useDocuments",()=>O,"useOptimisticActor",()=>_,"useOptimisticActorReady",()=>I],662966);var U=class extends Error{constructor(t){super(t[0].message),this.name="ValiError",this.issues=t}};function V(t,e){return{kind:"validation",type:"min_length",reference:V,async:!1,expects:`>=${t}`,requirement:t,message:e,"~run"(t,e){return t.typed&&t.value.length<this.requirement&&C(this,"length",t,e,{received:`${t.value.length}`}),t}}}function q(t,e,n){return"function"==typeof t.fallback?t.fallback(e,n):t.fallback}function z(t,e,n){return"function"==typeof t.default?t.default(e,n):t.default}function G(t,e){return{kind:"schema",type:"object",reference:G,expects:"Object",async:!1,entries:t,message:e,get"~standard"(){return D(this)},"~run"(t,e){let n=t.value;if(n&&"object"==typeof n)for(let r in t.typed=!0,t.value={},this.entries){let i=this.entries[r];if(r in n||("exact_optional"===i.type||"optional"===i.type||"nullish"===i.type)&&void 0!==i.default){let o=r in n?n[r]:z(i),s=i["~run"]({value:o},e);if(s.issues){let i={type:"object",origin:"value",input:n,key:r,value:o};for(let e of s.issues)e.path?e.path.unshift(i):e.path=[i],t.issues?.push(e);if(t.issues||(t.issues=s.issues),e.abortEarly){t.typed=!1;break}}s.typed||(t.typed=!1),t.value[r]=s.value}else if(void 0!==i.fallback)t.value[r]=q(i);else if("exact_optional"!==i.type&&"optional"!==i.type&&"nullish"!==i.type&&(C(this,"key",t,e,{input:void 0,expected:`"${r}
2"`,path:[{type:"object",origin:"key",input:n,key:r,value:n[r]}]}),e.abortEarly))break}else C(this,"type",t,e);return t}}}function W(t,e){return{kind:"schema",type:"optional",reference:W,expects:`(${t.expects} | undefined)`,async:!1,wrapped:t,default:e,get"~standard"(){return D(this)},"~run"(t,e){return void 0===t.value&&(void 0!==this.default&&(t.value=z(this,t,e)),void 0===t.value)?(t.typed=!0,t):this.wrapped["~run"](t,e)}}}function J(t){return{kind:"schema",type:"string",reference:J,expects:"string",async:!1,message:t,get"~standard"(){return D(this)},"~run"(t,e){return"string"==typeof t.value?t.typed=!0:C(this,"type",t,e),t}}}function Y(...t){return{...t[0],pipe:t,get"~standard"(){return D(this)},"~run"(e,n){for(let r of t)if("metadata"!==r.kind){if(e.issues&&("schema"===r.kind||"transformation"===r.kind)){e.typed=!1;break}e.issues&&(n.abortEarly||n.abortPipeEarly)||(e=r["~run"](e,n))}return e}}}function B(t,e,n){let r=t["~run"]({value:e},R(n));return{typed:r.typed,success:!r.issues,output:r.value,issues:r.issues}}let H=Y(J(),V(1)),K=W(H),X=G({baseUrl:H,dataset:K,id:H,path:H,projectId:K,tool:K,type:K,workspace:K,perspective:{...a=J(),fallback:"drafts",get"~standard"(){return D(this)},"~run"(t,e){let n=a["~run"](t,e);return n.issues?{typed:!0,value:q(this,n,e)}:n}}});function F(t){return!X["~run"]({value:t},{abortEarly:!0}).issues}function Q(t){let e="";for(let n of t){if("string"==typeof n){e&&(e+="."),e+=n;continue}if("number"==typeof n){e&&(e+=":"),e+=`${n}`;continue}if(null!==n&&Array.isArray(n)){e&&(e+=":"),e+=`${n.join(",")}}`;continue}if(n._key){e&&(e+=":"),e+=`${n._key}`;continue}}return e}let Z=/^([\w-]+):(0|[1-9][0-9]*)$/,tt=/^([\w-]+):([0-9]+),([0-9]+)$/,te=/^([\w-]+):([\w-]+)$/,tn=Y(J(),V(1)),tr=G({origin:tn,href:tn,data:W(function t(e,n,r){return{kind:"schema",type:"record",reference:t,expects:"Object",async:!1,key:e,value:n,message:r,get"~standard"(){return D(this)},"~run"(t,e){let n=t.value;if(n&&"object"==typeof n){for(let r in t.typed=!0,t.value={},n)if(Object.hasOwn(n,r)&&"__proto__"!==r&&"prototype"!==r&&"constructor"!==r){let i=n[r],o=this.key["~run"]({value:r},e);if(o.issues){let s={type:"object",origin:"key",input:n,key:r,value:i};for(let e of o.issues)e.path=[s],t.issues?.push(e);if(t.issues||(t.issues=o.issues),e.abortEarly){t.typed=!1;break}}let s=this.value["~run"]({value:i},e);if(s.issues){let o={type:"object",origin:"value",input:n,key:r,value:i};for(let e of s.issues)e.path?e.path.unshift(o):e.path=[o],t.issues?.push(e);if(t.issues||(t.issues=s.issues),e.abortEarly){t.typed=!1;break}}o.typed&&s.typed||(t.typed=!1),o.typed&&(t.value[o.value]=s.value)}}else C(this,"type",t,e);return t}}}(J(),function t(){return{kind:"schema",type:"unknown",reference:t,expects:"unknown",async:!1,get"~standard"(){return D(this)},"~run":t=>(t.typed=!0,t)}}()))});function ti(t){let e=B(X,t);if(e.success)return e.output;let n=B(tr,t);if(n.success)try{let t=new URL(n.output.href,typeof document>"u"?"https://example.com":location.origin);return t.searchParams.size>0?function(t,e,n){let r=t["~run"]({value:e},R(void 0));if(r.issues)throw new U(r.issues);return r.value}(X,Object.fromEntries(t.searchParams.entries())):n.output}catch(t){return console.error("Failed to parse sanity node",t),n.output}}function to(t){if("object"==typeof t&&null!==t)return ti(t);try{let e=JSON.parse(t);return ti(e)}catch{let e=t.split(";").reduce((t,e)=>{let[n,r]=e.split("=");if(!n||e.includes("=")&&!r)return t;switch(n){case"id":t.id=r;break;case"type":t.type=r;break;case"path":t.path=l.studioPath.toString(function(t){let e=[];for(let n of t.split(".")){let t=Z.exec(n);if(t){e.push(t[1],Number(t[2]));continue}let r=tt.exec(n);if(r){e.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=te.exec(n);if(i){e.push(i[1],{_key:i[2]});continue}e.push(n)}return e}(r));break;case"base":t.baseUrl=decodeURIComponent(r);break;case"perspective":t.perspective=r;break;case"tool":t.tool=r;break;case"workspace":t.workspace=r;break;case"projectId":t.projectId=r;break;case"dataset":t.dataset=r}return t},{});if(F(e))return e;return}}t.s(["createDataAttribute",()=>function t(e){function n(t){return t?"string"==typeof t?l.studioPath.fromString(t):t:[]}function r(t){if(!t.id)throw Error("`id` is required to create a data attribute");if(!t.type)throw Error("`type` is required to create a data attribute");if(!t.path||!t.path.length)throw Error("`path` is required to create a data attribute");return function(t){let{id:e,path:n,baseUrl:r,tool:i,workspace:o,type:s}=t;return F(t)?[["id",(0,l.getPublishedId)(e)],["type",s],["path",Q(l.studioPath.fromString(n))],["base",encodeURIComponent(r)],["workspace",o],["tool",i]].filter(([,t])=>!!t).map(t=>t.join("=")).join(";"):void 0}({baseUrl:t.baseUrl||"/",workspace:t.workspace,tool:t.tool,type:t.type,id:t.id,path:"str
2ing"==typeof t.path?t.path:l.studioPath.toString(t.path),perspective:t.perspective})}let i=t=>r({...e,path:[...n(e.path),...n(t)]});return i.toString=function(){return r(e)},i.combine=function(n){return t({...e,...n})},i.scope=function(r){return t({...e,path:[...n(e.path),...n(r)]})},i},"decodeSanityNodeData",()=>to,"pathToUrlString",()=>Q],989955);var ts={0:8203,1:8204,2:8205,3:8290,4:8291,5:8288,6:65279,7:8289,8:119155,9:119156,a:119157,b:119158,c:119159,d:119160,e:119161,f:119162},ta={0:8203,1:8204,2:8205,3:65279},tu={0:String.fromCodePoint(ta[0]),1:String.fromCodePoint(ta[1]),2:String.fromCodePoint(ta[2]),3:String.fromCodePoint(ta[3])},tl=[,,,,].fill(String.fromCodePoint(ta[0])).join(""),tc=Object.fromEntries(Object.entries(tu).map(t=>[t[1],+t[0]])),td=Object.fromEntries(Object.entries(ts).map(t=>t.reverse())),tf=`${Object.values(ts).map(t=>`\\u{${t.toString(16)}}`).join("")}`,tp=RegExp(`[${tf}]{4,}`,"gu");function th(t,e){let n,r,i,o,s,a,f,p,h,y=(0,u.c)(17),[m,g]=(0,c.useState)(!0),[v,b]=(0,c.useState)(t),[w,x]=(0,c.useState)(null),[E,S]=(0,c.useState)(t),k=_(),I=(0,c.useRef)(null);y[0]!==e?(n=()=>{I.current=(t,n)=>(Array.isArray(e)?e:[e]).reduce((e,n)=>n(e,{document:t.document,id:(0,l.getPublishedId)(t.id),originalId:t.id,type:t.type}),n)},r=[e],y[0]=e,y[1]=n,y[2]=r):(n=y[1],r=y[2]),(0,c.useInsertionEffect)(n,r),y[3]!==t?(i=()=>S(t),y[3]=t,y[4]=i):i=y[4];let A=(0,c.useRef)(i);return y[5]!==t?(o=()=>{A.current=()=>S(t)},s=[t],y[5]=t,y[6]=o,y[7]=s):(o=y[6],s=y[7]),(0,c.useInsertionEffect)(o,s),y[8]!==k?(a=()=>{let t;if((0,d.isEmptyActor)(k))return;let e=k.on("rebased.local",e=>{let n={document:e.document,id:e.id,originalId:(0,l.getPublishedId)(e.id),type:"mutate"};b(t=>I.current?I.current(n,t):t),x(n),A.current(),g(!1),clearTimeout(t)}),n=k.on("pristine",()=>{t=setTimeout(()=>{(0,c.startTransition)(()=>g(!0))},15e3)});return()=>{e.unsubscribe(),n.unsubscribe()}},f=[k],y[8]=k,y[9]=a,y[10]=f):(a=y[9],f=y[10]),(0,c.useEffect)(a,f),y[11]!==w||y[12]!==E||y[13]!==t||y[14]!==m?(p=()=>{if(!m){if(!w)throw Error("No last event found when syncing passthrough");E!==t&&(0,c.startTransition)(()=>{b(I.current?I.current(w,t):t),S(t)})}},h=[w,E,t,m],y[11]=w,y[12]=E,y[13]=t,y[14]=m,y[15]=p,y[16]=h):(p=y[15],h=y[16]),(0,c.useEffect)(p,h),m?t:v}let ty=[];for(let t=0;t<256;++t)ty.push((t+256).toString(16).slice(1));let tm=new Uint8Array(16);var tg="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);function tv(t,e,n){if(tg&&!t)return tg();let r=(t=t||{}).random??t.rng?.()??function(){if(!o){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");o=crypto.getRandomValues.bind(crypto)}return o(tm)}();if(r.length<16)throw Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(t,e=0){return(ty[t[e+0]]+ty[t[e+1]]+ty[t[e+2]]+ty[t[e+3]]+"-"+ty[t[e+4]]+ty[t[e+5]]+"-"+ty[t[e+6]]+ty[t[e+7]]+"-"+ty[t[e+8]]+ty[t[e+9]]+"-"+ty[t[e+10]]+ty[t[e+11]]+ty[t[e+12]]+ty[t[e+13]]+ty[t[e+14]]+ty[t[e+15]]).toLowerCase()}(r)}function tb(t){let e=t.getBoundingClientRect();return{x:e.x+scrollX,y:e.y+scrollY,w:e.width,h:e.height}}function tw(t,e,n){return"x"===n?{x:t.x+e,y:t.y,w:t.w-2*e,h:t.h}:{x:t.x,y:t.y+e,w:t.w,h:t.h-2*e}}function tx(t,e){return t.x===e.x&&t.y===e.y&&t.w===e.w&&t.h===e.h}function t_(t,e){let n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function tE(t,e,n){let r,i,o={x:t.x1,y:t.y1};if(e.some(t=>{var e;let r,i;return e=tw(t,Math.min(t.w,t.h)/10,"horizontal"===n?"x":"y"),r=o.x>=e.x&&o.x<=e.x+e.w,i=o.y>=e.y&&o.y<=e.y+e.h,r&&i}))return null;for(let s of e){let e=function(t,e){let n=[{x1:e.x,y1:e.y,x2:e.x+e.w,y2:e.y},{x1:e.x+e.w,y1:e.y,x2:e.x+e.w,y2:e.y+e.h},{x1:e.x+e.w,y1:e.y+e.h,x2:e.x,y2:e.y+e.h},{x1:e.x,y1:e.y+e.h,x2:e.x,y2:e.y}],r=[];for(let e=0;e<n.length;e++){let i=function(t,e){let{x1:n,y1:r,x2:i,y2:o}=t,{x1:s,y1:a,x2:u,y2:l}=e;if(n===i&&r===o||s===u&&a===l)return!1;let c=(l-a)*(i-n)-(u-s)*(o-r);if(0===c)return!1;let d=((u-s)*(r-a)-(l-a)*(n-s))/c,f=((i-n)*(r-a)-(o-r)*(n-s))/c;return!(d<0)&&!(d>1)&&!(f<0)&&!(f>1)&&{x:n+d*(i-n),y:r+d*(o-r)}}(t,n[e]);if(i){let t=!1;for(let e=0;e<r.length;e++)r[e].x===i.x&&r[e].y===i.y&&(t=!0);t||r.push(i)}}return 0!==r.length&&r.sort((e,n)=>t_(e,{x:t.x1,y:t.y1})-t_(n,{x:t.x1,y:t.y1}))}(t,tw(s,Math.min(s.w,s.h)/10,"horizontal"===n?"x":"y"));if(e){let t=e[0];r?t_(o,t)<t_(o,r)&&(r=t,i=s):(r=t,i=s)}}return i||null}function tS(t,e,n){let{x:r,y:i,w:o,h:s}=t,{x:a,y:u}=n;return{x:a+(r-a)*e,y:u+(i-u)*e,w:o*e,h:s*e}}function tk(t){let e=Math.max(0,Math.min(...t.map(t=>t.y))),n=Math.min(document.body.scrollHeight,Math.max(...t.map(t=>t.y+t.h)));return{min:e,max:n,height:n-e}}function tI(t,e){return e.find(e=>
2tx(tb(e.elements.element),t))?.sanity}function tA(t,e,n){return Object.values(e).every(t=>null===t)?null:"horizontal"===n?{left:e.left?{rect:e.left,sanity:tI(e.left,t)}:null,right:e.right?{rect:e.right,sanity:tI(e.right,t)}:null}:{top:e.top?{rect:e.top,sanity:tI(e.top,t)}:null,bottom:e.bottom?{rect:e.bottom,sanity:tI(e.bottom,t)}:null}}function t$(t){let e=document.body.getBoundingClientRect();return{x:Math.max(e.x,Math.min(t.clientX,e.x+e.width)),y:t.clientY+window.scrollY}}function tO(t,e,n){let r=tb(e),i=[...e.querySelectorAll(":where(h1, h2, h3, h4, p, a, img, span, button):not(:has(*))")];t.x<=r.x&&(t.x=r.x),t.x>=r.x+r.w&&(t.x=r.x+r.w),t.y>=r.y+r.h&&(t.y=r.y+r.h),t.y<=r.y&&(t.y=r.y);let o=i.map(t=>{let e=tS(tb(t),n,{x:r.x,y:r.y});return{x:e.x-r.x,y:e.y-r.y,w:e.w,h:e.h,tagName:t.tagName}});return{offsetX:(r.x-t.x)*n,offsetY:(r.y-t.y)*n,w:r.w*n,h:r.h*n,maxWidth:r.w*n*.75,childRects:o}}async function tT(t,e,n,r,i){return new Promise(o=>{t.addEventListener("transitionend",()=>{setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"})},2*i),o()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!0}),document.body.style.overflow="hidden",document.body.style.height="100%",document.documentElement.style.overflow="initial",document.documentElement.style.height="100%",setTimeout(()=>{t.style.transformOrigin="50% 0px",t.style.transition="transform 150ms ease",t.style.transform=`translate3d(0px, ${-n+scrollY}px, 0px) scale(${e})`},25)})}function tM(t){let e,n,r=(e=Math.max(0,Math.min(...t.map(t=>t.x))),{min:e,max:n=Math.min(document.body.offsetWidth,Math.max(...t.map(t=>t.x+t.w))),width:n-e}),i=tk(t),o=r.min>8&&r.min+r.width<=window.innerWidth-8,s=i.min>8&&i.min+i.height<=document.body.scrollHeight-8,a=o&&s;return{x:a?r.min-8:r.min,y:a?i.min-8:i.min,w:a?r.width+16:r.width,h:a?i.height+16:i.height}}async function tN(t,e,n,r,i,o){return new Promise(s=>{if(1===new DOMMatrix(window.getComputedStyle(e).transform).a)return;let a=n-window.innerHeight,u=scrollY;(t-=window.innerHeight/2)<0&&(t=0),e.addEventListener("transitionend",()=>{e.style.transition="none",e.style.transform="none",scrollTo({top:t,behavior:"instant"}),setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!1})},2*i),s()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),e.style.transform=`translateY(${Math.max(u-t,-a+u)}px) scale(1)`,o&&(document.body.style.overflow=o.body.overflow,document.body.style.height=o.body.height,document.documentElement.style.overflow=o.documentElement.overflow,document.documentElement.style.height=o.documentElement.height)})}let tj=!1,tP={y:0},tL={x:0,y:0},tR=typeof document>"u"?0:document.documentElement.scrollHeight,tC=null,tD=t=>t instanceof HTMLElement||t instanceof SVGElement,tU=t=>t&&tD(t)?t.dataset?.sanityOverlayElement?t:tU(t.parentElement):null;function tV(t){return tp.lastIndex=0,tp.test(t)}function tq(t,e=!1){return tV(t)?function(t,e=!1){try{let n=function(t){let e=t.match(tp);if(e)return function(t,e=!1){let n=Array.from(t);if(n.length%2==0){if(n.length%4||!t.startsWith(tl))return function(t,e){var n;let r=[];for(let e=.5*t.length;e--;){let n=`${td[t[2*e].codePointAt(0)]}${td[t[2*e+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(n,16)))}let i=[],o=[r.join("")],s=10;for(;o.length;){let t=o.shift();try{if(i.push(JSON.parse(t)),e)break}catch(r){if(!s--)throw r;let e=+(null==(n=r.message.match(/\sposition\s(\d+)$/))?void 0:n[1]);if(!e)throw r;o.unshift(t.substring(0,e),t.substring(e))}}return i}(n,e)}else throw Error("Encoded data has invalid length");let r=n.slice(4),i=new Uint8Array(r.length/4);for(let t=0;t<i.length;t++)i[t]=tc[r[4*t]]<<6|tc[r[4*t+1]]<<4|tc[r[4*t+2]]<<2|tc[r[4*t+3]];let o=new TextDecoder().decode(i);if(e){let t=o.indexOf("\0");return -1===t&&(t=o.length),[JSON.parse(o.slice(0,t))]}return o.split("\0").filter(Boolean).map(t=>JSON.parse(t))}(e[0],!0)[0]}(t);return n&&"sanity.io"===n.origin?(e&&(n.href=n.href?.replace(".alt","")),n):null}catch(e){return console.error("Failed to decode stega for string: ",t,"with the original error: ",e),null}}(t,e):null}function tz(t){return"path"in t}function tG(t){if(!t.length||!t.map(t=>tz(t)).every((t,e,n)=>t===n[0]))return;if(!tz(t[0]))return t[0];let e=t.filter(tz),n=t[0],r=["projectId","dataset","id","baseUrl","workspace","tool"];for(let t=1;t<e.length;t++){let i=e[t];if(r.some(t=>i[t]!==n?.[t])){n=void 0;break}n={...n,path:function(t,e){let n=t.split("."),r=e.split("."),i=Math.min(n.length,r.length);return n=n.slice(0,i).reverse(),r=r.slice(0,i).reverse(),n.reduce((t,e,n)=>e===r[n]?[...t,e]:[],[]).reverse().join(".")}(n.path,i.path)}}return n}function tW(t){let e=t.lastIndexOf(".");return t.substring(e,t.length).includes("[")}function tJ(t){if(!tW(t))return null;let e=t.split(".");return e[e.length-1]=e[e.length-1].replace(/\[.*?\]/g,"[]"),e.join(".")}function tY(t,e){return!!tW(t.path)&&!!tW(e.path)&&tJ(t.path)===tJ(e.path)}function tB(t,e,n,r){if(!t.getAttribute("data-sanity")||t.getAttribute("data-sanity-drag-disable")||!e||!tz(e)||!tW(e.path))return null;let i=t.getAttribute("data-sanity-drag-group"),o=[...n].reduce((t,n)=>{let o=r.get(n),s=n.getAttribute("data-sanity-drag-disable"),a=n.getAttribute("data-sanity-drag-group"),u=null!==n.getAttribute("data-sanity");
2return o?.sanity&&!s&&tz(o.sanity)&&tY(e,o.sanity)&&(null===i||i===a)&&u&&t.push(o),t},[]);return o.length<=1?null:o}function tH({handler:t,overlayElement:e,inFrame:n,inPopUp:r,optimisticActorReady:i}){let o=!1,s=new Map,a=new WeakMap,u=new Set,l=new WeakMap,c=new WeakMap,d,f,p,h=!1,y=[],m=()=>y[y.length-1];function g(t,e){t.removeEventListener("click",e.click,{capture:!0}),t.removeEventListener("contextmenu",e.contextmenu,{capture:!0}),t.removeEventListener("mousemove",e.mousemove,{capture:!0}),t.removeEventListener("mousedown",e.mousedown,{capture:!0}),t.removeEventListener("mouseenter",e.mouseenter),t.removeEventListener("mouseleave",e.mouseleave)}function v({id:e,elements:n,handlers:r}){let{element:i,measureElement:o}=n;i.addEventListener("click",r.click,{capture:!0}),i.addEventListener("contextmenu",r.contextmenu,{capture:!0}),i.addEventListener("mousemove",r.mousemove,{once:!0,capture:!0}),i.addEventListener("mousedown",r.mousedown,{capture:!0}),d.observe(o),t({type:"element/activate",id:e})}function b({id:e,elements:n,handlers:r}){let{element:i,measureElement:o}=n;g(i,r),d.unobserve(o),y=y.filter(t=>t!==i),t({type:"element/deactivate",id:e})}function w(e){if(!(!n&&!r||!i))for(let n of y){if(e===n){let n=a.get(e)?.sanity;if(!n||!tz(n))return;if(tB(e,n,u,a)){let n=e.style.cursor;n&&c.set(e,n),t({type:"overlay/setCursor",element:e,cursor:"move"});continue}}x(n)}}function x(e){let n=c.get(e);t({type:"overlay/setCursor",element:e,cursor:n})}function _(c){for(let d of function t(e){let n=[];function r(t,e,n,r){let i=to(e);if(!i)return;let o=function t(e){let{display:n}=window.getComputedStyle(e);if("inline"!==n)return e;let r=e.parentElement;return r?t(r):null}(t);if(o)return{elements:{element:t,measureElement:o},sanity:i,reason:n,preventGrouping:r}}if(e)for(let i of e.childNodes)!function e(i,o){let s=function(e){let{nodeType:n,parentElement:i,textContent:o}=e;if(e.nodeType===Node.ELEMENT_NODE&&e.dataset?.sanityEditTarget!==void 0){let n=tG(t(e).map(t=>"element"===t.type?t.commonSanity:void 0).filter(t=>void 0!==t));if(n)return{reason:"edit-target",elements:{element:e,measureElement:e},sanity:n}}else if(n===Node.TEXT_NODE&&i&&o){let t=tq(o);return t?r(i,t,"stega-text",!0):void 0}else if(e.nodeType===Node.ELEMENT_NODE){if("SCRIPT"===e.tagName||"SANITY-VISUAL-EDITING"===e.tagName)return;if(e.dataset?.sanity)return r(e,e.dataset.sanity,"data-attribute",!!(e.textContent&&tV(e.textContent)));if(e.dataset?.sanityEditInfo)return r(e,e.dataset.sanityEditInfo,"data-attribute",!!(e.textContent&&tV(e.textContent)));if("IMG"===e.tagName){let t=tq(e.alt,!0);return t?r(e,t,"stega-attribute"):void 0}if("TIME"===e.tagName){let t=tq(e.dateTime,!0);return t?r(e,t,"stega-attribute"):void 0}if("SVG"===e.tagName.toUpperCase()){if(!e.ariaLabel)return;let t=tq(e.ariaLabel,!0);return t?r(e,t,"stega-attribute"):void 0}}}(i),a=o;if(i.nodeType===Node.ELEMENT_NODE&&i.dataset?.sanityEditGroup!==void 0&&(a={type:"group",elements:{element:i,measureElement:i},targets:[]},n.push(a)),s){let t={elements:s.elements,sanity:s.sanity,reason:s.reason};a&&!s.preventGrouping?a.targets.push(t):n.push({elements:s.elements,type:"element",targets:[t]})}if(i.nodeType===Node.ELEMENT_NODE&&"IMG"!==i.tagName&&"SCRIPT"!==i.tagName&&"SANITY-VISUAL-EDITING"!==i.tagName)for(let t of i.childNodes)e(t,a)}(i,void 0);return n.map(t=>{if(0===t.targets.length&&"group"===t.type)return{...t,commonSanity:void 0};let e=1===t.targets.length?t.targets[0].sanity:tG(t.targets.map(({sanity:t})=>t).filter(t=>void 0!==t))||t.targets[0].sanity;return e?{...t,commonSanity:e}:null}).filter(t=>null!==t)}(c)){if("group"===d.type){for(let t of d.targets){let e=a.get(t.elements.element);e&&"element"===e.type&&E(t.elements.element)}0===d.targets.length&&E(d.elements.element)}if(!d.commonSanity)continue;let{element:c}=d.elements;a.has(c)?function(e){let{element:n}=e.elements,r=a.get(n);r&&(a.set(n,{...r,sanity:e.commonSanity}),t({type:"element/update",elementType:r.type,id:r.id,rect:tb(n),sanity:e.commonSanity,targets:e.targets.map(t=>({sanity:t.sanity,element:t.elements.element}))}))}(d):function({type:c,elements:d,commonSanity:p,targets:g}){let{element:b,measureElement:_}=d,E={click(e){let r=e.target;if(b===m()&&b.contains(r)){n&&(e.preventDefault(),e.stopPropagation());let r=a.get(b)?.sanity;r&&!h&&t({type:"element/click",id:S,sanity:r})}},contextmenu(e){if(!("path"in p)||!n&&!r||!i||!p.path.split(".").pop()?.includes("[_key=="))return;let o=e.target;b===m()&&b.contains(o)&&((n||r)&&(e.preventDefault(),e.stopPropagation()),t({type:"element/contextmenu",id:S,position:{x:e.clientX,y:e.clientY},sanity:p}))},mousedown(e){if(e.preventDefault(),e.currentTarget!==y.at(-1)||b.getAttribute("data-sanity-drag-disable")||!n&&!r||!i)return;let o=a.get(b)?.sanity;if(!o||!tz(o)||!tW(o.path))return;let s=tB(b,p,u,a);s&&function(t){var e;let{mouseEvent:n,element:r,overlayGroup:i,handler:o,target:s,onSequenceStart:a,onSequenceEnd:u}=t;if(0!==n.button)return;window.focus();let l=i.map(t=>tb(t.elements.element)),c=r.getAttribute("data-sanity-drag-flow")||((e=l).some(t=>e.filter(e=>!tx(t,e)).some(e=>t.y===e.y))?"horizontal":"vertical"),d=r.getAttribute("data-sanity-drag-group"),f=!!r.getAttribute("data-sanity-drag-minima
2p-disable"),p=!!r.getAttribute("data-sanity-drag-prevent-default"),h=r.getAttribute("data-unstable_sanity-drag-document-height"),y=r.getAttribute("data-unstable_sanity-drag-group-height"),m=null,g=t$(n),v=document.body,{minYScaled:b,scaleFactor:w}=function(t,e){let n=e||tk(t).height,r=(n+=200)>window.innerHeight?window.innerHeight/n:1,{min:i}=tk(t.map(t=>tS(t,r,{x:window.innerWidth/2,y:0})));return{scaleFactor:r,minYScaled:i-100*r}}(l,y?~~y:null),x=!1,_=!1,E=!0;tj||(tC={body:{overflow:window.getComputedStyle(document.body).overflow,height:window.getComputedStyle(document.body).height},documentElement:{overflow:window.getComputedStyle(document.documentElement).overflow,height:window.getComputedStyle(document.documentElement).height}},tR=h?~~h:document.documentElement.scrollHeight);let S=setInterval(()=>{l=i.map(t=>tb(t.elements.element))},150),k=()=>{w>=1||(o({type:"overlay/dragUpdateSkeleton",skeleton:tO(tL,r,w)}),o({type:"overlay/dragToggleMinimapPrompt",display:!1}),tT(v,w,b,o,150).then(()=>{setTimeout(()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:tM(l)})},300)}))},I=t=>{Math.abs(t.deltaY)>=10&&w<1&&!tj&&!_&&!f&&E&&(o({type:"overlay/dragToggleMinimapPrompt",display:!0}),_=!0),!t.shiftKey||tj||f||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),tj=!0,setTimeout(()=>{k()},50))},A=t=>{if(t.preventDefault(),tP=function(t){let e=document.body,n=window.getComputedStyle(e).transform;if("none"===n)return{x:t.x,y:t.y};let r=new DOMMatrix(n).inverse(),i=new DOMPoint(t.x,t.y).matrixTransform(r);return{x:i.x,y:i.y}}(tL=t$(t)),4>Math.abs(t_(tL,g)))return;if(!x){let t=tM(l),e=tO(tL,r,1);o({type:"overlay/dragStart",flow:c}),o({type:"overlay/dragUpdateSkeleton",skeleton:e}),o({type:"overlay/dragUpdateGroupRect",groupRect:t}),x=!0,a()}o({type:"overlay/dragUpdateCursorPosition",x:tL.x,y:tL.y}),!t.shiftKey||tj||f||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),tj=!0,setTimeout(()=>{k()},50));let e=function(t,e,n){if("horizontal"===n){let r={x1:t.x,y1:t.y,x2:t.x-1e8,y2:t.y},i={x1:t.x,y1:t.y,x2:t.x+1e8,y2:t.y};return{left:tE(r,e,n),right:tE(i,e,n)}}{let r={x1:t.x,y1:t.y,x2:t.x,y2:t.y-1e8},i={x1:t.x,y1:t.y,x2:t.x,y2:t.y+1e8};return{top:tE(r,e,n),bottom:tE(i,e,n)}}}(tL,l,c);JSON.stringify(m)!==JSON.stringify(e)&&o({type:"overlay/dragUpdateInsertPosition",insertPosition:tA(i,m=e,c)})},$=()=>{E=!1,o({type:"overlay/dragEnd",target:s,insertPosition:m?tA(i,m,c):null,dragGroup:d,flow:c,preventInsertDefault:p}),_&&o({type:"overlay/dragToggleMinimapPrompt",display:!1}),tj||(clearInterval(S),u(),j(),N()),M()},O=t=>{"Shift"===t.key&&tj&&(tj=!1,o({type:"overlay/dragUpdateSkeleton",skeleton:tO(tL,r,1/w)}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{tN(tP.y,v,tR,o,150,tC)},50),o({type:"overlay/dragUpdateGroupRect",groupRect:null}),E||(clearInterval(S),M(),j(),N(),u()))},T=()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:null}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{tN(tP.y,v,tR,o,150,tC).then(()=>{tj=!1})},50),clearInterval(S),M(),j(),N(),u()},M=()=>{window.removeEventListener("mousemove",A),window.removeEventListener("wheel",I),window.removeEventListener("mouseup",$)},N=()=>{window.removeEventListener("keyup",O)},j=()=>{window.removeEventListener("blur",T)};window.addEventListener("blur",T),window.addEventListener("keyup",O),window.addEventListener("wheel",I),window.addEventListener("mousemove",A),window.addEventListener("mouseup",$)}({element:b,handler:t,mouseEvent:e,overlayGroup:s,target:o,onSequenceStart:()=>{h=!0},onSequenceEnd:()=>{setTimeout(()=>{h=!1},250)}})},mousemove(t){E.mouseenter(t);let e=t.currentTarget;e&&(e.addEventListener("mouseenter",E.mouseenter),e.addEventListener("mouseleave",E.mouseleave))},mouseenter(){document.querySelector("vercel-live-feedback")&&b.closest("[data-vercel-edit-info]")||b.closest("[data-vercel-edit-target]")||(y.push(b),t({type:"element/mouseenter",id:S,rect:tb(b)}),w(b))},mouseleave(n){function r(){y.pop();let e=m();if(t({type:"element/mouseleave",id:S}),e){w(e);let n=a.get(e);n&&t({type:"element/mouseenter",id:n.id,rect:tb(e)})}x(b)}let{relatedTarget:i}=n,o=tU(i),s=e.contains(o);if(tD(o)&&s)return function t(e){let n=i=>{let{relatedTarget:o}=i;tU(o)?o&&tD(o)&&(e.removeEventListener("mouseleave",n),t(o)):(e.removeEventListener("mouseleave",n),r())};e.addEventListener("mouseleave",n)}(o);r()}},S=tv(),k={type:c,id:S,elements:d,sanity:p,handlers:E};u.add(b),l.set(_,b),s.set(S,b),a.set(b,k),f?.observe(b),t({type:"element/register",elementType:c,id:S,element:b,rect:tb(b),sanity:p,dragDisabled:!!b.getAttribute("data-sanity-drag-disable"),targets:g.map(t=>({sanity:t.sanity,element:t.elements.element}))}),o&&v(k)}(d)}}function E(e){let n=a.get(e);if(n){let{id:r,handlers:i}=n;g(e,i),d.unobserve(e),a.delete(e),u.delete(e),s.delete(r),t({type:"element/unregister",id:r})}}function S(e){let n=a.get(e);n&&t({type:"element/updateRect",id:n.id,rect:tb(e)})}function k(t){if(o)for(let e of t){let{target:t}=e,n=tD(t)&&a.get(t);n&&(e.isIntersecting?v(n):b(n))}}function I(e){let n=tU(e.target);if(n){"capture"===n.dataset.sanityOverlayElement&&(e.preventDefault(),e.stopPropagation());return}y=[],t({type:"overlay/blur"})}function A(){y=[],t({type:"overlay/reset-mouse-state"})}function $(){for(let t of u)S(t)}function O(e){"Escape"===e.key&&(y=[],t({type:"overlay/blur"}))}function T(t){let{target:e}=t;if(!(e===window.document||!tD(e)))for(let t of u)e.contains(t)&&S(t)}function M(){o||(f=new IntersectionObserver(k,{threshold:.3}),u.forEach(t=>f.observe(t)),t({type:"overlay/activate"}),o=!0)}function N(){o&&(f?.disconnect(),u.forEach(t=>{let e=a.get(t);e&&b(e)}),t({type:"overlay/deactivate"}),o=!1)}function j(e){let{id:n}=e.detail,r=s.get(n);if(!r)return;let i=a.get(r)?.sanity;i&&t({type:"element/click",id:n,sanity:i})}return window.document.fonts.ready.then(()=>{for(let t of u)S(t)}),window.addEventListener("click",I),window.addEventListener("contextmenu",I),window.addEventListener("sanity-overlay/exclusive-plugin-closed",A),window.addEventListener("sanity-overlay/label-click",j),window.addEventListener("keydown",O),window.addEventListener("resize",$),window.addEventListener("scroll",T,{capture:!0,passive:!0}),d=new ResizeObserver(function(t){for(let e of t){let t=e.target;if(tD(t)){let e=l.get(t);if(!e)return;S(e)}}}),(p=new MutationObserver(function(t){let n=!1;for(let r of t){let{target:t,type:i}=r,o="characterData"===i?t.parentElement:t;
2if(!(o===e||e.contains(o))&&(n=!0,tD(o))){let t=o.parentElement?.closest("[data-sanity-edit-group]")||null;_({childNodes:[tD(t)?t:o]})}}if(n)for(let t of u)t.isConnected||E(t),a.get(t)?.type!=="group"||t.hasAttribute("data-sanity-edit-group")||E(t)})).observe(document.body,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),_(document.body),M(),{activate:M,deactivate:N,destroy:function(){window.removeEventListener("click",I),window.removeEventListener("contextmenu",I),window.removeEventListener("sanity-overlay/exclusive-plugin-closed",A),window.removeEventListener("sanity-overlay/label-click",j),window.removeEventListener("keydown",O),window.removeEventListener("resize",$),window.removeEventListener("scroll",T),p.disconnect(),d.disconnect(),u.forEach(t=>{E(t)}),s.clear(),u.clear(),y=[],N()}}}let tK=(0,c.createContext)(null);t.s(["SharedStateContext",()=>tK,"createOverlayController",()=>tH,"sanityNodesExistInSameArray",()=>tY,"useOptimistic",()=>th,"v4",()=>tv],523694)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.