PageSourceSearch

https://collected-nextjs-portfolio-template.vercel.app/_next/static/chunks/4989.e878f0864ad67205.js

js collected-nextjs-portfolio-template.vercel.app collected 2026-10-03 06:30:52 UTC 171,378 bytes, 61 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4989],{59731:function(e){e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(s=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,s[i]))return!1;for(i=n;0!=i--;){var n,i,s,o=s[i];if(!e(t[o],r[o]))return!1}return!0}return t!=t&&r!=r}},11726:function(e,t,r){r.d(t,{BB:function(){return c},F5:function(){return E},Mx:function(){return k},U2:function(){return u},Vq:function(){return T},XL:function(){return x},dK:function(){return S},eT:function(){return p},lV:function(){return function e(t,r,n=[]){if(null!==t&&Array.isArray(t))return t.map((t,i)=>{if(A(t)){let s=t._key;if("string"==typeof s)return e(t,r,n.concat({_key:s,_index:i}))}return e(t,r,n.concat(i))});if(A(t)){if("block"===t._type||"span"===t._type){let i={...t};return"block"===t._type?i.children=e(t.children,r,n.concat("children")):"span"===t._type&&(i.text=e(t.text,r,n.concat("text"))),i}return Object.fromEntries(Object.entries(t).map(([t,i])=>[t,e(i,r,n.concat(t))]))}return r(t,n)}},qy:function(){return y},tZ:function(){return C},vs:function(){return b},wC:function(){return j}});let n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/_key\s*==\s*['"](.*)['"]/,s=/^\d*:\d*$/;function o(e){return"number"==typeof e||"string"==typeof e&&/^\[\d+\]$/.test(e)}function a(e){return"string"==typeof e?i.test(e.trim()):"object"==typeof e&&"_key"in e}function l(e){if("string"==typeof e&&s.test(e))return!0;if(!Array.isArray(e)||2!==e.length)return!1;let[t,r]=e;return("number"==typeof t||""===t)&&("number"==typeof r||""===r)}function u(e,t,r){let n="string"==typeof t?d(t):t;if(!Array.isArray(n))throw Error("Path must be an array or a string");let i=e;for(let e=0;e<n.length;e++){let t=n[e];if(o(t)){if(!Array.isArray(i))return r;i=i[t]}if(a(t)){if(!Array.isArray(i))return r;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 r}return i}function c(e){if(!Array.isArray(e))throw Error("Path is not an array");return e.reduce((e,t,r)=>{let n=typeof t;if("number"===n)return`${e}[${t}]`;if("string"===n)return`${e}${0===r?"":"."}${t}`;if(a(t)&&t._key)return`${e}[_key=="${t._key}"]`;if(Array.isArray(t)){let[r,n]=t;return`${e}[${r}:${n}]`}throw Error(`Unsupported path segment \`${JSON.stringify(t)}\``)},"")}function d(e){if("string"!=typeof e)throw Error("Path is not a string");let t=e.match(n);if(!t)throw Error("Invalid path string");return t.map(h)}function h(e){return o(e)?Number(e.replace(/[^\d]/g,"")):a(e)?{_key:e.match(i)[1]}:l(e)?function(e){let[t,r]=e.split(":").map(e=>""===e?e:Number(e));return[t,r]}(e):e}var p=Object.freeze({__proto__:null,fromString:d,get:u,isIndexSegment:o,isIndexTuple:l,isKeySegment:a,reKeySegment:i,toString:c});let f="drafts.",m="versions.";function v(e){return e.startsWith(f)}function g(e){return e.startsWith(m)}function y(e){return g(e)?f+b(e):v(e)?e:f+e}function x(e,t){if("drafts"===t||"published"===t)throw Error('Version can not be "published" or "drafts"');return`${m}${t}.${b(e)}`}function b(e){return g(e)?e.split(".").slice(2).join("."):v(e)?e.slice(f.length):e}let w={"\f":"\\f","\n":"\\n","\r":"\\r","	":"\\t","'":"\\'","\\":"\\\\"},P={"\\f":"\f","\\n":`
2`,"\\r":"\r","\\t":"	","\\'":"'","\\\\":"\\"};function E(e){let t;let r=[],n=/\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;for(;null!==(t=n.exec(e));){if(void 0!==t[1]){let e=t[1].replace(/\\(\\|f|n|r|t|')/g,e=>P[e]);r.push(e);continue}if(void 0!==t[2]){r.push(parseInt(t[2],10));continue}if(void 0!==t[3]){let e=t[3].replace(/\\(\\')/g,e=>P[e]);r.push({_key:e,_index:-1});continue}}return r}function j(e){return e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(""!==e._key)return{_key:e._key};if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)})}function S(e){return("string"==typeof e?d(e):e).map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(Array.isArray(e))throw Error(`IndexTuple segments aren't supported:${JSON.stringify(e)}`);
2if("object"==typeof e&&"_key"in e&&"_index"in e)return e;if(e._key)return{_key:e._key,_index:-1};throw Error(`invalid segment:${JSON.stringify(e)}`)})}function k(e,t){var r;if(!t?.mappings)return;let n=(r=e.map(e=>{if("string"==typeof e||"number"==typeof e)return e;if(-1!==e._index)return e._index;throw Error(`invalid segment:${JSON.stringify(e)}`)}),`$${r.map(e=>"string"==typeof e?`['${e.replace(/[\f\n\r\t'\\]/g,e=>w[e])}']`:"number"==typeof e?`[${e}]`:""!==e._key?`[?(@._key=='${e._key.replace(/['\\]/g,e=>w[e])}')]`:`[${e._index}]`).join("")}`);if(void 0!==t.mappings[n])return{mapping:t.mappings[n],matchedPath:n,pathSuffix:""};let i=Object.entries(t.mappings).filter(([e])=>n.startsWith(e)).sort(([e],[t])=>t.length-e.length);if(0==i.length)return;let[s,o]=i[0],a=n.substring(s.length);return{mapping:o,matchedPath:s,pathSuffix:a}}function A(e){return"object"==typeof e&&null!==e}function C(e){let{baseUrl:t,workspace:r="default",tool:n="default",id:i,type:s,path:o,projectId:a,dataset:l}=e;if(!t)throw Error("baseUrl is required");if(!o)throw Error("path is required");if(!i)throw Error("id is required");if("/"!==t&&t.endsWith("/"))throw Error("baseUrl must not end with a slash");let u="default"===r?void 0:r,d="default"===n?void 0:n,h=b(i),p=Array.isArray(o)?c(j(o)):o,f=new URLSearchParams({baseUrl:t,id:h,type:s,path:p});if(u&&f.set("workspace",u),d&&f.set("tool",d),a&&f.set("projectId",a),l&&f.set("dataset",l),v(i)||g(i)){if(g(i)){let e=function(e){if(!g(e))return;let[t,r,...n]=e.split(".");return r}(i);f.set("perspective",e)}}else f.set("perspective","published");let m=["/"===t?"":t];u&&m.push(u);let y=["mode=presentation",`id=${h}`,`type=${s}`,`path=${encodeURIComponent(p)}`];return d&&y.push(`tool=${d}`),m.push("intent","edit",`${y.join(";")}?${f}`),m.join("/")}function T(e){let{resultSourceMap:t,resultPath:r}=e,{mapping:n,pathSuffix:i}=k(r,t)||{};if(!n||"literal"===n.source.type||"unknown"===n.source.type)return;let s=t.documents[n.source.document],o=t.paths[n.source.path];if(s&&o){var a;let t;let{baseUrl:r,workspace:n,tool:l}=("/"!==(t="string"==typeof(a="function"==typeof e.studioUrl?e.studioUrl(s):e.studioUrl)?a:a.baseUrl)&&(t=t.replace(/\/$/,"")),"string"==typeof a?{baseUrl:t}:{...a,baseUrl:t});if(!r)return;let{_id:u,_type:c,_projectId:d,_dataset:h}=s;return{baseUrl:r,workspace:n,tool:l,id:u,type:c,path:E(o+i),projectId:d,dataset:h}}}},43328:function(e,t,r){r.d(t,{D:function(){return a},u:function(){return l}});var n=r(26705),i=r(59731),s=r(20955);let o=(0,s.createContext)(null);function a(e){let{children:t,setDisplayedDocument:r,documentId:a}=e,l=(0,s.useCallback)(e=>r(t=>i(t,e)?t:e),[r]);return(0,s.useEffect)(()=>{if(a)return;let e=setTimeout(()=>r(null));return()=>clearTimeout(e)},[a,r]),(0,n.jsx)(o.Provider,{value:l,children:t})}function l(){return(0,s.useContext)(o)}},94989:function(e,t,r){let n,i,s;r.r(t),r.d(t,{default:function(){return o1}});var o,a,l,u,c,d,h=r(26705),p=r(11726),f=r(31031),m=r(20955),v=r(88477),g=r(83826),y=r(2100),x=r(94168),b=r(51751),w=r(77844),P=r(71613),E=r(43328);let j="sanity.previewUrlSecret",S="sanity-preview-secret",k="sanity-preview-pathname",A=`*[_type == "${j}" && dateTime(_updatedAt) <= dateTime(now()) - 3600]`,C=(0,m.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"}),T=(0,m.createContext)({}),M=(0,m.createContext)(null),R="undefined"!=typeof document,V=R?m.useLayoutEffect:m.useEffect,D=(0,m.createContext)({strict:!1}),L=e=>e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),O="data-"+L("framerAppearId"),I={skipAnimations:!1,useManualTiming:!1};class ${constructor(){this.order=[],this.scheduled=new Set}add(e){if(!this.scheduled.has(e))return this.scheduled.add(e),this.order.push(e),!0}remove(e){let t=this.order.indexOf(e);-1!==t&&(this.order.splice(t,1),this.scheduled.delete(e))}clear(){this.order.length=0,this.scheduled.clear()}}let F=["prepare","read","update","preRender","render","postRender"];function U(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=F.reduce((e,t)=>(e[t]=function(e){let t=new $,r=new $,n=0,i=!1,s=!1,o=new WeakSet,a={schedule:(e,s=!1,a=!1)=>{let l=a&&i,u=l?t:r;return s&&o.add(e),u.add(e)&&l&&i&&(n=t.order.length),e},cancel:e=>{r.remove(e),o.delete(e)},process:l=>{if(i){s=!0;return}if(i=!0,[t,r]=[r,t],r.clear(),n=t.order.length)for(let r=0;r<n;r++){let n=t.order[r];o.has(n)&&(a.schedule(n),e()),n(l)}i=!1,s&&(s=!1,a.process(l))}};return a}(()=>r=!0),e),{}),o=e=>{s[e].process(i)},a=()=>{let s=I.useManualTiming?i.timestamp:performance.now();r=!1,i.delta=n?1e3/60:Math.max(Math.min(s-i.timestamp,40),1),i.timestamp=s,i.isProcessing=!0,F.forEach(o),i.isProcessing=!1,r&&t&&(n=!1,e(a))},l=()=>{r=!0,n=!0,i.isProcessing||e(a)};return{schedule:F.reduce((e,t)=>
2{let n=s[t];return e[t]=(e,t=!1,i=!1)=>(r||l(),n.schedule(e,t,i)),e},{}),cancel:e=>F.forEach(t=>s[t].cancel(e)),state:i,steps:s}}let{schedule:_,cancel:z}=U(queueMicrotask,!1);function B(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function N(e){return"string"==typeof e||Array.isArray(e)}function W(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}let H=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],q=["initial",...H];function G(e){return W(e.animate)||q.some(t=>N(e[t]))}function K(e){return!!(G(e)||e.variants)}function Z(e){return Array.isArray(e)?e.join(" "):e}let X={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Y={};for(let e in X)Y[e]={isEnabled:t=>X[e].some(e=>!!t[e])};let J=(0,m.createContext)({}),Q=(0,m.createContext)({}),ee=Symbol.for("motionComponentSymbol"),et=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function er(e){if("string"!=typeof e||e.includes("-"));else if(et.indexOf(e)>-1||/[A-Z]/.test(e))return!0;return!1}let en={},ei=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],es=new Set(ei);function eo(e,{layout:t,layoutId:r}){return es.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!en[e]||"opacity"===e)}let ea=e=>!!(e&&e.getVelocity),el={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eu=ei.length,ec=e=>t=>"string"==typeof t&&t.startsWith(e),ed=ec("--"),eh=ec("var(--"),ep=e=>!!eh(e)&&ef.test(e.split("/*")[0].trim()),ef=/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?
2:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)$/i,em=(e,t)=>t&&"number"==typeof e?t.transform(e):e,ev=(e,t,r)=>r>t?t:r<e?e:r,eg={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},ey={...eg,transform:e=>ev(0,1,e)},ex={...eg,default:1},eb=e=>Math.round(1e5*e)/1e5,ew=/(-)?([\d]*\.?[\d])+/g,eP=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,eE=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function ej(e){return"string"==typeof e}let eS=e=>({test:t=>ej(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ek=eS("deg"),eA=eS("%"),eC=eS("px"),eT=eS("vh"),eM=eS("vw"),eR={...eA,parse:e=>eA.parse(e)/100,transform:e=>eA.transform(100*e)},eV={...eg,transform:Math.round},eD={borderWidth:eC,borderTopWidth:eC,borderRightWidth:eC,borderBottomWidth:eC,borderLeftWidth:eC,borderRadius:eC,radius:eC,borderTopLeftRadius:eC,borderTopRightRadius:eC,borderBottomRightRadius:eC,borderBottomLeftRadius:eC,width:eC,maxWidth:eC,height:eC,maxHeight:eC,size:eC,top:eC,right:eC,bottom:eC,left:eC,padding:eC,paddingTop:eC,paddingRight:eC,paddingBottom:eC,paddingLeft:eC,margin:eC,marginTop:eC,marginRight:eC,marginBottom:eC,marginLeft:eC,rotate:ek,rotateX:ek,rotateY:ek,rotateZ:ek,scale:ex,scaleX:ex,scaleY:ex,scaleZ:ex,skew:ek,skewX:ek,skewY:ek,distance:eC,translateX:eC,translateY:eC,translateZ:eC,x:eC,y:eC,z:eC,perspective:eC,transformPerspective:eC,opacity:ey,originX:eR,originY:eR,originZ:eC,zIndex:eV,fillOpacity:ey,strokeOpacity:ey,numOctaves:eV};function eL(e,t,r,n){let{style:i,vars:s,transform:o,transformOrigin:a}=e,l=!1,u=!1,c=!0;for(let e in t){let r=t[e];if(ed(e)){s[e]=r;continue}let n=eD[e],d=em(r,n);if(es.has(e)){if(l=!0,o[e]=d,!c)continue;r!==(n.default||0)&&(c=!1)}else e.startsWith("origin")?(u=!0,a[e]=d):i[e]=d}if(!t.transform&&(l||n?i.transform=function(e,{enableHardwareAcceleration:t=!0,allowTransformNone:r=!0},n,i){let s="";for(let t=0;t<eu;t++){let r=ei[t];if(void 0!==e[r]){let t=el[r]||r;s+=`${t}(${e[r]}) `}}return t&&!e.z&&(s+="translateZ(0)"),s=s.trim(),i?s=i(e,n?"":s):r&&n&&(s="none"),s}(e.transform,r,c,n):i.transform&&(i.transform="none")),u){let{originX:e="50%",originY:t="50%",originZ:r=0}=a;i.transformOrigin=`${e} ${t} ${r}`}}let eO=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function eI(e,t,r){for(let n in t)ea(t[n])||eo(n,r)||(e[n]=t[n])}let e$=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function eF(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||e$.has(e)}let eU=e=>!eF(e);function e_(e){e&&(eU=t=>t.startsWith("on")?!eF(t):e(t))}try{e_(require("@emotion/is-prop-valid").default)}catch(e){}function ez(e,t,r){return"string"==typeof e?e:eC.transform(t+r*e)}let eB={offset:"stroke-dashoffset",array:"stroke-dasharray"},eN={offset:"strokeDashoffset",array:"strokeDasharray"};function eW(e,{attrX:t,attrY:r,attrScale:n,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(eL(e,u,c,h),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:p,style:f,dimensions:m}=e;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==i||void 0!==s||f.transform)&&(f.transformOrigin=function(e,t,r){let n=ez(t,e.x,e.width),i=ez(r,e.y,e.height);return`${n} ${i}`}(m,void 0!==i?i:.5,void 0!==s?s:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==o&&function(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?eB:eN;e[s.offset]=eC.transform(-n);let o=eC.transform(t),a=eC.transform(r);e[s.array]=`${o} ${a}`}(p,o,a,l,!1)}let eH=()=>({...eO(),attrs:{}}),eq=e=>"string"==typeof e&&"svg"===e.toLowerCase();function eG(e,{style:t,vars:r},n,i){for(let s in Object.assign(e.style,t,i&&i.getProjectionStyles(n)),r)e.style.setProperty(s,r[s])}let eK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function eZ(e,t,r,n){for(let r in eG(e,t,void 0,n),t.attrs)e.setAttribute(eK.has(r)?r:L(r),t.attrs[r])}function eX(e,t){let{style:r}=e,n={};for(let i in r)(ea(r[i])||t.style&&ea(t.style[i])||eo(i,e))&&(n[i]=r[i]);return n}function eY(e,t){let r=eX(e,t);for(let n in e)(ea(e[n])||ea(t[n]))&&(r[-1!==ei.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function eJ(e,t,r,n={},i={}){return"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),"string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t&&(t=t(void 0!==r?r:e.custom,n,i)),t}function eQ(e){let t=(0,m.useRef)(null);return null===t.current&&(t.current=e()),t.current}let e0=e=>Array.isArray(e),e1=e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue),e2=e=>e0(e)?e[e.length-1]||0:e;function e5(e){let t=ea(e)?e.get():e;return e1(t)?t.toValue():t}let e3=e=>(t,r)=>{let n=(0,m.useContext)(T),i=(0,m.useContext)(M),s=()=>(function({scrapeMotionValuesFromProps:e,createRenderState:t,onMount:r},n,i,s){let o={latestValues:function(e,t,r,n){let i={},s=n(e,{});for(let e in s)i[e]=e5(s[e]);let{initial:o,animate:a}=e,l=G(e),u=K(e);t&&u&&!l&&!1!==e.inherit&&(void 0===o&&(o=t.initial),void 0===a&&(a=t.animate));let c=!!r&&!1===r.initial,d=(c=c||!1===o)?a:o;return d&&"boolean"!=typeof d&&!W(d)&&(Array.isArray(d)?d:[d]).forEac
2h(t=>{let r=eJ(e,t);if(!r)return;let{transitionEnd:n,transition:s,...o}=r;for(let e in o){let t=o[e];if(Array.isArray(t)){let e=c?t.length-1:0;t=t[e]}null!==t&&(i[e]=t)}for(let e in n)i[e]=n[e]}),i}(n,i,s,e),renderState:t()};return r&&(o.mount=e=>r(n,e,o)),o})(e,t,n,i);return r?s():eQ(s)},e9=e=>e,{schedule:e4,cancel:e6,state:e8,steps:e7}=U("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:e9,!0),te={useVisualState:e3({scrapeMotionValuesFromProps:eY,createRenderState:eH,onMount:(e,t,{renderState:r,latestValues:n})=>{e4.read(()=>{try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){r.dimensions={x:0,y:0,width:0,height:0}}}),e4.render(()=>{eW(r,n,{enableHardwareAcceleration:!1},eq(t.tagName),e.transformTemplate),eZ(t,r)})}})},tt={useVisualState:e3({scrapeMotionValuesFromProps:eX,createRenderState:eO})};function tr(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}let tn=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function ti(e,t="page"){return{point:{x:e[t+"X"],y:e[t+"Y"]}}}let ts=e=>t=>tn(t)&&e(t,ti(t));function to(e,t,r,n){return tr(e,t,ts(r),n)}let ta=(e,t)=>r=>t(e(r)),tl=(...e)=>e.reduce(ta);function tu(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}let tc=tu("dragHorizontal"),td=tu("dragVertical");function th(e){let t=!1;if("y"===e)t=td();else if("x"===e)t=tc();else{let e=tc(),r=td();e&&r?t=()=>{e(),r()}
2:(e&&e(),r&&r())}return t}function tp(){let e=th(!0);return!e||(e(),!1)}class tf{constructor(e){this.isMounted=!1,this.node=e}update(){}}function tm(e,t){let r="onHover"+(t?"Start":"End");return to(e.current,"pointer"+(t?"enter":"leave"),(n,i)=>{if("touch"===n.pointerType||tp())return;let s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t),s[r]&&e4.update(()=>s[r](n,i))},{passive:!e.getProps()[r]})}class tv extends tf{mount(){this.unmount=tl(tm(this.node,!0),tm(this.node,!1))}unmount(){}}class tg extends tf{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=tl(tr(this.node.current,"focus",()=>this.onFocus()),tr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let ty=(e,t)=>!!t&&(e===t||ty(e,t.parentElement));function tx(e,t){if(!t)return;let r=new PointerEvent("pointer"+e);t(r,ti(r))}class tb extends tf{constructor(){super(...arguments),this.removeStartListeners=e9,this.removeEndListeners=e9,this.removeAccessibleListeners=e9,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();let r=this.node.getProps(),n=to(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;let{onTap:r,onTapCancel:n,globalTapTarget:i}=this.node.getProps();e4.update(()=>{i||ty(this.node.current,e.target)?r&&r(e,t):n&&n(e,t)})},{passive:!(r.onTap||r.onPointerUp)}),i=to(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=tl(n,i),this.startPress(e,t)},this.startAccessiblePress=()=>{let e=tr(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=tr(this.node.current,"keyup",e=>{"Enter"===e.key&&this.checkPressEnd()&&tx("up",(e,t)=>{let{onTap:r}=this.node.getProps();r&&e4.update(()=>r(e,t))})}),tx("down",(e,t)=>{this.startPress(e,t)}))}),t=tr(this.node.current,"blur",()=>{this.isPressing&&tx("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=tl(e,t)}}startPress(e,t){this.isPressing=!0;let{onTapStart:r,whileTap:n}=this.node.getProps();n&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&e4.update(()=>r(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!tp()}cancelPress(e,t){if(!this.checkPressEnd())return;let{onTapCancel:r}=this.node.getProps();r&&e4.update(()=>r(e,t))}mount(){let e=this.node.getProps(),t=to(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=tr(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=tl(t,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let tw=new WeakMap,tP=new WeakMap,tE=e=>{let t=tw.get(e.target);t&&t(e)},tj=e=>{e.forEach(tE)},tS={some:0,all:1};class tk extends tf{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:i}=e,s={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:tS[n]};return function(e,t,r){let n=function({root:e,...t}){let r=e||document;tP.has(r)||tP.set(r,{});let n=tP.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(tj,{root:e,...t})),n[i]}(t);return tw.set(e,r),n.observe(e),()=>{tw.delete(e),n.unobserve(e)}}(this.node.current,s,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),s=t?r:n;s&&s(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}function tA(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function tC(e,t,r){let n=e.getProps();return eJ(n,t,void 0!==r?r:n.custom,function(e){let t={};
2return e.values.forEach((e,r)=>t[r]=e.get()),t}(e),function(e){let t={};return e.values.forEach((e,r)=>t[r]=e.getVelocity()),t}(e))}let tT=e=>1e3*e,tM=e=>e/1e3,tR={current:!1},tV=e=>Array.isArray(e)&&"number"==typeof e[0],tD=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,tL={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:tD([0,.65,.55,1]),circOut:tD([.55,0,1,.45]),backIn:tD([.31,.01,.66,-.59]),backOut:tD([.33,1.53,.69,.99])},tO=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function tI(e,t,r,n){if(e===t&&r===n)return e9;let i=t=>(function(e,t,r,n,i){let s,o;let a=0;do(s=tO(o=t+(r-t)/2,n,i)-e)>0?r=o:t=o;while(Math.abs(s)>1e-7&&++a<12);return o})(t,0,1,e,r);return e=>0===e||1===e?e:tO(i(e),t,n)}let t$=tI(.42,0,1,1),tF=tI(0,0,.58,1),tU=tI(.42,0,.58,1),t_=e=>Array.isArray(e)&&"number"!=typeof e[0],tz=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tB=e=>t=>1-e(1-t),tN=e=>1-Math.sin(Math.acos(e)),tW=tB(tN),tH=tz(tN),tq=tI(.33,1.53,.69,.99),tG=tB(tq),tK=tz(tG),tZ={linear:e9,easeIn:t$,easeInOut:tU,easeOut:tF,circIn:tN,circInOut:tH,circOut:tW,backIn:tG,backInOut:tK,backOut:tq,anticipate:e=>(e*=2)<1?.5*tG(e):.5*(2-Math.pow(2,-10*(e-1)))},tX=e=>{if(Array.isArray(e)){e9(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,r,n,i]=e;return tI(t,r,n,i)}return"string"==typeof e?(e9(void 0!==tZ[e],`Invalid easing type '${e}'`),tZ[e]):e},tY=(e,t,r)=>{let n=t-e;return 0===n?1:(r-e)/n},tJ=(e,t,r)=>e+(t-e)*r;function tQ(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}let t0=(e,t)=>r=>!!(ej(r)&&eE.test(r)&&r.startsWith(e)||t&&Object.prototype.hasOwnProperty.call(r,t)),t1=(e,t,r)=>n=>{if(!ej(n))return n;let[i,s,o,a]=n.match(ew);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},t2=e=>ev(0,255,e),t5={...eg,transform:e=>Math.round(t2(e))},t3={test:t0("rgb","red"),parse:t1("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+t5.transform(e)+", "+t5.transform(t)+", "+t5.transform(r)+", "+eb(ey.transform(n))+")"},t9={test:t0("#"),parse:function(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}},transform:t3.transform},t4={test:t0("hsl","hue"),parse:t1("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+eA.transform(eb(t))+", "+eA.transform(eb(r))+", "+eb(ey.transform(n))+")"},t6=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},t8=[t9,t3,t4],t7=e=>t8.find(t=>t.test(e));function re(e){let t=t7(e);e9(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`);let r=t.parse(e);return t===t4&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let i=0,s=0,o=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,a=2*r-n;i=tQ(a,n,e+1/3),s=tQ(a,n,e),o=tQ(a,n,e-1/3)}else i=s=o=r;return{red:Math.round(255*i),green:Math.round(255*s),blue:Math.round(255*o),alpha:n}}(r)),r}let rt=(e,t)=>{let r=re(e),n=re(t),i={...r};return e=>(i.red=t6(r.red,n.red,e),i.green=t6(r.green,n.green,e),i.blue=t6(r.blue,n.blue,e),i.alpha=tJ(r.alpha,n.alpha,e),t3.transform(i))},rr={test:e=>t3.test(e)||t9.test(e)||t4.test(e),parse:e=>t3.test(e)?t3.parse(e):t4.test(e)?t4.parse(e):t9.parse(e),transform:e=>ej(e)?e:e.hasOwnProperty("red")?t3.transform(e):t4.transform(e)}
2,rn="number",ri="color",rs=/(var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\))|(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))|((-)?([\d]*\.?[\d])+)/gi;function ro(e){let t=e.toString(),r=t.match(rs)||[],n=[],i={color:[],number:[],var:[]},s=[];for(let e=0;e<r.length;e++){let t=r[e];rr.test(t)?(i.color.push(e),s.push(ri),n.push(rr.parse(t))):t.startsWith("var(")?(i.var.push(e),s.push("var"),n.push(t)):(i.number.push(e),s.push(rn),n.push(parseFloat(t)))}return{values:n,split:t.replace(rs,"${}").split("${}"),indexes:i,types:s}}function ra(e){return ro(e).values}function rl(e){let{split:t,types:r}=ro(e),n=t.length;return e=>{let i="";for(let s=0;s<n;s++)if(i+=t[s],void 0!==e[s]){let t=r[s];t===rn?i+=eb(e[s]):t===ri?i+=rr.transform(e[s]):i+=e[s]}return i}}let ru=e=>"number"==typeof e?0:e,rc={test:function(e){var t,r;return isNaN(e)&&ej(e)&&((null===(t=e.match(ew))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(eP))||void 0===r?void 0:r.length)||0)>0},parse:ra,createTransformer:rl,getAnimatableNone:function(e){let t=ra(e);return rl(e)(t.map(ru))}};function rd(e,t){return r=>r>0?t:e}function rh(e,t){return r=>tJ(e,t,r)}function rp(e){return"number"==typeof e?rh:"string"==typeof e?ep(e)?rd:rr.test(e)?rt:rv:Array.isArray(e)?rf:"object"==typeof e?rr.test(e)?rt:rm:rd}function rf(e,t){let r=[...e],n=r.length,i=e.map((e,r)=>rp(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=i[t](e);return r}}function rm(e,t){let r={...e,...t},n={};for(let i in r)void 0!==e[i]&&void 0!==t[i]&&(n[i]=rp(e[i])(e[i],t[i]));return e=>{for(let t in n)r[t]=n[t](e);return r}}let rv=(e,t)=>{let r=rc.createTransformer(t),n=ro(e),i=ro(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?tl(rf(function(e,t){var r;let n=[],i={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let o=t.types[s],a=e.indexes[o][i[o]],l=null!==(r=e.values[a])&&void 0!==r?r:0;n[s]=l,i[o]++}return n}(n,i),i.values),r):(e9(!0,`Complex values '${e}' and '${t}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),rd(e,t))};function rg(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?tJ(e,t,r):rp(e)(e,t)}function ry({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=t_(n)?n.map(tX):tX(n),s={done:!1,value:t[0]},o=function(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(e9(s===t.length,"Both input and output ranges must be the same length"),1===s)return()=>t[0];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let o=function(e,t,r){let n=[],i=r||rg,s=e.length-1;for(let r=0;r<s;r++){let s=i(e[r],e[r+1]);t&&(s=tl(Array.isArray(t)?t[r]||e9:t,s)),n.push(s)}return n}(t,n,i),a=o.length,l=t=>{let r=0;if(a>1)for(;r<e.length-2&&!(t<e[r+1]);r++);let n=tY(e[r],e[r+1],t);return o[r](n)};return r?t=>l(ev(e[0],e[s-1],t)):l}((r&&r.length===t.length?r:function(e){let t=[0];return function(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=tY(0,t,n);e.push(tJ(r,1,i))}}(t,e.length-1),t}(t)).map(t=>t*e),t,{ease:Array.isArray(i)?i:t.map(()=>i||tU).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(s.value=o(t),s.done=t>=e,s)}}function rx(e,t,r){var n,i;let s=Math.max(t-5,0);return n=r-e(s),(i=t-s)?1e3/i*n:0}function rb(e,t){return e*Math.sqrt(1-t*t)}let rw=["duration","bounce"],rP=["stiffness","damping","mass"];function rE(e,t){return t.some(t=>void 0!==e[t])}function rj({keyframes:e,restDelta:t,restSpeed:r,...n}){let i;let s=e[0],o=e[e.length-1],a={done:!1,value:s},{stiffness:l,damping:u,mass:c,duration:d,velocity:h,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!rE(e,rP)&&rE(e,rw)){let r=function({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let i,s;e9(e<=tT(10),"Spring duration must be 10 seconds or less");let o=1-t;o=ev(.05,1,o),e=ev(.01,10,tM(e)),o<1?(i=t=>{let n=t*o,i=n*e;return .001-(n-r)/rb(t,o)*Math.exp(-i)},s=t=>{let n=t*o*e,s=Math.pow(o,2)*Math.pow(t,2)*e,a=rb(Math.pow(t,2),o);return(n*r+r-s)*Math.exp(-n)*(-i(t)+.001>0?-1:1)/a}):(i=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),s=t=>e*e*(r-t)*Math.exp(-t*e));let a=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(i,s,5/e);if(e=tT(e),isNaN(a))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(a,2)*n;return{stiffness:t,damping:2*o*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...r,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-tM(n.velocity||0)}),f=h||0,m=u/(2*Math.sqrt(l*c)),v=o-s,g=tM(Math.sqrt(l/c)),y=5>Math.abs(v);if(r||(r=y?.01:2),t||(t=y?.005:.5),m<1){let e=rb(g,m);i=t=>o-Math.exp(-m*g*t)*((f+m*g*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}else if(1===m)i=e=>o-Math.exp(-g*e)*(v+(f+g*v)*e);else{let e=g*Math.sqrt(m*m-1);i=t=>{let r=Math.exp(-m*g*t),n=Math.min(e*t,300);return o-r*((f+m*g*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}
2return{calculatedDuration:p&&d||null,next:e=>{let n=i(e);if(p)a.done=e>=d;else{let s=f;0!==e&&(s=m<1?rx(i,e,n):0);let l=Math.abs(s)<=r,u=Math.abs(o-n)<=t;a.done=l&&u}return a.value=a.done?o:n,a}}}function rS({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){let d,h;let p=e[0],f={done:!1,value:p},m=e=>void 0!==a&&e<a||void 0!==l&&e>l,v=e=>void 0===a?l:void 0===l?a:Math.abs(a-e)<Math.abs(l-e)?a:l,g=r*t,y=p+g,x=void 0===o?y:o(y);x!==y&&(g=x-p);let b=e=>-g*Math.exp(-e/n),w=e=>x+b(e),P=e=>{let t=b(e),r=w(e);f.done=Math.abs(t)<=u,f.value=f.done?x:r},E=e=>{m(f.value)&&(d=e,h=rj({keyframes:[f.value,v(f.value)],velocity:rx(w,e,f.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:e=>{let t=!1;return(h||void 0!==d||(t=!0,P(e),E(e)),void 0!==d&&e>d)?h.next(e-d):(t||P(e),f)}}}function rk(){n=void 0}let rA={now:()=>(void 0===n&&rA.set(e8.isProcessing||I.useManualTiming?e8.timestamp:performance.now()),n),set:e=>{n=e,queueMicrotask(rk)}},rC=e=>{let t=({timestamp:t})=>e(t);return{start:()=>e4.update(t,!0),stop:()=>e6(t),now:()=>e8.isProcessing?e8.timestamp:rA.now()}};function rT(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}let rM={decay:rS,inertia:rS,tween:ry,keyframes:ry,spring:rj},rR=e=>e/100;function rV({autoplay:e=!0,delay:t=0,driver:r=rC,keyframes:n,type:i="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,f,m,v,g,y=1,x=!1,b=()=>{f=new Promise(e=>{p=e})};b();let w=rM[i]||ry;w!==ry&&"number"!=typeof n[0]&&(v=tl(rR,rg(n[0],n[1])),n=[0,100]);let P=w({...h,keyframes:n});"mirror"===a&&(g=w({...h,keyframes:[...n].reverse(),velocity:-(h.velocity||0)}));let E="idle",j=null,S=null,k=null;null===P.calculatedDuration&&s&&(P.calculatedDuration=rT(P));let{calculatedDuration:A}=P,C=1/0,T=1/0;null!==A&&(T=(C=A+o)*(s+1)-o);let M=0,R=e=>{if(null===S)return;y>0&&(S=Math.min(S,e)),y<0&&(S=Math.min(e-T/y,S));let r=(M=null!==j?j:Math.round(e-S)*y)-t*(y>=0?1:-1),i=y>=0?r<0:r>T;M=Math.max(r,0),"finished"===E&&null===j&&(M=T);let l=M,u=P;if(s){let e=Math.min(M,T)/C,t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,(t=Math.min(t,s+1))%2&&("reverse"===a?(r=1-r,o&&(r-=o/C)):"mirror"===a&&(u=g)),l=ev(0,1,r)*C}let c=i?{done:!1,value:n[0]}:u.next(l);v&&(c.value=v(c.value));let{done:h}=c;i||null===A||(h=y>=0?M>=T:M<=0);let p=null===j&&("finished"===E||"running"===E&&h);return d&&d(c.value),p&&L(),c},V=()=>{m&&m.stop(),m=void 0},D=()=>{E="idle",V(),p(),b(),S=k=null},L=()=>{E="finished",c&&c(),V(),p()},O=()=>{if(x)return;m||(m=r(R));let e=m.now();l&&l(),null!==j?S=e-j:S&&"finished"!==E||(S=e),"finished"===E&&b(),k=S,j=null,E="running",m.start()};e&&O();let I={then:(e,t)=>f.then(e,t),get time(){return tM(M)},set time(newTime){M=newTime=tT(newTime),null===j&&m&&0!==y?S=m.now()-newTime/y:j=newTime},get duration(){return tM(null===P.calculatedDuration?rT(P):P.calculatedDuration)},get speed(){return y},set speed(newSpeed){if(newSpeed===y||!m)return;y=newSpeed,I.time=tM(M)},get state(){return E},play:O,pause:()=>{E="paused",j=M},stop:()=>{x=!0,"idle"!==E&&(E="idle",u&&u(),D())},cancel:()=>{null!==k&&R(k),D()},complete:()=>{E="finished"},sample:e=>(S=0,R(e))};return I}let rD=(o=()=>Object.hasOwnProperty.call(Element.prototype,"animate"),()=>(void 0===s&&(s=o()),s)),rL=new Set(["opacity","clipPath","filter","transform"]),rO=(e,t)=>"spring"===t.type||"backgroundColor"===e||!function e(t){return!!(!t||"string"==typeof t&&tL[t]||tV(t)||Array.isArray(t)&&t.every(e))}(t.ease),rI={type:"spring",stiffness:500,damping:25,restSpeed:10},r$=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),rF={type:"keyframes",duration:.8},rU={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},r_=(e,{keyframes:t})=>t.length>2?rF:es.has(e)?e.startsWith("scale")?r$(t[1]):rI:rU,rz=(e,t)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(rc.test(t)||"0"===t)&&!t.startsWith("url(")),rB=new Set(["brightness","contrast","saturate","opacity"]);function rN(e){let[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;let[n]=r.match(ew)||[];if(!n)return e;let i=r.replace(n,""),s=rB.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}let rW=/([a-z-]*)\(.*?\)/g,rH={...rc,getAnimatableNone:e=>{let t=e.match(rW);return t?t.map(rN).join(" "):e}},rq={...eD,color:rr,backgroundColor:rr,outlineColor:rr,fill:rr,stroke:rr,borderColor:rr,borderTopColor:rr,borderRightColor:rr,borderBottomColor:rr,borderLeftColor:rr,filter:rH,WebkitFilter:rH},rG=e=>rq[e];function rK(e,t){let r=rG(e);return r!==rH&&(r=rc),r.getAnimatableNone?r.getAnimatableNone(t):void 0}let rZ=e=>/^0[^.\s]+$/.test(e);function rX(e,t){return e[t]||e.default||e}let rY=(e,t,r,n={})=>i=>{let s=rX(n,e)||{},o=s.delay||n.delay||0,{elapsed:a=0}=n;a-=tT(o);let l=function(e,t,r,n){let i,s;let o=rz(t,r);i=Array.isArray(r)?[...r]:[null,r];let a=void 0!==n.from?n.from:e.get(),l=[];for(let e=0;e<i.length;e++){var u;null===i[e]&&(i[e]=0===e?a:i[e-1]),("number"==typeof(u=i[e])?0===u:null!==u?"none"===u||"0"===u||rZ(u):void 0)&&l.push(e),"string"==typeof i[e]&&"none"!==i[e]&&"0"!==i[e]&&(s=i[e])}if(o&&l.length&&s)for(let e=0;e<l.length;e++)i[l[e]]=rK(t,s);return i}(t,e,r,s),u=l[0],c=l[l.length-1],d=rz(e,u),h=rz(e,c);e9(d===h,`You are trying to animate ${e} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:t.getVelocity(),ease:"easeOut",...s,delay:-a,onUpdate:e=>
2{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()}};if(!function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(s)&&(p={...p,...r_(e,p)}),p.duration&&(p.duration=tT(p.duration)),p.repeatDelay&&(p.repeatDelay=tT(p.repeatDelay)),!d||!h||tR.current||!1===s.type||I.skipAnimations)return function({keyframes:e,delay:t,onUpdate:r,onComplete:n}){let i=()=>(r&&r(e[e.length-1]),n&&n(),{time:0,speed:1,duration:0,play:e9,pause:e9,stop:e9,then:e=>(e(),Promise.resolve()),cancel:e9,complete:e9});return t?rV({keyframes:[0,1],duration:0,delay:t,onComplete:i}):i()}(tR.current?{...p,delay:0}:p);if(!n.isHandoff&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate){let r=function(e,t,{onUpdate:r,onComplete:n,...i}){let s,o;if(!(rD()&&rL.has(t)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping&&"inertia"!==i.type))return!1;let a=!1,l=!1,u=()=>{o=new Promise(e=>{s=e})};u();let{keyframes:c,duration:d=300,ease:h,times:p}=i;if(rO(t,i)){let e=rV({...i,repeat:0,delay:0}),t={done:!1,value:c[0]},r=[],n=0;for(;!t.done&&n<2e4;)t=e.sample(n),r.push(t.value),n+=10;p=void 0,c=r,d=n-10,h="linear"}let f=function(e,t,r,{delay:n=0,duration:i,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){let u={[t]:r};l&&(u.offset=l);let c=function e(t){if(t)return tV(t)?tD(t):Array.isArray(t)?t.map(e):tL[t]}(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:n,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"})}(e.owner.current,t,c,{...i,duration:d,ease:h,times:p}),m=()=>{l=!1,f.cancel()},v=()=>{l=!0,e4.update(m),s(),u()};return f.onfinish=()=>{l||(e.set(function(e,{repeat:t,repeatType:r="loop"}){let n=t&&"loop"!==r&&t%2==1?0:e.length-1;return e[n]}(c,i)),n&&n(),v())},{then:(e,t)=>o.then(e,t),attachTimeline:e=>(f.timeline=e,f.onfinish=null,e9),get time(){return tM(f.currentTime||0)},set time(newTime){f.currentTime=tT(newTime)},get speed(){return f.playbackRate},set speed(newSpeed){f.playbackRate=newSpeed},get duration(){return tM(d)},play:()=>{a||(f.play(),e6(m))},pause:()=>f.pause(),stop:()=>{if(a=!0,"idle"===f.playState)return;let{currentTime:t}=f;if(t){let r=rV({...i,autoplay:!1});e.setWithVelocity(r.sample(t-10).value,r.sample(t).value,10)}v()},complete:()=>{l||f.finish()},cancel:v}}(t,e,p);if(r)return r}return rV(p)};function rJ(e){return!!(ea(e)&&e.add)}let rQ=e=>/^\-?\d*\.?\d+$/.test(e);function r0(e,t){-1===e.indexOf(t)&&e.push(t)}function r1(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}class r2{constructor(){this.subscriptions=[]}add(e){return r0(this.subscriptions,e),()=>r1(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](e,t,r);else for(let i=0;i<n;i++){let n=this.subscriptions[i];n&&n(e,t,r)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}let r5=e=>!isNaN(parseFloat(e)),r3={current:void 0};class r9{constructor(e,t={}){this.version="11.0.8",this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(e,t=!0)=>{let r=rA.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.canTrackVelocity=r5(this.current),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=rA.now()}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new r2);let r=this.events[e].add(t);return"change"===e?()=>{r(),e4.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return r3.current&&r3.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var e;let t=rA.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,30);return e=parseFloat(this.current)-parseFloat(this.prevFrameValue),r?1e3/r*e:0}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function r4(e,t){return new r9(e,t)}let r6=e=>t=>t.test(e),r8=[eg,eC,eA,ek,eM,eT,{test:e=>"auto"===e,parse:e=>e}],r7=e=>r8.find(r6(e)),ne=[...r8,rr,rc],nt=e=>ne.find(r6(e));function nr(e,t,{delay:r=0,transitionOverride:n,type:i}={}){let{transition:s=e.getDefaultTransition(),transitionEnd:o,...a}=e.makeTargetAnimatable(t),l=e.getValue("willChange");n&&(s=n);let u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(let t in a){let n=e.getValue(t),i=a[t];if(!n||void 0===i||c&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(c,t))continue;let o={delay:r,elapsed:0,...rX(s||{},t)};if(window.HandoffAppearAnimations){let r=e.getProps()[O];if(r){let e=window.HandoffAppearAnimations(r,t,n,e4);null!==e&&(o.elapsed=e,o.isHandoff=!0)}}let d=!o.isHandoff&&!function(e,t){let r=e.get();if(!Array.isArray(t))return r!==t;for(let e=0;e<t.length;e++)if(t[e]!==r)return!0}(n,i);if("spring"===o.type&&(n.getVelocity()||o.velocity)&&(d=!1),n.animation&&(d=!1),d)continue;n.start(rY(t,n,i,e.shouldReduceMotion&&es.has(t)?{type:!1}:o));let h=n.animation;rJ(l)&&(l.add(t),h.then(()=>l.remove(t))),u.push(h)}return o&&Promise.all(u).then(()=>{o&&function(e,t){let r=tC(e,t),{transitionEnd:n={},transition:i={},...s}=r?e.makeTargetAnimatable(r,!1):{};for(let t in s={...s,...n}){let r=e2(s[t]);e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,r4(r))}}(e,o)}),u}function nn(e,t,r={}){let n=tC(e,t,r.custom),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(nr(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:s=0,staggerChildren:o,staggerDirection:a}=i;return function(e,t,r=0,n=0,i=1,s){let o=[],a=(e.variantChildren.size-1)*n,l=1===i?(e=0)=>e*n:(e=0)=>a-e*n;
2return Array.from(e.variantChildren).sort(ni).forEach((e,n)=>{e.notify("AnimationStart",t),o.push(nn(e,t,{...s,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(o)}(e,t,s+n,o,a,r)}:()=>Promise.resolve(),{when:a}=i;if(!a)return Promise.all([s(),o(r.delay)]);{let[e,t]="beforeChildren"===a?[s,o]:[o,s];return e().then(()=>t())}}function ni(e,t){return e.sortNodePosition(t)}let ns=[...H].reverse(),no=H.length;function na(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}class nl extends tf{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>nn(e,t,r)));else if("string"==typeof t)n=nn(e,t,r);else{let i="function"==typeof t?tC(e,t,r.custom):t;n=Promise.all(nr(e,i,r))}return n.then(()=>e.notify("AnimationComplete",t))})(e,t,r))),r={animate:na(!0),whileInView:na(),whileHover:na(),whileTap:na(),whileDrag:na(),whileFocus:na(),exit:na()},n=!0,i=(t,r)=>{let n=tC(e,r);if(n){let{transition:e,transitionEnd:r,...i}=n;t={...t,...i,...r}}return t};function s(s,o){let a=e.getProps(),l=e.getVariantContext(!0)||{},u=[],c=new Set,d={},h=1/0;for(let t=0;t<no;t++){var p;let f=ns[t],m=r[f],v=void 0!==a[f]?a[f]:l[f],g=N(v),y=f===o?m.isActive:null;!1===y&&(h=t);let x=v===l[f]&&v!==a[f]&&g;if(x&&n&&e.manuallyAnimateOnMount&&(x=!1),m.protectedKeys={...d},!m.isActive&&null===y||!v&&!m.prevProp||W(v)||"boolean"==typeof v)continue;let b=(p=m.prevProp,("string"==typeof v?v!==p:!!Array.isArray(v)&&!tA(v,p))||f===o&&m.isActive&&!x&&g||t>h&&g),w=!1,P=Array.isArray(v)?v:[v],E=P.reduce(i,{});!1===y&&(E={});let{prevResolvedValues:j={}}=m,S={...j,...E},k=e=>{b=!0,c.has(e)&&(w=!0,c.delete(e)),m.needsAnimating[e]=!0};for(let e in S){let t=E[e],r=j[e];if(!d.hasOwnProperty(e))(e0(t)&&e0(r)?tA(t,r):t===r)?void 0!==t&&c.has(e)?k(e):m.protectedKeys[e]=!0:void 0!==t?k(e):c.add(e)}m.prevProp=v,m.prevResolvedValues=E,m.isActive&&(d={...d,...E}),n&&e.blockInitialAnimation&&(b=!1),b&&(!x||w)&&u.push(...P.map(e=>({animation:e,options:{type:f,...s}})))}if(c.size){let t={};
2c.forEach(r=>{let n=e.getBaseTarget(r);void 0!==n&&(t[r]=n)}),u.push({animation:t})}let f=!!u.length;return n&&(!1===a.initial||a.initial===a.animate)&&!e.manuallyAnimateOnMount&&(f=!1),n=!1,f?t(u):Promise.resolve()}return{animateChanges:s,setActive:function(t,n,i){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;let a=s(i,t);for(let e in r)r[e].protectedKeys={};return a},setAnimateFunction:function(r){t=r(e)},getState:()=>r}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();this.unmount(),W(e)&&(this.unmount=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){}}let nu=0;class nc extends tf{constructor(){super(...arguments),this.id=nu++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t,custom:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;let i=this.node.animationState.setActive("exit",!e,{custom:null!=r?r:this.node.getProps().custom});t&&!e&&i.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}let nd=(e,t)=>Math.abs(e-t);class nh{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=nm(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,i=(e=r.offset,t={x:0,y:0},Math.sqrt(nd(e.x,t.x)**2+nd(e.y,t.y)**2)>=3);if(!n&&!i)return;let{point:s}=r,{timestamp:o}=e8;this.history.push({...s,timestamp:o});let{onStart:a,onMove:l}=this.handlers;n||(a&&a(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=np(t,this.transformPagePoint),e4.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let s=nm("pointercancel"===e.type?this.lastMoveEventInfo:np(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,s),n&&n(e,s)},!tn(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;let s=np(ti(e),this.transformPagePoint),{point:o}=s,{timestamp:a}=e8;this.history=[{...o,timestamp:a}];let{onSessionStart:l}=t;l&&l(e,nm(s,this.history)),this.removeListeners=tl(to(this.contextWindow,"pointermove",this.handlePointerMove),to(this.contextWindow,"pointerup",this.handlePointerUp),to(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),e6(this.updatePoint)}}function np(e,t){return t?{point:t(e.point)}:e}function nf(e,t){return{x:e.x-t.x,y:e.y-t.y}}function nm({point:e},t){return{point:e,delta:nf(e,nv(t)),offset:nf(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=nv(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>tT(.1)));)r--;if(!n)return{x:0,y:0};let s=tM(i.timestamp-n.timestamp);if(0===s)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(t,0)}}function nv(e){return e[e.length-1]}function ng(e){return e.max-e.min}function ny(e,t=0,r=.01){return Math.abs(e-t)<=r}function nx(e,t,r,n=.5){e.origin=n,e.originPoint=tJ(t.min,t.max,e.origin),e.scale=ng(r)/ng(t),(ny(e.scale,1,1e-4)||isNaN(e.scale))&&(e.scale=1),e.translate=tJ(r.min,r.max,e.origin)-e.originPoint,(ny(e.translate)||isNaN(e.translate))&&(e.translate=0)}function nb(e,t,r,n){nx(e.x,t.x,r.x,n?n.originX:void 0),nx(e.y,t.y,r.y,n?n.originY:void 0)}function nw(e,t,r){e.min=r.min+t.min,e.max=e.min+ng(t)}function nP(e,t,r){e.min=t.min-r.min,e.max=e.min+ng(t)}function nE(e,t,r){nP(e.x,t.x,r.x),nP(e.y,t.y,r.y)}function nj(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function nS(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function nk(e,t,r){return{min:nA(e,t),max:nA(e,r)}}function nA(e,t){return"number"==typeof e?e:e[t]||0}let nC=()=>({translate:0,scale:1,origin:0,originPoint:0}),nT=()=>({x:nC(),y:nC()}),nM=()=>({min:0,max:0}),nR=()=>({x:nM(),y:nM()});function nV(e){return[e("x"),e("y")]}function nD({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function nL(e){return void 0===e||1===e}function nO({scale:e,scaleX:t,scaleY:r}){return!nL(e)||!nL(t)||!nL(r)}function nI(e){return nO(e)||n$(e)||e.z||e.rotate||e.rotateX||e.rotateY}function n$(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function nF(e,t,r,n,i){return void 0!==i&&(e=n+i*(e-n)),n+r*(e-n)+t}function nU(e,t=0,r=1,n,i){e.min=nF(e.min,t,r,n,i),e.max=nF(e.max,t,r,n,i)}function n_(e,{x:t,y:r}){nU(e.x,t.translate,t.scale,t.originPoint),nU(e.y,r.translate,r.scale,r.originPoint)}function nz(e){return Number.isInteger(e)?e:e>1.0000000000001||e<.999999999999?e:1}function nB(e,t){e.min=e.min+t,e.max=e.max+t}function nN(e,t,[r,n,i]){let s=void 0!==t[i]?t[i]:.5,o=tJ(e.min,e.max,s);nU(e,t[r],t[n],o,t.scale)}let nW=["x","scaleX","originX"],nH=["y","scaleY","originY"];function nq(e,t){nN(e.x,t,nW),nN(e.y,t,nH)}function nG(e,t){return nD(function(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}let nK=({current:e})=>e?e.ownerDocument.defaultView:null,nZ=new WeakMap;
2class nX{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=nR(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;let{dragSnapToOrigin:n}=this.getProps();this.panSession=new nh(e,{onSessionStart:e=>{let{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(ti(e,"page").point)},onStart:(e,t)=>{let{drag:r,dragPropagation:n,onDragStart:i}=this.getProps();if(r&&!n&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=th(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),nV(e=>{let t=this.getAxisMotionValue(e).get()||0;if(eA.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[e];if(n){let e=ng(n);t=parseFloat(t)/100*e}}}this.originPoint[e]=t}),i&&e4.update(()=>i(e,t),!1,!0);let{animationState:s}=this.visualElement;s&&s.setActive("whileDrag",!0)},onMove:(e,t)=>{let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:i,onDrag:s}=this.getProps();if(!r&&!this.openGlobalLock)return;let{offset:o}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(o),null!==this.currentDirection&&i&&i(this.currentDirection);return}this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),s&&s(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>nV(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:nK(this.visualElement)})}stop(e,t){let r=this.isDragging;if(this.cancel(),!r)return;let{velocity:n}=t;this.startAnimation(n);let{onDragEnd:i}=this.getProps();i&&e4.update(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!nY(e,n,this.currentDirection))return;let i=this.getAxisMotionValue(e),s=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?tJ(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?tJ(r,e,n.max):Math.min(e,r)),e}(s,this.constraints[e],this.elastic[e])),i.set(s)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,i=this.constraints;t&&B(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=function(e,{top:t,left:r,bottom:n,right:i}){return{x:nj(e.x,r,i),y:nj(e.y,t,n)}}(n.layoutBox,t):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:nk(e,"left","right"),y:nk(e,"top","bottom")}}(r),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&nV(e=>{this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!B(t))return!1;let n=t.current;e9(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;let s=function(e,t,r){let n=nG(e,r),{scroll:i}=t;return i&&(nB(n.x,i.offset.x),nB(n.y,i.offset.y)),n}(n,i.root,this.visualElement.getTransformPagePoint()),o={x:nS((e=i.layout.layoutBox).x,s.x),y:nS(e.y,s.y)};if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(o));this.hasMutatedConstraints=!!e,e&&(o=nD(e))}return o}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(nV(o=>
2{if(!nY(o,t,this.currentDirection))return;let l=a&&a[o]||{};s&&(l={min:0,max:0});let u={type:"inertia",velocity:r?e[o]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,u)})).then(o)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return r.start(rY(e,r,0,t))}stopAnimation(){nV(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){nV(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){let t="_drag"+e.toUpperCase(),r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){nV(t=>{let{drag:r}=this.getProps();if(!nY(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,i=this.getAxisMotionValue(t);if(n&&n.layout){let{min:r,max:s}=n.layout.layoutBox[t];i.set(e[t]-tJ(r,s,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!B(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};nV(e=>{let t=this.getAxisMotionValue(e);if(t){let r=t.get();n[e]=function(e,t){let r=.5,n=ng(e),i=ng(t);return i>n?r=tY(t.min,t.max-n,e.min):n>i&&(r=tY(e.min,e.max-i,t.min)),ev(0,1,r)}({min:r,max:r},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),nV(t=>{if(!nY(t,e,null))return;let r=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];r.set(tJ(i,s,n[t]))})}addListeners(){if(!this.visualElement.current)return;nZ.set(this.visualElement,this);let e=to(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();B(e)&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),t();let i=tr(window,"resize",()=>this.scalePositionWithinConstraints()),s=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(nV(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{i(),e(),n(),s&&s()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:i=!1,dragElastic:s=.35,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function nY(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}class nJ extends tf{constructor(e){super(e),this.removeGroupControls=e9,this.removeListeners=e9,this.controls=new nX(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||e9}unmount(){this.removeGroupControls(),this.removeListeners()}}let nQ=e=>(t,r)=>{e&&e4.update(()=>e(t,r))};class n0 extends tf{constructor(){super(...arguments),this.removePointerDownListener=e9}onPointerDown(e){this.session=new nh(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:nK(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:nQ(e),onStart:nQ(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&e4.update(()=>n(e,t))}}}mount(){this.removePointerDownListener=to(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let n1={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function n2(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let n5={correct:(e,t)=>
2{if(!t.target)return e;if("string"==typeof e){if(!eC.test(e))return e;e=parseFloat(e)}let r=n2(e,t.target.x),n=n2(e,t.target.y);return`${r}% ${n}%`}};class n3 extends m.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:i}=e;Object.assign(en,n4),i&&(t.group&&t.group.add(i),r&&r.register&&n&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),n1.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:i}=this.props,s=r.projection;return s&&(s.isPresent=i,n||e.layoutDependency!==t||void 0===t?s.willUpdate():this.safeToRemove(),e.isPresent===i||(i?s.promote():s.relegate()||e4.postRender(()=>{let e=s.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),_.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function n9(e){let[t,r]=function(){let e=(0,m.useContext)(M);if(null===e)return[!0,null];let{isPresent:t,onExitComplete:r,register:n}=e,i=(0,m.useId)();return(0,m.useEffect)(()=>n(i),[]),!t&&r?[!1,()=>r&&r(i)]:[!0]}(),n=(0,m.useContext)(J);return m.createElement(n3,{...e,layoutGroup:n,switchLayoutGroup:(0,m.useContext)(Q),isPresent:t,safeToRemove:r})}let n4={borderRadius:{...n5,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:n5,borderTopRightRadius:n5,borderBottomLeftRadius:n5,borderBottomRightRadius:n5,boxSh
2adow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=rc.parse(e);if(n.length>5)return e;let i=rc.createTransformer(e),s="number"!=typeof n[0]?1:0,o=r.x.scale*t.x,a=r.y.scale*t.y;n[0+s]/=o,n[1+s]/=a;let l=tJ(o,a,.5);return"number"==typeof n[2+s]&&(n[2+s]/=l),"number"==typeof n[3+s]&&(n[3+s]/=l),i(n)}}},n6=["TopLeft","TopRight","BottomLeft","BottomRight"],n8=n6.length,n7=e=>"string"==typeof e?parseFloat(e):e,ie=e=>"number"==typeof e||eC.test(e);function it(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let ir=is(0,.5,tW),ii=is(.5,.95,e9);function is(e,t,r){return n=>n<e?0:n>t?1:r(tY(e,t,n))}function io(e,t){e.min=t.min,e.max=t.max}function ia(e,t){io(e.x,t.x),io(e.y,t.y)}function il(e,t,r,n,i){return e-=t,e=n+1/r*(e-n),void 0!==i&&(e=n+1/i*(e-n)),e}function iu(e,t,[r,n,i],s,o){!function(e,t=0,r=1,n=.5,i,s=e,o=e){if(eA.test(t)&&(t=parseFloat(t),t=tJ(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let a=tJ(s.min,s.max,n);e===s&&(a-=t),e.min=il(e.min,t,r,a,i),e.max=il(e.max,t,r,a,i)}(e,t[r],t[n],t[i],t.scale,s,o)}let ic=["x","scaleX","originX"],id=["y","scaleY","originY"];function ih(e,t,r,n){iu(e.x,t,ic,r?r.x:void 0,n?n.x:void 0),iu(e.y,t,id,r?r.y:void 0,n?n.y:void 0)}function ip(e){return 0===e.translate&&1===e.scale}function im(e){return ip(e.x)&&ip(e.y)}function iv(e,t){return Math.round(e.x.min)===Math.round(t.x.min)&&Math.round(e.x.max)===Math.round(t.x.max)&&Math.round(e.y.min)===Math.round(t.y.min)&&Math.round(e.y.max)===Math.round(t.y.max)}function ig(e){return ng(e.x)/ng(e.y)}class iy{constructor(){this.members=[]}add(e){r0(this.members,e),e.scheduleRender()}remove(e){if(r1(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t;let r=this.members.findIndex(t=>e===t);if(0===r)return!1;for(let e=r;e>=0;e--){let r=this.members[e];if(!1!==r.isPresent){t=r;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ix(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y;if((i||s)&&(n=`translate3d(${i}px, ${s}px, 0) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{rotate:e,rotateX:t,rotateY:i}=r;e&&(n+=`rotate(${e}deg) `),t&&(n+=`rotateX(${t}deg) `),i&&(n+=`rotateY(${i}deg) `)}let o=e.x.scale*t.x,a=e.y.scale*t.y;return(1!==o||1!==a)&&(n+=`scale(${o}, ${a})`),n||"none"}let ib=(e,t)=>e.depth-t.depth;class iw{constructor(){this.children=[],this.isDirty=!1}add(e){r0(this.children,e),this.isDirty=!0}remove(e){r1(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(ib),this.isDirty=!1,this.children.forEach(e)}}let iP=["","X","Y","Z"],iE={visibility:"hidden"},ij=0,iS={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function ik({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(e={},r=null==t?void 0:t()){this.id=ij++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,iS.totalNodes=iS.resolvedTargetDeltas=iS.recalculatedProjection=0,this.nodes.forEac
2h(iT),this.nodes.forEach(iI),this.nodes.forEach(i$),this.nodes.forEach(iM),window.MotionDebug&&window.MotionDebug.record(iS)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new iw)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new r2),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=t instanceof SVGElement&&"svg"!==t.tagName,this.instance=t;let{layoutId:n,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(i||n)&&(this.isLayoutDirty=!0),e){let r;let n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){let r=rA.now(),n=({timestamp:t})=>{let i=t-r;i>=250&&(e6(n),e(i-250))};return e4.read(n,!0),()=>e6(n)}(n,0),n1.hasAnimatedSinceResize&&(n1.hasAnimatedSinceResize=!1,this.nodes.forEach(iO))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&s&&(n||i)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let i=this.options.transition||s.getDefaultTransition()||iN,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!iv(this.targetLayout,n)||r,u=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);let t={...rX(i,"layout"),onPlay:o,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||iO(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,e6(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(iF),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;let n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(iV);return}this.isUpdating||this.nodes.forEach(iD),this.isUpdating=!1,window.HandoffCancelAllAnimations&&window.HandoffCancelAllAnimations(),this.nodes.forEach(iL),this.nodes.forEach(iA),this.nodes.forEach(iC),this.clearAllSnapshots();let e=rA.now();e8.delta=ev(0,1e3/60,e-e8.timestamp),e8.timestamp=e,e8.isProcessing=!0,e7.update.process(e8),e7.preRender.process(e8),e7.render.process(e8),e8.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,_.read(()=>this.update()))}
2clearAllSnapshots(){this.nodes.forEach(iR),this.sharedNodes.forEach(iU)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,e4.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){e4.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutCorrected=nR(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!!(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&(this.scroll={animationId:this.root.animationId,phase:e,isRoot:n(this.instance),offset:r(this.instance)})}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform,t=this.projectionDelta&&!im(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,s=n!==this.prevTransformTemplateValue;e&&(t||nI(this.latestValues)||s)&&(i(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){var t;let r=this.measurePageBox(),n=this.removeElementScroll(r);return e&&(n=this.removeTransform(n)),iq((t=n).x),iq(t.y),{animationId:this.root.animationId,measuredBox:r,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return nR();let t=e.measureViewportBox(),{scroll:r}=this.root;return r&&(nB(t.x,r.offset.x),nB(t.y,r.offset.y)),t}removeElementScroll(e){let t=nR();ia(t,e);for(let r=0;r<this.path.length;r++){let n=this.path[r],{scroll:i,options:s}=n;if(n!==this.root&&i&&s.layoutScroll){if(i.isRoot){ia(t,e);let{scroll:r}=this.root;r&&(nB(t.x,-r.offset.x),nB(t.y,-r.offset.y))}nB(t.x,i.offset.x),nB(t.y,i.offset.y)}}return t}applyTransform(e,t=!1){let r=nR();ia(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&nq(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),nI(n.latestValues)&&nq(r,n.latestValues)}return nI(this.latestValues)&&nq(r,this.latestValues),r}removeTransform(e){let t=nR();ia(t,e);for(let e=0;e<this.path.length;e++){let r=this.path[e];if(!r.instance||!nI(r.latestValues))continue;nO(r.latestValues)&&r.updateSnapshot();let n=nR();ia(n,r.measurePageBox()),ih(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return nI(this.latestValues)&&ih(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==e8.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t,r,n,i;let s=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=s.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=s.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=s.isSharedProjectionDirty);let o=!!this.resumingFrom||this!==s;if(!(e||o&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;let{layout:a,layoutId:l}=this.options;if(this.layout&&(a||l)){if(this.resolvedRelativeTargetAt=e8.timestamp,!this.targetDelta&&!this.relativeTarget){let e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nR(),this.relativeTargetOrigin=nR(),nE(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),ia(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if((this.target||(this.target=nR(),this.targetWithTransforms=nR()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target)?(this.forceRelativeParentToResolveTarget(),r=this.target,n=this.relativeTarget,i=this.relativeParent.target,nw(r.x,n.x,i.x),nw(r.y,n.y,i.y)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ia(this.target,this.layout.layoutBox),n_(this.target,this.targetDelta)):ia(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;let e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget=nR(),this.relativeTargetOrigin=nR(),nE(this.relativeTargetOrigin,this.target,e.target),ia(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}iS.resolvedTargetDeltas++}}}getClosestProjectingParent(){return!this.parent||nO(this.parent.latestValues)||n$(this.parent.latestValues)?void 0:this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var e;let t=this.getLead(),r=!!this.resumingFrom||this!==t,n=!0;if((this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty))&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===e8.timestamp&&(n=!1),n)return;let{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(i||s))return;ia(this.layoutCorrected,this.layout.layoutBox);let o=this.treeScale.x,a=this.treeScale.y;!function(e,t,r,n=!1){let i,s;let o=r.length;if(o){t.x=t.y=1;for(let a=0;a<o;a++){s=(i=r[a]).projectionDelta;let o=i.instance;(!o||!o.style||"contents"!==o.style.display)&&(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&nq(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,n_(e,s)),n&&nI(i.latestValues)&&nq(e,i.latestValues))}t.x=nz(t.x),t.y=nz(t.y)}}(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=nR());let{target:l}=t;if(!l){this.projectionTransform&&(this.projectionDelta=nT(),this.projectionTransform="none",this.scheduleRender());return}this.projectionDelta||(this.projectionDelta=nT(),this.projectionDeltaWithTransform=nT());let u=this.projectionTransform;nb(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=ix(this.projectionDelta,this.treeScale),(this.projectionTransform!==u||this.treeScale.x!==o||this.treeScale.y!==a)&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),iS.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(e,t=!1){let r;let n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o=nT();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let a=nR(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(iB));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(i_(o.x,e.x,n),i_(o.y,e.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,h,p,f;nE(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,f=this.relativeTargetOrigin,iz(p.x,f.x,a.x,n),iz(p.y,f.y,a.y,n),r&&(u=this.relativeTarget,h=r,u.x.min===h.x.min&&u.x.max===h.x.max&&u.y.min===
2h.y.min&&u.y.max===h.y.max)&&(this.isProjectionDirty=!1),r||(r=nR()),ia(r,this.relativeTarget)}l&&(this.animationValues=s,function(e,t,r,n,i,s){i?(e.opacity=tJ(0,void 0!==r.opacity?r.opacity:1,ir(n)),e.opacityExit=tJ(void 0!==t.opacity?t.opacity:1,0,ii(n))):s&&(e.opacity=tJ(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let i=0;i<n8;i++){let s=`border${n6[i]}Radius`,o=it(t,s),a=it(r,s);(void 0!==o||void 0!==a)&&(o||(o=0),a||(a=0),0===o||0===a||ie(o)===ie(a)?(e[s]=Math.max(tJ(n7(o),n7(a),n),0),(eA.test(a)||eA.test(o))&&(e[s]+="%")):e[s]=a)}(t.rotate||r.rotate)&&(e.rotate=tJ(t.rotate||0,r.rotate||0,n))}(s,i,this.latestValues,n,d,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(e6(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=e4.update(()=>{n1.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){let n=ea(0)?0:r4(0);return n.start(rY("",n,1e3,r)),n.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:r,layout:n,latestValues:i}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&iG(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||nR();let t=ng(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;let n=ng(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}ia(t,r),nq(t,i),nb(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new iy),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.rotate||r.rotateX||r.rotateY||r.rotateZ)&&(t=!0),!t)return;let n={};for(let t=0;t<iP.length;t++){let i="rotate"+iP[t];r[i]&&(n[i]=r[i],e.setStaticValue(i,0))}for(let t in e.render(),n)e.setStaticValue(t,n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return iE;let n={visibility:""},i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=e5(null==e?void 0:e.pointerEvents)||"",n.transform=i?i(this.latestValues,""):"none",n;let s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){let t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=e5(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!nI(this.latestValues)&&(t.transform=i?i({},""):"none",this.hasProjected=!1),t}let o=s.animationValues||s.latestValues;this.applyTransformsToTarget(),n.transform=ix(this.projectionDeltaWithTransform,this.treeScale,o),i&&(n.transform=i(o,n.transform));let{x:a,y:l}=this.projectionDelta;for(let e in n.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,s.animationValues?n.opacity=s===this?null!==(r=null!==(t=o.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:o.opacityExit:n.opacity=s===this?void 0!==o.opacity?o.opacity:"":void 0!==o.opacityExit?o.opacityExit:0,en){if(void 0===o[e])continue;let{correct:t,applyTo:r}=en[e],i="none"===n.transform?o[e]:t(o[e],s);if(r){let e=r.length;for(let t=0;t<e;t++)n[r[t]]=i}else n[e]=i}return this.options.layoutId&&(n.pointerEvents=s===this?e5(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}
2resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(iV),this.root.sharedNodes.clear()}}}function iA(e){e.updateLayout()}function iC(e){var t;let r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:n}=e.layout,{animationType:i}=e.options,s=r.source!==e.layout.source;"size"===i?nV(e=>{let n=s?r.measuredBox[e]:r.layoutBox[e],i=ng(n);n.min=t[e].min,n.max=n.min+i}):iG(i,r.layoutBox,t)&&nV(n=>{let i=s?r.measuredBox[n]:r.layoutBox[n],o=ng(t[n]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+o)});let o=nT();nb(o,t,r.layoutBox);let a=nT();s?nb(a,e.applyTransform(n,!0),r.measuredBox):nb(a,t,r.layoutBox);let l=!im(o),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:i,layout:s}=n;if(i&&s){let o=nR();nE(o,r.layoutBox,i.layoutBox);let a=nR();nE(a,t,s.layoutBox),iv(o,a)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=o,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function iT(e){iS.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function iM(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function iR(e){e.clearSnapshot()}function iV(e){e.clearMeasurements()}function iD(e){e.isLayoutDirty=!1}function iL(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function iO(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function iI(e){e.resolveTargetDelta()}function i$(e){e.calcProjection()}function iF(e){e.resetRotation()}function iU(e){e.removeLeadSnapshot()}function i_(e,t,r){e.translate=tJ(t.translate,0,r),e.scale=tJ(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function iz(e,t,r,n){e.min=tJ(t.min,r.min,n),e.max=tJ(t.max,r.max,n)}function iB(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let iN={duration:.45,ease:[.4,0,.1,1]},iW=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),iH=iW("applewebkit/")&&!iW("chrome/")?Math.round:e9;function iq(e){e.min=iH(e.min),e.max=iH(e.max)}function iG(e,t,r){return"position"===e||"preserve-aspect"===e&&!ny(ig(t),ig(r),.2)}let iK=ik({attachResizeListener:(e,t)=>tr(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),iZ={current:void 0},iX=ik({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!iZ.current){let e=new iK({});e.mount(window),e.setOptions({layoutScroll:!0}),iZ.current=e}return iZ.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),iY=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function iJ(e,t,r=1){e9(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);let[n,i]=function(e){let t=iY.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]}(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let e=s.trim();return rQ(e)?parseFloat(e):e}return ep(i)?iJ(i,t,r+1):i}let iQ=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),i0=e=>iQ.has(e),i1=e=>Object.keys(e).some(i0),i2=e=>e===eg||e===eC,i5=(e,t)=>parseFloat(e.split(", ")[t]),i3=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;let i=n.match(/^matrix3d\((.+)\)$/);if(i)return i5(i[1],t);{let t=n.match(/^matrix\((.+)\)$/);return t?i5(t[1],e):0}},i9=new Set(["x","y","z"]),i4=ei.filter(e=>!i9.has(e)),i6={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:i3(4,13),y:i3(5,14)};i6.translateX=i6.x,i6.translateY=i6.y;let i8=(e,t,r)=>{let n=t.measureViewportBox(),i=getComputedStyle(t.current),{display:s}=i,o={};"none"===s&&t.setStaticValue("display",e.display||"block"),r.forEach(e
2=>{o[e]=i6[e](n,i)}),t.render();let a=t.measureViewportBox();return r.forEach(r=>{let n=t.getValue(r);n&&n.jump(o[r]),e[r]=i6[r](a,i)}),e},i7=(e,t,r={},n={})=>{t={...t},n={...n};let i=Object.keys(t).filter(i0),s=[],o=!1,a=[];if(i.forEach(i=>{let l;let u=e.getValue(i);if(!e.hasValue(i))return;let c=r[i],d=r7(c),h=t[i];if(e0(h)){let e=h.length,t=null===h[0]?1:0;d=r7(c=h[t]);for(let r=t;r<e&&null!==h[r];r++)l?e9(r7(h[r])===l,"All keyframes must be of the same type"):e9((l=r7(h[r]))===d||i2(d)&&i2(l),"Keyframes must be of the same dimension as the current value")}else l=r7(h);if(d!==l){if(i2(d)&&i2(l)){let e=u.get();"string"==typeof e&&u.set(parseFloat(e)),"string"==typeof h?t[i]=parseFloat(h):Array.isArray(h)&&l===eC&&(t[i]=h.map(parseFloat))}else(null==d?void 0:d.transform)&&(null==l?void 0:l.transform)&&(0===c||0===h)?0===c?u.set(l.transform(c)):t[i]=d.transform(h):(o||(s=function(e){let t=[];return i4.forEach(r=>{let n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t.length&&e.render(),t}(e),o=!0),a.push(i),n[i]=void 0!==n[i]?n[i]:t[i],u.jump(h))}}),!a.length)return{target:t,transitionEnd:n};{let r=a.indexOf("height")>=0?window.pageYOffset:null,i=i8(t,e,a);return s.length&&s.forEach(([t,r])=>{e.getValue(t).set(r)}),e.render(),R&&null!==r&&window.scrollTo({top:r}),{target:i,transitionEnd:n}}},se=(e,t,r,n)=>{var i,s;let o=function(e,{...t},r){let n=e.current;if(!(n instanceof Element))return{target:t,transitionEnd:r};for(let i in r&&(r={...r}),e.values.forEach(e=>{let t=e.get();if(!ep(t))return;let r=iJ(t,n);r&&e.set(r)}),t){let e=t[i];if(!ep(e))continue;let s=iJ(e,n);s&&(t[i]=s,r||(r={}),void 0===r[i]&&(r[i]=e))}return{target:t,transitionEnd:r}}(e,t,n);return t=o.target,n=o.transitionEnd,i=t,s=n,i1(i)?i7(e,i,r,s):{target:i,transitionEnd:s}},st={current:null},sr={current:!1},sn=new WeakMap,si=Object.keys(Y),ss=si.length,so=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],sa=q.length;class sl{constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>e4.render(this.render,!1,!0);let{latestValues:o,renderState:a}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=t.initial?{...o}:{},this.renderState=a,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=G(t),this.isVariantNode=K(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:l,...u}=this.scrapeMotionValuesFromProps(t,{});for(let e in u){let t=u[e];void 0!==o[e]&&ea(t)&&(t.set(o[e],!1),rJ(l)&&l.add(e))}}scrapeMotionValuesFromProps(e,t){return{}}mount(e){this.current=e,sn.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),sr.current||function(){if(sr.current=!0,R){if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>st.current=e.matches;e.addListener(t),t()}else st.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||st.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in sn.delete(this.current),this.projection&&this.projection.unmount(),e6(this.notifyUpdate),e6(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features)this.features[e].unmount();this.current=null}bindToMotionValue(e,t){let r=es.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&e4.update(this.notifyUpdate,!1,!0),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),i()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}loadFeatures({children:e,...t},r,n,i){let s,o;for(let e=0;e<ss;e++){let r=si[e],{isEnabled:n,Feature:i,ProjectionNode:a,MeasureLayout:l}=Y[r];a&&(s=a),n(t)&&(!this.features[r]&&i&&(this.features[r]=new i(this)),l&&(o=l))}if(("html"===this.type||"svg"===this.type)&&!this.projection&&s){this.projection=new s(this.latestValues,this.parent&&this.parent.projection);let{layoutId:e,layout:r,drag:n,dragConstraints:o,layoutScroll:a,layoutRoot:l}=t;this.projection.setOptions({layoutId:e,layout:r,alwaysMeasureLayout:!!n||o&&B(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof r?r:"both",initialPromotionConfig:i,layoutScroll:a,layoutRoot:l})}return o}updateFeatures(){for(let e in this.features){let t=this.features[e];
2t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):nR()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}makeTargetAnimatable(e,t=!0){return this.makeTargetAnimatableFromInstance(e,t)}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<so.length;t++){let r=so[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);let n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){let{willChange:n}=t;for(let i in t){let s=t[i],o=r[i];if(ea(s))e.addValue(i,s),rJ(n)&&n.add(i);else if(ea(o))e.addValue(i,r4(s,{owner:e})),rJ(n)&&n.remove(i);else if(o!==s){if(e.hasValue(i)){let t=e.getValue(i);t.hasAnimated||t.set(s)}else{let t=e.getStaticValue(i);e.addValue(i,r4(void 0!==t?t:s,{owner:e}))}}}for(let n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(e=!1){if(e)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){let e=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(e.initial=this.props.initial),e}let t={};for(let e=0;e<sa;e++){let r=q[e],n=this.props[r];(N(n)||!1===n)&&(t[r]=n)}return t}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){t!==this.values.get(e)&&(this.removeValue(e),this.bindToMotionValue(e,t)),this.values.set(e,t),this.latestValues[e]=t.get()}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=r4(t,{owner:this}),this.addValue(e,r)),r}readValue(e){var t;return void 0===this.latestValues[e]&&this.current?null!==(t=this.getBaseTargetFromProps(this.props,e))&&void 0!==t?t:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e]}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let{initial:r}=this.props,n="string"==typeof r||"object"==typeof r?null===(t=eJ(this.props,r))||void 0===t?void 0:t[e]:void 0;if(r&&void 0!==n)return n;let i=this.getBaseTargetFromProps(this.props,e);return void 0===i||ea(i)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new r2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class su extends sl{sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}makeTargetAnimatableFromInstance({transition:e,transitionEnd:t,...r},n){let i=function(e,t,r){let n={};for(let i in e){let e=function(e,t){if(t)return(t[e]||t.default||t).from}(i,t);if(void 0!==e)n[i]=e;else{let e=r.getValue(i);e&&(n[i]=e.get())}}return n}(r,e||{},this);if(n){!function(e,t,r){var n,i;let s=Object.keys(t).filter(t=>!e.hasValue(t)),o=s.length;if(o)for(let a=0;a<o;a++){let o=s[a],l=t[o],u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(i=null!==(n=r[o])&&void 0!==n?n:e.readValue(o))&&void 0!==i?i:t[o]),null!=u&&("string"==typeof u&&(rQ(u)||rZ(u))?u=parseFloat(u):!nt(u)&&rc.test(l)&&(u=rK(o,l)),e.addValue(o,r4(u,{owner:e})),void 0===r[o]&&(r[o]=u),null!==u&&e.setBaseTarget(o,u))}}(this,r,i);let e=se(this,r,i,t);t=e.transitionEnd,r=e.target}return{transition:e,transitionEnd:t,...r}}}class sc extends su{constructor(){super(...arguments),this.type="html"}readValueFromInstance(e,t){if(es.has(t)){let e=rG(t);return e&&e.default||0}{let r=window.getComputedStyle(e),n=(ed(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return nG(e,t)}build(e,t,r,n){eL(e,t,r,n.transformTemplate)}scrapeMotionValuesFromProps(e,t){return eX(e,t)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;ea(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}renderInstance(e,t,r,n){eG(e,t,r,n)}}class sd extends su{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(es.has(t)){let e=rG(t);return e&&e.default||0}return t=eK.has(t)?t:L(t),e.getAttribute(t)}measureInstanceViewportBox(){return nR()}scrapeMotionValuesFromProps(e,t){return eY(e,t)}
2build(e,t,r,n){eW(e,t,r,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,r,n){eZ(e,t,r,n)}mount(e){this.isSVGTag=eq(e.tagName),super.mount(e)}}let sh=(e,t)=>er(e)?new sd(t,{enableHardwareAcceleration:!1}):new sc(t,{enableHardwareAcceleration:!0}),sp={animation:{Feature:nl},exit:{Feature:nc},inView:{Feature:tk},tap:{Feature:tb},focus:{Feature:tg},hover:{Feature:tv},pan:{Feature:n0},drag:{Feature:nJ,ProjectionNode:iX,MeasureLayout:n9},layout:{ProjectionNode:iX,MeasureLayout:n9}},sf=function(e){function t(t,r={}){return function({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:i}){e&&function(e){for(let t in e)Y[t]={...Y[t],...e[t]}}(e);let s=(0,m.forwardRef)(function(s,o){var a;let l;let u={...(0,m.useContext)(C),...s,layoutId:function({layoutId:e}){let t=(0,m.useContext)(J).id;return t&&void 0!==e?t+"-"+e:e}(s)},{isStatic:c}=u,d=function(e){let{initial:t,animate:r}=function(e,t){if(G(e)){let{initial:t,animate:r}=e;return{initial:!1===t||N(t)?t:void 0,animate:N(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,m.useContext)(T));return(0,m.useMemo)(()=>({initial:t,animate:r}),[Z(t),Z(r)])}(s),h=n(s,c);if(!c&&R){d.visualElement=function(e,t,r,n){let{visualElement:i}=(0,m.useContext)(T),s=(0,m.useContext)(D),o=(0,m.useContext)(M),a=(0,m.useContext)(C).reducedMotion,l=(0,m.useRef)();n=n||s.renderer,!l.current&&n&&(l.current=n(e,{visualState:t,parent:i,props:r,presenceContext:o,blockInitialAnimation:!!o&&!1===o.initial,reducedMotionConfig:a}));let u=l.current;(0,m.useInsertionEffect)(()=>{u&&u.update(r,o)});let c=(0,m.useRef)(!!(r[O]&&!window.HandoffComplete));return V(()=>{u&&(_.postRender(u.render),c.current&&u.animationState&&u.animationState.animateChanges())}),(0,m.useEffect)(()=>{u&&(u.updateFeatures(),!c.current&&u.animationState&&u.animationState.animateChanges(),c.current&&(c.current=!1,window.HandoffComplete=!0))}),u}(i,h,u,t);let r=(0,m.useContext)(Q),n=(0,m.useContext)(D).strict;d.visualElement&&(l=d.visualElement.loadFeatures(u,n,e,r))}return m.createElement(T.Provider,{value:d},l&&d.visualElement?m.createElement(l,{visualElement:d.visualElement,...u}):null,r(i,s,(a=d.visualElement,(0,m.useCallback)(e=>{e&&h.mount&&h.mount(e),a&&(e?a.mount(e):a.unmount()),o&&("function"==typeof o?o(e):B(o)&&(o.current=e))},[a])),h,c,d.visualElement))});return s[ee]=i,s}(e(t,r))}if("undefined"==typeof Proxy)return t;let r=new Map;return new Proxy(t,{get:(e,n)=>(r.has(n)||r.set(n,t(n)),r.get(n))})}((e,t)=>(function(e,{forwardMotionProps:t=!1},r,n){return{...er(e)?te:tt,preloadedFeatures:r,useRender:function(e=!1){return(t,r,n,{latestValues:i},s)=>{let o=(er(t)?function(e,t,r,n){let i=(0,m.useMemo)(()=>{let r=eH();return eW(r,t,{enableHardwareAcceleration:!1},eq(n),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){let t={};eI(t,e.style,e),i.style={...t,...i.style}}return i}:function(e,t,r){let n={},i=function(e,t,r){let n=e.style||{},i={};return eI(i,n,e),Object.assign(i,function({transformTemplate:e},t,r){return(0,m.useMemo)(()=>{let n=eO();return eL(n,t,{enableHardwareAcceleration:!r},e),Object.assign({},n.vars,n.style)},[t])}(e,t,r)),i}(e,t,r);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n})(r,i,s,t),a=function(e,t,r){let n={};for(let i in e)("values"!==i||"object"!=typeof e.values)&&(eU(i)||!0===r&&eF(i)||!t&&!eF(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}(r,"string"==typeof t,e),l=t!==m.Fragment?{...a,...o,ref:n}:{},{children:u}=r,c=(0,m.useMemo)(()=>ea(u)?u.get():u,[u]);return(0,m.createElement)(t,{...l,children:c})}}(t),createVisualElement:n,Component:e}})(e,t,sp,sh));function sm({children:e,isValidProp:t,...r}){t&&e_(t),(r={...(0,m.useContext)(C),...r}).isStatic=eQ(()=>r.isStatic);let n=(0,m.useMemo)(()=>r,[JSON.stringify(r.transition),r.transformPagePoint,r.reducedMotion]);return m.createElement(C.Provider,{value:n},e)}function sv(){let e=(0,m.useRef)(!1);return V(()=>(e.current=!0,()=>{e.current=!1}),[]),e}class sg extends m.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function sy({children:e,isPresent:t}){let r=(0,m.useId)(),n=(0,m.useRef)(null),i=(0,m.useRef)({width:0,height:0,top:0,left:0});return(0,m.useInsertionEffect)(()=>{let{width:e,height:s,top:o,left:a}
2=i.current;if(t||!n.current||!e||!s)return;n.current.dataset.motionPopId=r;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
3          [data-motion-pop-id="${r}"] {
4            position: absolute !important;
5            width: ${e}px !important;
6            height: ${s}px !important;
7            top: ${o}px !important;
8            left: ${a}px !important;
9          }
10        `),()=>{document.head.removeChild(l)}},[t]),m.createElement(sg,{isPresent:t,childRef:n,sizeRef:i},m.cloneElement(e,{ref:n}))}let sx=({children:e,initial:t,isPresent:r,onExitComplete:n,custom:i,presenceAffectsLayout:s,mode:o})=>{let a=eQ(sb),l=(0,m.useId)(),u=(0,m.useMemo)(()=>({id:l,initial:t,isPresent:r,custom:i,onExitComplete:e=>{for(let t of(a.set(e,!0),a.values()))if(!t)return;n&&n()},register:e=>(a.set(e,!1),()=>a.delete(e))}),s?void 0:[r]);return(0,m.useMemo)(()=>{a.forEach((e,t)=>a.set(t,!1))},[r]),m.useEffect(()=>{r||a.size||!n||n()},[r]),"popLayout"===o&&(e=m.createElement(sy,{isPresent:r},e)),m.createElement(M.Provider,{value:u},e)};function sb(){return new Map}let sw=e=>e.key||"",sP=({children:e,custom:t,initial:r=!0,onExitComplete:n,exitBeforeEnter:i,presenceAffectsLayout:s=!0,mode:o="sync"})=>{var a;e9(!i,"Replace exitBeforeEnter with mode='wait'");let l=(0,m.useContext)(J).forceRender||function(){let e=sv(),[t,r]=(0,m.useState)(0),n=(0,m.useCallback)(()=>{e.current&&r(t+1)},[t]);return[(0,m.useCallback)(()=>e4.postRender(n),[n]),t]}()[0],u=sv(),c=function(e){let t=[];return m.Children.forEach(e,e=>{(0,m.isValidElement)(e)&&t.push(e)}),t}(e),d=c,h=(0,m.useRef)(new Map).current,p=(0,m.useRef)(d),f=(0,m.useRef)(new Map).current,v=(0,m.useRef)(!0);if(V(()=>{v.current=!1,function(e,t){e.forEach(e=>{let r=sw(e);t.set(r,e)})}(c,f),p.current=d}),a=()=>{v.current=!0,f.clear(),h.clear()},(0,m.useEffect)(()=>()=>a(),[]),v.current)return m.createElement(m.Fragment,null,d.map(e=>m.createElement(sx,{key:sw(e),isPresent:!0,initial:!!r&&void 0,presenceAffectsLayout:s,mode:o},e)));d=[...d];let g=p.current.map(sw),y=c.map(sw),x=g.length;for(let e=0;e<x;e++){let t=g[e];-1!==y.indexOf(t)||h.has(t)||h.set(t,void 0)}return"wait"===o&&h.size&&(d=[]),h.forEach((e,r)=>{if(-1!==y.indexOf(r))return;let i=f.get(r);if(!i)return;let a=g.indexOf(r),v=e;v||(v=m.createElement(sx,{key:sw(i),isPresent:!1,onExitComplete:()=>{h.delete(r);let e=Array.from(f.keys()).filter(e=>!y.includes(e));if(e.forEach(e=>f.delete(e)),p.current=c.filter(t=>{let n=sw(t);return n===r||e.includes(n)}),!h.size){if(!1===u.current)return;l(),n&&n()}},custom:t,presenceAffectsLayout:s,mode:o},i),h.set(r,v)),d.splice(a,0,v)}),d=d.map(e=>{let t=e.key;return h.has(t)?e:m.createElement(sx,{key:sw(e),isPresent:!0,presenceAffectsLayout:s,mode:o},e)}),m.createElement(m.Fragment,null,h.size?d:d.map(e=>(0,m.cloneElement)(e)))};var sE=r(4572);async function sj(e,t,r,n,i=(0,sE.Z)()){let s=e.withConfig({apiVersion:"2023-11-09"});try{let e=new Date(Date.now()+36e5),o=`sanity-preview-url-secret.${i}`,a=function(){if("u">typeof crypto){let e=new Uint8Array(16);crypto.getRandomValues(e);let t="";for(let r=0;r<e.length;r++)t+=e[r].toString(16).padStart(2,"0");return t=btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/[=]+$/,"")}return Math.random().toString(36).slice(2)}(),l=s.patch(o).set({secret:a,source:t,studioUrl:r,userId:n});return await s.transaction().createOrReplace({_id:o,_type:j}).patch(l).commit({tag:"sanity.preview-url-secret"}),{secret:a,expiresAt:e}}finally{await s.delete({query:A})}}var sS=r(59731);function sk(e){return e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function sA(e){return e&&e.sensitive?"":"i"}let sC=e=>"object"==typeof e&&"function"==typeof e.then,sT=[],sM=(e,t,r)=>(function(e,t=null,r=!1,n={}){for(let i of(null===t&&(t=[e]),sT))if(function(e,t,r=(e,t)=>e===t){if(e===t)return!0;if(!e||!t)return!1;let n=e.length;if(t.length!==n)return!1;for(let i=0;i<n;i++)if(!r(e[i],t[i]))return!1;return!0}(t,i.keys,i.equal)){if(r)return;if(Object.prototype.hasOwnProperty.call(i,"error"))throw i.error;if(Object.prototype.hasOwnProperty.call(i,"response"))return n.lifespan&&n.lifespan>0&&(i.timeout&&clearTimeout(i.timeout),i.timeout=setTimeout(i.remove,n.lifespan)),i.response;if(!r)throw i.promise}let i={keys:t,equal:n.equal,remove:()=>{let e=sT.indexOf(i);-1!==e&&sT.splice(e,1)},promise:(sC(e)?e:e(...t)).then(e=>{i.response=e,n.lifespan&&n.lifespan>0&&(i.timeout=setTimeout(i.remove,n.lifespan))}).catch(e=>i.error=e)};if(sT.push(i),!r)throw i.promise})(e,t,!1,r);var sR=Object.defineProperty,sV=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?sR(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r};let sD=new Uint8Array(16),sL=[];for(let e=0;e<256;++e)sL.push((e+256).toString(16).slice(1));var sO={randomUUID:"u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function sI(e,t,r){if(sO.randomUUID&&!t&&!e)return sO.randomUUID();let n=(e=e||{}).random||(e.rng||function(){if(!i&&!(i="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return i(sD)})();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,function(e,t=0){return sL[e[t+0]]+sL[e[t+1]]+sL[e[t+2]]+sL[e[t+3]]+"-"+sL[e[t+4]]+sL[e[t+5]]+"-"+sL[e[t+6]]+sL[e[t+7]]+"-"+sL[e[t+8]]+sL[e[t+9]]+"-"+sL[e[t+10]]+sL[e[t+11]]+sL[e[t+12]]+sL[e[t+13]]+sL[e[t+14]]+sL[e[t+15]]}(n)}let s$=["handshake/syn","handshake/syn-ack","handshake/ack"],sF=e=>s$.some(t=>t===e),sU=({data:e={}})=>"object"==typeof e&&null!==e&&!Array.isArray(e)&&!("domain"in e)&&["id","type","from","to"].every(t=>t in e)&&e.type.startsWith("handshake/");function s_(e){let t=e.target,r=e.connectTo.map(e=>({buffer:[],config:e,id:"",handler:i,status:"connecting",interval:void 0,heartbeat:void 0}));function n(e){window.clearInterval(e.interval)}function i(e){let{data:t}=e;if(sF(t.type)){let e=r.find(e=>e.config.id===t.from);e&&"handshake/syn-ack"===t.type&&(l(e,"connected"),u(e,"handshake/ack",{id:e.id}))}}let s=t=>{var n,i,s;let o=t.data;if(!sF(o.type)&&r.find(e=>e.id===o.connectionId)){let t=r.find(e=>e.config.id===o.from);if(t){let r=[o.type,o.data];null==(i=(n=t.config).onEvent)||i.call(n,...r),null==(s=e.onEvent)||s.call(e,...r),c(t,"channel/response",{responseTo:o.id},!1)}}};function o(t){var n;if(sU(t))console.error("Visual editing package mismatch detected! Please ensure you are using the latest version of Sanity Studio and any packages listed here:\nhttps://github.com/sanity-io/visual-editing");else if(function(t){let{data:n,origin:i}=t;return"sanity/channels"===n.domain&&n.to==e.id&&r.map(e=>e.config.id).includes(n.from)&&"channel/response"!==n.type&&i===e.targetOrigin}(t)){let{data:e}=t;null==(n=r.find(t=>t.config.id===e.from))||n.handler(t)}}function a(e){e.heartbeat&&window.clearInterval(e.heartbeat)}function l(t,r){var o,l,d;t.status=r,null==(l=(o=t.config).onStatusUpdate)||l.call(o,r,t.config.id),null==(d=e.onStatusUpdate)||d.call(e,r,t.config.id),"connecting"===r||"reconnecting"===r?(t.handler=i,a(t),t.id=sI(),t.interval=window.setInterval(()=>{u(t,"handshake/syn",{id:t.id})},500)):"connected"===r?(t.handler=s,n(t),function(e){if(a(e),e.config.heartbeat){let t="number"==typeof e.config.heartbeat?e.config.heartbeat:1e3;e.heartbeat=window.setInterval(()=>{c(e,"channel/heartbeat")},t)}}(t),function(e){let t=[...e.buffer];e.buffer.splice(0,e.buffer.length),t.forEach(({type:t,data:r})=>{c(e,t,r)})}(t)):"disconnected"===r&&(t.id=null,t.handler=i,n(t),a(t))}function u(r,n,i){if(!r.id)throw Error("No channel ID set");let s={connectionId:r.id,data:i,domain:"sanity/channels",from:e.id,id:sI(),to:r.config.id,type:n};try{null==t||t.postMessage(s,{targetOrigin:"*"})}catch{throw Error(`Failed to postMessage '${s.id}' on '${e.id}'`)}}function c(r,n,i,s=!0){let o=sI();if("connecting"===r.status||"reconnecting"===r.status||"disconnected"===r.status)return void r.buffer.push({type:n,data:i});if(!r.id)throw Error("No channel ID set");let a={connectionId:r.id,data:i,domain:"sanity/channels",from:e.id,id:o,to:r.config.id,type:n};if(s){let t=setTimeout(()=>{a.connectionId===r.id&&(window.removeEventListener("message",s,!1),"channel/heartbeat"!==n&&r.buffer.push({type:n,data:i}),l(r,"reconnecting"),console.warn(`Received no response to message '${a.type}' on client '${e.id}' (ID: '${a.id}').`))},1e3),s=e=>{var r;let{data:n}=e;"channel/response"===n.type&&null!=(r=n.data)&&r.responseTo&&n.data.responseTo===a.id&&(window.removeEventListener("message",s,!1),clearTimeout(t))};window.addEventListener("message",s,!1)}
10try{null==t||t.postMessage(a,{targetOrigin:e.targetOrigin})}catch{throw Error(`Failed to postMessage '${a.id}' on client '${e.id}'`)}}return window.addEventListener("message",o,!1),r.forEach(e=>{l(e,"connecting")}),{destroy:function(){r.forEach(e=>{["disconnected"].includes(e.status)||(c(e,"channel/disconnect",{id:e.id},!1),l(e,"disconnected"))}),window.removeEventListener("message",o,!1),r.forEach(e=>{a(e),n(e)})},send:function(e,t,n){(e?Array.isArray(e)?[...e]:[e]:r).forEach(e=>{let i=r.find(t=>t.config.id===e);if(!i)throw Error("Invalid channel ID");c(i,t,n)})}}}function sz(e){var t,r,n;let i=typeof e;return"object"===i&&(i=null!=(n=e&&(null==(r=null==(t=Object.getPrototypeOf(e))?void 0:t.constructor)?void 0:r.name))?n:"null"),"string"===i?`"${e}"`:"number"===i||"bigint"===i||"boolean"===i?`${e}`:i}function sB(e,t,r,n,i){var s,o,a,d,h,p,f,m,v,g,y;let x=i&&"input"in i?i.input:r.value,b=null!=(s=null==i?void 0:i.expected)?s:e.expects,w=null!=(o=null==i?void 0:i.received)?o:sz(x),P={kind:e.kind,type:e.type,input:x,expected:b,received:w,message:`Invalid ${t}: ${b?`Expected ${b} but r`:"R"}eceived ${w}`,requirement:e.requirement,path:null==i?void 0:i.path,issues:null==i?void 0:i.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly,skipPipe:n.skipPipe},E="schema"===e.kind,j=null!=(p=null!=(h=null!=(d=null!=(a=e.message)?a:(m=e.reference,v=P.lang,null==(g=null==c?void 0:c.get(m))?void 0:g.get(v)))?d:E?(f=P.lang,null==u?void 0:u.get(f)):null)?h:n.message)?p:(y=P.lang,null==l?void 0:l.get(y));j&&(P.message="function"==typeof j?j(P):j),E&&(r.typed=!1),r.issues?r.issues.push(P):r.issues=[P]}var sN=class extends Error{constructor(e){super(e[0].message),sV(this,"issues"),this.name="ValiError",this.issues=e}};function sW(e){return{kind:"schema",type:"boolean",reference:sW,expects:"boolean",async:!1,message:e,_run(e,t){return"boolean"==typeof e.value?e.typed=!0:sB(this,"type",e,t),e}}}function sH(e,t){return{kind:"schema",type:"object",reference:sH,expects:"Object",async:!1,entries:e,message:t,_run(e,t){var r;let n=e.value;if(n&&"object"==typeof n)for(let i in e.typed=!0,e.value={},this.entries){let s=n[i],o=this.entries[i]._run({typed:!1,value:s},t);if(o.issues){let a={type:"object",origin:"value",input:n,key:i,value:s};for(let t of o.issues)t.path?t.path.unshift(a):t.path=[a],null==(r=e.issues)||r.push(t);if(e.issues||(e.issues=o.issues),t.abortEarly){e.typed=!1;break}}o.typed||(e.typed=!1),(void 0!==o.value||i in n)&&(e.value[i]=o.value)}else sB(this,"type",e,t);return e}}}function sq(e,...t){let r={kind:"schema",type:"optional",reference:sq,expects:`${e.expects} | undefined`,async:!1,wrapped:e,_run(e,t){return void 0===e.value&&("default"in this&&(e.value="function"==typeof this.default?this.default(e,t):this.default),void 0===e.value)?(e.typed=!0,e):this.wrapped._run(e,t)}};return 0 in t&&(r.default=t[0]),r}function sG(e){return{kind:"schema",type:"string",reference:sG,expects:"string",async:!1,message:e,_run(e,t){return"string"==typeof e.value?e.typed=!0:sB(this,"type",e,t),e}}}let sK=/^([A-Za-z]+):([0-9]+)$/,sZ=/^([A-Za-z]+):([0-9]+),([0-9]+)$/,sX=/^([A-Za-z]+):([a-z0-9]+)$/,sY=function(...e){return{...e[0],pipe:e,_run(t,r){for(let n=0;n<e.length;n++){t=e[n]._run(t,r);let i=e[n+1];if(r.skipPipe||t.issues&&(r.abortEarly||r.abortPipeEarly||"schema"===(null==i?void 0:i.kind)||"transformation"===(null==i?void 0:i.kind))){t.typed=!1;break}}return t}}}(sG(),function e(t,r){return{kind:"validation",type:"min_length",reference:e,async:!1,expects:`>=${t}`,requirement:t,message:r,_run(e,t){return e.typed&&e.value.length<this.requirement&&sB(this,"length",e,t,{received:`${e.value.length}`}),e}}}(1)),sJ=sq(sY);sH({baseUrl:sY,dataset:sJ,id:sY,path:sY,projectId:sJ,tool:sJ,type:sJ,workspace:sJ,isDraft:sq(sG())}),sH({origin:sY,href:sY,data:sq(function e(t,r,n){return{kind:"schema",type:"record",reference:e,expects:"Object",async:!1,key:t,value:r,message:n,_run(e,t){var r,n;let i=e.value;if(i&&"object"==typeof i){for(let s in e.typed=!0,e.value={},i)if("__proto__"!==s&&"prototype"!==s&&"constructor"!==s){let o=i[s],a=this.key._run({typed:!1,value:s},t);
10if(a.issues){let n={type:"record",origin:"key",input:i,key:s,value:o};for(let t of a.issues)t.path=[n],null==(r=e.issues)||r.push(t);if(e.issues||(e.issues=a.issues),t.abortEarly){e.typed=!1;break}}let l=this.value._run({typed:!1,value:o},t);if(l.issues){let r={type:"record",origin:"value",input:i,key:s,value:o};for(let t of l.issues)t.path?t.path.unshift(r):t.path=[r],null==(n=e.issues)||n.push(t);if(e.issues||(e.issues=l.issues),t.abortEarly){e.typed=!1;break}}a.typed&&l.typed||(e.typed=!1),a.typed&&(e.value[a.value]=l.value)}}else sB(this,"type",e,t);return e}}}(sG(),function e(){return{kind:"schema",type:"unknown",reference:e,expects:"unknown",async:!1,_run:e=>(e.typed=!0,e)}}()))});let sQ={alt:"altKey",ctrl:"ctrlKey",mod:"u">typeof window&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform)?"metaKey":"ctrlKey",shift:"shiftKey"};function s0(e){return"Alt"===e.key}function s1(e,t){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>{e.apply(e,n)},t)}}let s2=(0,m.createContext)(null);s2.displayName="PanelsContext";let s5=y.zo.div`
11  overflow: hidden;
12  flex-basis: 0;
13  flex-shrink: 1;
14`,s3=function({children:e,defaultSize:t=null,id:r,minWidth:n,maxWidth:i,order:s=0}){let o=(0,m.useContext)(s2);if(null===o)throw Error("Panel components must be rendered within a PanelGroup container");let{getPanelStyle:a,registerElement:l,unregisterElement:u}=o,c=a(r);return(0,m.useLayoutEffect)(()=>(l(r,{id:r,type:"panel",defaultSize:t,maxWidth:null!=i?i:null,minWidth:null!=n?n:0,order:s}),()=>{u(r)}),[r,t,s,i,n,l,u]),(0,h.jsx)(s5,{style:c,children:e})},s9="presentation/panels",s4=()=>JSON.parse(localStorage.getItem(s9)||"{}"),s6=e=>e.map(e=>[e.id,e.order].join(":")).join(",");function s8(e,t,r){let{maxWidth:n,minWidth:i}=e;return Math.min(null==n?100:n/r*100,Math.max(i/r*100,t))}function s7(e,t,r=0,n=null){return e.clientX-(n||t.getBoundingClientRect()).left-r}function oe(e){return"panel"===e.type}function ot(e){return"resizer"===e.type}function or(e){return Array.from(e.values()).sort(({order:e},{order:t})=>null==e&&null==t?0:null==e?-1:null==t?1:e-t)}function on(e,t,r){let n=t.reduce((e,t)=>e+t,0),i=[...t].map(e=>e/n*100),s=0;for(let t=0;t<e.length;t++){let n=e[t],o=i[t],a=s8(n,o,r);o!=a&&(s+=o-a,i[t]=a)}if("0.000"!==s.toFixed(3))for(let t=0;t<e.length;t++){let{maxWidth:n,minWidth:o}=e[t];o=o/r*100,null!=n&&(n=n/r*100);let a=Math.min(null!=n?n:100,Math.max(o,i[t]+s));if(a!==i[t]&&(s-=a-i[t],i[t]=a,"0.000"===Math.abs(s).toFixed(3)))break}return i}let oi=y.zo.div`
15  display: flex;
16  flex-direction: row;
17  height: 100%;
18  overflow: hidden;
19  width: 100%;
20`,os=function({children:e}){let t=(0,m.useRef)(null),[r,n]=(0,m.useState)(new Map),i=(0,m.useMemo)(()=>or(r).filter(oe),[r]),[s,o]=(0,m.useState)([]),[a,l]=(0,m.useState)(null),u=(0,m.useRef)({elements:r,panels:i,widths:s}),c=(0,m.useCallback)(e=>({flexGrow:function(e,t,r){if(1===e.length)return"100";let n=r[e.findIndex(e=>e.id===t)];return null==n?"0":n.toPrecision(10)}(i,e,s),pointerEvents:null===a?void 0:"none"}),[a,i,s]),d=(0,m.useCallback)((e,t)=>{n(r=>{if(r.has(e))return r;let n=new Map(r);return n.set(e,t),n})},[]),p=(0,m.useCallback)(e=>{n(t=>{if(!t.has(e))return t;let r=new Map(t);return r.delete(e),r})},[]),f=(0,m.useRef)({containerWidth:window.innerWidth,dragOffset:0,panelAfter:null,panelBefore:null,resizerIndex:-1,resizerRect:null,startX:0,widths:[]}),v=(0,m.useCallback)((e,t)=>{let n=or(r),i=n.findIndex(t=>t.id===e),s=r.get(e);if(!s||!ot(s))return;let o=s.el.current;o&&(f.current={resizerIndex:i,panelBefore:n.reduce((e,t,r)=>oe(t)&&r<i?t:e,null),panelAfter:n.reduce((e,t,r)=>null===e&&oe(t)&&r>i?t:e,null),containerWidth:window.innerWidth,startX:t.pageX,dragOffset:s7(t,o),resizerRect:o.getBoundingClientRect(),widths:u.current.widths},l(e))},[r]),g=(0,m.useCallback)(()=>{l(null)},[]),y=(0,m.useCallback)((e,n)=>{n.preventDefault(),n.stopPropagation();let{containerWidth:i,dragOffset:s,panelBefore:a,panelAfter:l,resizerRect:c}=f.current;if(null==a||null==l)return;let d=r.get(e);if(!d||!ot(d))return;let h=d.el.current;if(!h)return;let p=s7(n,h,s,c);if(0===p)return;let{widths:m}=u.current,v=function(e,t,r,n,i,s){let{panels:o,widths:a}=i,{widths:l}=s,u=l||a,c=[...u];{let i=e<0?n:r,s=u[o.findIndex(e=>e.id===i.id)],a=s8(i,s+Math.abs(e),t);if(s===a)return u;e=e<0?s-a:a-s}let d=0,h=e<0?r:n,p=o.findIndex(e=>e.id===h.id);for(;;){let r=o[p],n=u[p],i=s8(r,n-(Math.abs(e)-Math.abs(d)),t);if(n!==i&&(d+=n-i,c[p]=i,d.toPrecision(10).localeCompare(Math.abs(e).toPrecision(10),void 0,{numeric:!0})>=0))break;if(e<0){if(--p<0)break}else if(++p>=o.length)break}return 0===d?u:(h=e<0?n:r,c[p=o.findIndex(e=>e.id===h.id)]=u[p]+d,c)}(p/t.current.getBoundingClientRect().width*100,i,a,l,u.current,f.current);m.some((e,t)=>e!==v[t])&&o(v)},[r]);(0,m.useLayoutEffect)(()=>{u.current.elements=r,u.current.panels=i,u.current.widths=s},[r,i,s]);let x=(0,m.useMemo)(()=>{let e=(e,t)=>
20{var r;let n=s4(),i=s6(e);r={...n,[i]:t},localStorage.setItem(s9,JSON.stringify(r))};return{get:e=>{let t=s4(),r=s6(e);return Array.isArray(t[r])&&t[r].some(e=>null===e)?void 0:t[r]},set:e,setDebounced:s1(e,100)}},[]);(0,m.useLayoutEffect)(()=>{let{widths:e}=u.current;if(e.length===i.length)return;let t=x.get(i);if(t)return void o(on(i,t,window.innerWidth));o(function(e){let t=e.length,r=100,n=e.map(e=>e.defaultSize?(r-=e.defaultSize,t-=1,e.defaultSize):null),i=r/t;return n.map(e=>null===e?i:e)}(i))},[x,i]),(0,m.useEffect)(()=>{s.length&&x.setDebounced(i,s)},[x,i,s]),(0,m.useLayoutEffect)(()=>{let e=new ResizeObserver(()=>{let{panels:e,widths:t}=u.current,r=on(e,t,window.innerWidth);t.some((e,t)=>e!==r[t])&&o(r)});return e.observe(t.current),()=>{e.disconnect()}},[]);let b=(0,m.useMemo)(()=>({activeResizer:a,drag:y,getPanelStyle:c,registerElement:d,startDragging:v,stopDragging:g,unregisterElement:p}),[a,y,c,d,v,g,p]);return(0,h.jsx)(s2.Provider,{value:b,children:(0,h.jsx)(oi,{ref:t,children:e})})};function oo(e){let{children:t,message:r,onRetry:n,onContinueAnyway:i,...s}=e,{t:o}=(0,v.$G7)(x.p),a=(0,h.jsx)(f.zx,{fontSize:1,mode:"ghost",onClick:n,text:o("error-card.retry-button.text")}),l=(0,h.jsx)(f.zx,{fontSize:1,mode:"ghost",tone:"critical",onClick:i,text:o("error-card.continue-button.text")});return(0,h.jsx)(f.Zb,{height:"fill",...s,children:(0,h.jsx)(f.kC,{align:"center",height:"fill",justify:"center",children:(0,h.jsx)(f.W2,{padding:4,sizing:"border",width:0,children:(0,h.jsxs)(f.Kq,{space:4,children:[(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.xv,{size:1,weight:"semibold",children:o("error-card.title")}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:r})]}),t,n&&i?(0,h.jsxs)(f.gF,{space:2,children:[a,l]}):n?(0,h.jsx)(f.xu,{children:a}):i?(0,h.jsx)(f.xu,{children:l}):null]})})})})}let oa=(0,m.forwardRef)(function(e,t){let{searchParams:r,...n}=e;return(0,h.jsx)(g.Px,{...n,ref:t,state:{type:void 0,_searchParams:Object.entries(r)},title:void 0})}),ol=(0,m.forwardRef)(function(e,t){let{documentId:r,documentType:n,parentRefPath:i,template:s,searchParams:o,...a}=e;return(0,h.jsx)(g.Px,{...a,ref:t,state:{id:r,type:n,_searchParams:Object.entries({...o,prefersLatestPublished:"published"===o.perspective?"true":void 0})},title:void 0})});function ou(e){let{children:t,onStructureParams:r,structureParams:n,searchParams:i,refs:s}=e,{state:o,resolvePathFromState:a}=(0,g.tv)(),l=(0,v.BoV)(Object.fromEntries(o._searchParams||[])),u=(0,m.useCallback)(e=>`${a(o)}${function(e){let t=["comment","inspect","instruction","pathKey","rev","since","template","prefersLatestPublished","view"];return function(e={}){let t=Object.entries(e).map(([e,t])=>`${e}=${t}`).join("&");return t.length?`?${t}`:""}(Object.entries(e).filter(([e])=>t.includes(e)).reduce((e,[t,r])=>null==r?e:{...e,[t]:r},{}))}({...l,...e})}`,[a,l,o]),c=(0,m.useMemo)(()=>({index:0,groupIndex:0,siblingIndex:0,payload:{},params:n,hasGroupSiblings:!1,groupLength:1,routerPanesState:[],ChildLink:e=>{let{childId:t,...r}=e,n=null==s?void 0:s.find(e=>e._id===t||(0,v.vsM)(e._id)===t);return n?(0,h.jsx)(g.Px,{...r,state:{id:t,type:n._type,_searchParams:Object.entries({...i,prefersLatestPublished:"published"===(null==i?void 0:i.perspective)?"true":void 0})}}):(0,h.jsx)("div",{...r})},BackLink:e=>(0,h.jsx)(oa,{...e,searchParams:i}),ReferenceChildLink:e=>(0,h.jsx)(ol,{...e,searchParams:i}),ParameterizedLink:()=>(0,h.jsx)(h.Fragment,{children:"ParameterizedLink"}),closeCurrentAndAfter:()=>{console.warn("closeCurrentAndAfter")},handleEditReference:e=>{console.warn("handleEditReference",e)},replaceCurrent:e=>{console.warn("replaceCurrent",e)},closeCurrent:()=>{console.warn("closeCurrent")},duplicateCurrent:e=>{console.warn("duplicateCurrent",e)},setView:e=>{console.warn("setView",e)},setParams:e=>{var t;r({...e,inspect:null!=(t=e.inspect)?t:void 0})},setPayload:e=>{console.warn("setPayload",e)},navigateIntent:(e,t,r)=>{console.warn("navigateIntent",e,t,r)},createPathWithParams:u}),[u,r,s,i,n]);return(0,h.jsx)(w.ud.Provider,{value:c,children:t})}let oc=(0,y.zo)(P.PaneLayout)`
21  height: 100%;
22`,od=(0,y.zo)(f.kC)`
23  & > div {
24    min-width: none !important;
25    max-width: none !important;
26  }
27`,oh=(0,y.zo)(f.EK)`
28  white-space: pre-wrap;
29`;
29function op(e){let{mainDocumentState:t,onStructureParams:r,searchParams:n,refs:i}=e,{t:s}=(0,v.$G7)(x.p),{devMode:o}=(0,x.u)(),a=(0,m.useMemo)(()=>i.filter(e=>{var r;return(0,v.vsM)(e._id)!==(null==(r=null==t?void 0:t.document)?void 0:r._id)}).map(e=>e._id),[t,i]),l=(0,m.useMemo)(()=>({id:"$root",options:{filter:"_id in $ids",params:{ids:a}},schemaTypeName:"",title:s("document-list-pane.document-list.title"),type:"documentList"}),[a,s]),[u,c]=(0,m.useState)(null),d=(0,m.useCallback)(()=>c(null),[]),[p]=(0,m.useState)(()=>({}));return(0,m.useEffect)(()=>c(null),[i]),u?(0,h.jsx)(oo,{flex:1,message:s("document-list-pane.error.text"),onRetry:d,children:o&&(0,h.jsx)(f.Zb,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:s("presentation-error.label")}),(0,h.jsx)(oh,{size:1,children:u.error.message})]})})}):(0,h.jsx)(f.SV,{onCatch:c,children:(0,h.jsx)(oc,{children:(0,h.jsx)(P.StructureToolProvider,{children:(0,h.jsx)(ou,{onStructureParams:r,structureParams:p,searchParams:n,refs:i,children:(0,h.jsx)(od,{direction:"column",flex:1,children:(0,h.jsx)(P.PaneContainer,{index:0,itemId:"$root",pane:l,paneKey:"$root"})})})})})})}let of=(0,y.zo)(f.EK)`
30  white-space: pre-wrap;
31`;function om(e){let{documentId:t,documentType:r,onFocusPath:n,onStructureParams:i,searchParams:s,structureParams:o}=e,{template:a,templateParams:l}=o,{t:u}=(0,v.$G7)(x.p),{devMode:c}=(0,x.u)(),d=(0,m.useMemo)(()=>({id:t,options:{id:t,type:r,template:a,templateParameters:(0,g.ZB)(l)},title:"",type:"document"}),[t,r,a,l]),[p,y]=(0,m.useState)(null),b=(0,m.useCallback)(()=>y(null),[]);return(0,m.useEffect)(()=>{y(null)},[t,r,o]),p?(0,h.jsx)(oo,{flex:1,message:u("document-pane.error.text"),onRetry:b,children:c&&(0,h.jsx)(f.Zb,{overflow:"auto",padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:u("presentation-error.label")}),(0,h.jsx)(of,{size:1,children:p.error.message})]})})}):(0,h.jsx)(f.SV,{onCatch:y,children:(0,h.jsx)(P.PaneLayout,{style:{height:"100%"},children:(0,h.jsx)(ou,{searchParams:s,onStructureParams:i,structureParams:o,children:(0,h.jsx)(P.DocumentPane,{paneKey:"document",index:1,itemId:"document",pane:d,onFocusPath:n})})})})}function ov(e){let{documentId:t,documentType:r,onFocusPath:n,onStructureParams:i,searchParams:s,structureParams:o}=e;return(0,h.jsx)(P.StructureToolProvider,{children:(0,h.jsx)(om,{documentId:t,documentType:r,onFocusPath:n,onStructureParams:i,searchParams:s,structureParams:o})})}function og(e){var t;let{documentId:r,documentType:n,mainDocumentState:i,onFocusPath:s,onStructureParams:o,refs:a,searchParams:l,structureParams:u}=e,{t:c}=(0,v.$G7)(x.p),d=(0,v.I_y)(),p=(0,m.useCallback)(e=>(0,h.jsx)(g.Px,{...e,state:{id:i.document._id,type:i.document._type,_searchParams:Object.entries({...l,prefersLatestPublished:"published"===(null==l?void 0:l.perspective)?"true":void 0})}}),[i,l]),y=(0,m.useMemo)(()=>{var e;return d.get((null==(e=null==i?void 0:i.document)?void 0:e._type)||"shoe")},[i,d]),w=function(e,t){let r=(0,v.rq_)(),[n,i]=(0,m.useState)({});return(0,m.useEffect)(()=>{if(!t)return;let n=(0,v.eLL)(r,t,e,"").subscribe(e=>{i(e)});return()=>{null==n||n.unsubscribe()}},[r,t,e]),n}((null==(t=null==i?void 0:i.document)?void 0:t._id)||"",y),P=(0,m.useMemo)(()=>i?(0,h.jsx)(v.ogX,{...(0,v.L_b)({value:i.document,published:w.published,draft:w.draft}),schemaType:y,status:(0,h.jsx)(f.Zb,{padding:1,radius:2,shadow:1,children:(0,h.jsx)(f.xv,{muted:!0,size:0,weight:"medium",children:c("main-document.label")})})}):null,[i,y,c,w]);return r&&n?(0,h.jsx)(ov,{documentId:r,documentType:n,onFocusPath:s,onStructureParams:o,searchParams:l,structureParams:u}):(0,h.jsxs)(f.kC,{direction:"column",flex:1,height:"fill",children:[i&&(0,h.jsx)(f.Zb,{padding:3,tone:i.document?"inherit":"caution",children:i.document?(0,h.jsx)(v.oUE,{__unstable_focusRing:!0,as:p,"data-as":"a",radius:2,sizing:"border",tone:"inherit",children:P}):(0,h.jsx)(f.Zb,{padding:2,radius:2,tone:"inherit",children:(0,h.jsxs)(f.kC,{gap:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,h.jsx)(b.foC,{})})}),(0,h.jsx)(f.xu,{flex:1,children:(0,h.jsx)(f.xv,{size:1,children:(0,h.jsx)(v.vNl,{t:c,i18nKey:"main-document.missing.text",components:{Code:"code"},values:{path:i.path}})})})]})})}
31),(0,h.jsx)(op,{mainDocumentState:i,onStructureParams:o,searchParams:l,refs:a})]})}let oy=y.zo.div`
32  position: relative;
33`,ox=y.zo.div`
34  position: absolute;
35  top: 0;
36  bottom: 0;
37  left: -5px;
38  width: 9px;
39  z-index: 10;
40  cursor: ${({$disabled:e})=>e?"auto":"ew-resize"};
41
42  /* Border */
43  & > span:nth-child(1) {
44    display: block;
45    border-left: 1px solid var(--card-border-color);
46    position: absolute;
47    top: 0;
48    left: 4px;
49    bottom: 0;
50    transition: opacity 200ms;
51  }
52
53  ${({$disabled:e})=>!e&&"\n    /* Hover effect */\n    & > span:nth-child(2) {\n      display: block;\n      position: absolute;\n      top: 0;\n      left: 0;\n      width: 9px;\n      bottom: 0;\n      background-color: var(--card-border-color);\n      opacity: 0;\n      transition: opacity 150ms;\n    }\n\n    @media (hover: hover) {\n      &:hover > span:nth-child(2) {\n        opacity: 0.2;\n      }\n    }\n  "}
54`,ob=function({id:e,order:t,disabled:r=!1}){let n=(0,m.useRef)(null),i=(0,m.useContext)(s2);if(null===i)throw Error("Panel components must be rendered within a PanelGroup container");let s=(0,m.useRef)(e||sI()).current,{activeResizer:o,drag:a,startDragging:l,stopDragging:u,registerElement:c,unregisterElement:d}=i,p=o===s;if(null===i)throw Error("Panel components must be rendered within a PanelGroup container");let f=(0,m.useCallback)(e=>{l(s,e.nativeEvent)},[s,l]),v=(0,m.useCallback)(e=>{a(s,e)},[s,a]),g=(0,m.useCallback)(()=>{n.current.blur(),u()},[u]);return(0,m.useEffect)(()=>{if(p&&!r)return window.addEventListener("mousemove",v),window.addEventListener("mouseup",g),()=>{window.removeEventListener("mousemove",v),window.removeEventListener("mouseup",g)}},[r,p,v,g]),(0,m.useLayoutEffect)(()=>(c(s,{id:s,order:t,type:"resizer",el:n}),()=>{d(s)}),[s,t,c,d]),(0,h.jsx)(oy,{onMouseDown:f,ref:n,children:(0,h.jsxs)(ox,{$disabled:r,children:[(0,h.jsx)("span",{}),(0,h.jsx)("span",{})]})})},ow=e=>{let{documentId:t,setDisplayedDocument:r,getCommentIntent:n}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ob,{order:4}),(0,h.jsx)(s3,{id:"content",minWidth:325,order:5,children:(0,h.jsx)(E.D,{documentId:t,setDisplayedDocument:r,children:(0,h.jsx)(v.dFz,{getIntent:n,children:e.children})})})]})},oP=e=>{let{documentId:t,documentsOnPage:r,documentType:n,getCommentIntent:i,mainDocumentState:s,onFocusPath:o,onStructureParams:a,searchParams:l,setDisplayedDocument:u,structureParams:c}=e;return(0,h.jsx)(ow,{documentId:t,getCommentIntent:i,setDisplayedDocument:u,children:(0,h.jsx)(og,{documentId:t,documentType:n,mainDocumentState:s,onFocusPath:o,onStructureParams:a,refs:r,searchParams:l,structureParams:c})})},oE=function(e){let{children:t,navigate:r}=e,n=(0,m.useCallback)((e,t)=>{r(t||{},e?{preview:e}:{})},[r]);return(0,h.jsx)(x.P.Provider,{value:n,children:t})},oj=(0,m.memo)(function(e){let{minWidth:t,maxWidth:r,component:n}=e;return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(s3,{id:"navigator",minWidth:t,maxWidth:r,order:1,children:(0,h.jsx)(n,{})}),(0,h.jsx)(ob,{order:2,disabled:null!=t&&null!=r&&t===r})]})}),oS=function(e){let{children:t,params:r}=e,n=(0,m.useMemo)(()=>r,[r]);return(0,h.jsx)(x.a.Provider,{value:n,children:t})},ok=function(e){let{children:t,devMode:r,name:n,navigate:i,params:s,searchParams:o,structureParams:a}=e,l=(0,m.useMemo)(()=>({devMode:r,name:n,navigate:i,params:s,searchParams:o,structureParams:a}),[r,n,i,s,o,a]);return(0,h.jsx)(x.b.Provider,{value:l,children:t})},oA="ACTION_IFRAME_LOADED",oC="ACTION_IFRAME_REFRESH",oT="ACTION_IFRAME_RELOAD",oM="ACTION_VISUAL_EDITING_OVERLAYS_TOGGLE",oR=(e,t)=>{switch(t.type){case oA:return"loaded"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"loaded"}};case oC:return"refreshing"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"refreshing"}};case oT:return"reloading"===e.iframe.status?e:{...e,iframe:{...e.iframe,status:"reloading"}};case oM:return oV(e,t);default:return e}},oV=(e,t)=>e.visualEditing.overlaysEnabled===t.enabled?e:{...e,visualEditing:{...e.visualEditing,overlaysEnabled:t.enabled}},oD=sH({mainDocument:{...d=sW(),fallback:!1,_run(e,t){return d._run(e,t),e.issues?{typed:!0,value:"function"==typeof this.fallback?this.fallback(e,t):this.fallback}:e}},iframe:sH({status:function e(t,r){return{kind:"schema",type:"picklist",reference:e,expects:t.map(sz).join(" | ")||"never",async:!1,options:t,message:r,_run(e,t){return this.options.includes(e.value)?e.typed=!0:sB(this,"type",e,t),e}}}(["loading","loaded","refreshing","reloading"])}),visualEditing:sH({overlaysEnabled:sW()})}),oL={mainDocument:!1,iframe:{status:"loading"},visualEditing:{overlaysEnabled:!1}};function oO(e){return function(e,t,r){var n,i,s;let o=e._run({typed:!1,value:t},{lang:(n=void 0,null==a?void 0:a.lang),message:null==n?void 0:n.message,abortEarly:null!=(i=null==n?void 0:n.abortEarly)?i:null==a?void 0:a.abortEarly,abortPipeEarly:null!=(s=null==n?void 0:n.abortPipeEarly)?s:null==a?void 0:a.abortPipeEarly,skipPipe:null==n?void 0:n.skipPipe});if(o.issues)throw new sN(o.issues);return o.value}(oD,{...oL,...e})}let oI=sf(y.zo.iframe`
55  border: 0;
56  max-height: 100%;
57  width: 100%;
58  display: block;
59`),o$=function(e){var t;let{fontSize:r=1,onChange:n,origin:i,padding:s=3,prefix:o,suffix:a,value:l}=e,{t:u}=(0,v.$G7)(x.p),{basePath:c="/"}=(null==(t=(0,v.AJ_)())?void 0:t.activeWorkspace)||{},d=(0,m.useRef)(null),[p,g]=(0,m.useState)(void 0),[y,w]=(0,m.useState)(void 0),P=(0,m.useCallback)(e=>{g(e.currentTarget.value)},[]),E=(0,m.useCallback)(e=>{var t;if("Enter"===e.key){if(void 0===p)return;let e=p.startsWith("/")||""===p?`${i}${p}`:p;if(!e.startsWith(i+"/")&&e!==i)return void w(u("preview-location-input.error",{origin:i,context:"missing-origin"}));if(!i&&(e.startsWith(`${c}/`)||e===c))return void w(u("preview-location-input.error",{basePath:c,context:"same-base-path"}));let r=e===i?i+"/":e;w(void 0),g(void 0),n(r.slice(i.length)),null==(t=d.current)||t.blur()}"Escape"===e.key&&(w(void 0),g(void 0))},[c,n,i,p,u]),j=(0,m.useCallback)(()=>{w(void 0),g(void 0)},[]);(0,m.useEffect)(()=>{w(void 0),g(void 0)},[i,l]);let S=(0,m.useMemo)(()=>({icon:b.X5P}),[]);return(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(f.oi,{clearButton:y?S:void 0,customValidity:y,fontSize:r,onBlur:j,onClear:()=>{w(void 0),g(i+l)},onChange:P,onKeyDownCapture:E,padding:s,prefix:o,style:{zIndex:1},radius:2,ref:d,space:s,suffix:a,value:void 0===p?`${i}${l}`:p})})};function oF(e){let{initialUrl:t,openPopup:r,previewLocationOrigin:n,previewLocationRoute:i}=e,{t:s}=(0,v.$G7)(x.p),o=(0,m.useCallback)(e=>{e.preventDefault(),r(e.currentTarget.href)},[r]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(oU,{initialUrl:t,previewLocationOrigin:n,previewLocationRoute:i}),(0,h.jsx)(f.sN,{icon:b.buG,text:s("share-url.menu-item.open.text"),as:"a",href:`${n}${i}`,onClick:o,rel:"opener",target:"_blank"})]})}function oU(e){let{initialUrl:t,previewLocationOrigin:r,previewLocationRoute:n}=e,{t:i}=(0,v.$G7)(x.p),{push:s}=(0,f.pm)(),o=(0,v.m85)({apiVersion:x.A}),a=(0,v.xJ)(),[l,u]=(0,m.useState)(!1);return(0,h.jsx)(f.sN,{disabled:l,onClick:()=>{let e;if(null==navigator||!navigator.clipboard)return s({closable:!0,status:"error",title:i("share-url.clipboard.status",{context:"unsupported"})}),!1;u(!0);let l=`${r}${n}`,c=()=>{s({id:e,closable:!0,status:"success",title:i("share-url.clipboard.status",{context:"success"})}),u(!1)},d=e=>{s({closable:!0,status:"error",title:i("share-url.clipboard.status",{context:"failed"}),description:e.message||e.toString()}),u(!1)};if(t.searchParams.has(S)){let r=async()=>(e=s({closable:!0,title:i("share-url.clipboard.status",{context:"copying"})}),(function(e,t,r){let n=new URL(e);return n.searchParams.set(S,t),n.searchParams.set(k,r),n})(t,(await sj(o,"@sanity/presentation",typeof window>"u"?"":location.href,null==a?void 0:a.id)).secret,n).toString());if("u">typeof ClipboardItem){let e="text/plain",t=new ClipboardItem({[e]:r().then(t=>new Blob([t],{type:e}))});navigator.clipboard.write([t]).then(c).catch(d)}else r().then(e=>navigator.clipboard.writeText(e)).then(c).catch(d)}else navigator.clipboard.writeText(l).then(c).catch(d)},text:i("share-url.menu-item.copy.text"),icon:b.TIy})}let o_=sf(f.kC),oz={previewDrafts:"preview-frame.perspective.previewDrafts.title",published:"preview-frame.perspective.published.title"},oB={previewDrafts:b.dY8,published:b.EI4},oN=(0,m.forwardRef)(function(e,t){let{dispatch:r,iframe:n,initialUrl:i,loadersConnection:s,navigatorEnabled:o,onPathChange:a,onRefresh:l,openPopup:u,overlaysConnection:c,perspective:d,previewUrl:p,setPerspective:g,setViewport:y,targetOrigin:w,toggleNavigator:P,toggleOverlay:E,viewport:j,visualEditing:{overlaysEnabled:A}}=e,{t:C}=(0,v.$G7)(x.p),{devMode:T}=(0,x.u)(),M=(0,f.Tb)(),R=(0,m.useCallback)(()=>y("desktop"===j?"mobile":"desktop"),[y,j]),V="loading"===n.status||"reloading"===n.status,[D,L]=(0,m.useState)(!1),O
59="refreshing"===n.status,[I,$]=(0,m.useState)(!1),F=V||O||"connecting"===c,U=(0,m.useMemo)(()=>w===location.origin?"":w,[w]),_=(0,m.useCallback)(()=>{l(()=>{"function"!=typeof t&&null!=t&&t.current&&(r({type:oT}),t.current.src=`${w}${p||"/"}`)})},[r,l,p,w,t]),z=(0,m.useCallback)(()=>{"function"!=typeof t&&null!=t&&t.current&&(t.current.src=i.toString(),r({type:oT}))},[r,t,i]),B=(0,m.useCallback)(()=>{W(!0)},[]),[N,W]=(0,m.useState)(!1),[H,q]=(0,m.useState)(!1);(0,m.useEffect)(()=>{if(!(V||O||"connecting"!==c&&"reconnecting"!==c)){let e=setTimeout(()=>{q(!0)},1e3);return()=>clearTimeout(e)}},[c,V,O]),(0,m.useEffect)(()=>{if(!V&&!O&&H){if("connected"===c&&($(!1),q(!1),L(!1),W(!1)),"connecting"===c){let e=setTimeout(()=>{L(!0),console.error("Unable to connect to visual editing. Make sure you've setup '@sanity/visual-editing' correctly")},x.M);return()=>clearTimeout(e)}if("reconnecting"===c){let e=setTimeout(()=>{L(!0),$(!0)},x.M);return()=>clearTimeout(e)}"disconnected"===c&&$(!0)}},[V,c,O,H]);let G=(0,m.useMemo)(()=>{let{pathname:e,search:t}=function(e){let t=new URL(e);return t.searchParams.delete(k),t.searchParams.delete(S),t}(new URL(p||"/",w));return`${e}${t}`},[p,w]),K=(0,m.useCallback)(()=>{r({type:oA})},[r]);return(0,m.useEffect)(()=>{if("function"==typeof t||null==t||!t.current)return;let e=t.current;function r(){e===document.activeElement&&e.dispatchEvent(new MouseEvent("mousedown",{bubbles:!0,cancelable:!0}))}return window.addEventListener("blur",r),()=>{window.removeEventListener("blur",r)}},[t]),(0,h.jsx)(sm,{transition:M?{duration:0}:void 0,children:(0,h.jsxs)(f.uE,{delay:1e3,children:[(0,h.jsx)(f.Zb,{flex:"none",padding:2,shadow:1,style:{position:"relative"},children:(0,h.jsxs)(f.kC,{align:"center",style:{minHeight:0},children:[P&&(0,h.jsx)(f.xu,{flex:"none",marginRight:1,padding:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.navigator.toggle-button.tooltip")}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.navigator.toggle-button.aria-label"),fontSize:1,icon:b.bl6,mode:"bleed",onClick:P,padding:2,selected:o})})}),(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsxs)(f.kC,{align:"center",style:{whiteSpace:"nowrap"},children:[(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.overlay.toggle-button.tooltip",{context:A?"disable":"enable"})})}),(0,h.jsx)(f.xu,{paddingY:1,children:(0,h.jsx)(v.SV0,{keys:["Alt"],style:{marginTop:-4,marginBottom:-4}})})]}),fallbackPlacements:["bottom-start"],padding:1,placement:"bottom",portal:!0,children:(0,h.jsx)(f.Zb,{as:"label",flex:"none",marginRight:1,padding:3,style:{lineHeight:0,borderRadius:999,userSelect:"none"},tone:A?"transparent":void 0,children:(0,h.jsxs)(f.kC,{align:"center",gap:3,children:[(0,h.jsx)("div",{style:{margin:-4},children:(0,h.jsx)(f.rs,{checked:A,onChange:E,disabled:"loading"===n.status||"connected"!==c})}),(0,h.jsx)(f.xu,{children:(0,h.jsx)(f.xv,{muted:!A,size:1,weight:"medium",children:C("preview-frame.overlay.toggle-button.text")})})]})})}),(0,h.jsx)(f.xu,{flex:1,marginX:1,children:(0,h.jsx)(o$,{prefix:(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:"loaded"===n.status?C("preview-frame.refresh-button.tooltip"):C("preview-frame.status",{context:n.status})}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.refresh-button.aria-label"),fontSize:1,icon:b.DuK,mode:"bleed",loading:"reloading"===n.status||"refreshing"===n.status,onClick:_,padding:2})})}),onChange:a,origin:U,suffix:(0,h.jsx)(f.xu,{padding:1,children:(0,h.jsx)(f.j2,{button:(0,h.jsx)(f.zx,{fontSize:1,iconRight:b.aAc,mode:"bleed",padding:2,space:2}),id:"location-menu",menu:(0,h.jsx)(f.v2,{children:(0,h.jsx)(oF,{initialUrl:i,openPopup:u,previewLocationOrigin:U,previewLocationRoute:G})}),popover:{animate:!0,constrainSize:!0,placement:"bottom",portal:!0}})}),value:G})}),(0,h.jsx)(f.kC,{align:"center",flex:"none",gap:1,padding:1,children:(0,h.jsx)(f.j2,{button:(0,h.jsx)(f.zx,{fontSize:1,iconRight:b.v4q,mode:"bleed",padding:2,space:2,text:C(oz["connected"===s?d:"previewDrafts"]),loading:"reconnecting"===s&&"loaded"!==n.status,disabled:"connected"!==s}),id:"perspective-menu",menu:(0,h.jsxs)(f.v2,{style:{maxWidth:240},children:[(0,h.jsx)(f.sN,{fontSize:1,onClick:()=>g("previewDrafts"),padding:3,pressed:"previewDrafts"===d,tone:"caution",children:(0,h.jsxs)(f.kC,{align:"flex-start",ga
59p:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,m.createElement)(oB.previewDrafts)})}),(0,h.jsxs)(f.Kq,{flex:1,space:2,children:[(0,h.jsx)(f.xv,{size:1,weight:"medium",children:C(oz.previewDrafts)}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.perspective.previewDrafts.text")})]}),(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{muted:!0,size:1,style:{opacity:"previewDrafts"===d?1:0},children:(0,h.jsx)(b.KML,{})})})]})}),(0,h.jsx)(f.sN,{fontSize:1,onClick:()=>g("published"),padding:3,pressed:"published"===d,tone:"positive",children:(0,h.jsxs)(f.kC,{align:"flex-start",gap:3,children:[(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{size:1,children:(0,m.createElement)(oB.published)})}),(0,h.jsxs)(f.Kq,{flex:1,space:2,children:[(0,h.jsx)(f.xv,{size:1,weight:"medium",children:C(oz.published)}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.perspective.published.text")})]}),(0,h.jsx)(f.xu,{flex:"none",children:(0,h.jsx)(f.xv,{muted:!0,size:1,style:{opacity:"published"===d?1:0},children:(0,h.jsx)(b.KML,{})})})]})})]}),popover:{animate:!0,constrainSize:!0,placement:"bottom",portal:!0}})}),(0,h.jsx)(f.kC,{align:"center",flex:"none",gap:1,children:(0,h.jsx)(f.u,{animate:!0,content:(0,h.jsx)(f.xv,{size:1,children:C("preview-frame.viewport-button.tooltip",{context:"desktop"===j?"narrow":"full"})}),fallbackPlacements:["bottom-start"],padding:2,placement:"bottom",portal:!0,children:(0,h.jsx)(f.zx,{"aria-label":C("preview-frame.viewport-button.aria-label"),fontSize:1,icon:"desktop"===j?b.RbG:b.ugZ,mode:"bleed",onClick:R,padding:2})})})]})}),(0,h.jsx)(f.Zb,{flex:1,tone:"transparent",children:(0,h.jsxs)(f.kC,{align:"center",height:"fill",justify:"center",padding:"desktop"===j?0:2,sizing:"border",style:{position:"relative",cursor:F?"wait":void 0},children:[(0,h.jsx)(sP,{children:I||V||O||!H||N?(V||"connecting"===c&&"refreshing"!==n.status)&&!N?(0,h.jsx)(o_,{initial:"initial",animate:"animate",exit:"exit",variants:oH,justify:"center",align:"center",style:{inset:"0",position:"absolute"},children:(0,h.jsxs)(f.kC,{style:{...oW[j]},justify:"center",align:"center",direction:"column",gap:4,children:[(0,h.jsx)(f.$j,{muted:!0}),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.status",{context:"loading"})})]})}):I&&!N?(0,h.jsx)(o_,{initial:"initial",animate:"animate",exit:"exit",variants:oq,justify:"center",align:"center",style:{background:"var(--card-bg-color)",inset:"0",position:"absolute",borderTop:"1px solid transparent",boxShadow:"0 0 0 1px var(--card-border-color)"},children:(0,h.jsx)(oo,{flex:1,message:C("preview-frame.connection.error.text"),onRetry:z,onContinueAnyway:B,children:T&&(0,h.jsxs)(h.Fragment,{children:["connected"!==c&&(0,h.jsx)(f.Zb,{padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:C("preview-frame.overlay.connection-status.label")}),(0,h.jsx)(f.EK,{size:1,children:C("channel.status",{context:c})})]})}),"connected"!==s&&(0,h.jsx)(f.Zb,{padding:3,radius:2,tone:"critical",children:(0,h.jsxs)(f.Kq,{space:3,children:[(0,h.jsx)(f.__,{muted:!0,size:0,children:C("preview-frame.loader.connection-status.label")}),(0,h.jsx)(f.EK,{size:1,children:C("channel.status",{context:s})})]})})]})})}):null:(0,h.jsx)(o_,{initial:"initial",animate:"animate",exit:"exit",variants:oH,justify:"center",align:"center",style:{inset:"0",position:"absolute",backdropFilter:D?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",transition:"backdrop-filter 0.2s ease-in-out",WebkitBackdropFilter:D?"blur(16px) saturate(0.5) grayscale(0.5)":"blur(2px)",WebkitTransition:"-webkit-backdrop-filter 0.2s ease-in-out",zIndex:1},children:(0,h.jsxs)(f.kC,{style:{...oW[j]},justify:"center",align:"center",direction:"column",gap:4,children:[D&&(0,h.jsx)(f.zx,{disabled:!0,fontSize:1,mode:"ghost",text:C("preview-frame.continue-button.text"),style:{opacity:0}}),(0,h.jsx)(f.Zb,{radius:2,tone:D?"caution":"inherit",padding:4,shadow:1,children:(0,h.jsxs)(f.kC,{justify:"center",align:"center",direction:"column",gap:4,children:[(0,h.jsx)(f.$j,{muted:!0}
59),(0,h.jsx)(f.xv,{muted:!0,size:1,children:C("preview-frame.status",D?{context:"timeout"}:{context:"connecting"})})]})}),D&&(0,h.jsx)(f.zx,{fontSize:1,tone:"critical",onClick:B,text:C("preview-frame.continue-button.text")})]})})}),(0,h.jsx)(oI,{ref:t,style:{pointerEvents:(V||"connecting"===c&&"refreshing"!==n.status)&&!N?"none":"auto",boxShadow:"0 0 0 1px var(--card-border-color)",borderTop:"1px solid transparent"},src:i.toString(),initial:["background"],variants:oG,animate:[(V||"connecting"===c&&"refreshing"!==n.status)&&!N?"background":"active",V?"reloading":"idle",j,H&&!N?"timedOut":""],onLoad:K})]})})]})})}),oW={desktop:{width:"100%",height:"100%"},mobile:{width:375,height:650}},oH={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},oq={initial:{opacity:1},animate:{opacity:[0,0,1]},exit:{opacity:[1,0,0]}},oG={desktop:{...oW.desktop,boxShadow:"0 0 0 0px var(--card-border-color)"},mobile:{...oW.mobile,boxShadow:"0 0 0 1px var(--card-border-color)"},background:{opacity:0,scale:1},idle:{scale:1},reloading:{scale:[1,1,1,.98]},active:{opacity:[0,0,1],scale:1},timedOut:{opacity:[0,0,1]}},oK=!1;function oZ(e,t){return e instanceof Function?e(t):e}function oX(e){return Object.fromEntries(Object.entries(e).filter(([,e])=>void 0!==e&&""!==e&&null!==e))}let oY=Symbol(),oJ=(0,m.lazy)(()=>r.e(1140).then(r.bind(r,11140))),oQ=(0,m.lazy)(()=>r.e(5054).then(r.bind(r,35054))),o0=(0,y.zo)(f.kC)`
60  overflow-x: auto;
61`;function o1(e){var t,r,n,i;let{previewUrl:s,components:o}=null!=(t=e.tool.options)?t:{},a=e.tool.name||x.D,{unstable_navigator:l}=o||{},{navigate:u,state:c}=(0,g.tv)(),d=(0,v.BoV)(Object.fromEntries(c._searchParams||[])),y=function(e,t,r){var n,i;let s=(0,v.m85)({apiVersion:x.A}),o=(0,v.AJ_)(),a=(null==(n=null==o?void 0:o.activeWorkspace)?void 0:n.basePath)||"/",l=function(e,t,r,n){let[i,s]=(0,m.useState)(()=>n||""),o=(0,m.useRef)(0);(0,m.useEffect)(()=>{if(i&&n)return window.clearTimeout(o.current),()=>{o.current=window.setTimeout(()=>{s("")},100)}},[i,n]);let a=(0,v.xJ)();return(0,m.useMemo)(()=>["@sanity/presentation",t,r,e,null==a?void 0:a.id,oY,i],[t,null==a?void 0:a.id,e,r,i])}(t,a,(null==(i=null==o?void 0:o.activeWorkspace)?void 0:i.name)||"default",r),u=function(e,t){let r=(0,v.m85)({apiVersion:x.A}),n=(0,v.xJ)(),[i,s]=(0,m.useState)(""),o=e?sM(async()=>await sj(r,"@sanity/presentation",typeof window>"u"?"":location.href,null==n?void 0:n.id),[...t,i]):null;return(0,m.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>{(0,m.startTransition)(()=>s(o.expiresAt.toString()))},o.expiresAt.getTime()-Date.now());return()=>clearTimeout(e)},[o]),(null==o?void 0:o.secret)||null}("object"==typeof e||"function"==typeof e,l);return sM(async()=>{if("string"==typeof e){let t=new URL(e,location.origin),n=t;try{if(r){let e=new URL(r,t);e.origin===t.origin&&(n=e)}else if(document.referrer){let e=new URL(document.referrer);e.origin===t.origin&&(n=e)}}catch{}return location.origin===n.origin&&(n.pathname.startsWith(`${a}/`)||n.pathname===a)?t:n}let t=await ("object"==typeof e?function(e){let{draftMode:t,previewMode:r,origin:n=typeof location>"u"?"https://localhost":location.origin}=e,i=(null==r?void 0:r.enable)||(null==t?void 0:t.enable),{preview:s="/"}=e,o=new URL(s,n),a=i?new URL(i,n):void 0;return async t=>{try{if(t.previewSearchParam){let e=new URL(t.previewSearchParam,o);e.origin===o.origin&&(s=`${e.pathname}${e.search}`)}else if(t.referrer){let e=new URL(t.referrer);e.origin===o.origin&&(s=`${e.pathname}${e.search}`)}}catch{}"u">typeof location&&location.origin===o.origin&&t.studioBasePath&&(s.startsWith(`${t.studioBasePath}/`)||s===t.studioBasePath)&&(s=e.preview||"/");let r=new URL(s,o);if(a){let e=new URL(a),{searchParams:n}=e;return n.set(S,t.previewUrlSecret),r.pathname!==e.pathname&&n.set(k,`${r.pathname}${r.search}`),e.toString()}return r.toString()}}(e):e)({client:s,previewUrlSecret:u,previewSearchParam:r,referrer:typeof document>"u"?null:document.referrer,studioBasePath:a});return new URL(t,location.origin)},[...l,u])}(s||"/",a,d.preview||null),[b]=(0,m.useState)(()=>{var t;let r=null==(t=e.tool.options)?void 0:t.devMode;return"function"==typeof r?r():"boolean"==typeof r?r:"u">typeof window&&"localhost"===window.location.hostname}),w=(0,m.useMemo)(()=>y.origin,[y.origin]),P=(0,m.useRef)(null),[E,j]=(0,m.useState)(),[A,C]=(0,m.useState)({}),T=(0,m.useRef)({title:void 0,url:void 0}
61),{navigate:M,params:R,searchParams:V,structureParams:D}=function({initialPreviewUrl:e,routerNavigate:t,routerState:r,routerSearchParams:n,frameStateRef:i}){let s=(0,m.useMemo)(()=>{let{id:t,path:i,type:s}={id:function(e){var t;if(void 0===e)return;let r=null==(t=decodeURIComponent(e))?void 0:t.split(".");return"drafts"===r[0]&&r.shift(),r.join(".")}(r.id),path:function(e){if(void 0!==e)return p.eT.toString(function(e){let t=[];for(let r of e.split(".")){let e=sK.exec(r);if(e){t.push(e[1],Number(e[2]));continue}let n=sZ.exec(r);if(n){t.push(n[1],[Number(n[2]),Number(n[3])]);continue}let i=sX.exec(r);i?t.push(i[1],{_key:i[2]}):t.push(r)}return t}(decodeURIComponent(e)))}(r.path),type:r.type};return{id:t,type:s,path:i,preview:n.preview||`${e.pathname}${e.search}`,perspective:n.perspective,viewport:n.viewport,inspect:n.inspect,rev:n.rev,prefersLatestPublished:n.prefersLatestPublished,since:n.since,template:n.template,templateParams:n.templateParams,view:n.view,pathKey:n.pathKey,instruction:n.instruction,comment:n.comment}},[r,n,e]),o=(0,m.useMemo)(()=>oX({inspect:s.inspect,path:s.path,rev:s.rev,prefersLatestPublished:s.prefersLatestPublished,since:s.since,template:s.template,templateParams:s.templateParams,view:s.view,pathKey:s.pathKey,instruction:s.instruction,comment:s.comment}),[s.comment,s.inspect,s.instruction,s.path,s.pathKey,s.prefersLatestPublished,s.rev,s.since,s.template,s.templateParams,s.view]),a=(0,m.useMemo)(()=>oX({perspective:s.perspective,preview:s.preview,viewport:s.viewport}),[s.perspective,s.preview,s.viewport]),l=(0,m.useRef)(r);return(0,m.useEffect)(()=>{l.current=r},[r]),{navigate:(0,m.useCallback)((e,r={},n)=>{e.id&&(e.id=(0,v.vsM)(e.id));let{_searchParams:s,...o}=l.current,a=(s||[]).reduce((e,[t,r])=>(e[t]=r,e),{}),u=oX({...o,...e}),c=oX({...a,...r});o.id!==u.id&&(delete c.template,delete c.templateParams),u._searchParams=Object.entries(c).reduce((e,[t,r])=>[...e,[t,r]],[]),t(u,{replace:null!=n?n:c.preview===i.current.url})},[t,i]),params:s,searchParams:a,structureParams:o}}({initialPreviewUrl:y,routerNavigate:u,routerState:c,routerSearchParams:d,frameStateRef:T}),L=(0,m.useMemo)(()=>s1(M,50),[M]),[O,I]=(0,m.useReducer)(oR,{},oO),$=(0,m.useMemo)(()=>R.perspective?"published":"previewDrafts",[R.perspective]),F=(0,m.useMemo)(()=>R.viewport?"mobile":"desktop",[R.viewport]),[U,_]=function(e,t){if("published"!==e&&"previewDrafts"!==e)throw Error(`Invalid perspective: ${e}`);let[r,n]=(0,m.useState)({}),[i,s]=(0,m.useState)({}),o=(0,m.useRef)(""),a=(0,m.useCallback)((e,r,i=[])=>{let a=i.filter(e=>"_projectId"in e&&e._projectId?(oK||(console.warn("Cross dataset references are not supported yet, ignoring source document",e),oK=!0),!1):e);("published"===r?n:s)(r=>{let n={};for(let e of a)n[e._id]=e;return o.current!==t.current.url?(o.current=t.current.url,{[e]:n}):sS(r[e],n)?r:{...r,[e]:n}})},[t]);return[(0,m.useMemo)(()=>Object.values(Object.values("published"===e?r:i).reduce((e,t)=>(Object.values(t).forEach(t=>{e[t._id]=t}),e),{})),[e,i,r]),a]}($,T),z=(0,v.vpR)(),B=(0,v.p9V)(),N=function(e){let{navigate:t,resolvers:r=[],path:n,previewUrl:i}=e,{state:s}=(0,g.tv)(),o=(0,v.m85)({apiVersion:x.A}),[a,l]=(0,m.useState)(void 0),u=(0,m.useRef)(void 0),c=(0,m.useMemo)(()=>{var e,t;return new URL(n||(null==(t=null==(e=s._searchParams)?void 0:e.find(([e])=>"preview"===e))?void 0:t[1])||"","string"==typeof i?i:"object"==typeof i&&(null==i?void 0:i.origin)||location.origin)},[n,i,s._searchParams]),d=(0,m.useCallback)(()=>{l(void 0),u.current=void 0},[]);return(0,m.useEffect)(()=>{var e,n,i,s,a;if(r.length&&c){let d;for(let e of r){let t=function(e,t){for(e of Array.isArray(e)?e:[e]){let r,n=e;if("string"==typeof e)try{let t=new URL(e);r=t.origin,n=t.pathname}catch{}if(!r||t.origin===r)try{let e=(function(e,t){var r=[];return function(e,t,r){void 0===r&&(r={});var n=r.decode,i=void 0===n?function(e){return e}:n;return function(r){var n=e.exec(r);if(!n)return!1;for(var s=n[0],o=n.index,a=Object.create(null),l=1;l<n.length;l++)!function(e){if(void 0!==n[e]){var r=t[e-1];"*"===r.modifier||"+"===r.modifier?a[r.name]=n[e].split(r.prefix+r.suffix).map(function(e){return i(e,r)}):a[r.name]=i(n[e],r)}}(l);return{path:s,index:o,params:a}}}(function e(t,r,n){var i;return t instanceof RegExp?function(e,t){if(!t)return e;for(var r=/\((?:\?<(.*?)>)?(?!\?)/g,n=0,i=r.exec(e.source);i;)t.push({name:i[1]||n++,prefix:"",suffix:"",modifier:"",pattern:""}),i=r.exec(e.source);return e}(t,r):Array.isArray(t)?(i=t.map(function(t){return e(t,r,n).source}),new RegExp("(?:".concat(i.join("|"),")"),sA(n))):function(e,t,r){void 0===r&&(r={});for(var n=r.strict,i=void 0!==n&&n,s=r.start,o=r.end,a=r.encode,l=void 0===a?function(e){return e}:a,u=r.delimiter,c=r.endsWith,d="[".concat(sk(void 0===c?"":c),"]|$"),h="[".concat(sk(void 0===u?"/#?":u),"]"),p=void 0===s||s?"^":"",f=0;f<e.length;f++){var m=e[f];if("string"==typeof m)p+=sk(l(m));else{var v=sk(l(m.prefix)),g=sk(l(m.suffix));if(m.pattern){if(t&&t.push(m),v||g){if("+"===m.modifier||"*"===m.modifier){var y="*"===m.modifier?"?":"";p+="(?:".concat(v,"((?:").concat(m.pattern,")(?:").concat(g).concat(v,"(?:").concat(m.pattern,"))*)").concat(g,")").concat(y)}else p+="(?:".concat(v,"(").concat(m.pattern,")").concat(g,")").concat(m.modifier)}else{if("+"===m.modifier||"*"===m.modifier)throw TypeError('Can not repeat "'.concat(m.name,'" without a prefix and suffix'));p+="(".concat(m.pattern,")").concat(m.modifier)}}else p+="(?:".concat(v).concat(g,")").concat(m.modifier)}}if(void 0===o||o)i||(p+="".concat(h,"?")),p+=r.endsWith?"(?=".concat(d,")"):"$";else{var x=e[e.length-1],b="string"==typeof x?h.indexOf(x[x.length-1])>-1:void 0===x;i||(p+="(?:".concat(h,"(?=").concat(d,"))?")),b||(p+="(?=".concat(h,"|").concat(d,")"))}return new RegExp(p,sA(r))}(function(e,t){void 0===t&&(t={});for(var r=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if("*"===n||"+"===n||"?"===n){t.push({type:"MODIFIER",index:r,value:e[r++]});continue}if("\\"===n){t.push({type:"ESCAPED_CHAR",index:r++,value:e[r++]});continue}if("{"===n){t.push({type:"OPEN",index:r,value:e[r++]});continue}if("}"===n){t.push({type:"CLOSE",index:r,value:e[r++]});continue}if(":"===n){for(var i="",s=r+1;s<e.length;){var o=e.charCodeAt(s);if(o>=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122||95===o){i+=e[s++];continue}break}if(!i)throw TypeError("Missing parameter name at ".concat(r));t.push({type:"NAME",index:r,value:i}),r=s;continue}if("("===n){var a=1,l="",s=r+1;if("?"===e[s])throw TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<e.length;){if("\\"===e[s]){l+=e[s++]+e[s++];continue}
61if(")"===e[s]){if(0==--a){s++;break}}else if("("===e[s]&&(a++,"?"!==e[s+1]))throw TypeError("Capturing groups are not allowed at ".concat(s));l+=e[s++]}if(a)throw TypeError("Unbalanced pattern at ".concat(r));if(!l)throw TypeError("Missing pattern at ".concat(r));t.push({type:"PATTERN",index:r,value:l}),r=s;continue}t.push({type:"CHAR",index:r,value:e[r++]})}return t.push({type:"END",index:r,value:""}),t}(e),n=t.prefixes,i=void 0===n?"./":n,s=t.delimiter,o=void 0===s?"/#?":s,a=[],l=0,u=0,c="",d=function(e){if(u<r.length&&r[u].type===e)return r[u++].value},h=function(e){var t=d(e);if(void 0!==t)return t;var n=r[u],i=n.type,s=n.index;throw TypeError("Unexpected ".concat(i," at ").concat(s,", expected ").concat(e))},p=function(){for(var e,t="";e=d("CHAR")||d("ESCAPED_CHAR");)t+=e;return t},f=function(e){for(var t=0;t<o.length;t++){var r=o[t];if(e.indexOf(r)>-1)return!0}return!1},m=function(e){var t=a[a.length-1],r=e||(t&&"string"==typeof t?t:"");if(t&&!r)throw TypeError('Must have text between two parameters, missing text after "'.concat(t.name,'"'));return!r||f(r)?"[^".concat(sk(o),"]+?"):"(?:(?!".concat(sk(r),")[^").concat(sk(o),"])+?")};u<r.length;){var v=d("CHAR"),g=d("NAME"),y=d("PATTERN");if(g||y){var x=v||"";-1===i.indexOf(x)&&(c+=x,x=""),c&&(a.push(c),c=""),a.push({name:g||l++,prefix:x,suffix:"",pattern:y||m(x),modifier:d("MODIFIER")||""});continue}var b=v||d("ESCAPED_CHAR");if(b){c+=b;continue}if(c&&(a.push(c),c=""),d("OPEN")){var x=p(),w=d("NAME")||"",P=d("PATTERN")||"",E=p();h("CLOSE"),a.push({name:w||(P?l++:""),pattern:w&&!P?m(x):P,prefix:x,suffix:E,modifier:d("MODIFIER")||""});continue}h("END")}return a}(t,n),r,n)}(e,r,t),r,t)})(n,{decode:decodeURIComponent})(t.pathname);if(e){let{params:t,path:n}=e;return{origin:r,params:t,path:n}}}catch{throw Error(`"${e}" is not a valid route pattern`)}}}(e.route,c);if(t){d={context:t,resolver:e};break}}if(d){let r=function(e,t){var r;if(e.resolve){let n=null==(r=e.resolve(t))?void 0:r.filter;return n?`*[${n}][0]{_id, _type}`:void 0}return"type"in e?`*[_type == "${e.type}"][0]{_id, _type}`:`*[${oZ(e.filter,t)}][0]{_id, _type}`}(d.resolver,d.context),h=(e=d.resolver,n=d.context,e.resolve?null!=(s=null==(i=e.resolve(n))?void 0:i.params)?s:n.params:"type"in e?{}:null!=(a=oZ(e.params,n))?a:n.params);if(r){let e=new AbortController,n={perspective:"previewDrafts",signal:e.signal};return o.fetch(r,h,n).then(e=>{e&&u.current===e._id||(l({document:e,path:c.pathname}),null==t||t({id:null==e?void 0:e._id,type:null==e?void 0:e._type}),u.current=null==e?void 0:e._id)}).catch(e=>{e instanceof Error&&"AbortError"===e.name||(l({document:void 0,path:c.pathname}),u.current=void 0)}),()=>{e.abort()}}}}d()},[o,d,t,r,c]),a}({resolvers:null==(n=null==(r=e.tool.options)?void 0:r.resolve)?void 0:n.mainDocuments,previewUrl:null==(i=e.tool.options)?void 0:i.previewUrl,path:R.preview,navigate:M}),[W,H]=(0,m.useState)("connecting"),[q,G]=(0,m.useState)("connecting"),[K,Z]=(0,m.useState)("connecting"),[X]=(0,m.useState)(()=>new Set),Y=(0,m.useCallback)(e=>{let t=window.open(e,"_blank");t&&X.add(t)},[X]);(0,m.useEffect)(()=>{if(X.size&&E)for(let e of X)e&&"closed"in e&&!e.closed&&E.addSource(e)},[E,X,X.size]);let J=(0,m.useRef)($);(0,m.useEffect)(()=>{J.current=$},[$]),(0,m.useEffect)(()=>{var e;let t=null==(e=P.current)?void 0:e.contentWindow;if(!t)return;let r=function(e){let{destroy:t,send:r}=s_(e),n=new Set,i=new WeakMap,s=new Set;return{destroy:()=>{for(let e of(t(),s))e()},send:(e,...t)=>{for(let s of(r(e,...t),n))s&&"closed"in s&&!s.closed&&i.has(s)&&i.get(s)(e,...t)},addSource(t){if(n.has(t))return;if(!("closed"in t))throw console.warn("Source is unsupported",{source:t}),Error("Source is unsupported");if(t.closed)throw Error("Source is closed");let{send:r,destroy:o}=s_({...e,target:t,connectTo:e.connectTo.map(e=>{let{onStatusUpdate:t,onEvent:r,...n}=e;return{...n,onEvent:r?(...e)=>{let[t]=e;if("preview-kit/documents"!==t&&"overlay/navigate"!==t&&"loader/documents"!==t)return r(...e)}:void 0}})});s.add(o),i.set(t,r),n.add(t)}}}({id:"presentation",target:t,targetOrigin:w,connectTo:[{id:"overlays",heartbeat:!0,onStatusUpdate:H,onEvent(e,t){if(("visual-editing/focus"===e||"overlay/focus"===e)&&"id"in t)L({type:t.type,id:t.id,path:t.path},{prefersLatestPublished:"isDraft"in t||"previewDrafts"===J.current?void 0:"true"});else if("visual-editing/navigate"===e||"overlay/navigate"===e){let{title:e,url:r}=t;T.current.url!==r&&L({},{preview:r}),T.current={title:e,url:r}}else"visual-editing/meta"===e?T.current.title=t.title:"visual-editing/toggle"===e||"overlay/toggle"===e?I({type:oM,enabled:t.enabled}):"visual-editing/documents"===e?_("visual-editing",t.perspective,t.documents):"visual-editing/refreshing"===e&&"manual"===t.source?clearTimeout(eh.current):"visual-editing/refreshing"===e&&"mutation"===t.source?I({type:oC}):"visual-editing/refreshed"===e&&I({type:oA})}},{id:"loaders",heartbeat:!0,onStatusUpdate:G,onEvent(e,t){if("loader/documents"===e&&t.projectId===z&&t.dataset===B)_("loaders",t.perspective,t.documents);else if("loader/query-listen"===e&&t.projectId===z&&t.dataset===B){if
61("number"==typeof t.heartbeat&&t.heartbeat<x.c)throw Error(`Loader query listen heartbeat interval must be at least ${x.c}ms`);C(e=>{var r,n,i;return{...e,[(n=t.query,i=t.params,`${n}-${"string"==typeof i?i:JSON.stringify(i)}`)]:{perspective:t.perspective,query:t.query,params:t.params,receivedAt:Date.now(),heartbeat:null!=(r=t.heartbeat)&&r}}})}}},{id:"preview-kit",heartbeat:!0,onStatusUpdate:Z,onEvent(e,t){"preview-kit/documents"===e&&t.projectId===z&&t.dataset===B&&_("preview-kit",t.perspective,t.documents)}}]});return j(r),()=>{r.destroy(),j(void 0)}},[B,z,_,L,w]),(0,m.useEffect)(()=>{let e=setInterval(()=>C(e=>{if(Object.keys(e).length<1)return e;let t=Date.now();if(!Object.values(e).some(e=>!1!==e.heartbeat&&t>e.receivedAt+e.heartbeat))return e;let r={};for(let[n,i]of Object.entries(e))!1!==i.heartbeat&&t>i.receivedAt+i.heartbeat||(r[n]=i);return r}),x.c);return()=>clearInterval(e)},[]);let Q=(0,m.useCallback)(e=>{L({path:p.eT.toString(e)},{},!0)},[L]),ee=(0,m.useCallback)(e=>{let t=new URL(e,y.origin),r=t.pathname+t.search;t.origin===y.origin&&r!==R.preview&&L({},{preview:r})},[y,R,L]),et=(0,m.useCallback)(e=>{L({},{...e,prefersLatestPublished:void 0})},[L]);(0,m.useEffect)(()=>{null==E||E.send("overlays","presentation/perspective",{perspective:$})},[E,$]),(0,m.useEffect)(()=>{R.id&&R.path?null==E||E.send("overlays","presentation/focus",{id:R.id,path:R.path}):null==E||E.send("overlays","presentation/blur",void 0)},[E,R.id,R.path]);let er=(0,m.useRef)(void 0);(0,m.useEffect)(()=>{"published"!==$||!R.id||R.id===er.current||R.rev||R.prefersLatestPublished||L({},{prefersLatestPublished:"true"},!0),er.current=R.id},[L,R.id,R.prefersLatestPublished,R.rev,$]),(0,m.useEffect)(()=>{T.current.url&&R.preview&&T.current.url!==R.preview&&(T.current.url=R.preview,"connected"!==W&&P.current?P.current.src=`${w}${R.preview}`:null==E||E.send("overlays","presentation/navigate",{url:R.preview,type:"replace"}))},[E,W,w,R.preview]);let en=(0,m.useCallback)(()=>null==E?void 0:E.send("overlays","presentation/toggleOverlay",void 0),[E]),[ei,es]=(0,m.useState)(null);(0,m.useEffect)(()=>{let e=e=>{s0(e)&&en()},t=e=>{s0(e)&&en(),["mod","\\"].every(t=>sQ[t]?e[sQ[t]]:e.key===t.toUpperCase())&&en()};return window.addEventListener("keydown",t),window.addEventListener("keyup",e),()=>{window.removeEventListener("keydown",t),window.removeEventListener("keyup",e)}},[en]);let[eo,ea]=(0,m.useState)(null),[{navigatorEnabled:el,toggleNavigator:eu},ec]=function(e){let{unstable_navigator:t}=e,r=!(null==t||!t.component),[n,i]=function(e,t){let[r,n]=(0,m.useState)(()=>{var r;return JSON.parse(null!=(r=localStorage.getItem(e))?r:JSON.stringify(t))});return(0,m.useEffect)(()=>{localStorage.setItem(e,JSON.stringify(r))},[e,r]),[r,n]}("presentation/navigator",r),s=!!r&&n,o=(0,m.useMemo)(()=>{if(r)return()=>i(e=>!e)},[r,i]),a=(0,m.useCallback)(function(){return(0,h.jsx)(h.Fragment,{children:s&&(0,h.jsx)(oj,{...t})})},[s,t]);return[{navigatorEnabled:s,toggleNavigator:o},a]}({unstable_navigator:l}),ed=(0,m.useRef)(R.id);(0,m.useEffect)(()=>{R.rev&&ed.current&&R.id!==ed.current&&L({},{rev:void 0}),ed.current=R.id});let eh=(0,m.useRef)(),ep=(0,m.useCallback)(e=>{if(I({type:oC}),E)return eh.current=window.setTimeout(e,300),void E.send("overlays","presentation/refresh",{source:"manual",livePreviewEnabled:"connected"===K||"connected"===q});e()},[E,q,K]),ef=(0,v.cFj)(),em=(0,m.useCallback)(({id:e,type:t,path:r})=>{if(T.current.url)return{title:T.current.title||T.current.url,name:"edit",params:{id:e,path:r,type:t,inspect:x.C,workspace:ef.name,mode:x.E,preview:R.preview}}},[R.preview,ef.name]),ev=(0,m.useCallback)(e=>{L({},{viewport:"desktop"===e?void 0:"mobile"},!0)},[L]),eg=(0,m.useCallback)(e=>{L({},{perspective:"previewDrafts"===e?void 0:e})},[L]);return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(ok,{devMode:b,name:a,navigate:L,params:R,searchParams:V,structureParams:D,children:(0,h.jsx)(oE,{navigate:L,children:(0,h.jsx)(oS,{params:R,children:(0,h.jsx)(o0,{height:"fill",children:(0,h.jsxs)(os,{children:[(0,h.jsx)(ec,{}),(0,h.jsx)(s3,{id:"preview",minWidth:325,defaultSize:el?50:75,order:3,children:(0,h.jsx)(f.kC,{direction:"column",flex:1,height:"fill",ref:ea,children:(0,h.jsx)(f.NM,{element:eo,children:(0,h.jsx)(oN,{dispatch:I,iframe:O.
61iframe,initialUrl:y,loadersConnection:q,navigatorEnabled:el,onPathChange:ee,onRefresh:ep,openPopup:Y,overlaysConnection:W,previewUrl:R.preview,perspective:$,ref:P,setPerspective:eg,setViewport:ev,targetOrigin:w,toggleNavigator:eu,toggleOverlay:en,viewport:F,visualEditing:O.visualEditing})})})}),(0,h.jsx)(oP,{documentId:R.id,documentsOnPage:U,documentType:R.type,getCommentIntent:em,mainDocumentState:N,onFocusPath:Q,onStructureParams:et,searchParams:V,setDisplayedDocument:es,structureParams:D})]})})})})}),E&&(0,h.jsx)(m.Suspense,{children:(0,h.jsx)(oJ,{channel:E,liveQueries:A,perspective:$,liveDocument:ei,documentsOnPage:U})}),E&&R.id&&R.type&&(0,h.jsx)(m.Suspense,{children:(0,h.jsx)(oQ,{channel:E,id:R.id,type:R.type,loadersConnection:q,previewKitConnection:K})})]})}}}]);

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.