PageSourceSearch

https://mister-anderson.ai/_next/static/chunks/92.d930113b4a5ca8f3.js

js mister-anderson.ai collected 2026-10-05 12:17:32 UTC 128,170 bytes, 214 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[92],{70227:function(e,t,n){"use strict";let r,i,o;var a,s,l=Object.create,u=Object.defineProperty,c=Object.getOwnPropertyDescriptor,d=Object.getOwnPropertyNames,p=Object.getPrototypeOf,f=Object.prototype.hasOwnProperty,m=(e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of d(t))f.call(e,i)||i===n||u(e,i,{get:()=>t[i],enumerable:!(r=c(t,i))||r.enumerable});return e},y={};((e,t)=>{for(var n in t)u(e,n,{get:t[n],enumerable:!0})})(y,{$dispatcherGuard:()=>I,$makeReadOnly:()=>$,$reset:()=>M,$structuralCheck:()=>T,c:()=>E,clearRenderCounterRegistry:()=>O,renderCounterRegistry:()=>C,useRenderCounter:()=>A}),e.exports=m(u({},"__esModule",{value:!0}),y);var h=(o=null!=(r=n(2265))?l(p(r)):{},m(!i&&r&&r.__esModule?o:u(o,"default",{value:r,enumerable:!0}),r)),{useRef:g,useEffect:v,isValidElement:b}=h,w=null!=(a=h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE)?a:h.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,x=Symbol.for("react.memo_cache_sentinel"),E="function"==typeof(null==(s=h.__COMPILER_RUNTIME)?void 0:s.c)?h.__COMPILER_RUNTIME.c:function(e){return h.useMemo(()=>{let t=Array(e);for(let n=0;n<e;n++)t[n]=x;return t[x]=!0,t},[])},_={};["readContext","useCallback","useContext","useEffect","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useDebugValue","useDeferredValue","useTransition","useMutableSource","useSyncExternalStore","useId","unstable_isNewReconciler","getCacheSignal","getCacheForType","useCacheRefresh"].forEach(e=>{_[e]=()=>{throw Error(`[React] Unexpected React hook call (${e}) from a React compiled function. Check that all hooks are called directly and named according to convention ('use[A-Z]') `)}});var j=null;function k(e){return w.ReactCurrentDispatcher.current=e,w.ReactCurrentDispatcher.current}_.useMemoCache=e=>{if(null!=j)return j.useMemoCache(e);throw Error("React Compiler internal invariant violation: unexpected null dispatcher")};var S=[];function I(e){let t=w.ReactCurrentDispatcher.current;if(0===e){if(S.push(t),1===S.length&&(j=t),t===_)throw Error("[React] Unexpected call to custom hook or component from a React compiled function. Check that (1) all hooks are called directly and named according to convention ('use[A-Z]') and (2) components are returned as JSX instead of being directly invoked.");k(_)}else if(1===e){let e=S.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");0===S.length&&(j=null),k(e)}else if(2===e)S.push(t),k(j);else if(3===e){let e=S.pop();if(null==e)throw Error("React Compiler internal error: unexpected null in guard stack");k(e)}else throw Error("React Compiler internal error: unreachable block"+e)}function M(e){for(let t=0;t<e.length;t++)e[t]=x}function $(){throw Error("TODO: implement $makeReadOnly in react-compiler-runtime")}var C=new Map;function O(){for(let e of C.values())e.forEach(e=>{e.count=0})}function A(e){let t=g(null);null!=t.current&&(t.current.count+=1),v(()=>{if(null==t.current){let n;let r={count:0};null==(n=C.get(e))&&(n=new Set,C.set(e,n)),n.add(r),t.current=r}return()=>{null!==t.current&&function(e,t){let n=C.get(e);null!=n&&n.delete(t)}(e,t.current)}})}var R=new Set;function T(e,t,n,r,i,o){function a(e,t,a,s){let l=`${r}:${o} [${i}] ${n}${a} changed from ${e} to ${t} at depth ${s}`;R.has(l)||(R.add(l),console.error(l))}!function e(t,n,r,i){if(!(i>2)&&t!==n){if(typeof t!=typeof n)a(`type ${typeof t}`,`type ${typeof n}`,r,i);else if("object"==typeof t){let o=Array.isArray(t),s=Array.isArray(n);if(null===t&&null!==n)a("null",`type ${typeof n}`,r,i);else if(null===n)a(`type ${typeof t}`,"null",r,i);else if(t instanceof Map){if(n instanceof Map){if(t.size!==n.size)a(`Map instance with size ${t.size}`,`Map instance with size ${n.size}`,r,i);else for(let[o,s]of t)n.has(o)?e(s,n.get(o),`${r}.get(${o})`,i+1):a(`Map instance with key ${o}`,`Map instance without key ${o}`,r,i)}else a("Map instance","other value",r,i)}else if(n instanceof Map)a("other value","Map instance",r,i);else if(t instanceof Set){if(n instanceof Set){if(t.size!==n.size)a(`Set instance with size ${t.size}`,`Set instance with size ${n.size}
1`,r,i);else for(let e of n)t.has(e)||a(`Set instance without element ${e}`,`Set instance with element ${e}`,r,i)}else a("Set instance","other value",r,i)}else if(n instanceof Set)a("other value","Set instance",r,i);else if(o||s){if(o!==s)a(`type ${o?"array":"object"}`,`type ${s?"array":"object"}`,r,i);else if(t.length!==n.length)a(`array with length ${t.length}`,`array with length ${n.length}`,r,i);else for(let o=0;o<t.length;o++)e(t[o],n[o],`${r}[${o}]`,i+1)}else if(b(t)||b(n))b(t)!==b(n)?a(`type ${b(t)?"React element":"object"}`,`type ${b(n)?"React element":"object"}`,r,i):t.type!==n.type?a(`React element of type ${t.type}`,`React element of type ${n.type}`,r,i):e(t.props,n.props,`[props of ${r}]`,i+1);else{for(let e in n)e in t||a(`object without key ${e}`,`object with key ${e}`,r,i);for(let o in t)o in n?e(t[o],n[o],`${r}.${o}`,i+1):a(`object with key ${o}`,`object without key ${o}`,r,i)}}else{if("function"==typeof t)return;isNaN(t)||isNaN(n)?isNaN(t)!==isNaN(n)&&a(`${isNaN(t)?"NaN":"non-NaN value"}`,`${isNaN(n)?"NaN":"non-NaN value"}`,r,i):t!==n&&a(t,n,r,i)}}}(e,t,"",0)}},12119:function(e,t,n){"use strict";Object.defineProperty(t,"$",{enumerable:!0,get:function(){return i}});let r=n(83079);function i(e){let{createServerReference:t}=n(6671);return t(e,r.callServer)}},74951:function(e,t,n){"use strict";n.d(t,{Ax:function(){return d},XP:function(){return u},el:function(){return c}});var r=n(89981);let i={"handshake/syn":r.bK,"handshake/syn-ack":r.Ol,"handshake/ack":r.ei,"channel/response":r.Ag,"channel/heartbeat":r.UE,"channel/disconnect":r.Hq,"overlay/focus":"visual-editing/focus","overlay/navigate":"visual-editing/navigate","overlay/toggle":"visual-editing/toggle","presentation/toggleOverlay":"presentation/toggle-overlay"},o={[r.bK]:"handshake/syn",[r.Ol]:"handshake/syn-ack",[r.ei]:"handshake/ack",[r.Ag]:"channel/response",[r.UE]:"channel/heartbeat",[r.Hq]:"channel/disconnect","visual-editing/focus":"overlay/focus","visual-editing/navigate":"overlay/navigate","visual-editing/toggle":"overlay/toggle","presentation/toggle-overlay":"presentation/toggleOverlay"},a=e=>{let{data:t}=e;return t&&"object"==typeof t&&"domain"in t&&"type"in t&&"from"in t&&"to"in t&&("sanity/channels"===t.domain&&(t.domain=r.yK),"overlays"===t.to&&(t.to="visual-editing"),"overlays"===t.from&&(t.from="visual-editing"),t.channelId=t.connectionId,delete t.connectionId,t.type=i[t.type]??t.type),e},s=e=>{let{channelId:t,...n}=e,i={...n,connectionId:t};return i.domain===r.yK&&(i.domain="sanity/channels"),"visual-editing"===i.to&&(i.to="overlays"),"visual-editing"===i.from&&(i.from="overlays"),i.type=o[i.type]??i.type,"channel/response"===i.type&&i.responseTo&&!i.data&&(i.data={responseTo:i.responseTo}),("handshake/syn"===i.type||"handshake/syn-ack"===i.type||"handshake/ack"===i.type)&&(i.data={id:i.connectionId}),i},l=({context:e},t)=>{let{sources:n,targetOrigin:r}=e,i=s(t.message);n.forEach(e=>{e.postMessage(i,{targetOrigin:r})})},u=()=>({listen:(0,r.F8)(a),requestMachine:(0,r.lB)().provide({actions:{"send message":l}})});function c(){return window.self!==window.top}function d(){return!!window.opener}},50092:function(e,t,n){"use strict";let r,i;n.r(t),n.d(t,{default:function(){return oL}});var o,a,s,l,u,c,d,p,f=n(57437),m=n(70227),y=n(74951),h=n(2265),g=n(54887),v=n(47828),b=n(90535),w=n(77546);function x(e){return e.split(/[[.\]]/g).filter(Boolean).map(e=>e.includes("==")?function(e){let[t,n]=e.split("==");if("_key"!==t)throw Error(`Currently only "_key" is supported as path segment. Found ${t}`);if(typeof n>"u")throw Error('Invalid path segment, expected `key=="value"`');return{_key:n.replace(/^['"]/,"").replace(/['"]$/,"")}}(e):E.test(e)?Number(e):e)}let E=/^-?\d+$/,_=/^[a-z_$]+/;function j(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}]`:"object"==typeof e&&"_key"in e&&"string"==typeof e._key?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&_.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function k(e){if("createIfNotExists"in e)return{type:"createIfNotExists",document:e.createIfNotExists};if("createOrReplace"in e)return{type:"createOrReplace",document:e.createOrReplace};if("create"in e)return{type:"create",document:e.create};
1if("delete"in e)return{id:e.delete.id,type:"delete"};if("patch"in e){var t,n;return{type:"patch",id:e.patch.id,patches:[..."set"in(n=t=e.patch)?Object.keys(n.set).map(e=>({path:x(e),op:{type:"set",value:n.set[e]}})):[],..."setIfMissing"in t?Object.keys(t.setIfMissing).map(e=>({path:x(e),op:{type:"setIfMissing",value:t.setIfMissing[e]}})):[],..."unset"in t?t.unset.map(e=>({path:x(e),op:{type:"unset"}})):[],..."inc"in t?Object.keys(t.inc).map(e=>({path:x(e),op:{type:"inc",amount:t.inc[e]}})):[],..."inc"in t?Object.keys(t.dec).map(e=>({path:x(e),op:{type:"dec",amount:t.dec[e]}})):[],...function(e){if(!("insert"in e))return[];let t=function(e){let t=S.filter(t=>t in e);if(t.length>1)throw Error(`Insert patch is ambiguous. Should only contain one of: ${S.join(", ")}, instead found ${t.join(", ")}`);return t[0]}(e.insert);if(!t)throw Error("Insert patch missing position");let n=x(e.insert[t]),r=n.pop();return[{path:n,op:{type:"insert",position:t,referenceItem:r,items:e.insert.items}}]}(t)]}}throw Error(`Unknown mutation: ${JSON.stringify(e)}`)}let S=["before","replace","after"];function I(e){return $(e)}function M(e){return e.flatMap(I)}function $(e){if("create"===e.type||"createIfNotExists"===e.type||"createOrReplace"===e.type)return{[e.type]:e.document};if("delete"===e.type)return{delete:{id:e.id}};let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[j(t)]};if("insert"===n.type)return{insert:{[n.position]:j([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[j(t)]:n.value}};if("inc"===n.type)return{inc:{[j(t)]:n.amount}};if("dec"===n.type)return{dec:{[j(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[j(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${j(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>j([...t,{_key:e._key}])),insert:{[n.position]:j([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[j(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>j(t.concat(e)))};if("replace"===n.type)return{insert:{replace:j(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[j(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}function C(e){return Array.isArray(e)?e:[e]}var O=Object.freeze({__proto__:null,decode:function(e){return k(e)},decodeAll:function(e){return e.map(k)},encode:I,encodeAll:M,encodeMutation:$,encodeTransaction:function(e){return{transactionId:e.id,mutations:M(e.mutations)}}});function A(e,t,n){return{type:"insert",referenceItem:n,position:t,items:C(e)}}function R(e,t){return{type:"truncate",startIndex:e,endIndex:t}}function T(e){return{type:"remove",referenceItem:e}}function N(e,t){return{path:"string"==typeof e?x(e):e,op:t}}var P=n(40211);let z=(0,P.ah)(),L=z,D=new Set;var U=n(31684);let V=/_key\s*==\s*['"](.*)['"]/,F=/^\d*:\d*$/;function W(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function Z(e){return"string"==typeof e?V.test(e.trim()):"object"==typeof e&&"_key"in e}let Y=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,q=/_key\s*==\s*['"](.*)['"]/;function B(e,t,n){let r="string"==typeof t?function(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(Y);if(!t)throw Error("Invalid path string");return t.map(G)}(t):t;if(!Array.isArray(r))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<r.length;e++){let t=r[e];if(W(t)){if(!Array.isArray(i))return n;i=i[t]}if(Z(t)){if(!Array.isArray(i))return n;i=i.find(e=>e._key===t._key)}if("string"==typeof t&&(i="object"==typeof i&&null!==i?i[t]:void 0),typeof i>"u")return n}return i}function G(e){return W(e)?Number(e.replace(/[^\d]/g,"")):Z(e)?{_key:e.match(q)[1]}:!function(e){if("string"==typeof e&&F.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,n]=e;return("number"==typeof t||""===t)&&("number"==typeof n||""===n)}(e)?e:function(e){let[t,n]=e.split(":").map(e=>""===e?e:Number(e));return[t,n]}(e)}function H(){return(0,h.useSyncExternalStore)(J,X,K)}function K(){return z}function X(){return L}function J(e){return D.add(e),()=>D.delete(e)}function Q(e,t){let n;return(...r)=>{clearTimeout(n),n=setTimeout(()=>{e.apply(e,r)},t)}}function ee(e,t){let n=(0,y.el)(),r=(0,y.Ax)();if(t===z||!n&&!r)throw Error("The `useDocuments` hook cannot be used in this context");let i=(0,v.qy)(e),o=(0,v.vs)(e),a=t.getSnapshot().context?.documents,s=a?.[i],l=a?.[o],u=s||l;if(!u)throw Error(`Document "${e}" not found`);let c=s.getSnapshot().context?.local||l.getSnapshot().context?.local,d=new Promise(e=>{if(c)e(c);else{let t=u.on("ready",n=>{let{snapshot:r}=n;e(r||null),t.unsubscribe()})}});return{draftDoc:s,draftId:i,getSnapshot:()=>d,publishedDoc:l,publishedId:o,get snapshot(){if(!c)throw Error(`Snapshot for document "${e}" not found`);return c}}}function et(){let e,t,n;let r=(0,m.c)(7),i=H();r[0]!==i?(e=e=>({id:e,commit:()=>{let{draftDoc:t}=ee(e,i);t.send({type:"submit"})},get:t=>{let{snapshot:n}=ee(e,i);return t?B(n,t):n},getSnapshot:function(e,t){let{getSnapshot:n}=ee(e,t);return n}(e,i),patch:async(t,n)=>{let r=ee(e,i),{draftDoc:o,draftId:a,getSnapshot:s,publishedId:l}=r,{commit:u=!0}=n||{},c=await ("function"==typeof t?t({draftId:a,publishedId:l,get snapshot(){return r.snapshot},getSnapshot:s}):t),d=await s();if(!d)throw Error(`Snapshot for document "${e}" not found`);o.send({type:"mutate",mutations:[{type:"createIfNotExists",document:{...d,_id:a}},{type:"patch",id:a,patches:C(c)}]}),u&&("object"==typeof u&&"debounce"in u?Q(()=>o.send({type:"submit"}),u.debounce)():o.send({type:"submit"}))}}),r[0]=i,r[1]=e):e=r[1];let o=e;
1r[2]!==i?(t=(e,t,n)=>{let{draftDoc:r}=ee(e,i),{commit:o}=n||{},a=void 0===o||o;r.send({type:"mutate",mutations:t}),a&&("object"==typeof a&&"debounce"in a?Q(()=>r.send({type:"submit"}),a.debounce)():r.send({type:"submit"}))},r[2]=i,r[3]=t):t=r[3];let a=t;return r[4]!==o||r[5]!==a?(n={getDocument:o,mutateDocument:a},r[4]=o,r[5]=a,r[6]=n):n=r[6],n}let en=()=>{if(i)return i;i=[];for(let e=0;e<256;++e)i[e]=(e+256).toString(16).slice(1);return i};function er(e){let t=en();return(function(e=16){let t=new Uint8Array(e);return(0,U.Z)(t),t})(e).reduce((e,n)=>e+t[n],"").slice(0,e)}function ei(e){let t,n;let r="string"==typeof e?e:e.path,i=r.lastIndexOf("."),o=r.substring(i+1,r.length);if(!o.indexOf("["))throw Error("Invalid path: not an array");let a=r.lastIndexOf("["),s=r.substring(0,a);if(o.includes("_key")){let e=o.indexOf('"')+1,r=o.indexOf('"',e);t=o.substring(e,r),n=!0}else{let e=o.indexOf("[")+1,r=o.indexOf("]",e);t=o.substring(e,r),n=!1}if(!s||!t)throw Error("Invalid path");return{path:s,key:t,hasExplicitKey:n}}async function eo(e,t,n){if(!e.type)throw Error("Node type is missing");let{path:r,key:i}=ei(e),o=await t.getSnapshot(),a=B(o,r),s=B(o,e.path),l=a.findIndex(e=>e._key===i),u=-1,c="before";if("first"===n){if(0===l)return[];u=0,c="before"}else if("last"===n){if(l===a.length-1)return[];u=-1,c="after"}else if("next"===n){if(l===a.length-1)return[];u=l,c="after"}else if("previous"===n){if(0===l)return[];u=l-1,c="before"}return[N(r,R(l,l+1)),N(r,A(s,c,u))]}var ea=n(77861);let es=(0,ea.zGw)((0,ea.Z_8)(),(0,ea.EiV)(1)),el=(0,ea.jtO)(es),eu=(0,ea.Ryn)({baseUrl:es,dataset:el,id:es,path:es,projectId:el,tool:el,type:el,workspace:el,perspective:(0,ea.tvc)((0,ea.Z_8)(),"drafts")}),ec=/^([\w-]+):(0|[1-9][0-9]*)$/,ed=/^([\w-]+):([0-9]+),([0-9]+)$/,ep=/^([\w-]+):([\w-]+)$/,ef=(0,ea.zGw)((0,ea.Z_8)(),(0,ea.EiV)(1)),em=(0,ea.Ryn)({origin:ef,href:ef,data:(0,ea.jtO)((0,ea.IMB)((0,ea.Z_8)(),(0,ea._4T)()))});function ey(e){let t=(0,ea.AsG)(eu,e);if(t.success)return t.output;let n=(0,ea.AsG)(em,e);if(n.success)try{let e=new URL(n.output.href,typeof document>"u"?"https://example.com":location.origin);return e.searchParams.size>0?(0,ea.Qc3)(eu,Object.fromEntries(e.searchParams.entries())):n.output}catch(e){return console.error("Failed to parse sanity node",e),n.output}}var eh={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},eg={0:8203,1:8204,2:8205,3:65279},ev=[,,,,].fill(String.fromCodePoint(eg[0])).join(""),eb=Object.fromEntries(Object.entries(eg).map(e=>e.reverse())),ew=Object.fromEntries(Object.entries(eh).map(e=>e.reverse())),ex=`${Object.values(eh).map(e=>`\\u{${e.toString(16)}}`).join("")}`,eE=RegExp(`[${ex}]{4,}`,"gu");let e_=[];for(let e=0;e<256;++e)e_.push((e+256).toString(16).slice(1));let ej=new Uint8Array(16);var ek={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function eS(e,t,n){if(ek.randomUUID&&!e)return ek.randomUUID();let i=(e=e||{}).random??e.rng?.()??function(){if(!r){if(typeof crypto>"u"||!crypto.getRandomValues)throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");r=crypto.getRandomValues.bind(crypto)}return r(ej)}();if(i.length<16)throw Error("Random bytes length must be >= 16");return i[6]=15&i[6]|64,i[8]=63&i[8]|128,function(e,t=0){return(e_[e[t+0]]+e_[e[t+1]]+e_[e[t+2]]+e_[e[t+3]]+"-"+e_[e[t+4]]+e_[e[t+5]]+"-"+e_[e[t+6]]+e_[e[t+7]]+"-"+e_[e[t+8]]+e_[e[t+9]]+"-"+e_[e[t+10]]+e_[e[t+11]]+e_[e[t+12]]+e_[e[t+13]]+e_[e[t+14]]+e_[e[t+15]]).toLowerCase()}(i)}function eI(e){let t=e.getBoundingClientRect();return{x:t.x+scrollX,y:t.y+scrollY,w:t.width,h:t.height}}function eM(e,t,n){return"x"===n?{x:e.x+t,y:e.y,w:e.w-2*t,h:e.h}:{x:e.x,y:e.y+t,w:e.w,h:e.h-2*t}}function e$(e,t){return e.x===t.x&&e.y===t.y&&e.w===t.w&&e.h===t.h}function eC(e,t){let n=e.x-t.x,r=e.y-t.y;return Math.sqrt(n*n+r*r)}function eO(e,t,n){let r,i;let o={x:e.x1,y:e.y1};if(t.some(e=>(function(e,t){let n=e.x>=t.x&&e.x<=t.x+t.w,r=e.y>=t.y&&e.y<=t.y+t.h;return n&&r})(o,eM(e,Math.min(e.w,e.h)/10,"horizontal"===n?"x":"y"))))return null;for(let a of t){let t=function(e,t){let n=[{x1:t.x,y1:t.y,x2:t.x+t.w,y2:t.y},{x1:t.x+t.w,y1:t.y,x2:t.x+t.w,y2:t.y+t.h},{x1:t.x+t.w,y1:t.y+t.h,x2:t.x,y2:t.y+t.h},{x1:t.x,y1:t.y+t.h,x2:t.x,y2:t.y}],r=[];for(let t=0;t<n.length;t++){let i=function(e,t){let{x1:n,y1:r,x2:i,y2:o}=e,{x1:a,y1:s,x2:l,y2:u}=t;if(n===i&&r===o||a===l&&s===u)return!1;let c=(u-s)*(i-n)-(l-a)*(o-r);if(0===c)return!1;let d=((l-a)*(r-s)-(u-s)*(n-a))/c,p=((i-n)*(r-s)-(o-r)*(n-a))/c;return!(d<0)&&!(d>1)&&!(p<0)&&!(p>1)&&{x:n+d*(i-n),y:r+d*(o-r)}}(e,n[t]);if(i){let e=!1;for(let t=0;t<r.length;t++)r[t].x===i.x&&r[t].y===i.y&&(e=!0);e||r.push(i)}}return 0!==r.length&&r.sort((t,n)=>eC(t,{x:e.x1,y:e.y1})-eC(n,{x:e.x1,y:e.y1}))}(e,eM(a,Math.min(a.w,a.h)/10,"horizontal"===n?"x":"y"));if(t){let e=t[0];r?eC(o,e)<eC(o,r)&&(r=e,i=a):(r=e,i=a)}}return i||null}function eA(e,t,n){let{x:r,y:i,w:o,h:a}=e,{x:s,y:l}=n;return{x:s+(r-s)*t,y:l+(i-l)*t,w:o*t,h:a*t}}function eR(e){let t=Math.max(0,Math.min(...e.map(e=>e.y))),n=Math.min(document.body.scrollHeight,Math.max(...e.map(e=>e.y+e.h)));return{min:t,max:n,height:n-t}}function eT(e,t){return t.find(t=>e$(eI(t.elements.element),e))?.sanity}
1function eN(e,t,n){return Object.values(t).every(e=>null===e)?null:"horizontal"===n?{left:t.left?{rect:t.left,sanity:eT(t.left,e)}:null,right:t.right?{rect:t.right,sanity:eT(t.right,e)}:null}:{top:t.top?{rect:t.top,sanity:eT(t.top,e)}:null,bottom:t.bottom?{rect:t.bottom,sanity:eT(t.bottom,e)}:null}}function eP(e){let t=document.body.getBoundingClientRect();return{x:Math.max(t.x,Math.min(e.clientX,t.x+t.width)),y:e.clientY+window.scrollY}}function ez(e,t,n){let r=eI(t),i=[...t.querySelectorAll(":where(h1, h2, h3, h4, p, a, img, span, button):not(:has(*))")];e.x<=r.x&&(e.x=r.x),e.x>=r.x+r.w&&(e.x=r.x+r.w),e.y>=r.y+r.h&&(e.y=r.y+r.h),e.y<=r.y&&(e.y=r.y);let o=i.map(e=>{let t=eA(eI(e),n,{x:r.x,y:r.y});return{x:t.x-r.x,y:t.y-r.y,w:t.w,h:t.h,tagName:e.tagName}});return{offsetX:(r.x-e.x)*n,offsetY:(r.y-e.y)*n,w:r.w*n,h:r.h*n,maxWidth:r.w*n*.75,childRects:o}}async function eL(e,t,n,r,i){return new Promise(o=>{e.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(()=>{e.style.transformOrigin="50% 0px",e.style.transition="transform 150ms ease",e.style.transform=`translate3d(0px, ${-n+scrollY}px, 0px) scale(${t})`},25)})}function eD(e){let t=function(e){let t=Math.max(0,Math.min(...e.map(e=>e.x))),n=Math.min(document.body.offsetWidth,Math.max(...e.map(e=>e.x+e.w)));return{min:t,max:n,width:n-t}}(e),n=eR(e),r=t.min>8&&t.min+t.width<=window.innerWidth-8,i=n.min>8&&n.min+n.height<=document.body.scrollHeight-8,o=r&&i;return{x:o?t.min-8:t.min,y:o?n.min-8:n.min,w:o?t.width+16:t.width,h:o?n.height+16:n.height}}async function eU(e,t,n,r,i,o){return new Promise(a=>{if(1===new DOMMatrix(window.getComputedStyle(t).transform).a)return;let s=n-window.innerHeight,l=scrollY;(e-=window.innerHeight/2)<0&&(e=0),t.addEventListener("transitionend",()=>{t.style.transition="none",t.style.transform="none",scrollTo({top:e,behavior:"instant"}),setTimeout(()=>{r({type:"overlay/dragEndMinimapTransition"}),r({type:"overlay/dragToggleMinimap",display:!1})},2*i),a()},{once:!0}),r({type:"overlay/dragStartMinimapTransition"}),t.style.transform=`translateY(${Math.max(l-e,-s+l)}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 eV=!1,eF={y:0},eW={x:0,y:0},eZ=typeof document>"u"?0:document.documentElement.scrollHeight,eY=null,eq=e=>e instanceof HTMLElement||e instanceof SVGElement,eB=e=>e&&eq(e)?e.dataset?.sanityOverlayElement?e:eB(e.parentElement):null;function eG(e){return eE.lastIndex=0,eE.test(e)}function eH(e,t=!1){return eG(e)?function(e,t=!1){try{let n=function(e){let t=e.match(eE);if(t)return function(e,t=!1){let n=Array.from(e);if(n.length%2==0){if(n.length%4||!e.startsWith(ev))return function(e,t){var n;let r=[];for(let t=.5*e.length;t--;){let n=`${ew[e[2*t].codePointAt(0)]}${ew[e[2*t+1].codePointAt(0)]}`;r.unshift(String.fromCharCode(parseInt(n,16)))}let i=[],o=[r.join("")],a=10;for(;o.length;){let e=o.shift();try{if(i.push(JSON.parse(e)),t)break}catch(r){if(!a--)throw r;let t=+(null==(n=r.message.match(/\sposition\s(\d+)$/))?void 0:n[1]);if(!t)throw r;o.unshift(e.substring(0,t),e.substring(t))}}return i}(n,t)}else throw Error("Encoded data has invalid length");let r=[];for(let e=.25*n.length;e--;){let t=n.slice(4*e,4*e+4).map(e=>eb[e.codePointAt(0)]).join("");r.unshift(String.fromCharCode(parseInt(t,4)))}if(t){r.shift();let e=r.indexOf("\0");return -1===e&&(e=r.length),[JSON.parse(r.slice(0,e).join(""))]}return r.join("").split("\0").filter(Boolean).map(e=>JSON.parse(e))}(t[0],!0)[0]}(e);return n&&"sanity.io"===n.origin?(t&&(n.href=n.href?.replace(".alt","")),n):null}catch(t){return console.error("Failed to decode stega for string: ",e,"with the original error: ",t),null}}(e,t):null}let eK=e=>e.nodeType===Node.ELEMENT_NODE,eX=e=>"IMG"===e.tagName,eJ=e=>"TIME"===e.tagName,eQ=e=>"SVG"===e.tagName.toUpperCase();function e0(e){return"path"in e}function e1(e){if(!e.length||!e.map(e=>e0(e)).every((e,t,n)=>e===n[0]))return;if(!e0(e[0]))return e[0];let t=e.filter(e0),n=e[0],r=["projectId","dataset","id","baseUrl","workspace","tool"];for(let e=1;e<t.length;e++){let i=t[e];if(r.some(e=>i[e]!==n?.[e])){n=void 0;break}n={...n,path:function(e,t){let n=e.split("."),r=t.split("."),i=Math.min(n.length,r.length);return n=n.slice(0,i).reverse(),r=r.slice(0,i).reverse(),n.reduce((e,t,n
1)=>t===r[n]?[...e,t]:[],[]).reverse().join(".")}(n.path,i.path)}}return n}function e2(e){let t=e.lastIndexOf(".");return e.substring(t,e.length).includes("[")}function e3(e){if(!e2(e))return null;let t=e.split(".");return t[t.length-1]=t[t.length-1].replace(/\[.*?\]/g,"[]"),t.join(".")}function e4(e,t){return!!(e2(e.path)&&e2(t.path))&&e3(e.path)===e3(t.path)}function e5(e,t,n,r){if(!e.getAttribute("data-sanity")||e.getAttribute("data-sanity-drag-disable")||!t||!e0(t)||!e2(t.path))return null;let i=e.getAttribute("data-sanity-drag-group"),o=[...n].reduce((e,n)=>{let o=r.get(n),a=n.getAttribute("data-sanity-drag-disable"),s=n.getAttribute("data-sanity-drag-group"),l=null!==n.getAttribute("data-sanity");return o?.sanity&&!a&&e0(o.sanity)&&e4(t,o.sanity)&&(null===i||i===s)&&l&&e.push(o),e},[]);return o.length<=1?null:o}let e6=(0,h.createContext)(null);var e9=n(39840),e8=n(71033);function e7(e){if(!e)return(0,f.jsx)(e8.FMB,{});if("string"===e.type)return(0,f.jsx)(e8.Rhe,{});if("number"===e.type)return(0,f.jsx)(e8.yEv,{});let{value:t}=e;if("icon"in e&&e.icon)return(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:e.icon}});let{type:n}=t;if("string"===n)return(0,f.jsx)(e8.Rhe,{});if("boolean"===n)return(0,f.jsx)(e8.nSX,{});if("number"===n)return(0,f.jsx)(e8.yEv,{});if("array"===n||"union"===n)return(Array.isArray(t.of)?t.of:[t.of]).some(e=>"name"in e&&"block"===e.name)?(0,f.jsx)(e8.aI,{}):(0,f.jsx)(e8.DZP,{});if("object"===n){if("image"===e.name)return(0,f.jsx)(e8.XBm,{});if("block"===e.name)return(0,f.jsx)(e8.Rhe,{})}return(0,f.jsx)(e8.FMB,{})}let te=(0,w.iv)`
2  overflow-y: scroll;
3  overscroll-behavior: contain;
4  -ms-overflow-style: none;
5  scrollbar-width: none;
6
7  &:before {
8    content: '';
9    display: block;
10    height: calc(100% + 1px);
11    position: absolute;
12    top: 0;
13    width: 100%;
14    z-index: -1;
15  }
16`,tt=w.zo.div`
17  height: 100%;
18  inset: 0;
19  pointer-events: all;
20  position: fixed;
21  width: 100%;
22  display: flex;
23  justify-content: center;
24  align-items: center;
25
26  ${e=>e.$blockScroll&&te}
27`,tn=w.zo.div`
28  background: transparent;
29  height: 100%;
30  inset: 0;
31  position: absolute;
32  width: 100%;
33`,tr=e=>{let t;let n=(0,m.c)(2);return n[0]!==e?(t=(0,f.jsx)(b.h_,{children:(0,f.jsx)(ti,{...e})}),n[0]=e,n[1]=t):t=n[1],t},ti=e=>{let t,n;let r=(0,m.c)(7),{children:i,onDismiss:o,setBoundaryElement:a,blockScroll:s}=e,l=void 0===s||s;return r[0]!==o?(t=(0,f.jsx)(tn,{onMouseDownCapture:()=>{o?.()}}),r[0]=o,r[1]=t):t=r[1],r[2]!==l||r[3]!==i||r[4]!==a||r[5]!==t?(n=(0,f.jsxs)(tt,{"data-sanity-overlay-element":!0,ref:a,onClick:to,$blockScroll:l,children:[t,i]}),r[2]=l,r[3]=i,r[4]=a,r[5]=t,r[6]=n):n=r[6],n};function to(e){e.stopPropagation()}function ta(e){return{type:"log",name:e.name,version:e.version,description:e.description,maxSampleRate:e.maxSampleRate,schema:void 0}}let ts={"Visual Editing Drag Sequence Completed":ta({name:"Visual Editing Drag Sequence Completed",description:"An array is successfully reordered using drag and drop.",version:1}),"Visual Editing Drag Minimap Enabled":ta({name:"Visual Editing Drag Minimap Enabled",description:"The zoomed-out minimap view is enabled during a drag sequence.",version:1}),"Visual Editing Context Menu Item Removed":ta({name:"Visual Editing Context Menu Item Removed",description:"An item is removed using the Context Menu.",version:1}),"Visual Editing Context Menu Item Duplicated":ta({name:"Visual Editing Context Menu Item Duplicated",description:"An item is duplicated using the Context Menu.",version:1}),"Visual Editing Context Menu Item Moved":ta({name:"Visual Editing Context Menu Item Moved",description:"An item is moved using the Context Menu.",version:1}),"Visual Editing Context Menu Item Inserted":ta({name:"Visual Editing Context Menu Item Inserted",description:"An item is inserted using the Context Menu.",version:1}),"Visual Editing Insert Menu Item Inserted":ta({name:"Visual Editing Insert Menu Item Inserted",description:"An item is inserted using the Insert Menu.",version:1}),"Visual Editing Overlay Clicked":ta({name:"Visual Editing Overlay Clicked",description:"An Overlay is clicked.",version:1})},tl=(0,h.createContext)(void 0);function tu(){let e=(0,h.useContext)(tl);if(!e)throw Error("Telemetry context is missing");return e}let tc={"insert-menu.filter.all-items":"All","insert-menu.search.no-results":"No results","insert-menu.search.placeholder":"Filter types…","insert-menu.toggle-grid-view.tooltip":"Toggle grid view","insert-menu.toggle-list-view.tooltip":"Toggle list view"},td=e=>{let t,n,r,i;let o=(0,m.c)(11),{node:a,onSelect:s}=e;o[0]!==a.options?.insertMenu?(t=a.options?.insertMenu||{},o[0]=a.options?.insertMenu,o[1]=t):t=o[1];let l=t;o[2]!==l.views?(n=l.views?.map(tp),o[2]=l.views,o[3]=n):n=o[3];let u=n;return o[4]!==a.of?(r=a.of.map(tf),o[4]=a.of,o[5]=r):r=o[5],o[6]!==l||o[7]!==s||o[8]!==r||o[9]!==u?(i=(0,f.jsx)(e9.z,{...l,labels:tc,schemaTypes:r,onSelect:s,views:u}),o[6]=l,o[7]=s,o[8]=r,o[9]=u,o[10]=i):i=o[10],i};function tp(e){return"grid"===e.name?{...e,previewImageUrl:t=>e.previewImageUrls?.[t]}:e}function tf(e){return{...e,icon:e7(e)}}let tm=e=>{let t,n,r,i,o;let a=(0,m.c)(10);return a[0]!==e?({children:t,style:r,...n}=e,a[0]=e,a[1]=t,a[2]=n,a[3]=r):(t=a[1],n=a[2],r=a[3]),a[4]!==r?(i={...r,pointerEvents:"all"},a[4]=r,a[5]=i):i=a[5],a[6]!==t||a[7]!==n||a[8]!==i?(o=(0,f.jsx)("div",{style:i,"data-sanity-overlay-element":!0,...n,children:t}),a[6]=t,a[7]=n,a[8]=i,a[9]=o):o=a[9],o};var ty=n(74487),th=n(89056),tg=n(89981),tv=n(62381),tb=n(95978),tw=n(82863),tx=n(36381),tE=n(53374),t_="object"==typeof global&&global&&global.Object===Object&&global,tj="object"==typeof self&&self&&self.Object===Object&&self,tk=t_||tj||Function("return this")(),tS=tk.Symbol,tI=Object.prototype,tM=tI.hasOwnProperty,t$=tI.toString,tC=tS?tS.toStringTag:void 0,tO=function(e){var t=tM.call(e,tC),n=e[tC];try{e[tC]=void 0;var r=!0}catch(e){}var i=t$.call(e);return r&&(t?e[tC]=n:delete e[tC]),i},tA=Object.prototype.toString,tR=tS?tS.toStringTag:void 0,tT=function(e){return null==e?void 0===e?"[object Undef
33ined]":"[object Null]":tR&&tR in Object(e)?tO(e):tA.call(e)},tN=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},tP=function(e){if(!tN(e))return!1;var t=tT(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},tz=tk["__core-js_shared__"],tL=(o=/[^.]+$/.exec(tz&&tz.keys&&tz.keys.IE_PROTO||""))?"Symbol(src)_1."+o:"",tD=Function.prototype.toString,tU=function(e){if(null!=e){try{return tD.call(e)}catch(e){}try{return e+""}catch(e){}}return""},tV=/^\[object .+?Constructor\]$/,tF=Object.prototype,tW=Function.prototype.toString,tZ=tF.hasOwnProperty,tY=RegExp("^"+tW.call(tZ).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),tq=function(e,t){var n,r=null==e?void 0:e[t];return tN(n=r)&&(!tL||!(tL in n))&&(tP(n)?tY:tV).test(tU(n))?r:void 0},tB=function(){try{var e=tq(Object,"defineProperty");return e({},"",{}),e}catch(e){}}(),tG=function(e,t,n){"__proto__"==t&&tB?tB(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n},tH=function(e,t,n,r){for(var i=-1,o=null==e?0:e.length;++i<o;){var a=e[i];t(r,a,n(a),e)}return r},tK=function(e,t,n){for(var r=-1,i=Object(e),o=n(e),a=o.length;a--;){var s=o[++r];if(!1===t(i[s],s,i))break}return e},tX=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r},tJ=function(e){return null!=e&&"object"==typeof e},tQ=function(e){return tJ(e)&&"[object Arguments]"==tT(e)},t0=Object.prototype,t1=t0.hasOwnProperty,t2=t0.propertyIsEnumerable,t3=tQ(function(){return arguments}())?tQ:function(e){return tJ(e)&&t1.call(e,"callee")&&!t2.call(e,"callee")},t4=Array.isArray,t5="object"==typeof exports&&exports&&!exports.nodeType&&exports,t6=t5&&"object"==typeof module&&module&&!module.nodeType&&module,t9=t6&&t6.exports===t5?tk.Buffer:void 0,t8=(t9?t9.isBuffer:void 0)||function(){return!1},t7=/^(?:0|[1-9]\d*)$/,ne=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&t7.test(e))&&e>-1&&e%1==0&&e<t},nt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},nn={};nn["[object Float32Array]"]=nn["[object Float64Array]"]=nn["[object Int8Array]"]=nn["[object Int16Array]"]=nn["[object Int32Array]"]=nn["[object Uint8Array]"]=nn["[object Uint8ClampedArray]"]=nn["[object Uint16Array]"]=nn["[object Uint32Array]"]=!0,nn["[object Arguments]"]=nn["[object Array]"]=nn["[object ArrayBuffer]"]=nn["[object Boolean]"]=nn["[object DataView]"]=nn["[object Date]"]=nn["[object Error]"]=nn["[object Function]"]=nn["[object Map]"]=nn["[object Number]"]=nn["[object Object]"]=nn["[object RegExp]"]=nn["[object Set]"]=nn["[object String]"]=nn["[object WeakMap]"]=!1;var nr="object"==typeof exports&&exports&&!exports.nodeType&&exports,ni=nr&&"object"==typeof module&&module&&!module.nodeType&&module,no=ni&&ni.exports===nr&&t_.process,na=function(){try{var e=ni&&ni.require&&ni.require("util").types;if(e)return e;return no&&no.binding&&no.binding("util")}catch(e){}}(),ns=na&&na.isTypedArray,nl=ns?function(e){return ns(e)}:function(e){return tJ(e)&&nt(e.length)&&!!nn[tT(e)]},nu=Object.prototype.hasOwnProperty,nc=function(e,t){var n=t4(e),r=!n&&t3(e),i=!n&&!r&&t8(e),o=!n&&!r&&!i&&nl(e),a=n||r||i||o,s=a?tX(e.length,String):[],l=s.length;for(var u in e)(t||nu.call(e,u))&&!(a&&("length"==u||i&&("offset"==u||"parent"==u)||o&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||ne(u,l)))&&s.push(u);return s},nd=Object.prototype,np=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||nd)},nf=(a=Object.keys,s=Object,function(e){return a(s(e))}),nm=Object.prototype.hasOwnProperty,ny=function(e){if(!np(e))return nf(e);var t=[];for(var n in Object(e))nm.call(e,n)&&"constructor"!=n&&t.push(n);return t},nh=function(e){return null!=e&&nt(e.length)&&!tP(e)},ng=function(e){return nh(e)?nc(e):ny(e)}
33,nv=(l=function(e,t){return e&&tK(e,t,ng)},function(e,t){if(null==e)return e;if(!nh(e))return l(e,t);for(var n=e.length,r=-1,i=Object(e);(u?r--:++r<n)&&!1!==t(i[r],r,i););return e}),nb=function(e,t){return e===t||e!=e&&t!=t},nw=function(e,t){for(var n=e.length;n--;)if(nb(e[n][0],t))return n;return -1},nx=Array.prototype.splice;function nE(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nE.prototype.clear=function(){this.__data__=[],this.size=0},nE.prototype.delete=function(e){var t=this.__data__,n=nw(t,e);return!(n<0)&&(n==t.length-1?t.pop():nx.call(t,n,1),--this.size,!0)},nE.prototype.get=function(e){var t=this.__data__,n=nw(t,e);return n<0?void 0:t[n][1]},nE.prototype.has=function(e){return nw(this.__data__,e)>-1},nE.prototype.set=function(e,t){var n=this.__data__,r=nw(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};var n_=tq(tk,"Map"),nj=tq(Object,"create"),nk=Object.prototype.hasOwnProperty,nS=Object.prototype.hasOwnProperty;function nI(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}nI.prototype.clear=function(){this.__data__=nj?nj(null):{},this.size=0},nI.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},nI.prototype.get=function(e){var t=this.__data__;if(nj){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return nk.call(t,e)?t[e]:void 0},nI.prototype.has=function(e){var t=this.__data__;return nj?void 0!==t[e]:nS.call(t,e)},nI.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=nj&&void 0===t?"__lodash_hash_undefined__":t,this};var nM=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},n$=function(e,t){var n=e.__data__;return nM(t)?n["string"==typeof t?"string":"hash"]:n.map};function nC(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function nO(e){var t=this.__data__=new nE(e);this.size=t.size}function nA(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new nC;++t<n;)this.add(e[t])}nC.prototype.clear=function(){this.size=0,this.__data__={hash:new nI,map:new(n_||nE),string:new nI}},nC.prototype.delete=function(e){var t=n$(this,e).delete(e);return this.size-=t?1:0,t},nC.prototype.get=function(e){return n$(this,e).get(e)},nC.prototype.has=function(e){return n$(this,e).has(e)},nC.prototype.set=function(e,t){var n=n$(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},nO.prototype.clear=function(){this.__data__=new nE,this.size=0},nO.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},nO.prototype.get=function(e){return this.__data__.get(e)},nO.prototype.has=function(e){return this.__data__.has(e)},nO.prototype.set=function(e,t){var n=this.__data__;if(n instanceof nE){var r=n.__data__;if(!n_||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new nC(r)}return n.set(e,t),this.size=n.size,this},nA.prototype.add=nA.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},nA.prototype.has=function(e){return this.__data__.has(e)};var nR=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1},nT=function(e,t,n,r,i,o){var a=1&n,s=e.length,l=t.length;if(s!=l&&!(a&&l>s))return!1;var u=o.get(e),c=o.get(t);if(u&&c)return u==t&&c==e;var d=-1,p=!0,f=2&n?new nA:void 0;for(o.set(e,t),o.set(t,e);++d<s;){var m=e[d],y=t[d];if(r)var h=a?r(y,m,d,t,e,o):r(m,y,d,e,t,o);if(void 0!==h){if(h)continue;p=!1;break}if(f){if(!nR(t,function(e,t){if(!f.has(t)&&(m===e||i(m,e,n,r,o)))return f.push(t)})){p=!1;break}}else if(!(m===y||i(m,y,n,r,o))){p=!1;break}}return o.delete(e),o.delete(t),p},nN=tk.Uint8Array,nP=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n},nz=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},nL=tS?tS.prototype:void 0,nD=nL?nL.valueOf:void 0,nU=function(e,t,n,r,i,o,a){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":if(e.byteLength!=t.byteLength||!o(new nN(e),new nN(t)))break;return!0;case"[object Boolean]":case"[object Date]":case"[object Number]":return nb(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=nP;case"[object Set]":var l=1&r;if(s||(s=nz),e.size!=t.size&&!l)break;var u=a.get(e);if(u)return u==t;r|=2,a.set(e,t);var c=nT(s(e),s(t),r,i,o,a);return a.delete(e),c;case"[object Symbol]":if(nD)return nD.call(e)==nD.call(t)}return!1},nV=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},nF=function(e,t,n){var r=t(e);return t4(e)?r:nV(r,n(e))},nW=function(e,t){for(var n=-1,r=null==e?0:e.length,i=0,o=[];++n<r;){var a=e[n];t(a,n,e)&&(o[i++]=a)}return o},nZ=Object.prototype.propertyIsEnumerable,nY=Object.getOwnPropertySymbols,nq=nY?function(e){return null==e?[]:nW(nY(e=Object(e)),function(t){return nZ.call(e,t)})}:function(){return[]},nB=function(e){return nF(e,ng,nq)},nG=Object.prototype.hasOwnProperty,nH=function(e,t,n,r,i,o){var a=1&
33n,s=nB(e),l=s.length;if(l!=nB(t).length&&!a)return!1;for(var u=l;u--;){var c=s[u];if(!(a?c in t:nG.call(t,c)))return!1}var d=o.get(e),p=o.get(t);if(d&&p)return d==t&&p==e;var f=!0;o.set(e,t),o.set(t,e);for(var m=a;++u<l;){var y=e[c=s[u]],h=t[c];if(r)var g=a?r(h,y,c,t,e,o):r(y,h,c,e,t,o);if(!(void 0===g?y===h||i(y,h,n,r,o):g)){f=!1;break}m||(m="constructor"==c)}if(f&&!m){var v=e.constructor,b=t.constructor;v!=b&&"constructor"in e&&"constructor"in t&&!("function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b)&&(f=!1)}return o.delete(e),o.delete(t),f},nK=tq(tk,"DataView"),nX=tq(tk,"Promise"),nJ=tq(tk,"Set"),nQ=tq(tk,"WeakMap"),n0="[object Map]",n1="[object Promise]",n2="[object Set]",n3="[object WeakMap]",n4="[object DataView]",n5=tU(nK),n6=tU(n_),n9=tU(nX),n8=tU(nJ),n7=tU(nQ),re=tT;(nK&&re(new nK(new ArrayBuffer(1)))!=n4||n_&&re(new n_)!=n0||nX&&re(nX.resolve())!=n1||nJ&&re(new nJ)!=n2||nQ&&re(new nQ)!=n3)&&(re=function(e){var t=tT(e),n="[object Object]"==t?e.constructor:void 0,r=n?tU(n):"";if(r)switch(r){case n5:return n4;case n6:return n0;case n9:return n1;case n8:return n2;case n7:return n3}return t});var rt=re,rn="[object Arguments]",rr="[object Array]",ri="[object Object]",ro=Object.prototype.hasOwnProperty,ra=function(e,t,n,r,i,o){var a=t4(e),s=t4(t),l=a?rr:rt(e),u=s?rr:rt(t);l=l==rn?ri:l,u=u==rn?ri:u;var c=l==ri,d=u==ri,p=l==u;if(p&&t8(e)){if(!t8(t))return!1;a=!0,c=!1}if(p&&!c)return o||(o=new nO),a||nl(e)?nT(e,t,n,r,i,o):nU(e,t,l,n,r,i,o);if(!(1&n)){var f=c&&ro.call(e,"__wrapped__"),m=d&&ro.call(t,"__wrapped__");
33if(f||m){var y=f?e.value():e,h=m?t.value():t;return o||(o=new nO),i(y,h,n,r,o)}}return!!p&&(o||(o=new nO),nH(e,t,n,r,i,o))},rs=function e(t,n,r,i,o){return t===n||(null!=t&&null!=n&&(tJ(t)||tJ(n))?ra(t,n,r,i,e,o):t!=t&&n!=n)},rl=function(e,t,n,r){var i=n.length,o=i,a=!r;if(null==e)return!o;for(e=Object(e);i--;){var s=n[i];if(a&&s[2]?s[1]!==e[s[0]]:!(s[0]in e))return!1}for(;++i<o;){var l=(s=n[i])[0],u=e[l],c=s[1];if(a&&s[2]){if(void 0===u&&!(l in e))return!1}else{var d=new nO;if(r)var p=r(u,c,l,e,t,d);if(!(void 0===p?rs(c,u,3,r,d):p))return!1}}return!0},ru=function(e){return e==e&&!tN(e)},rc=function(e){for(var t=ng(e),n=t.length;n--;){var r=t[n],i=e[r];t[n]=[r,i,ru(i)]}return t},rd=function(e,t){return function(n){return null!=n&&n[e]===t&&(void 0!==t||e in Object(n))}},rp=function(e){var t=rc(e);return 1==t.length&&t[0][2]?rd(t[0][0],t[0][1]):function(n){return n===e||rl(n,e,t)}},rf=function(e){return"symbol"==typeof e||tJ(e)&&"[object Symbol]"==tT(e)},rm=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ry=/^\w*$/,rh=function(e,t){if(t4(e))return!1;var n=typeof e;return!!("number"==n||"symbol"==n||"boolean"==n||null==e||rf(e))||ry.test(e)||!rm.test(e)||null!=t&&e in Object(t)};function rg(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw TypeError("Expected a function");var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a)||o,a};return n.cache=new(rg.Cache||nC),n}rg.Cache=nC;var rv=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rb=/\\(\\)?/g,rw=(d=(c=rg(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rv,function(e,n,r,i){t.push(r?i.replace(rb,"$1"):n||e)}),t},function(e){return 500===d.size&&d.clear(),e})).cache,c),rx=function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i},rE=1/0,r_=tS?tS.prototype:void 0,rj=r_?r_.toString:void 0,rk=function e(t){if("string"==typeof t)return t;if(t4(t))return rx(t,e)+"";if(rf(t))return rj?rj.call(t):"";var n=t+"";return"0"==n&&1/t==-rE?"-0":n},rS=function(e,t){return t4(e)?e:rh(e,t)?[e]:rw(null==e?"":rk(e))},rI=1/0,rM=function(e){if("string"==typeof e||rf(e))return e;var t=e+"";return"0"==t&&1/e==-rI?"-0":t},r$=function(e,t){t=rS(t,e);for(var n=0,r=t.length;null!=e&&n<r;)e=e[rM(t[n++])];return n&&n==r?e:void 0},rC=function(e,t,n){var r=null==e?void 0:r$(e,t);return void 0===r?n:r},rO=function(e,t){return null!=e&&t in Object(e)},rA=function(e,t,n){t=rS(t,e);for(var r=-1,i=t.length,o=!1;++r<i;){var a=rM(t[r]);if(!(o=null!=e&&n(e,a)))break;e=e[a]}return o||++r!=i?o:!!(i=null==e?0:e.length)&&nt(i)&&ne(a,i)&&(t4(e)||t3(e))},rR=function(e){return e},rT=function(e){var t;return rh(e)?(t=rM(e),function(e){return null==e?void 0:e[t]}):function(t){return r$(t,e)}},rN=function(e){if("function"==typeof e)return e;if(null==e)return rR;if("object"==typeof e){var t,n;return t4(e)?(t=e[0],n=e[1],rh(t)&&ru(n)?rd(rM(t),n):function(e){var r=rC(e,t);return void 0===r&&r===n?null!=e&&rA(e,t,rO):rs(n,r,3)}):rp(e)}return rT(e)},rP=Object.prototype.hasOwnProperty,rz=(p=function(e,t,n){rP.call(e,n)?e[n].push(t):tG(e,n,[t])},function(e,t){return(t4(e)?tH:function(e,t,n,r){return nv(e,function(e,i,o){t(r,e,n(e),o)}),r})(e,p,rN(t,2),{})}),rL=n(80096),rD=n(71064),rU=n(44465),rV=n(89155),rF=n(68851),rW=n(96987),rZ=n(17647),rY=n(86811),rq=n(55519),rB=n(77067);function rG(e){if("patch"===e.type)return e.id;if("create"===e.type)return e.document._id;if("delete"===e.type)return e.id;if("createIfNotExists"===e.type||"createOrReplace"===e.type)return e.document._id;throw Error("Invalid mutation type")}let rH=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e));for(;e--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&n[e]];return t};function rK(e){return"string"==typeof e?._key}function rX(e){return"object"==typeof e&&"_key"in e&&"string"==typeof e._key}function rJ(e){return"number"==typeof e||rX(e)}function rQ(e,t){if(0===e.length)return t;let n=t;for(let t of e){if(rJ(t)){if(!Array.isArray(n))return;if(rX(t)){n=n.find(e=>e._key===t._key);continue}n=n[t];continue}n=n[t]}return n}let r0=/^[a-z_$]+/;function r1(e){return e.map((e,t)=>{var n;return n=0===t,Array.isArray(e)?`[${e[0]}:${e[1]||""}]`:"number"==typeof e?`[${e}
33]`:rX(e)?`[_key==${JSON.stringify(e._key)}]`:"string"==typeof e&&r0.test(e)?n?e:`.${e}`:`['${e}']`}).join("")}function r2(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function r3(e,t){if("number"==typeof t)return function(e,t){if(0===e&&(-1===t||0===t))return 0;let n=t<0?e+t:t;return n>=e||n<0?null:n}(e.length,t);if(rX(t)){let n=e.findIndex(e=>(null!==e&&"object"==typeof e&&"string"==typeof e._key&&e._key||null)===t._key);return -1===n?null:n}throw Error(`Expected path segment to be addressing a single array item either by numeric index or by '_key'. Instead saw ${JSON.stringify(t)}`)}function r4(e,t,n,r){let i=e.slice();return i.splice(t,n,...r||[]),i}function r5(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "insert()" on non-array value');let n=r3(t,e.referenceItem);if(null===n)throw Error(`Found no matching array element to insert ${e.position}`);return 0===t.length?e.items:r4(t,"before"===e.position?n:n+1,0,e.items)}let r6=Object.prototype.hasOwnProperty.call.bind(Object.prototype.hasOwnProperty);var r9=Object.freeze({__proto__:null,assign:function(e,t){if(!r2(t))throw TypeError('Cannot apply "assign()" on non-object value');return!function(e){for(let t in e)if(r6(e,t))return!1;return!0}(e.value)?{...t,...e.value}:t},dec:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "dec()" on non-numeric value');return t-e.amount},diffMatchPatch:function(e,t){if("string"!=typeof t)throw TypeError('Cannot apply "diffMatchPatch()" on non-string value');return(0,tE.QE)((0,tE.G8)(e.value),t)[0]},inc:function(e,t){if("number"!=typeof t)throw TypeError('Cannot apply "inc()" on non-numeric value');return t+e.amount},insert:r5,remove:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "remove()" on non-array value');let n=r3(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return r4(t,n,1,[])},replace:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "replace()" on non-array value');let n=r3(t,e.referenceItem);if(null===n)throw Error("Found no matching array element to replace");return r4(t,n,e.items.length,e.items)},set:function(e,t){return e.value},setIfMissing:function(e,t){return t??e.value},truncate:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "truncate()" on non-array value');return"number"==typeof e.endIndex?t.slice(0,e.startIndex).concat(t.slice(e.endIndex)):t.slice(0,e.startIndex)},unassign:function(e,t){if(!r2(t))throw TypeError('Cannot apply "unassign()" on non-object value');return 0===e.keys.length?t:function(e,t){let n={...e};for(let e of t)delete n[e];return n}(t,e.keys)},unset:function(e){},upsert:function(e,t){if(!Array.isArray(t))throw TypeError('Cannot apply "upsert()" on non-array value');
33if(0===e.items.length)return t;let n=[],r=[];if(e.items.forEach((e,i)=>{let o=t.findIndex(t=>t?._key===e._key);o>=0?n[o]=i:r.push(e)}),0===n.length&&0==r.length)return t;let i=[...t];for(let t of n)i[t]=e.items[n[t]];return r5({type:"insert",items:r,referenceItem:e.referenceItem,position:e.position},i)}});function r8(e,t){return e.reduce((e,t)=>r7(t,e),t)}function r7(e,t){return function e(t,n,r){if(!(t.length>0))return function(e,t){if(!(e.type in r9))throw Error(`Invalid operation type: "${e.type}"`);return r9[e.type](e,t)}(n,r);let[i,...o]=t;if(rJ(i)&&Array.isArray(r))return function(t,n,r,i){let o=r3(i,t);if(null===o||-1===o)return i;let a=i[o],s=e(n,r,a);return s===a?i:r4(i,o,1,[s])}(i,o,n,r);if("string"==typeof i&&r2(r))return function(t,n,r,i){let o=i[t];if(void 0===o&&n.length>0)return i;let a=e(n,r,o);return a===o?i:{...i,[t]:a}}(i,o,n,r);throw Error(`Cannot apply operation of type "${n.type}" to path ${r1(t)} on ${typeof r} value`)}(e.path,e.op,t)}function ie(e){return"_id"in e}function it(e,t){return t.reduce((e,t)=>{let n=ir(e,t);if("error"===n.status)throw Error(n.message);return"noop"===n.status?e:n.after},e)}function ir(e,t){if("create"===t.type)return function(e,t){var n;if(e)return{status:"error",message:"Document already exist"};let r=ie(n=t.document)?n:{...n,_id:rH()};return{status:"created",id:r._id,after:r}}(e,t);if("createIfNotExists"===t.type)return ie(t.document)?e?{status:"noop"}:{status:"created",id:t.document._id,after:t.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"};if("delete"===t.type)return e?t.id!==e._id?{status:"error",message:"Delete mutation targeted wrong document"}:{status:"deleted",id:t.id,before:e,after:void 0}:{status:"noop"};if("createOrReplace"===t.type)return ie(t.document)?e?{status:"updated",id:t.document._id,before:e,after:t.document}:{status:"created",id:t.document._id,after:t.document}:{status:"error",message:"Cannot createIfNotExists on document without _id"};if("patch"===t.type)return function(e,t){if(!e)return{status:"error",message:"Cannot apply patch on nonexistent document"};let n=function(e,t){if(e.options?.ifRevision&&t._rev!==e.options.ifRevision)throw Error("Revision mismatch");if(e.id!==t._id)throw Error(`Document id mismatch. Refusing to apply mutation for document with id="${e.id}" on the given document with id="${t._id}"`);return r8(e.patches,t)}(t,e);return e===n?{status:"noop"}:{status:"updated",id:t.id,before:e,after:n}}(e,t);throw Error(`Invalid mutation type: ${t.type}`)}function ii(e,t,n){let r=[];for(let n of e.slice().reverse()){if(t(n))return r;r.push(n)}return r.reverse()}function io(e,t){return r1(e)===r1(t)}function ia(e,t){let n=e;return t.reduce((e,t)=>{let r=n;if(n=r7(t,n),"set"===t.op.type&&"string"==typeof t.op.value){let n=rQ(t.path,r);if("string"==typeof n){let r={...t,op:{type:"diffMatchPatch",value:(0,tE.M5)((0,tE.oY)(n,t.op.value))}};return e.flatMap(e=>io(e.path,t.path)&&"diffMatchPatch"===e.op.type?[]:e).concat(r)}}return e.push(t),e},[])}function is(e,t,n,r){let i=t,o=r.map(t=>{let n=t.mutations.flatMap(t=>{if(rG(t)!==e)return[];let n=i;return i=it(i,[t]),n&&"patch"===t.type?{type:"dmpified",mutation:{...t,dmpPatches:ia(n,t.patches),original:t.patches}}:t});return{...t,mutations:n}}),a=n;return o.map(t=>{let n=[];return t.mutations.forEach(t=>{if("dmpified"===t.type)try{a=r8(t.mutation.dmpPatches,a),n.push(t)}catch{console.warn("Failed to apply dmp patch, falling back to original");try{a=r8(t.mutation.original,a),n.push(t)}catch(t){throw Error(`Failed to apply patch for document "${e}": ${t.message}`)}}else a=it(a,[t])})}),[r.map(t=>({...t,mutations:t.mutations.map(t=>"patch"!==t.type||rG(t)!==e?t:{...t,patches:t.patches.map(e=>"set"!==e.op.type?e:{...e,op:{...e.op,value:rQ(e.path,a)}})})})),a]}function il(e){return function(e){if("create"===e.type||"createIfNotExists"===e.type||"createOrReplace"===e.type)return{[e.type]:e.document};if("delete"===e.type)return{delete:{id:e.id}};let t=e.options?.ifRevision;return e.patches.map(n=>({patch:{id:e.id,...t&&{ifRevisionID:t},...function(e){let{path:t,op:n}=e;if("unset"===n.type)return{unset:[r1(t)]};if("insert"===n.type)return{insert:{[n.position]:r1([...t,n.referenceItem]),items:n.items}};if("diffMatchPatch"===n.type)return{diffMatchPatch:{[r1(t)]:n.value}};if("inc"===n.type)return{inc:{[r1(t)]:n.amount}};if("dec"===n.type)return{dec:{[r1(t)]:n.amount}};if("set"===n.type||"setIfMissing"===n.type)return{[n.type]:{[r1(t)]:n.value}};if("truncate"===n.type){let e=[n.startIndex,"number"==typeof n.endIndex?n.endIndex:""].join(":");return{unset:[`${r1(t)}[${e}]`]}}if("upsert"===n.type)return{unset:n.items.map(e=>
33r1([...t,{_key:e._key}])),insert:{[n.position]:r1([...t,n.referenceItem]),items:n.items}};if("assign"===n.type)return{set:Object.fromEntries(Object.keys(n.value).map(e=>[r1(t.concat(e)),n.value[e]]))};if("unassign"===n.type)return{unset:n.keys.map(e=>r1(t.concat(e)))};if("replace"===n.type)return{insert:{replace:r1(t.concat(n.referenceItem)),items:n.items}};if("remove"===n.type)return{unset:[r1(t.concat(n.referenceItem))]};throw Error(`Unknown operation type ${n.type}`)}(n)}}))}(e)}function iu(e){let t=e.listen('*[!(_id in path("_.**"))]',{},{events:["welcome","mutation","reconnect"],includeResult:!1,includePreviousRevision:!1,visibility:"transaction",effectFormat:"mendoza",includeMutations:!1}).pipe((0,rD.B)({resetOnRefCountZero:!0})),n=t.pipe((0,rU.h)(e=>"reconnect"===e.type)),r=t.pipe((0,rU.h)(e=>"welcome"===e.type)),i=t.pipe((0,rU.h)(e=>"mutation"===e.type)),o=(0,tx.T)(r,n).pipe((0,rV.d)({bufferSize:1,refCount:!0})).pipe((0,rU.h)(e=>"welcome"===e.type));return(0,tx.T)(o,i,n)}let ic=(0,rY.cY)({types:{},actions:{"assign error to context":(0,rq.a)({error:({event:e})=>e}),"clear error from context":(0,rq.a)({error:void 0}),"connect to server-sent events":(0,tv.r)({type:"connect"}),"listen to server-sent events":(0,tv.b)("server-sent events",{id:"listener",input:({context:e})=>({listener:e.sharedListener||iu(e.client),id:e.id})}),"stop listening to server-sent events":(0,tv.s)("listener"),"buffer remote mutation events":(0,rq.a)({mutationEvents:({event:e,context:t})=>((0,rY.ZD)(e,"mutation"),[...t.mutationEvents,e])}),"restore stashed changes":(0,rq.a)({stagedChanges:({event:e,context:t})=>((0,rY.ZD)(e,"xstate.done.actor.submitTransactions"),t.stashedChanges),stashedChanges:[]}),"rebase fetched remote snapshot":(0,rB.e)(({enqueue:e})=>{e.assign(({event:e,context:t})=>{(0,rY.ZD)(e,"xstate.done.actor.getDocument");let n=t.remote,r=e.output,i=!1;for(let e of t.mutationEvents)e.effects?.apply&&(e.previousRev||"appear"===e.transition)&&(i||e.previousRev!==r?._rev||(i=!0),i&&(r=id(r,e.effects.apply,e.resultRev)));t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.id,r);let[o,a]=is(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:a,stagedChanges:o,mutationEvents:[]}}),e.sendParent(({context:e})=>({type:"rebased.remote",id:e.id,document:e.remote}))}),"apply mendoza patch":(0,rq.a)(({event:e,context:t})=>{(0,rY.ZD)(e,"mutation");let n=t.remote;if(e.transactionId===n?._rev)return{};let r=id(n,e.effects.apply,e.resultRev);t.cache&&(!t.cache.has(t.id)||t.cache.get(t.id)._rev!==r?._rev)&&t.cache.set(t.id,r);let[i,o]=is(t.id,null===n?void 0:n,null===r?void 0:r,t.stagedChanges);return{remote:r,local:o,stagedChanges:i}}),"increment fetch attempts":(0,rq.a)({fetchRemoteSnapshotAttempts:({context:e})=>e.fetchRemoteSnapshotAttempts+1}),"reset fetch attempts":(0,rq.a)({fetchRemoteSnapshotAttempts:0}),"increment submit attempts":(0,rq.a)({submitTransactionsAttempts:({context:e})=>e.submitTransactionsAttempts+1}),"reset submit attempts":(0,rq.a)({submitTransactionsAttempts:0}),"stage mutation":(0,rq.a)({stagedChanges:({event:e,context:t})=>((0,rY.ZD)(e,"mutate"),[...t.stagedChanges,{transaction:!1,mutations:e.mutations}])}),"stash mutation":(0,rq.a)({stashedChanges:({event:e,context:t})=>((0,rY.ZD)(e,"mutate"),[...t.stashedChanges,{transaction:!1,mutations:e.mutations}])}),"rebase local snapshot":(0,rB.e)(({enqueue:e})=>{e.assign({local:({event:e,context:t})=>{(0,rY.ZD)(e,"mutate");let n=new Map;return t.local&&n.set(t.id,t.local),function(e,t){e.forEach(e=>{("created"===e.status||"updated"===e.status)&&t.set(e.id,e.after),"deleted"===e.status&&t.delete(e.id)})}(function(e,t){let n=Object.create(null);for(let r of e){let e=rG(r);if(!e)throw Error("Unable to get document id from mutation");let i=n[e]?.after||t.get(e),o=ir(i,r);if("error"===o.status)throw Error(o.message);"noop"!==o.status&&("updated"===o.status||"created"===o.status||"deleted"===o.status)&&(e in n||(n[e]={before:i,after:void 0,muts:[]}),n[e].after=o.after)}return Object.entries(n).map(([e,{before:t,after:n,muts:r}])=>({id:e,status:n?t?"updated":"created":"deleted",mutations:r,before:t,after:n}))}(e.mutations,n),n),n.get(t.id)}}),e.sendParent(({context:e})=>({type:"rebased.local",id:e.id,document:e.local}))}),"send pristine event to parent":(0,rB.b)(({context:e})=>({type:"pristine",id:e.id})),"send sync event to parent":(0,rB.b)(({context:e})=>({type:"sync",id:e.id,document:e.remote})),"send mutation event to parent":(0,rB.b)(({context:e,event:t})=>((0,rY.ZD)(t,"mutation"),{type:"mutation",id:e.id,previousRev:t.previousRev,resultRev:t.resultRev,effects:t.effects}))},actors:{"server-sent events":(0,P.Y$)(({input:e})=>{let{listener:t,id:n}=e;return(0,rF.P)(()=>t).pipe((0,rU.h)(e=>"welcome"===e.type||"reconnect"===e.type||"mutation"===e.type&&e.documentId===n),(0,rW.Q)(rZ.E))}),"fetch remote snapshot":(0,P.p4)(async({input:e,signal:t})=>{let{client:n,id:r}=e;return await n.getDocument(r,{signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}),"submit mutations as transactions":(0,P.p4)(async({input:e,signal:t})=>{let{client:n,transactions:r}=e;for(let e of r){if(t.aborted)return;await n.dataRequest("mutate",{transactionId:e.id,mutations:e.mutations.flatMap(il)},{visibility:"async",returnDocuments:!1,signal:t}).catch(e=>{if(!(e instanceof Error&&"AbortError"===e.name))throw e})}})},delays:{fetchRemoteSnapshotTimeout:({context:e})=>1e3*Math.pow(2,e.fetchRemoteSnapshotAttempts),submitTransactionsTimeout:({context:e})=>1e3*Math.pow(2,e.submitTransactionsAttempts)}}).createMachine({id:"document-mutator",context:({input:e})=>({client:e.client.withConfig({allowReconfigure:!1}),sharedListener:e.sharedListener,id:e.id,remote:void 0,local:void 0,mutationEvents:[],stagedChanges:[],stashedChanges:[],error:void 0,fetchRemoteSnapshotAttempts:0,submitTransactionsAttempts:0,cache:e.cache}),entry:["connect to server-sent events"],on:{mutate:{actions:["rebase local snapshot","stage mutation"]}},initial:"disconnected",states:{disconnected:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}}},connecting:{on:{welcome:"connected",reconnect:"reconnecting",error:"connectFailure"},tags:["busy"]},connectFailure:{on:{connect:{target:"connecting",actions:["listen to server-sent events"]}},entry:["stop listening to server-sent events","assign error to context"],exit:["clear error from context"],tags:["error"]},reconnecting:{on:{welcome:{target:"connected"},error:{target:"connectFailure"}},tags:["busy","error"]},connected:{on:{mutation:{actions:["buffer remote mutation events"]},reconnect:"reconnecting"},entry:["clear error from context"],initial:"loading",states:{loading:{invoke:{src:"fetch remote snapshot",id:"getDocument",input:({context:e})=>({client:e.client,id:e.id}),onError:{target:"loadFailure"},onDone:{target:"loaded",actions:["rebase fetched remote snapshot","reset fetch attempts"]}},tags:["busy"]},loaded:{entry:["send sync event to parent"],on:{mutation:{actions:["apply mendoza patch","send mutation event to parent"]}},initial:"pristine",states:{pristine:{on:{mutate:{actions:["rebase local snapshot","stage mutation"],target:"dirty"}},tags:["ready"]},dirty:{on:{submit:"submitting"},tags:["ready"]},submitting:{on:{mutate:{actions:["rebase local snapshot","stash mutation"]}},invoke:{src:"submit mutations as transactions",id:"submitTransactions",input:({context:e})=>{let t=new Map;return t.set(e.id,e.remote),{client:e.client,transactions:(function(e,t){let n=[],r=[];
33return e.forEach(e=>{t(e)?r.push(e):(r.length>0&&n.push(r),r=[],n.push([e]))}),r.length>0&&n.push(r),n})(e.stagedChanges,e=>!e.transaction).flatMap(e=>({...e[0],mutations:e.flatMap(e=>e.mutations)})).map(e=>({...e,mutations:Object.values(rz(e.mutations,rG)).flatMap(e=>{var t;return(0===(t=0===e.length?e:e.reduce((e,t)=>"delete"===t.type?[t]:(e.push(t),e),[])).length?t:t.reduce((e,t)=>("createIfNotExists"!==t.type?e.push(t):ii(e,e=>"delete"===e.type).find(e=>"createIfNotExists"===e.type)||e.push(t),e),[])).flat().reduce((e,t)=>{let n=e[e.length-1];return n&&"patch"!==n.type||"patch"!==t.type?e.concat(t):e.slice(0,-1).concat({...t,patches:(n?.patches||[]).concat(t.patches)})},[])})})).map(e=>({...e,mutations:e.mutations.map(e=>"patch"!==e.type?e:{...e,patches:e.patches.reduce((e,t)=>{if("unset"!==t.op.type)return e.push(t),e;let n=e.filter(e=>{var n,r;return n=t.path,r=e.path,!(n.length<=r.length&&n.every((e,t)=>{var n;return n=function(e,t){if(t<0||t>=e.length)throw Error("Index out of bounds");return e[t]}(r,t),rK(e)&&rK(n)?e._key===n._key:"number"==typeof e?Number(e)===Number(n):e===n}))});return n.push(t),n},[]).reduceRight((e,t)=>(e.find(e=>{var n,r;return n=e.op,("set"===(r=t.op).type||"unset"===r.type)&&("set"===n.type||"unset"===n.type)&&io(e.path,t.path)})||e.unshift(t),e),[]).reduce((e,t)=>("setIfMissing"!==t.op.type?e.push(t):ii(e,e=>"unset"===e.op.type).find(e=>"setIfMissing"===e.op.type&&io(e.path,t.path))||e.push(t),e),[])})})).map(e=>({...e,mutations:e.mutations.map((e,n)=>{var r;return"patch"===e.type&&(r=t.get(e.id))?{...e,patches:ia(r,e.patches)}:e})})).map(e=>e.transaction&&void 0!==e.id?{id:e.id,mutations:e.mutations}:{mutations:e.mutations})}},onError:{target:"submitFailure"},onDone:{target:"pristine",actions:["restore stashed changes","reset submit attempts","send pristine event to parent"]}},tags:["busy","ready"]},submitFailure:{exit:["clear error from context"],after:{submitTransactionsTimeout:{actions:["increment submit attempts"],target:"submitting"}},on:{retry:"submitting"},tags:["error","ready"]}}},loadFailure:{exit:["clear error from context"],after:{fetchRemoteSnapshotTimeout:{actions:["increment fetch attempts"],target:"loading"}},on:{retry:"loading"},tags:["error"]}}}}});function id(e,t,n){let r=(0,rL.a)(function(e){if(!e)return null;let{_rev:t,...n}=e;return n}(e),t);return r?Object.assign(r,{_rev:n}):null}let ip=e=>{let t=(0,P.p4)(async({input:t,signal:n})=>{let{id:r}=t,{snapshot:i}=await e.fetch("visual-editing/fetch-snapshot",{documentId:r},{signal:n});return i}),n=(0,P.p4)(async({input:t})=>{let{transactions:n}=t;for(let t of n){let n=O.encodeTransaction(t);return e.post("visual-editing/mutate",n)}});return ic.provide({actions:{"send sync event to parent":(0,rB.e)(({enqueue:e})=>{e.sendParent(({context:e})=>({type:"sync",id:e.id,document:e.remote})),e.emit(({context:e})=>({type:"ready",snapshot:e.local}))})},actors:{"fetch remote snapshot":t,"submit mutations as transactions":n}})},im=(0,rY.cY)({types:{},actions:{"emit sync event":(0,rB.a)(({event:e})=>((0,rY.ZD)(e,"sync"),e)),"emit mutation event":(0,rB.a)(({event:e})=>((0,rY.ZD)(e,"mutation"),e)),"emit rebased event":(0,rB.a)(({event:e})=>((0,rY.ZD)(e,["rebased.local","rebased.remote"]),e)),"emit pristine event":(0,rB.a)(({event:e})=>((0,rY.ZD)(e,["pristine"]),e)),"add document actor":(0,rq.a)({documents:({context:e,event:t,spawn:n})=>{(0,rY.ZD)(t,"observe");let r=t.documentId;return e.documents[r]?e.documents:{...e.documents,[r]:n("documentMutatorMachine",{input
33:{id:r,client:e.client,sharedListener:e.sharedListener||iu(e.client)},id:r})}}}),"stop remote snapshot":(0,tv.s)(({context:e,event:t})=>((0,rY.ZD)(t,"unobserve"),e.documents[t.documentId])),"remove remote snapshot from context":(0,rq.a)({documents:({context:e,event:t})=>{if((0,rY.ZD)(t,"unobserve"),!e.documents[t.documentId])return e.documents;let{[t.documentId]:n,...r}=e.documents;return r}})},actors:{documentMutatorMachine:ic}}).createMachine({id:"dataset-mutator",context:({input:e})=>({documents:{},client:e.client,sharedListener:e.sharedListener}),on:{sync:{actions:["emit sync event"]},mutation:{actions:["emit mutation event"]},"rebased.*":{actions:["emit rebased event"]},pristine:{actions:["emit pristine event"]},observe:{actions:["add document actor"]},unobserve:{actions:["stop remote snapshot","remove remote snapshot from context"]}},initial:"pristine",states:{pristine:{}}}),iy=e=>im.provide({actors:{documentMutatorMachine:ip(e)}}),ih=e=>{let t,n,r,i;let o=(0,m.c)(8),{comlink:a,history:s}=e;return o[0]!==a||o[1]!==s?(t=()=>a?.on("presentation/navigate",e=>{s?.update(e)}),n=[a,s],o[0]=a,o[1]=s,o[2]=t,o[3]=n):(t=o[2],n=o[3]),(0,h.useEffect)(t,n),o[4]!==a||o[5]!==s?(r=()=>{if(s)return s.subscribe(e=>{e.title=e.title||document.title,a?.post("visual-editing/navigate",e)})},i=[a,s],o[4]=a,o[5]=s,o[6]=r,o[7]=i):(r=o[6],i=o[7]),(0,h.useEffect)(r,i),null},ig=e=>{let t,n;let r=(0,m.c)(3),{comlink:i}=e;return r[0]!==i?(t=()=>{let e=()=>{i.post("visual-editing/meta",{title:document.title})},t=new MutationObserver(t=>{let[n]=t;"TITLE"===n.target.nodeName&&e()});return t.observe(document.head,{subtree:!0,characterData:!0,childList:!0}),e(),()=>t.disconnect()},n=[i],r[0]=i,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,h.useEffect)(t,n),null};function iv(e){let t=new CustomEvent("sanity/dragEnd",{detail:e,cancelable:!0});window.dispatchEvent(t)}let ib=(0,h.createContext)(null);function iw(){let e=(0,h.useContext)(ib);if(!e)throw Error("Schema context is missing");return e}function ix(e,t,n,r){if(!e.type)throw Error("Node type is missing");return()=>t.patch(()=>(function(e,t,n){let{path:r,key:i}=ei(e);return[N(r,A([{_type:t,_key:er()}],n,{_key:i}))]})(e,n,r))}function iE(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Duplicate",icon:e8.TIy,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t,n="after"){let{path:r,key:i}=ei(e);return[N(r,A({...B(t,e.path),_key:er()},n,{_key:i}))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Duplicated"}]:[]}function i_(e){let{node:t,doc:n}=e;return n?[{type:"action",label:"Remove",icon:e8.HFL,action:function(e,t){if(!e.type)throw Error("Node type is missing");return()=>t.patch(async({getSnapshot:t})=>(function(e,t){let{path:n,key:r}=ei(e),i=B(t,n).findIndex(e=>e._key===r);return[N(n,R(i,i+1))]})(e,await t()))}(t,n),telemetryEvent:"Visual Editing Context Menu Item Removed"}]:[]}async function ij(e,t=!0){let{node:n,doc:r}=e;if(!r)return[];let i=[],o=[],[a,s,l,u]=await Promise.all([eo(n,r,"previous"),eo(n,r,"next"),eo(n,r,"first"),eo(n,r,"last")]);return l.length&&o.push({type:"action",label:"To top",icon:e8.EI4,action:()=>r.patch(l),telemetryEvent:"Visual Editing Context Menu Item Moved"}),a.length&&o.push({type:"action",label:"Up",icon:e8.Hf3,action:()=>r.patch(a),telemetryEvent:"Visual Editing Context Menu Item Moved"}),s.length&&o.push({type:"action",label:"Down",icon:e8.veu,action:()=>r.patch(s),telemetryEvent:"Visual Editing Context Menu Item Moved"}),u.length&&o.push({type:"action",label:"To bottom",icon:e8.xEY,action:()=>r.patch(u),telemetryEvent:"Visual Editing Context Menu Item Moved"}),o.length&&(i.push({type:"group",label:"Move",icon:e8.fzI,items:o}),t&&i.push({type:"divider"})),i}async function ik(e){let{node:t,field:n,doc:r}=e,i=[];return i.push(...iE(e)),i.push(...i_(e)),i.push(...await ij(e)),i.push({type:"action",label:"Insert before",icon:e8.ySV,action:ix(t,r,n.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i.push({type:"action",label:"Insert after",icon:e8.oty,action:ix(t,r,n.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}),i}let iS=e=>{let t,n,r,i,o;let a=(0,m.c)(12),{label:s,parent:l,width:u,onSelect:c,boundaryElement:d}=e;return a[0]===Symbol.for("react.memo_cache_sentinel")?(t=["left-start","right","left","right-end","left-end","bottom","top"],a[0]=t):t=a[0],a[1]===Symbol.for("react.memo_cache_sentinel")?(n=[4,4,4,4],a[1]=n):n=a[1],a[2]!==d||a[3]!==u?(r={arrow:!1,constrainSize:!0,floatingBoundary:d,padding:0,placement:"right-start",fallbackPlacements:t,preventOverflow:!0,width:u,__unstable_margins:n},a[2]=d,a[3]=u,a[4]=r):r=a[4],a[5]!==c||a[6]!==l?(i=(0,f.jsx)(td,{node:l,onSelect:c}
33),a[5]=c,a[6]=l,a[7]=i):i=a[7],a[8]!==s||a[9]!==r||a[10]!==i?(o=(0,f.jsx)(b.kS,{fontSize:1,icon:e8.oty,padding:2,popover:r,space:2,text:s,children:i}),a[8]=s,a[9]=r,a[10]=i,a[11]=o):o=a[11],o};async function iI(e){let{doc:t,node:n,parent:r}=e,i=[];if(i.push(...iE(e)),i.push(...i_(e)),i.push(...await ij(e)),r.options?.insertMenu){let e=(r.options.insertMenu||{}).views?.some(e=>"grid"===e.name)?0:void 0;i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,f.jsx)(iS,{label:"Insert before",onSelect:e=>{ix(n,t,e.name,"before")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})}),i.push({type:"custom",component:({boundaryElement:i,sendTelemetry:o})=>(0,f.jsx)(iS,{label:"Insert after",onSelect:e=>{ix(n,t,e.name,"after")(),o("Visual Editing Context Menu Item Inserted",null)},parent:r,width:e,boundaryElement:i})})}else i.push({type:"group",label:"Insert before",icon:e8.ySV,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",icon:e7(e),label:"block"===e.name?"Paragraph":e.title||e.name,action:ix(n,t,e.name,"before"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))}),i.push({type:"group",label:"Insert after",icon:e8.oty,items:r.of.filter(e=>"unionOption"===e.type).map(e=>({type:"action",label:"block"===e.name?"Paragraph":e.title||e.name,icon:e7(e),action:ix(n,t,e.name,"after"),telemetryEvent:"Visual Editing Context Menu Item Inserted"}))});return i}let iM=[-4,4,-4,4];function i$(e){let t;let n=(0,m.c)(27),{node:r,onDismiss:i,boundaryElement:o}=e,a=tu();n[0]!==r||n[1]!==i||n[2]!==a?(t=()=>{"action"===r.type&&(r.action?.(),i?.(),r.telemetryEvent&&a(r.telemetryEvent,null))},n[0]=r,n[1]=i,n[2]=a,n[3]=t):t=n[3];let s=t;if("divider"===r.type){let e;return n[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,f.jsx)(b.R,{}),n[4]=e):e=n[4],e}if("action"===r.type){let e;let t=!r.action;return n[5]!==r.hotkeys||n[6]!==r.icon||n[7]!==r.label||n[8]!==s||n[9]!==t?(e=(0,f.jsx)(b.sN,{fontSize:1,hotkeys:r.hotkeys,icon:r.icon,padding:2,space:2,text:r.label,disabled:t,onClick:s}),n[5]=r.hotkeys,n[6]=r.icon,n[7]=r.label,n[8]=s,n[9]=t,n[10]=e):e=n[10],e}if("group"===r.type){let e,t,a;let s=r.icon;n[11]===Symbol.for("react.memo_cache_sentinel")?(e={arrow:!1,constrainSize:!0,placement:"right-start",fallbackPlacements:["left-start","right","left","right-end","left-end","bottom","top"],preventOverflow:!0,__unstable_margins:iM},n[11]=e):e=n[11];let l=r.label;if(n[12]!==o||n[13]!==r.items||n[14]!==i){let e;n[16]!==o||n[17]!==i?(e=(e,t)=>(0,f.jsx)(i$,{node:e,onDismiss:i,boundaryElement:o},t),n[16]=o,n[17]=i,n[18]=e):e=n[18],t=r.items.map(e),n[12]=o,n[13]=r.items,n[14]=i,n[15]=t}else t=n[15];return n[19]!==r.icon||n[20]!==r.label||n[21]!==t?(a=(0,f.jsx)(b.kS,{fontSize:1,icon:s,padding:2,popover:e,space:2,text:l,children:t}),n[19]=r.icon,n[20]=r.label,n[21]=t,n[22]=a):a=n[22],a}if("custom"===r.type){let e;let{component:t}=r;return n[23]!==t||n[24]!==o||n[25]!==a?(e=(0,f.jsx)(t,{boundaryElement:o,sendTelemetry:a}),n[23]=t,n[24]=o,n[25]=a,n[26]=e):e=n[26],e}return null}let iC=e=>{let t,n,r,i,o,a,s,l,u,c,d,p,y,g,v,w,x,E;let _=(0,m.c)(43),{node:j,onDismiss:k,position:S}=e,{x:I,y:M}=S,[$,C]=(0,h.useState)(null),{getField:O}=iw(),{getDocument:A}=et();_[0]!==O||_[1]!==j?(t=O(j),_[0]=O,_[1]=j,_[2]=t):t=_[2];let{field:R,parent:T}=t;n=R?.title||R?.name||"Unknown type";let[N,P]=(0,h.useState)(void 0);_[3]!==R||_[4]!==A||_[5]!==j||_[6]!==T?(r=()=>{(async()=>{let e=A(j.id);e&&P(await function(e){let{node:t,field:n,parent:r,doc:i}=e;return n?.type==="arrayItem"?ik({node:t,field:n,doc:i}):r?.type==="union"?iI({node:t,parent:r,doc:i}):Promise.resolve([])}({node:j,field:R,parent:T,doc:e}))})()},i=[R,j,T,A],_[3]=R,_[4]=A,_[5]=j,_[6]=T,_[7]=r,_[8]=i):(r=_[7],i=_[8]),(0,h.useEffect)(r,i),_[9]!==I||_[10]!==M?(a={getBoundingClientRect:()=>({bottom:M,left:I,right:I,top:M,width:0,height:0})},_[9]=I,_[10]=M,_[11]=a):a=_[11],o=a,_[12]!==R?(l=e7(R),_[12]=R,_[13]=l):l=_[13],s=l,_[14]===Symbol.for("react.memo_cache_sentinel")?(u={minWidth:120,maxWidth:160},_[14]=u):u=_[14],_[15]!==s||_[16]!==N?(c=(0,f.jsx)(b.xu,{flex:"none",children:N?(0,f.jsx)(b.xv,{size:1,children:s}):(0,f.jsx)(b.$j,{size:1})}),_[15]=s,_[16]=N,_[17]=c):c=_[17];let z=N?n:"Loading...";_[18]!==z?(d=(0,f.jsx)(b.Kq,{flex:1,space:2,children:(0,f.jsx)(b.xv,{size:1,weight:"semibold",children:z})}),_[18]=z,_[19]=d):d=_[19],_[20]!==c||_[21]!==d?(p=(0,f.jsxs)(b.kC,{gap:2,padding:2,children:[c,d]}),_[20]=c,_[21]=d,_[22]=p):p=_[22],_[23]!==$||_[24]!==N||_[25]!==k?(y=N&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(b.R,{}),N.map((e,t)=>(0,f.jsx)(i$,{node:e,onDismiss:k,boundaryElement:$},t))]}),_[23]=$,_[24]=N,_[25]=k,_[26]=y):y=_[26],_[27]!==p||_[28]!==y?(g=(0,f.jsxs)(b.v2,{style:u,children:[p,y]}),_[27]=p,_[28]=y,_[29]=g):g=_[29];let L=`${I}-${M}`;
33return _[30]!==I||_[31]!==M?(v={position:"absolute",left:I,top:M},_[30]=I,_[31]=M,_[32]=v):v=_[32],_[33]!==L||_[34]!==v?(w=(0,f.jsx)("div",{style:v},L),_[33]=L,_[34]=v,_[35]=w):w=_[35],_[36]!==o||_[37]!==g||_[38]!==w?(x=(0,f.jsx)(b.J2,{__unstable_margins:iM,arrow:!1,open:!0,placement:"right-start",referenceElement:o,content:g,children:w}),_[36]=o,_[37]=g,_[38]=w,_[39]=x):x=_[39],_[40]!==k||_[41]!==x?(E=(0,f.jsx)(tr,{setBoundaryElement:C,onDismiss:k,children:x}),_[40]=k,_[41]=x,_[42]=E):E=_[42],E},iO=(0,h.createContext)(null),iA=e=>(0,h.isValidElement)(e),iR=(0,w.zo)(b.Zb)`
34  background-color: var(--overlay-bg);
35  border-radius: 3px;
36  pointer-events: none;
37  position: absolute;
38  will-change: transform;
39  box-shadow: var(--overlay-box-shadow);
40  transition: none;
41
42  --overlay-bg: transparent;
43  --overlay-box-shadow: inset 0 0 0 1px transparent;
44
45  [data-overlays] & {
46    --overlay-bg: color-mix(in srgb, transparent 95%, var(--card-focus-ring-color));
47    --overlay-box-shadow: inset 0 0 0 2px
48      color-mix(in srgb, transparent 50%, var(--card-focus-ring-color));
49  }
50
51  [data-fading-out] & {
52    transition:
53      box-shadow 1550ms,
54      background-color 1550ms;
55
56    --overlay-bg: rgba(0, 0, 255, 0);
57    --overlay-box-shadow: inset 0 0 0 1px transparent;
58  }
59
60  &[data-focused] {
61    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
62  }
63
64  &[data-hovered]:not([data-focused]) {
65    transition: none;
66    --overlay-box-shadow: inset 0 0 0 2px var(--card-focus-ring-color);
67  }
68
69  /* [data-unmounted] & {
70    --overlay-box-shadow: inset 0 0 0 1px var(--card-focus-ring-color);
71  } */
72
73  :link {
74    text-decoration: none;
75  }
76`,iT=(0,w.zo)(b.kC)`
77  bottom: 100%;
78  cursor: pointer;
79  pointer-events: none;
80  position: absolute;
81  right: 0;
82
83  [data-hovered]:not([data-menu-open]) & {
84    pointer-events: all;
85  }
86
87  [data-flipped] & {
88    bottom: auto;
89    top: 100%;
90  }
91`,iN=(0,w.zo)(b.kC)`
92  top: 100%;
93  cursor: pointer;
94  pointer-events: none;
95  position: absolute;
96  left: 0;
97
98  gap: 4px;
99  padding: 4px 0;
100  flex-wrap: wrap;
101
102  [data-hovered]:not([data-menu-open]) & {
103    pointer-events: all;
104  }
105
106  [data-flipped] & {
107    top: calc(100% + 2rem);
108  }
109`,iP=(0,w.zo)(b.kC)`
110  margin: -0.5rem;
111
112  [data-hovered]:not([data-menu-open]) & {
113    pointer-events: all;
114  }
115`,iz=(0,w.zo)(b.kC)`
116  bottom: 100%;
117  cursor: pointer;
118  pointer-events: none;
119  position: absolute;
120  left: 0;
121
122  [data-hovered]:not([data-menu-open]) & {
123    pointer-events: all;
124  }
125
126  [data-flipped] & {
127    bottom: auto;
128    top: 100%;
129  }
130`,iL=(0,w.zo)(b.Zb)`
131  cursor: pointer;
132  background-color: var(--card-focus-ring-color);
133  right: 0;
134  border-radius: 3px;
135
136  & [data-ui='Text'] {
137    color: #fff;
138    white-space: nowrap;
139  }
140`,iD=(0,w.zo)(b.kC)`
141  display: flex;
142  align-items: center;
143  background-color: var(--card-focus-ring-color);
144  right: 0;
145  border-radius: 3px;
146  & [data-ui='Text'],
147  & [data-sanity-icon] {
148    color: #fff;
149    white-space: nowrap;
150  }
151`,iU=w.zo.div`
152  position: absolute;
153  inset: 0;
154  pointer-events: all;
155`,iV=e=>{let t,n,r,i,o,a,s,l,u,c,d,p,y,g,w,x,E,_;let j=(0,m.c)(59),{id:k,element:S,focused:I,componentResolver:M,node:$,showActions:C,draggable:O,targets:A,elementType:R,comlink:T,onActivateExclusivePlugin:N,onMenuOpenChange:P}=e,{getField:z,getType:L}=iw();j[0]!==L||j[1]!==$?(t=L($),j[0]=L,j[1]=$,j[2]=t):t=j[2];let D=t;j[3]!==$?(n="path"in $?function(e){let{id:t,type:n,path:r,baseUrl:i,tool:o,workspace:a}=e;return(0,v.tZ)({baseUrl:i,workspace:a,tool:o,type:n,id:t,path:r?function(e){let t="";for(let n of e){if("string"==typeof n){t&&(t+="."),t+=n;continue}if("number"==typeof n){t&&(t+=":"),t+=`${n}`;continue}if(null!==n&&Array.isArray(n)){t&&(t+=":"),t+=`${n.join(",")}}`;continue}if(n._key){t&&(t+=":"),t+=`${n._key}`;continue}}return t}(v.eT.fromString(r)):[]})}($):$.href,j[3]=$,j[4]=n):n=j[4];let U=n,V=function(){let e=(0,h.useContext)(iO);if(!e)throw Error("Preview Snapshots context is missing");return e}();e:{let e;if(!("path"in $)){r=void 0;break e}j[5]!==$||j[6]!==V?(e=V.find(e=>e._id===$.id)?.title,j[5]=$,j[6]=V,j[7]=e):e=j[7],r=e}let F=r;j[8]!==S||j[9]!==I||j[10]!==z||j[11]!==L?(o=function(e,t){let n=L(e),{field:r,parent:i}=z(e);if(!("id"in e)||!r||!n)return;let o=r.value.type;return{document:n,element:S,targetElement:t||S,field:r,focused:!!I,node:e,parent:i,type:o}},j[8]=S,j[9]=I,j[10]=z,j[11]=L,j[12]=o):o=j[12];let W=o;if(j[13]!==R||j[14]!==W||j[15]!==$?(a="element"===R?W($):void 0,j[13]=R,j[14]=W,j[15]=$,j[16]=a):a=j[16],j[17]!==W||j[18]!==A){let e;j[20]!==W?(e=e=>W(e.sanity,e.element),j[20]=W,j[21]=e):e=j[21],s=A.map(e).filter(iY),j[17]=W,j[18]=A,j[19]=s}else s=j[19];j[22]!==a||j[23]!==s?(l={legacyComponentContext:a,pluginContexts:s},j[22]=a,j[23]=s,j[24]=l):l=j[24];let Z=function(e,t){let n;let r=(0,m.c)(4);e:{let i;if(!e){n=void 0;break e}if(r[0]!==e||r[1]!==t){let o=t?.(e);if(!o){n=void 0;break e}if(iA(o)){n=o;break e}i=(Array.isArray(o)?o:[o]).map(iW),r[0]=e,r[1]=t,r[2]=i,r[3]=n}else i=r[2],n=r[3];n=i}return n}((i=l).legacyComponentContext,M),Y=function(e,t){let n;let r=(0,m.c)(5);if(r[0]!==e||r[1]!==t){let i;r[3]!==t?(i=e=>{let n={id:eS(),context:e,hud:[],exclusive:[]};return t?.forEach(t=>{t.guard?.(e)&&("hud"===t.type&&n.hud.push(t),"exclusive"===t.type&&n.exclusive.push(t))}),n},r[3]=t,r[4]=i):i=r[4],n=e.map(i),r[0]=e,r[1]=t,r[2]=n}else n=r[2];return n}(i.pluginContexts,e.plugins);j[25]!==D?(u=D?.icon?(0,f.jsx)("div",{dangerouslySetInnerHTML:{__html:D.icon}}):(0,f.jsx)(e8.$lS,{}),j[25]=D,j[26]=u):u=j[26];let q=u,B=(0,h.useId)();j[27]!==Y?(c=Y?.some(iq),j[27]=Y,j[28]=c):c=j[28];let G=c||Y?.length>1;
155j[29]!==k?(d=()=>{window.dispatchEvent(new CustomEvent("sanity-overlay/label-click",{detail:{id:k}}))},j[29]=k,j[30]=d):d=j[30];let H=d;return j[31]!==U||j[32]!==C?(p=C?(0,f.jsx)(iT,{gap:1,paddingY:1,children:(0,f.jsx)(iZ,{href:U})}):null,j[31]=U,j[32]=C,j[33]=p):p=j[33],j[34]!==T||j[35]!==O||j[36]!==H||j[37]!==q||j[38]!==B||j[39]!==Y||j[40]!==N||j[41]!==P||j[42]!==G||j[43]!==F?(y=(F||G)&&(0,f.jsx)(iz,{gap:1,paddingY:1,onClick:H,children:(0,f.jsxs)(iD,{gap:2,padding:2,children:[O&&(0,f.jsx)(b.xu,{marginRight:1,children:(0,f.jsx)(b.xv,{className:"drag-handle",size:0,children:(0,f.jsx)(e8.VVU,{})})}),(0,f.jsx)(b.xv,{size:0,children:q}),F&&(0,f.jsx)(b.xv,{size:1,weight:"medium",children:F}),G&&(0,f.jsx)(b.xu,{paddingLeft:2,onClick:iB,children:(0,f.jsx)(iP,{children:(0,f.jsx)(ty.j2,{id:B,popover:{animate:!0,placement:"bottom-start",constrainSize:!0,tone:"default"},onOpen:()=>{P?.(!0)},onClose:()=>{P?.(!1)},button:(0,f.jsx)(b.zx,{icon:e8.zGg,tone:"primary",padding:2}),menu:(0,f.jsx)(b.v2,{paddingY:0,children:(0,f.jsx)(tm,{children:Y?.map((e,t)=>f.jsxs(h.Fragment,{children:[f.jsxs(b.Kq,{role:"group",paddingY:1,space:0,children:[f.jsx(b.sN,{paddingY:2,text:f.jsx(b.xu,{paddingY:2,children:f.jsx(b.xv,{muted:!0,size:1,style:{textTransform:"capitalize"},children:`${e.context.document.name}: ${e.context.field?.name}`})}),onClick:()=>{e.context.node&&T?.post("visual-editing/focus",e.context.node)}}),e.exclusive.map(t=>t.component?f.jsx(b.sN,{paddingY:2,icon:t.icon||f.jsx(e8.BWR,{}),text:f.jsx(b.xu,{paddingY:2,children:f.jsx(b.xv,{size:1,children:t.title||t.name})}),onClick:()=>N?.(t,e.context)},t.name):null)]}),t<Y.length-1&&f.jsx(b.R,{})]},e.id))})})})})})]})}),j[34]=T,j[35]=O,j[36]=H,j[37]=q,j[38]=B,j[39]=Y,j[40]=N,j[41]=P,j[42]=G,j[43]=F,j[44]=y):y=j[44],j[45]!==Y?(g=Y?.map(iG),j[45]=Y,j[46]=g):g=j[46],j[47]!==g?(w=(0,f.jsx)(iN,{children:g}),j[47]=g,j[48]=w):w=j[48],j[49]!==p||j[50]!==y||j[51]!==w?(x=(0,f.jsxs)(tm,{children:[p,y,w]}),j[49]=p,j[50]=y,j[51]=w,j[52]=x):x=j[52],j[53]!==Z||j[54]!==i.legacyComponentContext?(E=Array.isArray(Z)?Z.map((e,t)=>{let{component:n,props:r}=e;return(0,f.jsx)(n,{PointerEvents:tm,...i.legacyComponentContext,...r},t)}):Z,j[53]=Z,j[54]=i.legacyComponentContext,j[55]=E):E=j[55],j[56]!==x||j[57]!==E?(_=(0,f.jsxs)(f.Fragment,{children:[x,E]}),j[56]=x,j[57]=E,j[58]=_):_=j[58],_},iF=(0,h.memo)(function(e){let t,n,r,i,o,a,s,l,u,c,d,p,y,g;let v=(0,m.c)(38),{draggable:b,focused:w,hovered:x,rect:E,wasMaybeCollapsed:_,enableScrollIntoView:j}=e,k=(0,h.useRef)(null),S=(0,h.useRef)(!1),I=`${E.w}px`,M=`${E.h}px`,$=`translate(${E.x}px, ${E.y}px)`;v[0]!==I||v[1]!==M||v[2]!==$?(n={width:I,height:M,transform:$},v[0]=I,v[1]=M,v[2]=$,v[3]=n):n=v[3],t=n,v[4]!==j||v[5]!==w||v[6]!==_?(r=()=>{if(!S.current&&!_&&!0===w&&k.current&&j){let e=k.current;(0,th.Z)(k.current,{behavior:t=>{0!==t.length&&e.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"})},scrollMode:"if-needed",block:"center",inline:"nearest"})}S.current=!0===w},i=[w,_,j],v[4]=j,v[5]=w,v[6]=_,v[7]=r,v[8]=i):(r=v[7],i=v[8]),(0,h.useEffect)(r,i);let[C,O]=(0,h.useState)(!1);v[9]!==x?(o=()=>{if(!k.current||!x)return;let e=new IntersectionObserver(e=>{let[t]=e;O(t.boundingClientRect.top<0)},{threshold:1});return e.observe(k.current),()=>e.disconnect()},v[9]=x,v[10]=o):o=v[10],v[11]!==x||v[12]!==C?(a=[x,C],v[11]=x,v[12]=C,v[13]=a):a=v[13],(0,h.useEffect)(o,a);let[A,R]=(0,h.useState)(null);v[14]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{R(null),window.dispatchEvent(new CustomEvent("sanity-overlay/exclusive-plugin-closed"))},v[14]=s):s=v[14];let T=s;v[15]===Symbol.for("react.memo_cache_sentinel")?(l=(e,t)=>{R({plugin:e,context:t})},v[15]=l):l=v[15];let N=l,P=A?.plugin.component,[z,L]=(0,h.useState)(!1);v[16]===Symbol.for("react.memo_cache_sentinel")?(u=()=>{L(!1)},v[16]=u):u=v[16],v[17]!==x?(c=[x],v[17]=x,v[18]=c):c=v[18],(0,h.useEffect)(u,c),v[19]!==P||v[20]!==z?(d=z||P?(0,f.jsx)(ti,{onDismiss:T,blockScroll:z}):null,v[19]=P,v[20]=z,v[21]=d):d=v[21];let D=w?"":void 0,U=x?"":void 0,V=C?"":void 0,F=b?"":void 0,W=z?"":void 0;
155return v[22]!==P||v[23]!==A||v[24]!==x||v[25]!==e?(p=P?(0,f.jsx)(iU,{"data-sanity-overlay-element":!0,onClick:iH,children:(0,f.jsx)(P,{...A.context,closeExclusiveView:T})}):x?(0,f.jsx)(iV,{...e,onActivateExclusivePlugin:N,onMenuOpenChange:L}):null,v[22]=P,v[23]=A,v[24]=x,v[25]=e,v[26]=p):p=v[26],v[27]!==t||v[28]!==D||v[29]!==U||v[30]!==V||v[31]!==F||v[32]!==W||v[33]!==p?(y=(0,f.jsx)(iR,{"data-focused":D,"data-hovered":U,"data-flipped":V,"data-draggable":F,"data-menu-open":W,ref:k,style:t,children:p}),v[27]=t,v[28]=D,v[29]=U,v[30]=V,v[31]=F,v[32]=W,v[33]=p,v[34]=y):y=v[34],v[35]!==d||v[36]!==y?(g=(0,f.jsxs)(f.Fragment,{children:[d,y]}),v[35]=d,v[36]=y,v[37]=g):g=v[37],g});function iW(e){return"object"==typeof e&&"component"in e?e:{component:e,props:{}}}let iZ=(0,h.memo)(function(e){let t,n,r,i;let o=(0,m.c)(6),a=(0,h.useSyncExternalStore)(iK,iX);return o[0]!==e.href||o[1]!==a?(n=function e(t,n){try{let r=new URL(t,typeof location>"u"?void 0:location.origin);if(r.hash){let t=new URL(e(r.hash.slice(1),n));return`${r.origin}${r.pathname}${r.search}#${t.pathname}${t.search}`}return r.searchParams.set("preview",n),r.toString()}catch{return t}}(e.href,a),o[0]=e.href,o[1]=a,o[2]=n):n=o[2],t=n,o[3]===Symbol.for("react.memo_cache_sentinel")?(r=(0,f.jsx)(iL,{padding:2,children:(0,f.jsx)(b.xv,{size:1,weight:"medium",children:"Open in Studio"})}),o[3]=r):r=o[3],o[4]!==t?(i=(0,f.jsx)(b.xu,{as:"a",href:t,target:"_blank",rel:"noopener noreferrer",children:r}),o[4]=t,o[5]=i):i=o[5],i});function iY(e){return void 0!==e}function iq(e){return e.exclusive.length>0}function iB(e){e.stopPropagation()}function iG(e){return(0,f.jsx)(h.Fragment,{children:e.hud.map(t=>{let n=t.component;return n?(0,f.jsx)(n,{...e.context},t.name):null})},e.id)}function iH(e){e.stopPropagation()}function iK(e){let t=()=>e();return window.addEventListener("popstate",t),()=>window.removeEventListener("popstate",t)}function iX(){return window.location.href}let iJ=e=>{let t;let n=(0,m.c)(5),{dragGroupRect:r}=e,i=`${r.y}px`,o=`${r.x}px`,a=`${r.w-1}px`,s=`${r.h-1}px`;return n[0]!==i||n[1]!==o||n[2]!==a||n[3]!==s?(t=(0,f.jsx)("div",{style:{position:"absolute",top:i,left:o,width:a,height:s,border:"1px dashed #f0709b",pointerEvents:"none"}}),n[0]=i,n[1]=o,n[2]=a,n[3]=s,n[4]=t):t=n[4],t},iQ=e=>{let t;let n=(0,m.c)(4),{dragInsertPosition:r}=e;if(null===r)return;let i=r?.left||r?.right?"horizontal":"vertical",o=0,a=0,s=0,l=0;if("horizontal"===i){let{left:e,right:t}=r;if(s=6,t&&e){let n=e.rect.x+e.rect.w,r=t.rect.x,i=.0125*Math.min(t.rect.h,e.rect.h);o=.5*n+.5*r-3,a=e.rect.y+i,l=Math.min(t.rect.h,e.rect.h)-2*i}else if(t&&!e){let e=.0125*t.rect.h;o=t.rect.x-3,a=t.rect.y+e,l=t.rect.h-2*e}else if(e&&!t){let t=.0125*e.rect.h;o=e.rect.x+e.rect.w-3,a=e.rect.y+t,l=e.rect.h-2*t}}else{let{bottom:e,top:t}=r;if(e&&t){let n=Math.min(t.rect.x,e.rect.x),r=t.rect.y+t.rect.h,i=e.rect.y,u=.0125*Math.min(e.rect.w,t.rect.w);l=6,o=n+u,a=.5*r+.5*i-3,s=Math.max(e.rect.w,t.rect.w)-2*u}else if(e&&!t){let t=.0125*e.rect.w;o=e.rect.x+t,a=e.rect.y-3,s=e.rect.w-2*t,l=6}else if(t&&!e){let e=.0125*t.rect.w;o=t.rect.x+e,a=t.rect.y+t.rect.h-3,s=t.rect.w-2*e,l=6}}let u=`${s}px`,c=`${l}px`,d=`translate(${o}px, ${a}px)`;return n[0]!==u||n[1]!==c||n[2]!==d?(t=(0,f.jsx)("div",{style:{position:"absolute",width:u,height:c,transform:d,background:"#556bfc",border:"2px solid white",borderRadius:"999px",zIndex:"999999"}}),n[0]=u,n[1]=c,n[2]=d,n[3]=t):t=n[3],t},i0=w.zo.div`
156  --drag-preview-opacity: 0.98;
157  --drag-preview-skeleton-stroke: #ffffff;
158
159  @media (prefers-color-scheme: dark) {
160    --drag-preview-skeleton-stroke: #383d51;
161  }
162
163  position: fixed;
164  display: grid;
165  transform: ${({$scaleFactor:e,$width:t,$height:n})=>`translate(calc(var(--drag-preview-x) - ${t/2}px), calc(var(--drag-preview-y) - ${n/2}px)) scale(${e})`};
166  width: ${({$width:e})=>`${e}px`};
167  height: ${({$height:e})=>`${e}px`};
168  z-index: 9999999;
169  opacity: var(--drag-preview-opacity);
170  cursor: move;
171
172  .drag-preview-content-wrapper {
173    position: relative;
174    width: 100%;
175    height: 100%;
176    container-type: inline-size;
177  }
178
179  [data-ui='card'] {
180    position: relative;
181    width: 100%;
182    height: 100%;
183  }
184
185  .drag-preview-skeleton {
186    position: absolute;
187    inset: 0;
188
189    rect {
190      stroke: var(--drag-preview-skeleton-stroke);
191    }
192  }
193
194  .drag-preview-handle {
195    position: absolute;
196    top: 4cqmin;
197    left: 4cqmin;
198    width: 6cqmin;
199    fill: var(--drag-preview-handle-fill);
200  }
201`,i1=e=>{var t,n;let r,i,o,a,s,l,u,c,d,p,y,h,g,v,w,x,E,_,j,k,S;let I=(0,m.c)(50),{skeleton:M}=e,$=Math.min(M.maxWidth,window.innerWidth/2),C=M.w>$?$/M.w:1,O=M.offsetX*C,A=M.offsetY*C,R=(0,b.Bj)(),T=(0,b.g9)(),N=T.radius[~~((n=(M.w-0)*((t=T.radiu
201s.length-2)-1)/1920+1)<1?1:n>t?t:n)];if(I[0]!==O||I[1]!==A||I[2]!==R||I[3]!==N||I[4]!==C||I[5]!==M.childRects||I[6]!==M.h||I[7]!==M.w){let e=M.childRects.filter(i2),t=M.childRects.filter(i3);i=i0,a=M.w,s=M.h,l=O,u=A,c=C,r=b.Zb,h=N,g=4,v="hidden",w="transparent",x=R?"dark":"light",y="drag-preview-content-wrapper",d="drag-preview-skeleton",p=`0 0 ${M.w} ${M.h}`,o=[...e,...t],I[0]=O,I[1]=A,I[2]=R,I[3]=N,I[4]=C,I[5]=M.childRects,I[6]=M.h,I[7]=M.w,I[8]=r,I[9]=i,I[10]=o,I[11]=a,I[12]=s,I[13]=l,I[14]=u,I[15]=c,I[16]=d,I[17]=p,I[18]=y,I[19]=h,I[20]=g,I[21]=v,I[22]=w,I[23]=x}else r=I[8],i=I[9],o=I[10],a=I[11],s=I[12],l=I[13],u=I[14],c=I[15],d=I[16],p=I[17],y=I[18],h=I[19],g=I[20],v=I[21],w=I[22],x=I[23];return I[24]!==o||I[25]!==T.color?(E=o.map((e,t)=>(0,f.jsx)("rect",{x:e.x,y:e.y,width:e.w,height:e.h,fill:T.color.skeleton.from},t)),I[24]=o,I[25]=T.color,I[26]=E):E=I[26],I[27]!==E||I[28]!==d||I[29]!==p?(_=(0,f.jsx)("svg",{className:d,viewBox:p,children:E}),I[27]=E,I[28]=d,I[29]=p,I[30]=_):_=I[30],I[31]!==_||I[32]!==y?(j=(0,f.jsx)("div",{className:y,children:_}),I[31]=_,I[32]=y,I[33]=j):j=I[33],I[34]!==r||I[35]!==j||I[36]!==h||I[37]!==g||I[38]!==v||I[39]!==w||I[40]!==x?(k=(0,f.jsx)(r,{radius:h,shadow:g,overflow:v,tone:w,scheme:x,children:j}),I[34]=r,I[35]=j,I[36]=h,I[37]=g,I[38]=v,I[39]=w,I[40]=x,I[41]=k):k=I[41],I[42]!==i||I[43]!==a||I[44]!==s||I[45]!==l||I[46]!==u||I[47]!==c||I[48]!==k?(S=(0,f.jsx)(i,{$width:a,$height:s,$offsetX:l,$offsetY:u,$scaleFactor:c,children:k}),I[42]=i,I[43]=a,I[44]=s,I[45]=l,I[46]=u,I[47]=c,I[48]=k,I[49]=S):S=I[49],S};function i2(e){return"IMG"===e.tagName}function i3(e){return"IMG"!==e.tagName}let i4=(0,w.zo)(b.Zb)`
202  position: fixed;
203  bottom: 2rem;
204  left: 2rem;
205`,i5=()=>{let e,t;let n=(0,m.c)(2);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e={zIndex:"999999"},n[0]=e):e=n[0],n[1]===Symbol.for("react.memo_cache_sentinel")?(t=(0,f.jsx)(i4,{padding:2,shadow:2,radius:2,style:e,children:(0,f.jsxs)(b.kC,{align:"center",gap:2,children:[(0,f.jsx)(b.SV,{keys:["Shift"]}),(0,f.jsx)(b.xv,{size:1,children:"Zoom Out"}),(0,f.jsx)(e8.Qq,{})]})}),n[1]=t):t=n[1],t},i6=(e,t)=>{let{type:n}=t;switch(n){case"element/register":return e.find(e=>e.id===t.id)?e:[...e,{id:t.id,activated:!1,element:t.element,focused:!1,hovered:!1,rect:t.rect,sanity:t.sanity,dragDisabled:t.dragDisabled,targets:t.targets,elementType:t.elementType}];case"element/activate":return e.map(e=>e.id===t.id?{...e,activated:!0}:e);case"element/update":return e.map(e=>e.id===t.id?{...e,sanity:t.sanity,rect:t.rect,targets:t.targets,elementType:t.elementType}:e);case"element/unregister":return e.filter(e=>e.id!==t.id);case"element/deactivate":return e.map(e=>e.id===t.id?{...e,activated:!1,hovered:!1}:e);case"element/mouseenter":return e.map(e=>e.id===t.id?{...e,rect:t.rect,hovered:!0}:{...e,hovered:!1});case"element/mouseleave":return e.map(e=>e.id===t.id?{...e,hovered:!1}:e);case"element/updateRect":return e.map(e=>e.id===t.id?{...e,rect:t.rect}:e);case"element/click":return e.map(e=>({...e,focused:e.id===t.id&&"clicked"}));case"overlay/reset-mouse-state":return e.map(e=>({...e,focused:!1,hovered:!1}));case"overlay/blur":return e.map(e=>({...e,focused:!1}));case"presentation/blur":return e.map(e=>({...e,focused:!1}));case"presentation/focus":{let n=e.find(e=>"clicked"===e.focused);return e.map(e=>{let r="path"in e.sanity&&e.sanity.id===t.data.id&&e.sanity.path===t.data.path;return n&&e===n&&r?e:{...e,focused:r&&n?"duplicate":r}})}default:return e}};function i9(e,t){let{type:n}=t,{contextMenu:r,focusPath:i,perspective:o,isDragging:a,dragInsertPosition:s,dragShowMinimap:l,dragShowMinimapPrompt:u,dragSkeleton:c,dragMinimapTransition:d,dragGroupRect:p}=e,f=!1;if("presentation/focus"===n){let n=e.focusPath;n!==(i=t.data.path)&&(f=n.slice(i.length).startsWith("["))}return"presentation/perspective"===n&&(o=t.data.perspective),"element/contextmenu"===n&&(r="sanity"in t?{node:t.sanity,position:t.position}:null),("element/click"===n||"element/mouseleave"===n||"overlay/blur"===n||"presentation/blur"===n||"presentation/focus"===n)&&(r=null),"overlay/dragUpdateInsertPosition"===n&&(s=t.insertPosition),"overlay/dragStart"===n&&(a=!0),"overlay/dragUpdateSkeleton"===t.type&&(c=t.skeleton),"overlay/dragEnd"===n&&(a=!1),"overlay/dragToggleMinimapPrompt"===t.type&&(u=t.display),"overlay/dragStartMinimapTransition"===n&&(d=!0),"overlay/dragEndMinimapTransition"===n&&(d=!1),"overlay/dragUpdateGroupRect"===n&&(p=t.groupRect),"overlay/dragToggleMinimap"===n&&(l=t.display),{...e,contextMenu:r,elements:i6(e.elements,t),dragInsertPosition:s,dragSkeleton:c,dragGroupRect:p,isDragging:a,focusPath:i,perspective:o,wasMaybeCollapsed:f,dragShowMinimap:l,dragShowMinimapPrompt:u,dragMinimapTransition:d}}let i8=function(e){let t,n,r,i,o,a,s;let l=(0,m.c)(13),{comlink:u,children:c}=e;l[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],l[0]=t):t=l[0];let[d,p]=(0,h.useState)(t);l[1]!==u?(n=async e=>{if(u)try{let t=await u.fetch("visual-editing/preview-snapshots",void 0,{signal:e,suppressWarnings:!0});p(t.snapshots)}catch{}},l[1]=u,l[2]=n):n=l[2];let y=n;return l[3]!==u||l[4]!==y?(r=()=>{if(!u)return;let e=new AbortController,t=u.onStatus(()=>{y(e.signal)},"connected");return()=>{e.abort(),t()}},i=[u,y],l[3]=u,l[4]=y,l[5]=r,l[6]=i):(r=l[5],i=l[6]),(0,h.useEffect)(r,i),l[7]!==u?(o=()=>u?.on("presentation/preview-snapshots",e=>{p(e.snapshots)}),a=[u],l[7]=u,l[8]=o,l[9]=a):(o=l[8],a=l[9]),(0,h.useEffect)(o,a),l[10]!==c||l[11]!==d?(s=(0,f.jsx)(iO.Provider,{value:d,children:c}),l[10]=c,l[11]=d,l[12]=s):s=l[12],s};function i7(e){return"document"===e.type}function oe(e){return"type"===e.type}let ot=function(e){let t,n,r,i,o,a,s,l,u,c,d,p;let y=(0,m.c)(22),{comlink:g,children:v,elements:b}=e;y[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Map,y[0]=t):t=y[0];let[w,x]=(0,h.useState)(t),[E,_]=(0,h.useState)(null);y[1]!==g?(n=()=>
205{if(!g)return;let e=async function(e){if(g)try{let t=await g.fetch("visual-editing/schema",void 0,{signal:e,suppressWarnings:!0});_(t.schema)}catch{}},t=new AbortController,n=g.onStatus(()=>{e(t.signal)},"connected");return()=>{t.abort(),n()}},r=[g],y[1]=g,y[2]=n,y[3]=r):(n=y[2],r=y[3]),(0,h.useEffect)(n,r),y[4]===Symbol.for("react.memo_cache_sentinel")?(i=[],y[4]=i):i=y[4];let j=(0,h.useRef)(i),k=(0,h.useDeferredValue)(b);y[5]!==k?(o=k.reduce((e,t)=>{let{sanity:n}=t;if(!("id"in n)||!n.path.includes("[_key=="))return e;let r=n.path.split(".").toReversed().reduce((e,t)=>e.length?[t,...e]:t.includes("[_key==")?[t]:[],[]).join(".");return e.find(e=>e.id===n.id&&e.path===r)||e.push({id:n.id,path:r}),e},[]),y[5]=k,y[6]=o):o=y[6];let S=o,I=(0,h.useRef)(null);y[7]!==g||y[8]!==S?(a=()=>{if(!S.length||!g)return;let e=async(e,t)=>{let n=j.current;try{j.current=e;let n=await g.fetch("visual-editing/schema-union-types",{paths:e},{signal:t,suppressWarnings:!0});if(t.aborted)return;x(n.types),I.current=null}catch{}t.aborted&&(j.current=n)};S.some(e=>!j.current.find(t=>{let{id:n,path:r}=t;return n===e.id&&r===e.path}))&&(I.current?.abort(),I.current=new AbortController,e(S,I.current.signal))},s=[g,S],y[7]=g,y[8]=S,y[9]=a,y[10]=s):(a=y[9],s=y[10]),(0,h.useEffect)(a,s),y[11]!==E?(l=(e,t)=>{if(!E||"string"!=typeof e&&(!("path"in e)||!Array.isArray(E)))return;let n="string"==typeof e?e:e.type;return E.filter("document"===(t||"document")?i7:oe).find(e=>e.name===n)},y[11]=E,y[12]=l):l=y[12];let M=l;y[13]!==M||y[14]!==w?(u=e=>{if(!("path"in e))return{field:void 0,parent:void 0};let t=M(e);if(!t)return{field:void 0,parent:void 0};let n=e.path.split(".").flatMap(on);try{return function t(n,r,i,o){let a=void 0===o?[]:o;if(!n)return{field:void 0,parent:void 0};let[s,...l]=r;if("fields"in n){let e=n.fields[s];if(!e&&"rest"in n)return t(n.rest,r,n,a);if(!l.length)return{field:e,parent:i};if(!e)throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...a,...r].join(".")}"`);return t(e.value,l,n,[...a,s])}if("array"===n.type)return t(n.of,r,n,a);if("arrayItem"===n.type)return l.length?t(n.value,l,n,[...a,s]):{field:n,parent:i};if("union"===n.type){let r=s.startsWith("[_key==")?w?.get(e.id)?.get([a.join("."),s].filter(Boolean).join("")):s;return t(n.of.find(e=>"unionOption"===e.type?e.name===r:e),l,n,[...a,s])}if("unionOption"===n.type)return s?t(n.value,r,n,a):{field:n,parent:i};if("inline"===n.type)return t(M(n.name,"type").value,r,n,a);throw Error(`[@sanity/visual-editing] No field could be resolved at path: "${[...a,...r].join(".")}"`)}(t,n,void 0)}catch(e){return e instanceof Error&&console.warn(e.message),{field:void 0,parent:void 0}}},y[13]=M,y[14]=w,y[15]=u):u=y[15];let $=u;return y[16]!==$||y[17]!==M?(d={getField:$,getType:M},y[16]=$,y[17]=M,y[18]=d):d=y[18],c=d,y[19]!==v||y[20]!==c?(p=(0,f.jsx)(ib.Provider,{value:c,children:v}),y[19]=v,y[20]=c,y[21]=p):p=y[21],p};function on(e){return e.includes("[")?e.split(/(\[.+\])/,2):[e]}let or=(e=>{let t=e,n=new Set;return{getState:()=>t,setState:e=>{t=e(t),n.forEach(e=>e())},subscribe:e=>(n.add(e),()=>n.delete(e))}})({}),oi=e=>{let t,n,r,i,o,a,s;let l=(0,m.c)(11),{comlink:u,children:c}=e;return l[0]!==u?(t=()=>u?.on("presentation/shared-state",oo),n=[u],l[0]=u,l[1]=t,l[2]=n):(t=l[1],n=l[2]),(0,h.useEffect)(t,n),l[3]!==u?(r=()=>{(async function(){let e=await u?.fetch("visual-editing/shared-state",void 0,{suppressWarnings:!0});e&&or.setState(()=>e.state)})().catch(oa)},i=[u],l[3]=u,l[4]=r,l[5]=i):(r=l[4],i=l[5]),(0,h.useEffect)(r,i),l[6]!==u?(a={comlink:u,store:or},l[6]=u,l[7]=a):a=l[7],o=a,l[8]!==c||l[9]!==o?(s=(0,f.jsx)(e6.Provider,{value:o,children:c}),l[8]=c,l[9]=o,l[10]=s):s=l[10],s};function oo(e){"value"in e?or.setState(t=>({...t,[e.key]:e.value})):or.setState(t=>Object.fromEntries(Object.entries(t).filter(t=>{let[n]=t;return n!==e.key})))}function oa(e){console.debug(e),console.warn("[@sanity/visual-editing]: Failed to fetch shared state. Check your version of `sanity` is up-to-date")}let os=e=>{let t,n;let r=(0,m.c)(5),{children:i,comlink:o}=e;r[0]!==o?(t=(e,t)=>{if(!o)return;let n=ts[e];if(n)o.post("visual-editing/telemetry-log",{event:n,data:t});else throw Error(`Telemetry event: ${e} does not exist`)},r[0]=o,r[1]=t):t=r[1];let a=t;return r[2]!==i||r[3]!==a?(n=(0,f.jsx)(tl.Provider,{value:a,children:i}),r[2]=i,r[3]=a,r[4]=n):n=r[4],n};function ol(){}function ou(e){return e.id}function oc(e){return!!e}function od(e){let{sanity:t}=e;return t&&"id"in t?t:null}let op=w.zo.div`
206  background-color: transparent;
207  direction: ltr;
208  inset: 0;
209  pointer-events: none;
210  position: absolute;
211  width: 100%;
212  height: 100%;
213  z-index: ${({$zIndex:e})=>e??"9999999"};
214`;function of(e){let t,n;return t=requestAnimationFrame(()=>{n=requestAnimationFrame(e)}),()=>{void 0!==t&&cancelAnimationFrame(t),void 0!==n&&cancelAnimationFrame(n)}}let om=e=>{let t,n,r,i,o;let a=(0,m.c)(8),{documentIds:s}=e;a[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],a[0]=t):t=a[0];let[l,u]=(0,h.useState)(t);a[1]!==s?(n=()=>{u(e=>{let t=Array.from(new Set(s));return e.length===t.length&&e.reduce(ob,t)?.length===0?e:t})},r=[s],a[1]=s,a[2]=n,a[3]=r):(n=a[2],r=a[3]),(0,h.useEffect)(n,r);let c=H();return a[4]!==c||a[5]!==l?(i=()=>{for(let e of l)c.send({type:"observe",documentId:(0,v.qy)(e)}),c.send({type:"observe",documentId:(0,v.vs)(e)});return()=>{for(let e of l)c.send({type:"unobserve",documentId:(0,v.qy)(e)}),c.send({type:"unobserve",documentId:(0,v.vs)(e)})}},o=[c,l],a[4]=c,a[5]=l,a[6]=i,a[7]=o):(i=a[6],o=a[7]),(0,h.useEffect)(i,o),null},oy=e=>{let t,n,r;let i=(0,m.c)(12),{comlink:o,dispatch:a,inFrame:s,inPopUp:l,onDrag:u,overlayEnabled:c,rootElement:d}=e,{dispatchDragEndEvent:p}=function(){let e,t,n;let r=(0,m.c)(4),{getDocument:i}=et();return r[0]!==i?(e=()=>{let e=e=>{let{insertPosition:t,target:n,preventInsertDefault:r}=e.detail;if(r)return;let o=function(e){if(e){let{top:t,right:n,bottom:r,left:i}=e;if(i||t)return{node:(i??t).sanity,position:"after"};if(n||r)return{node:(n??r).sanity,position:"before"}}}(t);if(o){let e=i(n.id),{node:t,position:r}=o,{key:a,hasExplicitKey:s}=ei(n),{path:l,key:u}=ei(t);l&&u&&u!==a&&e.patch(async e=>{let{getSnapshot:t}=e,i=B(await t(),n.path);return s?[N(l,T({_key:a})),N(l,A(i,r,{_key:u}))]:[N(l,T(~~a)),N(l,A(i,r,u>a?~~u-1:~~u))]})}};return window.addEventListener("sanity/dragEnd",e),()=>{window.removeEventListener("sanity/dragEnd",e)}},t=[i],r[0]=i,r[1]=e,r[2]=t):(e=r[1],t=r[2]),(0,h.useEffect)(e,t),r[3]===Symbol.for("react.memo_cache_sentinel")?(n={dispatchDragEndEvent:iv},r[3]=n):n=r[3],n}(),f=tu();i[0]!==o||i[1]!==a||i[2]!==p||i[3]!==u||i[4]!==f?(t=e=>{if("element/click"===e.type){let{sanity:t}=e;o?.post("visual-editing/focus",t),f("Visual Editing Overlay Clicked",null)}else if("overlay/activate"===e.type)o?.post("visual-editing/toggle",{enabled:!0});else if("overlay/deactivate"===e.type)o?.post("visual-editing/toggle",{enabled:!1});else if("overlay/dragEnd"===e.type){let{insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}=e;p({insertPosition:t,target:n,dragGroup:r,flow:i,preventInsertDefault:o}),t&&f("Visual Editing Drag Sequence Completed",null)}else if("overlay/dragUpdateCursorPosition"===e.type){u(e.x,e.y);return}else if("overlay/dragToggleMinimap"===e.type&&!0===e.display)f("Visual Editing Drag Minimap Enabled",null);else if("overlay/setCursor"===e.type){let{element:t,cursor:n}=e;n?t.style.cursor=n:t.style.removeProperty("cursor")}a(e)},i[0]=o,i[1]=a,i[2]=p,i[3]=u,i[4]=f,i[5]=t):t=i[5];let y=function(e,t,n,r){let i,o;let a=(0,m.c)(7),s=(0,h.useRef)(void 0),l=H()!==z;return a[0]!==e||a[1]!==t||a[2]!==n||a[3]!==r||a[4]!==l?(i=()=>
214{if(e)return s.current=function({handler:e,overlayElement:t,inFrame:n,inPopUp:r,optimisticActorReady:i}){let o=!1,a=new Map,s=new WeakMap,l=new Set,u=new WeakMap,c=new WeakMap,d,p,f,m=!1,y=[],h=()=>y[y.length-1];function g(e,t){e.removeEventListener("click",t.click,{capture:!0}),e.removeEventListener("contextmenu",t.contextmenu,{capture:!0}),e.removeEventListener("mousemove",t.mousemove,{capture:!0}),e.removeEventListener("mousedown",t.mousedown,{capture:!0}),e.removeEventListener("mouseenter",t.mouseenter),e.removeEventListener("mouseleave",t.mouseleave)}function b({id:t,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),e({type:"element/activate",id:t})}function w({id:t,elements:n,handlers:r}){let{element:i,measureElement:o}=n;g(i,r),d.unobserve(o),y=y.filter(e=>e!==i),e({type:"element/deactivate",id:t})}function x(t){if(!(!n&&!r||!i))for(let n of y){if(t===n){let n=s.get(t)?.sanity;if(!n||!e0(n))return;if(e5(t,n,l,s)){let n=t.style.cursor;n&&c.set(t,n),e({type:"overlay/setCursor",element:t,cursor:"move"});continue}}E(n)}}function E(t){let n=c.get(t);e({type:"overlay/setCursor",element:t,cursor:n})}function _(c){for(let d of function e(t){let n=[];function r(e,t,n,r){let i=function(e){if("object"==typeof e&&null!==e)return ey(e);try{let t=JSON.parse(e);return ey(t)}catch{return function(e){let t=e.split(";").reduce((e,t)=>{let[n,r]=t.split("=");if(!n||t.includes("=")&&!r)return e;switch(n){case"id":e.id=r;break;case"type":e.type=r;break;case"path":e.path=v.eT.toString(function(e){let t=[];for(let n of e.split(".")){let e=ec.exec(n);if(e){t.push(e[1],Number(e[2]));continue}let r=ed.exec(n);if(r){t.push(r[1],[Number(r[2]),Number(r[3])]);continue}let i=ep.exec(n);if(i){t.push(i[1],{_key:i[2]});continue}t.push(n)}return t}(r));break;case"base":e.baseUrl=decodeURIComponent(r);break;case"perspective":e.perspective=r;break;case"tool":e.tool=r;break;case"workspace":e.workspace=r;break;case"projectId":e.projectId=r;break;case"dataset":e.dataset=r}return e},{});if((0,ea.is)(eu,t))return t}(e)}}(t);if(!i)return;let o=function e(t){let{display:n}=window.getComputedStyle(t);if("inline"!==n)return t;let r=t.parentElement;return r?e(r):null}(e);if(o)return{elements:{element:e,measureElement:o},sanity:i,reason:n,preventGrouping:r}}if(t)for(let i of t.childNodes)!function t(i,o){let a=function(t){let{nodeType:n,parentElement:i,textContent:o}=t;if(eK(t)&&t.dataset?.sanityEditTarget!==void 0){let n=e1(e(t).map(e=>"element"===e.type?e.commonSanity:void 0).filter(e=>void 0!==e));if(n)return{reason:"edit-target",elements:{element:t,measureElement:t},sanity:n}}else if(n===Node.TEXT_NODE&&i&&o){let e=eH(o);return e?r(i,e,"stega-text",!0):void 0}else if(eK(t)){if("SCRIPT"===t.tagName||"SANITY-VISUAL-EDITING"===t.tagName)return;if(t.dataset?.sanity)return r(t,t.dataset.sanity,"data-attribute",!!(t.textContent&&eG(t.textContent)));if(t.dataset?.sanityEditInfo)return r(t,t.dataset.sanityEditInfo,"data-attribute",!!(t.textContent&&eG(t.textContent)));if(eX(t)){let e=eH(t.alt,!0);return e?r(t,e,"stega-attribute"):void 0}if(eJ(t)){let e=eH(t.dateTime,!0);return e?r(t,e,"stega-attribute"):void 0}if(eQ(t)){if(!t.ariaLabel)return;let e=eH(t.ariaLabel,!0);return e?r(t,e,"stega-attribute"):void 0}}}(i),s=o;if(eK(i)&&i.dataset?.sanityEditGroup!==void 0&&(s={type:"group",elements:{element:i,measureElement:i},targets:[]},n.push(s)),a){let e={elements:a.elements,sanity:a.sanity,reason:a.reason};s&&!a.preventGrouping?s.targets.push(e):n.push({elements:a.elements,type:"element",targets:[e]})}if(eK(i)&&!eX(i)&&!("SCRIPT"===i.tagName||"SANITY-VISUAL-EDITING"===i.tagName))for(let e of i.childNodes)t(e,s)}(i,void 0);return n.map(e=>{if(0===e.targets.length&&"group"===e.type)return{...e,commonSanity:void 0};let t=1===e.targets.length?e.targets[0].sanity:e1(e.targets.map(({sanity:e})=>e).filter(e=>void 0!==e))||e.targets[0].sanity;return t?{...e,commonSanity:t}:null}).filter(e=>null!==e)}(c)){if("group"===d.type){for(let e of d.targets){let t=s.get(e.elements.element);t&&"element"===t.type&&j(e.elements.element)}0===d.targets.length&&j(d.elements.element)}if(!d.commonSanity)continue;let{element:c}=d.elements;s.has(c)?function(t){let{element:n}=t.elements,r=s.get(n);r&&(s.set(n,{...r,sanity:t.commonSanity}),e({type:"element/update",elementType:r.type,id:r.id,rect:eI(n),sanity:t.commonSanity,targets:t.targets.map(e=>({sanity:e.sanity,element:e.elements.element}))}))}(d):function({type:c,elements:d,commonSanity:f,targets:g}){let{element:v,measureElement:w}=d,_={click(t){let r=t.target;if(v===h()&&v.contains(r)){n&&(t.preventDefault(),t.stopPropagation());let r=s.get(v)?.sanity;r&&!m&&e({type:"element/click",id:j,sanity:r})}},contextmenu(t){if(!("path"in f)||!n&&!r||!i||!f.path.split(".").pop()?.includes("[_key=="))return;let o=t.target;v===h()&&v.contains(o)&&((n||r)&&(t.preventDefault(),t.stopPropagation()),e({type:"element/contextmenu",id:j,position:{x:t.clientX,y:t.clientY},sanity:f}))},mousedown(t){if(t.preventDefault(),t.currentTarget!==y.at(-1)||v.getAttribute("data-sanity-drag-disable")||!n&&!r||!i)return;let o=s.get(v)?.sanity;if(!o||!e0(o)||!e2(o.path))return;let a=e5(v,f,l,s);a&&function(e){var t;let{mouseEvent:n,element:r,overlayGroup:i,handler:o,target:a,onSequenceStart:s,onSequenceEnd:l}=e;if(0!==n.button)return;window.focus();let u=i.map(e=>eI(e.elements.element)),c=r.getAttribute("data-sanity-drag-flow")||((t=u).some(e=>t.filter(t=>!e$(e,t)).some(t=>e.y===t.y))?"horizontal":"vertical"),d=r.getAttribute("data-sanity-drag-group"),p=!!r.getAttribute("data-sanity-drag-minima
214p-disable"),f=!!r.getAttribute("data-sanity-drag-prevent-default"),m=r.getAttribute("data-unstable_sanity-drag-document-height"),y=r.getAttribute("data-unstable_sanity-drag-group-height"),h=null,g=eP(n),v=document.body,{minYScaled:b,scaleFactor:w}=function(e,t){let n=t||eR(e).height,r=(n+=200)>window.innerHeight?window.innerHeight/n:1,{min:i}=eR(e.map(e=>eA(e,r,{x:window.innerWidth/2,y:0})));return{scaleFactor:r,minYScaled:i-100*r}}(u,y?~~y:null),x=!1,E=!1,_=!0;eV||(eY={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}},eZ=m?~~m:document.documentElement.scrollHeight);let j=setInterval(()=>{u=i.map(e=>eI(e.elements.element))},150),k=()=>{w>=1||(o({type:"overlay/dragUpdateSkeleton",skeleton:ez(eW,r,w)}),o({type:"overlay/dragToggleMinimapPrompt",display:!1}),eL(v,w,b,o,150).then(()=>{setTimeout(()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:eD(u)})},300)}))},S=e=>{Math.abs(e.deltaY)>=10&&w<1&&!eV&&!E&&!p&&_&&(o({type:"overlay/dragToggleMinimapPrompt",display:!0}),E=!0),!e.shiftKey||eV||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),eV=!0,setTimeout(()=>{k()},50))},I=e=>{if(e.preventDefault(),eF=function(e){let t=document.body,n=window.getComputedStyle(t).transform;if("none"===n)return{x:e.x,y:e.y};let r=new DOMMatrix(n).inverse(),i=new DOMPoint(e.x,e.y).matrixTransform(r);return{x:i.x,y:i.y}}(eW=eP(e)),4>Math.abs(eC(eW,g)))return;if(!x){let e=eD(u),t=ez(eW,r,1);o({type:"overlay/dragStart",flow:c}),o({type:"overlay/dragUpdateSkeleton",skeleton:t}),o({type:"overlay/dragUpdateGroupRect",groupRect:e}),x=!0,s()}o({type:"overlay/dragUpdateCursorPosition",x:eW.x,y:eW.y}),!e.shiftKey||eV||p||(window.dispatchEvent(new CustomEvent("unstable_sanity/dragApplyMinimap")),eV=!0,setTimeout(()=>{k()},50));let t=function(e,t,n){if("horizontal"===n){let r={x1:e.x,y1:e.y,x2:e.x-1e8,y2:e.y},i={x1:e.x,y1:e.y,x2:e.x+1e8,y2:e.y};return{left:eO(r,t,n),right:eO(i,t,n)}}{let r={x1:e.x,y1:e.y,x2:e.x,y2:e.y-1e8},i={x1:e.x,y1:e.y,x2:e.x,y2:e.y+1e8};return{top:eO(r,t,n),bottom:eO(i,t,n)}}}(eW,u,c);JSON.stringify(h)!==JSON.stringify(t)&&o({type:"overlay/dragUpdateInsertPosition",insertPosition:eN(i,h=t,c)})},M=()=>{_=!1,o({type:"overlay/dragEnd",target:a,insertPosition:h?eN(i,h,c):null,dragGroup:d,flow:c,preventInsertDefault:f}),E&&o({type:"overlay/dragToggleMinimapPrompt",display:!1}),eV||(clearInterval(j),l(),R(),A()),O()},$=e=>{"Shift"===e.key&&eV&&(eV=!1,o({type:"overlay/dragUpdateSkeleton",skeleton:ez(eW,r,1/w)}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{eU(eF.y,v,eZ,o,150,eY)},50),o({type:"overlay/dragUpdateGroupRect",groupRect:null}),_||(clearInterval(j),O(),R(),A(),l()))},C=()=>{o({type:"overlay/dragUpdateGroupRect",groupRect:null}),window.dispatchEvent(new CustomEvent("unstable_sanity/dragResetMinimap")),setTimeout(()=>{eU(eF.y,v,eZ,o,150,eY).then(()=>{eV=!1})},50),clearInterval(j),O(),R(),A(),l()},O=()=>{window.removeEventListener("mousemove",I),window.removeEventListener("wheel",S),window.removeEventListener("mouseup",M)},A=()=>{window.removeEventListener("keyup",$)},R=()=>{window.removeEventListener("blur",C)};window.addEventListener("blur",C),window.addEventListener("keyup",$),window.addEventListener("wheel",S),window.addEventListener("mousemove",I),window.addEventListener("mouseup",M)}({element:v,handler:e,mouseEvent:t,overlayGroup:a,target:o,onSequenceStart:()=>{m=!0},onSequenceEnd:()=>{setTimeout(()=>{m=!1},250)}})},mousemove(e){_.mouseenter(e);let t=e.currentTarget;t&&(t.addEventListener("mouseenter",_.mouseenter),t.addEventListener("mouseleave",_.mouseleave))},mouseenter(){document.querySelector("vercel-live-feedback")&&v.closest("[data-vercel-edit-info]")||v.closest("[data-vercel-edit-target]")||(y.push(v),e({type:"element/mouseenter",id:j,rect:eI(v)}),x(v))},mouseleave(n){function r(){y.pop();let t=h();if(e({type:"element/mouseleave",id:j}),t){x(t);let n=s.get(t);n&&e({type:"element/mouseenter",id:n.id,rect:eI(t)})}E(v)}let{relatedTarget:i}=n,o=eB(i),a=t.contains(o);if(eq(o)&&a)return function e(t){let n=i=>{let{relatedTarget:o}=i;eB(o)?o&&eq(o)&&(t.removeEventListener("mouseleave",n),e(o)):(t.removeEventListener("mouseleave",n),r())};t.addEventListener("mouseleave",n)}(o);r()}},j=eS(),k={type:c,id:j,elements:d,sanity:f,handlers:_};l.add(v),u.set(w,v),a.set(j,v),s.set(v,k),p?.observe(v),e({type:"element/register",elementType:c,id:j,element:v,rect:eI(v),sanity:f,dragDisabled:!!v.getAttribute("data-sanity-drag-disable"),targets:g.map(e=>({sanity:e.sanity,element:e.elements.element}))}),o&&b(k)}(d)}}function j(t){let n=s.get(t);if(n){let{id:r,handlers:i}=n;g(t,i),d.unobserve(t),s.delete(t),l.delete(t),a.delete(r),e({type:"element/unregister",id:r})}}function k(t){let n=s.get(t);n&&e({type:"element/updateRect",id:n.id,rect:eI(t)})}function S(e){if(o)for(let t of e){let{target:e}=t,n=eq(e)&&s.get(e);n&&(t.isIntersecting?b(n):w(n))}}function I(t){let n=eB(t.target);if(n){"capture"===n.dataset.sanityOverlayElement&&(t.preventDefault(),t.stopPropagation());return}y=[],e({type:"overlay/blur"})}function M(){y=[],e({type:"overlay/reset-mouse-state"})}function $(){for(let e of l)k(e)}function C(t){"Escape"===t.key&&(y=[],e({type:"overlay/blur"}))}function O(e){let{target:t}=e;if(!(t===window.document||!eq(t)))for(let e of l)t.contains(e)&&k(e)}function A(){o||(p=new IntersectionObserver(S,{threshold:.3}
214),l.forEach(e=>p.observe(e)),e({type:"overlay/activate"}),o=!0)}function R(){o&&(p?.disconnect(),l.forEach(e=>{let t=s.get(e);t&&w(t)}),e({type:"overlay/deactivate"}),o=!1)}function T(t){let{id:n}=t.detail,r=a.get(n);if(!r)return;let i=s.get(r)?.sanity;i&&e({type:"element/click",id:n,sanity:i})}return window.document.fonts.ready.then(()=>{for(let e of l)k(e)}),window.addEventListener("click",I),window.addEventListener("contextmenu",I),window.addEventListener("sanity-overlay/exclusive-plugin-closed",M),window.addEventListener("sanity-overlay/label-click",T),window.addEventListener("keydown",C),window.addEventListener("resize",$),window.addEventListener("scroll",O,{capture:!0,passive:!0}),d=new ResizeObserver(function(e){for(let t of e){let e=t.target;if(eq(e)){let t=u.get(e);if(!t)return;k(t)}}}),(f=new MutationObserver(function(e){let n=!1;for(let r of e){let{target:e,type:i}=r,o="characterData"===i?e.parentElement:e;if(!(o===t||t.contains(o))&&(n=!0,eq(o))){let e=o.parentElement?.closest("[data-sanity-edit-group]")||null;_({childNodes:[eq(e)?e:o]})}}if(n)for(let e of l)e.isConnected||j(e),s.get(e)?.type!=="group"||e.hasAttribute("data-sanity-edit-group")||j(e)})).observe(document.body,{attributes:!0,characterData:!0,childList:!0,subtree:!0}),_(document.body),A(),{activate:A,deactivate:R,destroy:function(){window.removeEventListener("click",I),window.removeEventListener("contextmenu",I),window.removeEventListener("sanity-overlay/exclusive-plugin-closed",M),window.removeEventListener("sanity-overlay/label-click",T),window.removeEventListener("keydown",C),window.removeEventListener("resize",$),window.removeEventListener("scroll",O),f.disconnect(),d.disconnect(),l.forEach(e=>{j(e)}),a.clear(),l.clear(),y=[],R()}}}({handler:t,overlayElement:e,inFrame:n,inPopUp:r,optimisticActorReady:l}),()=>{s.current?.destroy(),s.current=void 0}},o=[e,t,n,r,l],a[0]=e,a[1]=t,a[2]=n,a[3]=r,a[4]=l,a[5]=i,a[6]=o):(i=a[5],o=a[6]),(0,h.useEffect)(i,o),s}(d,t,s,l);return i[6]!==y.current||i[7]!==c?(n=()=>{c?y.current?.activate():y.current?.deactivate()},i[6]=y.current,i[7]=c,i[8]=n):n=i[8],i[9]!==y||i[10]!==c?(r=[y,c],i[9]=y,i[10]=c,i[11]=r):r=i[11],(0,h.useEffect)(n,r),null},oh=e=>{let t,n,r,i,o,a,s,l,u,c,d,p,y,g,v,w,x,E,_,j,k,S,I,M,$;let C=(0,m.c)(76),{comlink:O,comlinkStatus:A,componentResolver:R,inFrame:T,inPopUp:N,zIndex:P}=e,L=(0,b.Bj)();C[0]===Symbol.for("react.memo_cache_sentinel")?(t={contextMenu:null,dragInsertPosition:null,dragShowMinimap:!1,dragShowMinimapPrompt:!1,dragSkeleton:null,elements:[],focusPath:"",isDragging:!1,perspective:"published",wasMaybeCollapsed:!1,dragMinimapTransition:!1,dragGroupRect:null},C[0]=t):t=C[0];let[D,U]=(0,h.useReducer)(i9,t),{contextMenu:V,dragInsertPosition:F,dragShowMinimap:W,dragShowMinimapPrompt:Z,dragSkeleton:Y,elements:q,isDragging:B,perspective:G,wasMaybeCollapsed:K,dragMinimapTransition:X,dragGroupRect:J}=D,[Q,ee]=(0,h.useState)(null),[et,en]=(0,h.useState)(!0);C[1]!==O?(n=()=>{let e=[O?.on("presentation/focus",e=>{U({type:"presentation/focus",data:e})}),O?.on("presentation/blur",e=>{U({type:"presentation/blur",data:e})}),O?.on("presentation/toggle-overlay",()=>{en(ow)})].filter(Boolean);return()=>e.forEach(ox)},r=[O],C[1]=O,C[2]=n,C[3]=r):(n=C[2],r=C[3]),(0,h.useEffect)(n,r),function(e,t){let n,r;let i=(0,m.c)(4);i[0]!==e||i[1]!==t?(n=()=>{let n=new AbortController;e?.fetch("visual-editing/fetch-perspective",void 0,{signal:n.signal,suppressWarnings:!0}).then(e=>{t({type:"presentation/perspective",data:e})}).catch(ol);let r=e?.on("presentation/perspective",e=>{t({type:"presentation/perspective",data:e})});return()=>{r?.(),n.abort()}},r=[e,t],i[0]=e,i[1]=t,i[2]=n,i[3]=r):(n=i[2],r=i[3]),(0,h.useEffect)(n,r)}(O,U),function(e,t,n){let r,i,o;let a=(0,m.c)(7),s=(0,h.useRef)(void 0);a[0]!==e?(r=(t,n)=>{e?.post("visual-editing/documents",{documents:t,perspective:n})},a[0]=e,a[1]=r):r=a[1];let l=r;a[2]!==t||a[3]!==n||a[4]!==l?(i=()=>{let e=t.map(od).filter(oc),r=new Set(e.map(ou));if(!s.current||!function(e,t){if(e===t)return!0;if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(r,s.current.nodeIds)||n!==s.current.perspective){let t=Array.from(r).map(t=>{let{type:n,projectId:r,dataset:i}=e.find(e=>e.id===t);return r&&i?{_id:t,_type:n,_projectId:r,_dataset:i}:{_id:t,_type:n}});s.current={nodeIds:r,perspective:n},l(t,n)}},o=[t,n,l],a[2]=t,a[3]=n,a[4]=l,a[5]=i,a[6]=o):(i=a[5],o=a[6]),(0,h.useEffect)(i,o)}(O,q,G),C[4]!==Q?(i=(e,t)=>{Q&&(Q.style.setProperty("--drag-preview-x",`${e}px`),Q.style.setProperty("--drag-preview-y",`${t-window.scrollY}px`))},C[4]=Q,C[5]=i):i=C[5];let er=i;C[6]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{let e=e=>{ov(e)&&en(o_)},t=e=>{ov(e)&&en(oj),["mod","\\"].every(t=>og[t]?e[og[t]]:e.key===t.toUpperCase())&&en(ok)};return window.addEventListener("click",oE),window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("click",oE),window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},a=[en],C[6]=o,C[7]=a):(o=C[6],a=C[7]),(0,h.useEffect)(o,a);let[ei,eo]=(0,h.useState)(!1),[ea,es]=(0,h.useState)(!1),el=(0,h.useRef)(void 0);C[8]!==et?(s=()=>
214{if(et)return of(()=>{eo(!0),of(()=>{es(!0),el.current=setTimeout(()=>{es(!1),eo(!1)},1500)})});el.current&&(clearTimeout(el.current),eo(!1),es(!1))},l=[et],C[8]=et,C[9]=s,C[10]=l):(s=C[9],l=C[10]),(0,h.useEffect)(s,l),C[11]!==q?(c=q.flatMap(oS),C[11]=q,C[12]=c):c=C[12],u=c,C[13]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{U({type:"overlay/blur"})},C[13]=d):d=C[13];let eu=d,ec=H()!==z;p=ec?R:void 0;e:{let t;if((T||N)&&"connected"!==A||B){let e;C[14]===Symbol.for("react.memo_cache_sentinel")?(e=[],C[14]=e):e=C[14],y=e;break e}C[15]!==O||C[16]!==p||C[17]!==X||C[18]!==W||C[19]!==q||C[20]!==T||C[21]!==B||C[22]!==ec||C[23]!==e.plugins||C[24]!==K?(t=q.filter(oI).map(t=>{let{id:n,element:r,focused:i,hovered:o,rect:a,sanity:s,dragDisabled:l,targets:u,elementType:c}=t,d=!l&&!!r.getAttribute("data-sanity")&&ec&&q.some(e=>"id"in e.sanity&&"id"in s&&e4(e.sanity,s)&&e.sanity.path!==s.path);return(0,f.jsx)(iF,{comlink:O,componentResolver:p,plugins:e.plugins,element:r,enableScrollIntoView:!B&&!X&&!W,id:n,focused:i,hovered:o,node:s,rect:a,showActions:!T,draggable:d,isDragging:B||X,wasMaybeCollapsed:i&&K,targets:u,elementType:c},n)}),C[15]=O,C[16]=p,C[17]=X,C[18]=W,C[19]=q,C[20]=T,C[21]=B,C[22]=ec,C[23]=e.plugins,C[24]=K,C[25]=t):t=C[25],y=t}let ed=y,ep=L?"dark":"light",ef=ea?"":void 0,em=ei?"":void 0;return C[26]!==u||C[27]!==G?(g=(0,f.jsx)(om,{documentIds:u,perspective:G}),C[26]=u,C[27]=G,C[28]=g):g=C[28],C[29]!==O||C[30]!==T||C[31]!==N||C[32]!==et||C[33]!==Q||C[34]!==er?(v=(0,f.jsx)(oy,{comlink:O,dispatch:U,inFrame:T,inPopUp:N,onDrag:er,overlayEnabled:et,rootElement:Q}),C[29]=O,C[30]=T,C[31]=N,C[32]=et,C[33]=Q,C[34]=er,C[35]=v):v=C[35],C[36]!==V?(w=V&&(0,f.jsx)(iC,{...V,onDismiss:eu}),C[36]=V,C[37]=w):w=C[37],C[38]!==J||C[39]!==F||C[40]!==X||C[41]!==Z||C[42]!==B?(x=B&&!X&&(0,f.jsxs)(f.Fragment,{children:[F&&(0,f.jsx)(iQ,{dragInsertPosition:F}),Z&&(0,f.jsx)(i5,{}),J&&(0,f.jsx)(iJ,{dragGroupRect:J})]}),C[38]=J,C[39]=F,C[40]=X,C[41]=Z,C[42]=B,C[43]=x):x=C[43],C[44]!==Y||C[45]!==B?(E=B&&Y&&(0,f.jsx)(i1,{skeleton:Y}),C[44]=Y,C[45]=B,C[46]=E):E=C[46],C[47]!==ed||C[48]!==ef||C[49]!==em||C[50]!==g||C[51]!==v||C[52]!==w||C[53]!==x||C[54]!==E||C[55]!==P?(_=(0,f.jsxs)(op,{"data-fading-out":ef,"data-overlays":em,ref:ee,$zIndex:P,children:[g,v,w,ed,x,E]}),C[47]=ed,C[48]=ef,C[49]=em,C[50]=g,C[51]=v,C[52]=w,C[53]=x,C[54]=E,C[55]=P,C[56]=_):_=C[56],C[57]!==O||C[58]!==_?(j=(0,f.jsx)(oi,{comlink:O,children:_}),C[57]=O,C[58]=_,C[59]=j):j=C[59],C[60]!==O||C[61]!==j?(k=(0,f.jsx)(i8,{comlink:O,children:j}),C[60]=O,C[61]=j,C[62]=k):k=C[62],C[63]!==O||C[64]!==q||C[65]!==k?(S=(0,f.jsx)(ot,{comlink:O,elements:q,children:k}),C[63]=O,C[64]=q,C[65]=k,C[66]=S):S=C[66],C[67]!==Q||C[68]!==S?(I=(0,f.jsx)(b.li,{children:(0,f.jsx)(b.Xp,{element:Q,children:S})}),C[67]=Q,C[68]=S,C[69]=I):I=C[69],C[70]!==ep||C[71]!==I?(M=(0,f.jsx)(b.f6,{scheme:ep,theme:b.Lg,tone:"transparent",children:I}),C[70]=ep,C[71]=I,C[72]=M):M=C[72],C[73]!==O||C[74]!==M?($=(0,f.jsx)(os,{comlink:O,children:M}),C[73]=O,C[74]=M,C[75]=$):$=C[75],$},og={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function ov(e){return"Alt"===e.key}function ob(e,t){return e.filter(e=>e!==t)}function ow(e){return!e}function ox(e){return e()}function oE(e){let t=e.target;if(((0,b.bg)(t)||(0,b.Re)(t)&&t.closest("a"))&&e.altKey){e.preventDefault(),e.stopPropagation();let t=new MouseEvent(e.type,{...e,altKey:!1,bubbles:!0,cancelable:!0});e.target?.dispatchEvent(t)}}function o_(e){return!e}function oj(e){return!e}function ok(e){return!e}function oS(e){return"id"in e.sanity?[e.sanity.id]:[]}function oI(e){return e.activated||e.focused}let oM=e=>{let t,n;let r=(0,m.c)(4),{comlink:i,refresh:o}=e,a=(0,h.useRef)(0),s=(0,h.useRef)(0);return r[0]!==i||r[1]!==o?(t=()=>i.on("presentation/refresh",e=>{if("manual"===e.source){clearTimeout(a.current);let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e);let n=!1;a.current=window.setTimeout(()=>{i.post("visual-editing/refreshed",e),n=!0},3e3),t?.finally?.(()=>{n||(clearTimeout(a.current),i.post("visual-editing/refreshed",e))})}else if("mutation"===e.source){clearTimeout(s.current);
214let t=o(e);if(!1===t)return;i.post("visual-editing/refreshing",e),s.current=window.setTimeout(()=>{let t=o(e);!1!==t&&(i.post("visual-editing/refreshing",e),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e))},1e3),t?.finally?.(()=>{i.post("visual-editing/refreshed",e)})||i.post("visual-editing/refreshed",e)}}),n=[i,o],r[0]=i,r[1]=o,r[2]=t,r[3]=n):(t=r[2],n=r[3]),(0,h.useEffect)(t,n),null};function o$(e){let{data:t,origin:n}=e;t&&"object"==typeof t&&"domain"in t&&"sanity/channels"===t.domain&&"from"in t&&"presentation"===t.from&&"type"in t&&"presentation/status"===t.type&&window.parent.postMessage({domain:"sanity/channels",type:"visual-editing/status",data:{origin:location.origin}},n)}function oC(){console.warn("[@sanity/visual-editing] Package version mismatch detected: Please update your Sanity studio to prevent potential compatibility issues.")}function oO(){}let oA=e=>{let t,n,r,i,o,a,s,l;let u=(0,m.c)(23),{components:c,plugins:d,history:p,portal:v,refresh:b,zIndex:w}=e,x=void 0===v||v,[E,_]=(0,h.useState)(null),[j,k]=(0,h.useState)(null);u[0]===Symbol.for("react.memo_cache_sentinel")?(t=()=>{_((0,y.el)()),k((0,y.Ax)())},n=[],u[0]=t,u[1]=n):(t=u[0],n=u[1]),(0,h.useEffect)(t,n);let[S,I]=(0,h.useState)(null);u[2]!==x?(r=()=>{if(!1===x)return;let e=document.createElement("sanity-visual-editing");return document.documentElement.appendChild(e),I(e),()=>{I(null),document.documentElement.contains(e)&&document.documentElement.removeChild(e)}},i=[x],u[2]=x,u[3]=r,u[4]=i):(r=u[3],i=u[4]),(0,h.useEffect)(r,i);let[M,$]=function(e){let t,n,r,i,o;let a=(0,m.c)(9),s=void 0===e||e,[l,u]=(0,h.useState)(),[c,d]=(0,h.useState)("idle");return a[0]!==s?(t=()=>{if(!s)return;let e=(0,tg.dS)({name:"visual-editing",connectTo:"presentation"},(0,tg.zB)().provide({actors:(0,y.XP)()})),t=e.onStatus(()=>d("connected"),"connected");u(e);let n=e.start();return()=>{t(),n(),u(void 0)}},n=[s],a[0]=s,a[1]=t,a[2]=n):(t=a[1],n=a[2]),(0,h.useEffect)(t,n),a[3]!==c?(r=()=>{if("connected"===c)return;let e=new AbortController;return window.addEventListener("message",o$,{signal:e.signal}),()=>{e.abort()}},i=[c],a[3]=c,a[4]=r,a[5]=i):(r=a[4],i=a[5]),(0,h.useEffect)(r,i),a[6]!==l||a[7]!==c?(o=[l,c],a[6]=l,a[7]=c,a[8]=o):o=a[8],o}(!0===E||!0===j);!function(e){let t,n;let r=(0,m.c)(3);r[0]!==e?(t=()=>{if(!e)return;let t=function(e){let t=new tb.t(1),n=new tw.x;return e.fetch("visual-editing/snapshot-welcome",void 0,{suppressWarnings:!0}).then(e=>{t.next(e.event)}).catch(()=>{}
214),e.on("presentation/snapshot-event",e=>{"reconnect"===e.event.type&&t.next(e.event),"mutation"===e.event.type&&n.next(e.event)}),(0,tx.T)(t,n)}(e),n=iy(e),r=(0,tv.c)(n,{input:{client:{withConfig:oO},sharedListener:t}});r.start();let i=new AbortController;return e.fetch("visual-editing/features",void 0,{signal:i.signal,suppressWarnings:!0}).then(e=>{e.features.optimistic&&function(e){for(let t of(L=e,D))t()}(r)}).catch(oC),()=>{r.stop(),i.abort()}},n=[e],r[0]=e,r[1]=t,r[2]=n):(t=r[1],n=r[2]),(0,h.useEffect)(t,n)}("connected"===$?M:void 0),u[5]!==M||u[6]!==$||u[7]!==c||u[8]!==E||u[9]!==j||u[10]!==d||u[11]!==w?(o=null!==E&&null!==j&&(0,f.jsx)(oh,{comlink:M,comlinkStatus:$,componentResolver:c,plugins:d,inFrame:E,inPopUp:j,zIndex:w}),u[5]=M,u[6]=$,u[7]=c,u[8]=E,u[9]=j,u[10]=d,u[11]=w,u[12]=o):o=u[12],u[13]!==M||u[14]!==p||u[15]!==b?(a=M&&(0,f.jsxs)(f.Fragment,{children:[(0,f.jsx)(ih,{comlink:M,history:p}),(0,f.jsx)(ig,{comlink:M}),b&&(0,f.jsx)(oM,{comlink:M,refresh:b})]}),u[13]=M,u[14]=p,u[15]=b,u[16]=a):a=u[16],u[17]!==o||u[18]!==a?(s=(0,f.jsxs)(f.Fragment,{children:[o,a]}),u[17]=o,u[18]=a,u[19]=s):s=u[19];let C=s;return!1!==x&&S?(u[20]!==C||u[21]!==S?(l=(0,g.createPortal)(C,S),u[20]=C,u[21]=S,u[22]=l):l=u[22],l):C};oA.displayName="VisualEditing";var oR=n(99376);n(83079);var oT=(0,n(12119).$)("77ef1e4b8a1e122d5b22cc4e02c0ac32ae04d3a1");function oN(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n<t);return r||t>-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}function oP(e,t){if(!function(e,t){if("string"!=typeof e)return!1;let{pathname:n}=oN(e);return n===t||n.startsWith(`${t}/`)}(e,t))return e;let n=e.slice(t.length);return n.startsWith("/")?n:`/${n}`}let oz=(e,t)=>{let{pathname:n,query:r,hash:i}=oN(e);return t?n.endsWith("/")?`${n}${r}${i}`:`${n}/${r}${i}`:`${n.replace(/\/$/,"")||"/"}${r}${i}`};function oL(e){let{basePath:t="",plugins:n,components:r,refresh:i,trailingSlash:o=!1,zIndex:a}=e,s=(0,oR.useRouter)(),l=(0,h.useRef)(s),[u,c]=(0,h.useState)();(0,h.useEffect)(()=>{l.current=s},[s]);let d=(0,h.useMemo)(()=>({subscribe:e=>(c(()=>e),()=>c(void 0)),update:e=>{switch(e.type){case"push":return l.current.push(oP(e.url,t));case"pop":return l.current.back();case"replace":return l.current.replace(oP(e.url,t));default:throw Error(`Unknown update type: ${e.type}`)}}}),[t]),p=(0,oR.usePathname)(),m=(0,oR.useSearchParams)();(0,h.useEffect)(()=>{u&&u({type:"push",url:oz(function(e,t){if(!e.startsWith("/")||!t)return e;if("/"===e&&t)return t;let{pathname:n,query:r,hash:i}=oN(e);return`${t}${n}${r}${i}`}(`${p}${m?.size?`?${m}`:""}`,t),o)})},[t,u,p,m,o]);let y=(0,h.useCallback)(e=>{if(i)return i(e);switch(e.source){case"manual":return e.livePreviewEnabled?(console.debug("Live preview is setup, calling router.refresh() to refresh the server components without refetching cached data"),l.current.refresh(),Promise.resolve()):(console.debug("No loaders in live mode detected, or preview kit setup, revalidating root layout"),oT());case"mutation":return e.livePreviewEnabled?(console.debug("Live preview is setup, mutation is skipped assuming its handled by the live preview"),!1):(console.debug("No loaders in live mode detected, or preview kit setup, revalidating root layout"),oT());default:throw Error("Unknown refresh source",{cause:e})}},[i]);return(0,f.jsx)(oA,{plugins:n,components:r,history:d,portal:!0,refresh:y,zIndex:a})}}}]);

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.