sanity-plugin-tags-v4 1.0.7 → 1.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{index-2165dd09.js → index-672a6732.js} +124 -84
- package/dist/_chunks/index-672a6732.js.map +1 -0
- package/dist/_chunks/{index-8ec314f1.js → index-f99f99ae.js} +124 -84
- package/dist/_chunks/index-f99f99ae.js.map +1 -0
- package/dist/_chunks/{refractor-86932f9e.js → refractor-8ecfc7e2.js} +2 -2
- package/dist/_chunks/{refractor-86932f9e.js.map → refractor-8ecfc7e2.js.map} +1 -1
- package/dist/_chunks/{refractor-44595dc0.js → refractor-c877e656.js} +2 -2
- package/dist/_chunks/{refractor-44595dc0.js.map → refractor-c877e656.js.map} +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -7
- package/src/components/TagsInput.tsx +18 -10
- package/src/index.ts +1 -0
- package/dist/_chunks/index-2165dd09.js.map +0 -1
- package/dist/_chunks/index-8ec314f1.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _process$env,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject0,_templateObject1,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21,_templateObject22,_templateObject23,_templateObject24,_templateObject25,_templateObject26,_templateObject27,_templateObject28,_templateObject29,_templateObject30,_templateObject31,_templateObject32,_templateObject33,_templateObject34,_templateObject35,_templateObject36,_templateObject37,_templateObject38,_templateObject39,_templateObject40,_templateObject41,_templateObject42,_templateObject43,_templateObject44,_templateObject45,_templateObject46,_templateObject47,_templateObject48,_templateObject49,_templateObject50,_templateObject51,_templateObject52,_templateObject53,_templateObject54,_templateObject55,_templateObject56,_templateObject57,_templateObject58,_templateObject59,_templateObject60,_templateObject61,_templateObject62,_templateObject63,_templateObject64,_templateObject65,_templateObject66,_templateObject67,_templateObject68,_templateObject69,_templateObject70,_templateObject71,_templateObject72,_templateObject73,_templateObject74,_templateObject75,_templateObject76,_templateObject77,_templateObject78,_templateObject79,_templateObject80,_templateObject81,_templateObject82,_templateObject83,_templateObject84,_templateObject85,_templateObject86,_templateObject87,_templateObject88;const _excluded=["crossAxis","alignment","allowedPlacements","autoAlignment"],_excluded2=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],_excluded3=["strategy"],_excluded4=["mainAxis","crossAxis","limiter"],_excluded5=["type"],_excluded6=["motionValue","onUpdate","onComplete","element"],_excluded7=["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"],_excluded8=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"],_excluded9=["transitionEnd","transition"],_excluded0=["transition","transitionEnd"],_excluded1=["willChange"],_excluded10=["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"],_excluded11=["transition","transitionEnd"],_excluded12=["transitionEnd","transition"],_excluded13=["root"],_excluded14=["accent","align","children","muted","size","textOverflow","weight"],_excluded15=["__unstable_hideInnerStroke","as","color","src","title","initials","onImageLoadError","arrowPosition","animateArrowFrom","status","size"],_excluded16=["children","maxLength","size"],_excluded17=["as","column","columnStart","columnEnd","display","flex","height","margin","marginX","marginY","marginTop","marginRight","marginBottom","marginLeft","overflow","padding","paddingX","paddingY","paddingTop","paddingRight","paddingBottom","paddingLeft","row","rowStart","rowEnd","sizing"],_excluded18=["accent","align","children","muted","size","textOverflow","weight"],_excluded19=["children","fontSize","mode","padding","radius","tone"],_excluded20=["align","as","direction","gap","justify","wrap"],_excluded21=["children","disabled","fontSize","icon","iconRight","justify","loading","mode","padding","paddingX","paddingY","paddingTop","paddingBottom","paddingLeft","paddingRight","radius","selected","space","text","textAlign","textWeight","tone","type","muted","width"],_excluded22=["__unstable_checkered","__unstable_focusRing","as","border","borderTop","borderRight","borderBottom","borderLeft","muted","pressed","radius","scheme","selected","shadow","tone"],_excluded23=["checked","className","disabled","indeterminate","customValidity","readOnly","style"],_excluded24=["children","language","size","weight"],_excluded25=["as","width"],_excluded26=["as","autoRows","autoCols","autoFlow","columns","gap","gapX","gapY","rows","children"],_excluded27=["accent","align","children","muted","size","textOverflow","weight"],_excluded28=["as","children","space"],_excluded29=["children","fontSize","padding","radius"],_excluded30=["width","height","radius"],_excluded31=["children","media"],_excluded32=["children","onActivate","onFocus","style"],_excluded33=["children","zOffset"],_excluded34=["as","gap","getItemKey","items","onChange","renderItem"],_excluded35=["__unstable_margins","animate","arrow","arrowRef","arrowX","arrowY","children","padding","placement","originX","originY","overflow","radius","scheme","shadow","strategy","style","tone","width","x","y"],_excluded36=["__unstable_margins","animate","arrow","boundaryElement","children","constrainSize","content","disabled","fallbackPlacements","matchReferenceWidth","floatingBoundary","modal","onActivate","open","overflow","padding","placement","placementStrategy","portal","preventOverflow","radius","referenceBoundary","referenceElement","scheme","shadow","tone","width","zOffset","updateRef"],_excluded37=["className","disabled","style","customValidity","readOnly"],_excluded38=["children","customValidity","disabled","fontSize","padding","radius","readOnly","space"],_excluded39=["as","space"],_excluded40=["checked","className","disabled","indeterminate","readOnly","style"],_excluded41=["border","customValidity","disabled","fontSize","padding","radius","weight","__unstable_disableFocusRing"],_excluded42=["__unstable_disableFocusRing","border","clearButton","disabled","fontSize","icon","iconRight","onClear","padding","prefix","radius","readOnly","space","suffix","customValidity","type","weight"],_excluded43=["animate","arrow","arrowRef","arrowX","arrowY","children","originX","originY","padding","placement","radius","scheme","shadow","style"],_excluded44=["animate","arrow","boundaryElement","children","content","disabled","fallbackPlacements","padding","placement","portal","radius","scheme","shadow","zOffset","delay"],_excluded45=["fontSize","keys","padding","radius","space"],_excluded46=["children","focusFirst","focusLast","onClickOutside","onEscape","onItemClick","onItemSelect","onKeyDown","originElement","padding","registerElement","shouldFocus","space"],_excluded47=["as","children","disabled","fontSize","hotkeys","icon","iconRight","onClick","padding","paddingX","paddingY","paddingTop","paddingRight","paddingBottom","paddingLeft","pressed","radius","selected","space","text","tone"],_excluded48=["icon","id","focused","fontSize","label","onClick","onFocus","padding","selected"],_excluded49=["children"],_excluded50=["border","customValidity","disabled","filterOption","fontSize","icon","id","listBox","loading","onBlur","onChange","onFocus","onQueryChange","onSelect","openButton","openOnFocus","options","padding","popover","prefix","radius","readOnly","relatedElements","renderOption","renderPopover","renderValue","suffix","value"],_excluded51=["children","maxLength","separator","space"],_excluded52=["__unstable_autoFocus","__unstable_hideCloseButton","cardRadius","cardShadow","children","contentRef","footer","header","id","onActivate","onClickOutside","onClose","onFocus","padding","portal","position","scheme","width","zOffset","animate"],_excluded53=["animated","delay","radius"],_excluded54=["size"],_excluded55=["size"],_excluded56=["size"],_excluded57=["size"],_excluded58=["flex"],_excluded59=["children","space","onFocus"];function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}import{useClient as useClient$1,useFormValue,set,unset,definePlugin}from'sanity';import{jsx,Fragment,jsxs}from'react/jsx-runtime';import*as React$1 from'react';import React__default,{forwardRef,useLayoutEffect,createContext,useRef as useRef$1,useEffect as useEffect$1,useId,useContext,useInsertionEffect,useMemo,useCallback,Children,isValidElement as isValidElement$1,useState,createElement,Fragment as Fragment$1,Component,useImperativeHandle,lazy,cloneElement,useDebugValue,useSyncExternalStore,Suspense,useReducer,startTransition}from'react';import{css,styled,keyframes as keyframes$1,useTheme,ThemeProvider as ThemeProvider$1}from'styled-components';import*as ReactDOM from'react-dom';import{createPortal}from'react-dom';import Select$1 from'react-select';import CreatableSelect from'react-select/creatable';import{defer,from,pipe as pipe$1}from'rxjs';import{map,switchMap}from'rxjs/operators';const COLOR_HUES=["gray","blue","purple","magenta","red","orange","yellow","green","cyan"],COLOR_TINTS=["50","100","200","300","400","500","600","700","800","900","950"];const black={title:"Black",hex:"#0d0e12"},white={title:"White",hex:"#ffffff"},gray={50:{title:"Gray 50",hex:"#f6f6f8"},100:{title:"Gray 100",hex:"#eeeef1"},200:{title:"Gray 200",hex:"#e3e4e8"},300:{title:"Gray 300",hex:"#bbbdc9"},400:{title:"Gray 400",hex:"#9499ad"},500:{title:"Gray 500",hex:"#727892"},600:{title:"Gray 600",hex:"#515870"},700:{title:"Gray 700",hex:"#383d51"},800:{title:"Gray 800",hex:"#252837"},900:{title:"Gray 900",hex:"#1b1d27"},950:{title:"Gray 950",hex:"#13141b"}},blue={50:{title:"Blue 50",hex:"#f5f8ff"},100:{title:"Blue 100",hex:"#e5edff"},200:{title:"Blue 200",hex:"#dbe5ff"},300:{title:"Blue 300",hex:"#a8bfff"},400:{title:"Blue 400",hex:"#7595ff"},500:{title:"Blue 500",hex:"#556bfc"},600:{title:"Blue 600",hex:"#4043e7"},700:{title:"Blue 700",hex:"#2927aa"},800:{title:"Blue 800",hex:"#192457"},900:{title:"Blue 900",hex:"#161a41"},950:{title:"Blue 950",hex:"#101228"}},purple={50:{title:"Purple 50",hex:"#f8f5ff"},100:{title:"Purple 100",hex:"#f1ebff"},200:{title:"Purple 200",hex:"#ece1fe"},300:{title:"Purple 300",hex:"#ccb1fc"},400:{title:"Purple 400",hex:"#b087f7"},500:{title:"Purple 500",hex:"#8f57ef"},600:{title:"Purple 600",hex:"#721fe5"},700:{title:"Purple 700",hex:"#4c1a9e"},800:{title:"Purple 800",hex:"#2f1862"},900:{title:"Purple 900",hex:"#23173f"},950:{title:"Purple 950",hex:"#181128"}},magenta={50:{title:"Magenta 50",hex:"#fef6f9"},100:{title:"Magenta 100",hex:"#fde8ef"},200:{title:"Magenta 200",hex:"#fcdee9"},300:{title:"Magenta 300",hex:"#f7abc5"},400:{title:"Magenta 400",hex:"#f0709b"},500:{title:"Magenta 500",hex:"#e72767"},600:{title:"Magenta 600",hex:"#b11651"},700:{title:"Magenta 700",hex:"#7c1342"},800:{title:"Magenta 800",hex:"#4b1130"},900:{title:"Magenta 900",hex:"#341325"},950:{title:"Magenta 950",hex:"#1f0f14"}},red={50:{title:"Red 50",hex:"#fff6f5"},100:{title:"Red 100",hex:"#ffe7e5"},200:{title:"Red 200",hex:"#ffdedc"},300:{title:"Red 300",hex:"#fdada5"},400:{title:"Red 400",hex:"#f77769"},500:{title:"Red 500",hex:"#ef4434"},600:{title:"Red 600",hex:"#cc2819"},700:{title:"Red 700",hex:"#8b2018"},800:{title:"Red 800",hex:"#4d1714"},900:{title:"Red 900",hex:"#321615"},950:{title:"Red 950",hex:"#1e1011"}},orange={50:{title:"Orange 50",hex:"#fff7f0"},100:{title:"Orange 100",hex:"#ffeadb"},200:{title:"Orange 200",hex:"#ffddc7"},300:{title:"Orange 300",hex:"#ffb685"},400:{title:"Orange 400",hex:"#ff8e42"},500:{title:"Orange 500",hex:"#fa6400"},600:{title:"Orange 600",hex:"#b14802"},700:{title:"Orange 700",hex:"#7c3404"},800:{title:"Orange 800",hex:"#461e07"},900:{title:"Orange 900",hex:"#32160b"},950:{title:"Orange 950",hex:"#21120d"}},yellow={50:{title:"Yellow 50",hex:"#fefae1"},100:{title:"Yellow 100",hex:"#fcf3bb"},200:{title:"Yellow 200",hex:"#f9e994"},300:{title:"Yellow 300",hex:"#f7d455"},400:{title:"Yellow 400",hex:"#f9bc15"},500:{title:"Yellow 500",hex:"#d28a04"},600:{title:"Yellow 600",hex:"#965908"},700:{title:"Yellow 700",hex:"#653a0b"},800:{title:"Yellow 800",hex:"#3b220c"},900:{title:"Yellow 900",hex:"#271a11"},950:{title:"Yellow 950",hex:"#181410"}},green={50:{title:"Green 50",hex:"#e7fef5"},100:{title:"Green 100",hex:"#c5fce8"},200:{title:"Green 200",hex:"#a9f9dc"},300:{title:"Green 300",hex:"#59f3ba"},400:{title:"Green 400",hex:"#0ff0a1"},500:{title:"Green 500",hex:"#04b97a"},600:{title:"Green 600",hex:"#01794f"},700:{title:"Green 700",hex:"#015133"},800:{title:"Green 800",hex:"#023120"},900:{title:"Green 900",hex:"#06231a"},950:{title:"Green 950",hex:"#071715"}},cyan={50:{title:"Cyan 50",hex:"#e7fefe"},100:{title:"Cyan 100",hex:"#c5fcfc"},200:{title:"Cyan 200",hex:"#96f8f8"},300:{title:"Cyan 300",hex:"#62efef"},400:{title:"Cyan 400",hex:"#18e2e2"},500:{title:"Cyan 500",hex:"#04b8be"},600:{title:"Cyan 600",hex:"#037782"},700:{title:"Cyan 700",hex:"#024950"},800:{title:"Cyan 800",hex:"#042f34"},900:{title:"Cyan 900",hex:"#072227"},950:{title:"Cyan 950",hex:"#0d181c"}},hues={gray,blue,purple,magenta,red,orange,yellow,green,cyan},color$1=_objectSpread({black,white},hues);const defaultThemeConfig={avatar:{sizes:[{distance:-4,size:19},{distance:-4,size:25},{distance:-8,size:33},{distance:-12,size:49}],focusRing:{offset:1,width:1}},button:{textWeight:"medium",border:{width:1},focusRing:{offset:-1,width:1}},card:{border:{width:1},focusRing:{offset:-1,width:1},shadow:{outline:0.5}},container:[320,640,960,1280,1600,1920],media:[360,600,900,1200,1800,2400],layer:{dialog:{zOffset:600},popover:{zOffset:400},tooltip:{zOffset:200}},radius:[0,1,3,6,9,12,21],shadow:[null,{umbra:[0,0,0,0],penumbra:[0,0,0,0],ambient:[0,0,0,0]},{umbra:[0,3,5,-2],penumbra:[0,6,10,0],ambient:[0,1,18,1]},{umbra:[0,7,8,-4],penumbra:[0,12,17,2],ambient:[0,5,22,4]},{umbra:[0,9,11,-5],penumbra:[0,18,28,2],ambient:[0,7,34,6]},{umbra:[0,11,15,-7],penumbra:[0,24,38,3],ambient:[0,9,46,8]}],space:[0,4,8,12,20,32,52,84,136,220],input:{border:{width:1},checkbox:{size:17,focusRing:{offset:-1,width:1}},radio:{size:17,markSize:9,focusRing:{offset:-1,width:1}},switch:{width:25,height:17,padding:5,transitionDurationMs:150,transitionTimingFunction:"ease-out",focusRing:{offset:1,width:1}},select:{focusRing:{offset:-1,width:1}},text:{focusRing:{offset:-1,width:1}}},style:{button:{root:{transition:"background-color 100ms,border-color 100ms,color 100ms"}}// card: {
|
|
1
|
+
var _process$env,_templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5,_templateObject6,_templateObject7,_templateObject8,_templateObject9,_templateObject0,_templateObject1,_templateObject10,_templateObject11,_templateObject12,_templateObject13,_templateObject14,_templateObject15,_templateObject16,_templateObject17,_templateObject18,_templateObject19,_templateObject20,_templateObject21,_templateObject22,_templateObject23,_templateObject24,_templateObject25,_templateObject26,_templateObject27,_templateObject28,_templateObject29,_templateObject30,_templateObject31,_templateObject32,_templateObject33,_templateObject34,_templateObject35,_templateObject36,_templateObject37,_templateObject38,_templateObject39,_templateObject40,_templateObject41,_templateObject42,_templateObject43,_templateObject44,_templateObject45,_templateObject46,_templateObject47,_templateObject48,_templateObject49,_templateObject50,_templateObject51,_templateObject52,_templateObject53,_templateObject54,_templateObject55,_templateObject56,_templateObject57,_templateObject58,_templateObject59,_templateObject60,_templateObject61,_templateObject62,_templateObject63,_templateObject64,_templateObject65,_templateObject66,_templateObject67,_templateObject68,_templateObject69,_templateObject70,_templateObject71,_templateObject72,_templateObject73,_templateObject74,_templateObject75,_templateObject76,_templateObject77,_templateObject78,_templateObject79,_templateObject80,_templateObject81,_templateObject82,_templateObject83,_templateObject84,_templateObject85,_templateObject86,_templateObject87,_templateObject88;const _excluded=["crossAxis","alignment","allowedPlacements","autoAlignment"],_excluded2=["mainAxis","crossAxis","fallbackPlacements","fallbackStrategy","fallbackAxisSideDirection","flipAlignment"],_excluded3=["strategy"],_excluded4=["mainAxis","crossAxis","limiter"],_excluded5=["type"],_excluded6=["motionValue","onUpdate","onComplete","element"],_excluded7=["autoplay","delay","type","repeat","repeatDelay","repeatType","keyframes","name","motionValue","element"],_excluded8=["inherit"],_excluded9=["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"],_excluded0=["transitionEnd","transition"],_excluded1=["transition","transitionEnd"],_excluded10=["willChange"],_excluded11=["attrX","attrY","attrScale","pathLength","pathSpacing","pathOffset"],_excluded12=["transition","transitionEnd"],_excluded13=["transitionEnd","transition"],_excluded14=["root"],_excluded15=["accent","align","children","muted","size","textOverflow","weight"],_excluded16=["__unstable_hideInnerStroke","as","color","src","title","initials","onImageLoadError","arrowPosition","animateArrowFrom","status","size"],_excluded17=["children","maxLength","size"],_excluded18=["as","column","columnStart","columnEnd","display","flex","height","margin","marginX","marginY","marginTop","marginRight","marginBottom","marginLeft","overflow","padding","paddingX","paddingY","paddingTop","paddingRight","paddingBottom","paddingLeft","row","rowStart","rowEnd","sizing"],_excluded19=["accent","align","children","muted","size","textOverflow","weight"],_excluded20=["children","fontSize","mode","padding","radius","tone"],_excluded21=["align","as","direction","gap","justify","wrap"],_excluded22=["children","disabled","fontSize","icon","iconRight","justify","loading","mode","padding","paddingX","paddingY","paddingTop","paddingBottom","paddingLeft","paddingRight","radius","selected","space","text","textAlign","textWeight","tone","type","muted","width"],_excluded23=["__unstable_checkered","__unstable_focusRing","as","border","borderTop","borderRight","borderBottom","borderLeft","muted","pressed","radius","scheme","selected","shadow","tone"],_excluded24=["checked","className","disabled","indeterminate","customValidity","readOnly","style"],_excluded25=["children","language","size","weight"],_excluded26=["as","width"],_excluded27=["as","autoRows","autoCols","autoFlow","columns","gap","gapX","gapY","rows","children"],_excluded28=["accent","align","children","muted","size","textOverflow","weight"],_excluded29=["as","children","space"],_excluded30=["children","fontSize","padding","radius"],_excluded31=["width","height","radius"],_excluded32=["children","media"],_excluded33=["children","onActivate","onFocus","style"],_excluded34=["children","zOffset"],_excluded35=["as","gap","getItemKey","items","onChange","renderItem"],_excluded36=["__unstable_margins","animate","arrow","arrowRef","arrowX","arrowY","children","padding","placement","originX","originY","overflow","radius","scheme","shadow","strategy","style","tone","width","x","y"],_excluded37=["__unstable_margins","animate","arrow","boundaryElement","children","constrainSize","content","disabled","fallbackPlacements","matchReferenceWidth","floatingBoundary","modal","onActivate","open","overflow","padding","placement","placementStrategy","portal","preventOverflow","radius","referenceBoundary","referenceElement","scheme","shadow","tone","width","zOffset","updateRef"],_excluded38=["className","disabled","style","customValidity","readOnly"],_excluded39=["children","customValidity","disabled","fontSize","padding","radius","readOnly","space"],_excluded40=["as","space"],_excluded41=["checked","className","disabled","indeterminate","readOnly","style"],_excluded42=["border","customValidity","disabled","fontSize","padding","radius","weight","__unstable_disableFocusRing"],_excluded43=["__unstable_disableFocusRing","border","clearButton","disabled","fontSize","icon","iconRight","onClear","padding","prefix","radius","readOnly","space","suffix","customValidity","type","weight"],_excluded44=["animate","arrow","arrowRef","arrowX","arrowY","children","originX","originY","padding","placement","radius","scheme","shadow","style"],_excluded45=["animate","arrow","boundaryElement","children","content","disabled","fallbackPlacements","padding","placement","portal","radius","scheme","shadow","zOffset","delay"],_excluded46=["fontSize","keys","padding","radius","space"],_excluded47=["children","focusFirst","focusLast","onClickOutside","onEscape","onItemClick","onItemSelect","onKeyDown","originElement","padding","registerElement","shouldFocus","space"],_excluded48=["as","children","disabled","fontSize","hotkeys","icon","iconRight","onClick","padding","paddingX","paddingY","paddingTop","paddingRight","paddingBottom","paddingLeft","pressed","radius","selected","space","text","tone"],_excluded49=["icon","id","focused","fontSize","label","onClick","onFocus","padding","selected"],_excluded50=["children"],_excluded51=["border","customValidity","disabled","filterOption","fontSize","icon","id","listBox","loading","onBlur","onChange","onFocus","onQueryChange","onSelect","openButton","openOnFocus","options","padding","popover","prefix","radius","readOnly","relatedElements","renderOption","renderPopover","renderValue","suffix","value"],_excluded52=["children","maxLength","separator","space"],_excluded53=["__unstable_autoFocus","__unstable_hideCloseButton","cardRadius","cardShadow","children","contentRef","footer","header","id","onActivate","onClickOutside","onClose","onFocus","padding","portal","position","scheme","width","zOffset","animate"],_excluded54=["animated","delay","radius"],_excluded55=["size"],_excluded56=["size"],_excluded57=["size"],_excluded58=["size"],_excluded59=["flex"],_excluded60=["children","space","onFocus"];function _taggedTemplateLiteral(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}));}function _objectWithoutProperties(e,t){if(null==e)return{};var o,r,i=_objectWithoutPropertiesLoose(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(r=0;r<n.length;r++)o=n[r],-1===t.indexOf(o)&&{}.propertyIsEnumerable.call(e,o)&&(i[o]=e[o]);}return i;}function _objectWithoutPropertiesLoose(r,e){if(null==r)return{};var t={};for(var n in r)if({}.hasOwnProperty.call(r,n)){if(-1!==e.indexOf(n))continue;t[n]=r[n];}return t;}function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable;})),t.push.apply(t,o);}return t;}function _objectSpread(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?ownKeys(Object(t),!0).forEach(function(r){_defineProperty(e,r,t[r]);}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));});}return e;}function _defineProperty(e,r,t){return(r=_toPropertyKey(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e;}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==typeof i?i:i+"";}function _toPrimitive(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t);}import{useClient as useClient$1,useFormValue,set,unset,definePlugin}from'sanity';import{jsx,Fragment,jsxs}from'react/jsx-runtime';import*as React$1 from'react';import React__default,{forwardRef,useLayoutEffect,createContext,useRef as useRef$1,useEffect as useEffect$1,useId,useContext,useInsertionEffect,useMemo,useCallback,Children,isValidElement as isValidElement$1,useState,createElement,Fragment as Fragment$1,Component,useImperativeHandle,lazy,cloneElement,useDebugValue,useSyncExternalStore,Suspense,useReducer,startTransition}from'react';import{css,styled,keyframes as keyframes$1,useTheme,ThemeProvider as ThemeProvider$1}from'styled-components';import*as ReactDOM from'react-dom';import{createPortal}from'react-dom';import Select$1 from'react-select';import CreatableSelect from'react-select/creatable';import{defer,from,pipe as pipe$1}from'rxjs';import{map,switchMap}from'rxjs/operators';const COLOR_HUES=["gray","blue","purple","magenta","red","orange","yellow","green","cyan"],COLOR_TINTS=["50","100","200","300","400","500","600","700","800","900","950"];const black={title:"Black",hex:"#0d0e12"},white={title:"White",hex:"#ffffff"},gray={50:{title:"Gray 50",hex:"#f6f6f8"},100:{title:"Gray 100",hex:"#eeeef1"},200:{title:"Gray 200",hex:"#e3e4e8"},300:{title:"Gray 300",hex:"#bbbdc9"},400:{title:"Gray 400",hex:"#9499ad"},500:{title:"Gray 500",hex:"#727892"},600:{title:"Gray 600",hex:"#515870"},700:{title:"Gray 700",hex:"#383d51"},800:{title:"Gray 800",hex:"#252837"},900:{title:"Gray 900",hex:"#1b1d27"},950:{title:"Gray 950",hex:"#13141b"}},blue={50:{title:"Blue 50",hex:"#f5f8ff"},100:{title:"Blue 100",hex:"#e5edff"},200:{title:"Blue 200",hex:"#dbe5ff"},300:{title:"Blue 300",hex:"#a8bfff"},400:{title:"Blue 400",hex:"#7595ff"},500:{title:"Blue 500",hex:"#556bfc"},600:{title:"Blue 600",hex:"#4043e7"},700:{title:"Blue 700",hex:"#2927aa"},800:{title:"Blue 800",hex:"#192457"},900:{title:"Blue 900",hex:"#161a41"},950:{title:"Blue 950",hex:"#101228"}},purple={50:{title:"Purple 50",hex:"#f8f5ff"},100:{title:"Purple 100",hex:"#f1ebff"},200:{title:"Purple 200",hex:"#ece1fe"},300:{title:"Purple 300",hex:"#ccb1fc"},400:{title:"Purple 400",hex:"#b087f7"},500:{title:"Purple 500",hex:"#8f57ef"},600:{title:"Purple 600",hex:"#721fe5"},700:{title:"Purple 700",hex:"#4c1a9e"},800:{title:"Purple 800",hex:"#2f1862"},900:{title:"Purple 900",hex:"#23173f"},950:{title:"Purple 950",hex:"#181128"}},magenta={50:{title:"Magenta 50",hex:"#fef6f9"},100:{title:"Magenta 100",hex:"#fde8ef"},200:{title:"Magenta 200",hex:"#fcdee9"},300:{title:"Magenta 300",hex:"#f7abc5"},400:{title:"Magenta 400",hex:"#f0709b"},500:{title:"Magenta 500",hex:"#e72767"},600:{title:"Magenta 600",hex:"#b11651"},700:{title:"Magenta 700",hex:"#7c1342"},800:{title:"Magenta 800",hex:"#4b1130"},900:{title:"Magenta 900",hex:"#341325"},950:{title:"Magenta 950",hex:"#1f0f14"}},red={50:{title:"Red 50",hex:"#fff6f5"},100:{title:"Red 100",hex:"#ffe7e5"},200:{title:"Red 200",hex:"#ffdedc"},300:{title:"Red 300",hex:"#fdada5"},400:{title:"Red 400",hex:"#f77769"},500:{title:"Red 500",hex:"#ef4434"},600:{title:"Red 600",hex:"#cc2819"},700:{title:"Red 700",hex:"#8b2018"},800:{title:"Red 800",hex:"#4d1714"},900:{title:"Red 900",hex:"#321615"},950:{title:"Red 950",hex:"#1e1011"}},orange={50:{title:"Orange 50",hex:"#fff7f0"},100:{title:"Orange 100",hex:"#ffeadb"},200:{title:"Orange 200",hex:"#ffddc7"},300:{title:"Orange 300",hex:"#ffb685"},400:{title:"Orange 400",hex:"#ff8e42"},500:{title:"Orange 500",hex:"#fa6400"},600:{title:"Orange 600",hex:"#b14802"},700:{title:"Orange 700",hex:"#7c3404"},800:{title:"Orange 800",hex:"#461e07"},900:{title:"Orange 900",hex:"#32160b"},950:{title:"Orange 950",hex:"#21120d"}},yellow={50:{title:"Yellow 50",hex:"#fefae1"},100:{title:"Yellow 100",hex:"#fcf3bb"},200:{title:"Yellow 200",hex:"#f9e994"},300:{title:"Yellow 300",hex:"#f7d455"},400:{title:"Yellow 400",hex:"#f9bc15"},500:{title:"Yellow 500",hex:"#d28a04"},600:{title:"Yellow 600",hex:"#965908"},700:{title:"Yellow 700",hex:"#653a0b"},800:{title:"Yellow 800",hex:"#3b220c"},900:{title:"Yellow 900",hex:"#271a11"},950:{title:"Yellow 950",hex:"#181410"}},green={50:{title:"Green 50",hex:"#e7fef5"},100:{title:"Green 100",hex:"#c5fce8"},200:{title:"Green 200",hex:"#a9f9dc"},300:{title:"Green 300",hex:"#59f3ba"},400:{title:"Green 400",hex:"#0ff0a1"},500:{title:"Green 500",hex:"#04b97a"},600:{title:"Green 600",hex:"#01794f"},700:{title:"Green 700",hex:"#015133"},800:{title:"Green 800",hex:"#023120"},900:{title:"Green 900",hex:"#06231a"},950:{title:"Green 950",hex:"#071715"}},cyan={50:{title:"Cyan 50",hex:"#e7fefe"},100:{title:"Cyan 100",hex:"#c5fcfc"},200:{title:"Cyan 200",hex:"#96f8f8"},300:{title:"Cyan 300",hex:"#62efef"},400:{title:"Cyan 400",hex:"#18e2e2"},500:{title:"Cyan 500",hex:"#04b8be"},600:{title:"Cyan 600",hex:"#037782"},700:{title:"Cyan 700",hex:"#024950"},800:{title:"Cyan 800",hex:"#042f34"},900:{title:"Cyan 900",hex:"#072227"},950:{title:"Cyan 950",hex:"#0d181c"}},hues={gray,blue,purple,magenta,red,orange,yellow,green,cyan},color$1=_objectSpread({black,white},hues);const defaultThemeConfig={avatar:{sizes:[{distance:-4,size:19},{distance:-4,size:25},{distance:-8,size:33},{distance:-12,size:49}],focusRing:{offset:1,width:1}},button:{textWeight:"medium",border:{width:1},focusRing:{offset:-1,width:1}},card:{border:{width:1},focusRing:{offset:-1,width:1},shadow:{outline:0.5}},container:[320,640,960,1280,1600,1920],media:[360,600,900,1200,1800,2400],layer:{dialog:{zOffset:600},popover:{zOffset:400},tooltip:{zOffset:200}},radius:[0,1,3,6,9,12,21],shadow:[null,{umbra:[0,0,0,0],penumbra:[0,0,0,0],ambient:[0,0,0,0]},{umbra:[0,3,5,-2],penumbra:[0,6,10,0],ambient:[0,1,18,1]},{umbra:[0,7,8,-4],penumbra:[0,12,17,2],ambient:[0,5,22,4]},{umbra:[0,9,11,-5],penumbra:[0,18,28,2],ambient:[0,7,34,6]},{umbra:[0,11,15,-7],penumbra:[0,24,38,3],ambient:[0,9,46,8]}],space:[0,4,8,12,20,32,52,84,136,220],input:{border:{width:1},checkbox:{size:17,focusRing:{offset:-1,width:1}},radio:{size:17,markSize:9,focusRing:{offset:-1,width:1}},switch:{width:25,height:17,padding:5,transitionDurationMs:150,transitionTimingFunction:"ease-out",focusRing:{offset:1,width:1}},select:{focusRing:{offset:-1,width:1}},text:{focusRing:{offset:-1,width:1}}},style:{button:{root:{transition:"background-color 100ms,border-color 100ms,color 100ms"}}// card: {
|
|
2
2
|
// root: {
|
|
3
3
|
// transition: 'background-color 100ms,border-color 100ms,color 100ms',
|
|
4
4
|
// },
|
|
@@ -621,7 +621,7 @@ const finalKeyframe=unresolvedKeyframes[unresolvedKeyframes.length-1];if(current
|
|
|
621
621
|
* its current value, "previous" value, and therefore allow
|
|
622
622
|
* Motion to also correctly calculate velocity for any subsequent animation
|
|
623
623
|
* while deferring the commit until the next animation frame.
|
|
624
|
-
*/commitStyles(){if(!this.isPseudoElement){var _this$animation$commi,_this$animation2;(_this$animation$commi=(_this$animation2=this.animation).commitStyles)===null||_this$animation$commi===void 0||_this$animation$commi.call(_this$animation2);}}get duration(){var _this$animation$effec,_this$animation$effec2;const duration=((_this$animation$effec=this.animation.effect)===null||_this$animation$effec===void 0||(_this$animation$effec2=_this$animation$effec.getComputedTiming)===null||_this$animation$effec2===void 0?void 0:_this$animation$effec2.call(_this$animation$effec).duration)||0;return millisecondsToSeconds(Number(duration));}get iterationDuration(){const{delay=0}=this.options||{};return this.duration+millisecondsToSeconds(delay);}get time(){return millisecondsToSeconds(Number(this.animation.currentTime)||0);}set time(newTime){this.manualStartTime=null;this.finishedTime=null;this.animation.currentTime=secondsToMilliseconds(newTime);}/**
|
|
624
|
+
*/commitStyles(){var _this$options5;const element=(_this$options5=this.options)===null||_this$options5===void 0?void 0:_this$options5.element;if(!this.isPseudoElement&&element!==null&&element!==void 0&&element.isConnected){var _this$animation$commi,_this$animation2;(_this$animation$commi=(_this$animation2=this.animation).commitStyles)===null||_this$animation$commi===void 0||_this$animation$commi.call(_this$animation2);}}get duration(){var _this$animation$effec,_this$animation$effec2;const duration=((_this$animation$effec=this.animation.effect)===null||_this$animation$effec===void 0||(_this$animation$effec2=_this$animation$effec.getComputedTiming)===null||_this$animation$effec2===void 0?void 0:_this$animation$effec2.call(_this$animation$effec).duration)||0;return millisecondsToSeconds(Number(duration));}get iterationDuration(){const{delay=0}=this.options||{};return this.duration+millisecondsToSeconds(delay);}get time(){return millisecondsToSeconds(Number(this.animation.currentTime)||0);}set time(newTime){this.manualStartTime=null;this.finishedTime=null;this.animation.currentTime=secondsToMilliseconds(newTime);}/**
|
|
625
625
|
* The playback speed of the animation.
|
|
626
626
|
* 1 = normal speed, 2 = double speed, 0.5 = half speed.
|
|
627
627
|
*/get speed(){return this.animation.playbackRate;}set speed(newSpeed){// Allow backwards playback after finishing
|
|
@@ -653,7 +653,7 @@ class NativeAnimationExtended extends NativeAnimation{constructor(options){/**
|
|
|
653
653
|
* create a renderless JS animation and sample it twice to calculate
|
|
654
654
|
* its current value, "previous" value, and therefore allow
|
|
655
655
|
* Motion to calculate velocity for any subsequent animation.
|
|
656
|
-
*/updateMotionValue(value){const _this$
|
|
656
|
+
*/updateMotionValue(value){const _this$options6=this.options,{motionValue,onUpdate,onComplete,element}=_this$options6,options=_objectWithoutProperties(_this$options6,_excluded6);if(!motionValue)return;if(value!==undefined){motionValue.set(value);return;}const sampleAnimation=new JSAnimation(_objectSpread(_objectSpread({},options),{},{autoplay:false}));/**
|
|
657
657
|
* Use wall-clock elapsed time for sampling.
|
|
658
658
|
* Under CPU load, WAAPI's currentTime may not reflect actual
|
|
659
659
|
* elapsed time, causing incorrect sampling and visual jumps.
|
|
@@ -734,11 +734,15 @@ if(!token)return;// Attempt to read this CSS variable off the element
|
|
|
734
734
|
const resolved=window.getComputedStyle(element).getPropertyValue(token);if(resolved){const trimmed=resolved.trim();return isNumericalString(trimmed)?parseFloat(trimmed):trimmed;}return isCSSVariableToken(fallback)?getVariableValue(fallback,element,depth+1):fallback;}const underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10};const criticallyDampedSpring=target=>({type:"spring",stiffness:550,damping:target===0?2*Math.sqrt(550):30,restSpeed:10});const keyframesTransition={type:"keyframes",duration:0.8};/**
|
|
735
735
|
* Default easing curve is a slightly shallower version of
|
|
736
736
|
* the default browser easing curve.
|
|
737
|
-
*/const ease={type:"keyframes",ease:[0.25,0.1,0.35,1],duration:0.3};const getDefaultTransition=(valueKey,_ref29)=>{let{keyframes}=_ref29;if(keyframes.length>2){return keyframesTransition;}else if(transformProps.has(valueKey)){return valueKey.startsWith("scale")?criticallyDampedSpring(keyframes[1]):underDampedSpring;}return ease;};const isNotNull=value=>value!==null;function getFinalKeyframe(keyframes,_ref30,finalKeyframe){let{repeat,repeatType="loop"}=_ref30;const resolvedKeyframes=keyframes.filter(isNotNull);const index=repeat&&repeatType!=="loop"&&repeat%2===1?0:resolvedKeyframes.length-1;return!index||finalKeyframe===undefined?resolvedKeyframes[index]:finalKeyframe;}
|
|
737
|
+
*/const ease={type:"keyframes",ease:[0.25,0.1,0.35,1],duration:0.3};const getDefaultTransition=(valueKey,_ref29)=>{let{keyframes}=_ref29;if(keyframes.length>2){return keyframesTransition;}else if(transformProps.has(valueKey)){return valueKey.startsWith("scale")?criticallyDampedSpring(keyframes[1]):underDampedSpring;}return ease;};const isNotNull=value=>value!==null;function getFinalKeyframe(keyframes,_ref30,finalKeyframe){let{repeat,repeatType="loop"}=_ref30;const resolvedKeyframes=keyframes.filter(isNotNull);const index=repeat&&repeatType!=="loop"&&repeat%2===1?0:resolvedKeyframes.length-1;return!index||finalKeyframe===undefined?resolvedKeyframes[index]:finalKeyframe;}/**
|
|
738
|
+
* If `transition` has `inherit: true`, shallow-merge it with
|
|
739
|
+
* `parentTransition` (child keys win) and strip the `inherit` key.
|
|
740
|
+
* Otherwise return `transition` unchanged.
|
|
741
|
+
*/function resolveTransition(transition,parentTransition){if(transition!==null&&transition!==void 0&&transition.inherit&&parentTransition){const{inherit:_}=transition,rest=_objectWithoutProperties(transition,_excluded8);return _objectSpread(_objectSpread({},parentTransition),rest);}return transition;}function getValueTransition(transition,key){var _ref31,_transition$key;const valueTransition=(_ref31=(_transition$key=transition===null||transition===void 0?void 0:transition[key])!==null&&_transition$key!==void 0?_transition$key:transition===null||transition===void 0?void 0:transition["default"])!==null&&_ref31!==void 0?_ref31:transition;if(valueTransition!==transition){return resolveTransition(valueTransition,transition);}return valueTransition;}/**
|
|
738
742
|
* Decide whether a transition is defined on a given Transition.
|
|
739
743
|
* This filters out orchestration options and returns true
|
|
740
744
|
* if any options are left.
|
|
741
|
-
*/function isTransitionDefined(_ref32){let{when,delay:_delay,delayChildren,staggerChildren,staggerDirection,repeat,repeatType,repeatDelay,from,elapsed}=_ref32,transition=_objectWithoutProperties(_ref32,
|
|
745
|
+
*/function isTransitionDefined(_ref32){let{when,delay:_delay,delayChildren,staggerChildren,staggerDirection,repeat,repeatType,repeatDelay,from,elapsed}=_ref32,transition=_objectWithoutProperties(_ref32,_excluded9);return!!Object.keys(transition).length;}const animateMotionValue=function(name,value,target){let transition=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};let element=arguments.length>4?arguments[4]:undefined;let isHandoff=arguments.length>5?arguments[5]:undefined;return onComplete=>{const valueTransition=getValueTransition(transition,name)||{};/**
|
|
742
746
|
* Most transition values are currently completely overwritten by value-specific
|
|
743
747
|
* transitions. In the future it'd be nicer to blend these transitions. But for now
|
|
744
748
|
* delay actually does inherit from the root transition if not value-specific.
|
|
@@ -754,7 +758,7 @@ const resolved=window.getComputedStyle(element).getPropertyValue(token);if(resol
|
|
|
754
758
|
* as seconds.
|
|
755
759
|
*/options.duration&&(options.duration=secondsToMilliseconds(options.duration));options.repeatDelay&&(options.repeatDelay=secondsToMilliseconds(options.repeatDelay));/**
|
|
756
760
|
* Support deprecated way to set initial value. Prefer keyframe syntax.
|
|
757
|
-
*/if(options.from!==undefined){options.keyframes[0]=options.from;}let shouldSkip=false;if(options.type===false||options.duration===0&&!options.repeatDelay){makeAnimationInstant(options);if(options.delay===0){shouldSkip=true;}}if(MotionGlobalConfig.instantAnimations||MotionGlobalConfig.skipAnimations){shouldSkip=true;makeAnimationInstant(options);options.delay=0;}/**
|
|
761
|
+
*/if(options.from!==undefined){options.keyframes[0]=options.from;}let shouldSkip=false;if(options.type===false||options.duration===0&&!options.repeatDelay){makeAnimationInstant(options);if(options.delay===0){shouldSkip=true;}}if(MotionGlobalConfig.instantAnimations||MotionGlobalConfig.skipAnimations||element!==null&&element!==void 0&&element.shouldSkipAnimations){shouldSkip=true;makeAnimationInstant(options);options.delay=0;}/**
|
|
758
762
|
* If the transition type or easing has been explicitly set by the user
|
|
759
763
|
* then we don't want to allow flattening the animation.
|
|
760
764
|
*/options.allowFlatten=!valueTransition.type&&!valueTransition.ease;/**
|
|
@@ -900,7 +904,7 @@ return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue
|
|
|
900
904
|
* Set VisualElement's MotionValue, creating a new MotionValue for it if
|
|
901
905
|
* it doesn't exist.
|
|
902
906
|
*/function setMotionValue(visualElement,key,value){if(visualElement.hasValue(key)){visualElement.getValue(key).set(value);}else{visualElement.addValue(key,motionValue(value));}}function resolveFinalValueInKeyframes(v){// TODO maybe throw if v.length - 1 is placeholder token?
|
|
903
|
-
return isKeyframesTarget(v)?v[v.length-1]||0:v;}function setTarget(visualElement,definition){const resolved=resolveVariant(visualElement,definition);let _ref33=resolved||{},{transitionEnd={},transition={}}=_ref33,target=_objectWithoutProperties(_ref33,
|
|
907
|
+
return isKeyframesTarget(v)?v[v.length-1]||0:v;}function setTarget(visualElement,definition){const resolved=resolveVariant(visualElement,definition);let _ref33=resolved||{},{transitionEnd={},transition={}}=_ref33,target=_objectWithoutProperties(_ref33,_excluded0);target=_objectSpread(_objectSpread({},target),transitionEnd);for(const key in target){const value=resolveFinalValueInKeyframes(target[key]);setMotionValue(visualElement,key,value);}}const isMotionValue=value=>Boolean(value&&value.getVelocity);function isWillChangeMotionValue(value){return Boolean(isMotionValue(value)&&value.add);}function addValueToWillChange(visualElement,key){const willChange=visualElement.getValue("willChange");/**
|
|
904
908
|
* It could be that a user has set willChange to a regular MotionValue,
|
|
905
909
|
* in which case we can't add the value to it.
|
|
906
910
|
*/if(isWillChangeMotionValue(willChange)){return willChange.add(key);}else if(!willChange&&MotionGlobalConfig.WillChange){const newWillChange=new MotionGlobalConfig.WillChange("auto");visualElement.addValue("willChange",newWillChange);newWillChange.add(key);}}function camelToDash(str){return str.replace(/([A-Z])/g,match=>"-".concat(match.toLowerCase()));}const optimizedAppearDataId="framerAppearId";const optimizedAppearDataAttribute="data-"+camelToDash(optimizedAppearDataId);function getOptimisedAppearId(visualElement){return visualElement.props[optimizedAppearDataAttribute];}/**
|
|
@@ -908,12 +912,12 @@ return isKeyframesTarget(v)?v[v.length-1]||0:v;}function setTarget(visualElement
|
|
|
908
912
|
* just by checking whether the key was listed in protectedKeys, but this
|
|
909
913
|
* posed problems if an animation was triggered by afterChildren and protectedKeys
|
|
910
914
|
* had been set to true in the meantime.
|
|
911
|
-
*/function shouldBlockAnimation(_ref34,key){let{protectedKeys,needsAnimating}=_ref34;const shouldBlock=protectedKeys.hasOwnProperty(key)&&needsAnimating[key]!==true;needsAnimating[key]=false;return shouldBlock;}function animateTarget(visualElement,targetAndTransition){var _transition;let{delay=0,transitionOverride,type}=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};let{transition
|
|
915
|
+
*/function shouldBlockAnimation(_ref34,key){let{protectedKeys,needsAnimating}=_ref34;const shouldBlock=protectedKeys.hasOwnProperty(key)&&needsAnimating[key]!==true;needsAnimating[key]=false;return shouldBlock;}function animateTarget(visualElement,targetAndTransition){var _transition;let{delay=0,transitionOverride,type}=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};let{transition,transitionEnd}=targetAndTransition,target=_objectWithoutProperties(targetAndTransition,_excluded1);const defaultTransition=visualElement.getDefaultTransition();transition=transition?resolveTransition(transition,defaultTransition):defaultTransition;const reduceMotion=(_transition=transition)===null||_transition===void 0?void 0:_transition.reduceMotion;if(transitionOverride)transition=transitionOverride;const animations=[];const animationTypeState=type&&visualElement.animationState&&visualElement.animationState.getState()[type];for(const key in target){var _visualElement$latest;const value=visualElement.getValue(key,(_visualElement$latest=visualElement.latestValues[key])!==null&&_visualElement$latest!==void 0?_visualElement$latest:null);const valueTarget=target[key];if(valueTarget===undefined||animationTypeState&&shouldBlockAnimation(animationTypeState,key)){continue;}const valueTransition=_objectSpread({delay},getValueTransition(transition||{},key));/**
|
|
912
916
|
* If the value is already at the defined target, skip the animation.
|
|
913
917
|
*/const currentValue=value.get();if(currentValue!==undefined&&!value.isAnimating&&!Array.isArray(valueTarget)&&valueTarget===currentValue&&!valueTransition.velocity){continue;}/**
|
|
914
918
|
* If this is the first time a value is being animated, check
|
|
915
919
|
* to see if we're handling off from an existing animation.
|
|
916
|
-
*/let isHandoff=false;if(window.MotionHandoffAnimation){const appearId=getOptimisedAppearId(visualElement);if(appearId){const startTime=window.MotionHandoffAnimation(appearId,key,frame);if(startTime!==null){valueTransition.startTime=startTime;isHandoff=true;}}}addValueToWillChange(visualElement,key);const shouldReduceMotion=reduceMotion!==null&&reduceMotion!==void 0?reduceMotion:visualElement.shouldReduceMotion;value.start(animateMotionValue(key,value,valueTarget,shouldReduceMotion&&positionalKeys.has(key)?{type:false}:valueTransition,visualElement,isHandoff));const animation=value.animation;if(animation){animations.push(animation);}}if(transitionEnd){
|
|
920
|
+
*/let isHandoff=false;if(window.MotionHandoffAnimation){const appearId=getOptimisedAppearId(visualElement);if(appearId){const startTime=window.MotionHandoffAnimation(appearId,key,frame);if(startTime!==null){valueTransition.startTime=startTime;isHandoff=true;}}}addValueToWillChange(visualElement,key);const shouldReduceMotion=reduceMotion!==null&&reduceMotion!==void 0?reduceMotion:visualElement.shouldReduceMotion;value.start(animateMotionValue(key,value,valueTarget,shouldReduceMotion&&positionalKeys.has(key)?{type:false}:valueTransition,visualElement,isHandoff));const animation=value.animation;if(animation){animations.push(animation);}}if(transitionEnd){const applyTransitionEnd=()=>frame.update(()=>{transitionEnd&&setTarget(visualElement,transitionEnd);});if(animations.length){Promise.all(animations).then(applyTransitionEnd);}else{applyTransitionEnd();}}return animations;}function animateVariant(visualElement,variant){var _visualElement$presen;let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const resolved=resolveVariant(visualElement,variant,options.type==="exit"?(_visualElement$presen=visualElement.presenceContext)===null||_visualElement$presen===void 0?void 0:_visualElement$presen.custom:undefined);let{transition=visualElement.getDefaultTransition()||{}}=resolved||{};if(options.transitionOverride){transition=options.transitionOverride;}/**
|
|
917
921
|
* If we have a variant, create a callback that runs it as an animation.
|
|
918
922
|
* Otherwise, we resolve a Promise immediately for a composable no-op.
|
|
919
923
|
*/const getAnimation=resolved?()=>Promise.all(animateTarget(visualElement,resolved,options)):()=>Promise.resolve();/**
|
|
@@ -984,7 +988,7 @@ if((_this$removedTransfor=this.removedTransforms)!==null&&_this$removedTransfor!
|
|
|
984
988
|
* with drag gestures, and automatically removes the "pointerennd" event listener when the hover ends.
|
|
985
989
|
*
|
|
986
990
|
* @public
|
|
987
|
-
*/function hover(elementOrSelector,onHoverStart){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const[elements,eventOptions,cancel]=setupGesture(elementOrSelector,options);const
|
|
991
|
+
*/function hover(elementOrSelector,onHoverStart){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const[elements,eventOptions,cancel]=setupGesture(elementOrSelector,options);elements.forEach(element=>{let isPressed=false;let deferredHoverEnd=false;let hoverEndCallback;const removePointerLeave=()=>{element.removeEventListener("pointerleave",onPointerLeave);};const endHover=event=>{if(hoverEndCallback){hoverEndCallback(event);hoverEndCallback=undefined;}removePointerLeave();};const onPointerUp=event=>{isPressed=false;window.removeEventListener("pointerup",onPointerUp);window.removeEventListener("pointercancel",onPointerUp);if(deferredHoverEnd){deferredHoverEnd=false;endHover(event);}};const onPointerDown=()=>{isPressed=true;window.addEventListener("pointerup",onPointerUp,eventOptions);window.addEventListener("pointercancel",onPointerUp,eventOptions);};const onPointerLeave=leaveEvent=>{if(leaveEvent.pointerType==="touch")return;if(isPressed){deferredHoverEnd=true;return;}endHover(leaveEvent);};const onPointerEnter=enterEvent=>{if(!isValidHover(enterEvent))return;deferredHoverEnd=false;const onHoverEnd=onHoverStart(element,enterEvent);if(typeof onHoverEnd!=="function")return;hoverEndCallback=onHoverEnd;element.addEventListener("pointerleave",onPointerLeave,eventOptions);};element.addEventListener("pointerenter",onPointerEnter,eventOptions);element.addEventListener("pointerdown",onPointerDown,eventOptions);});return cancel;}/**
|
|
988
992
|
* Recursively traverse up the tree to check whether the provided child node
|
|
989
993
|
* is the parent or a descendant of it.
|
|
990
994
|
*
|
|
@@ -997,21 +1001,27 @@ if((_this$removedTransfor=this.removedTransforms)!==null&&_this$removedTransfor!
|
|
|
997
1001
|
*
|
|
998
1002
|
* Specifically match against false here as incomplete versions of
|
|
999
1003
|
* PointerEvents in very old browser might have it set as undefined.
|
|
1000
|
-
*/return event.isPrimary!==false;}};const
|
|
1001
|
-
* Checks if an element is
|
|
1002
|
-
*
|
|
1004
|
+
*/return event.isPrimary!==false;}};const keyboardAccessibleElements=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);/**
|
|
1005
|
+
* Checks if an element is natively keyboard accessible (focusable).
|
|
1006
|
+
* Used by the press gesture to determine if we need to add tabIndex.
|
|
1007
|
+
*/function isElementKeyboardAccessible(element){return keyboardAccessibleElements.has(element.tagName)||element.isContentEditable===true;}const textInputElements=new Set(["INPUT","SELECT","TEXTAREA"]);/**
|
|
1008
|
+
* Checks if an element has text selection or direct interaction behavior
|
|
1009
|
+
* that should block drag gestures from starting.
|
|
1003
1010
|
*
|
|
1004
|
-
* This specifically targets form controls
|
|
1005
|
-
*
|
|
1006
|
-
*
|
|
1007
|
-
|
|
1011
|
+
* This specifically targets form controls where the user might want to select
|
|
1012
|
+
* text or interact with the control (e.g., sliders, dropdowns).
|
|
1013
|
+
*
|
|
1014
|
+
* Buttons and links are NOT included because they don't have click-and-move
|
|
1015
|
+
* actions of their own - they only respond to click events, so dragging
|
|
1016
|
+
* should still work when initiated from these elements.
|
|
1017
|
+
*/function isElementTextInput(element){return textInputElements.has(element.tagName)||element.isContentEditable===true;}const isPressing=new WeakSet();/**
|
|
1008
1018
|
* Filter out events that are not "Enter" keys.
|
|
1009
1019
|
*/function filterEvents(callback){return event=>{if(event.key!=="Enter")return;callback(event);};}function firePointerEvent(target,type){target.dispatchEvent(new PointerEvent("pointer"+type,{isPrimary:true,bubbles:true}));}const enableKeyboardPress=(focusEvent,eventOptions)=>{const element=focusEvent.currentTarget;if(!element)return;const handleKeydown=filterEvents(()=>{if(isPressing.has(element))return;firePointerEvent(element,"down");const handleKeyup=filterEvents(()=>{firePointerEvent(element,"up");});const handleBlur=()=>firePointerEvent(element,"cancel");element.addEventListener("keyup",handleKeyup,eventOptions);element.addEventListener("blur",handleBlur,eventOptions);});element.addEventListener("keydown",handleKeydown,eventOptions);/**
|
|
1010
1020
|
* Add an event listener that fires on blur to remove the keydown events.
|
|
1011
1021
|
*/element.addEventListener("blur",()=>element.removeEventListener("keydown",handleKeydown),eventOptions);};/**
|
|
1012
1022
|
* Filter out events that are not primary pointer events, or are triggering
|
|
1013
1023
|
* while a Motion gesture is active.
|
|
1014
|
-
*/function isValidPressEvent(event){return isPrimaryPointer(event)&&!isDragActive();}
|
|
1024
|
+
*/function isValidPressEvent(event){return isPrimaryPointer(event)&&!isDragActive();}const claimedPointerDownEvents=new WeakSet();/**
|
|
1015
1025
|
* Create a press gesture.
|
|
1016
1026
|
*
|
|
1017
1027
|
* Press is different to `"pointerdown"`, `"pointerup"` in that it
|
|
@@ -1029,10 +1039,10 @@ if((_this$removedTransfor=this.removedTransforms)!==null&&_this$removedTransfor!
|
|
|
1029
1039
|
* make an element focusable by default.
|
|
1030
1040
|
*
|
|
1031
1041
|
* @public
|
|
1032
|
-
*/function press(targetOrSelector,onPressStart){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const[targets,eventOptions,cancelEvents]=setupGesture(targetOrSelector,options);const startPress=startEvent=>{const target=startEvent.currentTarget;if(!isValidPressEvent(startEvent))return;isPressing.add(target);const onPressEnd=onPressStart(target,startEvent);const onPointerEnd=(endEvent,success)=>{window.removeEventListener("pointerup",onPointerUp);window.removeEventListener("pointercancel",onPointerCancel);if(isPressing.has(target)){isPressing.delete(target);}if(!isValidPressEvent(endEvent)){return;}if(typeof onPressEnd==="function"){onPressEnd(endEvent,{success});}};const onPointerUp=upEvent=>{onPointerEnd(upEvent,target===window||target===document||options.useGlobalTarget||isNodeOrChild(target,upEvent.target));};const onPointerCancel=cancelEvent=>{onPointerEnd(cancelEvent,false);};window.addEventListener("pointerup",onPointerUp,eventOptions);window.addEventListener("pointercancel",onPointerCancel,eventOptions);};targets.forEach(target=>{const pointerDownTarget=options.useGlobalTarget?window:target;pointerDownTarget.addEventListener("pointerdown",startPress,eventOptions);if(isHTMLElement$1(target)){target.addEventListener("focus",event=>enableKeyboardPress(event,eventOptions));if(!isElementKeyboardAccessible(target)&&!target.hasAttribute("tabindex")){target.tabIndex=0;}}});return cancelEvents;}/**
|
|
1042
|
+
*/function press(targetOrSelector,onPressStart){let options=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};const[targets,eventOptions,cancelEvents]=setupGesture(targetOrSelector,options);const startPress=startEvent=>{const target=startEvent.currentTarget;if(!isValidPressEvent(startEvent))return;if(claimedPointerDownEvents.has(startEvent))return;isPressing.add(target);if(options.stopPropagation){claimedPointerDownEvents.add(startEvent);}const onPressEnd=onPressStart(target,startEvent);const onPointerEnd=(endEvent,success)=>{window.removeEventListener("pointerup",onPointerUp);window.removeEventListener("pointercancel",onPointerCancel);if(isPressing.has(target)){isPressing.delete(target);}if(!isValidPressEvent(endEvent)){return;}if(typeof onPressEnd==="function"){onPressEnd(endEvent,{success});}};const onPointerUp=upEvent=>{onPointerEnd(upEvent,target===window||target===document||options.useGlobalTarget||isNodeOrChild(target,upEvent.target));};const onPointerCancel=cancelEvent=>{onPointerEnd(cancelEvent,false);};window.addEventListener("pointerup",onPointerUp,eventOptions);window.addEventListener("pointercancel",onPointerCancel,eventOptions);};targets.forEach(target=>{const pointerDownTarget=options.useGlobalTarget?window:target;pointerDownTarget.addEventListener("pointerdown",startPress,eventOptions);if(isHTMLElement$1(target)){target.addEventListener("focus",event=>enableKeyboardPress(event,eventOptions));if(!isElementKeyboardAccessible(target)&&!target.hasAttribute("tabindex")){target.tabIndex=0;}}});return cancelEvents;}/**
|
|
1033
1043
|
* Checks if an element is an SVG element in a way
|
|
1034
1044
|
* that works across iframes
|
|
1035
|
-
*/function isSVGElement(element){return isObject(element)&&"ownerSVGElement"in element;}/**
|
|
1045
|
+
*/function isSVGElement(element){return isObject(element)&&"ownerSVGElement"in element;}const resizeHandlers=new WeakMap();let observer;const getSize=(borderBoxAxis,svgAxis,htmlAxis)=>(target,borderBoxSize)=>{if(borderBoxSize&&borderBoxSize[0]){return borderBoxSize[0][borderBoxAxis+"Size"];}else if(isSVGElement(target)&&"getBBox"in target){return target.getBBox()[svgAxis];}else{return target[htmlAxis];}};const getWidth=/*@__PURE__*/getSize("inline","width","offsetWidth");const getHeight=/*@__PURE__*/getSize("block","height","offsetHeight");function notifyTarget(_ref36){var _resizeHandlers$get;let{target,borderBoxSize}=_ref36;(_resizeHandlers$get=resizeHandlers.get(target))===null||_resizeHandlers$get===void 0||_resizeHandlers$get.forEach(handler=>{handler(target,{get width(){return getWidth(target,borderBoxSize);},get height(){return getHeight(target,borderBoxSize);}});});}function notifyAll(entries){entries.forEach(notifyTarget);}function createResizeObserver(){if(typeof ResizeObserver==="undefined")return;observer=new ResizeObserver(notifyAll);}function resizeElement(target,handler){if(!observer)createResizeObserver();const elements=resolveElements(target);elements.forEach(element=>{var _observer;let elementHandlers=resizeHandlers.get(element);if(!elementHandlers){elementHandlers=new Set();resizeHandlers.set(element,elementHandlers);}elementHandlers.add(handler);(_observer=observer)===null||_observer===void 0||_observer.observe(element);});return()=>{elements.forEach(element=>{const elementHandlers=resizeHandlers.get(element);elementHandlers===null||elementHandlers===void 0||elementHandlers.delete(handler);if(!(elementHandlers!==null&&elementHandlers!==void 0&&elementHandlers.size)){var _observer2;(_observer2=observer)===null||_observer2===void 0||_observer2.unobserve(element);}});};}const windowCallbacks=new Set();let windowResizeHandler;function createWindowResizeHandler(){windowResizeHandler=()=>{const info={get width(){return window.innerWidth;},get height(){return window.innerHeight;}};windowCallbacks.forEach(callback=>callback(info));};window.addEventListener("resize",windowResizeHandler);}function resizeWindow(callback){windowCallbacks.add(callback);if(!windowResizeHandler)createWindowResizeHandler();return()=>{windowCallbacks.delete(callback);if(!windowCallbacks.size&&typeof windowResizeHandler==="function"){window.removeEventListener("resize",windowResizeHandler);windowResizeHandler=undefined;}};}function resize(a,b){return typeof a==="function"?resizeWindow(a):resizeElement(a,b);}/**
|
|
1036
1046
|
* Checks if an element is specifically an SVGSVGElement (the root SVG element)
|
|
1037
1047
|
* in a way that works across iframes
|
|
1038
1048
|
*/function isSVGSVGElement(element){return isSVGElement(element)&&element.tagName==="svg";}/**
|
|
@@ -1072,7 +1082,7 @@ for(const key in prev){if(next[key]===undefined)element.removeValue(key);}return
|
|
|
1072
1082
|
*
|
|
1073
1083
|
* This isn't an abstract method as it needs calling in the constructor, but it is
|
|
1074
1084
|
* intended to be one.
|
|
1075
|
-
*/scrapeMotionValuesFromProps(_props,_prevProps,_visualElement){return{};}constructor(
|
|
1085
|
+
*/scrapeMotionValuesFromProps(_props,_prevProps,_visualElement){return{};}constructor(_ref37){let{parent,props,presenceContext,reducedMotionConfig,skipAnimations,blockInitialAnimation,visualState}=_ref37;let options=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};/**
|
|
1076
1086
|
* A reference to the current underlying Instance, e.g. a HTMLElement
|
|
1077
1087
|
* or Three.Mesh etc.
|
|
1078
1088
|
*/this.current=null;/**
|
|
@@ -1086,6 +1096,9 @@ for(const key in prev){if(next[key]===undefined)element.removeValue(key);}return
|
|
|
1086
1096
|
* TODO: This is currently set on every individual VisualElement but feels
|
|
1087
1097
|
* like it could be set globally.
|
|
1088
1098
|
*/this.shouldReduceMotion=null;/**
|
|
1099
|
+
* Decides whether animations should be skipped for this VisualElement.
|
|
1100
|
+
* Useful for E2E tests and visual regression testing.
|
|
1101
|
+
*/this.shouldSkipAnimations=false;/**
|
|
1089
1102
|
* A map of all motion values attached to this visual element. Motion
|
|
1090
1103
|
* values are source of truth for any given animated value. A motion
|
|
1091
1104
|
* value might be provided externally by the component via props.
|
|
@@ -1099,12 +1112,15 @@ for(const key in prev){if(next[key]===undefined)element.removeValue(key);}return
|
|
|
1099
1112
|
* from scrapeMotionValuesFromProps. We use the keys in here to determine
|
|
1100
1113
|
* if any motion values need to be removed after props are updated.
|
|
1101
1114
|
*/this.prevMotionValues={};/**
|
|
1115
|
+
* Track whether this element has been mounted before, to detect
|
|
1116
|
+
* remounts after Suspense unmount/remount cycles.
|
|
1117
|
+
*/this.hasBeenMounted=false;/**
|
|
1102
1118
|
* An object containing a SubscriptionManager for each active event.
|
|
1103
1119
|
*/this.events={};/**
|
|
1104
1120
|
* An object containing an unsubscribe function for each prop event subscription.
|
|
1105
1121
|
* For example, every "Update" event can have multiple subscribers via
|
|
1106
1122
|
* VisualElement.on(), but only one of those can be defined via the onUpdate prop.
|
|
1107
|
-
*/this.propEventSubscriptions={};this.notifyUpdate=()=>this.notify("Update",this.latestValues);this.render=()=>{if(!this.current)return;this.triggerBuild();this.renderInstance(this.current,this.renderState,this.props.style,this.projection);};this.renderScheduledAt=0.0;this.scheduleRender=()=>{const now=time$1.now();if(this.renderScheduledAt<now){this.renderScheduledAt=now;frame.render(this.render,false,true);}};const{latestValues,renderState}=visualState;this.latestValues=latestValues;this.baseTarget=_objectSpread({},latestValues);this.initialValues=props.initial?_objectSpread({},latestValues):{};this.renderState=renderState;this.parent=parent;this.props=props;this.presenceContext=presenceContext;this.depth=parent?parent.depth+1:0;this.reducedMotionConfig=reducedMotionConfig;this.options=options;this.blockInitialAnimation=Boolean(blockInitialAnimation);this.isControllingVariants=isControllingVariants(props);this.isVariantNode=isVariantNode(props);if(this.isVariantNode){this.variantChildren=new Set();}this.manuallyAnimateOnMount=Boolean(parent&&parent.current);/**
|
|
1123
|
+
*/this.propEventSubscriptions={};this.notifyUpdate=()=>this.notify("Update",this.latestValues);this.render=()=>{if(!this.current)return;this.triggerBuild();this.renderInstance(this.current,this.renderState,this.props.style,this.projection);};this.renderScheduledAt=0.0;this.scheduleRender=()=>{const now=time$1.now();if(this.renderScheduledAt<now){this.renderScheduledAt=now;frame.render(this.render,false,true);}};const{latestValues,renderState}=visualState;this.latestValues=latestValues;this.baseTarget=_objectSpread({},latestValues);this.initialValues=props.initial?_objectSpread({},latestValues):{};this.renderState=renderState;this.parent=parent;this.props=props;this.presenceContext=presenceContext;this.depth=parent?parent.depth+1:0;this.reducedMotionConfig=reducedMotionConfig;this.skipAnimationsConfig=skipAnimations;this.options=options;this.blockInitialAnimation=Boolean(blockInitialAnimation);this.isControllingVariants=isControllingVariants(props);this.isVariantNode=isVariantNode(props);if(this.isVariantNode){this.variantChildren=new Set();}this.manuallyAnimateOnMount=Boolean(parent&&parent.current);/**
|
|
1108
1124
|
* Any motion values that are provided to the element when created
|
|
1109
1125
|
* aren't yet bound to the element, as this would technically be impure.
|
|
1110
1126
|
* However, we iterate through the motion values and set them to the
|
|
@@ -1113,11 +1129,17 @@ for(const key in prev){if(next[key]===undefined)element.removeValue(key);}return
|
|
|
1113
1129
|
* TODO: This is impure and we should look at changing this to run on mount.
|
|
1114
1130
|
* Doing so will break some tests but this isn't necessarily a breaking change,
|
|
1115
1131
|
* more a reflection of the test.
|
|
1116
|
-
*/const _this$scrapeMotionVal=this.scrapeMotionValuesFromProps(props,{},this),{willChange}=_this$scrapeMotionVal,initialMotionValues=_objectWithoutProperties(_this$scrapeMotionVal,
|
|
1132
|
+
*/const _this$scrapeMotionVal=this.scrapeMotionValuesFromProps(props,{},this),{willChange}=_this$scrapeMotionVal,initialMotionValues=_objectWithoutProperties(_this$scrapeMotionVal,_excluded10);for(const key in initialMotionValues){const value=initialMotionValues[key];if(latestValues[key]!==undefined&&isMotionValue(value)){value.set(latestValues[key]);}}}mount(instance){var _this$skipAnimationsC,_this$parent;/**
|
|
1133
|
+
* If this element has been mounted before (e.g. after a Suspense
|
|
1134
|
+
* unmount/remount), reset motion values to their initial state
|
|
1135
|
+
* so animations replay correctly from initial → animate.
|
|
1136
|
+
*/if(this.hasBeenMounted){for(const key in this.initialValues){var _this$values$get;(_this$values$get=this.values.get(key))===null||_this$values$get===void 0||_this$values$get.jump(this.initialValues[key]);this.latestValues[key]=this.initialValues[key];}}this.current=instance;visualElementStore.set(instance,this);if(this.projection&&!this.projection.instance){this.projection.mount(instance);}if(this.parent&&this.isVariantNode&&!this.isControllingVariants){this.removeFromVariantTree=this.parent.addVariantChild(this);}this.values.forEach((value,key)=>this.bindToMotionValue(key,value));/**
|
|
1117
1137
|
* Determine reduced motion preference. Only initialize the matchMedia
|
|
1118
1138
|
* listener if we actually need the dynamic value (i.e., when config
|
|
1119
1139
|
* is neither "never" nor "always").
|
|
1120
|
-
*/if(this.reducedMotionConfig==="never"){this.shouldReduceMotion=false;}else if(this.reducedMotionConfig==="always"){this.shouldReduceMotion=true;}else{if(!hasReducedMotionListener.current){initPrefersReducedMotion();}this.shouldReduceMotion=prefersReducedMotion.current;}if(process.env.NODE_ENV!=="production"){warnOnce(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled");}
|
|
1140
|
+
*/if(this.reducedMotionConfig==="never"){this.shouldReduceMotion=false;}else if(this.reducedMotionConfig==="always"){this.shouldReduceMotion=true;}else{if(!hasReducedMotionListener.current){initPrefersReducedMotion();}this.shouldReduceMotion=prefersReducedMotion.current;}if(process.env.NODE_ENV!=="production"){warnOnce(this.shouldReduceMotion!==true,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled");}/**
|
|
1141
|
+
* Set whether animations should be skipped based on the config.
|
|
1142
|
+
*/this.shouldSkipAnimations=(_this$skipAnimationsC=this.skipAnimationsConfig)!==null&&_this$skipAnimationsC!==void 0?_this$skipAnimationsC:false;(_this$parent=this.parent)===null||_this$parent===void 0||_this$parent.addChild(this);this.update(this.props,this.presenceContext);this.hasBeenMounted=true;}unmount(){var _this$parent2;this.projection&&this.projection.unmount();cancelFrame(this.notifyUpdate);cancelFrame(this.render);this.valueSubscriptions.forEach(remove=>remove());this.valueSubscriptions.clear();this.removeFromVariantTree&&this.removeFromVariantTree();(_this$parent2=this.parent)===null||_this$parent2===void 0||_this$parent2.removeChild(this);for(const key in this.events){this.events[key].clear();}for(const key in this.features){const feature=this.features[key];if(feature){feature.unmount();feature.isMounted=false;}}this.current=null;}addChild(child){var _this$enteringChildre;this.children.add(child);(_this$enteringChildre=this.enteringChildren)!==null&&_this$enteringChildre!==void 0?_this$enteringChildre:this.enteringChildren=new Set();this.enteringChildren.add(child);}removeChild(child){this.children.delete(child);this.enteringChildren&&this.enteringChildren.delete(child);}bindToMotionValue(key,value){if(this.valueSubscriptions.has(key)){this.valueSubscriptions.get(key)();}const valueIsTransform=transformProps.has(key);if(valueIsTransform&&this.onBindTransform){this.onBindTransform();}const removeOnChange=value.on("change",latestValue=>{this.latestValues[key]=latestValue;this.props.onUpdate&&frame.preRender(this.notifyUpdate);if(valueIsTransform&&this.projection){this.projection.isTransformDirty=true;}this.scheduleRender();});let removeSyncCheck;if(typeof window!=="undefined"&&window.MotionCheckAppearSync){removeSyncCheck=window.MotionCheckAppearSync(this,key,value);}this.valueSubscriptions.set(key,()=>{removeOnChange();if(removeSyncCheck)removeSyncCheck();if(value.owner)value.stop();});}sortNodePosition(other){/**
|
|
1121
1143
|
* If these nodes aren't even of the same type we can't compare their depth.
|
|
1122
1144
|
*/if(!this.current||!this.sortInstanceNodePosition||this.type!==other.type){return 0;}return this.sortInstanceNodePosition(this.current,other.current);}updateFeatures(){let key="animation";for(key in featureDefinitions){const featureDefinition=featureDefinitions[key];if(!featureDefinition)continue;const{isEnabled,Feature:FeatureConstructor}=featureDefinition;/**
|
|
1123
1145
|
* If this feature is enabled but not active, make a new instance.
|
|
@@ -1168,7 +1190,7 @@ value=parseFloat(value);}else if(!findValueType(value)&&complex.test(target)){va
|
|
|
1168
1190
|
* compareDocumentPosition returns a bitmask, by using the bitwise &
|
|
1169
1191
|
* we're returning true if 2 in that bitmask is set to true. 2 is set
|
|
1170
1192
|
* to true if b preceeds a.
|
|
1171
|
-
*/return a.compareDocumentPosition(b)&2?1:-1;}getBaseTargetFromProps(props,key){const style=props.style;return style?style[key]:undefined;}removeValueFromRenderState(key,
|
|
1193
|
+
*/return a.compareDocumentPosition(b)&2?1:-1;}getBaseTargetFromProps(props,key){const style=props.style;return style?style[key]:undefined;}removeValueFromRenderState(key,_ref38){let{vars,style}=_ref38;delete vars[key];delete style[key];}handleChildMotionValue(){if(this.childSubscription){this.childSubscription();delete this.childSubscription;}const{children}=this.props;if(isMotionValue(children)){this.childSubscription=children.on("change",latest=>{if(this.current){this.current.textContent="".concat(latest);}});}}}/**
|
|
1172
1194
|
* Feature base class for extending VisualElement functionality.
|
|
1173
1195
|
* Features are plugins that can be mounted/unmounted to add behavior
|
|
1174
1196
|
* like gestures, animations, or layout tracking.
|
|
@@ -1176,11 +1198,11 @@ value=parseFloat(value);}else if(!findValueType(value)&&complex.test(target)){va
|
|
|
1176
1198
|
* Bounding boxes tend to be defined as top, left, right, bottom. For various operations
|
|
1177
1199
|
* it's easier to consider each axis individually. This function returns a bounding box
|
|
1178
1200
|
* as a map of single-axis min/max values.
|
|
1179
|
-
*/function convertBoundingBoxToBox(
|
|
1201
|
+
*/function convertBoundingBoxToBox(_ref39){let{top,left,right,bottom}=_ref39;return{x:{min:left,max:right},y:{min:top,max:bottom}};}function convertBoxToBoundingBox(_ref40){let{x,y}=_ref40;return{top:y.min,right:x.max,bottom:y.max,left:x.min};}/**
|
|
1180
1202
|
* Applies a TransformPoint function to a bounding box. TransformPoint is usually a function
|
|
1181
1203
|
* provided by Framer to allow measured points to be corrected for device scaling. This is used
|
|
1182
1204
|
* when measuring DOM elements and DOM event points.
|
|
1183
|
-
*/function transformBoxPoints(point,transformPoint){if(!transformPoint)return point;const topLeft=transformPoint({x:point.left,y:point.top});const bottomRight=transformPoint({x:point.right,y:point.bottom});return{top:topLeft.y,left:topLeft.x,bottom:bottomRight.y,right:bottomRight.x};}function isIdentityScale(scale){return scale===undefined||scale===1;}function hasScale(
|
|
1205
|
+
*/function transformBoxPoints(point,transformPoint){if(!transformPoint)return point;const topLeft=transformPoint({x:point.left,y:point.top});const bottomRight=transformPoint({x:point.right,y:point.bottom});return{top:topLeft.y,left:topLeft.x,bottom:bottomRight.y,right:bottomRight.x};}function isIdentityScale(scale){return scale===undefined||scale===1;}function hasScale(_ref41){let{scale,scaleX,scaleY}=_ref41;return!isIdentityScale(scale)||!isIdentityScale(scaleX)||!isIdentityScale(scaleY);}function hasTransform(values){return hasScale(values)||has2DTranslate(values)||values.z||values.rotate||values.rotateX||values.rotateY||values.skewX||values.skewY;}function has2DTranslate(values){return is2DTranslate(values.x)||is2DTranslate(values.y);}function is2DTranslate(value){return value&&value!=="0%";}/**
|
|
1184
1206
|
* Scales a point based on a factor and an originPoint
|
|
1185
1207
|
*/function scalePoint(point,scale,originPoint){const distanceFromOrigin=point-originPoint;const scaled=scale*distanceFromOrigin;return originPoint+scaled;}/**
|
|
1186
1208
|
* Applies a translate/scale delta to a point
|
|
@@ -1188,7 +1210,7 @@ value=parseFloat(value);}else if(!findValueType(value)&&complex.test(target)){va
|
|
|
1188
1210
|
* Applies a translate/scale delta to an axis
|
|
1189
1211
|
*/function applyAxisDelta(axis){let translate=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let scale=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;let originPoint=arguments.length>3?arguments[3]:undefined;let boxScale=arguments.length>4?arguments[4]:undefined;axis.min=applyPointDelta(axis.min,translate,scale,originPoint,boxScale);axis.max=applyPointDelta(axis.max,translate,scale,originPoint,boxScale);}/**
|
|
1190
1212
|
* Applies a translate/scale delta to a box
|
|
1191
|
-
*/function applyBoxDelta(box,
|
|
1213
|
+
*/function applyBoxDelta(box,_ref42){let{x,y}=_ref42;applyAxisDelta(box.x,x.translate,x.scale,x.originPoint);applyAxisDelta(box.y,y.translate,y.scale,y.originPoint);}const TREE_SCALE_SNAP_MIN=0.999999999999;const TREE_SCALE_SNAP_MAX=1.0000000000001;/**
|
|
1192
1214
|
* Apply a tree of deltas to a box. We do this to calculate the effect of all the transforms
|
|
1193
1215
|
* in a tree upon our box before then calculating how to project it into our desired viewport-relative box
|
|
1194
1216
|
*
|
|
@@ -1235,7 +1257,7 @@ hasTransformOrigin=true;transformOrigin[key]=valueAsType;}else{style[key]=valueA
|
|
|
1235
1257
|
*/style.transform="none";}}/**
|
|
1236
1258
|
* Build a transformOrigin style. Uses the same defaults as the browser for
|
|
1237
1259
|
* undefined origins.
|
|
1238
|
-
*/if(hasTransformOrigin){const{originX="50%",originY="50%",originZ=0}=transformOrigin;style.transformOrigin="".concat(originX," ").concat(originY," ").concat(originZ);}}function renderHTML(element,
|
|
1260
|
+
*/if(hasTransformOrigin){const{originX="50%",originY="50%",originZ=0}=transformOrigin;style.transformOrigin="".concat(originX," ").concat(originY," ").concat(originZ);}}function renderHTML(element,_ref43,styleProp,projection){let{style,vars}=_ref43;const elementStyle=element.style;let key;for(key in style){// CSSStyleDeclaration has [index: number]: string; in the types, so we use that as key type.
|
|
1239
1261
|
elementStyle[key]=style[key];}// Write projection styles directly to element style
|
|
1240
1262
|
projection===null||projection===void 0||projection.applyProjectionStyles(elementStyle,styleProp);for(key in vars){// Loop over any CSS variables and assign those.
|
|
1241
1263
|
// They can only be assigned using `setProperty`.
|
|
@@ -1251,7 +1273,7 @@ elementStyle.setProperty(key,vars[key]);}}function pixelsToPercent(pixels,axis){
|
|
|
1251
1273
|
*/if(typeof latest==="string"){if(px.test(latest)){latest=parseFloat(latest);}else{return latest;}}/**
|
|
1252
1274
|
* If latest is a number, it's a pixel value. We use the current viewportBox to calculate that
|
|
1253
1275
|
* pixel value as a percentage of each axis
|
|
1254
|
-
*/const x=pixelsToPercent(latest,node.target.x);const y=pixelsToPercent(latest,node.target.y);return"".concat(x,"% ").concat(y,"%");}};const correctBoxShadow={correct:(latest,
|
|
1276
|
+
*/const x=pixelsToPercent(latest,node.target.x);const y=pixelsToPercent(latest,node.target.y);return"".concat(x,"% ").concat(y,"%");}};const correctBoxShadow={correct:(latest,_ref44)=>{let{treeScale,projectionDelta}=_ref44;const original=latest;const shadow=complex.parse(latest);// TODO: Doesn't support multiple shadows
|
|
1255
1277
|
if(shadow.length>5)return original;const template=complex.createTransformer(latest);const offset=typeof shadow[0]!=="number"?1:0;// Calculate the overall context scale
|
|
1256
1278
|
const xScale=projectionDelta.x.scale*treeScale.x;const yScale=projectionDelta.y.scale*treeScale.y;shadow[0+offset]/=xScale;shadow[1+offset]/=yScale;/**
|
|
1257
1279
|
* Ideally we'd correct x and y scales individually, but because blur and
|
|
@@ -1260,7 +1282,7 @@ const xScale=projectionDelta.x.scale*treeScale.x;const yScale=projectionDelta.y.
|
|
|
1260
1282
|
* the two scales.
|
|
1261
1283
|
*/const averageScale=mixNumber$1(xScale,yScale,0.5);// Blur
|
|
1262
1284
|
if(typeof shadow[2+offset]==="number")shadow[2+offset]/=averageScale;// Spread
|
|
1263
|
-
if(typeof shadow[3+offset]==="number")shadow[3+offset]/=averageScale;return template(shadow);}};const scaleCorrectors={borderRadius:_objectSpread(_objectSpread({},correctBorderRadius),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow};function isForcedMotionValue(key,
|
|
1285
|
+
if(typeof shadow[3+offset]==="number")shadow[3+offset]/=averageScale;return template(shadow);}};const scaleCorrectors={borderRadius:_objectSpread(_objectSpread({},correctBorderRadius),{},{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow};function isForcedMotionValue(key,_ref45){let{layout,layoutId}=_ref45;return transformProps.has(key)||key.startsWith("origin")||(layout||layoutId!==undefined)&&(!!scaleCorrectors[key]||key==="opacity");}function scrapeMotionValuesFromProps$1(props,prevProps,visualElement){const style=props.style;const prevStyle=prevProps===null||prevProps===void 0?void 0:prevProps.style;const newValues={};if(!style)return newValues;for(const key in style){var _visualElement$getVal;if(isMotionValue(style[key])||prevStyle&&isMotionValue(prevStyle[key])||isForcedMotionValue(key,props)||(visualElement===null||visualElement===void 0||(_visualElement$getVal=visualElement.getValue(key))===null||_visualElement$getVal===void 0?void 0:_visualElement$getVal.liveStyle)!==undefined){newValues[key]=style[key];}}return newValues;}function getComputedStyle$1(element){return window.getComputedStyle(element);}class HTMLVisualElement extends DOMVisualElement{constructor(){super(...arguments);this.type="html";this.renderInstance=renderHTML;}readValueFromInstance(instance,key){if(transformProps.has(key)){var _this$projection;return(_this$projection=this.projection)!==null&&_this$projection!==void 0&&_this$projection.isProjecting?defaultTransformValue(key):readTransformValue(instance,key);}else{const computedStyle=getComputedStyle$1(instance);const value=(isCSSVariableName(key)?computedStyle.getPropertyValue(key):computedStyle[key])||0;return typeof value==="string"?value.trim():value;}}measureInstanceViewportBox(instance,_ref46){let{transformPagePoint}=_ref46;return measureViewportBox(instance,transformPagePoint);}build(renderState,latestValues,props){buildHTMLStyles(renderState,latestValues,props.transformTemplate);}scrapeMotionValuesFromProps(props,prevProps,visualElement){return scrapeMotionValuesFromProps$1(props,prevProps,visualElement);}}const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"};const camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};/**
|
|
1264
1286
|
* Build SVG path properties. Uses the path's measured length to convert
|
|
1265
1287
|
* our custom pathLength, pathSpacing and pathOffset into stroke-dashoffset
|
|
1266
1288
|
* and stroke-dasharray attributes.
|
|
@@ -1278,8 +1300,8 @@ attrs[keys.array]="".concat(length," ").concat(spacing);}/**
|
|
|
1278
1300
|
* CSS Motion Path properties that should remain as CSS styles on SVG elements.
|
|
1279
1301
|
*/const cssMotionPathProperties=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];/**
|
|
1280
1302
|
* Build SVG visual attributes, like cx and style.transform
|
|
1281
|
-
*/function buildSVGAttrs(state,
|
|
1282
|
-
}=
|
|
1303
|
+
*/function buildSVGAttrs(state,_ref47,isSVGTag,transformTemplate,styleProp){let{attrX,attrY,attrScale,pathLength,pathSpacing=1,pathOffset=0// This is object creation, which we try to avoid per-frame.
|
|
1304
|
+
}=_ref47,latest=_objectWithoutProperties(_ref47,_excluded11);buildHTMLStyles(state,latest,transformTemplate);/**
|
|
1283
1305
|
* For svg tags we just want to make sure viewBox is animatable and treat all the styles
|
|
1284
1306
|
* as normal HTML tags.
|
|
1285
1307
|
*/if(isSVGTag){if(state.style.viewBox){state.attrs.viewBox=state.style.viewBox;}return;}state.attrs=state.style;state.style={};const{attrs,style}=state;/**
|
|
@@ -1295,10 +1317,10 @@ if(pathLength!==undefined){buildSVGPath(attrs,pathLength,pathSpacing,pathOffset,
|
|
|
1295
1317
|
*/const camelCaseAttributes=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"]);const isSVGTag=tag=>typeof tag==="string"&&tag.toLowerCase()==="svg";function renderSVG(element,renderState,_styleProp,projection){renderHTML(element,renderState,undefined,projection);for(const key in renderState.attrs){element.setAttribute(!camelCaseAttributes.has(key)?camelToDash(key):key,renderState.attrs[key]);}}function scrapeMotionValuesFromProps(props,prevProps,visualElement){const newValues=scrapeMotionValuesFromProps$1(props,prevProps,visualElement);for(const key in props){if(isMotionValue(props[key])||isMotionValue(prevProps[key])){const targetKey=transformPropOrder.indexOf(key)!==-1?"attr"+key.charAt(0).toUpperCase()+key.substring(1):key;newValues[targetKey]=props[key];}}return newValues;}class SVGVisualElement extends DOMVisualElement{constructor(){super(...arguments);this.type="svg";this.isSVGTag=false;this.measureInstanceViewportBox=createBox;}getBaseTargetFromProps(props,key){return props[key];}readValueFromInstance(instance,key){if(transformProps.has(key)){const defaultType=getDefaultValueType(key);return defaultType?defaultType.default||0:0;}key=!camelCaseAttributes.has(key)?camelToDash(key):key;return instance.getAttribute(key);}scrapeMotionValuesFromProps(props,prevProps,visualElement){return scrapeMotionValuesFromProps(props,prevProps,visualElement);}build(renderState,latestValues,props){buildSVGAttrs(renderState,latestValues,this.isSVGTag,props.transformTemplate,props.style);}renderInstance(instance,renderState,styleProp,projection){renderSVG(instance,renderState,styleProp,projection);}mount(instance){this.isSVGTag=isSVGTag(instance.tagName);super.mount(instance);}}const numVariantProps=variantProps.length;/**
|
|
1296
1318
|
* Get variant context from a visual element's parent chain.
|
|
1297
1319
|
* Uses `any` type for visualElement to avoid circular dependencies.
|
|
1298
|
-
*/function getVariantContext(visualElement){if(!visualElement)return undefined;if(!visualElement.isControllingVariants){const context=visualElement.parent?getVariantContext(visualElement.parent)||{}:{};if(visualElement.props.initial!==undefined){context.initial=visualElement.props.initial;}return context;}const context={};for(let i=0;i<numVariantProps;i++){const name=variantProps[i];const prop=visualElement.props[name];if(isVariantLabel(prop)||prop===false){context[name]=prop;}}return context;}function shallowCompare(next,prev){if(!Array.isArray(prev))return false;const prevLength=prev.length;if(prevLength!==next.length)return false;for(let i=0;i<prevLength;i++){if(prev[i]!==next[i])return false;}return true;}const reversePriorityOrder=[...variantPriorityOrder].reverse();const numAnimationTypes=variantPriorityOrder.length;function createAnimateFunction(visualElement){return animations=>{return Promise.all(animations.map(
|
|
1320
|
+
*/function getVariantContext(visualElement){if(!visualElement)return undefined;if(!visualElement.isControllingVariants){const context=visualElement.parent?getVariantContext(visualElement.parent)||{}:{};if(visualElement.props.initial!==undefined){context.initial=visualElement.props.initial;}return context;}const context={};for(let i=0;i<numVariantProps;i++){const name=variantProps[i];const prop=visualElement.props[name];if(isVariantLabel(prop)||prop===false){context[name]=prop;}}return context;}function shallowCompare(next,prev){if(!Array.isArray(prev))return false;const prevLength=prev.length;if(prevLength!==next.length)return false;for(let i=0;i<prevLength;i++){if(prev[i]!==next[i])return false;}return true;}const reversePriorityOrder=[...variantPriorityOrder].reverse();const numAnimationTypes=variantPriorityOrder.length;function createAnimateFunction(visualElement){return animations=>{return Promise.all(animations.map(_ref48=>{let{animation,options}=_ref48;return animateVisualElement(visualElement,animation,options);}));};}function createAnimationState(visualElement){let animate=createAnimateFunction(visualElement);let state=createState();let isInitialRender=true;/**
|
|
1299
1321
|
* This function will be used to reduce the animation definitions for
|
|
1300
1322
|
* each active animation type into an object of resolved values for it.
|
|
1301
|
-
*/const buildResolvedTypeValues=type=>(acc,definition)=>{var _visualElement$presen2;const resolved=resolveVariant(visualElement,definition,type==="exit"?(_visualElement$presen2=visualElement.presenceContext)===null||_visualElement$presen2===void 0?void 0:_visualElement$presen2.custom:undefined);if(resolved){const{transition,transitionEnd}=resolved,target=_objectWithoutProperties(resolved,
|
|
1323
|
+
*/const buildResolvedTypeValues=type=>(acc,definition)=>{var _visualElement$presen2;const resolved=resolveVariant(visualElement,definition,type==="exit"?(_visualElement$presen2=visualElement.presenceContext)===null||_visualElement$presen2===void 0?void 0:_visualElement$presen2.custom:undefined);if(resolved){const{transition,transitionEnd}=resolved,target=_objectWithoutProperties(resolved,_excluded12);acc=_objectSpread(_objectSpread(_objectSpread({},acc),target),transitionEnd);}return acc;};/**
|
|
1302
1324
|
* This just allows us to inject mocked animation functions
|
|
1303
1325
|
* @internal
|
|
1304
1326
|
*/function setAnimateFunction(makeAnimator){animate=makeAnimator(visualElement);}/**
|
|
@@ -1420,7 +1442,7 @@ if(state[type].isActive===isActive)return Promise.resolve();// Propagate active
|
|
|
1420
1442
|
*/function removeAxisDelta(axis){let translate=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;let scale=arguments.length>2&&arguments[2]!==undefined?arguments[2]:1;let origin=arguments.length>3&&arguments[3]!==undefined?arguments[3]:0.5;let boxScale=arguments.length>4?arguments[4]:undefined;let originAxis=arguments.length>5&&arguments[5]!==undefined?arguments[5]:axis;let sourceAxis=arguments.length>6&&arguments[6]!==undefined?arguments[6]:axis;if(percent.test(translate)){translate=parseFloat(translate);const relativeProgress=mixNumber$1(sourceAxis.min,sourceAxis.max,translate/100);translate=relativeProgress-sourceAxis.min;}if(typeof translate!=="number")return;let originPoint=mixNumber$1(originAxis.min,originAxis.max,origin);if(axis===originAxis)originPoint-=translate;axis.min=removePointDelta(axis.min,translate,scale,originPoint,boxScale);axis.max=removePointDelta(axis.max,translate,scale,originPoint,boxScale);}/**
|
|
1421
1443
|
* Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
|
|
1422
1444
|
* and acts as a bridge between motion values and removeAxisDelta
|
|
1423
|
-
*/function removeAxisTransforms(axis,transforms,
|
|
1445
|
+
*/function removeAxisTransforms(axis,transforms,_ref49,origin,sourceAxis){let[key,scaleKey,originKey]=_ref49;removeAxisDelta(axis,transforms[key],transforms[scaleKey],transforms[originKey],transforms.scale,origin,sourceAxis);}/**
|
|
1424
1446
|
* The names of the motion values we want to apply as translation, scale and origin.
|
|
1425
1447
|
*/const xKeys=["x","scaleX","originX"];const yKeys=["y","scaleY","originY"];/**
|
|
1426
1448
|
* Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
|
|
@@ -1443,7 +1465,7 @@ if(state[type].isActive===isActive)return Promise.resolve();// Propagate active
|
|
|
1443
1465
|
*/if(follow.rotate||lead.rotate){target.rotate=mixNumber$1(follow.rotate||0,lead.rotate||0,progress);}}function getRadius(values,radiusName){return values[radiusName]!==undefined?values[radiusName]:values.borderRadius;}const easeCrossfadeIn=/*@__PURE__*/compress(0,0.5,circOut);const easeCrossfadeOut=/*@__PURE__*/compress(0.5,0.95,noop);function compress(min,max,easing){return p=>{// Could replace ifs with clamp
|
|
1444
1466
|
if(p<min)return 0;if(p>max)return 1;return easing(progress(min,max,p));};}function animateSingleValue(value,keyframes,options){const motionValue$1=isMotionValue(value)?value:motionValue(value);motionValue$1.start(animateMotionValue("",motionValue$1,keyframes,options));return motionValue$1.animation;}function addDomEvent(target,eventName,handler){let options=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{passive:true};target.addEventListener(eventName,handler,options);return()=>target.removeEventListener(eventName,handler);}const compareByDepth=(a,b)=>a.depth-b.depth;class FlatTree{constructor(){this.children=[];this.isDirty=false;}add(child){addUniqueItem(this.children,child);this.isDirty=true;}remove(child){removeItem(this.children,child);this.isDirty=true;}forEach(callback){this.isDirty&&this.children.sort(compareByDepth);this.isDirty=false;this.children.forEach(callback);}}/**
|
|
1445
1467
|
* Timeout defined in ms
|
|
1446
|
-
*/function delay(callback,timeout){const start=time$1.now();const checkElapsed=
|
|
1468
|
+
*/function delay(callback,timeout){const start=time$1.now();const checkElapsed=_ref50=>{let{timestamp}=_ref50;const elapsed=timestamp-start;if(elapsed>=timeout){cancelFrame(checkElapsed);callback(elapsed-timeout);}};frame.setup(checkElapsed,true);return()=>cancelFrame(checkElapsed);}/**
|
|
1447
1469
|
* If the provided value is a MotionValue, this returns the actual value, otherwise just the value itself
|
|
1448
1470
|
*/function resolveMotionValue(value){return isMotionValue(value)?value.get():value;}class NodeStack{constructor(){this.members=[];}add(node){addUniqueItem(this.members,node);node.scheduleRender();}remove(node){removeItem(this.members,node);if(node===this.prevLead){this.prevLead=undefined;}if(node===this.lead){const prevLead=this.members[this.members.length-1];if(prevLead){this.promote(prevLead);}}}relegate(node){const indexOfNode=this.members.findIndex(member=>node===member);if(indexOfNode===0)return false;/**
|
|
1449
1471
|
* Find the next projection node that is present
|
|
@@ -1469,7 +1491,7 @@ if(p<min)return 0;if(p>max)return 1;return easing(progress(min,max,p));};}functi
|
|
|
1469
1491
|
* We use 1000 as the animation target as 0-1000 maps better to pixels than 0-1
|
|
1470
1492
|
* which has a noticeable difference in spring animations
|
|
1471
1493
|
*/const animationTarget=1000;let id$1=0;function resetDistortingTransform(key,visualElement,values,sharedAnimationValues){const{latestValues}=visualElement;// Record the distorting transform and then temporarily set it to 0
|
|
1472
|
-
if(latestValues[key]){values[key]=latestValues[key];visualElement.setStaticValue(key,0);if(sharedAnimationValues){sharedAnimationValues[key]=0;}}}function cancelTreeOptimisedTransformAnimations(projectionNode){projectionNode.hasCheckedOptimisedAppear=true;if(projectionNode.root===projectionNode)return;const{visualElement}=projectionNode.options;if(!visualElement)return;const appearId=getOptimisedAppearId(visualElement);if(window.MotionHasOptimisedAnimation(appearId,"transform")){const{layout,layoutId}=projectionNode.options;window.MotionCancelOptimisedAnimation(appearId,"transform",frame,!(layout||layoutId));}const{parent}=projectionNode;if(parent&&!parent.hasCheckedOptimisedAppear){cancelTreeOptimisedTransformAnimations(parent);}}function createProjectionNode$1(
|
|
1494
|
+
if(latestValues[key]){values[key]=latestValues[key];visualElement.setStaticValue(key,0);if(sharedAnimationValues){sharedAnimationValues[key]=0;}}}function cancelTreeOptimisedTransformAnimations(projectionNode){projectionNode.hasCheckedOptimisedAppear=true;if(projectionNode.root===projectionNode)return;const{visualElement}=projectionNode.options;if(!visualElement)return;const appearId=getOptimisedAppearId(visualElement);if(window.MotionHasOptimisedAnimation(appearId,"transform")){const{layout,layoutId}=projectionNode.options;window.MotionCancelOptimisedAnimation(appearId,"transform",frame,!(layout||layoutId));}const{parent}=projectionNode;if(parent&&!parent.hasCheckedOptimisedAppear){cancelTreeOptimisedTransformAnimations(parent);}}function createProjectionNode$1(_ref51){let{attachResizeListener,defaultParent,measureScroll,checkIsScrollRoot,resetTransform}=_ref51;return class ProjectionNode{constructor(){let latestValues=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};let parent=arguments.length>1&&arguments[1]!==undefined?arguments[1]:defaultParent===null||defaultParent===void 0?void 0:defaultParent();/**
|
|
1473
1495
|
* A unique ID generated for every projection node.
|
|
1474
1496
|
*/this.id=id$1++;/**
|
|
1475
1497
|
* An id that represents a unique session instigated by startUpdate.
|
|
@@ -1539,7 +1561,7 @@ this.sharedNodes=new Map();this.latestValues=latestValues;this.root=parent?paren
|
|
|
1539
1561
|
* Lifecycles
|
|
1540
1562
|
*/mount(instance){if(this.instance)return;this.isSVG=isSVGElement(instance)&&!isSVGSVGElement(instance);this.instance=instance;const{layoutId,layout,visualElement}=this.options;if(visualElement&&!visualElement.current){visualElement.mount(instance);}this.root.nodes.add(this);this.parent&&this.parent.children.add(this);if(this.root.hasTreeAnimated&&(layout||layoutId)){this.isLayoutDirty=true;}if(attachResizeListener){let cancelDelay;let innerWidth=0;const resizeUnblockUpdate=()=>this.root.updateBlockedByResize=false;// Set initial innerWidth in a frame.read callback to batch the read
|
|
1541
1563
|
frame.read(()=>{innerWidth=window.innerWidth;});attachResizeListener(instance,()=>{const newInnerWidth=window.innerWidth;if(newInnerWidth===innerWidth)return;innerWidth=newInnerWidth;this.root.updateBlockedByResize=true;cancelDelay&&cancelDelay();cancelDelay=delay(resizeUnblockUpdate,250);if(globalProjectionState.hasAnimatedSinceResize){globalProjectionState.hasAnimatedSinceResize=false;this.nodes.forEach(finishAnimation);}});}if(layoutId){this.root.registerSharedNode(layoutId,this);}// Only register the handler if it requires layout animation
|
|
1542
|
-
if(this.options.animate!==false&&visualElement&&(layoutId||layout)){this.addEventListener("didUpdate",
|
|
1564
|
+
if(this.options.animate!==false&&visualElement&&(layoutId||layout)){this.addEventListener("didUpdate",_ref52=>{let{delta,hasLayoutChanged,hasRelativeLayoutChanged,layout:newLayout}=_ref52;if(this.isTreeAnimationBlocked()){this.target=undefined;this.relativeTarget=undefined;return;}// TODO: Check here if an animation exists
|
|
1543
1565
|
const layoutTransition=this.options.transition||visualElement.getDefaultTransition()||defaultLayoutTransition;const{onLayoutAnimationStart,onLayoutAnimationComplete}=visualElement.getProps();/**
|
|
1544
1566
|
* The target layout of the element might stay the same,
|
|
1545
1567
|
* but its position relative to its parent has changed.
|
|
@@ -1713,10 +1735,10 @@ visualElement.render();// Put back all the values we reset
|
|
|
1713
1735
|
for(const key in resetValues){visualElement.setStaticValue(key,resetValues[key]);if(this.animationValues){this.animationValues[key]=resetValues[key];}}// Schedule a render for the next frame. This ensures we won't visually
|
|
1714
1736
|
// see the element with the reset rotate value applied.
|
|
1715
1737
|
visualElement.scheduleRender();}applyProjectionStyles(targetStyle,// CSSStyleDeclaration - doesn't allow numbers to be assigned to properties
|
|
1716
|
-
styleProp){if(!this.instance||this.isSVG)return;if(!this.isVisible){targetStyle.visibility="hidden";return;}const transformTemplate=this.getTransformTemplate();if(this.needsReset){this.needsReset=false;targetStyle.visibility="";targetStyle.opacity="";targetStyle.pointerEvents=resolveMotionValue(styleProp===null||styleProp===void 0?void 0:styleProp.pointerEvents)||"";targetStyle.transform=transformTemplate?transformTemplate(this.latestValues,""):"none";return;}const lead=this.getLead();if(!this.projectionDelta||!this.layout||!lead.target){if(this.options.layoutId){targetStyle.opacity=this.latestValues.opacity!==undefined?this.latestValues.opacity:1;targetStyle.pointerEvents=resolveMotionValue(styleProp===null||styleProp===void 0?void 0:styleProp.pointerEvents)||"";}if(this.hasProjected&&!hasTransform(this.latestValues)){targetStyle.transform=transformTemplate?transformTemplate({},""):"none";this.hasProjected=false;}return;}targetStyle.visibility="";const valuesToRender=lead.animationValues||lead.latestValues;this.applyTransformsToTarget();let transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,valuesToRender);if(transformTemplate){transform=transformTemplate(valuesToRender,transform);}targetStyle.transform=transform;const{x,y}=this.projectionDelta;targetStyle.transformOrigin="".concat(x.origin*100,"% ").concat(y.origin*100,"% 0");if(lead.animationValues){var
|
|
1738
|
+
styleProp){if(!this.instance||this.isSVG)return;if(!this.isVisible){targetStyle.visibility="hidden";return;}const transformTemplate=this.getTransformTemplate();if(this.needsReset){this.needsReset=false;targetStyle.visibility="";targetStyle.opacity="";targetStyle.pointerEvents=resolveMotionValue(styleProp===null||styleProp===void 0?void 0:styleProp.pointerEvents)||"";targetStyle.transform=transformTemplate?transformTemplate(this.latestValues,""):"none";return;}const lead=this.getLead();if(!this.projectionDelta||!this.layout||!lead.target){if(this.options.layoutId){targetStyle.opacity=this.latestValues.opacity!==undefined?this.latestValues.opacity:1;targetStyle.pointerEvents=resolveMotionValue(styleProp===null||styleProp===void 0?void 0:styleProp.pointerEvents)||"";}if(this.hasProjected&&!hasTransform(this.latestValues)){targetStyle.transform=transformTemplate?transformTemplate({},""):"none";this.hasProjected=false;}return;}targetStyle.visibility="";const valuesToRender=lead.animationValues||lead.latestValues;this.applyTransformsToTarget();let transform=buildProjectionTransform(this.projectionDeltaWithTransform,this.treeScale,valuesToRender);if(transformTemplate){transform=transformTemplate(valuesToRender,transform);}targetStyle.transform=transform;const{x,y}=this.projectionDelta;targetStyle.transformOrigin="".concat(x.origin*100,"% ").concat(y.origin*100,"% 0");if(lead.animationValues){var _ref53,_valuesToRender$opaci;/**
|
|
1717
1739
|
* If the lead component is animating, assign this either the entering/leaving
|
|
1718
1740
|
* opacity
|
|
1719
|
-
*/targetStyle.opacity=lead===this?(
|
|
1741
|
+
*/targetStyle.opacity=lead===this?(_ref53=(_valuesToRender$opaci=valuesToRender.opacity)!==null&&_valuesToRender$opaci!==void 0?_valuesToRender$opaci:this.latestValues.opacity)!==null&&_ref53!==void 0?_ref53:1:this.preserveOpacity?this.latestValues.opacity:valuesToRender.opacityExit;}else{/**
|
|
1720
1742
|
* Or we're not animating at all, set the lead component to its layout
|
|
1721
1743
|
* opacity and other components to hidden.
|
|
1722
1744
|
*/targetStyle.opacity=lead===this?valuesToRender.opacity!==undefined?valuesToRender.opacity:"":valuesToRender.opacityExit!==undefined?valuesToRender.opacityExit:0;}/**
|
|
@@ -1780,9 +1802,9 @@ if(hasCleanup){return()=>{for(let i=0;i<cleanups.length;i++){const cleanup=clean
|
|
|
1780
1802
|
return React$1.useCallback(composeRefs(...refs),refs);}/**
|
|
1781
1803
|
* Measurement functionality has to be within a separate component
|
|
1782
1804
|
* to leverage snapshot lifecycle.
|
|
1783
|
-
*/class PopChildMeasure extends React$1.Component{getSnapshotBeforeUpdate(prevProps){const element=this.props.childRef.current;if(element&&prevProps.isPresent&&!this.props.isPresent){const parent=element.offsetParent;const parentWidth=isHTMLElement$1(parent)?parent.offsetWidth||0:0;const parentHeight=isHTMLElement$1(parent)?parent.offsetHeight||0:0;const size=this.props.sizeRef.current;size.height=element.offsetHeight||0;size.width=element.offsetWidth||0;size.top=element.offsetTop;size.left=element.offsetLeft;size.right=parentWidth-size.width-size.left;size.bottom=parentHeight-size.height-size.top;}return null;}/**
|
|
1805
|
+
*/class PopChildMeasure extends React$1.Component{getSnapshotBeforeUpdate(prevProps){const element=this.props.childRef.current;if(element&&prevProps.isPresent&&!this.props.isPresent&&this.props.pop!==false){const parent=element.offsetParent;const parentWidth=isHTMLElement$1(parent)?parent.offsetWidth||0:0;const parentHeight=isHTMLElement$1(parent)?parent.offsetHeight||0:0;const size=this.props.sizeRef.current;size.height=element.offsetHeight||0;size.width=element.offsetWidth||0;size.top=element.offsetTop;size.left=element.offsetLeft;size.right=parentWidth-size.width-size.left;size.bottom=parentHeight-size.height-size.top;}return null;}/**
|
|
1784
1806
|
* Required with getSnapshotBeforeUpdate to stop React complaining.
|
|
1785
|
-
*/componentDidUpdate(){}render(){return this.props.children;}}function PopChild(
|
|
1807
|
+
*/componentDidUpdate(){}render(){return this.props.children;}}function PopChild(_ref54){var _children$props$ref,_children$props;let{children,isPresent,anchorX,anchorY,root,pop}=_ref54;const id=useId();const ref=useRef$1(null);const size=useRef$1({width:0,height:0,top:0,left:0,right:0,bottom:0});const{nonce}=useContext(MotionConfigContext);/**
|
|
1786
1808
|
* In React 19, refs are passed via props.ref instead of element.ref.
|
|
1787
1809
|
* We check props.ref first (React 19) and fall back to element.ref (React 18).
|
|
1788
1810
|
*/const childRef=(_children$props$ref=(_children$props=children.props)===null||_children$props===void 0?void 0:_children$props.ref)!==null&&_children$props$ref!==void 0?_children$props$ref:children===null||children===void 0?void 0:children.ref;const composedRef=useComposedRefs(ref,childRef);/**
|
|
@@ -1793,7 +1815,7 @@ return React$1.useCallback(composeRefs(...refs),refs);}/**
|
|
|
1793
1815
|
* in getSnapshotBeforeUpdate (post-render), likewise if we apply the
|
|
1794
1816
|
* styles directly on the DOM node, we might be overwriting
|
|
1795
1817
|
* styles set via the style prop.
|
|
1796
|
-
*/useInsertionEffect(()=>{const{width,height,top,left,right,bottom}=size.current;if(isPresent||!ref.current||!width||!height)return;const x=anchorX==="left"?"left: ".concat(left):"right: ".concat(right);const y=anchorY==="bottom"?"bottom: ".concat(bottom):"top: ".concat(top);ref.current.dataset.motionPopId=id;const style=document.createElement("style");if(nonce)style.nonce=nonce;const parent=root!==null&&root!==void 0?root:document.head;parent.appendChild(style);if(style.sheet){style.sheet.insertRule("\n [data-motion-pop-id=\"".concat(id,"\"] {\n position: absolute !important;\n width: ").concat(width,"px !important;\n height: ").concat(height,"px !important;\n ").concat(x,"px !important;\n ").concat(y,"px !important;\n }\n "));}return()=>{if(parent.contains(style)){parent.removeChild(style);}};},[isPresent]);return jsx(PopChildMeasure,{isPresent:isPresent,childRef:ref,sizeRef:size,children:React$1.cloneElement(children,{ref:composedRef})});}const PresenceChild=
|
|
1818
|
+
*/useInsertionEffect(()=>{const{width,height,top,left,right,bottom}=size.current;if(isPresent||pop===false||!ref.current||!width||!height)return;const x=anchorX==="left"?"left: ".concat(left):"right: ".concat(right);const y=anchorY==="bottom"?"bottom: ".concat(bottom):"top: ".concat(top);ref.current.dataset.motionPopId=id;const style=document.createElement("style");if(nonce)style.nonce=nonce;const parent=root!==null&&root!==void 0?root:document.head;parent.appendChild(style);if(style.sheet){style.sheet.insertRule("\n [data-motion-pop-id=\"".concat(id,"\"] {\n position: absolute !important;\n width: ").concat(width,"px !important;\n height: ").concat(height,"px !important;\n ").concat(x,"px !important;\n ").concat(y,"px !important;\n }\n "));}return()=>{if(parent.contains(style)){parent.removeChild(style);}};},[isPresent]);return jsx(PopChildMeasure,{isPresent:isPresent,childRef:ref,sizeRef:size,pop:pop,children:pop===false?children:React$1.cloneElement(children,{ref:composedRef})});}const PresenceChild=_ref55=>{let{children,initial,isPresent,onExitComplete,custom,presenceAffectsLayout,mode,anchorX,anchorY,root}=_ref55;const presenceChildren=useConstant(newChildrenMap);const id=useId();let isReusedContext=true;let context=useMemo(()=>{isReusedContext=false;return{id,initial,isPresent,custom,onExitComplete:childId=>{presenceChildren.set(childId,true);for(const isComplete of presenceChildren.values()){if(!isComplete)return;// can stop searching when any is incomplete
|
|
1797
1819
|
}onExitComplete&&onExitComplete();},register:childId=>{presenceChildren.set(childId,false);return()=>presenceChildren.delete(childId);}};},[isPresent,presenceChildren,onExitComplete]);/**
|
|
1798
1820
|
* If the presence of a child affects the layout of the components around it,
|
|
1799
1821
|
* we want to make a new context value to ensure they get re-rendered
|
|
@@ -1801,7 +1823,7 @@ return React$1.useCallback(composeRefs(...refs),refs);}/**
|
|
|
1801
1823
|
*/if(presenceAffectsLayout&&isReusedContext){context=_objectSpread({},context);}useMemo(()=>{presenceChildren.forEach((_,key)=>presenceChildren.set(key,false));},[isPresent]);/**
|
|
1802
1824
|
* If there's no `motion` components to fire exit animations, we want to remove this
|
|
1803
1825
|
* component immediately.
|
|
1804
|
-
*/React$1.useEffect(()=>{!isPresent&&!presenceChildren.size&&onExitComplete&&onExitComplete();},[isPresent]);
|
|
1826
|
+
*/React$1.useEffect(()=>{!isPresent&&!presenceChildren.size&&onExitComplete&&onExitComplete();},[isPresent]);children=jsx(PopChild,{pop:mode==="popLayout",isPresent:isPresent,anchorX:anchorX,anchorY:anchorY,root:root,children:children});return jsx(PresenceContext.Provider,{value:context,children:children});};function newChildrenMap(){return new Map();}/**
|
|
1805
1827
|
* When a component is the child of `AnimatePresence`, it can use `usePresence`
|
|
1806
1828
|
* to access information about whether it's still present in the React tree.
|
|
1807
1829
|
*
|
|
@@ -1858,7 +1880,7 @@ Children.forEach(children,child=>{if(isValidElement$1(child))filtered.push(child
|
|
|
1858
1880
|
* `usePresence` all need to call `safeToRemove`.
|
|
1859
1881
|
*
|
|
1860
1882
|
* @public
|
|
1861
|
-
*/const AnimatePresence=
|
|
1883
|
+
*/const AnimatePresence=_ref56=>{let{children,custom,initial=true,onExitComplete,presenceAffectsLayout=true,mode="sync",propagate=false,anchorX="left",anchorY="top",root}=_ref56;const[isParentPresent,safeToRemove]=usePresence(propagate);/**
|
|
1862
1884
|
* Filter any children that aren't ReactElements. We can only track components
|
|
1863
1885
|
* between renders with a props.key.
|
|
1864
1886
|
*/const presentChildren=useMemo(()=>onlyElements(children),[children]);/**
|
|
@@ -1902,7 +1924,7 @@ Children.forEach(children,child=>{if(isValidElement$1(child))filtered.push(child
|
|
|
1902
1924
|
*
|
|
1903
1925
|
* @privateRemarks
|
|
1904
1926
|
* This doesn't throw if a `MotionProp` name is missing - it should.
|
|
1905
|
-
*/const validMotionProps=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"]);/**
|
|
1927
|
+
*/const validMotionProps=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","propagate","ignoreStrict","viewport"]);/**
|
|
1906
1928
|
* Check whether a prop name is a valid `MotionProp` key.
|
|
1907
1929
|
*
|
|
1908
1930
|
* @param key - Name of the property to check
|
|
@@ -1934,7 +1956,7 @@ shouldForward=key=>key.startsWith("on")?!isValidMotionProp(key):isValidProp(key)
|
|
|
1934
1956
|
* We check the type as it could be used with the `feColorMatrix`
|
|
1935
1957
|
* element, which we support.
|
|
1936
1958
|
*/if(key==="values"&&typeof props.values==="object")continue;if(shouldForward(key)||forwardMotionProps===true&&isValidMotionProp(key)||!isDom&&!isValidMotionProp(key)||// If trying to use native HTML drag events, forward drag listeners
|
|
1937
|
-
props["draggable"]&&key.startsWith("onDrag")){filteredProps[key]=props[key];}}return filteredProps;}const MotionContext=/* @__PURE__ */createContext({});function getCurrentTreeVariants(props,context){if(isControllingVariants(props)){const{initial,animate}=props;return{initial:initial===false||isVariantLabel(initial)?initial:undefined,animate:isVariantLabel(animate)?animate:undefined};}return props.inherit!==false?context:{};}function useCreateMotionContext(props){const{initial,animate}=getCurrentTreeVariants(props,useContext(MotionContext));return useMemo(()=>({initial,animate}),[variantLabelsAsDependency(initial),variantLabelsAsDependency(animate)]);}function variantLabelsAsDependency(prop){return Array.isArray(prop)?prop.join(" "):prop;}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(target,source,props){for(const key in source){if(!isMotionValue(source[key])&&!isForcedMotionValue(key,props)){target[key]=source[key];}}}function useInitialMotionValues(
|
|
1959
|
+
props["draggable"]&&key.startsWith("onDrag")){filteredProps[key]=props[key];}}return filteredProps;}const MotionContext=/* @__PURE__ */createContext({});function getCurrentTreeVariants(props,context){if(isControllingVariants(props)){const{initial,animate}=props;return{initial:initial===false||isVariantLabel(initial)?initial:undefined,animate:isVariantLabel(animate)?animate:undefined};}return props.inherit!==false?context:{};}function useCreateMotionContext(props){const{initial,animate}=getCurrentTreeVariants(props,useContext(MotionContext));return useMemo(()=>({initial,animate}),[variantLabelsAsDependency(initial),variantLabelsAsDependency(animate)]);}function variantLabelsAsDependency(prop){return Array.isArray(prop)?prop.join(" "):prop;}const createHtmlRenderState=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function copyRawValuesOnly(target,source,props){for(const key in source){if(!isMotionValue(source[key])&&!isForcedMotionValue(key,props)){target[key]=source[key];}}}function useInitialMotionValues(_ref57,visualState){let{transformTemplate}=_ref57;return useMemo(()=>{const state=createHtmlRenderState();buildHTMLStyles(state,visualState,transformTemplate);return Object.assign({},state.vars,state.style);},[visualState]);}function useStyle(props,visualState){const styleProp=props.style||{};const style={};/**
|
|
1938
1960
|
* Copy non-Motion Values straight into style
|
|
1939
1961
|
*/copyRawValuesOnly(style,styleProp,props);Object.assign(style,useInitialMotionValues(props,visualState));return style;}function useHTMLProps(props,visualState){// The `any` isn't ideal but it is the type of createElement props argument
|
|
1940
1962
|
const htmlProps={};const style=useStyle(props,visualState);if(props.drag&&props.dragListener!==false){// Disable the ghost element when a user drags
|
|
@@ -1952,11 +1974,11 @@ style.touchAction=props.drag===true?"none":"pan-".concat(props.drag==="x"?"y":"x
|
|
|
1952
1974
|
* If it's in our list of lowercase SVG tags, it's an SVG component
|
|
1953
1975
|
*/lowercaseSVGElements.indexOf(Component)>-1||/**
|
|
1954
1976
|
* If it contains a capital letter, it's an SVG component
|
|
1955
|
-
*//[A-Z]/.test(Component)){return true;}return false;}function useRender(Component,props,ref,
|
|
1977
|
+
*//[A-Z]/.test(Component)){return true;}return false;}function useRender(Component,props,ref,_ref58,isStatic){let{latestValues}=_ref58;let forwardMotionProps=arguments.length>5&&arguments[5]!==undefined?arguments[5]:false;let isSVG=arguments.length>6?arguments[6]:undefined;const useVisualProps=(isSVG!==null&&isSVG!==void 0?isSVG:isSVGComponent(Component))?useSVGProps:useHTMLProps;const visualProps=useVisualProps(props,latestValues,isStatic,Component);const filteredProps=filterProps(props,typeof Component==="string",forwardMotionProps);const elementProps=Component!==Fragment$1?_objectSpread(_objectSpread(_objectSpread({},filteredProps),visualProps),{},{ref}):{};/**
|
|
1956
1978
|
* If component has been handed a motion value as its child,
|
|
1957
1979
|
* memoise its initial value and render that. Subsequent updates
|
|
1958
1980
|
* will be handled by the onChange handler
|
|
1959
|
-
*/const{children}=props;const renderedChildren=useMemo(()=>isMotionValue(children)?children.get():children,[children]);return createElement(Component,_objectSpread(_objectSpread({},elementProps),{},{children:renderedChildren}));}function makeState(
|
|
1981
|
+
*/const{children}=props;const renderedChildren=useMemo(()=>isMotionValue(children)?children.get():children,[children]);return createElement(Component,_objectSpread(_objectSpread({},elementProps),{},{children:renderedChildren}));}function makeState(_ref59,props,context,presenceContext){let{scrapeMotionValuesFromProps,createRenderState}=_ref59;const state={latestValues:makeLatestValues(props,context,presenceContext,scrapeMotionValuesFromProps),renderState:createRenderState()};return state;}function makeLatestValues(props,context,presenceContext,scrapeMotionValues){const values={};const motionValues=scrapeMotionValues(props,{});for(const key in motionValues){values[key]=resolveMotionValue(motionValues[key]);}let{initial,animate}=props;const isControllingVariants$1=isControllingVariants(props);const isVariantNode$1=isVariantNode(props);if(context&&isVariantNode$1&&!isControllingVariants$1&&props.inherit!==false){if(initial===undefined)initial=context.initial;if(animate===undefined)animate=context.animate;}let isInitialAnimationBlocked=presenceContext?presenceContext.initial===false:false;isInitialAnimationBlocked=isInitialAnimationBlocked||initial===false;const variantToSet=isInitialAnimationBlocked?animate:initial;if(variantToSet&&typeof variantToSet!=="boolean"&&!isAnimationControls(variantToSet)){const list=Array.isArray(variantToSet)?variantToSet:[variantToSet];for(let i=0;i<list.length;i++){const resolved=resolveVariantFromProps(props,list[i]);if(resolved){const{transitionEnd,transition}=resolved,target=_objectWithoutProperties(resolved,_excluded13);for(const key in target){let valueTarget=target[key];if(Array.isArray(valueTarget)){/**
|
|
1960
1982
|
* Take final keyframe if the initial animation is blocked because
|
|
1961
1983
|
* we want to initialise at the end of that blocked animation.
|
|
1962
1984
|
*/const index=isInitialAnimationBlocked?valueTarget.length-1:0;valueTarget=valueTarget[index];}if(valueTarget!==null){values[key]=valueTarget;}}for(const key in transitionEnd){values[key]=transitionEnd[key];}}}}return values;}const makeUseVisualState=config=>(props,isStatic)=>{const context=useContext(MotionContext);const presenceContext=useContext(PresenceContext);const make=()=>makeState(config,props,context,presenceContext);return isStatic?make():useConstant(make);};const useHTMLVisualState=/*@__PURE__*/makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps$1,createRenderState:createHtmlRenderState});const useSVGVisualState=/*@__PURE__*/makeUseVisualState({scrapeMotionValuesFromProps:scrapeMotionValuesFromProps,createRenderState:createSvgRenderState});const motionComponentSymbol=Symbol.for("motionComponentSymbol");/**
|
|
@@ -1971,12 +1993,12 @@ style.touchAction=props.drag===true?"none":"pan-".concat(props.drag==="x"?"y":"x
|
|
|
1971
1993
|
*/const externalRefContainer=useRef$1(externalRef);useInsertionEffect(()=>{externalRefContainer.current=externalRef;});// Store cleanup function returned by callback refs (React 19 feature)
|
|
1972
1994
|
const refCleanup=useRef$1(null);return useCallback(instance=>{if(instance){var _visualState$onMount;(_visualState$onMount=visualState.onMount)===null||_visualState$onMount===void 0||_visualState$onMount.call(visualState,instance);}if(visualElement){instance?visualElement.mount(instance):visualElement.unmount();}const ref=externalRefContainer.current;if(typeof ref==="function"){if(instance){const cleanup=ref(instance);if(typeof cleanup==="function"){refCleanup.current=cleanup;}}else if(refCleanup.current){refCleanup.current();refCleanup.current=null;}else{ref(instance);}}else if(ref){ref.current=instance;}},[visualElement]);}/**
|
|
1973
1995
|
* Internal, exported only for usage in Framer
|
|
1974
|
-
*/const SwitchLayoutGroupContext=createContext({});function isRefObject(ref){return ref&&typeof ref==="object"&&Object.prototype.hasOwnProperty.call(ref,"current");}function useVisualElement(Component,visualState,props,createVisualElement,ProjectionNodeConstructor,isSVG){var _window$MotionHandoff,_window,_window$MotionHasOpti,_window2;const{visualElement:parent}=useContext(MotionContext);const lazyContext=useContext(LazyContext);const presenceContext=useContext(PresenceContext);const
|
|
1996
|
+
*/const SwitchLayoutGroupContext=createContext({});function isRefObject(ref){return ref&&typeof ref==="object"&&Object.prototype.hasOwnProperty.call(ref,"current");}function useVisualElement(Component,visualState,props,createVisualElement,ProjectionNodeConstructor,isSVG){var _window$MotionHandoff,_window,_window$MotionHasOpti,_window2;const{visualElement:parent}=useContext(MotionContext);const lazyContext=useContext(LazyContext);const presenceContext=useContext(PresenceContext);const motionConfig=useContext(MotionConfigContext);const reducedMotionConfig=motionConfig.reducedMotion;const skipAnimations=motionConfig.skipAnimations;const visualElementRef=useRef$1(null);/**
|
|
1975
1997
|
* Track whether the component has been through React's commit phase.
|
|
1976
1998
|
* Used to detect when LazyMotion features load after the component has mounted.
|
|
1977
1999
|
*/const hasMountedOnce=useRef$1(false);/**
|
|
1978
2000
|
* If we haven't preloaded a renderer, check to see if we have one lazy-loaded
|
|
1979
|
-
*/createVisualElement=createVisualElement||lazyContext.renderer;if(!visualElementRef.current&&createVisualElement){visualElementRef.current=createVisualElement(Component,{visualState,parent,props,presenceContext,blockInitialAnimation:presenceContext?presenceContext.initial===false:false,reducedMotionConfig,isSVG});/**
|
|
2001
|
+
*/createVisualElement=createVisualElement||lazyContext.renderer;if(!visualElementRef.current&&createVisualElement){visualElementRef.current=createVisualElement(Component,{visualState,parent,props,presenceContext,blockInitialAnimation:presenceContext?presenceContext.initial===false:false,reducedMotionConfig,skipAnimations,isSVG});/**
|
|
1980
2002
|
* If the component has already mounted before features loaded (e.g. via
|
|
1981
2003
|
* LazyMotion with async feature loading), we need to force the initial
|
|
1982
2004
|
* animation to run. Otherwise state changes that occurred before features
|
|
@@ -2020,7 +2042,7 @@ queueMicrotask(()=>{var _window$MotionHandoff2,_window3;(_window$MotionHandoff2=
|
|
|
2020
2042
|
*
|
|
2021
2043
|
* Alongside this is a config option which provides a way of rendering the provided
|
|
2022
2044
|
* component "offline", or outside the React render cycle.
|
|
2023
|
-
*/function createMotionComponent(Component){var
|
|
2045
|
+
*/function createMotionComponent(Component){var _ref60,_Component$displayNam;let{forwardMotionProps=false,type}=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};let preloadedFeatures=arguments.length>2?arguments[2]:undefined;let createVisualElement=arguments.length>3?arguments[3]:undefined;preloadedFeatures&&loadFeatures(preloadedFeatures);/**
|
|
2024
2046
|
* Determine whether to use SVG or HTML rendering based on:
|
|
2025
2047
|
* 1. Explicit `type` option (highest priority)
|
|
2026
2048
|
* 2. Auto-detection via `isSVGComponent`
|
|
@@ -2035,7 +2057,7 @@ queueMicrotask(()=>{var _window$MotionHandoff2,_window3;(_window$MotionHandoff2=
|
|
|
2035
2057
|
*/context.visualElement=useVisualElement(Component,visualState,configAndProps,createVisualElement,layoutProjection.ProjectionNode,isSVG);}/**
|
|
2036
2058
|
* The mount order and hierarchy is specific to ensure our element ref
|
|
2037
2059
|
* is hydrated by the time features fire their effects.
|
|
2038
|
-
*/return jsxs(MotionContext.Provider,{value:context,children:[MeasureLayout&&context.visualElement?jsx(MeasureLayout,_objectSpread({visualElement:context.visualElement},configAndProps)):null,useRender(Component,props,useMotionRef(visualState,context.visualElement,externalRef),visualState,isStatic,forwardMotionProps,isSVG)]});}MotionDOMComponent.displayName="motion.".concat(typeof Component==="string"?Component:"create(".concat((
|
|
2060
|
+
*/return jsxs(MotionContext.Provider,{value:context,children:[MeasureLayout&&context.visualElement?jsx(MeasureLayout,_objectSpread({visualElement:context.visualElement},configAndProps)):null,useRender(Component,props,useMotionRef(visualState,context.visualElement,externalRef),visualState,isStatic,forwardMotionProps,isSVG)]});}MotionDOMComponent.displayName="motion.".concat(typeof Component==="string"?Component:"create(".concat((_ref60=(_Component$displayNam=Component.displayName)!==null&&_Component$displayNam!==void 0?_Component$displayNam:Component.name)!==null&&_ref60!==void 0?_ref60:"",")"));const ForwardRefMotionComponent=forwardRef(MotionDOMComponent);ForwardRefMotionComponent[motionComponentSymbol]=Component;return ForwardRefMotionComponent;}function useLayoutId(_ref61){let{layoutId}=_ref61;const layoutGroupId=useContext(LayoutGroupContext).id;return layoutGroupId&&layoutId!==undefined?layoutGroupId+"-"+layoutId:layoutId;}function useStrictMode(configAndProps,preloadedFeatures){const isStrict=useContext(LazyContext).strict;/**
|
|
2039
2061
|
* If we're in development mode, check to make sure we're not rendering a motion component
|
|
2040
2062
|
* as a child of LazyMotion, as this will break the file-size benefits of using it.
|
|
2041
2063
|
*/if(process.env.NODE_ENV!=="production"&&preloadedFeatures&&isStrict){const strictMessage="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";configAndProps.ignoreStrict?warning(false,strictMessage,"lazy-strict-mode"):invariant(false,strictMessage,"lazy-strict-mode");}}function getProjectionFunctionality(props){const featureDefinitions=getInitializedFeatureDefinitions();const{drag,layout}=featureDefinitions;if(!drag&&!layout)return{};const combined=_objectSpread(_objectSpread({},drag),layout);return{MeasureLayout:drag!==null&&drag!==void 0&&drag.isEnabled(props)||layout!==null&&layout!==void 0&&layout.isEnabled(props)?combined.MeasureLayout:undefined,ProjectionNode:combined.ProjectionNode};}function createMotionProxy(preloadedFeatures,createVisualElement){if(typeof Proxy==="undefined"){return createMotionComponent;}/**
|
|
@@ -2058,7 +2080,7 @@ queueMicrotask(()=>{var _window$MotionHandoff2,_window3;(_window$MotionHandoff2=
|
|
|
2058
2080
|
*/constructor(node){super(node);node.animationState||(node.animationState=createAnimationState(node));}updateAnimationControlsSubscription(){const{animate}=this.node.getProps();if(isAnimationControls(animate)){this.unmountControls=animate.subscribe(this.node);}}/**
|
|
2059
2081
|
* Subscribe any provided AnimationControls to the component's VisualElement
|
|
2060
2082
|
*/mount(){this.updateAnimationControlsSubscription();}update(){const{animate}=this.node.getProps();const{animate:prevAnimate}=this.node.prevProps||{};if(animate!==prevAnimate){this.updateAnimationControlsSubscription();}}unmount(){var _this$unmountControls;this.node.animationState.reset();(_this$unmountControls=this.unmountControls)===null||_this$unmountControls===void 0||_this$unmountControls.call(this);}}let id=0;class ExitAnimationFeature extends Feature{constructor(){super(...arguments);this.id=id++;}update(){if(!this.node.presenceContext)return;const{isPresent,onExitComplete}=this.node.presenceContext;const{isPresent:prevIsPresent}=this.node.prevPresenceContext||{};if(!this.node.animationState||isPresent===prevIsPresent){return;}const exitAnimation=this.node.animationState.setActive("exit",!isPresent);if(onExitComplete&&!isPresent){exitAnimation.then(()=>{onExitComplete(this.id);});}}mount(){const{register,onExitComplete}=this.node.presenceContext||{};if(onExitComplete){onExitComplete(this.id);}if(register){this.unmount=register(this.id);}}unmount(){}}const animations={animation:{Feature:AnimationFeature},exit:{Feature:ExitAnimationFeature}};function extractEventInfo(event){return{point:{x:event.pageX,y:event.pageY}};}const addPointerInfo=handler=>{return event=>isPrimaryPointer(event)&&handler(event,extractEventInfo(event));};function addPointerEvent(target,eventName,handler,options){return addDomEvent(target,eventName,addPointerInfo(handler),options);}// Fixes https://github.com/motiondivision/motion/issues/2270
|
|
2061
|
-
const getContextWindow=
|
|
2083
|
+
const getContextWindow=_ref62=>{let{current}=_ref62;return current?current.ownerDocument.defaultView:null;};const distance=(a,b)=>Math.abs(a-b);function distance2D(a,b){// Multi-dimensional
|
|
2062
2084
|
const xDelta=distance(a.x,b.x);const yDelta=distance(a.y,b.y);return Math.sqrt(xDelta**2+yDelta**2);}const overflowStyles=/*#__PURE__*/new Set(["auto","scroll"]);/**
|
|
2063
2085
|
* @internal
|
|
2064
2086
|
*/class PanSession{constructor(event,handlers){let{transformPagePoint,contextWindow=window,dragSnapToOrigin=false,distanceThreshold=3,element}=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{};/**
|
|
@@ -2098,11 +2120,17 @@ window.addEventListener("scroll",this.onWindowScroll,{passive:true});this.remove
|
|
|
2098
2120
|
* For window scroll: adjusts lastMoveEventInfo since pageX/pageY would change.
|
|
2099
2121
|
*/handleScroll(target){const initial=this.scrollPositions.get(target);if(!initial)return;const isWindow=target===window;const current=isWindow?{x:window.scrollX,y:window.scrollY}:{x:target.scrollLeft,y:target.scrollTop};const delta={x:current.x-initial.x,y:current.y-initial.y};if(delta.x===0&&delta.y===0)return;if(isWindow){// Window scroll: pageX/pageY changes, so update lastMoveEventInfo
|
|
2100
2122
|
if(this.lastMoveEventInfo){this.lastMoveEventInfo.point.x+=delta.x;this.lastMoveEventInfo.point.y+=delta.y;}}else{// Element scroll: pageX/pageY unchanged, so adjust history origin
|
|
2101
|
-
if(this.history.length>0){this.history[0].x-=delta.x;this.history[0].y-=delta.y;}}this.scrollPositions.set(target,current);frame.update(this.updatePoint,true);}updateHandlers(handlers){this.handlers=handlers;}end(){this.removeListeners&&this.removeListeners();this.removeScrollListeners&&this.removeScrollListeners();this.scrollPositions.clear();cancelFrame(this.updatePoint);}}function transformPoint(info,transformPagePoint){return transformPagePoint?{point:transformPagePoint(info.point)}:info;}function subtractPoint(a,b){return{x:a.x-b.x,y:a.y-b.y};}function getPanInfo(
|
|
2123
|
+
if(this.history.length>0){this.history[0].x-=delta.x;this.history[0].y-=delta.y;}}this.scrollPositions.set(target,current);frame.update(this.updatePoint,true);}updateHandlers(handlers){this.handlers=handlers;}end(){this.removeListeners&&this.removeListeners();this.removeScrollListeners&&this.removeScrollListeners();this.scrollPositions.clear();cancelFrame(this.updatePoint);}}function transformPoint(info,transformPagePoint){return transformPagePoint?{point:transformPagePoint(info.point)}:info;}function subtractPoint(a,b){return{x:a.x-b.x,y:a.y-b.y};}function getPanInfo(_ref63,history){let{point}=_ref63;return{point,delta:subtractPoint(point,lastDevicePoint(history)),offset:subtractPoint(point,startDevicePoint(history)),velocity:getVelocity(history,0.1)};}function startDevicePoint(history){return history[0];}function lastDevicePoint(history){return history[history.length-1];}function getVelocity(history,timeDelta){if(history.length<2){return{x:0,y:0};}let i=history.length-1;let timestampedPoint=null;const lastPoint=lastDevicePoint(history);while(i>=0){timestampedPoint=history[i];if(lastPoint.timestamp-timestampedPoint.timestamp>secondsToMilliseconds(timeDelta)){break;}i--;}if(!timestampedPoint){return{x:0,y:0};}/**
|
|
2124
|
+
* If the selected point is the pointer-down origin (history[0]),
|
|
2125
|
+
* there are better movement points available, and the time gap
|
|
2126
|
+
* is suspiciously large (>2x timeDelta), use the next point instead.
|
|
2127
|
+
* This prevents stale pointer-down points from diluting velocity
|
|
2128
|
+
* in hold-then-flick gestures.
|
|
2129
|
+
*/if(timestampedPoint===history[0]&&history.length>2&&lastPoint.timestamp-timestampedPoint.timestamp>secondsToMilliseconds(timeDelta)*2){timestampedPoint=history[1];}const time=millisecondsToSeconds(lastPoint.timestamp-timestampedPoint.timestamp);if(time===0){return{x:0,y:0};}const currentVelocity={x:(lastPoint.x-timestampedPoint.x)/time,y:(lastPoint.y-timestampedPoint.y)/time};if(currentVelocity.x===Infinity){currentVelocity.x=0;}if(currentVelocity.y===Infinity){currentVelocity.y=0;}return currentVelocity;}/**
|
|
2102
2130
|
* Apply constraints to a point. These constraints are both physical along an
|
|
2103
2131
|
* axis, and an elastic factor that determines how much to constrain the point
|
|
2104
2132
|
* by if it does lie outside the defined parameters.
|
|
2105
|
-
*/function applyConstraints(point,
|
|
2133
|
+
*/function applyConstraints(point,_ref64,elastic){let{min,max}=_ref64;if(min!==undefined&&point<min){// If we have a min point defined, and this is outside of that, constrain
|
|
2106
2134
|
point=elastic?mixNumber$1(min,point,elastic.min):Math.max(point,min);}else if(max!==undefined&&point>max){// If we have a max point defined, and this is outside of that, constrain
|
|
2107
2135
|
point=elastic?mixNumber$1(max,point,elastic.max):Math.min(point,max);}return point;}/**
|
|
2108
2136
|
* Calculate constraints in terms of the viewport when defined relatively to the
|
|
@@ -2111,7 +2139,7 @@ point=elastic?mixNumber$1(max,point,elastic.max):Math.min(point,max);}return poi
|
|
|
2111
2139
|
*/function calcRelativeAxisConstraints(axis,min,max){return{min:min!==undefined?axis.min+min:undefined,max:max!==undefined?axis.max+max-(axis.max-axis.min):undefined};}/**
|
|
2112
2140
|
* Calculate constraints in terms of the viewport when
|
|
2113
2141
|
* defined relatively to the measured bounding box.
|
|
2114
|
-
*/function calcRelativeConstraints(layoutBox,
|
|
2142
|
+
*/function calcRelativeConstraints(layoutBox,_ref65){let{top,left,bottom,right}=_ref65;return{x:calcRelativeAxisConstraints(layoutBox.x,left,right),y:calcRelativeAxisConstraints(layoutBox.y,top,bottom)};}/**
|
|
2115
2143
|
* Calculate viewport constraints when defined as another viewport-relative axis
|
|
2116
2144
|
*/function calcViewportAxisConstraints(layoutAxis,constraintsAxis){let min=constraintsAxis.min-layoutAxis.min;let max=constraintsAxis.max-layoutAxis.max;// If the constraints axis is actually smaller than the layout axis then we can
|
|
2117
2145
|
// flip the constraints
|
|
@@ -2134,19 +2162,14 @@ if(constraintsAxis.max-constraintsAxis.min<layoutAxis.max-layoutAxis.min){[min,m
|
|
|
2134
2162
|
* The latest pan info. Used as fallback when the `cancel` and `stop` functions are called without arguments.
|
|
2135
2163
|
*/this.latestPanInfo=null;this.visualElement=visualElement;}start(originEvent){let{snapToCursor=false,distanceThreshold}=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};/**
|
|
2136
2164
|
* Don't start dragging if this component is exiting
|
|
2137
|
-
*/const{presenceContext}=this.visualElement;if(presenceContext&&presenceContext.isPresent===false)return;const onSessionStart=event=>{//
|
|
2138
|
-
// - snapToCursor: stop because we'll set new position values
|
|
2139
|
-
// - otherwise: pause to allow resume if no drag starts (for constraint animations)
|
|
2140
|
-
if(snapToCursor){this.stopAnimation();this.snapToCursor(extractEventInfo(event).point);}else{this.pauseAnimation();}};const onStart=(event,info)=>{// Stop any paused animation so motion values reflect true current position
|
|
2141
|
-
// (pauseAnimation was called in onSessionStart to allow resume if no drag started)
|
|
2142
|
-
this.stopAnimation();// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
|
|
2165
|
+
*/const{presenceContext}=this.visualElement;if(presenceContext&&presenceContext.isPresent===false)return;const onSessionStart=event=>{if(snapToCursor){this.snapToCursor(extractEventInfo(event).point);}this.stopAnimation();};const onStart=(event,info)=>{// Attempt to grab the global drag gesture lock - maybe make this part of PanSession
|
|
2143
2166
|
const{drag,dragPropagation,onDragStart}=this.getProps();if(drag&&!dragPropagation){if(this.openDragLock)this.openDragLock();this.openDragLock=setDragLock(drag);// If we don 't have the lock, don't start dragging
|
|
2144
2167
|
if(!this.openDragLock)return;}this.latestPointerEvent=event;this.latestPanInfo=info;this.isDragging=true;this.currentDirection=null;this.resolveConstraints();if(this.visualElement.projection){this.visualElement.projection.isAnimationBlocked=true;this.visualElement.projection.target=undefined;}/**
|
|
2145
2168
|
* Record gesture origin and pointer offset
|
|
2146
2169
|
*/eachAxis(axis=>{let current=this.getAxisMotionValue(axis).get()||0;/**
|
|
2147
2170
|
* If the MotionValue is a percentage value convert to px
|
|
2148
2171
|
*/if(percent.test(current)){const{projection}=this.visualElement;if(projection&&projection.layout){const measuredAxis=projection.layout.layoutBox[axis];if(measuredAxis){const length=calcLength(measuredAxis);current=length*(parseFloat(current)/100);}}}this.originPoint[axis]=current;});// Fire onDragStart event
|
|
2149
|
-
if(onDragStart){frame.
|
|
2172
|
+
if(onDragStart){frame.update(()=>onDragStart(event,info),false,true);}addValueToWillChange(this.visualElement,"transform");const{animationState}=this.visualElement;animationState&&animationState.setActive("whileDrag",true);};const onMove=(event,info)=>{this.latestPointerEvent=event;this.latestPanInfo=info;const{dragPropagation,dragDirectionLock,onDirectionLock,onDrag}=this.getProps();// If we didn't successfully receive the gesture lock, early return.
|
|
2150
2173
|
if(!dragPropagation&&!this.openDragLock)return;const{offset}=info;// Attempt to detect drag direction if directionLock is true
|
|
2151
2174
|
if(dragDirectionLock&&this.currentDirection===null){this.currentDirection=getCurrentDirection(offset);// If we've successfully set a direction, notify listener
|
|
2152
2175
|
if(this.currentDirection!==null){onDirectionLock&&onDirectionLock(this.currentDirection);}return;}// Update each point with the latest position
|
|
@@ -2158,7 +2181,7 @@ this.updateAxis("x",info.point,offset);this.updateAxis("y",info.point,offset);/*
|
|
|
2158
2181
|
*/this.visualElement.render();/**
|
|
2159
2182
|
* This must fire after the render call as it might trigger a state
|
|
2160
2183
|
* change which itself might trigger a layout update.
|
|
2161
|
-
*/onDrag
|
|
2184
|
+
*/if(onDrag){frame.update(()=>onDrag(event,info),false,true);}};const onSessionEnd=(event,info)=>{this.latestPointerEvent=event;this.latestPanInfo=info;this.stop(event,info);this.latestPointerEvent=null;this.latestPanInfo=null;};const resumeAnimation=()=>{const{dragSnapToOrigin:snap}=this.getProps();if(snap||this.constraints){this.startAnimation({x:0,y:0});}};const{dragSnapToOrigin}=this.getProps();this.panSession=new PanSession(originEvent,{onSessionStart,onStart,onMove,onSessionEnd,resumeAnimation},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin,distanceThreshold,contextWindow:getContextWindow(this.visualElement),element:this.visualElement.current});}/**
|
|
2162
2185
|
* @internal
|
|
2163
2186
|
*/stop(event,panInfo){const finalEvent=event||this.latestPointerEvent;const finalPanInfo=panInfo||this.latestPanInfo;const isDragging=this.isDragging;this.cancel();if(!isDragging||!finalPanInfo||!finalEvent)return;const{velocity}=finalPanInfo;this.startAnimation(velocity);const{onDragEnd}=this.getProps();if(onDragEnd){frame.postRender(()=>onDragEnd(finalEvent,finalPanInfo));}}/**
|
|
2164
2187
|
* @internal
|
|
@@ -2171,8 +2194,10 @@ this.updateAxis("x",info.point,offset);this.updateAxis("y",info.point,offset);/*
|
|
|
2171
2194
|
if(!offset||!shouldDrag(axis,drag,this.currentDirection))return;const axisValue=this.getAxisMotionValue(axis);let next=this.originPoint[axis]+offset[axis];// Apply constraints
|
|
2172
2195
|
if(this.constraints&&this.constraints[axis]){next=applyConstraints(next,this.constraints[axis],this.elastic[axis]);}axisValue.set(next);}resolveConstraints(){var _this$visualElement$p;const{dragConstraints,dragElastic}=this.getProps();const layout=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(false):(_this$visualElement$p=this.visualElement.projection)===null||_this$visualElement$p===void 0?void 0:_this$visualElement$p.layout;const prevConstraints=this.constraints;if(dragConstraints&&isRefObject(dragConstraints)){if(!this.constraints){this.constraints=this.resolveRefConstraints();}}else{if(dragConstraints&&layout){this.constraints=calcRelativeConstraints(layout.layoutBox,dragConstraints);}else{this.constraints=false;}}this.elastic=resolveDragElastic(dragElastic);/**
|
|
2173
2196
|
* If we're outputting to external MotionValues, we want to rebase the measured constraints
|
|
2174
|
-
* from viewport-relative to component-relative.
|
|
2175
|
-
|
|
2197
|
+
* from viewport-relative to component-relative. This only applies to relative (non-ref)
|
|
2198
|
+
* constraints, as ref-based constraints from calcViewportConstraints are already in the
|
|
2199
|
+
* correct coordinate space for the motion value transform offset.
|
|
2200
|
+
*/if(prevConstraints!==this.constraints&&!isRefObject(dragConstraints)&&layout&&this.constraints&&!this.hasMutatedConstraints){eachAxis(axis=>{if(this.constraints!==false&&this.getAxisMotionValue(axis)){this.constraints[axis]=rebaseAxisConstraints(layout.layoutBox[axis],this.constraints[axis]);}});}}resolveRefConstraints(){const{dragConstraints:constraints,onMeasureDragConstraints}=this.getProps();if(!constraints||!isRefObject(constraints))return false;const constraintsElement=constraints.current;invariant(constraintsElement!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection}=this.visualElement;// TODO
|
|
2176
2201
|
if(!projection||!projection.layout)return false;const constraintsBox=measurePageBox(constraintsElement,projection.root,this.visualElement.getTransformPagePoint());let measuredConstraints=calcViewportConstraints(projection.layout.layoutBox,constraintsBox);/**
|
|
2177
2202
|
* If there's an onMeasureDragConstraints listener we call it and
|
|
2178
2203
|
* if different constraints are returned, set constraints to that
|
|
@@ -2185,7 +2210,7 @@ if(!projection||!projection.layout)return false;const constraintsBox=measurePage
|
|
|
2185
2210
|
// component's animation controls which will handle interactions with whileHover (etc),
|
|
2186
2211
|
// otherwise we just have to animate the `MotionValue` itself.
|
|
2187
2212
|
return this.startAxisValueAnimation(axis,inertia);});// Run all animations and then resolve the new drag constraints.
|
|
2188
|
-
return Promise.all(momentumAnimations).then(onDragTransitionEnd);}startAxisValueAnimation(axis,transition){const axisValue=this.getAxisMotionValue(axis);addValueToWillChange(this.visualElement,axis);return axisValue.start(animateMotionValue(axis,axisValue,0,transition,this.visualElement,false));}stopAnimation(){eachAxis(axis=>this.getAxisMotionValue(axis).stop());}
|
|
2213
|
+
return Promise.all(momentumAnimations).then(onDragTransitionEnd);}startAxisValueAnimation(axis,transition){const axisValue=this.getAxisMotionValue(axis);addValueToWillChange(this.visualElement,axis);return axisValue.start(animateMotionValue(axis,axisValue,0,transition,this.visualElement,false));}stopAnimation(){eachAxis(axis=>this.getAxisMotionValue(axis).stop());}/**
|
|
2189
2214
|
* Drag works differently depending on which props are provided.
|
|
2190
2215
|
*
|
|
2191
2216
|
* - If _dragX and _dragY are provided, we output the gesture delta directly to those motion values.
|
|
@@ -2208,24 +2233,39 @@ if(!shouldDrag(axis,drag,this.currentDirection))return;const{projection}=this.vi
|
|
|
2208
2233
|
* constraints box and save as a progress value.
|
|
2209
2234
|
*/const boxProgress={x:0,y:0};eachAxis(axis=>{const axisValue=this.getAxisMotionValue(axis);if(axisValue&&this.constraints!==false){const latest=axisValue.get();boxProgress[axis]=calcOrigin({min:latest,max:latest},this.constraints[axis]);}});/**
|
|
2210
2235
|
* Update the layout of this element and resolve the latest drag constraints
|
|
2211
|
-
*/const{transformTemplate}=this.visualElement.getProps();this.visualElement.current.style.transform=transformTemplate?transformTemplate({},""):"none";projection.root&&projection.root.updateScroll();projection.updateLayout()
|
|
2236
|
+
*/const{transformTemplate}=this.visualElement.getProps();this.visualElement.current.style.transform=transformTemplate?transformTemplate({},""):"none";projection.root&&projection.root.updateScroll();projection.updateLayout();/**
|
|
2237
|
+
* Reset constraints so resolveConstraints() will recalculate them
|
|
2238
|
+
* with the freshly measured layout rather than returning the cached value.
|
|
2239
|
+
*/this.constraints=false;this.resolveConstraints();/**
|
|
2212
2240
|
* For each axis, calculate the current progress of the layout axis
|
|
2213
2241
|
* within the new constraints.
|
|
2214
2242
|
*/eachAxis(axis=>{if(!shouldDrag(axis,drag,null))return;/**
|
|
2215
2243
|
* Calculate a new transform based on the previous box progress
|
|
2216
|
-
*/const axisValue=this.getAxisMotionValue(axis);const{min,max}=this.constraints[axis];axisValue.set(mixNumber$1(min,max,boxProgress[axis]));})
|
|
2244
|
+
*/const axisValue=this.getAxisMotionValue(axis);const{min,max}=this.constraints[axis];axisValue.set(mixNumber$1(min,max,boxProgress[axis]));});/**
|
|
2245
|
+
* Flush the updated transform to the DOM synchronously to prevent
|
|
2246
|
+
* a visual flash at the element's CSS layout position (0,0) when
|
|
2247
|
+
* the transform was stripped for measurement.
|
|
2248
|
+
*/this.visualElement.render();}addListeners(){if(!this.visualElement.current)return;elementDragControls.set(this.visualElement,this);const element=this.visualElement.current;/**
|
|
2217
2249
|
* Attach a pointerdown event listener on this DOM element to initiate drag tracking.
|
|
2218
2250
|
*/const stopPointerListener=addPointerEvent(element,"pointerdown",event=>{const{drag,dragListener=true}=this.getProps();const target=event.target;/**
|
|
2219
|
-
* Only block drag if clicking on a
|
|
2220
|
-
*
|
|
2221
|
-
*
|
|
2222
|
-
|
|
2251
|
+
* Only block drag if clicking on a text input child element
|
|
2252
|
+
* (input, textarea, select, contenteditable) where users might
|
|
2253
|
+
* want to select text or interact with the control.
|
|
2254
|
+
*
|
|
2255
|
+
* Buttons and links don't block drag since they don't have
|
|
2256
|
+
* click-and-move actions of their own.
|
|
2257
|
+
*/const isClickingTextInputChild=target!==element&&isElementTextInput(target);if(drag&&dragListener&&!isClickingTextInputChild){this.start(event);}});/**
|
|
2258
|
+
* If using ref-based constraints, observe both the draggable element
|
|
2259
|
+
* and the constraint container for size changes via ResizeObserver.
|
|
2260
|
+
* Setup is deferred because dragConstraints.current is null when
|
|
2261
|
+
* addListeners first runs (React hasn't committed the ref yet).
|
|
2262
|
+
*/let stopResizeObservers;const measureDragConstraints=()=>{const{dragConstraints}=this.getProps();if(isRefObject(dragConstraints)&&dragConstraints.current){this.constraints=this.resolveRefConstraints();if(!stopResizeObservers){stopResizeObservers=startResizeObservers(element,dragConstraints.current,()=>this.scalePositionWithinConstraints());}}};const{projection}=this.visualElement;const stopMeasureLayoutListener=projection.addEventListener("measure",measureDragConstraints);if(projection&&!projection.layout){projection.root&&projection.root.updateScroll();projection.updateLayout();}frame.read(measureDragConstraints);/**
|
|
2223
2263
|
* Attach a window resize listener to scale the draggable target within its defined
|
|
2224
2264
|
* constraints as the window resizes.
|
|
2225
2265
|
*/const stopResizeListener=addDomEvent(window,"resize",()=>this.scalePositionWithinConstraints());/**
|
|
2226
2266
|
* If the element's layout changes, calculate the delta and apply that to
|
|
2227
2267
|
* the drag gesture's origin point.
|
|
2228
|
-
*/const stopLayoutUpdateListener=projection.addEventListener("didUpdate",
|
|
2268
|
+
*/const stopLayoutUpdateListener=projection.addEventListener("didUpdate",_ref66=>{let{delta,hasLayoutChanged}=_ref66;if(this.isDragging&&hasLayoutChanged){eachAxis(axis=>{const motionValue=this.getAxisMotionValue(axis);if(!motionValue)return;this.originPoint[axis]+=delta[axis].translate;motionValue.set(motionValue.get()+delta[axis].translate);});this.visualElement.render();}});return()=>{stopResizeListener();stopPointerListener();stopMeasureLayoutListener();stopLayoutUpdateListener&&stopLayoutUpdateListener();stopResizeObservers&&stopResizeObservers();};}getProps(){const props=this.visualElement.getProps();const{drag=false,dragDirectionLock=false,dragPropagation=false,dragConstraints=false,dragElastic=defaultElastic,dragMomentum=true}=props;return _objectSpread(_objectSpread({},props),{},{drag,dragDirectionLock,dragPropagation,dragConstraints,dragElastic,dragMomentum});}}function skipFirstCall(callback){let isFirst=true;return()=>{if(isFirst){isFirst=false;return;}callback();};}function startResizeObservers(element,constraintsElement,onResize){const stopElement=resize(element,skipFirstCall(onResize));const stopContainer=resize(constraintsElement,skipFirstCall(onResize));return()=>{stopElement();stopContainer();};}function shouldDrag(direction,drag,currentDirection){return(drag===true||drag===direction)&&(currentDirection===null||currentDirection===direction);}/**
|
|
2229
2269
|
* Based on an x/y offset determine the current drag direction. If both axis' offsets are lower
|
|
2230
2270
|
* than the provided threshold, return `null`.
|
|
2231
2271
|
*
|
|
@@ -2242,7 +2282,7 @@ const{dragControls}=this.node.getProps();if(dragControls){this.removeGroupContro
|
|
|
2242
2282
|
* The pan session will be properly cleaned up when:
|
|
2243
2283
|
* 1. The drag ends naturally (pointerup/pointercancel)
|
|
2244
2284
|
* 2. The component is truly removed from the DOM
|
|
2245
|
-
*/if(!this.controls.isDragging){this.controls.endPanSession();}}}const asyncHandler=handler=>(event,info)=>{if(handler){frame.
|
|
2285
|
+
*/if(!this.controls.isDragging){this.controls.endPanSession();}}}const asyncHandler=handler=>(event,info)=>{if(handler){frame.update(()=>handler(event,info),false,true);}};class PanGesture extends Feature{constructor(){super(...arguments);this.removePointerDownListener=noop;}onPointerDown(pointerDownEvent){this.session=new PanSession(pointerDownEvent,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:getContextWindow(this.node)});}createPanHandlers(){const{onPanSessionStart,onPanStart,onPan,onPanEnd}=this.node.getProps();return{onSessionStart:asyncHandler(onPanSessionStart),onStart:asyncHandler(onPanStart),onMove:asyncHandler(onPan),onEnd:(event,info)=>{delete this.session;if(onPanEnd){frame.postRender(()=>onPanEnd(event,info));}}};}mount(){this.removePointerDownListener=addPointerEvent(this.node.current,"pointerdown",event=>this.onPointerDown(event));}update(){this.session&&this.session.updateHandlers(this.createPanHandlers());}unmount(){this.removePointerDownListener();this.session&&this.session.end();}}/**
|
|
2246
2286
|
* Track whether we've taken any snapshots yet. If not,
|
|
2247
2287
|
* we can safely skip notification of didUpdate.
|
|
2248
2288
|
*
|
|
@@ -2268,7 +2308,7 @@ const{dragControls}=this.node.getProps();if(dragControls){this.removeGroupContro
|
|
|
2268
2308
|
* apply whileHover. But, if matches throws that focus-visible
|
|
2269
2309
|
* is not a valid selector then in that browser outline styles will be applied
|
|
2270
2310
|
* to the element by default and we want to match that behaviour with whileFocus.
|
|
2271
|
-
*/try{isFocusVisible=this.node.current.matches(":focus-visible");}catch(e){isFocusVisible=true;}if(!isFocusVisible||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",true);this.isActive=true;}onBlur(){if(!this.isActive||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",false);this.isActive=false;}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()));}unmount(){}}function handlePressEvent(node,event,lifecycle){const{props}=node;if(node.current instanceof HTMLButtonElement&&node.current.disabled){return;}if(node.animationState&&props.whileTap){node.animationState.setActive("whileTap",lifecycle==="Start");}const eventName="onTap"+(lifecycle==="End"?"":lifecycle);const callback=props[eventName];if(callback){frame.postRender(()=>callback(event,extractEventInfo(event)));}}class PressGesture extends Feature{mount(){const{current}=this.node;if(!current)return;this.unmount=press(current,(_element,startEvent)=>{handlePressEvent(this.node,startEvent,"Start");return(endEvent,
|
|
2311
|
+
*/try{isFocusVisible=this.node.current.matches(":focus-visible");}catch(e){isFocusVisible=true;}if(!isFocusVisible||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",true);this.isActive=true;}onBlur(){if(!this.isActive||!this.node.animationState)return;this.node.animationState.setActive("whileFocus",false);this.isActive=false;}mount(){this.unmount=pipe(addDomEvent(this.node.current,"focus",()=>this.onFocus()),addDomEvent(this.node.current,"blur",()=>this.onBlur()));}unmount(){}}function handlePressEvent(node,event,lifecycle){const{props}=node;if(node.current instanceof HTMLButtonElement&&node.current.disabled){return;}if(node.animationState&&props.whileTap){node.animationState.setActive("whileTap",lifecycle==="Start");}const eventName="onTap"+(lifecycle==="End"?"":lifecycle);const callback=props[eventName];if(callback){frame.postRender(()=>callback(event,extractEventInfo(event)));}}class PressGesture extends Feature{mount(){const{current}=this.node;if(!current)return;const{globalTapTarget,propagate}=this.node.props;this.unmount=press(current,(_element,startEvent)=>{handlePressEvent(this.node,startEvent,"Start");return(endEvent,_ref67)=>{let{success}=_ref67;return handlePressEvent(this.node,endEvent,success?"End":"Cancel");};},{useGlobalTarget:globalTapTarget,stopPropagation:(propagate===null||propagate===void 0?void 0:propagate.tap)===false});}unmount(){}}/**
|
|
2272
2312
|
* Map an IntersectionHandler callback to an element. We only ever make one handler for one
|
|
2273
2313
|
* element, so even though these handlers might all be triggered by different
|
|
2274
2314
|
* observers, we can keep them in the same map.
|
|
@@ -2276,7 +2316,7 @@ const{dragControls}=this.node.getProps();if(dragControls){this.removeGroupContro
|
|
|
2276
2316
|
* Multiple observers can be created for multiple element/document roots. Each with
|
|
2277
2317
|
* different settings. So here we store dictionaries of observers to each root,
|
|
2278
2318
|
* using serialised settings (threshold/margin) as lookup keys.
|
|
2279
|
-
*/const observers=new WeakMap();const fireObserverCallback=entry=>{const callback=observerCallbacks.get(entry.target);callback&&callback(entry);};const fireAllObserverCallbacks=entries=>{entries.forEach(fireObserverCallback);};function initIntersectionObserver(
|
|
2319
|
+
*/const observers=new WeakMap();const fireObserverCallback=entry=>{const callback=observerCallbacks.get(entry.target);callback&&callback(entry);};const fireAllObserverCallbacks=entries=>{entries.forEach(fireObserverCallback);};function initIntersectionObserver(_ref68){let{root}=_ref68,options=_objectWithoutProperties(_ref68,_excluded14);const lookupRoot=root||document;/**
|
|
2280
2320
|
* If we don't have an observer lookup map for this root, create one.
|
|
2281
2321
|
*/if(!observers.has(lookupRoot)){observers.set(lookupRoot,{});}const rootObservers=observers.get(lookupRoot);const key=JSON.stringify(options);/**
|
|
2282
2322
|
* If we don't have an observer for this combination of root and settings,
|
|
@@ -2289,14 +2329,14 @@ const{dragControls}=this.node.getProps();if(dragControls){this.removeGroupContro
|
|
|
2289
2329
|
*/if(once&&!isIntersecting&&this.hasEnteredView){return;}else if(isIntersecting){this.hasEnteredView=true;}if(this.node.animationState){this.node.animationState.setActive("whileInView",isIntersecting);}/**
|
|
2290
2330
|
* Use the latest committed props rather than the ones in scope
|
|
2291
2331
|
* when this observer is created
|
|
2292
|
-
*/const{onViewportEnter,onViewportLeave}=this.node.getProps();const callback=isIntersecting?onViewportEnter:onViewportLeave;callback&&callback(entry);};return observeIntersection(this.node.current,options,onIntersectionUpdate);}mount(){this.startObserver();}update(){if(typeof IntersectionObserver==="undefined")return;const{props,prevProps}=this.node;const hasOptionsChanged=["amount","margin","root"].some(hasViewportOptionChanged(props,prevProps));if(hasOptionsChanged){this.startObserver();}}unmount(){}}function hasViewportOptionChanged(_ref68){let{viewport={}}=_ref68;let{viewport:prevViewport={}}=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return name=>viewport[name]!==prevViewport[name];}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};const layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}};const featureBundle=_objectSpread(_objectSpread(_objectSpread(_objectSpread({},animations),gestureAnimations),drag),layout);const motion=/*@__PURE__*/createMotionProxy(featureBundle,createDomVisualElement);var resizeObservers=[];var hasActiveObservations=function(){return resizeObservers.some(function(ro){return ro.activeTargets.length>0;});};var hasSkippedObservations=function(){return resizeObservers.some(function(ro){return ro.skippedTargets.length>0;});};var msg='ResizeObserver loop completed with undelivered notifications.';var deliverResizeLoopError=function(){var event;if(typeof ErrorEvent==='function'){event=new ErrorEvent('error',{message:msg});}else{event=document.createEvent('Event');event.initEvent('error',false,false);event.message=msg;}window.dispatchEvent(event);};var ResizeObserverBoxOptions;(function(ResizeObserverBoxOptions){ResizeObserverBoxOptions["BORDER_BOX"]="border-box";ResizeObserverBoxOptions["CONTENT_BOX"]="content-box";ResizeObserverBoxOptions["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box";})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(obj){return Object.freeze(obj);};var ResizeObserverSize=function(){function ResizeObserverSize(inlineSize,blockSize){this.inlineSize=inlineSize;this.blockSize=blockSize;freeze(this);}return ResizeObserverSize;}();var DOMRectReadOnly=function(){function DOMRectReadOnly(x,y,width,height){this.x=x;this.y=y;this.width=width;this.height=height;this.top=this.y;this.left=this.x;this.bottom=this.top+this.height;this.right=this.left+this.width;return freeze(this);}DOMRectReadOnly.prototype.toJSON=function(){var _a=this,x=_a.x,y=_a.y,top=_a.top,right=_a.right,bottom=_a.bottom,left=_a.left,width=_a.width,height=_a.height;return{x:x,y:y,top:top,right:right,bottom:bottom,left:left,width:width,height:height};};DOMRectReadOnly.fromRect=function(rectangle){return new DOMRectReadOnly(rectangle.x,rectangle.y,rectangle.width,rectangle.height);};return DOMRectReadOnly;}();var isSVG=function(target){return target instanceof SVGElement&&'getBBox'in target;};var isHidden=function(target){if(isSVG(target)){var _a=target.getBBox(),width=_a.width,height=_a.height;return!width&&!height;}var _b=target,offsetWidth=_b.offsetWidth,offsetHeight=_b.offsetHeight;return!(offsetWidth||offsetHeight||target.getClientRects().length);};var isElement=function(obj){var _a;if(obj instanceof Element){return true;}var scope=(_a=obj===null||obj===void 0?void 0:obj.ownerDocument)===null||_a===void 0?void 0:_a.defaultView;return!!(scope&&obj instanceof scope.Element);};var isReplacedElement=function(target){switch(target.tagName){case'INPUT':if(target.type!=='image'){break;}case'VIDEO':case'AUDIO':case'EMBED':case'OBJECT':case'CANVAS':case'IFRAME':case'IMG':return true;}return false;};var global$1=typeof window!=='undefined'?window:{};var cache=new WeakMap();var scrollRegexp=/auto|scroll/;var verticalRegexp=/^tb|vertical/;var IE=/msie|trident/i.test(global$1.navigator&&global$1.navigator.userAgent);var parseDimension=function(pixel){return parseFloat(pixel||'0');};var size$1=function(inlineSize,blockSize,switchSizes){if(inlineSize===void 0){inlineSize=0;}if(blockSize===void 0){blockSize=0;}if(switchSizes===void 0){switchSizes=false;}return new ResizeObserverSize((switchSizes?blockSize:inlineSize)||0,(switchSizes?inlineSize:blockSize)||0);};var zeroBoxes=freeze({devicePixelContentBoxSize:size$1(),borderBoxSize:size$1(),contentBoxSize:size$1(),contentRect:new DOMRectReadOnly(0,0,0,0)});var calculateBoxSizes=function(target,forceRecalculation){if(forceRecalculation===void 0){forceRecalculation=false;}if(cache.has(target)&&!forceRecalculation){return cache.get(target);}if(isHidden(target)){cache.set(target,zeroBoxes);return zeroBoxes;}var cs=getComputedStyle(target);var svg=isSVG(target)&&target.ownerSVGElement&&target.getBBox();var removePadding=!IE&&cs.boxSizing==='border-box';var switchSizes=verticalRegexp.test(cs.writingMode||'');var canScrollVertically=!svg&&scrollRegexp.test(cs.overflowY||'');var canScrollHorizontally=!svg&&scrollRegexp.test(cs.overflowX||'');var paddingTop=svg?0:parseDimension(cs.paddingTop);var paddingRight=svg?0:parseDimension(cs.paddingRight);var paddingBottom=svg?0:parseDimension(cs.paddingBottom);var paddingLeft=svg?0:parseDimension(cs.paddingLeft);var borderTop=svg?0:parseDimension(cs.borderTopWidth);var borderRight=svg?0:parseDimension(cs.borderRightWidth);var borderBottom=svg?0:parseDimension(cs.borderBottomWidth);var borderLeft=svg?0:parseDimension(cs.borderLeftWidth);var horizontalPadding=paddingLeft+paddingRight;var verticalPadding=paddingTop+paddingBottom;var horizontalBorderArea=borderLeft+borderRight;var verticalBorderArea=borderTop+borderBottom;var horizontalScrollbarThickness=!canScrollHorizontally?0:target.offsetHeight-verticalBorderArea-target.clientHeight;var verticalScrollbarThickness=!canScrollVertically?0:target.offsetWidth-horizontalBorderArea-target.clientWidth;var widthReduction=removePadding?horizontalPadding+horizontalBorderArea:0;var heightReduction=removePadding?verticalPadding+verticalBorderArea:0;var contentWidth=svg?svg.width:parseDimension(cs.width)-widthReduction-verticalScrollbarThickness;var contentHeight=svg?svg.height:parseDimension(cs.height)-heightReduction-horizontalScrollbarThickness;var borderBoxWidth=contentWidth+horizontalPadding+verticalScrollbarThickness+horizontalBorderArea;var borderBoxHeight=contentHeight+verticalPadding+horizontalScrollbarThickness+verticalBorderArea;var boxes=freeze({devicePixelContentBoxSize:size$1(Math.round(contentWidth*devicePixelRatio),Math.round(contentHeight*devicePixelRatio),switchSizes),borderBoxSize:size$1(borderBoxWidth,borderBoxHeight,switchSizes),contentBoxSize:size$1(contentWidth,contentHeight,switchSizes),contentRect:new DOMRectReadOnly(paddingLeft,paddingTop,contentWidth,contentHeight)});cache.set(target,boxes);return boxes;};var calculateBoxSize=function(target,observedBox,forceRecalculation){var _a=calculateBoxSizes(target,forceRecalculation),borderBoxSize=_a.borderBoxSize,contentBoxSize=_a.contentBoxSize,devicePixelContentBoxSize=_a.devicePixelContentBoxSize;switch(observedBox){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return devicePixelContentBoxSize;case ResizeObserverBoxOptions.BORDER_BOX:return borderBoxSize;default:return contentBoxSize;}};var ResizeObserverEntry=function(){function ResizeObserverEntry(target){var boxes=calculateBoxSizes(target);this.target=target;this.contentRect=boxes.contentRect;this.borderBoxSize=freeze([boxes.borderBoxSize]);this.contentBoxSize=freeze([boxes.contentBoxSize]);this.devicePixelContentBoxSize=freeze([boxes.devicePixelContentBoxSize]);}return ResizeObserverEntry;}();var calculateDepthForNode=function(node){if(isHidden(node)){return Infinity;}var depth=0;var parent=node.parentNode;while(parent){depth+=1;parent=parent.parentNode;}return depth;};var broadcastActiveObservations=function(){var shallowestDepth=Infinity;var callbacks=[];resizeObservers.forEach(function processObserver(ro){if(ro.activeTargets.length===0){return;}var entries=[];ro.activeTargets.forEach(function processTarget(ot){var entry=new ResizeObserverEntry(ot.target);var targetDepth=calculateDepthForNode(ot.target);entries.push(entry);ot.lastReportedSize=calculateBoxSize(ot.target,ot.observedBox);if(targetDepth<shallowestDepth){shallowestDepth=targetDepth;}});callbacks.push(function resizeObserverCallback(){ro.callback.call(ro.observer,entries,ro.observer);});ro.activeTargets.splice(0,ro.activeTargets.length);});for(var _i=0,callbacks_1=callbacks;_i<callbacks_1.length;_i++){var callback=callbacks_1[_i];callback();}return shallowestDepth;};var gatherActiveObservationsAtDepth=function(depth){resizeObservers.forEach(function processObserver(ro){ro.activeTargets.splice(0,ro.activeTargets.length);ro.skippedTargets.splice(0,ro.skippedTargets.length);ro.observationTargets.forEach(function processTarget(ot){if(ot.isActive()){if(calculateDepthForNode(ot.target)>depth){ro.activeTargets.push(ot);}else{ro.skippedTargets.push(ot);}}});});};var process$1=function(){var depth=0;gatherActiveObservationsAtDepth(depth);while(hasActiveObservations()){depth=broadcastActiveObservations();gatherActiveObservationsAtDepth(depth);}if(hasSkippedObservations()){deliverResizeLoopError();}return depth>0;};var trigger;var callbacks=[];var notify=function(){return callbacks.splice(0).forEach(function(cb){return cb();});};var queueMicroTask=function(callback){if(!trigger){var toggle_1=0;var el_1=document.createTextNode('');var config={characterData:true};new MutationObserver(function(){return notify();}).observe(el_1,config);trigger=function(){el_1.textContent="".concat(toggle_1?toggle_1--:toggle_1++);};}callbacks.push(callback);trigger();};var queueResizeObserver=function(cb){queueMicroTask(function ResizeObserver(){requestAnimationFrame(cb);});};var watching=0;var isWatching=function(){return!!watching;};var CATCH_PERIOD=250;var observerConfig={attributes:true,characterData:true,childList:true,subtree:true};var events=['resize','load','transitionend','animationend','animationstart','animationiteration','keyup','keydown','mouseup','mousedown','mouseover','mouseout','blur','focus'];var time=function(timeout){if(timeout===void 0){timeout=0;}return Date.now()+timeout;};var scheduled=false;var Scheduler=function(){function Scheduler(){var _this=this;this.stopped=true;this.listener=function(){return _this.schedule();};}Scheduler.prototype.run=function(timeout){var _this=this;if(timeout===void 0){timeout=CATCH_PERIOD;}if(scheduled){return;}scheduled=true;var until=time(timeout);queueResizeObserver(function(){var elementsHaveResized=false;try{elementsHaveResized=process$1();}finally{scheduled=false;timeout=until-time();if(!isWatching()){return;}if(elementsHaveResized){_this.run(1000);}else if(timeout>0){_this.run(timeout);}else{_this.start();}}});};Scheduler.prototype.schedule=function(){this.stop();this.run();};Scheduler.prototype.observe=function(){var _this=this;var cb=function(){return _this.observer&&_this.observer.observe(document.body,observerConfig);};document.body?cb():global$1.addEventListener('DOMContentLoaded',cb);};Scheduler.prototype.start=function(){var _this=this;if(this.stopped){this.stopped=false;this.observer=new MutationObserver(this.listener);this.observe();events.forEach(function(name){return global$1.addEventListener(name,_this.listener,true);});}};Scheduler.prototype.stop=function(){var _this=this;if(!this.stopped){this.observer&&this.observer.disconnect();events.forEach(function(name){return global$1.removeEventListener(name,_this.listener,true);});this.stopped=true;}};return Scheduler;}();var scheduler=new Scheduler();var updateCount=function(n){!watching&&n>0&&scheduler.start();watching+=n;!watching&&scheduler.stop();};var skipNotifyOnElement=function(target){return!isSVG(target)&&!isReplacedElement(target)&&getComputedStyle(target).display==='inline';};var ResizeObservation=function(){function ResizeObservation(target,observedBox){this.target=target;this.observedBox=observedBox||ResizeObserverBoxOptions.CONTENT_BOX;this.lastReportedSize={inlineSize:0,blockSize:0};}ResizeObservation.prototype.isActive=function(){var size=calculateBoxSize(this.target,this.observedBox,true);if(skipNotifyOnElement(this.target)){this.lastReportedSize=size;}if(this.lastReportedSize.inlineSize!==size.inlineSize||this.lastReportedSize.blockSize!==size.blockSize){return true;}return false;};return ResizeObservation;}();var ResizeObserverDetail=function(){function ResizeObserverDetail(resizeObserver,callback){this.activeTargets=[];this.skippedTargets=[];this.observationTargets=[];this.observer=resizeObserver;this.callback=callback;}return ResizeObserverDetail;}();var observerMap=new WeakMap();var getObservationIndex=function(observationTargets,target){for(var i=0;i<observationTargets.length;i+=1){if(observationTargets[i].target===target){return i;}}return-1;};var ResizeObserverController=function(){function ResizeObserverController(){}ResizeObserverController.connect=function(resizeObserver,callback){var detail=new ResizeObserverDetail(resizeObserver,callback);observerMap.set(resizeObserver,detail);};ResizeObserverController.observe=function(resizeObserver,target,options){var detail=observerMap.get(resizeObserver);var firstObservation=detail.observationTargets.length===0;if(getObservationIndex(detail.observationTargets,target)<0){firstObservation&&resizeObservers.push(detail);detail.observationTargets.push(new ResizeObservation(target,options&&options.box));updateCount(1);scheduler.schedule();}};ResizeObserverController.unobserve=function(resizeObserver,target){var detail=observerMap.get(resizeObserver);var index=getObservationIndex(detail.observationTargets,target);var lastObservation=detail.observationTargets.length===1;if(index>=0){lastObservation&&resizeObservers.splice(resizeObservers.indexOf(detail),1);detail.observationTargets.splice(index,1);updateCount(-1);}};ResizeObserverController.disconnect=function(resizeObserver){var _this=this;var detail=observerMap.get(resizeObserver);detail.observationTargets.slice().forEach(function(ot){return _this.unobserve(resizeObserver,ot.target);});detail.activeTargets.splice(0,detail.activeTargets.length);};return ResizeObserverController;}();var ResizeObserver$1=function(){function ResizeObserver(callback){if(arguments.length===0){throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");}if(typeof callback!=='function'){throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");}ResizeObserverController.connect(this,callback);}ResizeObserver.prototype.observe=function(target,options){if(arguments.length===0){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");}if(!isElement(target)){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");}ResizeObserverController.observe(this,target,options);};ResizeObserver.prototype.unobserve=function(target){if(arguments.length===0){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");}if(!isElement(target)){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");}ResizeObserverController.unobserve(this,target);};ResizeObserver.prototype.disconnect=function(){ResizeObserverController.disconnect(this);};ResizeObserver.toString=function(){return'function ResizeObserver () { [polyfill code] }';};return ResizeObserver;}();const context=React__default.createContext(!0);function forbiddenInRender(){throw new Error("A function wrapped in useEffectEvent can't be called during rendering.");}const isInvalidExecutionContextForEventFunction="use"in React__default?()=>{try{return React__default.use(context);}catch(_unused2){return!1;}}:()=>!1;function useEffectEvent(fn){const ref=React__default.useRef(forbiddenInRender);return React__default.useInsertionEffect(()=>{ref.current=fn;},[fn]),function(){isInvalidExecutionContextForEventFunction()&&forbiddenInRender();const latestFn=ref.current;return latestFn(...arguments);};}buildTheme();const EMPTY_ARRAY=[],EMPTY_RECORD={},POPOVER_MOTION_PROPS={card:{initial:{scale:0.97,willChange:"transform"},hidden:{opacity:0},visible:{opacity:1,transition:{when:"beforeChildren",duration:0.1}},scaleIn:{scale:1},scaleOut:{scale:0.97}},children:{hidden:{opacity:0},visible:{opacity:1}},transition:{type:"spring",visualDuration:0.2,bounce:0.25}};function _isEnterToClickElement(element){return isHTMLAnchorElement(element)||isHTMLButtonElement(element);}function isHTMLElement(node){return node instanceof Node&&node.nodeType===Node.ELEMENT_NODE;}function isHTMLAnchorElement(element){return isHTMLElement(element)&&element.nodeName==="A";}function isHTMLInputElement(element){return isHTMLElement(element)&&element.nodeName==="INPUT";}function isHTMLButtonElement(element){return isHTMLElement(element)&&element.nodeName==="BUTTON";}function isHTMLSelectElement(element){return isHTMLElement(element)&&element.nodeName==="SELECT";}function isHTMLTextAreaElement(element){return isHTMLElement(element)&&element.nodeName==="TEXTAREA";}function containsOrEqualsElement(element,node){return element.contains(node)||element===node;}function _isScrollable(el){if(!(el instanceof Element))return!1;const style=window.getComputedStyle(el);return style.overflowX.includes("auto")||style.overflowX.includes("scroll")||style.overflowY.includes("auto")||style.overflowY.includes("scroll");}function _fillCSSObject(keys,value){return keys.reduce((style,key2)=>(style[key2]=value,style),{});}function rem(pixelValue){return pixelValue===0?0:"".concat(pixelValue/16,"rem");}function _responsive(media,values,callback){return((values===null||values===void 0?void 0:values.map(callback))||[]).map((statement,mediaIndex)=>mediaIndex===0?statement:{["@media screen and (min-width: ".concat(media[mediaIndex-1],"px)")]:statement});}function _getArrayProp(val,defaultVal){return val===void 0?defaultVal||EMPTY_ARRAY:Array.isArray(val)?val:[val];}function _getResponsiveSpace(theme,props){let spaceIndexes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:EMPTY_ARRAY;if(!Array.isArray(spaceIndexes))throw new Error("the property must be array of numbers");if(spaceIndexes.length===0)return null;const{media,space}=getTheme_v2(theme);return _responsive(media,spaceIndexes,spaceIndex=>_fillCSSObject(props,rem(space[spaceIndex])));}function responsiveFont(fontKey,props){const{$size,$weight}=props,{font,media}=getTheme_v2(props.theme),{family,sizes,weights}=font[fontKey],fontWeight=$weight&&weights[$weight]||weights.regular,defaultSize=sizes[2],base={position:"relative",fontFamily:family,fontWeight:"".concat(fontWeight),padding:"1px 0",margin:0,"&:before":{content:'""',display:"block",height:0},"&:after":{content:'""',display:"block",height:0},"& > code, & > span":{display:"block"},"&:not([hidden])":{display:"block"}};if(!$size)return responsiveFont.warned||(console.warn("No size specified for responsive font",{fontKey,$size,props,base}),responsiveFont.warned=!0),[base];const resp=_responsive(media,$size,sizeIndex=>fontSize(sizes[sizeIndex]||defaultSize));return[base,...resp];}function fontSize(size2){const{ascenderHeight,descenderHeight,fontSize:fontSize2,iconSize,letterSpacing,lineHeight}=size2,negHeight=ascenderHeight+descenderHeight,capHeight=lineHeight-negHeight,iconOffset=(capHeight-iconSize)/2,customIconSize=Math.floor(fontSize2*1.125/2)*2+1,customIconOffset=(capHeight-customIconSize)/2;return{fontSize:rem(fontSize2),lineHeight:"calc(".concat(lineHeight," / ").concat(fontSize2,")"),letterSpacing:rem(letterSpacing),transform:"translateY(".concat(rem(descenderHeight),")"),"&:before":{marginTop:"calc(".concat(rem(0-negHeight)," - 1px)")},"&:after":{marginBottom:"-1px"},"& svg:not([data-sanity-icon])":{fontSize:"calc(".concat(customIconSize," / 16 * 1rem)"),margin:rem(customIconOffset)},"& [data-sanity-icon]":{fontSize:"calc(".concat(iconSize," / 16 * 1rem)"),margin:rem(iconOffset)}};}function responsiveCodeFontStyle(props){return responsiveFont("code",props);}function responsiveHeadingFont(props){return responsiveFont("heading",props);}function responsiveLabelFont(props){return responsiveFont("label",props);}function responsiveTextAlignStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$align,textAlign=>({textAlign}));}function responsiveTextFont(props){return responsiveFont("text",props);}function getGlobalScope(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global;throw new Error("@sanity/ui: could not locate global scope");}const globalScope=getGlobalScope();function createGlobalScopedContext(key2,defaultValue){const symbol=Symbol.for(key2);if(typeof document>"u"){const context=createContext(defaultValue);return context.displayName=key2,context;}return globalScope[symbol]=globalScope[symbol]||createContext(defaultValue),globalScope[symbol];}const ThemeContext=createGlobalScopedContext("@sanity/ui/context/theme",null);function ThemeProvider(props){var _props$scheme,_props$theme,_props$tone;const $=dist.c(15),parentTheme=useContext(ThemeContext),{children}=props,scheme=(_props$scheme=props.scheme)!==null&&_props$scheme!==void 0?_props$scheme:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.scheme)||"light",rootTheme=(_props$theme=props.theme)!==null&&_props$theme!==void 0?_props$theme:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.theme)||null,tone=(_props$tone=props.tone)!==null&&_props$tone!==void 0?_props$tone:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.tone)||"default";let t0;bb0:{if(!rootTheme){t0=null;break bb0;}let t12;$[0]!==rootTheme||$[1]!==scheme||$[2]!==tone?(t12={version:0,theme:rootTheme,scheme,tone},$[0]=rootTheme,$[1]=scheme,$[2]=tone,$[3]=t12):t12=$[3],t0=t12;}const themeContext=t0;let t1;bb1:{if(!rootTheme){t1=null;break bb1;}let t22;$[4]!==rootTheme||$[5]!==scheme||$[6]!==tone?(t22=getScopedTheme(rootTheme,scheme,tone),$[4]=rootTheme,$[5]=scheme,$[6]=tone,$[7]=t22):t22=$[7],t1=t22;}const theme=t1;if(!theme){let t22;return $[8]===Symbol.for("react.memo_cache_sentinel")?(t22=/* @__PURE__ */jsx("pre",{children:'ThemeProvider: no "theme" property provided'}),$[8]=t22):t22=$[8],t22;}let t2;$[9]!==children||$[10]!==theme?(t2=/* @__PURE__ */jsx(ThemeProvider$1,{theme,children}),$[9]=children,$[10]=theme,$[11]=t2):t2=$[11];let t3;return $[12]!==t2||$[13]!==themeContext?(t3=/* @__PURE__ */jsx(ThemeContext.Provider,{value:themeContext,children:t2}),$[12]=t2,$[13]=themeContext,$[14]=t3):t3=$[14],t3;}ThemeProvider.displayName="ThemeProvider";function useRootTheme(){const value=useContext(ThemeContext);if(!value)throw new Error("useRootTheme(): missing context value");return value;}function ThemeColorProvider(props){const $=dist.c(5),{children,scheme,tone}=props,root=useRootTheme(),t0=scheme||root.scheme;let t1;return $[0]!==children||$[1]!==root.theme||$[2]!==t0||$[3]!==tone?(t1=/* @__PURE__ */jsx(ThemeProvider,{scheme:t0,theme:root.theme,tone,children}),$[0]=children,$[1]=root.theme,$[2]=t0,$[3]=tone,$[4]=t1):t1=$[4],t1;}ThemeColorProvider.displayName="ThemeColorProvider";function useTheme_v2(){const $=dist.c(2),t0=useTheme();let t1;return $[0]!==t0?(t1=getTheme_v2(t0),$[0]=t0,$[1]=t1):t1=$[1],t1;}function responsiveBorderStyle(){return[border,borderTop,borderRight,borderBottom,borderLeft];}function border(props){var _card$border$width,_card$border;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width=(_card$border=card.border)===null||_card$border===void 0?void 0:_card$border.width)!==null&&_card$border$width!==void 0?_card$border$width:1,"px solid var(--card-border-color)");return _responsive(media,props.$border,value=>value?{"&&":{border:borderStyle}}:{"&&":{border:0}});}function borderTop(props){var _card$border$width2,_card$border2;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width2=(_card$border2=card.border)===null||_card$border2===void 0?void 0:_card$border2.width)!==null&&_card$border$width2!==void 0?_card$border$width2:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderTop,value=>value?{"&&":{borderTop:borderStyle}}:{"&&":{borderTop:0}});}function borderRight(props){var _card$border$width3,_card$border3;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width3=(_card$border3=card.border)===null||_card$border3===void 0?void 0:_card$border3.width)!==null&&_card$border$width3!==void 0?_card$border$width3:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderRight,value=>value?{"&&":{borderRight:borderStyle}}:{"&&":{borderRight:0}});}function borderBottom(props){var _card$border$width4,_card$border4;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width4=(_card$border4=card.border)===null||_card$border4===void 0?void 0:_card$border4.width)!==null&&_card$border$width4!==void 0?_card$border$width4:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderBottom,value=>value?{"&&":{borderBottom:borderStyle}}:{"&&":{borderBottom:0}});}function borderLeft(props){var _card$border$width5,_card$border5;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width5=(_card$border5=card.border)===null||_card$border5===void 0?void 0:_card$border5.width)!==null&&_card$border$width5!==void 0?_card$border$width5:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderLeft,value=>value?{"&&":{borderLeft:borderStyle}}:{"&&":{borderLeft:0}});}const BASE_STYLE$4={'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"}},BOX_SIZING={content:"content-box",border:"border-box"},BOX_HEIGHT={stretch:"stretch",fill:"100%"};function boxStyle(){return BASE_STYLE$4;}function responsiveBoxStyle(){return[responsiveBoxSizingStyle,responsiveBoxHeightStyle,responsiveBoxOverflowStyle,responsiveBoxDisplayStyle];}function responsiveBoxDisplayStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$display,display=>({"&:not([hidden])":{display}}));}function responsiveBoxSizingStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$sizing,sizing=>({boxSizing:BOX_SIZING[sizing]}));}function responsiveBoxHeightStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$height,height=>({height:BOX_HEIGHT[height]}));}function responsiveBoxOverflowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$overflow,overflow=>({overflow}));}const BASE_STYLE$3={minWidth:0,minHeight:0};function flexItemStyle(){return[BASE_STYLE$3,responsiveFlexItemStyle];}function responsiveFlexItemStyle(props){const{media}=getTheme_v2(props.theme);return props.$flex?_responsive(media,props.$flex,flex=>({flex:"".concat(flex)})):EMPTY_ARRAY;}const BASE_STYLE$2={"&&:not([hidden])":{display:"flex"}};function responsiveFlexStyle(){return[BASE_STYLE$2,responsiveFlexAlignStyle,responsiveFlexGapStyle,responsiveFlexWrapStyle,responsiveFlexJustifyStyle,responsiveFlexDirectionStyle];}function responsiveFlexAlignStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$align,align=>({alignItems:align}));}function responsiveFlexGapStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gap,gap=>({gap:gap?rem(space[gap]):void 0}));}function responsiveFlexWrapStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$wrap,wrap=>({flexWrap:wrap}));}function responsiveFlexJustifyStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$justify,justify=>({justifyContent:justify}));}function responsiveFlexDirectionStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$direction,direction=>({flexDirection:direction}));}function focusRingBorderStyle(border2){return"inset 0 0 0 ".concat(border2.width,"px ").concat(border2.color);}function focusRingStyle(opts){const{base,border:border2,focusRing}=opts,focusRingOutsetWidth=focusRing.offset+focusRing.width,focusRingInsetWidth=0-focusRing.offset,bgColor=base?base.bg:"var(--card-bg-color)";return[focusRingInsetWidth>0&&"inset 0 0 0 ".concat(focusRingInsetWidth,"px var(--card-focus-ring-color)"),border2&&focusRingBorderStyle(border2),focusRingInsetWidth<0&&"0 0 0 ".concat(0-focusRingInsetWidth,"px ").concat(bgColor),focusRingOutsetWidth>0&&"0 0 0 ".concat(focusRingOutsetWidth,"px var(--card-focus-ring-color)")].filter(Boolean).join(",");}function responsiveGridItemStyle(){return[responsiveGridItemRowStyle,responsiveGridItemRowStartStyle,responsiveGridItemRowEndStyle,responsiveGridItemColumnStyle,responsiveGridItemColumnStartStyle,responsiveGridItemColumnEndStyle];}const GRID_ITEM_ROW={auto:"auto",full:"1 / -1"},GRID_ITEM_COLUMN={auto:"auto",full:"1 / -1"};function responsiveGridItemRowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$row,row=>typeof row=="number"?{gridRow:"span ".concat(row," / span ").concat(row)}:{gridRow:GRID_ITEM_ROW[row]});}function responsiveGridItemRowStartStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rowStart,rowStart=>({gridRowStart:"".concat(rowStart)}));}function responsiveGridItemRowEndStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rowEnd,rowEnd=>({gridRowEnd:"".concat(rowEnd)}));}function responsiveGridItemColumnStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$column,column=>typeof column=="number"?{gridColumn:"span ".concat(column," / span ").concat(column)}:{gridColumn:GRID_ITEM_COLUMN[column]});}function responsiveGridItemColumnStartStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columnStart,columnStart=>({gridColumnStart:"".concat(columnStart)}));}function responsiveGridItemColumnEndStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columnEnd,columnEnd=>({gridColumnEnd:"".concat(columnEnd)}));}const GRID_CSS={"&&:not([hidden])":{display:"grid"},'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"}},GRID_AUTO_COLUMS={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},GRID_AUTO_ROWS={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"};function responsiveGridStyle(){return[GRID_CSS,responsiveGridAutoFlowStyle,responsiveGridAutoRowsStyle,responsiveGridAutoColsStyle,responsiveGridColumnsStyle,responsiveGridRowsStyle,responsiveGridGapStyle,responsiveGridGapXStyle,responsiveGridGapYStyle];}function responsiveGridAutoFlowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoFlow,autoFlow=>({gridAutoFlow:autoFlow}));}function responsiveGridAutoRowsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoRows,autoRows=>({gridAutoRows:autoRows&&GRID_AUTO_ROWS[autoRows]}));}function responsiveGridAutoColsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoCols,autoCols=>({gridAutoColumns:autoCols&&GRID_AUTO_COLUMS[autoCols]}));}function responsiveGridColumnsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columns,columns=>({gridTemplateColumns:columns&&"repeat(".concat(columns,",minmax(0,1fr));")}));}function responsiveGridRowsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rows,rows=>({gridTemplateRows:rows&&"repeat(".concat(rows,",minmax(0,1fr));")}));}function responsiveGridGapStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gap,gap=>({gridGap:gap?rem(space[gap]):void 0}));}function responsiveGridGapXStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gapX,gapX=>({columnGap:gapX?rem(space[gapX]):void 0}));}function responsiveGridGapYStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gapY,gapY=>({rowGap:gapY?rem(space[gapY]):void 0}));}function responsiveInputPaddingStyle(props){const{$fontSize,$iconLeft,$iconRight,$padding,$space}=props,{font,media,space}=getTheme_v2(props.theme),len=Math.max($padding.length,$space.length,$fontSize.length),_padding=[],_space=[],_fontSize=[];for(let i=0;i<len;i+=1)_fontSize[i]=$fontSize[i]===void 0?_fontSize[i-1]:$fontSize[i],_padding[i]=$padding[i]===void 0?_padding[i-1]:$padding[i],_space[i]=$space[i]===void 0?_space[i-1]:$space[i];return _responsive(media,_padding,(_,i)=>{const size2=font.text.sizes[_fontSize[i]]||font.text.sizes[2],emSize=size2.lineHeight-size2.ascenderHeight-size2.descenderHeight,p=space[_padding[i]],s=space[_space[i]],styles={paddingTop:rem(p-size2.ascenderHeight),paddingRight:rem(p),paddingBottom:rem(p-size2.descenderHeight),paddingLeft:rem(p)};return $iconRight&&(styles.paddingRight=rem(p+emSize+s)),$iconLeft&&(styles.paddingLeft=rem(p+emSize+s)),styles;});}function responsiveInputPaddingIconRightStyle(props){return responsiveInputPaddingStyle(_objectSpread(_objectSpread({},props),{},{$iconRight:!0}));}const ROOT_STYLE=css(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));function textInputRootStyle(){return ROOT_STYLE;}function textInputBaseStyle(props){const{$scheme,$tone,$weight}=props,{color,font}=getTheme_v2(props.theme);return css(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ",";\n font-weight: ",";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='","'][data-tone='","'] {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n }\n "])),font.text.family,$weight&&font.text.weights[$weight]||font.text.weights.regular,$scheme,$tone,color.input.default.enabled.fg,color.input.default.enabled.placeholder,color.input.default.enabled.fg,color.input.default.enabled.placeholder,color.input.default.disabled.fg,color.input.default.disabled.placeholder,color.input.invalid.enabled.fg,color.input.invalid.enabled.placeholder,color.input.default.readOnly.fg,color.input.default.readOnly.placeholder);}function textInputFontSizeStyle(props){const{font,media}=getTheme_v2(props.theme);return _responsive(media,props.$fontSize,sizeIndex=>{const size2=font.text.sizes[sizeIndex]||font.text.sizes[2];return{fontSize:rem(size2.fontSize),lineHeight:"".concat(size2.lineHeight/size2.fontSize)};});}function textInputRepresentationStyle(props){const{$hasPrefix,$hasSuffix,$scheme,$tone,$unstableDisableFocusRing}=props,{color,input}=getTheme_v2(props.theme);return css(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ",";\n border-bottom-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n\n &[data-scheme='","'][data-tone='","'] {\n --card-bg-color: ",";\n --card-fg-color: ",";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ",";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ",";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ",";\n }\n }\n\n /* disabled */\n *:not(:invalid):disabled + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n --card-icon-color: "," !important;\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n --card-icon-color: "," !important;\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n }\n\n *:invalid:read-only + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n }\n\n *:invalid:not(:disabled):not(:read-only):hover + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ",";\n }\n\n *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {\n --input-box-shadow: ",";\n }\n }\n }\n "])),$hasPrefix?0:void 0,$hasPrefix?0:void 0,$hasSuffix?0:void 0,$hasSuffix?0:void 0,$scheme,$tone,color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.invalid.enabled.bg,color.input.invalid.enabled.fg,focusRingBorderStyle({color:color.input.invalid.enabled.border,width:input.border.width}),$unstableDisableFocusRing?void 0:focusRingStyle({border:{color:color.input.default.enabled.border,width:input.border.width},focusRing:input.text.focusRing}),$unstableDisableFocusRing?void 0:focusRingStyle({focusRing:input.text.focusRing}),color.input.default.disabled.bg,color.input.default.disabled.fg,color.input.default.disabled.fg,focusRingBorderStyle({color:color.input.default.disabled.border,width:input.border.width}),color.input.invalid.disabled.bg,color.input.invalid.disabled.fg,color.input.invalid.disabled.fg,focusRingBorderStyle({color:color.input.invalid.disabled.border,width:input.border.width}),color.input.default.readOnly.bg,color.input.default.readOnly.fg,color.input.invalid.readOnly.bg,color.input.invalid.readOnly.fg,color.input.default.hovered.bg,color.input.default.hovered.fg,color.input.invalid.hovered.bg,color.input.invalid.hovered.fg,focusRingBorderStyle({color:color.input.default.hovered.border,width:input.border.width}),focusRingBorderStyle({color:color.input.invalid.hovered.border,width:input.border.width}));}function responsiveMarginStyle(props){const{theme}=props;return[_getResponsiveSpace(theme,["margin"],props.$margin),_getResponsiveSpace(theme,["marginLeft","marginRight"],props.$marginX),_getResponsiveSpace(theme,["marginTop","marginBottom"],props.$marginY),_getResponsiveSpace(theme,["marginTop"],props.$marginTop),_getResponsiveSpace(theme,["marginRight"],props.$marginRight),_getResponsiveSpace(theme,["marginBottom"],props.$marginBottom),_getResponsiveSpace(theme,["marginLeft"],props.$marginLeft)].filter(Boolean);}function responsivePaddingStyle(props){const{theme}=props;return[_getResponsiveSpace(theme,["padding"],props.$padding),_getResponsiveSpace(theme,["paddingLeft","paddingRight"],props.$paddingX),_getResponsiveSpace(theme,["paddingTop","paddingBottom"],props.$paddingY),_getResponsiveSpace(theme,["paddingTop"],props.$paddingTop),_getResponsiveSpace(theme,["paddingRight"],props.$paddingRight),_getResponsiveSpace(theme,["paddingBottom"],props.$paddingBottom),_getResponsiveSpace(theme,["paddingLeft"],props.$paddingLeft)].filter(Boolean);}function responsiveRadiusStyle(props){const{media,radius}=getTheme_v2(props.theme);return _responsive(media,props.$radius,value=>{let borderRadius=0;return typeof value=="number"&&(borderRadius=rem(radius[value])),value==="full"&&(borderRadius="9999px"),{borderRadius};});}function toBoxShadow(shadow,color){return"".concat(shadow.map(rem).join(" ")," ").concat(color);}function shadowStyle(shadow){let outlineWidth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(!shadow)return EMPTY_RECORD;const outline="0 0 0 ".concat(rem(outlineWidth)," var(--card-shadow-outline-color)"),umbra=toBoxShadow(shadow.umbra,"var(--card-shadow-umbra-color)"),penumbra=toBoxShadow(shadow.penumbra,"var(--card-shadow-penumbra-color)"),ambient=toBoxShadow(shadow.ambient,"var(--card-shadow-ambient-color)");return{boxShadow:"".concat(outline,", ").concat(umbra,", ").concat(penumbra,", ").concat(ambient)};}function responsiveShadowStyle(props){const{card,media,shadow}=getTheme_v2(props.theme);return _responsive(media,props.$shadow,index=>shadowStyle(shadow[index],card.shadow.outline));}const SpanWithTextOverflow=styled.span.withConfig({displayName:"SpanWithTextOverflow",componentId:"sc-ol2i3b-0"})(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;"])));function labelBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n text-transform: uppercase;\n\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),$accent&&css(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family);}const StyledLabel=/* @__PURE__ */styled.div.withConfig({displayName:"StyledLabel",componentId:"sc-1luap7z-0"})(responsiveLabelFont,responsiveTextAlignStyle,labelBaseStyle),Label=forwardRef(function(props,ref){var _props2;const $=dist.c(26);let accent,align,childrenProp,restProps,t0,t1,textOverflow,weight;$[0]!==props?(_props2=props,{accent,align,children:childrenProp,muted:t0,size:t1,textOverflow,weight}=_props2,restProps=_objectWithoutProperties(_props2,_excluded14),_props2,$[0]=props,$[1]=accent,$[2]=align,$[3]=childrenProp,$[4]=restProps,$[5]=t0,$[6]=t1,$[7]=textOverflow,$[8]=weight):(accent=$[1],align=$[2],childrenProp=$[3],restProps=$[4],t0=$[5],t1=$[6],textOverflow=$[7],weight=$[8]);const muted=t0===void 0?!1:t0,size2=t1===void 0?2:t1;let children=childrenProp;if(textOverflow==="ellipsis"){let t22;$[9]!==children?(t22=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t22):t22=$[10],children=t22;}else{let t22;$[11]!==children?(t22=/* @__PURE__ */jsx("span",{children}),$[11]=children,$[12]=t22):t22=$[12],children=t22;}let t2;$[13]!==align?(t2=_getArrayProp(align),$[13]=align,$[14]=t2):t2=$[14];let t3;$[15]!==size2?(t3=_getArrayProp(size2),$[15]=size2,$[16]=t3):t3=$[16];let t4;return $[17]!==accent||$[18]!==children||$[19]!==muted||$[20]!==ref||$[21]!==restProps||$[22]!==t2||$[23]!==t3||$[24]!==weight?(t4=/* @__PURE__ */jsx(StyledLabel,_objectSpread(_objectSpread({"data-ui":"Label"},restProps),{},{$accent:accent,$align:t2,$muted:muted,$size:t3,$weight:weight,ref,children})),$[17]=accent,$[18]=children,$[19]=muted,$[20]=ref,$[21]=restProps,$[22]=t2,$[23]=t3,$[24]=weight,$[25]=t4):t4=$[25],t4;});Label.displayName="ForwardRef(Label)";const avatarStyle={root:avatarRootStyle,arrow:avatarArrowStyle,bgStroke:avatarBgStrokeStyle,stroke:avatarStrokeStyle,initials:avatarInitialsStyle,image:avatarImageStyle};function avatarArrowStyle(){return{position:"absolute",boxSizing:"border-box",zIndex:"0",opacity:"0",transition:"all 0.2s linear",transform:"rotate(-90deg) translate3d(0, 6px, 0)",left:0,right:0,top:0,bottom:0,"& > svg":{width:"11px",height:"7px",position:"absolute",top:"-5px",left:"50%",transform:"translateX(-6px)","&:not([hidden])":{display:"block"}},"[data-arrow-position='inside'] > &":{transform:"rotate(-90deg) translate3d(0, 6px, 0)",opacity:"0"},"[data-arrow-position='top'] > &":{opacity:"1",transform:"rotate(0deg)"},"[data-arrow-position='bottom'] > &":{opacity:"1",transform:"rotate(-180deg)"}};}function avatarRootStyle(props){const{$color}=props,{avatar}=getTheme_v2(props.theme);return{"--avatar-bg-color":"var(--card-avatar-".concat($color,"-bg-color)"),"--avatar-fg-color":"var(--card-avatar-".concat($color,"-fg-color)"),backgroundColor:"var(--avatar-bg-color)",position:"relative",boxSizing:"border-box",userSelect:"none",boxShadow:"0 0 0 1px var(--card-bg-color)",'&[data-status="inactive"]':{opacity:"0.5"},"&>svg":{"&:not([hidden])":{display:"block"}},/* &:is(button) */'&[data-as="button"]':{WebkitFontSmoothing:"inherit",appearance:"none",margin:0,padding:0,border:0,font:"inherit",color:"inherit",outline:"none","&:focus":{boxShadow:focusRingStyle({focusRing:avatar.focusRing})},"&:focus:not(:focus-visible)":{boxShadow:"none"}}};}function responsiveAvatarSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2]||avatar.sizes[0];return{width:rem(avatarSize.size),height:rem(avatarSize.size),borderRadius:rem(avatarSize.size/2),"&>svg":{width:rem(avatarSize.size),height:rem(avatarSize.size),borderRadius:rem(avatarSize.size/2)}};});}function avatarImageStyle(){return{position:"relative"};}function avatarInitialsStyle(){return{width:"100%",height:"100%",color:"var(--avatar-fg-color)",alignItems:"center",justifyContent:"center",textTransform:"uppercase",textAlign:"center",borderRadius:"50%","&:not([hidden])":{display:"flex"}};}function avatarBgStrokeStyle(){return{strokeWidth:"4px",stroke:"var(--card-bg-color)"};}function avatarStrokeStyle(){return{strokeWidth:"2px",stroke:"var(--avatar-bg-color)",'[data-status="editing"] &':{strokeDasharray:"2 4",strokeLinecap:"round"}};}const StyledAvatar=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatar",componentId:"sc-1rj7kl0-0"})(responsiveAvatarSizeStyle,avatarStyle.root),Arrow$1=/* @__PURE__ */styled.div.withConfig({displayName:"Arrow",componentId:"sc-1rj7kl0-1"})(avatarStyle.arrow),BgStroke=/* @__PURE__ */styled.ellipse.withConfig({displayName:"BgStroke",componentId:"sc-1rj7kl0-2"})(avatarStyle.bgStroke),Stroke=/* @__PURE__ */styled.ellipse.withConfig({displayName:"Stroke",componentId:"sc-1rj7kl0-3"})(avatarStyle.stroke),Initials=/* @__PURE__ */styled.div.withConfig({displayName:"Initials",componentId:"sc-1rj7kl0-4"})(avatarStyle.initials),InitialsLabel=/* @__PURE__ */styled(Label).withConfig({displayName:"InitialsLabel",componentId:"sc-1rj7kl0-5"})({color:"inherit"}),AvatarImage=/* @__PURE__ */styled.svg.withConfig({displayName:"AvatarImage",componentId:"sc-1rj7kl0-6"})(avatarStyle.image),Avatar=forwardRef(function(props,ref){var _props3;const $=dist.c(46);let __unstable_hideInnerStroke,animateArrowFrom,arrowPositionProp,asProp,initials,onImageLoadError,restProps,src,t0,t1,t2,title;$[0]!==props?(_props3=props,{__unstable_hideInnerStroke,as:asProp,color:t0,src,title,initials,onImageLoadError,arrowPosition:arrowPositionProp,animateArrowFrom,status:t1,size:t2}=_props3,restProps=_objectWithoutProperties(_props3,_excluded15),_props3,$[0]=props,$[1]=__unstable_hideInnerStroke,$[2]=animateArrowFrom,$[3]=arrowPositionProp,$[4]=asProp,$[5]=initials,$[6]=onImageLoadError,$[7]=restProps,$[8]=src,$[9]=t0,$[10]=t1,$[11]=t2,$[12]=title):(__unstable_hideInnerStroke=$[1],animateArrowFrom=$[2],arrowPositionProp=$[3],asProp=$[4],initials=$[5],onImageLoadError=$[6],restProps=$[7],src=$[8],t0=$[9],t1=$[10],t2=$[11],title=$[12]);const color=t0===void 0?"gray":t0,status=t1===void 0?"online":t1,sizeProp=t2===void 0?1:t2,{avatar}=useTheme_v2(),as=ReactIs.isValidElementType(asProp)?asProp:"div",size2=_getArrayProp(sizeProp),_sizeRem=(avatar.sizes[size2[0]]||avatar.sizes[0]).size,_radius=_sizeRem/2,elementId=useId(),[arrowPosition,setArrowPosition]=useState(animateArrowFrom||arrowPositionProp||"inside"),[imageFailed,setImageFailed]=useState(!1),imageId="avatar-image-".concat(elementId);let t3,t4;$[13]!==arrowPosition||$[14]!==arrowPositionProp?(t3=()=>{if(arrowPosition===arrowPositionProp)return;const raf=requestAnimationFrame(()=>setArrowPosition(arrowPositionProp));return()=>cancelAnimationFrame(raf);},t4=[arrowPosition,arrowPositionProp],$[13]=arrowPosition,$[14]=arrowPositionProp,$[15]=t3,$[16]=t4):(t3=$[15],t4=$[16]),useEffect$1(t3,t4);let t5,t6;$[17]!==src?(t5=()=>{src&&setImageFailed(!1);},t6=[src],$[17]=src,$[18]=t5,$[19]=t6):(t5=$[18],t6=$[19]),useEffect$1(t5,t6);let t7;$[20]!==onImageLoadError?(t7=()=>{setImageFailed(!0),onImageLoadError&&onImageLoadError(new Error("Avatar: the image failed to load"));},$[20]=onImageLoadError,$[21]=t7):t7=$[21];const handleImageError=t7,T0=StyledAvatar,t8=typeof as=="string"?as:void 0,t9="Avatar";let t10;$[22]!==color?(t10=/* @__PURE__ */jsx(Arrow$1,{children:/* @__PURE__ */jsx("svg",{width:"11",height:"7",viewBox:"0 0 11 7",fill:"none",children:/* @__PURE__ */jsx("path",{d:"M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",fill:color})})}),$[22]=color,$[23]=t10):t10=$[23];let t11;$[24]!==__unstable_hideInnerStroke||$[25]!==_radius||$[26]!==_sizeRem||$[27]!==handleImageError||$[28]!==imageFailed||$[29]!==imageId||$[30]!==src?(t11=!imageFailed&&src&&/* @__PURE__ */jsxs(AvatarImage,{viewBox:"0 0 ".concat(_sizeRem," ").concat(_sizeRem),fill:"none",children:[/* @__PURE__ */jsx("defs",{children:/* @__PURE__ */jsx("pattern",{id:imageId,patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:/* @__PURE__ */jsx("image",{href:src,width:"1",height:"1",onError:handleImageError})})}),/* @__PURE__ */jsx("circle",{cx:_radius,cy:_radius,r:_radius,fill:"url(#".concat(imageId,")")}),!__unstable_hideInnerStroke&&/* @__PURE__ */jsx(BgStroke,{cx:_radius,cy:_radius,rx:_radius,ry:_radius,vectorEffect:"non-scaling-stroke"}),/* @__PURE__ */jsx(Stroke,{cx:_radius,cy:_radius,rx:_radius,ry:_radius,vectorEffect:"non-scaling-stroke"})]}),$[24]=__unstable_hideInnerStroke,$[25]=_radius,$[26]=_sizeRem,$[27]=handleImageError,$[28]=imageFailed,$[29]=imageId,$[30]=src,$[31]=t11):t11=$[31];const t12=(imageFailed||!src)&&initials&&/* @__PURE__ */jsx(Fragment,{children:/* @__PURE__ */jsx(Initials,{children:/* @__PURE__ */jsx(InitialsLabel,{forwardedAs:"span",size:size2.map(_temp$a),weight:"medium",children:initials})})});let t13;return $[32]!==T0||$[33]!==arrowPosition||$[34]!==as||$[35]!==color||$[36]!==ref||$[37]!==restProps||$[38]!==size2||$[39]!==status||$[40]!==t10||$[41]!==t11||$[42]!==t12||$[43]!==t8||$[44]!==title?(t13=/* @__PURE__ */jsxs(T0,_objectSpread(_objectSpread({as,"data-as":t8,"data-ui":t9},restProps),{},{$color:color,$size:size2,"aria-label":title,"data-arrow-position":arrowPosition,"data-status":status,ref,title,children:[t10,t11,t12]})),$[32]=T0,$[33]=arrowPosition,$[34]=as,$[35]=color,$[36]=ref,$[37]=restProps,$[38]=size2,$[39]=status,$[40]=t10,$[41]=t11,$[42]=t12,$[43]=t8,$[44]=title,$[45]=t13):t13=$[45],t13;});Avatar.displayName="ForwardRef(Avatar)";function _temp$a(s){return s===1?1:s===2?3:s===3?5:0;}function _responsiveAvatarCounterSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2];return avatarSize?{borderRadius:rem(avatarSize.size/2),minWidth:rem(avatarSize.size),height:rem(avatarSize.size)}:EMPTY_RECORD;});}function _avatarCounterBaseStyle(props){const{space}=getTheme_v2(props.theme);return css(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1px var(--card-hairline-hard-color);\n padding: 0 ",";\n\n &:not([hidden]) {\n display: flex;\n }\n "])),rem(space[2]));}const StyledAvatarCounter=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatarCounter",componentId:"sc-1ydx86y-0"})(_responsiveAvatarCounterSizeStyle,_avatarCounterBaseStyle),AvatarCounter=forwardRef(function(props,ref){const $=dist.c(20),{count,size:t0}=props,sizeProp=t0===void 0?1:t0;let T0,T1,t1,t2,t3,t4,t5;if($[0]!==ref||$[1]!==sizeProp){const size2=_getArrayProp(sizeProp);T1=StyledAvatarCounter,t3=size2,t4="AvatarCounter",t5=ref,T0=Label,t1="span",t2=size2.map(_temp$9),$[0]=ref,$[1]=sizeProp,$[2]=T0,$[3]=T1,$[4]=t1,$[5]=t2,$[6]=t3,$[7]=t4,$[8]=t5;}else T0=$[2],T1=$[3],t1=$[4],t2=$[5],t3=$[6],t4=$[7],t5=$[8];let t6;$[9]!==T0||$[10]!==count||$[11]!==t1||$[12]!==t2?(t6=/* @__PURE__ */jsx(T0,{as:t1,size:t2,weight:"medium",children:count}),$[9]=T0,$[10]=count,$[11]=t1,$[12]=t2,$[13]=t6):t6=$[13];let t7;return $[14]!==T1||$[15]!==t3||$[16]!==t4||$[17]!==t5||$[18]!==t6?(t7=/* @__PURE__ */jsx(T1,{$size:t3,"data-ui":t4,ref:t5,children:t6}),$[14]=T1,$[15]=t3,$[16]=t4,$[17]=t5,$[18]=t6,$[19]=t7):t7=$[19],t7;});AvatarCounter.displayName="ForwardRef(AvatarCounter)";function _temp$9(s){return s===1?1:s===2?3:s===3?5:0;}const BASE_STYLES=css(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));function avatarStackStyle(){return BASE_STYLES;}function responsiveAvatarStackSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2];return avatarSize?{"& > div + div":{marginLeft:rem(avatarSize.distance)}}:EMPTY_RECORD;});}const StyledAvatarStack=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatarStack",componentId:"sc-cysmbb-0"})(responsiveAvatarStackSizeStyle,avatarStackStyle),AvatarStack=forwardRef(function(props,ref){var _props4;const $=dist.c(38);let childrenProp,restProps,t0,t1;$[0]!==props?(_props4=props,{children:childrenProp,maxLength:t0,size:t1}=_props4,restProps=_objectWithoutProperties(_props4,_excluded16),_props4,$[0]=props,$[1]=childrenProp,$[2]=restProps,$[3]=t0,$[4]=t1):(childrenProp=$[1],restProps=$[2],t0=$[3],t1=$[4]);const maxLengthProp=t0===void 0?4:t0,sizeProp=t1===void 0?1:t1;let T0,t2,t3,t4,t5,t6,t7,t8;if($[5]!==childrenProp||$[6]!==maxLengthProp||$[7]!==ref||$[8]!==restProps||$[9]!==sizeProp){const children=Children.toArray(childrenProp).filter(isValidElement$1),maxLength=Math.max(maxLengthProp,0);let t92;$[18]!==sizeProp?(t92=_getArrayProp(sizeProp),$[18]=sizeProp,$[19]=t92):t92=$[19];const size2=t92,len=children.length,visibleCount=maxLength-1,extraCount=len-visibleCount,visibleChildren=extraCount>1?children.slice(extraCount,len):children;T0=StyledAvatarStack,t2="AvatarStack",t3=restProps,t4=ref,t5=size2,$[20]!==len||$[21]!==size2?(t6=len===0&&/* @__PURE__ */jsx("div",{children:/* @__PURE__ */jsx(AvatarCounter,{count:len,size:size2})}),$[20]=len,$[21]=size2,$[22]=t6):t6=$[22],$[23]!==extraCount||$[24]!==len||$[25]!==size2?(t7=len!==0&&extraCount>1&&/* @__PURE__ */jsx("div",{children:/* @__PURE__ */jsx(AvatarCounter,{count:extraCount,size:size2})}),$[23]=extraCount,$[24]=len,$[25]=size2,$[26]=t7):t7=$[26];let t10;$[27]!==size2?(t10=(child,childIndex)=>/* @__PURE__ */jsx("div",{children:cloneElement(child,{size:size2})},String(childIndex)),$[27]=size2,$[28]=t10):t10=$[28],t8=visibleChildren.map(t10),$[5]=childrenProp,$[6]=maxLengthProp,$[7]=ref,$[8]=restProps,$[9]=sizeProp,$[10]=T0,$[11]=t2,$[12]=t3,$[13]=t4,$[14]=t5,$[15]=t6,$[16]=t7,$[17]=t8;}else T0=$[10],t2=$[11],t3=$[12],t4=$[13],t5=$[14],t6=$[15],t7=$[16],t8=$[17];let t9;return $[29]!==T0||$[30]!==t2||$[31]!==t3||$[32]!==t4||$[33]!==t5||$[34]!==t6||$[35]!==t7||$[36]!==t8?(t9=/* @__PURE__ */jsxs(T0,_objectSpread(_objectSpread({"data-ui":t2},t3),{},{ref:t4,$size:t5,children:[t6,t7,t8]})),$[29]=T0,$[30]=t2,$[31]=t3,$[32]=t4,$[33]=t5,$[34]=t6,$[35]=t7,$[36]=t8,$[37]=t9):t9=$[37],t9;});AvatarStack.displayName="ForwardRef(AvatarStack)";const StyledBox=/* @__PURE__ */styled.div.withConfig({displayName:"StyledBox",componentId:"sc-1hhky9f-0"})(boxStyle,flexItemStyle,responsiveBoxStyle,responsiveGridItemStyle,responsiveMarginStyle,responsivePaddingStyle),Box=forwardRef(function(props,ref){var _props5;const $=dist.c(109);let column,columnEnd,columnStart,flex,height,marginBottom,marginLeft,marginRight,marginTop,marginX,marginY,overflow,paddingBottom,paddingLeft,paddingRight,paddingTop,paddingX,paddingY,restProps,row,rowEnd,rowStart,sizing,t0,t1,t2,t3;$[0]!==props?(_props5=props,{as:t0,column,columnStart,columnEnd,display:t1,flex,height,margin:t2,marginX,marginY,marginTop,marginRight,marginBottom,marginLeft,overflow,padding:t3,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft,row,rowStart,rowEnd,sizing}=_props5,restProps=_objectWithoutProperties(_props5,_excluded17),_props5,$[0]=props,$[1]=column,$[2]=columnEnd,$[3]=columnStart,$[4]=flex,$[5]=height,$[6]=marginBottom,$[7]=marginLeft,$[8]=marginRight,$[9]=marginTop,$[10]=marginX,$[11]=marginY,$[12]=overflow,$[13]=paddingBottom,$[14]=paddingLeft,$[15]=paddingRight,$[16]=paddingTop,$[17]=paddingX,$[18]=paddingY,$[19]=restProps,$[20]=row,$[21]=rowEnd,$[22]=rowStart,$[23]=sizing,$[24]=t0,$[25]=t1,$[26]=t2,$[27]=t3):(column=$[1],columnEnd=$[2],columnStart=$[3],flex=$[4],height=$[5],marginBottom=$[6],marginLeft=$[7],marginRight=$[8],marginTop=$[9],marginX=$[10],marginY=$[11],overflow=$[12],paddingBottom=$[13],paddingLeft=$[14],paddingRight=$[15],paddingTop=$[16],paddingX=$[17],paddingY=$[18],restProps=$[19],row=$[20],rowEnd=$[21],rowStart=$[22],sizing=$[23],t0=$[24],t1=$[25],t2=$[26],t3=$[27]);const asProp=t0===void 0?"div":t0,display=t1===void 0?"block":t1,margin=t2===void 0?0:t2,padding=t3===void 0?0:t3,t4=typeof asProp=="string"?asProp:void 0;let t5;$[28]!==column?(t5=_getArrayProp(column),$[28]=column,$[29]=t5):t5=$[29];let t6;$[30]!==columnStart?(t6=_getArrayProp(columnStart),$[30]=columnStart,$[31]=t6):t6=$[31];let t7;$[32]!==columnEnd?(t7=_getArrayProp(columnEnd),$[32]=columnEnd,$[33]=t7):t7=$[33];let t8;$[34]!==display?(t8=_getArrayProp(display),$[34]=display,$[35]=t8):t8=$[35];let t9;$[36]!==flex?(t9=_getArrayProp(flex),$[36]=flex,$[37]=t9):t9=$[37];let t10;$[38]!==height?(t10=_getArrayProp(height),$[38]=height,$[39]=t10):t10=$[39];let t11;$[40]!==margin?(t11=_getArrayProp(margin),$[40]=margin,$[41]=t11):t11=$[41];let t12;$[42]!==marginX?(t12=_getArrayProp(marginX),$[42]=marginX,$[43]=t12):t12=$[43];let t13;$[44]!==marginY?(t13=_getArrayProp(marginY),$[44]=marginY,$[45]=t13):t13=$[45];let t14;$[46]!==marginTop?(t14=_getArrayProp(marginTop),$[46]=marginTop,$[47]=t14):t14=$[47];let t15;$[48]!==marginRight?(t15=_getArrayProp(marginRight),$[48]=marginRight,$[49]=t15):t15=$[49];let t16;$[50]!==marginBottom?(t16=_getArrayProp(marginBottom),$[50]=marginBottom,$[51]=t16):t16=$[51];let t17;$[52]!==marginLeft?(t17=_getArrayProp(marginLeft),$[52]=marginLeft,$[53]=t17):t17=$[53];let t18;$[54]!==overflow?(t18=_getArrayProp(overflow),$[54]=overflow,$[55]=t18):t18=$[55];let t19;$[56]!==padding?(t19=_getArrayProp(padding),$[56]=padding,$[57]=t19):t19=$[57];let t20;$[58]!==paddingX?(t20=_getArrayProp(paddingX),$[58]=paddingX,$[59]=t20):t20=$[59];let t21;$[60]!==paddingY?(t21=_getArrayProp(paddingY),$[60]=paddingY,$[61]=t21):t21=$[61];let t22;$[62]!==paddingTop?(t22=_getArrayProp(paddingTop),$[62]=paddingTop,$[63]=t22):t22=$[63];let t23;$[64]!==paddingRight?(t23=_getArrayProp(paddingRight),$[64]=paddingRight,$[65]=t23):t23=$[65];let t24;$[66]!==paddingBottom?(t24=_getArrayProp(paddingBottom),$[66]=paddingBottom,$[67]=t24):t24=$[67];let t25;$[68]!==paddingLeft?(t25=_getArrayProp(paddingLeft),$[68]=paddingLeft,$[69]=t25):t25=$[69];let t26;$[70]!==row?(t26=_getArrayProp(row),$[70]=row,$[71]=t26):t26=$[71];let t27;$[72]!==rowStart?(t27=_getArrayProp(rowStart),$[72]=rowStart,$[73]=t27):t27=$[73];let t28;$[74]!==rowEnd?(t28=_getArrayProp(rowEnd),$[74]=rowEnd,$[75]=t28):t28=$[75];let t29;$[76]!==sizing?(t29=_getArrayProp(sizing),$[76]=sizing,$[77]=t29):t29=$[77];let t30;return $[78]!==asProp||$[79]!==props.children||$[80]!==ref||$[81]!==restProps||$[82]!==t10||$[83]!==t11||$[84]!==t12||$[85]!==t13||$[86]!==t14||$[87]!==t15||$[88]!==t16||$[89]!==t17||$[90]!==t18||$[91]!==t19||$[92]!==t20||$[93]!==t21||$[94]!==t22||$[95]!==t23||$[96]!==t24||$[97]!==t25||$[98]!==t26||$[99]!==t27||$[100]!==t28||$[101]!==t29||$[102]!==t4||$[103]!==t5||$[104]!==t6||$[105]!==t7||$[106]!==t8||$[107]!==t9?(t30=/* @__PURE__ */jsx(StyledBox,_objectSpread(_objectSpread({"data-as":t4,"data-ui":"Box"},restProps),{},{$column:t5,$columnStart:t6,$columnEnd:t7,$display:t8,$flex:t9,$height:t10,$margin:t11,$marginX:t12,$marginY:t13,$marginTop:t14,$marginRight:t15,$marginBottom:t16,$marginLeft:t17,$overflow:t18,$padding:t19,$paddingX:t20,$paddingY:t21,$paddingTop:t22,$paddingRight:t23,$paddingBottom:t24,$paddingLeft:t25,$row:t26,$rowStart:t27,$rowEnd:t28,$sizing:t29,as:asProp,ref,children:props.children})),$[78]=asProp,$[79]=props.children,$[80]=ref,$[81]=restProps,$[82]=t10,$[83]=t11,$[84]=t12,$[85]=t13,$[86]=t14,$[87]=t15,$[88]=t16,$[89]=t17,$[90]=t18,$[91]=t19,$[92]=t20,$[93]=t21,$[94]=t22,$[95]=t23,$[96]=t24,$[97]=t25,$[98]=t26,$[99]=t27,$[100]=t28,$[101]=t29,$[102]=t4,$[103]=t5,$[104]=t6,$[105]=t7,$[106]=t8,$[107]=t9,$[108]=t30):t30=$[108],t30;});Box.displayName="ForwardRef(Box)";function textBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject0||(_templateObject0=_taggedTemplateLiteral(["\n color: var(--card-fg-color);\n\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ",";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])),$accent&&css(_templateObject1||(_templateObject1=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family,font.text.weights.bold);}const StyledText=/* @__PURE__ */styled.div.withConfig({displayName:"StyledText",componentId:"sc-11ov82j-0"})(responsiveTextFont,responsiveTextAlignStyle,textBaseStyle),Text=forwardRef(function(props,ref){var _props6;const $=dist.c(26);let align,childrenProp,restProps,t0,t1,t2,textOverflow,weight;$[0]!==props?(_props6=props,{accent:t0,align,children:childrenProp,muted:t1,size:t2,textOverflow,weight}=_props6,restProps=_objectWithoutProperties(_props6,_excluded18),_props6,$[0]=props,$[1]=align,$[2]=childrenProp,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=textOverflow,$[8]=weight):(align=$[1],childrenProp=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],textOverflow=$[7],weight=$[8]);const accent=t0===void 0?!1:t0,muted=t1===void 0?!1:t1,size2=t2===void 0?2:t2;let children=childrenProp;if(textOverflow==="ellipsis"){let t32;$[9]!==children?(t32=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t32):t32=$[10],children=t32;}let t3;$[11]!==align?(t3=_getArrayProp(align),$[11]=align,$[12]=t3):t3=$[12];let t4;$[13]!==size2?(t4=_getArrayProp(size2),$[13]=size2,$[14]=t4):t4=$[14];let t5;$[15]!==children?(t5=/* @__PURE__ */jsx("span",{children}),$[15]=children,$[16]=t5):t5=$[16];let t6;return $[17]!==accent||$[18]!==muted||$[19]!==ref||$[20]!==restProps||$[21]!==t3||$[22]!==t4||$[23]!==t5||$[24]!==weight?(t6=/* @__PURE__ */jsx(StyledText,_objectSpread(_objectSpread({"data-ui":"Text"},restProps),{},{$accent:accent,$align:t3,$muted:muted,ref,$size:t4,$weight:weight,children:t5})),$[17]=accent,$[18]=muted,$[19]=ref,$[20]=restProps,$[21]=t3,$[22]=t4,$[23]=t5,$[24]=weight,$[25]=t6):t6=$[25],t6;});Text.displayName="ForwardRef(Text)";function badgeStyle(props){const{$tone}=props;return{"--card-bg-color":"var(--card-badge-".concat($tone,"-bg-color)"),"--card-fg-color":"var(--card-badge-".concat($tone,"-fg-color)"),backgroundColor:"var(--card-bg-color)",cursor:"default","&:not([hidden])":{display:"inline-block",verticalAlign:"top"}};}const StyledBadge=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledBadge",componentId:"sc-5u140l-0"})(responsiveRadiusStyle,badgeStyle),Badge=forwardRef(function(props,ref){const $=dist.c(21);let children,restProps,t0,t1,t2,t3;if($[0]!==props){const{children:t42,fontSize:t52,mode:_deprecated_mode,padding:t62,radius:t72,tone:t8}=props,t9=_objectWithoutProperties(props,_excluded19);children=t42,t0=t52,t1=t62,t2=t72,t3=t8,restProps=t9,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0,$[4]=t1,$[5]=t2,$[6]=t3;}else children=$[1],restProps=$[2],t0=$[3],t1=$[4],t2=$[5],t3=$[6];const fontSize2=t0===void 0?1:t0,padding=t1===void 0?1:t1,radius=t2===void 0?"full":t2,tone=t3===void 0?"default":t3;let t4;$[7]!==radius?(t4=_getArrayProp(radius),$[7]=radius,$[8]=t4):t4=$[8];let t5;$[9]!==padding?(t5=_getArrayProp(padding),$[9]=padding,$[10]=t5):t5=$[10];let t6;$[11]!==children||$[12]!==fontSize2?(t6=/* @__PURE__ */jsx(Text,{size:fontSize2,children}),$[11]=children,$[12]=fontSize2,$[13]=t6):t6=$[13];let t7;return $[14]!==ref||$[15]!==restProps||$[16]!==t4||$[17]!==t5||$[18]!==t6||$[19]!==tone?(t7=/* @__PURE__ */jsx(StyledBadge,_objectSpread(_objectSpread({"data-ui":"Badge"},restProps),{},{$tone:tone,$radius:t4,padding:t5,ref,children:t6})),$[14]=ref,$[15]=restProps,$[16]=t4,$[17]=t5,$[18]=t6,$[19]=tone,$[20]=t7):t7=$[20],t7;});Badge.displayName="ForwardRef(Badge)";const StyledFlex=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledFlex",componentId:"sc-oxesg3-0"})(flexItemStyle,responsiveFlexStyle),Flex=forwardRef(function(props,ref){var _props7;const $=dist.c(27);let align,as,gap,justify,restProps,t0,wrap;$[0]!==props?(_props7=props,{align,as,direction:t0,gap,justify,wrap}=_props7,restProps=_objectWithoutProperties(_props7,_excluded20),_props7,$[0]=props,$[1]=align,$[2]=as,$[3]=gap,$[4]=justify,$[5]=restProps,$[6]=t0,$[7]=wrap):(align=$[1],as=$[2],gap=$[3],justify=$[4],restProps=$[5],t0=$[6],wrap=$[7]);const direction=t0===void 0?"row":t0;let t1;$[8]!==align?(t1=_getArrayProp(align),$[8]=align,$[9]=t1):t1=$[9];let t2;$[10]!==direction?(t2=_getArrayProp(direction),$[10]=direction,$[11]=t2):t2=$[11];let t3;$[12]!==gap?(t3=_getArrayProp(gap),$[12]=gap,$[13]=t3):t3=$[13];let t4;$[14]!==justify?(t4=_getArrayProp(justify),$[14]=justify,$[15]=t4):t4=$[15];let t5;$[16]!==wrap?(t5=_getArrayProp(wrap),$[16]=wrap,$[17]=t5):t5=$[17];let t6;return $[18]!==as||$[19]!==ref||$[20]!==restProps||$[21]!==t1||$[22]!==t2||$[23]!==t3||$[24]!==t4||$[25]!==t5?(t6=/* @__PURE__ */jsx(StyledFlex,_objectSpread(_objectSpread({"data-ui":"Flex"},restProps),{},{$align:t1,$direction:t2,$gap:t3,$justify:t4,$wrap:t5,forwardedAs:as,ref})),$[18]=as,$[19]=ref,$[20]=restProps,$[21]=t1,$[22]=t2,$[23]=t3,$[24]=t4,$[25]=t5,$[26]=t6):t6=$[26],t6;});Flex.displayName="ForwardRef(Flex)";const rotate$1=keyframes$1(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"]))),StyledSpinner=styled(Text).withConfig({displayName:"StyledSpinner",componentId:"sc-124hnd0-0"})(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["& > span > svg{animation:"," 500ms linear infinite;}"])),rotate$1),Spinner=forwardRef(function(props,ref){const $=dist.c(4);let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=/* @__PURE__ */jsx(SpinnerIcon,{}),$[0]=t0):t0=$[0];let t1;return $[1]!==props||$[2]!==ref?(t1=/* @__PURE__ */jsx(StyledSpinner,_objectSpread(_objectSpread({"data-ui":"Spinner"},props),{},{ref,children:t0})),$[1]=props,$[2]=ref,$[3]=t1):t1=$[3],t1;});Spinner.displayName="ForwardRef(Spinner)";function _cardColorStyle(base,color){var _color$badge$neutral,_color$badge$neutral2,_color$badge$neutral3,_color$badge$neutral4,_color$badge$suggest,_color$badge$suggest2,_color$badge$suggest3,_color$badge$suggest4;let checkered=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return{// from base
|
|
2332
|
+
*/const{onViewportEnter,onViewportLeave}=this.node.getProps();const callback=isIntersecting?onViewportEnter:onViewportLeave;callback&&callback(entry);};return observeIntersection(this.node.current,options,onIntersectionUpdate);}mount(){this.startObserver();}update(){if(typeof IntersectionObserver==="undefined")return;const{props,prevProps}=this.node;const hasOptionsChanged=["amount","margin","root"].some(hasViewportOptionChanged(props,prevProps));if(hasOptionsChanged){this.startObserver();}}unmount(){}}function hasViewportOptionChanged(_ref69){let{viewport={}}=_ref69;let{viewport:prevViewport={}}=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};return name=>viewport[name]!==prevViewport[name];}const gestureAnimations={inView:{Feature:InViewFeature},tap:{Feature:PressGesture},focus:{Feature:FocusGesture},hover:{Feature:HoverGesture}};const layout={layout:{ProjectionNode:HTMLProjectionNode,MeasureLayout}};const featureBundle=_objectSpread(_objectSpread(_objectSpread(_objectSpread({},animations),gestureAnimations),drag),layout);const motion=/*@__PURE__*/createMotionProxy(featureBundle,createDomVisualElement);var resizeObservers=[];var hasActiveObservations=function(){return resizeObservers.some(function(ro){return ro.activeTargets.length>0;});};var hasSkippedObservations=function(){return resizeObservers.some(function(ro){return ro.skippedTargets.length>0;});};var msg='ResizeObserver loop completed with undelivered notifications.';var deliverResizeLoopError=function(){var event;if(typeof ErrorEvent==='function'){event=new ErrorEvent('error',{message:msg});}else{event=document.createEvent('Event');event.initEvent('error',false,false);event.message=msg;}window.dispatchEvent(event);};var ResizeObserverBoxOptions;(function(ResizeObserverBoxOptions){ResizeObserverBoxOptions["BORDER_BOX"]="border-box";ResizeObserverBoxOptions["CONTENT_BOX"]="content-box";ResizeObserverBoxOptions["DEVICE_PIXEL_CONTENT_BOX"]="device-pixel-content-box";})(ResizeObserverBoxOptions||(ResizeObserverBoxOptions={}));var freeze=function(obj){return Object.freeze(obj);};var ResizeObserverSize=function(){function ResizeObserverSize(inlineSize,blockSize){this.inlineSize=inlineSize;this.blockSize=blockSize;freeze(this);}return ResizeObserverSize;}();var DOMRectReadOnly=function(){function DOMRectReadOnly(x,y,width,height){this.x=x;this.y=y;this.width=width;this.height=height;this.top=this.y;this.left=this.x;this.bottom=this.top+this.height;this.right=this.left+this.width;return freeze(this);}DOMRectReadOnly.prototype.toJSON=function(){var _a=this,x=_a.x,y=_a.y,top=_a.top,right=_a.right,bottom=_a.bottom,left=_a.left,width=_a.width,height=_a.height;return{x:x,y:y,top:top,right:right,bottom:bottom,left:left,width:width,height:height};};DOMRectReadOnly.fromRect=function(rectangle){return new DOMRectReadOnly(rectangle.x,rectangle.y,rectangle.width,rectangle.height);};return DOMRectReadOnly;}();var isSVG=function(target){return target instanceof SVGElement&&'getBBox'in target;};var isHidden=function(target){if(isSVG(target)){var _a=target.getBBox(),width=_a.width,height=_a.height;return!width&&!height;}var _b=target,offsetWidth=_b.offsetWidth,offsetHeight=_b.offsetHeight;return!(offsetWidth||offsetHeight||target.getClientRects().length);};var isElement=function(obj){var _a;if(obj instanceof Element){return true;}var scope=(_a=obj===null||obj===void 0?void 0:obj.ownerDocument)===null||_a===void 0?void 0:_a.defaultView;return!!(scope&&obj instanceof scope.Element);};var isReplacedElement=function(target){switch(target.tagName){case'INPUT':if(target.type!=='image'){break;}case'VIDEO':case'AUDIO':case'EMBED':case'OBJECT':case'CANVAS':case'IFRAME':case'IMG':return true;}return false;};var global$1=typeof window!=='undefined'?window:{};var cache=new WeakMap();var scrollRegexp=/auto|scroll/;var verticalRegexp=/^tb|vertical/;var IE=/msie|trident/i.test(global$1.navigator&&global$1.navigator.userAgent);var parseDimension=function(pixel){return parseFloat(pixel||'0');};var size$1=function(inlineSize,blockSize,switchSizes){if(inlineSize===void 0){inlineSize=0;}if(blockSize===void 0){blockSize=0;}if(switchSizes===void 0){switchSizes=false;}return new ResizeObserverSize((switchSizes?blockSize:inlineSize)||0,(switchSizes?inlineSize:blockSize)||0);};var zeroBoxes=freeze({devicePixelContentBoxSize:size$1(),borderBoxSize:size$1(),contentBoxSize:size$1(),contentRect:new DOMRectReadOnly(0,0,0,0)});var calculateBoxSizes=function(target,forceRecalculation){if(forceRecalculation===void 0){forceRecalculation=false;}if(cache.has(target)&&!forceRecalculation){return cache.get(target);}if(isHidden(target)){cache.set(target,zeroBoxes);return zeroBoxes;}var cs=getComputedStyle(target);var svg=isSVG(target)&&target.ownerSVGElement&&target.getBBox();var removePadding=!IE&&cs.boxSizing==='border-box';var switchSizes=verticalRegexp.test(cs.writingMode||'');var canScrollVertically=!svg&&scrollRegexp.test(cs.overflowY||'');var canScrollHorizontally=!svg&&scrollRegexp.test(cs.overflowX||'');var paddingTop=svg?0:parseDimension(cs.paddingTop);var paddingRight=svg?0:parseDimension(cs.paddingRight);var paddingBottom=svg?0:parseDimension(cs.paddingBottom);var paddingLeft=svg?0:parseDimension(cs.paddingLeft);var borderTop=svg?0:parseDimension(cs.borderTopWidth);var borderRight=svg?0:parseDimension(cs.borderRightWidth);var borderBottom=svg?0:parseDimension(cs.borderBottomWidth);var borderLeft=svg?0:parseDimension(cs.borderLeftWidth);var horizontalPadding=paddingLeft+paddingRight;var verticalPadding=paddingTop+paddingBottom;var horizontalBorderArea=borderLeft+borderRight;var verticalBorderArea=borderTop+borderBottom;var horizontalScrollbarThickness=!canScrollHorizontally?0:target.offsetHeight-verticalBorderArea-target.clientHeight;var verticalScrollbarThickness=!canScrollVertically?0:target.offsetWidth-horizontalBorderArea-target.clientWidth;var widthReduction=removePadding?horizontalPadding+horizontalBorderArea:0;var heightReduction=removePadding?verticalPadding+verticalBorderArea:0;var contentWidth=svg?svg.width:parseDimension(cs.width)-widthReduction-verticalScrollbarThickness;var contentHeight=svg?svg.height:parseDimension(cs.height)-heightReduction-horizontalScrollbarThickness;var borderBoxWidth=contentWidth+horizontalPadding+verticalScrollbarThickness+horizontalBorderArea;var borderBoxHeight=contentHeight+verticalPadding+horizontalScrollbarThickness+verticalBorderArea;var boxes=freeze({devicePixelContentBoxSize:size$1(Math.round(contentWidth*devicePixelRatio),Math.round(contentHeight*devicePixelRatio),switchSizes),borderBoxSize:size$1(borderBoxWidth,borderBoxHeight,switchSizes),contentBoxSize:size$1(contentWidth,contentHeight,switchSizes),contentRect:new DOMRectReadOnly(paddingLeft,paddingTop,contentWidth,contentHeight)});cache.set(target,boxes);return boxes;};var calculateBoxSize=function(target,observedBox,forceRecalculation){var _a=calculateBoxSizes(target,forceRecalculation),borderBoxSize=_a.borderBoxSize,contentBoxSize=_a.contentBoxSize,devicePixelContentBoxSize=_a.devicePixelContentBoxSize;switch(observedBox){case ResizeObserverBoxOptions.DEVICE_PIXEL_CONTENT_BOX:return devicePixelContentBoxSize;case ResizeObserverBoxOptions.BORDER_BOX:return borderBoxSize;default:return contentBoxSize;}};var ResizeObserverEntry=function(){function ResizeObserverEntry(target){var boxes=calculateBoxSizes(target);this.target=target;this.contentRect=boxes.contentRect;this.borderBoxSize=freeze([boxes.borderBoxSize]);this.contentBoxSize=freeze([boxes.contentBoxSize]);this.devicePixelContentBoxSize=freeze([boxes.devicePixelContentBoxSize]);}return ResizeObserverEntry;}();var calculateDepthForNode=function(node){if(isHidden(node)){return Infinity;}var depth=0;var parent=node.parentNode;while(parent){depth+=1;parent=parent.parentNode;}return depth;};var broadcastActiveObservations=function(){var shallowestDepth=Infinity;var callbacks=[];resizeObservers.forEach(function processObserver(ro){if(ro.activeTargets.length===0){return;}var entries=[];ro.activeTargets.forEach(function processTarget(ot){var entry=new ResizeObserverEntry(ot.target);var targetDepth=calculateDepthForNode(ot.target);entries.push(entry);ot.lastReportedSize=calculateBoxSize(ot.target,ot.observedBox);if(targetDepth<shallowestDepth){shallowestDepth=targetDepth;}});callbacks.push(function resizeObserverCallback(){ro.callback.call(ro.observer,entries,ro.observer);});ro.activeTargets.splice(0,ro.activeTargets.length);});for(var _i=0,callbacks_1=callbacks;_i<callbacks_1.length;_i++){var callback=callbacks_1[_i];callback();}return shallowestDepth;};var gatherActiveObservationsAtDepth=function(depth){resizeObservers.forEach(function processObserver(ro){ro.activeTargets.splice(0,ro.activeTargets.length);ro.skippedTargets.splice(0,ro.skippedTargets.length);ro.observationTargets.forEach(function processTarget(ot){if(ot.isActive()){if(calculateDepthForNode(ot.target)>depth){ro.activeTargets.push(ot);}else{ro.skippedTargets.push(ot);}}});});};var process$1=function(){var depth=0;gatherActiveObservationsAtDepth(depth);while(hasActiveObservations()){depth=broadcastActiveObservations();gatherActiveObservationsAtDepth(depth);}if(hasSkippedObservations()){deliverResizeLoopError();}return depth>0;};var trigger;var callbacks=[];var notify=function(){return callbacks.splice(0).forEach(function(cb){return cb();});};var queueMicroTask=function(callback){if(!trigger){var toggle_1=0;var el_1=document.createTextNode('');var config={characterData:true};new MutationObserver(function(){return notify();}).observe(el_1,config);trigger=function(){el_1.textContent="".concat(toggle_1?toggle_1--:toggle_1++);};}callbacks.push(callback);trigger();};var queueResizeObserver=function(cb){queueMicroTask(function ResizeObserver(){requestAnimationFrame(cb);});};var watching=0;var isWatching=function(){return!!watching;};var CATCH_PERIOD=250;var observerConfig={attributes:true,characterData:true,childList:true,subtree:true};var events=['resize','load','transitionend','animationend','animationstart','animationiteration','keyup','keydown','mouseup','mousedown','mouseover','mouseout','blur','focus'];var time=function(timeout){if(timeout===void 0){timeout=0;}return Date.now()+timeout;};var scheduled=false;var Scheduler=function(){function Scheduler(){var _this=this;this.stopped=true;this.listener=function(){return _this.schedule();};}Scheduler.prototype.run=function(timeout){var _this=this;if(timeout===void 0){timeout=CATCH_PERIOD;}if(scheduled){return;}scheduled=true;var until=time(timeout);queueResizeObserver(function(){var elementsHaveResized=false;try{elementsHaveResized=process$1();}finally{scheduled=false;timeout=until-time();if(!isWatching()){return;}if(elementsHaveResized){_this.run(1000);}else if(timeout>0){_this.run(timeout);}else{_this.start();}}});};Scheduler.prototype.schedule=function(){this.stop();this.run();};Scheduler.prototype.observe=function(){var _this=this;var cb=function(){return _this.observer&&_this.observer.observe(document.body,observerConfig);};document.body?cb():global$1.addEventListener('DOMContentLoaded',cb);};Scheduler.prototype.start=function(){var _this=this;if(this.stopped){this.stopped=false;this.observer=new MutationObserver(this.listener);this.observe();events.forEach(function(name){return global$1.addEventListener(name,_this.listener,true);});}};Scheduler.prototype.stop=function(){var _this=this;if(!this.stopped){this.observer&&this.observer.disconnect();events.forEach(function(name){return global$1.removeEventListener(name,_this.listener,true);});this.stopped=true;}};return Scheduler;}();var scheduler=new Scheduler();var updateCount=function(n){!watching&&n>0&&scheduler.start();watching+=n;!watching&&scheduler.stop();};var skipNotifyOnElement=function(target){return!isSVG(target)&&!isReplacedElement(target)&&getComputedStyle(target).display==='inline';};var ResizeObservation=function(){function ResizeObservation(target,observedBox){this.target=target;this.observedBox=observedBox||ResizeObserverBoxOptions.CONTENT_BOX;this.lastReportedSize={inlineSize:0,blockSize:0};}ResizeObservation.prototype.isActive=function(){var size=calculateBoxSize(this.target,this.observedBox,true);if(skipNotifyOnElement(this.target)){this.lastReportedSize=size;}if(this.lastReportedSize.inlineSize!==size.inlineSize||this.lastReportedSize.blockSize!==size.blockSize){return true;}return false;};return ResizeObservation;}();var ResizeObserverDetail=function(){function ResizeObserverDetail(resizeObserver,callback){this.activeTargets=[];this.skippedTargets=[];this.observationTargets=[];this.observer=resizeObserver;this.callback=callback;}return ResizeObserverDetail;}();var observerMap=new WeakMap();var getObservationIndex=function(observationTargets,target){for(var i=0;i<observationTargets.length;i+=1){if(observationTargets[i].target===target){return i;}}return-1;};var ResizeObserverController=function(){function ResizeObserverController(){}ResizeObserverController.connect=function(resizeObserver,callback){var detail=new ResizeObserverDetail(resizeObserver,callback);observerMap.set(resizeObserver,detail);};ResizeObserverController.observe=function(resizeObserver,target,options){var detail=observerMap.get(resizeObserver);var firstObservation=detail.observationTargets.length===0;if(getObservationIndex(detail.observationTargets,target)<0){firstObservation&&resizeObservers.push(detail);detail.observationTargets.push(new ResizeObservation(target,options&&options.box));updateCount(1);scheduler.schedule();}};ResizeObserverController.unobserve=function(resizeObserver,target){var detail=observerMap.get(resizeObserver);var index=getObservationIndex(detail.observationTargets,target);var lastObservation=detail.observationTargets.length===1;if(index>=0){lastObservation&&resizeObservers.splice(resizeObservers.indexOf(detail),1);detail.observationTargets.splice(index,1);updateCount(-1);}};ResizeObserverController.disconnect=function(resizeObserver){var _this=this;var detail=observerMap.get(resizeObserver);detail.observationTargets.slice().forEach(function(ot){return _this.unobserve(resizeObserver,ot.target);});detail.activeTargets.splice(0,detail.activeTargets.length);};return ResizeObserverController;}();var ResizeObserver$1=function(){function ResizeObserver(callback){if(arguments.length===0){throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");}if(typeof callback!=='function'){throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");}ResizeObserverController.connect(this,callback);}ResizeObserver.prototype.observe=function(target,options){if(arguments.length===0){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");}if(!isElement(target)){throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");}ResizeObserverController.observe(this,target,options);};ResizeObserver.prototype.unobserve=function(target){if(arguments.length===0){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");}if(!isElement(target)){throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");}ResizeObserverController.unobserve(this,target);};ResizeObserver.prototype.disconnect=function(){ResizeObserverController.disconnect(this);};ResizeObserver.toString=function(){return'function ResizeObserver () { [polyfill code] }';};return ResizeObserver;}();const context=React__default.createContext(!0);function forbiddenInRender(){throw new Error("A function wrapped in useEffectEvent can't be called during rendering.");}const isInvalidExecutionContextForEventFunction="use"in React__default?()=>{try{return React__default.use(context);}catch(_unused2){return!1;}}:()=>!1;function useEffectEvent(fn){const ref=React__default.useRef(forbiddenInRender);return React__default.useInsertionEffect(()=>{ref.current=fn;},[fn]),function(){isInvalidExecutionContextForEventFunction()&&forbiddenInRender();const latestFn=ref.current;return latestFn(...arguments);};}buildTheme();const EMPTY_ARRAY=[],EMPTY_RECORD={},POPOVER_MOTION_PROPS={card:{initial:{scale:0.97,willChange:"transform"},hidden:{opacity:0},visible:{opacity:1,transition:{when:"beforeChildren",duration:0.1}},scaleIn:{scale:1},scaleOut:{scale:0.97}},children:{hidden:{opacity:0},visible:{opacity:1}},transition:{type:"spring",visualDuration:0.2,bounce:0.25}};function _isEnterToClickElement(element){return isHTMLAnchorElement(element)||isHTMLButtonElement(element);}function isHTMLElement(node){return node instanceof Node&&node.nodeType===Node.ELEMENT_NODE;}function isHTMLAnchorElement(element){return isHTMLElement(element)&&element.nodeName==="A";}function isHTMLInputElement(element){return isHTMLElement(element)&&element.nodeName==="INPUT";}function isHTMLButtonElement(element){return isHTMLElement(element)&&element.nodeName==="BUTTON";}function isHTMLSelectElement(element){return isHTMLElement(element)&&element.nodeName==="SELECT";}function isHTMLTextAreaElement(element){return isHTMLElement(element)&&element.nodeName==="TEXTAREA";}function containsOrEqualsElement(element,node){return element.contains(node)||element===node;}function _isScrollable(el){if(!(el instanceof Element))return!1;const style=window.getComputedStyle(el);return style.overflowX.includes("auto")||style.overflowX.includes("scroll")||style.overflowY.includes("auto")||style.overflowY.includes("scroll");}function _fillCSSObject(keys,value){return keys.reduce((style,key2)=>(style[key2]=value,style),{});}function rem(pixelValue){return pixelValue===0?0:"".concat(pixelValue/16,"rem");}function _responsive(media,values,callback){return((values===null||values===void 0?void 0:values.map(callback))||[]).map((statement,mediaIndex)=>mediaIndex===0?statement:{["@media screen and (min-width: ".concat(media[mediaIndex-1],"px)")]:statement});}function _getArrayProp(val,defaultVal){return val===void 0?defaultVal||EMPTY_ARRAY:Array.isArray(val)?val:[val];}function _getResponsiveSpace(theme,props){let spaceIndexes=arguments.length>2&&arguments[2]!==undefined?arguments[2]:EMPTY_ARRAY;if(!Array.isArray(spaceIndexes))throw new Error("the property must be array of numbers");if(spaceIndexes.length===0)return null;const{media,space}=getTheme_v2(theme);return _responsive(media,spaceIndexes,spaceIndex=>_fillCSSObject(props,rem(space[spaceIndex])));}function responsiveFont(fontKey,props){const{$size,$weight}=props,{font,media}=getTheme_v2(props.theme),{family,sizes,weights}=font[fontKey],fontWeight=$weight&&weights[$weight]||weights.regular,defaultSize=sizes[2],base={position:"relative",fontFamily:family,fontWeight:"".concat(fontWeight),padding:"1px 0",margin:0,"&:before":{content:'""',display:"block",height:0},"&:after":{content:'""',display:"block",height:0},"& > code, & > span":{display:"block"},"&:not([hidden])":{display:"block"}};if(!$size)return responsiveFont.warned||(console.warn("No size specified for responsive font",{fontKey,$size,props,base}),responsiveFont.warned=!0),[base];const resp=_responsive(media,$size,sizeIndex=>fontSize(sizes[sizeIndex]||defaultSize));return[base,...resp];}function fontSize(size2){const{ascenderHeight,descenderHeight,fontSize:fontSize2,iconSize,letterSpacing,lineHeight}=size2,negHeight=ascenderHeight+descenderHeight,capHeight=lineHeight-negHeight,iconOffset=(capHeight-iconSize)/2,customIconSize=Math.floor(fontSize2*1.125/2)*2+1,customIconOffset=(capHeight-customIconSize)/2;return{fontSize:rem(fontSize2),lineHeight:"calc(".concat(lineHeight," / ").concat(fontSize2,")"),letterSpacing:rem(letterSpacing),transform:"translateY(".concat(rem(descenderHeight),")"),"&:before":{marginTop:"calc(".concat(rem(0-negHeight)," - 1px)")},"&:after":{marginBottom:"-1px"},"& svg:not([data-sanity-icon])":{fontSize:"calc(".concat(customIconSize," / 16 * 1rem)"),margin:rem(customIconOffset)},"& [data-sanity-icon]":{fontSize:"calc(".concat(iconSize," / 16 * 1rem)"),margin:rem(iconOffset)}};}function responsiveCodeFontStyle(props){return responsiveFont("code",props);}function responsiveHeadingFont(props){return responsiveFont("heading",props);}function responsiveLabelFont(props){return responsiveFont("label",props);}function responsiveTextAlignStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$align,textAlign=>({textAlign}));}function responsiveTextFont(props){return responsiveFont("text",props);}function getGlobalScope(){if(typeof globalThis<"u")return globalThis;if(typeof window<"u")return window;if(typeof self<"u")return self;if(typeof global<"u")return global;throw new Error("@sanity/ui: could not locate global scope");}const globalScope=getGlobalScope();function createGlobalScopedContext(key2,defaultValue){const symbol=Symbol.for(key2);if(typeof document>"u"){const context=createContext(defaultValue);return context.displayName=key2,context;}return globalScope[symbol]=globalScope[symbol]||createContext(defaultValue),globalScope[symbol];}const ThemeContext=createGlobalScopedContext("@sanity/ui/context/theme",null);function ThemeProvider(props){var _props$scheme,_props$theme,_props$tone;const $=dist.c(15),parentTheme=useContext(ThemeContext),{children}=props,scheme=(_props$scheme=props.scheme)!==null&&_props$scheme!==void 0?_props$scheme:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.scheme)||"light",rootTheme=(_props$theme=props.theme)!==null&&_props$theme!==void 0?_props$theme:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.theme)||null,tone=(_props$tone=props.tone)!==null&&_props$tone!==void 0?_props$tone:(parentTheme===null||parentTheme===void 0?void 0:parentTheme.tone)||"default";let t0;bb0:{if(!rootTheme){t0=null;break bb0;}let t12;$[0]!==rootTheme||$[1]!==scheme||$[2]!==tone?(t12={version:0,theme:rootTheme,scheme,tone},$[0]=rootTheme,$[1]=scheme,$[2]=tone,$[3]=t12):t12=$[3],t0=t12;}const themeContext=t0;let t1;bb1:{if(!rootTheme){t1=null;break bb1;}let t22;$[4]!==rootTheme||$[5]!==scheme||$[6]!==tone?(t22=getScopedTheme(rootTheme,scheme,tone),$[4]=rootTheme,$[5]=scheme,$[6]=tone,$[7]=t22):t22=$[7],t1=t22;}const theme=t1;if(!theme){let t22;return $[8]===Symbol.for("react.memo_cache_sentinel")?(t22=/* @__PURE__ */jsx("pre",{children:'ThemeProvider: no "theme" property provided'}),$[8]=t22):t22=$[8],t22;}let t2;$[9]!==children||$[10]!==theme?(t2=/* @__PURE__ */jsx(ThemeProvider$1,{theme,children}),$[9]=children,$[10]=theme,$[11]=t2):t2=$[11];let t3;return $[12]!==t2||$[13]!==themeContext?(t3=/* @__PURE__ */jsx(ThemeContext.Provider,{value:themeContext,children:t2}),$[12]=t2,$[13]=themeContext,$[14]=t3):t3=$[14],t3;}ThemeProvider.displayName="ThemeProvider";function useRootTheme(){const value=useContext(ThemeContext);if(!value)throw new Error("useRootTheme(): missing context value");return value;}function ThemeColorProvider(props){const $=dist.c(5),{children,scheme,tone}=props,root=useRootTheme(),t0=scheme||root.scheme;let t1;return $[0]!==children||$[1]!==root.theme||$[2]!==t0||$[3]!==tone?(t1=/* @__PURE__ */jsx(ThemeProvider,{scheme:t0,theme:root.theme,tone,children}),$[0]=children,$[1]=root.theme,$[2]=t0,$[3]=tone,$[4]=t1):t1=$[4],t1;}ThemeColorProvider.displayName="ThemeColorProvider";function useTheme_v2(){const $=dist.c(2),t0=useTheme();let t1;return $[0]!==t0?(t1=getTheme_v2(t0),$[0]=t0,$[1]=t1):t1=$[1],t1;}function responsiveBorderStyle(){return[border,borderTop,borderRight,borderBottom,borderLeft];}function border(props){var _card$border$width,_card$border;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width=(_card$border=card.border)===null||_card$border===void 0?void 0:_card$border.width)!==null&&_card$border$width!==void 0?_card$border$width:1,"px solid var(--card-border-color)");return _responsive(media,props.$border,value=>value?{"&&":{border:borderStyle}}:{"&&":{border:0}});}function borderTop(props){var _card$border$width2,_card$border2;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width2=(_card$border2=card.border)===null||_card$border2===void 0?void 0:_card$border2.width)!==null&&_card$border$width2!==void 0?_card$border$width2:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderTop,value=>value?{"&&":{borderTop:borderStyle}}:{"&&":{borderTop:0}});}function borderRight(props){var _card$border$width3,_card$border3;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width3=(_card$border3=card.border)===null||_card$border3===void 0?void 0:_card$border3.width)!==null&&_card$border$width3!==void 0?_card$border$width3:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderRight,value=>value?{"&&":{borderRight:borderStyle}}:{"&&":{borderRight:0}});}function borderBottom(props){var _card$border$width4,_card$border4;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width4=(_card$border4=card.border)===null||_card$border4===void 0?void 0:_card$border4.width)!==null&&_card$border$width4!==void 0?_card$border$width4:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderBottom,value=>value?{"&&":{borderBottom:borderStyle}}:{"&&":{borderBottom:0}});}function borderLeft(props){var _card$border$width5,_card$border5;const{card,media}=getTheme_v2(props.theme),borderStyle="".concat((_card$border$width5=(_card$border5=card.border)===null||_card$border5===void 0?void 0:_card$border5.width)!==null&&_card$border$width5!==void 0?_card$border$width5:1,"px solid var(--card-border-color)");return _responsive(media,props.$borderLeft,value=>value?{"&&":{borderLeft:borderStyle}}:{"&&":{borderLeft:0}});}const BASE_STYLE$4={'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"}},BOX_SIZING={content:"content-box",border:"border-box"},BOX_HEIGHT={stretch:"stretch",fill:"100%"};function boxStyle(){return BASE_STYLE$4;}function responsiveBoxStyle(){return[responsiveBoxSizingStyle,responsiveBoxHeightStyle,responsiveBoxOverflowStyle,responsiveBoxDisplayStyle];}function responsiveBoxDisplayStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$display,display=>({"&:not([hidden])":{display}}));}function responsiveBoxSizingStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$sizing,sizing=>({boxSizing:BOX_SIZING[sizing]}));}function responsiveBoxHeightStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$height,height=>({height:BOX_HEIGHT[height]}));}function responsiveBoxOverflowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$overflow,overflow=>({overflow}));}const BASE_STYLE$3={minWidth:0,minHeight:0};function flexItemStyle(){return[BASE_STYLE$3,responsiveFlexItemStyle];}function responsiveFlexItemStyle(props){const{media}=getTheme_v2(props.theme);return props.$flex?_responsive(media,props.$flex,flex=>({flex:"".concat(flex)})):EMPTY_ARRAY;}const BASE_STYLE$2={"&&:not([hidden])":{display:"flex"}};function responsiveFlexStyle(){return[BASE_STYLE$2,responsiveFlexAlignStyle,responsiveFlexGapStyle,responsiveFlexWrapStyle,responsiveFlexJustifyStyle,responsiveFlexDirectionStyle];}function responsiveFlexAlignStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$align,align=>({alignItems:align}));}function responsiveFlexGapStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gap,gap=>({gap:gap?rem(space[gap]):void 0}));}function responsiveFlexWrapStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$wrap,wrap=>({flexWrap:wrap}));}function responsiveFlexJustifyStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$justify,justify=>({justifyContent:justify}));}function responsiveFlexDirectionStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$direction,direction=>({flexDirection:direction}));}function focusRingBorderStyle(border2){return"inset 0 0 0 ".concat(border2.width,"px ").concat(border2.color);}function focusRingStyle(opts){const{base,border:border2,focusRing}=opts,focusRingOutsetWidth=focusRing.offset+focusRing.width,focusRingInsetWidth=0-focusRing.offset,bgColor=base?base.bg:"var(--card-bg-color)";return[focusRingInsetWidth>0&&"inset 0 0 0 ".concat(focusRingInsetWidth,"px var(--card-focus-ring-color)"),border2&&focusRingBorderStyle(border2),focusRingInsetWidth<0&&"0 0 0 ".concat(0-focusRingInsetWidth,"px ").concat(bgColor),focusRingOutsetWidth>0&&"0 0 0 ".concat(focusRingOutsetWidth,"px var(--card-focus-ring-color)")].filter(Boolean).join(",");}function responsiveGridItemStyle(){return[responsiveGridItemRowStyle,responsiveGridItemRowStartStyle,responsiveGridItemRowEndStyle,responsiveGridItemColumnStyle,responsiveGridItemColumnStartStyle,responsiveGridItemColumnEndStyle];}const GRID_ITEM_ROW={auto:"auto",full:"1 / -1"},GRID_ITEM_COLUMN={auto:"auto",full:"1 / -1"};function responsiveGridItemRowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$row,row=>typeof row=="number"?{gridRow:"span ".concat(row," / span ").concat(row)}:{gridRow:GRID_ITEM_ROW[row]});}function responsiveGridItemRowStartStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rowStart,rowStart=>({gridRowStart:"".concat(rowStart)}));}function responsiveGridItemRowEndStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rowEnd,rowEnd=>({gridRowEnd:"".concat(rowEnd)}));}function responsiveGridItemColumnStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$column,column=>typeof column=="number"?{gridColumn:"span ".concat(column," / span ").concat(column)}:{gridColumn:GRID_ITEM_COLUMN[column]});}function responsiveGridItemColumnStartStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columnStart,columnStart=>({gridColumnStart:"".concat(columnStart)}));}function responsiveGridItemColumnEndStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columnEnd,columnEnd=>({gridColumnEnd:"".concat(columnEnd)}));}const GRID_CSS={"&&:not([hidden])":{display:"grid"},'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"}},GRID_AUTO_COLUMS={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},GRID_AUTO_ROWS={auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"};function responsiveGridStyle(){return[GRID_CSS,responsiveGridAutoFlowStyle,responsiveGridAutoRowsStyle,responsiveGridAutoColsStyle,responsiveGridColumnsStyle,responsiveGridRowsStyle,responsiveGridGapStyle,responsiveGridGapXStyle,responsiveGridGapYStyle];}function responsiveGridAutoFlowStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoFlow,autoFlow=>({gridAutoFlow:autoFlow}));}function responsiveGridAutoRowsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoRows,autoRows=>({gridAutoRows:autoRows&&GRID_AUTO_ROWS[autoRows]}));}function responsiveGridAutoColsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$autoCols,autoCols=>({gridAutoColumns:autoCols&&GRID_AUTO_COLUMS[autoCols]}));}function responsiveGridColumnsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$columns,columns=>({gridTemplateColumns:columns&&"repeat(".concat(columns,",minmax(0,1fr));")}));}function responsiveGridRowsStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$rows,rows=>({gridTemplateRows:rows&&"repeat(".concat(rows,",minmax(0,1fr));")}));}function responsiveGridGapStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gap,gap=>({gridGap:gap?rem(space[gap]):void 0}));}function responsiveGridGapXStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gapX,gapX=>({columnGap:gapX?rem(space[gapX]):void 0}));}function responsiveGridGapYStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$gapY,gapY=>({rowGap:gapY?rem(space[gapY]):void 0}));}function responsiveInputPaddingStyle(props){const{$fontSize,$iconLeft,$iconRight,$padding,$space}=props,{font,media,space}=getTheme_v2(props.theme),len=Math.max($padding.length,$space.length,$fontSize.length),_padding=[],_space=[],_fontSize=[];for(let i=0;i<len;i+=1)_fontSize[i]=$fontSize[i]===void 0?_fontSize[i-1]:$fontSize[i],_padding[i]=$padding[i]===void 0?_padding[i-1]:$padding[i],_space[i]=$space[i]===void 0?_space[i-1]:$space[i];return _responsive(media,_padding,(_,i)=>{const size2=font.text.sizes[_fontSize[i]]||font.text.sizes[2],emSize=size2.lineHeight-size2.ascenderHeight-size2.descenderHeight,p=space[_padding[i]],s=space[_space[i]],styles={paddingTop:rem(p-size2.ascenderHeight),paddingRight:rem(p),paddingBottom:rem(p-size2.descenderHeight),paddingLeft:rem(p)};return $iconRight&&(styles.paddingRight=rem(p+emSize+s)),$iconLeft&&(styles.paddingLeft=rem(p+emSize+s)),styles;});}function responsiveInputPaddingIconRightStyle(props){return responsiveInputPaddingStyle(_objectSpread(_objectSpread({},props),{},{$iconRight:!0}));}const ROOT_STYLE=css(_templateObject||(_templateObject=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: flex;\n }\n\n align-items: center;\n"])));function textInputRootStyle(){return ROOT_STYLE;}function textInputBaseStyle(props){const{$scheme,$tone,$weight}=props,{color,font}=getTheme_v2(props.theme);return css(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["\n appearance: none;\n background: none;\n border: 0;\n border-radius: 0;\n outline: none;\n width: 100%;\n box-sizing: border-box;\n font-family: ",";\n font-weight: ",";\n margin: 0;\n position: relative;\n z-index: 1;\n display: block;\n\n /* NOTE: This is a hack to disable Chrome\u2019s autofill styles */\n &:-webkit-autofill,\n &:-webkit-autofill:hover,\n &:-webkit-autofill:focus,\n &:-webkit-autofill:active {\n -webkit-text-fill-color: var(--input-fg-color) !important;\n transition: background-color 5000s;\n transition-delay: 86400s /* 24h */;\n }\n\n /* &:is(textarea) */\n &[data-as='textarea'] {\n resize: none;\n }\n\n color: var(--input-fg-color);\n\n &::placeholder {\n color: var(--input-placeholder-color);\n }\n\n &[data-scheme='","'][data-tone='","'] {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n\n /* enabled */\n &:not(:invalid):not(:disabled):not(:read-only) {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* disabled */\n &:not(:invalid):disabled {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* invalid */\n &:invalid {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n\n /* readOnly */\n &:read-only {\n --input-fg-color: ",";\n --input-placeholder-color: ",";\n }\n }\n "])),font.text.family,$weight&&font.text.weights[$weight]||font.text.weights.regular,$scheme,$tone,color.input.default.enabled.fg,color.input.default.enabled.placeholder,color.input.default.enabled.fg,color.input.default.enabled.placeholder,color.input.default.disabled.fg,color.input.default.disabled.placeholder,color.input.invalid.enabled.fg,color.input.invalid.enabled.placeholder,color.input.default.readOnly.fg,color.input.default.readOnly.placeholder);}function textInputFontSizeStyle(props){const{font,media}=getTheme_v2(props.theme);return _responsive(media,props.$fontSize,sizeIndex=>{const size2=font.text.sizes[sizeIndex]||font.text.sizes[2];return{fontSize:rem(size2.fontSize),lineHeight:"".concat(size2.lineHeight/size2.fontSize)};});}function textInputRepresentationStyle(props){const{$hasPrefix,$hasSuffix,$scheme,$tone,$unstableDisableFocusRing}=props,{color,input}=getTheme_v2(props.theme);return css(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["\n --input-box-shadow: none;\n\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n display: block;\n pointer-events: none;\n z-index: 0;\n\n background-color: var(--card-bg-color);\n box-shadow: var(--input-box-shadow);\n\n border-top-left-radius: ",";\n border-bottom-left-radius: ",";\n border-top-right-radius: ",";\n border-bottom-right-radius: ",";\n\n &[data-scheme='","'][data-tone='","'] {\n --card-bg-color: ",";\n --card-fg-color: ",";\n\n /* enabled */\n *:not(:disabled) + &[data-border] {\n --input-box-shadow: ",";\n }\n\n /* invalid */\n *:not(:disabled):invalid + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n /* focused */\n *:not(:disabled):focus + & {\n &[data-border] {\n --input-box-shadow: ",";\n }\n\n &:not([data-border]) {\n --input-box-shadow: ",";\n }\n }\n\n /* disabled */\n *:not(:invalid):disabled + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n --card-icon-color: "," !important;\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n *:invalid:disabled + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n --card-icon-color: "," !important;\n\n &[data-border] {\n --input-box-shadow: ",";\n }\n }\n\n /* readOnly */\n *:not(:invalid):read-only + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n }\n\n *:invalid:read-only + & {\n --card-bg-color: "," !important;\n --card-fg-color: "," !important;\n }\n\n /* hovered */\n @media (hover: hover) {\n *:not(:disabled):not(:read-only):not(:invalid):hover + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n }\n\n *:invalid:not(:disabled):not(:read-only):hover + & {\n --card-bg-color: ",";\n --card-fg-color: ",";\n }\n\n *:not(:disabled):not(:read-only):not(:invalid):not(:focus):hover + &[data-border] {\n --input-box-shadow: ",";\n }\n\n *:invalid:not(:disabled):not(:read-only):not(:focus):hover + &[data-border] {\n --input-box-shadow: ",";\n }\n }\n }\n "])),$hasPrefix?0:void 0,$hasPrefix?0:void 0,$hasSuffix?0:void 0,$hasSuffix?0:void 0,$scheme,$tone,color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.invalid.enabled.bg,color.input.invalid.enabled.fg,focusRingBorderStyle({color:color.input.invalid.enabled.border,width:input.border.width}),$unstableDisableFocusRing?void 0:focusRingStyle({border:{color:color.input.default.enabled.border,width:input.border.width},focusRing:input.text.focusRing}),$unstableDisableFocusRing?void 0:focusRingStyle({focusRing:input.text.focusRing}),color.input.default.disabled.bg,color.input.default.disabled.fg,color.input.default.disabled.fg,focusRingBorderStyle({color:color.input.default.disabled.border,width:input.border.width}),color.input.invalid.disabled.bg,color.input.invalid.disabled.fg,color.input.invalid.disabled.fg,focusRingBorderStyle({color:color.input.invalid.disabled.border,width:input.border.width}),color.input.default.readOnly.bg,color.input.default.readOnly.fg,color.input.invalid.readOnly.bg,color.input.invalid.readOnly.fg,color.input.default.hovered.bg,color.input.default.hovered.fg,color.input.invalid.hovered.bg,color.input.invalid.hovered.fg,focusRingBorderStyle({color:color.input.default.hovered.border,width:input.border.width}),focusRingBorderStyle({color:color.input.invalid.hovered.border,width:input.border.width}));}function responsiveMarginStyle(props){const{theme}=props;return[_getResponsiveSpace(theme,["margin"],props.$margin),_getResponsiveSpace(theme,["marginLeft","marginRight"],props.$marginX),_getResponsiveSpace(theme,["marginTop","marginBottom"],props.$marginY),_getResponsiveSpace(theme,["marginTop"],props.$marginTop),_getResponsiveSpace(theme,["marginRight"],props.$marginRight),_getResponsiveSpace(theme,["marginBottom"],props.$marginBottom),_getResponsiveSpace(theme,["marginLeft"],props.$marginLeft)].filter(Boolean);}function responsivePaddingStyle(props){const{theme}=props;return[_getResponsiveSpace(theme,["padding"],props.$padding),_getResponsiveSpace(theme,["paddingLeft","paddingRight"],props.$paddingX),_getResponsiveSpace(theme,["paddingTop","paddingBottom"],props.$paddingY),_getResponsiveSpace(theme,["paddingTop"],props.$paddingTop),_getResponsiveSpace(theme,["paddingRight"],props.$paddingRight),_getResponsiveSpace(theme,["paddingBottom"],props.$paddingBottom),_getResponsiveSpace(theme,["paddingLeft"],props.$paddingLeft)].filter(Boolean);}function responsiveRadiusStyle(props){const{media,radius}=getTheme_v2(props.theme);return _responsive(media,props.$radius,value=>{let borderRadius=0;return typeof value=="number"&&(borderRadius=rem(radius[value])),value==="full"&&(borderRadius="9999px"),{borderRadius};});}function toBoxShadow(shadow,color){return"".concat(shadow.map(rem).join(" ")," ").concat(color);}function shadowStyle(shadow){let outlineWidth=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1;if(!shadow)return EMPTY_RECORD;const outline="0 0 0 ".concat(rem(outlineWidth)," var(--card-shadow-outline-color)"),umbra=toBoxShadow(shadow.umbra,"var(--card-shadow-umbra-color)"),penumbra=toBoxShadow(shadow.penumbra,"var(--card-shadow-penumbra-color)"),ambient=toBoxShadow(shadow.ambient,"var(--card-shadow-ambient-color)");return{boxShadow:"".concat(outline,", ").concat(umbra,", ").concat(penumbra,", ").concat(ambient)};}function responsiveShadowStyle(props){const{card,media,shadow}=getTheme_v2(props.theme);return _responsive(media,props.$shadow,index=>shadowStyle(shadow[index],card.shadow.outline));}const SpanWithTextOverflow=styled.span.withConfig({displayName:"SpanWithTextOverflow",componentId:"sc-ol2i3b-0"})(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;"])));function labelBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["\n text-transform: uppercase;\n\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),$accent&&css(_templateObject6||(_templateObject6=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject7||(_templateObject7=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family);}const StyledLabel=/* @__PURE__ */styled.div.withConfig({displayName:"StyledLabel",componentId:"sc-1luap7z-0"})(responsiveLabelFont,responsiveTextAlignStyle,labelBaseStyle),Label=forwardRef(function(props,ref){var _props2;const $=dist.c(26);let accent,align,childrenProp,restProps,t0,t1,textOverflow,weight;$[0]!==props?(_props2=props,{accent,align,children:childrenProp,muted:t0,size:t1,textOverflow,weight}=_props2,restProps=_objectWithoutProperties(_props2,_excluded15),_props2,$[0]=props,$[1]=accent,$[2]=align,$[3]=childrenProp,$[4]=restProps,$[5]=t0,$[6]=t1,$[7]=textOverflow,$[8]=weight):(accent=$[1],align=$[2],childrenProp=$[3],restProps=$[4],t0=$[5],t1=$[6],textOverflow=$[7],weight=$[8]);const muted=t0===void 0?!1:t0,size2=t1===void 0?2:t1;let children=childrenProp;if(textOverflow==="ellipsis"){let t22;$[9]!==children?(t22=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t22):t22=$[10],children=t22;}else{let t22;$[11]!==children?(t22=/* @__PURE__ */jsx("span",{children}),$[11]=children,$[12]=t22):t22=$[12],children=t22;}let t2;$[13]!==align?(t2=_getArrayProp(align),$[13]=align,$[14]=t2):t2=$[14];let t3;$[15]!==size2?(t3=_getArrayProp(size2),$[15]=size2,$[16]=t3):t3=$[16];let t4;return $[17]!==accent||$[18]!==children||$[19]!==muted||$[20]!==ref||$[21]!==restProps||$[22]!==t2||$[23]!==t3||$[24]!==weight?(t4=/* @__PURE__ */jsx(StyledLabel,_objectSpread(_objectSpread({"data-ui":"Label"},restProps),{},{$accent:accent,$align:t2,$muted:muted,$size:t3,$weight:weight,ref,children})),$[17]=accent,$[18]=children,$[19]=muted,$[20]=ref,$[21]=restProps,$[22]=t2,$[23]=t3,$[24]=weight,$[25]=t4):t4=$[25],t4;});Label.displayName="ForwardRef(Label)";const avatarStyle={root:avatarRootStyle,arrow:avatarArrowStyle,bgStroke:avatarBgStrokeStyle,stroke:avatarStrokeStyle,initials:avatarInitialsStyle,image:avatarImageStyle};function avatarArrowStyle(){return{position:"absolute",boxSizing:"border-box",zIndex:"0",opacity:"0",transition:"all 0.2s linear",transform:"rotate(-90deg) translate3d(0, 6px, 0)",left:0,right:0,top:0,bottom:0,"& > svg":{width:"11px",height:"7px",position:"absolute",top:"-5px",left:"50%",transform:"translateX(-6px)","&:not([hidden])":{display:"block"}},"[data-arrow-position='inside'] > &":{transform:"rotate(-90deg) translate3d(0, 6px, 0)",opacity:"0"},"[data-arrow-position='top'] > &":{opacity:"1",transform:"rotate(0deg)"},"[data-arrow-position='bottom'] > &":{opacity:"1",transform:"rotate(-180deg)"}};}function avatarRootStyle(props){const{$color}=props,{avatar}=getTheme_v2(props.theme);return{"--avatar-bg-color":"var(--card-avatar-".concat($color,"-bg-color)"),"--avatar-fg-color":"var(--card-avatar-".concat($color,"-fg-color)"),backgroundColor:"var(--avatar-bg-color)",position:"relative",boxSizing:"border-box",userSelect:"none",boxShadow:"0 0 0 1px var(--card-bg-color)",'&[data-status="inactive"]':{opacity:"0.5"},"&>svg":{"&:not([hidden])":{display:"block"}},/* &:is(button) */'&[data-as="button"]':{WebkitFontSmoothing:"inherit",appearance:"none",margin:0,padding:0,border:0,font:"inherit",color:"inherit",outline:"none","&:focus":{boxShadow:focusRingStyle({focusRing:avatar.focusRing})},"&:focus:not(:focus-visible)":{boxShadow:"none"}}};}function responsiveAvatarSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2]||avatar.sizes[0];return{width:rem(avatarSize.size),height:rem(avatarSize.size),borderRadius:rem(avatarSize.size/2),"&>svg":{width:rem(avatarSize.size),height:rem(avatarSize.size),borderRadius:rem(avatarSize.size/2)}};});}function avatarImageStyle(){return{position:"relative"};}function avatarInitialsStyle(){return{width:"100%",height:"100%",color:"var(--avatar-fg-color)",alignItems:"center",justifyContent:"center",textTransform:"uppercase",textAlign:"center",borderRadius:"50%","&:not([hidden])":{display:"flex"}};}function avatarBgStrokeStyle(){return{strokeWidth:"4px",stroke:"var(--card-bg-color)"};}function avatarStrokeStyle(){return{strokeWidth:"2px",stroke:"var(--avatar-bg-color)",'[data-status="editing"] &':{strokeDasharray:"2 4",strokeLinecap:"round"}};}const StyledAvatar=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatar",componentId:"sc-1rj7kl0-0"})(responsiveAvatarSizeStyle,avatarStyle.root),Arrow$1=/* @__PURE__ */styled.div.withConfig({displayName:"Arrow",componentId:"sc-1rj7kl0-1"})(avatarStyle.arrow),BgStroke=/* @__PURE__ */styled.ellipse.withConfig({displayName:"BgStroke",componentId:"sc-1rj7kl0-2"})(avatarStyle.bgStroke),Stroke=/* @__PURE__ */styled.ellipse.withConfig({displayName:"Stroke",componentId:"sc-1rj7kl0-3"})(avatarStyle.stroke),Initials=/* @__PURE__ */styled.div.withConfig({displayName:"Initials",componentId:"sc-1rj7kl0-4"})(avatarStyle.initials),InitialsLabel=/* @__PURE__ */styled(Label).withConfig({displayName:"InitialsLabel",componentId:"sc-1rj7kl0-5"})({color:"inherit"}),AvatarImage=/* @__PURE__ */styled.svg.withConfig({displayName:"AvatarImage",componentId:"sc-1rj7kl0-6"})(avatarStyle.image),Avatar=forwardRef(function(props,ref){var _props3;const $=dist.c(46);let __unstable_hideInnerStroke,animateArrowFrom,arrowPositionProp,asProp,initials,onImageLoadError,restProps,src,t0,t1,t2,title;$[0]!==props?(_props3=props,{__unstable_hideInnerStroke,as:asProp,color:t0,src,title,initials,onImageLoadError,arrowPosition:arrowPositionProp,animateArrowFrom,status:t1,size:t2}=_props3,restProps=_objectWithoutProperties(_props3,_excluded16),_props3,$[0]=props,$[1]=__unstable_hideInnerStroke,$[2]=animateArrowFrom,$[3]=arrowPositionProp,$[4]=asProp,$[5]=initials,$[6]=onImageLoadError,$[7]=restProps,$[8]=src,$[9]=t0,$[10]=t1,$[11]=t2,$[12]=title):(__unstable_hideInnerStroke=$[1],animateArrowFrom=$[2],arrowPositionProp=$[3],asProp=$[4],initials=$[5],onImageLoadError=$[6],restProps=$[7],src=$[8],t0=$[9],t1=$[10],t2=$[11],title=$[12]);const color=t0===void 0?"gray":t0,status=t1===void 0?"online":t1,sizeProp=t2===void 0?1:t2,{avatar}=useTheme_v2(),as=ReactIs.isValidElementType(asProp)?asProp:"div",size2=_getArrayProp(sizeProp),_sizeRem=(avatar.sizes[size2[0]]||avatar.sizes[0]).size,_radius=_sizeRem/2,elementId=useId(),[arrowPosition,setArrowPosition]=useState(animateArrowFrom||arrowPositionProp||"inside"),[imageFailed,setImageFailed]=useState(!1),imageId="avatar-image-".concat(elementId);let t3,t4;$[13]!==arrowPosition||$[14]!==arrowPositionProp?(t3=()=>{if(arrowPosition===arrowPositionProp)return;const raf=requestAnimationFrame(()=>setArrowPosition(arrowPositionProp));return()=>cancelAnimationFrame(raf);},t4=[arrowPosition,arrowPositionProp],$[13]=arrowPosition,$[14]=arrowPositionProp,$[15]=t3,$[16]=t4):(t3=$[15],t4=$[16]),useEffect$1(t3,t4);let t5,t6;$[17]!==src?(t5=()=>{src&&setImageFailed(!1);},t6=[src],$[17]=src,$[18]=t5,$[19]=t6):(t5=$[18],t6=$[19]),useEffect$1(t5,t6);let t7;$[20]!==onImageLoadError?(t7=()=>{setImageFailed(!0),onImageLoadError&&onImageLoadError(new Error("Avatar: the image failed to load"));},$[20]=onImageLoadError,$[21]=t7):t7=$[21];const handleImageError=t7,T0=StyledAvatar,t8=typeof as=="string"?as:void 0,t9="Avatar";let t10;$[22]!==color?(t10=/* @__PURE__ */jsx(Arrow$1,{children:/* @__PURE__ */jsx("svg",{width:"11",height:"7",viewBox:"0 0 11 7",fill:"none",children:/* @__PURE__ */jsx("path",{d:"M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z",fill:color})})}),$[22]=color,$[23]=t10):t10=$[23];let t11;$[24]!==__unstable_hideInnerStroke||$[25]!==_radius||$[26]!==_sizeRem||$[27]!==handleImageError||$[28]!==imageFailed||$[29]!==imageId||$[30]!==src?(t11=!imageFailed&&src&&/* @__PURE__ */jsxs(AvatarImage,{viewBox:"0 0 ".concat(_sizeRem," ").concat(_sizeRem),fill:"none",children:[/* @__PURE__ */jsx("defs",{children:/* @__PURE__ */jsx("pattern",{id:imageId,patternContentUnits:"objectBoundingBox",width:"1",height:"1",children:/* @__PURE__ */jsx("image",{href:src,width:"1",height:"1",onError:handleImageError})})}),/* @__PURE__ */jsx("circle",{cx:_radius,cy:_radius,r:_radius,fill:"url(#".concat(imageId,")")}),!__unstable_hideInnerStroke&&/* @__PURE__ */jsx(BgStroke,{cx:_radius,cy:_radius,rx:_radius,ry:_radius,vectorEffect:"non-scaling-stroke"}),/* @__PURE__ */jsx(Stroke,{cx:_radius,cy:_radius,rx:_radius,ry:_radius,vectorEffect:"non-scaling-stroke"})]}),$[24]=__unstable_hideInnerStroke,$[25]=_radius,$[26]=_sizeRem,$[27]=handleImageError,$[28]=imageFailed,$[29]=imageId,$[30]=src,$[31]=t11):t11=$[31];const t12=(imageFailed||!src)&&initials&&/* @__PURE__ */jsx(Fragment,{children:/* @__PURE__ */jsx(Initials,{children:/* @__PURE__ */jsx(InitialsLabel,{forwardedAs:"span",size:size2.map(_temp$a),weight:"medium",children:initials})})});let t13;return $[32]!==T0||$[33]!==arrowPosition||$[34]!==as||$[35]!==color||$[36]!==ref||$[37]!==restProps||$[38]!==size2||$[39]!==status||$[40]!==t10||$[41]!==t11||$[42]!==t12||$[43]!==t8||$[44]!==title?(t13=/* @__PURE__ */jsxs(T0,_objectSpread(_objectSpread({as,"data-as":t8,"data-ui":t9},restProps),{},{$color:color,$size:size2,"aria-label":title,"data-arrow-position":arrowPosition,"data-status":status,ref,title,children:[t10,t11,t12]})),$[32]=T0,$[33]=arrowPosition,$[34]=as,$[35]=color,$[36]=ref,$[37]=restProps,$[38]=size2,$[39]=status,$[40]=t10,$[41]=t11,$[42]=t12,$[43]=t8,$[44]=title,$[45]=t13):t13=$[45],t13;});Avatar.displayName="ForwardRef(Avatar)";function _temp$a(s){return s===1?1:s===2?3:s===3?5:0;}function _responsiveAvatarCounterSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2];return avatarSize?{borderRadius:rem(avatarSize.size/2),minWidth:rem(avatarSize.size),height:rem(avatarSize.size)}:EMPTY_RECORD;});}function _avatarCounterBaseStyle(props){const{space}=getTheme_v2(props.theme);return css(_templateObject8||(_templateObject8=_taggedTemplateLiteral(["\n align-items: center;\n justify-content: center;\n box-sizing: border-box;\n user-select: none;\n color: inherit;\n color: var(--card-fg-color);\n background: var(--card-bg-color);\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n inset 0 0 0 1px var(--card-hairline-hard-color);\n padding: 0 ",";\n\n &:not([hidden]) {\n display: flex;\n }\n "])),rem(space[2]));}const StyledAvatarCounter=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatarCounter",componentId:"sc-1ydx86y-0"})(_responsiveAvatarCounterSizeStyle,_avatarCounterBaseStyle),AvatarCounter=forwardRef(function(props,ref){const $=dist.c(20),{count,size:t0}=props,sizeProp=t0===void 0?1:t0;let T0,T1,t1,t2,t3,t4,t5;if($[0]!==ref||$[1]!==sizeProp){const size2=_getArrayProp(sizeProp);T1=StyledAvatarCounter,t3=size2,t4="AvatarCounter",t5=ref,T0=Label,t1="span",t2=size2.map(_temp$9),$[0]=ref,$[1]=sizeProp,$[2]=T0,$[3]=T1,$[4]=t1,$[5]=t2,$[6]=t3,$[7]=t4,$[8]=t5;}else T0=$[2],T1=$[3],t1=$[4],t2=$[5],t3=$[6],t4=$[7],t5=$[8];let t6;$[9]!==T0||$[10]!==count||$[11]!==t1||$[12]!==t2?(t6=/* @__PURE__ */jsx(T0,{as:t1,size:t2,weight:"medium",children:count}),$[9]=T0,$[10]=count,$[11]=t1,$[12]=t2,$[13]=t6):t6=$[13];let t7;return $[14]!==T1||$[15]!==t3||$[16]!==t4||$[17]!==t5||$[18]!==t6?(t7=/* @__PURE__ */jsx(T1,{$size:t3,"data-ui":t4,ref:t5,children:t6}),$[14]=T1,$[15]=t3,$[16]=t4,$[17]=t5,$[18]=t6,$[19]=t7):t7=$[19],t7;});AvatarCounter.displayName="ForwardRef(AvatarCounter)";function _temp$9(s){return s===1?1:s===2?3:s===3?5:0;}const BASE_STYLES=css(_templateObject9||(_templateObject9=_taggedTemplateLiteral(["\n white-space: nowrap;\n\n & > div {\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n }\n"])));function avatarStackStyle(){return BASE_STYLES;}function responsiveAvatarStackSizeStyle(props){const{avatar,media}=getTheme_v2(props.theme);return _responsive(media,props.$size,size2=>{const avatarSize=avatar.sizes[size2];return avatarSize?{"& > div + div":{marginLeft:rem(avatarSize.distance)}}:EMPTY_RECORD;});}const StyledAvatarStack=/* @__PURE__ */styled.div.withConfig({displayName:"StyledAvatarStack",componentId:"sc-cysmbb-0"})(responsiveAvatarStackSizeStyle,avatarStackStyle),AvatarStack=forwardRef(function(props,ref){var _props4;const $=dist.c(38);let childrenProp,restProps,t0,t1;$[0]!==props?(_props4=props,{children:childrenProp,maxLength:t0,size:t1}=_props4,restProps=_objectWithoutProperties(_props4,_excluded17),_props4,$[0]=props,$[1]=childrenProp,$[2]=restProps,$[3]=t0,$[4]=t1):(childrenProp=$[1],restProps=$[2],t0=$[3],t1=$[4]);const maxLengthProp=t0===void 0?4:t0,sizeProp=t1===void 0?1:t1;let T0,t2,t3,t4,t5,t6,t7,t8;if($[5]!==childrenProp||$[6]!==maxLengthProp||$[7]!==ref||$[8]!==restProps||$[9]!==sizeProp){const children=Children.toArray(childrenProp).filter(isValidElement$1),maxLength=Math.max(maxLengthProp,0);let t92;$[18]!==sizeProp?(t92=_getArrayProp(sizeProp),$[18]=sizeProp,$[19]=t92):t92=$[19];const size2=t92,len=children.length,visibleCount=maxLength-1,extraCount=len-visibleCount,visibleChildren=extraCount>1?children.slice(extraCount,len):children;T0=StyledAvatarStack,t2="AvatarStack",t3=restProps,t4=ref,t5=size2,$[20]!==len||$[21]!==size2?(t6=len===0&&/* @__PURE__ */jsx("div",{children:/* @__PURE__ */jsx(AvatarCounter,{count:len,size:size2})}),$[20]=len,$[21]=size2,$[22]=t6):t6=$[22],$[23]!==extraCount||$[24]!==len||$[25]!==size2?(t7=len!==0&&extraCount>1&&/* @__PURE__ */jsx("div",{children:/* @__PURE__ */jsx(AvatarCounter,{count:extraCount,size:size2})}),$[23]=extraCount,$[24]=len,$[25]=size2,$[26]=t7):t7=$[26];let t10;$[27]!==size2?(t10=(child,childIndex)=>/* @__PURE__ */jsx("div",{children:cloneElement(child,{size:size2})},String(childIndex)),$[27]=size2,$[28]=t10):t10=$[28],t8=visibleChildren.map(t10),$[5]=childrenProp,$[6]=maxLengthProp,$[7]=ref,$[8]=restProps,$[9]=sizeProp,$[10]=T0,$[11]=t2,$[12]=t3,$[13]=t4,$[14]=t5,$[15]=t6,$[16]=t7,$[17]=t8;}else T0=$[10],t2=$[11],t3=$[12],t4=$[13],t5=$[14],t6=$[15],t7=$[16],t8=$[17];let t9;return $[29]!==T0||$[30]!==t2||$[31]!==t3||$[32]!==t4||$[33]!==t5||$[34]!==t6||$[35]!==t7||$[36]!==t8?(t9=/* @__PURE__ */jsxs(T0,_objectSpread(_objectSpread({"data-ui":t2},t3),{},{ref:t4,$size:t5,children:[t6,t7,t8]})),$[29]=T0,$[30]=t2,$[31]=t3,$[32]=t4,$[33]=t5,$[34]=t6,$[35]=t7,$[36]=t8,$[37]=t9):t9=$[37],t9;});AvatarStack.displayName="ForwardRef(AvatarStack)";const StyledBox=/* @__PURE__ */styled.div.withConfig({displayName:"StyledBox",componentId:"sc-1hhky9f-0"})(boxStyle,flexItemStyle,responsiveBoxStyle,responsiveGridItemStyle,responsiveMarginStyle,responsivePaddingStyle),Box=forwardRef(function(props,ref){var _props5;const $=dist.c(109);let column,columnEnd,columnStart,flex,height,marginBottom,marginLeft,marginRight,marginTop,marginX,marginY,overflow,paddingBottom,paddingLeft,paddingRight,paddingTop,paddingX,paddingY,restProps,row,rowEnd,rowStart,sizing,t0,t1,t2,t3;$[0]!==props?(_props5=props,{as:t0,column,columnStart,columnEnd,display:t1,flex,height,margin:t2,marginX,marginY,marginTop,marginRight,marginBottom,marginLeft,overflow,padding:t3,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft,row,rowStart,rowEnd,sizing}=_props5,restProps=_objectWithoutProperties(_props5,_excluded18),_props5,$[0]=props,$[1]=column,$[2]=columnEnd,$[3]=columnStart,$[4]=flex,$[5]=height,$[6]=marginBottom,$[7]=marginLeft,$[8]=marginRight,$[9]=marginTop,$[10]=marginX,$[11]=marginY,$[12]=overflow,$[13]=paddingBottom,$[14]=paddingLeft,$[15]=paddingRight,$[16]=paddingTop,$[17]=paddingX,$[18]=paddingY,$[19]=restProps,$[20]=row,$[21]=rowEnd,$[22]=rowStart,$[23]=sizing,$[24]=t0,$[25]=t1,$[26]=t2,$[27]=t3):(column=$[1],columnEnd=$[2],columnStart=$[3],flex=$[4],height=$[5],marginBottom=$[6],marginLeft=$[7],marginRight=$[8],marginTop=$[9],marginX=$[10],marginY=$[11],overflow=$[12],paddingBottom=$[13],paddingLeft=$[14],paddingRight=$[15],paddingTop=$[16],paddingX=$[17],paddingY=$[18],restProps=$[19],row=$[20],rowEnd=$[21],rowStart=$[22],sizing=$[23],t0=$[24],t1=$[25],t2=$[26],t3=$[27]);const asProp=t0===void 0?"div":t0,display=t1===void 0?"block":t1,margin=t2===void 0?0:t2,padding=t3===void 0?0:t3,t4=typeof asProp=="string"?asProp:void 0;let t5;$[28]!==column?(t5=_getArrayProp(column),$[28]=column,$[29]=t5):t5=$[29];let t6;$[30]!==columnStart?(t6=_getArrayProp(columnStart),$[30]=columnStart,$[31]=t6):t6=$[31];let t7;$[32]!==columnEnd?(t7=_getArrayProp(columnEnd),$[32]=columnEnd,$[33]=t7):t7=$[33];let t8;$[34]!==display?(t8=_getArrayProp(display),$[34]=display,$[35]=t8):t8=$[35];let t9;$[36]!==flex?(t9=_getArrayProp(flex),$[36]=flex,$[37]=t9):t9=$[37];let t10;$[38]!==height?(t10=_getArrayProp(height),$[38]=height,$[39]=t10):t10=$[39];let t11;$[40]!==margin?(t11=_getArrayProp(margin),$[40]=margin,$[41]=t11):t11=$[41];let t12;$[42]!==marginX?(t12=_getArrayProp(marginX),$[42]=marginX,$[43]=t12):t12=$[43];let t13;$[44]!==marginY?(t13=_getArrayProp(marginY),$[44]=marginY,$[45]=t13):t13=$[45];let t14;$[46]!==marginTop?(t14=_getArrayProp(marginTop),$[46]=marginTop,$[47]=t14):t14=$[47];let t15;$[48]!==marginRight?(t15=_getArrayProp(marginRight),$[48]=marginRight,$[49]=t15):t15=$[49];let t16;$[50]!==marginBottom?(t16=_getArrayProp(marginBottom),$[50]=marginBottom,$[51]=t16):t16=$[51];let t17;$[52]!==marginLeft?(t17=_getArrayProp(marginLeft),$[52]=marginLeft,$[53]=t17):t17=$[53];let t18;$[54]!==overflow?(t18=_getArrayProp(overflow),$[54]=overflow,$[55]=t18):t18=$[55];let t19;$[56]!==padding?(t19=_getArrayProp(padding),$[56]=padding,$[57]=t19):t19=$[57];let t20;$[58]!==paddingX?(t20=_getArrayProp(paddingX),$[58]=paddingX,$[59]=t20):t20=$[59];let t21;$[60]!==paddingY?(t21=_getArrayProp(paddingY),$[60]=paddingY,$[61]=t21):t21=$[61];let t22;$[62]!==paddingTop?(t22=_getArrayProp(paddingTop),$[62]=paddingTop,$[63]=t22):t22=$[63];let t23;$[64]!==paddingRight?(t23=_getArrayProp(paddingRight),$[64]=paddingRight,$[65]=t23):t23=$[65];let t24;$[66]!==paddingBottom?(t24=_getArrayProp(paddingBottom),$[66]=paddingBottom,$[67]=t24):t24=$[67];let t25;$[68]!==paddingLeft?(t25=_getArrayProp(paddingLeft),$[68]=paddingLeft,$[69]=t25):t25=$[69];let t26;$[70]!==row?(t26=_getArrayProp(row),$[70]=row,$[71]=t26):t26=$[71];let t27;$[72]!==rowStart?(t27=_getArrayProp(rowStart),$[72]=rowStart,$[73]=t27):t27=$[73];let t28;$[74]!==rowEnd?(t28=_getArrayProp(rowEnd),$[74]=rowEnd,$[75]=t28):t28=$[75];let t29;$[76]!==sizing?(t29=_getArrayProp(sizing),$[76]=sizing,$[77]=t29):t29=$[77];let t30;return $[78]!==asProp||$[79]!==props.children||$[80]!==ref||$[81]!==restProps||$[82]!==t10||$[83]!==t11||$[84]!==t12||$[85]!==t13||$[86]!==t14||$[87]!==t15||$[88]!==t16||$[89]!==t17||$[90]!==t18||$[91]!==t19||$[92]!==t20||$[93]!==t21||$[94]!==t22||$[95]!==t23||$[96]!==t24||$[97]!==t25||$[98]!==t26||$[99]!==t27||$[100]!==t28||$[101]!==t29||$[102]!==t4||$[103]!==t5||$[104]!==t6||$[105]!==t7||$[106]!==t8||$[107]!==t9?(t30=/* @__PURE__ */jsx(StyledBox,_objectSpread(_objectSpread({"data-as":t4,"data-ui":"Box"},restProps),{},{$column:t5,$columnStart:t6,$columnEnd:t7,$display:t8,$flex:t9,$height:t10,$margin:t11,$marginX:t12,$marginY:t13,$marginTop:t14,$marginRight:t15,$marginBottom:t16,$marginLeft:t17,$overflow:t18,$padding:t19,$paddingX:t20,$paddingY:t21,$paddingTop:t22,$paddingRight:t23,$paddingBottom:t24,$paddingLeft:t25,$row:t26,$rowStart:t27,$rowEnd:t28,$sizing:t29,as:asProp,ref,children:props.children})),$[78]=asProp,$[79]=props.children,$[80]=ref,$[81]=restProps,$[82]=t10,$[83]=t11,$[84]=t12,$[85]=t13,$[86]=t14,$[87]=t15,$[88]=t16,$[89]=t17,$[90]=t18,$[91]=t19,$[92]=t20,$[93]=t21,$[94]=t22,$[95]=t23,$[96]=t24,$[97]=t25,$[98]=t26,$[99]=t27,$[100]=t28,$[101]=t29,$[102]=t4,$[103]=t5,$[104]=t6,$[105]=t7,$[106]=t8,$[107]=t9,$[108]=t30):t30=$[108],t30;});Box.displayName="ForwardRef(Box)";function textBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject0||(_templateObject0=_taggedTemplateLiteral(["\n color: var(--card-fg-color);\n\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n background-color: var(--card-code-bg-color);\n color: var(--card-code-fg-color);\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ",";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n color: var(--card-icon-color);\n\n & path {\n vector-effect: non-scaling-stroke !important;\n }\n }\n "])),$accent&&css(_templateObject1||(_templateObject1=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject10||(_templateObject10=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family,font.text.weights.bold);}const StyledText=/* @__PURE__ */styled.div.withConfig({displayName:"StyledText",componentId:"sc-11ov82j-0"})(responsiveTextFont,responsiveTextAlignStyle,textBaseStyle),Text=forwardRef(function(props,ref){var _props6;const $=dist.c(26);let align,childrenProp,restProps,t0,t1,t2,textOverflow,weight;$[0]!==props?(_props6=props,{accent:t0,align,children:childrenProp,muted:t1,size:t2,textOverflow,weight}=_props6,restProps=_objectWithoutProperties(_props6,_excluded19),_props6,$[0]=props,$[1]=align,$[2]=childrenProp,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=textOverflow,$[8]=weight):(align=$[1],childrenProp=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],textOverflow=$[7],weight=$[8]);const accent=t0===void 0?!1:t0,muted=t1===void 0?!1:t1,size2=t2===void 0?2:t2;let children=childrenProp;if(textOverflow==="ellipsis"){let t32;$[9]!==children?(t32=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t32):t32=$[10],children=t32;}let t3;$[11]!==align?(t3=_getArrayProp(align),$[11]=align,$[12]=t3):t3=$[12];let t4;$[13]!==size2?(t4=_getArrayProp(size2),$[13]=size2,$[14]=t4):t4=$[14];let t5;$[15]!==children?(t5=/* @__PURE__ */jsx("span",{children}),$[15]=children,$[16]=t5):t5=$[16];let t6;return $[17]!==accent||$[18]!==muted||$[19]!==ref||$[20]!==restProps||$[21]!==t3||$[22]!==t4||$[23]!==t5||$[24]!==weight?(t6=/* @__PURE__ */jsx(StyledText,_objectSpread(_objectSpread({"data-ui":"Text"},restProps),{},{$accent:accent,$align:t3,$muted:muted,ref,$size:t4,$weight:weight,children:t5})),$[17]=accent,$[18]=muted,$[19]=ref,$[20]=restProps,$[21]=t3,$[22]=t4,$[23]=t5,$[24]=weight,$[25]=t6):t6=$[25],t6;});Text.displayName="ForwardRef(Text)";function badgeStyle(props){const{$tone}=props;return{"--card-bg-color":"var(--card-badge-".concat($tone,"-bg-color)"),"--card-fg-color":"var(--card-badge-".concat($tone,"-fg-color)"),backgroundColor:"var(--card-bg-color)",cursor:"default","&:not([hidden])":{display:"inline-block",verticalAlign:"top"}};}const StyledBadge=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledBadge",componentId:"sc-5u140l-0"})(responsiveRadiusStyle,badgeStyle),Badge=forwardRef(function(props,ref){const $=dist.c(21);let children,restProps,t0,t1,t2,t3;if($[0]!==props){const{children:t42,fontSize:t52,mode:_deprecated_mode,padding:t62,radius:t72,tone:t8}=props,t9=_objectWithoutProperties(props,_excluded20);children=t42,t0=t52,t1=t62,t2=t72,t3=t8,restProps=t9,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0,$[4]=t1,$[5]=t2,$[6]=t3;}else children=$[1],restProps=$[2],t0=$[3],t1=$[4],t2=$[5],t3=$[6];const fontSize2=t0===void 0?1:t0,padding=t1===void 0?1:t1,radius=t2===void 0?"full":t2,tone=t3===void 0?"default":t3;let t4;$[7]!==radius?(t4=_getArrayProp(radius),$[7]=radius,$[8]=t4):t4=$[8];let t5;$[9]!==padding?(t5=_getArrayProp(padding),$[9]=padding,$[10]=t5):t5=$[10];let t6;$[11]!==children||$[12]!==fontSize2?(t6=/* @__PURE__ */jsx(Text,{size:fontSize2,children}),$[11]=children,$[12]=fontSize2,$[13]=t6):t6=$[13];let t7;return $[14]!==ref||$[15]!==restProps||$[16]!==t4||$[17]!==t5||$[18]!==t6||$[19]!==tone?(t7=/* @__PURE__ */jsx(StyledBadge,_objectSpread(_objectSpread({"data-ui":"Badge"},restProps),{},{$tone:tone,$radius:t4,padding:t5,ref,children:t6})),$[14]=ref,$[15]=restProps,$[16]=t4,$[17]=t5,$[18]=t6,$[19]=tone,$[20]=t7):t7=$[20],t7;});Badge.displayName="ForwardRef(Badge)";const StyledFlex=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledFlex",componentId:"sc-oxesg3-0"})(flexItemStyle,responsiveFlexStyle),Flex=forwardRef(function(props,ref){var _props7;const $=dist.c(27);let align,as,gap,justify,restProps,t0,wrap;$[0]!==props?(_props7=props,{align,as,direction:t0,gap,justify,wrap}=_props7,restProps=_objectWithoutProperties(_props7,_excluded21),_props7,$[0]=props,$[1]=align,$[2]=as,$[3]=gap,$[4]=justify,$[5]=restProps,$[6]=t0,$[7]=wrap):(align=$[1],as=$[2],gap=$[3],justify=$[4],restProps=$[5],t0=$[6],wrap=$[7]);const direction=t0===void 0?"row":t0;let t1;$[8]!==align?(t1=_getArrayProp(align),$[8]=align,$[9]=t1):t1=$[9];let t2;$[10]!==direction?(t2=_getArrayProp(direction),$[10]=direction,$[11]=t2):t2=$[11];let t3;$[12]!==gap?(t3=_getArrayProp(gap),$[12]=gap,$[13]=t3):t3=$[13];let t4;$[14]!==justify?(t4=_getArrayProp(justify),$[14]=justify,$[15]=t4):t4=$[15];let t5;$[16]!==wrap?(t5=_getArrayProp(wrap),$[16]=wrap,$[17]=t5):t5=$[17];let t6;return $[18]!==as||$[19]!==ref||$[20]!==restProps||$[21]!==t1||$[22]!==t2||$[23]!==t3||$[24]!==t4||$[25]!==t5?(t6=/* @__PURE__ */jsx(StyledFlex,_objectSpread(_objectSpread({"data-ui":"Flex"},restProps),{},{$align:t1,$direction:t2,$gap:t3,$justify:t4,$wrap:t5,forwardedAs:as,ref})),$[18]=as,$[19]=ref,$[20]=restProps,$[21]=t1,$[22]=t2,$[23]=t3,$[24]=t4,$[25]=t5,$[26]=t6):t6=$[26],t6;});Flex.displayName="ForwardRef(Flex)";const rotate$1=keyframes$1(_templateObject11||(_templateObject11=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"]))),StyledSpinner=styled(Text).withConfig({displayName:"StyledSpinner",componentId:"sc-124hnd0-0"})(_templateObject12||(_templateObject12=_taggedTemplateLiteral(["& > span > svg{animation:"," 500ms linear infinite;}"])),rotate$1),Spinner=forwardRef(function(props,ref){const $=dist.c(4);let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=/* @__PURE__ */jsx(SpinnerIcon,{}),$[0]=t0):t0=$[0];let t1;return $[1]!==props||$[2]!==ref?(t1=/* @__PURE__ */jsx(StyledSpinner,_objectSpread(_objectSpread({"data-ui":"Spinner"},props),{},{ref,children:t0})),$[1]=props,$[2]=ref,$[3]=t1):t1=$[3],t1;});Spinner.displayName="ForwardRef(Spinner)";function _cardColorStyle(base,color){var _color$badge$neutral,_color$badge$neutral2,_color$badge$neutral3,_color$badge$neutral4,_color$badge$suggest,_color$badge$suggest2,_color$badge$suggest3,_color$badge$suggest4;let checkered=arguments.length>2&&arguments[2]!==undefined?arguments[2]:!1;return{// from base
|
|
2293
2333
|
"--card-backdrop-color":base.backdrop,"--card-focus-ring-color":base.focusRing,"--card-shadow-outline-color":base.shadow.outline,"--card-shadow-umbra-color":base.shadow.umbra,"--card-shadow-penumbra-color":base.shadow.penumbra,"--card-shadow-ambient-color":base.shadow.ambient,// from state
|
|
2294
2334
|
"--card-accent-fg-color":color.accent.fg,"--card-avatar-gray-bg-color":color.avatar.gray.bg,"--card-avatar-gray-fg-color":color.avatar.gray.fg,"--card-avatar-blue-bg-color":color.avatar.blue.bg,"--card-avatar-blue-fg-color":color.avatar.blue.fg,"--card-avatar-purple-bg-color":color.avatar.purple.bg,"--card-avatar-purple-fg-color":color.avatar.purple.fg,"--card-avatar-magenta-bg-color":color.avatar.magenta.bg,"--card-avatar-magenta-fg-color":color.avatar.magenta.fg,"--card-avatar-red-bg-color":color.avatar.red.bg,"--card-avatar-red-fg-color":color.avatar.red.fg,"--card-avatar-orange-bg-color":color.avatar.orange.bg,"--card-avatar-orange-fg-color":color.avatar.orange.fg,"--card-avatar-yellow-bg-color":color.avatar.yellow.bg,"--card-avatar-yellow-fg-color":color.avatar.yellow.fg,"--card-avatar-green-bg-color":color.avatar.green.bg,"--card-avatar-green-fg-color":color.avatar.green.fg,"--card-avatar-cyan-bg-color":color.avatar.cyan.bg,"--card-avatar-cyan-fg-color":color.avatar.cyan.fg,"--card-bg-color":color.bg,"--card-bg-image":checkered?"repeating-conic-gradient(".concat(color.bg," 0% 25%, ").concat(color.muted.bg," 0% 50%)"):void 0,"--card-border-color":color.border,"--card-badge-default-bg-color":color.badge.default.bg,"--card-badge-default-dot-color":color.badge.default.dot,"--card-badge-default-fg-color":color.badge.default.fg,"--card-badge-default-icon-color":color.badge.default.icon,"--card-badge-neutral-bg-color":(_color$badge$neutral=color.badge.neutral)===null||_color$badge$neutral===void 0?void 0:_color$badge$neutral.bg,"--card-badge-neutral-dot-color":(_color$badge$neutral2=color.badge.neutral)===null||_color$badge$neutral2===void 0?void 0:_color$badge$neutral2.dot,"--card-badge-neutral-fg-color":(_color$badge$neutral3=color.badge.neutral)===null||_color$badge$neutral3===void 0?void 0:_color$badge$neutral3.fg,"--card-badge-neutral-icon-color":(_color$badge$neutral4=color.badge.neutral)===null||_color$badge$neutral4===void 0?void 0:_color$badge$neutral4.icon,"--card-badge-primary-bg-color":color.badge.primary.bg,"--card-badge-primary-dot-color":color.badge.primary.dot,"--card-badge-primary-fg-color":color.badge.primary.fg,"--card-badge-primary-icon-color":color.badge.primary.icon,"--card-badge-suggest-bg-color":(_color$badge$suggest=color.badge.suggest)===null||_color$badge$suggest===void 0?void 0:_color$badge$suggest.bg,"--card-badge-suggest-dot-color":(_color$badge$suggest2=color.badge.suggest)===null||_color$badge$suggest2===void 0?void 0:_color$badge$suggest2.dot,"--card-badge-suggest-fg-color":(_color$badge$suggest3=color.badge.suggest)===null||_color$badge$suggest3===void 0?void 0:_color$badge$suggest3.fg,"--card-badge-suggest-icon-color":(_color$badge$suggest4=color.badge.suggest)===null||_color$badge$suggest4===void 0?void 0:_color$badge$suggest4.icon,"--card-badge-positive-bg-color":color.badge.positive.bg,"--card-badge-positive-dot-color":color.badge.positive.dot,"--card-badge-positive-fg-color":color.badge.positive.fg,"--card-badge-positive-icon-color":color.badge.positive.icon,"--card-badge-caution-bg-color":color.badge.caution.bg,"--card-badge-caution-dot-color":color.badge.caution.dot,"--card-badge-caution-fg-color":color.badge.caution.fg,"--card-badge-caution-icon-color":color.badge.caution.icon,"--card-badge-critical-bg-color":color.badge.critical.bg,"--card-badge-critical-dot-color":color.badge.critical.dot,"--card-badge-critical-fg-color":color.badge.critical.fg,"--card-badge-critical-icon-color":color.badge.critical.icon,"--card-code-bg-color":color.code.bg,"--card-code-fg-color":color.code.fg,"--card-fg-color":color.fg,"--card-icon-color":color.icon,"--card-kbd-bg-color":color.kbd.bg,"--card-kbd-border-color":color.kbd.border,"--card-kbd-fg-color":color.kbd.fg,"--card-link-fg-color":color.link.fg,"--card-muted-bg-color":color.muted.bg,"--card-muted-fg-color":color.muted.fg,"--card-skeleton-color-from":color.skeleton.from,"--card-skeleton-color-to":color.skeleton.to,// deprecated variables (kept for legacy)
|
|
2295
|
-
"--card-bg2-color":color.muted.bg,"--card-link-color":color.link.fg,"--card-hairline-soft-color":color.border,"--card-hairline-hard-color":color.border};}function buttonBaseStyles(props){const{$width}=props,{style}=getTheme_v2(props.theme);return css(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n ",";\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ","\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])),style===null||style===void 0?void 0:style.button,$width==="fill"&&css(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));}function combineBoxShadow(){for(var _len7=arguments.length,boxShadows=new Array(_len7),_key7=0;_key7<_len7;_key7++){boxShadows[_key7]=arguments[_key7];}return boxShadows.filter(Boolean).join(",");}function buttonColorStyles(props){var _style$button;const{$mode}=props,{button,color:baseColor,style}=getTheme_v2(props.theme),shadow=props.$mode==="ghost",mode=baseColor.button[$mode]||baseColor.button.default,color=mode[props.$tone]||mode.default,border2={width:button.border.width,color:"var(--card-border-color)"},defaultBoxShadow=void 0;return[_cardColorStyle(baseColor,color.enabled),{backgroundColor:"var(--card-bg-color)",color:"var(--card-fg-color)",boxShadow:focusRingBorderStyle(border2),'&:disabled, &[data-disabled="true"]':_cardColorStyle(baseColor,color.disabled),"&:not([data-disabled='true'])":{boxShadow:combineBoxShadow(focusRingBorderStyle(border2),shadow?defaultBoxShadow:void 0),"&:focus":{boxShadow:focusRingStyle({base:baseColor,border:{width:2,color:baseColor.bg},focusRing:button.focusRing})},"&:focus:not(:focus-visible)":{boxShadow:combineBoxShadow(focusRingBorderStyle(border2),shadow?defaultBoxShadow:void 0)},"@media (hover: hover)":{"&:hover":_cardColorStyle(baseColor,color.hovered),"&:active":_cardColorStyle(baseColor,color.pressed),"&[data-hovered]":_cardColorStyle(baseColor,color.hovered)},"&[data-selected]":_cardColorStyle(baseColor,color.pressed)}},style===null||style===void 0||(_style$button=style.button)===null||_style$button===void 0?void 0:_style$button.root].filter(Boolean);}const StyledButton=/* @__PURE__ */styled.button.withConfig({displayName:"StyledButton",componentId:"sc-aaekt4-0"})(responsiveRadiusStyle,buttonBaseStyles,buttonColorStyles),LoadingBox=styled.div.withConfig({displayName:"LoadingBox",componentId:"sc-aaekt4-1"})(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;"]))),Button=forwardRef(function(props,ref){var _props8;const $=dist.c(86);let IconComponent,IconRightComponent,children,disabled,loading,paddingBottomProp,paddingLeftProp,paddingRightProp,paddingTopProp,paddingXProp,paddingYProp,restProps,selected,t0,t1,t2,t3,t4,t5,t6,t7,t8,text,textAlign,textWeight,width;$[0]!==props?(_props8=props,{children,disabled,fontSize:t0,icon:IconComponent,iconRight:IconRightComponent,justify:t1,loading,mode:t2,padding:t3,paddingX:paddingXProp,paddingY:paddingYProp,paddingTop:paddingTopProp,paddingBottom:paddingBottomProp,paddingLeft:paddingLeftProp,paddingRight:paddingRightProp,radius:t4,selected,space:t5,text,textAlign,textWeight,tone:t6,type:t7,muted:t8,width}=_props8,restProps=_objectWithoutProperties(_props8,_excluded21),_props8,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=children,$[4]=disabled,$[5]=loading,$[6]=paddingBottomProp,$[7]=paddingLeftProp,$[8]=paddingRightProp,$[9]=paddingTopProp,$[10]=paddingXProp,$[11]=paddingYProp,$[12]=restProps,$[13]=selected,$[14]=t0,$[15]=t1,$[16]=t2,$[17]=t3,$[18]=t4,$[19]=t5,$[20]=t6,$[21]=t7,$[22]=t8,$[23]=text,$[24]=textAlign,$[25]=textWeight,$[26]=width):(IconComponent=$[1],IconRightComponent=$[2],children=$[3],disabled=$[4],loading=$[5],paddingBottomProp=$[6],paddingLeftProp=$[7],paddingRightProp=$[8],paddingTopProp=$[9],paddingXProp=$[10],paddingYProp=$[11],restProps=$[12],selected=$[13],t0=$[14],t1=$[15],t2=$[16],t3=$[17],t4=$[18],t5=$[19],t6=$[20],t7=$[21],t8=$[22],text=$[23],textAlign=$[24],textWeight=$[25],width=$[26]);const fontSize2=t0===void 0?1:t0,justifyProp=t1===void 0?"center":t1,mode=t2===void 0?"default":t2,paddingProp=t3===void 0?3:t3,radiusProp=t4===void 0?2:t4,spaceProp=t5===void 0?3:t5,tone=t6===void 0?"default":t6,type=t7===void 0?"button":t7,muted=t8===void 0?!1:t8,{button}=useTheme_v2();let t9;$[27]!==justifyProp?(t9=_getArrayProp(justifyProp),$[27]=justifyProp,$[28]=t9):t9=$[28];const justify=t9;let t10;$[29]!==paddingProp?(t10=_getArrayProp(paddingProp),$[29]=paddingProp,$[30]=t10):t10=$[30];const padding=t10;let t11;$[31]!==paddingXProp?(t11=_getArrayProp(paddingXProp),$[31]=paddingXProp,$[32]=t11):t11=$[32];const paddingX=t11;let t12;$[33]!==paddingYProp?(t12=_getArrayProp(paddingYProp),$[33]=paddingYProp,$[34]=t12):t12=$[34];const paddingY=t12;let t13;$[35]!==paddingTopProp?(t13=_getArrayProp(paddingTopProp),$[35]=paddingTopProp,$[36]=t13):t13=$[36];const paddingTop=t13;let t14;$[37]!==paddingBottomProp?(t14=_getArrayProp(paddingBottomProp),$[37]=paddingBottomProp,$[38]=t14):t14=$[38];const paddingBottom=t14;let t15;$[39]!==paddingLeftProp?(t15=_getArrayProp(paddingLeftProp),$[39]=paddingLeftProp,$[40]=t15):t15=$[40];const paddingLeft=t15;let t16;$[41]!==paddingRightProp?(t16=_getArrayProp(paddingRightProp),$[41]=paddingRightProp,$[42]=t16):t16=$[42];const paddingRight=t16;let t17;$[43]!==radiusProp?(t17=_getArrayProp(radiusProp),$[43]=radiusProp,$[44]=t17):t17=$[44];const radius=t17;let t18;$[45]!==spaceProp?(t18=_getArrayProp(spaceProp),$[45]=spaceProp,$[46]=t18):t18=$[46];const space=t18;let t19;$[47]!==padding||$[48]!==paddingBottom||$[49]!==paddingLeft||$[50]!==paddingRight||$[51]!==paddingTop||$[52]!==paddingX||$[53]!==paddingY?(t19={padding,paddingX,paddingY,paddingTop,paddingBottom,paddingLeft,paddingRight},$[47]=padding,$[48]=paddingBottom,$[49]=paddingLeft,$[50]=paddingRight,$[51]=paddingTop,$[52]=paddingX,$[53]=paddingY,$[54]=t19):t19=$[54];const boxProps=t19,t20=!!(loading||disabled),t21=selected?"":void 0,t22=!!(loading||disabled);let t23;$[55]!==loading?(t23=!!loading&&/* @__PURE__ */jsx(LoadingBox,{children:/* @__PURE__ */jsx(Spinner,{})}),$[55]=loading,$[56]=t23):t23=$[56];let t24;$[57]!==IconComponent||$[58]!==IconRightComponent||$[59]!==boxProps||$[60]!==button||$[61]!==fontSize2||$[62]!==justify||$[63]!==muted||$[64]!==space||$[65]!==text||$[66]!==textAlign||$[67]!==textWeight?(t24=(IconComponent||text||IconRightComponent)&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},boxProps),{},{children:/* @__PURE__ */jsxs(Flex,{as:"span",justify,gap:space,children:[IconComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]}),text&&/* @__PURE__ */jsx(Box,{children:/* @__PURE__ */jsx(Text,{muted,align:textAlign,size:fontSize2,textOverflow:"ellipsis",weight:textWeight!==null&&textWeight!==void 0?textWeight:button.textWeight,children:text})}),IconRightComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})]})})),$[57]=IconComponent,$[58]=IconRightComponent,$[59]=boxProps,$[60]=button,$[61]=fontSize2,$[62]=justify,$[63]=muted,$[64]=space,$[65]=text,$[66]=textAlign,$[67]=textWeight,$[68]=t24):t24=$[68];let t25;$[69]!==boxProps||$[70]!==children?(t25=children&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},boxProps),{},{children})),$[69]=boxProps,$[70]=children,$[71]=t25):t25=$[71];let t26;return $[72]!==mode||$[73]!==radius||$[74]!==ref||$[75]!==restProps||$[76]!==t20||$[77]!==t21||$[78]!==t22||$[79]!==t23||$[80]!==t24||$[81]!==t25||$[82]!==tone||$[83]!==type||$[84]!==width?(t26=/* @__PURE__ */jsxs(StyledButton,_objectSpread(_objectSpread({"data-ui":"Button"},restProps),{},{$mode:mode,$radius:radius,$tone:tone,"data-disabled":t20,"data-selected":t21,disabled:t22,ref,type,$width:width,children:[t23,t24,t25]})),$[72]=mode,$[73]=radius,$[74]=ref,$[75]=restProps,$[76]=t20,$[77]=t21,$[78]=t22,$[79]=t23,$[80]=t24,$[81]=t25,$[82]=tone,$[83]=type,$[84]=width,$[85]=t26):t26=$[85],t26;});Button.displayName="ForwardRef(Button)";function cardStyle(props){return[cardBaseStyle(props),cardColorStyle(props)];}function cardBaseStyle(props){const{$checkered}=props,{space}=getTheme_v2(props.theme);return css(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n ","\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])),$checkered&&css(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n background-size: ","px ","px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])),space[3],space[3]));}function cardColorStyle(props){var _style$card;const{$checkered,$focusRing,$muted}=props,{card,color,style}=getTheme_v2(props.theme),border2={width:card.border.width,color:"var(--card-border-color)"};return css(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["\n color-scheme: ",";\n\n ","\n\n background-color: ",";\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ","\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ",";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ","\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ",";\n }\n }\n }\n\n ","\n "])),color._dark?"dark":"light",_cardColorStyle(color,color,$checkered),$muted?"var(--card-muted-bg-color)":"var(--card-bg-color)",_cardColorStyle(color,color.selectable.default.disabled,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),_cardColorStyle(color,color.selectable.default.selected,$checkered),_cardColorStyle(color,color.selectable.default.hovered,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),$focusRing?focusRingStyle({base:color,border:border2,focusRing:card.focusRing}):void 0,_cardColorStyle(color,color.selectable.default.disabled,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),_cardColorStyle(color,color.selectable.default.selected,$checkered),_cardColorStyle(color,color.selectable.default.hovered,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),$focusRing?focusRingStyle({base:color,border:border2,focusRing:card.focusRing}):void 0,style===null||style===void 0||(_style$card=style.card)===null||_style$card===void 0?void 0:_style$card.root);}const StyledCard=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledCard",componentId:"sc-osnro2-0"})(responsiveBorderStyle,responsiveRadiusStyle,responsiveShadowStyle,cardStyle),Card=forwardRef(function(props,ref){var _props9;const $=dist.c(56);let asProp,border2,borderBottom2,borderLeft2,borderRight2,borderTop2,muted,pressed,restProps,scheme,selected,shadow,t0,t1,t2,t3;$[0]!==props?(_props9=props,{__unstable_checkered:t0,__unstable_focusRing:t1,as:asProp,border:border2,borderTop:borderTop2,borderRight:borderRight2,borderBottom:borderBottom2,borderLeft:borderLeft2,muted,pressed,radius:t2,scheme,selected,shadow,tone:t3}=_props9,restProps=_objectWithoutProperties(_props9,_excluded22),_props9,$[0]=props,$[1]=asProp,$[2]=border2,$[3]=borderBottom2,$[4]=borderLeft2,$[5]=borderRight2,$[6]=borderTop2,$[7]=muted,$[8]=pressed,$[9]=restProps,$[10]=scheme,$[11]=selected,$[12]=shadow,$[13]=t0,$[14]=t1,$[15]=t2,$[16]=t3):(asProp=$[1],border2=$[2],borderBottom2=$[3],borderLeft2=$[4],borderRight2=$[5],borderTop2=$[6],muted=$[7],pressed=$[8],restProps=$[9],scheme=$[10],selected=$[11],shadow=$[12],t0=$[13],t1=$[14],t2=$[15],t3=$[16]);const checkered=t0===void 0?!1:t0,focusRing=t1===void 0?!1:t1,radius=t2===void 0?0:t2,toneProp=t3===void 0?"default":t3,as=reactIsExports.isValidElementType(asProp)?asProp:"div",rootTheme=useRootTheme(),tone=toneProp==="inherit"?rootTheme.tone:toneProp,t4=typeof as=="string"?as:void 0,t5=rootTheme.scheme;let t6;$[17]!==border2?(t6=_getArrayProp(border2),$[17]=border2,$[18]=t6):t6=$[18];let t7;$[19]!==borderTop2?(t7=_getArrayProp(borderTop2),$[19]=borderTop2,$[20]=t7):t7=$[20];let t8;$[21]!==borderRight2?(t8=_getArrayProp(borderRight2),$[21]=borderRight2,$[22]=t8):t8=$[22];let t9;$[23]!==borderBottom2?(t9=_getArrayProp(borderBottom2),$[23]=borderBottom2,$[24]=t9):t9=$[24];let t10;$[25]!==borderLeft2?(t10=_getArrayProp(borderLeft2),$[25]=borderLeft2,$[26]=t10):t10=$[26];let t11;$[27]!==radius?(t11=_getArrayProp(radius),$[27]=radius,$[28]=t11):t11=$[28];let t12;$[29]!==shadow?(t12=_getArrayProp(shadow),$[29]=shadow,$[30]=t12):t12=$[30];const t13=checkered?"":void 0,t14=pressed?"":void 0,t15=selected?"":void 0;let t16;$[31]!==as||$[32]!==checkered||$[33]!==focusRing||$[34]!==muted||$[35]!==ref||$[36]!==restProps||$[37]!==rootTheme.scheme||$[38]!==selected||$[39]!==t10||$[40]!==t11||$[41]!==t12||$[42]!==t13||$[43]!==t14||$[44]!==t15||$[45]!==t4||$[46]!==t6||$[47]!==t7||$[48]!==t8||$[49]!==t9||$[50]!==tone?(t16=/* @__PURE__ */jsx(StyledCard,_objectSpread(_objectSpread({"data-as":t4,"data-scheme":t5,"data-ui":"Card","data-tone":tone},restProps),{},{$border:t6,$borderTop:t7,$borderRight:t8,$borderBottom:t9,$borderLeft:t10,$checkered:checkered,$focusRing:focusRing,$muted:muted,$radius:t11,$shadow:t12,$tone:tone,"data-checkered":t13,"data-pressed":t14,"data-selected":t15,forwardedAs:as,ref,selected})),$[31]=as,$[32]=checkered,$[33]=focusRing,$[34]=muted,$[35]=ref,$[36]=restProps,$[37]=rootTheme.scheme,$[38]=selected,$[39]=t10,$[40]=t11,$[41]=t12,$[42]=t13,$[43]=t14,$[44]=t15,$[45]=t4,$[46]=t6,$[47]=t7,$[48]=t8,$[49]=t9,$[50]=tone,$[51]=t16):t16=$[51];let t17;return $[52]!==scheme||$[53]!==t16||$[54]!==tone?(t17=/* @__PURE__ */jsx(ThemeColorProvider,{scheme,tone,children:t16}),$[52]=scheme,$[53]=t16,$[54]=tone,$[55]=t17):t17=$[55],t17;});Card.displayName="ForwardRef(Card)";function useClickOutsideEvent(listener,t0,boundaryElement){const $=dist.c(9),elementsArg=t0===void 0?_temp$8:t0;let t1;$[0]!==boundaryElement||$[1]!==elementsArg||$[2]!==listener?(t1=evt=>{if(!listener)return;const target=evt.target;if(!(target instanceof Node))return;const resolvedBoundaryElement=boundaryElement===null||boundaryElement===void 0?void 0:boundaryElement();if(resolvedBoundaryElement&&!resolvedBoundaryElement.contains(target))return;const elements=elementsArg().flat();for(const el of elements)if(el&&(target===el||el.contains(target)))return;listener(evt);},$[0]=boundaryElement,$[1]=elementsArg,$[2]=listener,$[3]=t1):t1=$[3];const onEvent=useEffectEvent(t1),hasListener=!!listener;let t2;$[4]!==hasListener||$[5]!==onEvent?(t2=()=>{if(!hasListener)return;const handleEvent=evt_0=>onEvent(evt_0);return document.addEventListener("mousedown",handleEvent),()=>{document.removeEventListener("mousedown",handleEvent);};},$[4]=hasListener,$[5]=onEvent,$[6]=t2):t2=$[6];let t3;$[7]!==hasListener?(t3=[hasListener],$[7]=hasListener,$[8]=t3):t3=$[8],useEffect$1(t2,t3),useDebugValue(listener?"MouseDown On":"MouseDown Off");}function _temp$8(){return EMPTY_ARRAY;}function useCustomValidity(ref,customValidity){const $=dist.c(4);let t0,t1;$[0]!==customValidity||$[1]!==ref?(t0=()=>{var _ref$current;(_ref$current=ref.current)===null||_ref$current===void 0||_ref$current.setCustomValidity(customValidity||"");},t1=[customValidity,ref],$[0]=customValidity,$[1]=ref,$[2]=t0,$[3]=t1):(t0=$[2],t1=$[3]),useEffect$1(t0,t1);}const _ResizeObserver=typeof document<"u"&&typeof window<"u"&&window.ResizeObserver?window.ResizeObserver:ResizeObserver$1,_elementSizeObserver=_createElementSizeObserver();function _createElementRectValueListener(){return{subscribe(element,subscriber){const resizeObserver=new _ResizeObserver(_ref69=>{let[entry]=_ref69;subscriber({_contentRect:entry.contentRect,border:{width:entry.borderBoxSize[0].inlineSize,height:entry.borderBoxSize[0].blockSize},content:{width:entry.contentRect.width,height:entry.contentRect.height}});});return resizeObserver.observe(element),()=>{resizeObserver.unobserve(element),resizeObserver.disconnect();};}};}function _createElementSizeObserver(){const disposeCache=/* @__PURE__ */new WeakMap(),subscribersCache=/* @__PURE__ */new WeakMap();return{subscribe(element,subscriber){const subscribers=subscribersCache.get(element)||[];let dispose=disposeCache.get(element);return subscribersCache.has(element)||(subscribersCache.set(element,subscribers),dispose=_createElementRectValueListener().subscribe(element,elementRect=>{for(const sub of subscribers)sub(elementRect);})),subscribers.push(subscriber),()=>{const idx=subscribers.indexOf(subscriber);idx>-1&&subscribers.splice(idx,1),subscribers.length===0&&dispose&&dispose();};}};}function useElementSize(element){const $=dist.c(3),[size2,setSize]=useState(null);let t0,t1;return $[0]!==element?(t0=()=>{if(element)return _elementSizeObserver.subscribe(element,setSize);},t1=[element],$[0]=element,$[1]=t0,$[2]=t1):(t0=$[1],t1=$[2]),useEffect$1(t0,t1),size2;}function useGlobalKeyDown(onKeyDown,options){const $=dist.c(7);let t0;$[0]!==onKeyDown?(t0=event=>onKeyDown(event),$[0]=onKeyDown,$[1]=t0):t0=$[1];const handleKeyDown=useEffectEvent(t0);let t1;$[2]!==handleKeyDown||$[3]!==options?(t1=()=>{const handler=event_0=>handleKeyDown(event_0);return window.addEventListener("keydown",handler,options),()=>window.removeEventListener("keydown",handler,options);},$[2]=handleKeyDown,$[3]=options,$[4]=t1):t1=$[4];let t2;$[5]!==options?(t2=[options],$[5]=options,$[6]=t2):t2=$[6],useEffect$1(t1,t2);}function useMatchMedia(mediaQueryString,getServerSnapshot2){const $=dist.c(4);useDebugValue(mediaQueryString);let t0;$[0]!==mediaQueryString?(t0=onStoreChange=>{const media=window.matchMedia(mediaQueryString);return media.addEventListener("change",onStoreChange),()=>media.removeEventListener("change",onStoreChange);},$[0]=mediaQueryString,$[1]=t0):t0=$[1];let t1;return $[2]!==mediaQueryString?(t1=()=>window.matchMedia(mediaQueryString).matches,$[2]=mediaQueryString,$[3]=t1):t1=$[3],useSyncExternalStore(t0,t1,getServerSnapshot2);}function _getMediaQuery(media,index){return index===0?"screen and (max-width: ".concat(media[index]-1,"px)"):index===media.length?"screen and (min-width: ".concat(media[index-1],"px)"):"screen and (min-width: ".concat(media[index-1],"px) and (max-width: ").concat(media[index]-1,"px)");}function _createMediaStore(media){const mediaLen=media.length;let sizes;const getSizes=()=>{if(!sizes){sizes=[];for(let index=mediaLen;index>-1;index-=1){const mediaQuery=_getMediaQuery(media,index);sizes.push({index,mq:window.matchMedia(mediaQuery)});}}return sizes;};return{getSnapshot:()=>{for(const{index,mq}of getSizes())if(mq.matches)return index;return 0;},subscribe:onStoreChange=>{const disposeFns=[];for(const{mq}of getSizes()){const handleChange=()=>{mq.matches&&onStoreChange();};mq.addEventListener("change",handleChange),disposeFns.push(()=>mq.removeEventListener("change",handleChange));}return()=>{for(const disposeFn of disposeFns)disposeFn();};}};}function getServerSnapshot(){return 0;}function useMediaIndex(){const $=dist.c(2),{media}=useTheme_v2();let t0;$[0]!==media?(t0=_createMediaStore(media),$[0]=media,$[1]=t0):t0=$[1];const store=t0;return useSyncExternalStore(store.subscribe,store.getSnapshot,getServerSnapshot);}function usePrefersDark(t0){return useMatchMedia("(prefers-color-scheme: dark)",t0===void 0?_temp$7:t0);}function _temp$7(){return!1;}function usePrefersReducedMotion(t0){return useMatchMedia("(prefers-reduced-motion: reduce)",t0===void 0?_temp$6:t0);}function _temp$6(){return!1;}function checkboxBaseStyles(){return css(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n "])));}function inputElementStyles(props){const{color,input,radius}=getTheme_v2(props.theme),{focusRing}=input.checkbox;return css(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ",";\n width: ",";\n box-sizing: border-box;\n box-shadow: ",";\n border-radius: ",";\n line-height: 1;\n background-color: ",";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.5px !important;\n }\n }\n }\n\n &:checked + span {\n background: ",";\n box-shadow: ",";\n color: ",";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ",";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ",";\n }\n\n &[data-error] + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n &[data-error]&:checked + span {\n background-color: ",";\n color: ",";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ",";\n }\n\n &:disabled + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n &:disabled&:checked + span {\n background-color: ",";\n }\n\n &[data-read-only] + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ",";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])),rem(input.checkbox.size),rem(input.checkbox.size),focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),rem(radius[2]),color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.fg,width:input.border.width}),color.input.default.enabled.bg,focusRingStyle({focusRing}),focusRingStyle({focusRing:{width:1,offset:1}}),color.input.invalid.enabled.border,focusRingBorderStyle({width:input.border.width,color:color.input.invalid.enabled.muted.bg}),color.input.default.disabled.fg,color.input.invalid.enabled.muted.bg,color.input.default.enabled.bg,focusRingStyle({border:{width:input.border.width,color:color.input.invalid.readOnly.muted.bg},focusRing:{width:1,offset:1}}),color.input.default.disabled.bg,focusRingBorderStyle({width:input.border.width,color:color.input.default.disabled.border}),color.input.default.disabled.fg,color.input.default.disabled.muted.bg,color.input.default.readOnly.bg,focusRingBorderStyle({width:input.border.width,color:color.input.default.readOnly.border}),color.input.default.readOnly.fg,color.input.default.readOnly.muted.bg);}const StyledCheckbox=/* @__PURE__ */styled.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-1l5mt2l-0"})(checkboxBaseStyles),Input$5=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-1l5mt2l-1"})(inputElementStyles),Checkbox=forwardRef(function(props,forwardedRef){var _props0;const $=dist.c(25);let checked,className,customValidity,disabled,indeterminate,readOnly,restProps,style;$[0]!==props?(_props0=props,{checked,className,disabled,indeterminate,customValidity,readOnly,style}=_props0,restProps=_objectWithoutProperties(_props0,_excluded23),_props0,$[0]=props,$[1]=checked,$[2]=className,$[3]=customValidity,$[4]=disabled,$[5]=indeterminate,$[6]=readOnly,$[7]=restProps,$[8]=style):(checked=$[1],className=$[2],customValidity=$[3],disabled=$[4],indeterminate=$[5],readOnly=$[6],restProps=$[7],style=$[8]);const ref=useRef$1(null);let t0;$[9]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[9]=t0):t0=$[9],useImperativeHandle(forwardedRef,t0);let t1,t2;$[10]!==indeterminate?(t1=()=>{ref.current&&(ref.current.indeterminate=indeterminate||!1);},t2=[indeterminate],$[10]=indeterminate,$[11]=t1,$[12]=t2):(t1=$[11],t2=$[12]),useEffect$1(t1,t2),useCustomValidity(ref,customValidity);const t3=!disabled&&readOnly?"":void 0,t4=customValidity?"":void 0,t5=disabled||readOnly;let t6;$[13]!==checked||$[14]!==readOnly||$[15]!==restProps||$[16]!==t3||$[17]!==t4||$[18]!==t5?(t6=/* @__PURE__ */jsx(Input$5,_objectSpread(_objectSpread({"data-read-only":t3,"data-error":t4},restProps),{},{checked,disabled:t5,type:"checkbox",readOnly,ref})),$[13]=checked,$[14]=readOnly,$[15]=restProps,$[16]=t3,$[17]=t4,$[18]=t5,$[19]=t6):t6=$[19];let t7;$[20]===Symbol.for("react.memo_cache_sentinel")?(t7=/* @__PURE__ */jsxs("span",{children:[/* @__PURE__ */jsx(CheckmarkIcon,{}),/* @__PURE__ */jsx(RemoveIcon,{})]}),$[20]=t7):t7=$[20];let t8;return $[21]!==className||$[22]!==style||$[23]!==t6?(t8=/* @__PURE__ */jsxs(StyledCheckbox,{className,"data-ui":"Checkbox",style,children:[t6,t7]}),$[21]=className,$[22]=style,$[23]=t6,$[24]=t8):t8=$[24],t8;});Checkbox.displayName="ForwardRef(Checkbox)";function codeSyntaxHighlightingStyle(_ref70){let{theme}=_ref70;const{color:{syntax:color}}=getTheme_v2(theme);return{"&.atrule":{color:color.atrule},"&.attr-name":{color:color.attrName},"&.attr-value":{color:color.attrValue},"&.attribute":{color:color.attribute},"&.boolean":{color:color.boolean},"&.builtin":{color:color.builtin},"&.cdata":{color:color.cdata},"&.char":{color:color.char},"&.class":{color:color.class},"&.class-name":{color:color.className},"&.comment":{color:color.comment},"&.constant":{color:color.constant},"&.deleted":{color:color.deleted},"&.doctype":{color:color.doctype},"&.entity":{color:color.entity},"&.function":{color:color.function},"&.hexcode":{color:color.hexcode},"&.id":{color:color.id},"&.important":{color:color.important},"&.inserted":{color:color.inserted},"&.keyword":{color:color.keyword},"&.number":{color:color.number},"&.operator":{color:color.operator},"&.prolog":{color:color.prolog},"&.property":{color:color.property},"&.pseudo-class":{color:color.pseudoClass},"&.pseudo-element":{color:color.pseudoElement},"&.punctuation":{color:color.punctuation},"&.regex":{color:color.regex},"&.selector":{color:color.selector},"&.string":{color:color.string},"&.symbol":{color:color.symbol},"&.tag":{color:color.tag},"&.unit":{color:color.unit},"&.url":{color:color.url},"&.variable":{color:color.variable}};}function codeBaseStyle(){return css(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ","\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),codeSyntaxHighlightingStyle);}const LazyRefractor=lazy(()=>import('./refractor-86932f9e.js')),StyledCode=/* @__PURE__ */styled.pre.withConfig({displayName:"StyledCode",componentId:"sc-4dymyn-0"})(codeBaseStyle,responsiveCodeFontStyle),Code=forwardRef(function(props,ref){var _props1;const $=dist.c(22);let children,language,restProps,t0,weight;$[0]!==props?(_props1=props,{children,language,size:t0,weight}=_props1,restProps=_objectWithoutProperties(_props1,_excluded24),_props1,$[0]=props,$[1]=children,$[2]=language,$[3]=restProps,$[4]=t0,$[5]=weight):(children=$[1],language=$[2],restProps=$[3],t0=$[4],weight=$[5]);const size2=t0===void 0?2:t0;let t1;$[6]!==size2?(t1=_getArrayProp(size2),$[6]=size2,$[7]=t1):t1=$[7];let t2;$[8]!==children?(t2=/* @__PURE__ */jsx("code",{children}),$[8]=children,$[9]=t2):t2=$[9];let t3;$[10]!==children||$[11]!==language?(t3=/* @__PURE__ */jsx(LazyRefractor,{language,value:children}),$[10]=children,$[11]=language,$[12]=t3):t3=$[12];let t4;$[13]!==t2||$[14]!==t3?(t4=/* @__PURE__ */jsx(Suspense,{fallback:t2,children:t3}),$[13]=t2,$[14]=t3,$[15]=t4):t4=$[15];let t5;return $[16]!==ref||$[17]!==restProps||$[18]!==t1||$[19]!==t4||$[20]!==weight?(t5=/* @__PURE__ */jsx(StyledCode,_objectSpread(_objectSpread({"data-ui":"Code"},restProps),{},{$size:t1,$weight:weight,ref,children:t4})),$[16]=ref,$[17]=restProps,$[18]=t1,$[19]=t4,$[20]=weight,$[21]=t5):t5=$[21],t5;});Code.displayName="ForwardRef(Code)";const BASE_STYLE$1={width:"100%",margin:"0 auto"};function containerBaseStyle(){return BASE_STYLE$1;}function responsiveContainerWidthStyle(props){const{container,media}=getTheme_v2(props.theme);return _responsive(media,props.$width,val=>({maxWidth:val==="auto"?"none":rem(container[val])}));}const StyledContainer=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledContainer",componentId:"sc-wyroop-0"})(containerBaseStyle,responsiveContainerWidthStyle),Container=forwardRef(function(props,ref){var _props10;const $=dist.c(11);let as,restProps,t0;$[0]!==props?(_props10=props,{as,width:t0}=_props10,restProps=_objectWithoutProperties(_props10,_excluded25),_props10,$[0]=props,$[1]=as,$[2]=restProps,$[3]=t0):(as=$[1],restProps=$[2],t0=$[3]);const width=t0===void 0?2:t0;let t1;$[4]!==width?(t1=_getArrayProp(width),$[4]=width,$[5]=t1):t1=$[5];let t2;return $[6]!==as||$[7]!==ref||$[8]!==restProps||$[9]!==t1?(t2=/* @__PURE__ */jsx(StyledContainer,_objectSpread(_objectSpread({"data-ui":"Container"},restProps),{},{$width:t1,forwardedAs:as,ref})),$[6]=as,$[7]=ref,$[8]=restProps,$[9]=t1,$[10]=t2):t2=$[10],t2;});Container.displayName="ForwardRef(Container)";const StyledGrid=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledGrid",componentId:"sc-v8t8oz-0"})(responsiveGridStyle),Grid=forwardRef(function(props,ref){var _props11;const $=dist.c(42);let as,autoCols,autoFlow,autoRows,children,columns,gap,gapX,gapY,restProps,rows;$[0]!==props?(_props11=props,{as,autoRows,autoCols,autoFlow,columns,gap,gapX,gapY,rows,children}=_props11,restProps=_objectWithoutProperties(_props11,_excluded26),_props11,$[0]=props,$[1]=as,$[2]=autoCols,$[3]=autoFlow,$[4]=autoRows,$[5]=children,$[6]=columns,$[7]=gap,$[8]=gapX,$[9]=gapY,$[10]=restProps,$[11]=rows):(as=$[1],autoCols=$[2],autoFlow=$[3],autoRows=$[4],children=$[5],columns=$[6],gap=$[7],gapX=$[8],gapY=$[9],restProps=$[10],rows=$[11]);const t0=typeof as=="string"?as:void 0;let t1;$[12]!==autoRows?(t1=_getArrayProp(autoRows),$[12]=autoRows,$[13]=t1):t1=$[13];let t2;$[14]!==autoCols?(t2=_getArrayProp(autoCols),$[14]=autoCols,$[15]=t2):t2=$[15];let t3;$[16]!==autoFlow?(t3=_getArrayProp(autoFlow),$[16]=autoFlow,$[17]=t3):t3=$[17];let t4;$[18]!==columns?(t4=_getArrayProp(columns),$[18]=columns,$[19]=t4):t4=$[19];let t5;$[20]!==gap?(t5=_getArrayProp(gap),$[20]=gap,$[21]=t5):t5=$[21];let t6;$[22]!==gapX?(t6=_getArrayProp(gapX),$[22]=gapX,$[23]=t6):t6=$[23];let t7;$[24]!==gapY?(t7=_getArrayProp(gapY),$[24]=gapY,$[25]=t7):t7=$[25];let t8;$[26]!==rows?(t8=_getArrayProp(rows),$[26]=rows,$[27]=t8):t8=$[27];let t9;return $[28]!==as||$[29]!==children||$[30]!==ref||$[31]!==restProps||$[32]!==t0||$[33]!==t1||$[34]!==t2||$[35]!==t3||$[36]!==t4||$[37]!==t5||$[38]!==t6||$[39]!==t7||$[40]!==t8?(t9=/* @__PURE__ */jsx(StyledGrid,_objectSpread(_objectSpread({"data-as":t0,"data-ui":"Grid"},restProps),{},{$autoRows:t1,$autoCols:t2,$autoFlow:t3,$columns:t4,$gap:t5,$gapX:t6,$gapY:t7,$rows:t8,forwardedAs:as,ref,children})),$[28]=as,$[29]=children,$[30]=ref,$[31]=restProps,$[32]=t0,$[33]=t1,$[34]=t2,$[35]=t3,$[36]=t4,$[37]=t5,$[38]=t6,$[39]=t7,$[40]=t8,$[41]=t9):t9=$[41],t9;});Grid.displayName="ForwardRef(Grid)";function headingBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ",";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),$accent&&css(_templateObject23||(_templateObject23=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family,font.heading.weights.bold);}const StyledHeading=/* @__PURE__ */styled.div.withConfig({displayName:"StyledHeading",componentId:"sc-137lwim-0"})(headingBaseStyle,responsiveTextAlignStyle,responsiveHeadingFont),Heading=forwardRef(function(props,ref){var _props12;const $=dist.c(26);let align,childrenProp,restProps,t0,t1,t2,textOverflow,weight;$[0]!==props?(_props12=props,{accent:t0,align,children:childrenProp,muted:t1,size:t2,textOverflow,weight}=_props12,restProps=_objectWithoutProperties(_props12,_excluded27),_props12,$[0]=props,$[1]=align,$[2]=childrenProp,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=textOverflow,$[8]=weight):(align=$[1],childrenProp=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],textOverflow=$[7],weight=$[8]);const accent=t0===void 0?!1:t0,muted=t1===void 0?!1:t1,size2=t2===void 0?2:t2;let children=childrenProp;if(textOverflow==="ellipsis"){let t32;$[9]!==children?(t32=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t32):t32=$[10],children=t32;}let t3;$[11]!==align?(t3=_getArrayProp(align),$[11]=align,$[12]=t3):t3=$[12];let t4;$[13]!==size2?(t4=_getArrayProp(size2),$[13]=size2,$[14]=t4):t4=$[14];let t5;$[15]!==children?(t5=/* @__PURE__ */jsx("span",{children}),$[15]=children,$[16]=t5):t5=$[16];let t6;return $[17]!==accent||$[18]!==muted||$[19]!==ref||$[20]!==restProps||$[21]!==t3||$[22]!==t4||$[23]!==t5||$[24]!==weight?(t6=/* @__PURE__ */jsx(StyledHeading,_objectSpread(_objectSpread({"data-ui":"Heading"},restProps),{},{$accent:accent,$align:t3,$muted:muted,$size:t4,$weight:weight,ref,children:t5})),$[17]=accent,$[18]=muted,$[19]=ref,$[20]=restProps,$[21]=t3,$[22]=t4,$[23]=t5,$[24]=weight,$[25]=t6):t6=$[25],t6;});Heading.displayName="ForwardRef(Heading)";function inlineBaseStyle(){return{lineHeight:"0","&&:not([hidden])":{display:"block"},"& > div":{display:"inline-block",verticalAlign:"middle"}};}function inlineSpaceStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$space,spaceIndex=>{const _space=rem(spaceIndex===0.5?space[1]/2:space[spaceIndex]);return{margin:"-".concat(_space," 0 0 -").concat(_space),"& > div":{padding:"".concat(_space," 0 0 ").concat(_space)}};});}const StyledInline=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledInline",componentId:"sc-1pkiy6j-0"})(inlineBaseStyle,inlineSpaceStyle),Inline=forwardRef(function(props,ref){var _props13;const $=dist.c(15);let as,childrenProp,restProps,space;$[0]!==props?(_props13=props,{as,children:childrenProp,space}=_props13,restProps=_objectWithoutProperties(_props13,_excluded28),_props13,$[0]=props,$[1]=as,$[2]=childrenProp,$[3]=restProps,$[4]=space):(as=$[1],childrenProp=$[2],restProps=$[3],space=$[4]);let t0;$[5]!==childrenProp?(t0=Children.map(childrenProp,_temp$5),$[5]=childrenProp,$[6]=t0):t0=$[6];const children=t0;let t1;$[7]!==space?(t1=_getArrayProp(space),$[7]=space,$[8]=t1):t1=$[8];const t2=ref;let t3;return $[9]!==as||$[10]!==children||$[11]!==restProps||$[12]!==t1||$[13]!==t2?(t3=/* @__PURE__ */jsx(StyledInline,_objectSpread(_objectSpread({"data-ui":"Inline"},restProps),{},{$space:t1,forwardedAs:as,ref:t2,children})),$[9]=as,$[10]=children,$[11]=restProps,$[12]=t1,$[13]=t2,$[14]=t3):t3=$[14],t3;});Inline.displayName="ForwardRef(Inline)";function _temp$5(child){return child&&/* @__PURE__ */jsx("div",{children:child});}function kbdStyle(){return css(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}const StyledKBD=/* @__PURE__ */styled.kbd.withConfig({displayName:"StyledKBD",componentId:"sc-1w7yd8w-0"})(responsiveRadiusStyle,kbdStyle),KBD=forwardRef(function(props,ref){var _props14;const $=dist.c(19);let children,restProps,t0,t1,t2;$[0]!==props?(_props14=props,{children,fontSize:t0,padding:t1,radius:t2}=_props14,restProps=_objectWithoutProperties(_props14,_excluded29),_props14,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0,$[4]=t1,$[5]=t2):(children=$[1],restProps=$[2],t0=$[3],t1=$[4],t2=$[5]);const fontSize2=t0===void 0?0:t0,padding=t1===void 0?1:t1,radius=t2===void 0?2:t2;let t3;$[6]!==radius?(t3=_getArrayProp(radius),$[6]=radius,$[7]=t3):t3=$[7];let t4;$[8]!==children||$[9]!==fontSize2?(t4=/* @__PURE__ */jsx(Text,{as:"span",size:fontSize2,weight:"semibold",children}),$[8]=children,$[9]=fontSize2,$[10]=t4):t4=$[10];let t5;$[11]!==padding||$[12]!==t4?(t5=/* @__PURE__ */jsx(Box,{as:"span",padding,children:t4}),$[11]=padding,$[12]=t4,$[13]=t5):t5=$[13];let t6;return $[14]!==ref||$[15]!==restProps||$[16]!==t3||$[17]!==t5?(t6=/* @__PURE__ */jsx(StyledKBD,_objectSpread(_objectSpread({"data-ui":"KBD"},restProps),{},{$radius:t3,ref,children:t5})),$[14]=ref,$[15]=restProps,$[16]=t3,$[17]=t5,$[18]=t6):t6=$[18],t6;});KBD.displayName="ForwardRef(KBD)";const origin={name:"@sanity/ui/origin",fn(_ref71){var _middlewareData$shift,_middlewareData$shift2;let{middlewareData,placement,rects}=_ref71;const[side]=placement.split("-"),floatingWidth=rects.floating.width,floatingHeight=rects.floating.height,shiftX=((_middlewareData$shift=middlewareData.shift)===null||_middlewareData$shift===void 0?void 0:_middlewareData$shift.x)||0,shiftY=((_middlewareData$shift2=middlewareData.shift)===null||_middlewareData$shift2===void 0?void 0:_middlewareData$shift2.y)||0;if(floatingWidth<=0||floatingHeight<=0)return{};const isVerticalPlacement=["bottom","top"].includes(side),{originX,originY}=isVerticalPlacement?{originX:clamp(0.5-shiftX/floatingWidth,0,1),originY:side==="bottom"?0:1}:{originX:side==="left"?1:0,originY:clamp(0.5-shiftY/floatingHeight,0,1)};return{data:{originX,originY}};}};function clamp(num,min,max){return Math.min(Math.max(num,min),max);}function moveTowardsLength(movingPoint,targetPoint,amount){const width=targetPoint.x-movingPoint.x,height=targetPoint.y-movingPoint.y,distance=Math.sqrt(width*width+height*height);return moveTowardsFractional(movingPoint,targetPoint,Math.min(1,amount/distance));}function moveTowardsFractional(movingPoint,targetPoint,fraction){return{x:movingPoint.x+(targetPoint.x-movingPoint.x)*fraction,y:movingPoint.y+(targetPoint.y-movingPoint.y)*fraction};}function getRoundedCommands(points){const len=points.length,cmds=[];for(let i=0;i<len;i+=1){const point=points[i],prevPoint=points[i-1],nextPoint=points[i+1];if(prevPoint&&point.radius){const curveStart=moveTowardsLength(point,prevPoint,point.radius),curveEnd=moveTowardsLength(point,nextPoint,point.radius),startControl=moveTowardsFractional(curveStart,point,0.5),endControl=moveTowardsFractional(point,curveEnd,0.5);cmds.push(_objectSpread({type:"point"},curveStart)),cmds.push({type:"curve",curveEnd,startControl,endControl});}else cmds.push(_objectSpread({type:"point"},point));}return cmds;}function compileCommands(cmds){return cmds.map((n,idx)=>n.type==="point"?"".concat(idx===0?"M":"L"," ").concat(n.x," ").concat(n.y):n.type==="curve"?"C ".concat(n.startControl.x," ").concat(n.startControl.y," ").concat(n.endControl.x," ").concat(n.endControl.y," ").concat(n.curveEnd.x," ").concat(n.curveEnd.y):"").join(" ");}const StyledArrow=/* @__PURE__ */styled.div.withConfig({displayName:"StyledArrow",componentId:"sc-12vzy6c-0"})(_ref72=>{let{$w:w}=_ref72;return css(_templateObject26||(_templateObject26=_taggedTemplateLiteral(["\n position: absolute;\n width: ","px;\n height: ","px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ","px ","px;\n }\n\n [data-placement^='top'] > & {\n bottom: -","px;\n\n & > svg {\n transform: rotate(0);\n }\n }\n\n [data-placement^='right'] > & {\n left: -","px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -","px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -","px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n "])),w,w,w/2,w/2,w,w,w,w);}),StrokePath=styled.path.withConfig({displayName:"StrokePath",componentId:"sc-12vzy6c-1"})(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["stroke:var(--card-shadow-outline-color);"]))),ShapePath=styled.path.withConfig({displayName:"ShapePath",componentId:"sc-12vzy6c-2"})(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["fill:var(--card-bg-color);"]))),Arrow=forwardRef(function(props,ref){var _props15;const $=dist.c(29);let h,restProps,t0,w;$[0]!==props?(_props15=props,{width:w,height:h,radius:t0}=_props15,restProps=_objectWithoutProperties(_props15,_excluded30),_props15,$[0]=props,$[1]=h,$[2]=restProps,$[3]=t0,$[4]=w):(h=$[1],restProps=$[2],t0=$[3],w=$[4]);const radius=t0===void 0?0:t0,{card}=useTheme_v2(),strokeWidth=card.shadow.outline,center=w/2;let t1;if($[5]!==center||$[6]!==h||$[7]!==radius||$[8]!==w){const points=[{x:0,y:0},{x:radius,y:0,radius},{x:center,y:h-1,radius},{x:w-radius,y:0,radius},{x:w,y:0}],cmds=getRoundedCommands(points);t1=compileCommands(cmds),$[5]=center,$[6]=h,$[7]=radius,$[8]=w,$[9]=t1;}else t1=$[9];const path=t1,strokePath="".concat(path),fillPath="".concat(path," M ").concat(w," -1 M 0 -1 Z"),t2="0 0 ".concat(w," ").concat(w);let t3;$[10]!==strokeWidth||$[11]!==w?(t3=/* @__PURE__ */jsx("mask",{id:"stroke-mask",children:/* @__PURE__ */jsx("rect",{x:0,y:strokeWidth,width:w,height:w,fill:"white"})}),$[10]=strokeWidth,$[11]=w,$[12]=t3):t3=$[12];const t4=strokeWidth*2;let t5;$[13]!==strokePath||$[14]!==t4?(t5=/* @__PURE__ */jsx(StrokePath,{d:strokePath,mask:"url(#stroke-mask)",strokeWidth:t4}),$[13]=strokePath,$[14]=t4,$[15]=t5):t5=$[15];let t6;$[16]!==fillPath?(t6=/* @__PURE__ */jsx(ShapePath,{d:fillPath}),$[16]=fillPath,$[17]=t6):t6=$[17];let t7;$[18]!==t2||$[19]!==t3||$[20]!==t5||$[21]!==t6||$[22]!==w?(t7=/* @__PURE__ */jsxs("svg",{width:w,height:w,viewBox:t2,children:[t3,t5,t6]}),$[18]=t2,$[19]=t3,$[20]=t5,$[21]=t6,$[22]=w,$[23]=t7):t7=$[23];let t8;return $[24]!==ref||$[25]!==restProps||$[26]!==t7||$[27]!==w?(t8=/* @__PURE__ */jsx(StyledArrow,_objectSpread(_objectSpread({},restProps),{},{$w:w,ref,children:t7})),$[24]=ref,$[25]=restProps,$[26]=t7,$[27]=w,$[28]=t8):t8=$[28],t8;});Arrow.displayName="ForwardRef(Arrow)";const BoundaryElementContext=createGlobalScopedContext("@sanity/ui/context/boundaryElement",null);function isRecord(value){return!!(value&&typeof value=="object"&&!Array.isArray(value));}const DEFAULT_VALUE={version:0,element:null};function useBoundaryElement(){const value=useContext(BoundaryElementContext);if(value&&(!isRecord(value)||value.version!==0))throw new Error("useBoundaryElement(): the context value is not compatible");return value||DEFAULT_VALUE;}function findMaxBreakpoints(media,width){const ret=[];for(let i=0;i<media.length;i+=1)media[i]>width&&ret.push(i);return ret;}function findMinBreakpoints(media,width){const ret=[];for(let i=0;i<media.length;i+=1)media[i]<=width&&ret.push(i);return ret;}const ElementQuery=forwardRef(function(props,forwardedRef){var _props16,_useElementSize$borde,_useElementSize;const $=dist.c(18),theme=useTheme_v2();let _media,children,restProps;$[0]!==props?(_props16=props,{children,media:_media}=_props16,restProps=_objectWithoutProperties(_props16,_excluded31),_props16,$[0]=props,$[1]=_media,$[2]=children,$[3]=restProps):(_media=$[1],children=$[2],restProps=$[3]);const media=_media!==null&&_media!==void 0?_media:theme.media,[element,setElement]=useState(null),width=(_useElementSize$borde=(_useElementSize=useElementSize(element))===null||_useElementSize===void 0?void 0:_useElementSize.border.width)!==null&&_useElementSize$borde!==void 0?_useElementSize$borde:window.innerWidth;let t0;if($[4]!==media||$[5]!==width){const eq=findMaxBreakpoints(media,width);t0=eq.length?eq.join(" "):void 0,$[4]=media,$[5]=width,$[6]=t0;}else t0=$[6];const max=t0;let t1;if($[7]!==media||$[8]!==width){const eq_0=findMinBreakpoints(media,width);t1=eq_0.length?eq_0.join(" "):void 0,$[7]=media,$[8]=width,$[9]=t1;}else t1=$[9];const min=t1;let t2,t3;$[10]!==element?(t2=()=>element,t3=[element],$[10]=element,$[11]=t2,$[12]=t3):(t2=$[11],t3=$[12]),useImperativeHandle(forwardedRef,t2,t3);let t4;return $[13]!==children||$[14]!==max||$[15]!==min||$[16]!==restProps?(t4=/* @__PURE__ */jsx("div",_objectSpread(_objectSpread({"data-ui":"ElementQuery"},restProps),{},{"data-eq-max":max,"data-eq-min":min,ref:setElement,children})),$[13]=children,$[14]=max,$[15]=min,$[16]=restProps,$[17]=t4):t4=$[17],t4;});ElementQuery.displayName="ForwardRef(ElementQuery)";function getLayerContext(contextValue){if(!isRecord(contextValue)||contextValue.version!==0)throw new Error("the context value is not compatible");if(!contextValue)throw new Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");if(contextValue.version===0)return contextValue;throw new Error("could not get layer context");}const LayerContext=createGlobalScopedContext("@sanity/ui/context/layer",null);function LayerProvider(props){var _parent$level;const $=dist.c(21),{children,zOffset:t0}=props,zOffsetProp=t0===void 0?0:t0,parentContextValue=useContext(LayerContext);let t1;$[0]!==parentContextValue?(t1=parentContextValue&&getLayerContext(parentContextValue),$[0]=parentContextValue,$[1]=t1):t1=$[1];const parent=t1,parentRegisterChild=parent===null||parent===void 0?void 0:parent.registerChild,level=((_parent$level=parent===null||parent===void 0?void 0:parent.level)!==null&&_parent$level!==void 0?_parent$level:0)+1;let t2;$[2]!==zOffsetProp?(t2=_getArrayProp(zOffsetProp),$[2]=zOffsetProp,$[3]=t2):t2=$[3];const zOffset=t2,maxMediaIndex=zOffset.length-1,mediaIndex=Math.min(useMediaIndex(),maxMediaIndex),zIndex=parent?parent.zIndex+zOffset[mediaIndex]:zOffset[mediaIndex];let t3;$[4]===Symbol.for("react.memo_cache_sentinel")?(t3={},$[4]=t3):t3=$[4];const[,setChildLayers]=useState(t3),[size2,setSize]=useState(0),isTopLayer=size2===0;let t4;$[5]!==parentRegisterChild||$[6]!==setChildLayers?(t4=childLevel=>{const parentDispose=parentRegisterChild===null||parentRegisterChild===void 0?void 0:parentRegisterChild(childLevel);return childLevel!==void 0?setChildLayers(state=>{var _state$childLevel;const prevLen=(_state$childLevel=state[childLevel])!==null&&_state$childLevel!==void 0?_state$childLevel:0,nextState=_objectSpread(_objectSpread({},state),{},{[childLevel]:prevLen+1});return setSize(Object.keys(nextState).length),nextState;}):setSize(_temp$4),()=>{childLevel!==void 0?setChildLayers(state_0=>{const nextState_0=_objectSpread({},state_0);return nextState_0[childLevel]===1?(delete nextState_0[childLevel],setSize(Object.keys(nextState_0).length)):nextState_0[childLevel]=nextState_0[childLevel]-1,nextState_0;}):setSize(_temp2$2),parentDispose===null||parentDispose===void 0?void 0:parentDispose();};},$[5]=parentRegisterChild,$[6]=setChildLayers,$[7]=t4):t4=$[7];const registerChild=t4;let t5,t6;$[8]!==level||$[9]!==parentRegisterChild?(t5=()=>parentRegisterChild===null||parentRegisterChild===void 0?void 0:parentRegisterChild(level),t6=[level,parentRegisterChild],$[8]=level,$[9]=parentRegisterChild,$[10]=t5,$[11]=t6):(t5=$[10],t6=$[11]),useEffect$1(t5,t6);let t7;$[12]!==isTopLayer||$[13]!==level||$[14]!==registerChild||$[15]!==size2||$[16]!==zIndex?(t7={version:0,isTopLayer,level,registerChild,size:size2,zIndex},$[12]=isTopLayer,$[13]=level,$[14]=registerChild,$[15]=size2,$[16]=zIndex,$[17]=t7):t7=$[17];const value=t7;let t8;return $[18]!==children||$[19]!==value?(t8=/* @__PURE__ */jsx(LayerContext.Provider,{value,children}),$[18]=children,$[19]=value,$[20]=t8):t8=$[20],t8;}function _temp2$2(v_0){return v_0-1;}function _temp$4(v){return v+1;}LayerProvider.displayName="LayerProvider";function useLayer(){const $=dist.c(2),value=useContext(LayerContext);if(!value)throw new Error("useLayer(): missing context value");try{let t1;return $[0]!==value?(t1=getLayerContext(value),$[0]=value,$[1]=t1):t1=$[1],t1;}catch(t0){const err=t0;throw err instanceof Error?new Error("useLayer(): ".concat(err.message)):new Error("useLayer(): ".concat(err));}}const StyledLayer=/* @__PURE__ */styled.div.withConfig({displayName:"StyledLayer",componentId:"sc-16kojrv-0"})({position:"relative"}),LayerChildren=forwardRef(function(props,forwardedRef){var _props17;const $=dist.c(22);let children,onActivate,onFocus,restProps,t0;$[0]!==props?(_props17=props,{children,onActivate,onFocus,style:t0}=_props17,restProps=_objectWithoutProperties(_props17,_excluded32),_props17,$[0]=props,$[1]=children,$[2]=onActivate,$[3]=onFocus,$[4]=restProps,$[5]=t0):(children=$[1],onActivate=$[2],onFocus=$[3],restProps=$[4],t0=$[5]);const style=t0===void 0?EMPTY_RECORD:t0,{zIndex,isTopLayer}=useLayer(),lastFocusedRef=useRef$1(null),ref=useRef$1(null),isTopLayerRef=useRef$1(isTopLayer);let t1;$[6]===Symbol.for("react.memo_cache_sentinel")?(t1=()=>ref.current,$[6]=t1):t1=$[6],useImperativeHandle(forwardedRef,t1);let t2,t3;$[7]!==isTopLayer||$[8]!==onActivate?(t2=()=>{var _onActivate;isTopLayerRef.current!==isTopLayer&&isTopLayer&&(_onActivate=onActivate)!==null&&_onActivate!==void 0&&_onActivate({activeElement:lastFocusedRef.current}),isTopLayerRef.current=isTopLayer;},t3=[isTopLayer,onActivate],$[7]=isTopLayer,$[8]=onActivate,$[9]=t2,$[10]=t3):(t2=$[9],t3=$[10]),useEffect$1(t2,t3);let t4;$[11]!==isTopLayer||$[12]!==onFocus?(t4=event=>{var _onFocus;(_onFocus=onFocus)===null||_onFocus===void 0||_onFocus(event);const rootElement=ref.current,target=document.activeElement;!isTopLayer||!rootElement||!target||isHTMLElement(target)&&containsOrEqualsElement(rootElement,target)&&(lastFocusedRef.current=target);},$[11]=isTopLayer,$[12]=onFocus,$[13]=t4):t4=$[13];const handleFocus=t4;let t5;$[14]!==style||$[15]!==zIndex?(t5=_objectSpread(_objectSpread({},style),{},{zIndex}),$[14]=style,$[15]=zIndex,$[16]=t5):t5=$[16];let t6;return $[17]!==children||$[18]!==handleFocus||$[19]!==restProps||$[20]!==t5?(t6=/* @__PURE__ */jsx(StyledLayer,_objectSpread(_objectSpread({},restProps),{},{"data-ui":"Layer",onFocus:handleFocus,ref,style:t5,children})),$[17]=children,$[18]=handleFocus,$[19]=restProps,$[20]=t5,$[21]=t6):t6=$[21],t6;}),Layer=forwardRef(function(props,ref){var _props18;const $=dist.c(11);let children,restProps,t0;$[0]!==props?(_props18=props,{children,zOffset:t0}=_props18,restProps=_objectWithoutProperties(_props18,_excluded33),_props18,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0):(children=$[1],restProps=$[2],t0=$[3]);const zOffset=t0===void 0?1:t0;let t1;$[4]!==children||$[5]!==ref||$[6]!==restProps?(t1=/* @__PURE__ */jsx(LayerChildren,_objectSpread(_objectSpread({},restProps),{},{ref,children})),$[4]=children,$[5]=ref,$[6]=restProps,$[7]=t1):t1=$[7];let t2;return $[8]!==t1||$[9]!==zOffset?(t2=/* @__PURE__ */jsx(LayerProvider,{zOffset,children:t1}),$[8]=t1,$[9]=zOffset,$[10]=t2):t2=$[10],t2;});Layer.displayName="ForwardRef(Layer)";const key="@sanity/ui/context/portal",elementKey=Symbol.for("".concat(key,"/element"));globalScope[elementKey]=null;const defaultContextValue={version:0,boundaryElement:null,get element(){return typeof document>"u"?null:(globalScope[elementKey]||(globalScope[elementKey]=document.createElement("div"),globalScope[elementKey].setAttribute("data-portal",""),document.body.appendChild(globalScope[elementKey])),globalScope[elementKey]);}},PortalContext=createGlobalScopedContext(key,defaultContextValue);function usePortal(){const value=useContext(PortalContext);if(!value)throw new Error("usePortal(): missing context value");if(!isRecord(value)||value.version!==0)throw new Error("usePortal(): the context value is not compatible");return value;}function Portal(props){var _portal$elements;const $=dist.c(3),{children,__unstable_name:name}=props,portal=usePortal(),portalElement=(name?portal.elements&&portal.elements[name]:portal.element)||((_portal$elements=portal.elements)===null||_portal$elements===void 0?void 0:_portal$elements.default);if(!portalElement)return null;let t0;return $[0]!==children||$[1]!==portalElement?(t0=createPortal(children,portalElement),$[0]=children,$[1]=portalElement,$[2]=t0):t0=$[2],t0;}Portal.displayName="Portal";const StyledSrOnly=styled.div.withConfig({displayName:"StyledSrOnly",componentId:"sc-mubr0c-0"})(_templateObject29||(_templateObject29=_taggedTemplateLiteral(["display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;"]))),SrOnly=forwardRef(function(props,ref){const $=dist.c(4),{as,children}=props;let t0;return $[0]!==as||$[1]!==children||$[2]!==ref?(t0=/* @__PURE__ */jsx(StyledSrOnly,{"aria-hidden":!0,as,"data-ui":"SrOnly",ref,children}),$[0]=as,$[1]=children,$[2]=ref,$[3]=t0):t0=$[3],t0;});SrOnly.displayName="ForwardRef(SrOnly)";const StyledVirtualList=styled.div.withConfig({displayName:"StyledVirtualList",componentId:"sc-dlqsj4-0"})(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["position:relative;"]))),ItemWrapper=styled.div.withConfig({displayName:"ItemWrapper",componentId:"sc-dlqsj4-1"})(_templateObject31||(_templateObject31=_taggedTemplateLiteral(["position:absolute;left:0;right:0;"]))),VirtualList=forwardRef(function(props,forwardedRef){var _props19;const $=dist.c(44);let getItemKey,onChange,renderItem,restProps,t0,t1,t2;$[0]!==props?(_props19=props,{as:t0,gap:t1,getItemKey,items:t2,onChange,renderItem}=_props19,restProps=_objectWithoutProperties(_props19,_excluded34),_props19,$[0]=props,$[1]=getItemKey,$[2]=onChange,$[3]=renderItem,$[4]=restProps,$[5]=t0,$[6]=t1,$[7]=t2):(getItemKey=$[1],onChange=$[2],renderItem=$[3],restProps=$[4],t0=$[5],t1=$[6],t2=$[7]);const as=t0===void 0?"div":t0,gap=t1===void 0?0:t1;let t3;$[8]!==t2?(t3=t2===void 0?[]:t2,$[8]=t2,$[9]=t3):t3=$[9];const items=t3,{space}=useTheme_v2(),ref=useRef$1(null),wrapperRef=useRef$1(null),[scrollTop,setScrollTop]=useState(0),[scrollHeight,setScrollHeight]=useState(0),[itemHeight,setItemHeight]=useState(-1);let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[10]=t4):t4=$[10],useImperativeHandle(forwardedRef,t4);let t5;$[11]===Symbol.for("react.memo_cache_sentinel")?(t5=()=>{if(!wrapperRef.current)return;const firstElement=wrapperRef.current.firstChild;firstElement instanceof HTMLElement&&setItemHeight(firstElement.offsetHeight);},$[11]=t5):t5=$[11];let t6;$[12]!==renderItem?(t6=[renderItem],$[12]=renderItem,$[13]=t6):t6=$[13],useEffect$1(t5,t6);let t7,t8;$[14]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>{if(!ref.current)return;const scrollEl=findScrollable(ref.current.parentNode);if(scrollEl){if(!(scrollEl instanceof HTMLElement))return;const handleScroll=()=>{setScrollTop(scrollEl.scrollTop);};scrollEl.addEventListener("scroll",handleScroll,{passive:!0});const ro=new _ResizeObserver(entries=>{setScrollHeight(entries[0].contentRect.height);});return ro.observe(scrollEl),handleScroll(),()=>{scrollEl.removeEventListener("scroll",handleScroll),ro.unobserve(scrollEl),ro.disconnect();};}const handleScroll_0=()=>{setScrollTop(window.scrollY);},handleResize=()=>{setScrollHeight(window.innerHeight);};return window.addEventListener("scroll",handleScroll_0,{passive:!0}),window.addEventListener("resize",handleResize),setScrollHeight(window.innerHeight),handleScroll_0(),()=>{window.removeEventListener("scroll",handleScroll_0),window.removeEventListener("resize",handleResize);};},t8=[],$[14]=t7,$[15]=t8):(t7=$[14],t8=$[15]),useEffect$1(t7,t8);const len=items.length,height=itemHeight?len*(itemHeight+space[gap])-space[gap]:0,fromIndex=height?Math.max(Math.floor(scrollTop/height*len)-2,0):0,toIndex=height?Math.ceil((scrollTop+scrollHeight)/height*len)+1:0;let t10,t9;$[16]!==fromIndex||$[17]!==gap||$[18]!==itemHeight||$[19]!==onChange||$[20]!==scrollHeight||$[21]!==scrollTop||$[22]!==space||$[23]!==toIndex?(t9=()=>{onChange&&onChange({fromIndex,gap:space[gap],itemHeight,scrollHeight,scrollTop,toIndex});},t10=[fromIndex,gap,itemHeight,onChange,scrollHeight,scrollTop,space,toIndex],$[16]=fromIndex,$[17]=gap,$[18]=itemHeight,$[19]=onChange,$[20]=scrollHeight,$[21]=scrollTop,$[22]=space,$[23]=toIndex,$[24]=t10,$[25]=t9):(t10=$[24],t9=$[25]),useEffect$1(t9,t10);let t11;$[26]!==fromIndex||$[27]!==gap||$[28]!==getItemKey||$[29]!==itemHeight||$[30]!==items||$[31]!==renderItem||$[32]!==space||$[33]!==toIndex?(t11={fromIndex,gap,itemHeight,space,toIndex,getItemKey,items,renderItem},$[26]=fromIndex,$[27]=gap,$[28]=getItemKey,$[29]=itemHeight,$[30]=items,$[31]=renderItem,$[32]=space,$[33]=toIndex,$[34]=t11):t11=$[34];const children=useChildren(t11);let t12;$[35]!==height?(t12={height},$[35]=height,$[36]=t12):t12=$[36];let t13;$[37]!==children||$[38]!==t12?(t13=/* @__PURE__ */jsx("div",{ref:wrapperRef,style:t12,children}),$[37]=children,$[38]=t12,$[39]=t13):t13=$[39];let t14;return $[40]!==as||$[41]!==restProps||$[42]!==t13?(t14=/* @__PURE__ */jsx(StyledVirtualList,_objectSpread(_objectSpread({as,"data-ui":"VirtualList"},restProps),{},{ref,children:t13})),$[40]=as,$[41]=restProps,$[42]=t13,$[43]=t14):t14=$[43],t14;});VirtualList.displayName="ForwardRef(VirtualList)";function useChildren(t0){const $=dist.c(21),{fromIndex,gap,getItemKey,itemHeight,items,renderItem,space,toIndex}=t0;if(!renderItem||items.length===0)return null;if(itemHeight===-1){let t12;$[0]!==items[0]||$[1]!==renderItem?(t12=renderItem(items[0]),$[0]=items[0],$[1]=renderItem,$[2]=t12):t12=$[2];let t2;return $[3]!==t12?(t2=[/* @__PURE__ */jsx(ItemWrapper,{children:t12},0)],$[3]=t12,$[4]=t2):t2=$[4],t2;}let t1;if($[5]!==fromIndex||$[6]!==gap||$[7]!==getItemKey||$[8]!==itemHeight||$[9]!==items||$[10]!==renderItem||$[11]!==space||$[12]!==toIndex){let t2;$[14]!==fromIndex||$[15]!==gap||$[16]!==getItemKey||$[17]!==itemHeight||$[18]!==renderItem||$[19]!==space?(t2=(item,_itemIndex)=>{const itemIndex=fromIndex+_itemIndex,node=renderItem(item),key2=getItemKey?getItemKey(item,itemIndex):itemIndex;return/* @__PURE__ */jsx(ItemWrapper,{style:{top:itemIndex*(itemHeight+space[gap])},children:node},key2);},$[14]=fromIndex,$[15]=gap,$[16]=getItemKey,$[17]=itemHeight,$[18]=renderItem,$[19]=space,$[20]=t2):t2=$[20],t1=items.slice(fromIndex,toIndex).map(t2),$[5]=fromIndex,$[6]=gap,$[7]=getItemKey,$[8]=itemHeight,$[9]=items,$[10]=renderItem,$[11]=space,$[12]=toIndex,$[13]=t1;}else t1=$[13];return t1;}function findScrollable(parentNode){let _scrollEl=parentNode;for(;_scrollEl&&!_isScrollable(_scrollEl);)_scrollEl=_scrollEl.parentNode;return _scrollEl;}function getElementRef(element){var _Object$getOwnPropert,_Object$getOwnPropert2;let getter=(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.props,"ref"))===null||_Object$getOwnPropert===void 0?void 0:_Object$getOwnPropert.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element.ref:(getter=(_Object$getOwnPropert2=Object.getOwnPropertyDescriptor(element,"ref"))===null||_Object$getOwnPropert2===void 0?void 0:_Object$getOwnPropert2.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element.props.ref:element.props.ref||element.ref);}const DEFAULT_POPOVER_DISTANCE=4,DEFAULT_POPOVER_PADDING=4,DEFAULT_POPOVER_ARROW_WIDTH=19,DEFAULT_POPOVER_ARROW_HEIGHT=8,DEFAULT_POPOVER_ARROW_RADIUS=2,DEFAULT_POPOVER_MARGINS=[0,0,0,0],DEFAULT_FALLBACK_PLACEMENTS$1={top:["bottom","left","right"],"top-start":["bottom-start","left-start","right-start"],"top-end":["bottom-end","left-end","right-end"],bottom:["top","left","right"],"bottom-start":["top-start","left-start","right-start"],"bottom-end":["top-end","left-end","right-end"],left:["right","top","bottom"],"left-start":["right-start","top-start","bottom-start"],"left-end":["right-end","top-end","bottom-end"],right:["left","top","bottom"],"right-start":["left-start","top-start","bottom-start"],"right-end":["left-end","top-end","bottom-end"]};function size(options){const{constrainSize,margins,matchReferenceWidth,maxWidthRef,padding=0,referenceWidthRef,setReferenceWidth,widthRef}=options;return{name:"@sanity/ui/size",async fn(args){var _maxWidthRef$current;const{elements,placement,platform,rects}=args,{floating,reference}=rects,overflow=await detectOverflow(args,{altBoundary:!0,boundary:options.boundaryElement||void 0,elementContext:"floating",padding,rootBoundary:"viewport"});let maxWidth=1/0,maxHeight=1/0;const floatingW=floating.width,floatingH=floating.height;placement.includes("top")&&(maxWidth=floatingW-(overflow.left+overflow.right),maxHeight=floatingH-overflow.top),placement.includes("right")&&(maxWidth=floatingW-overflow.right,maxHeight=floatingH-(overflow.top+overflow.bottom)),placement.includes("bottom")&&(maxWidth=floatingW-(overflow.left+overflow.right),maxHeight=floatingH-overflow.bottom),placement.includes("left")&&(maxWidth=floatingW-overflow.left,maxHeight=floatingH-(overflow.top+overflow.bottom));const availableWidth=maxWidth-margins[1]-margins[3],availableHeight=maxHeight-margins[0]-margins[2],referenceWidth=reference.width-margins[1]-margins[3];referenceWidthRef.current=referenceWidth,setReferenceWidth(referenceWidth),matchReferenceWidth?elements.floating.style.width="".concat(referenceWidth,"px"):widthRef.current!==void 0&&(elements.floating.style.width="".concat(widthRef.current,"px")),constrainSize&&(elements.floating.style.maxWidth="".concat(Math.min(availableWidth,(_maxWidthRef$current=maxWidthRef.current)!==null&&_maxWidthRef$current!==void 0?_maxWidthRef$current:1/0),"px"),elements.floating.style.maxHeight="".concat(availableHeight,"px"));const nextDimensions=await platform.getDimensions(elements.floating),targetH=nextDimensions.height,targetW=nextDimensions.width;return floatingW!==targetW||floatingH!==targetH?{reset:{rects:!0}}:{};}};}function calcCurrentWidth(params){const{container,mediaIndex,width}=params,w=width[mediaIndex],currentWidth=w===void 0?width[width.length-1]:w;return typeof currentWidth=="number"?container[currentWidth]:void 0;}function calcMaxWidth(params){const{boundaryWidth,currentWidth}=params;if(!(currentWidth===void 0&&boundaryWidth===void 0))return Math.min(currentWidth!==null&¤tWidth!==void 0?currentWidth:1/0,(boundaryWidth||1/0)-DEFAULT_POPOVER_PADDING*2);}const MotionCard$1=styled(motion.create(Card)).withConfig({displayName:"MotionCard",componentId:"sc-ihg31s-0"})(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;"]))),MotionFlex=styled(motion.create(Flex)).withConfig({displayName:"MotionFlex",componentId:"sc-ihg31s-1"})(_templateObject33||(_templateObject33=_taggedTemplateLiteral(["will-change:opacity;"]))),PopoverCard=forwardRef(function(props,ref){var _props20;const $=dist.c(66);let animate,arrow2,arrowRef,arrowX,arrowY,children,marginsProp,originX,originY,overflow,padding,placement,radius,restProps,scheme,shadow,strategy,style,tone,width,xProp,yProp;$[0]!==props?(_props20=props,{__unstable_margins:marginsProp,animate,arrow:arrow2,arrowRef,arrowX,arrowY,children,padding,placement,originX,originY,overflow,radius,scheme,shadow,strategy,style,tone,width,x:xProp,y:yProp}=_props20,restProps=_objectWithoutProperties(_props20,_excluded35),_props20,$[0]=props,$[1]=animate,$[2]=arrow2,$[3]=arrowRef,$[4]=arrowX,$[5]=arrowY,$[6]=children,$[7]=marginsProp,$[8]=originX,$[9]=originY,$[10]=overflow,$[11]=padding,$[12]=placement,$[13]=radius,$[14]=restProps,$[15]=scheme,$[16]=shadow,$[17]=strategy,$[18]=style,$[19]=tone,$[20]=width,$[21]=xProp,$[22]=yProp):(animate=$[1],arrow2=$[2],arrowRef=$[3],arrowX=$[4],arrowY=$[5],children=$[6],marginsProp=$[7],originX=$[8],originY=$[9],overflow=$[10],padding=$[11],placement=$[12],radius=$[13],restProps=$[14],scheme=$[15],shadow=$[16],strategy=$[17],style=$[18],tone=$[19],width=$[20],xProp=$[21],yProp=$[22]);const{zIndex}=useLayer(),margins=marginsProp||DEFAULT_POPOVER_MARGINS,x=(xProp!==null&&xProp!==void 0?xProp:0)+margins[3],y=(yProp!==null&&yProp!==void 0?yProp:0)+margins[0],t0=animate?"transform":void 0;let t1;$[23]!==originX||$[24]!==originY||$[25]!==strategy||$[26]!==style||$[27]!==t0||$[28]!==width||$[29]!==x||$[30]!==y||$[31]!==zIndex?(t1=_objectSpread({left:x,originX,originY,position:strategy,top:y,width,zIndex,willChange:t0},style),$[23]=originX,$[24]=originY,$[25]=strategy,$[26]=style,$[27]=t0,$[28]=width,$[29]=x,$[30]=y,$[31]=zIndex,$[32]=t1):t1=$[32];const rootStyle2=t1,t2=arrowX!==null?arrowX:void 0,t3=arrowY!==null?arrowY:void 0;let t4;$[33]!==t2||$[34]!==t3?(t4={left:t2,top:t3,right:void 0,bottom:void 0},$[33]=t2,$[34]=t3,$[35]=t4):t4=$[35];const arrowStyle=t4,t5=restProps;let t6;$[36]!==animate?(t6=animate?["hidden","initial"]:void 0,$[36]=animate,$[37]=t6):t6=$[37];let t7;$[38]!==animate?(t7=animate?["visible","scaleIn"]:void 0,$[38]=animate,$[39]=t7):t7=$[39];let t8;$[40]!==animate?(t8=animate?["hidden","scaleOut"]:void 0,$[40]=animate,$[41]=t8):t8=$[41];let t9;$[42]!==children||$[43]!==padding?(t9=/* @__PURE__ */jsx(Flex,{direction:"column",flex:1,padding,children}),$[42]=children,$[43]=padding,$[44]=t9):t9=$[44];let t10;$[45]!==overflow||$[46]!==t9?(t10=/* @__PURE__ */jsx(MotionFlex,{"data-ui":"Popover__wrapper",direction:"column",flex:1,overflow,variants:POPOVER_MOTION_PROPS.children,transition:POPOVER_MOTION_PROPS.transition,children:t9}),$[45]=overflow,$[46]=t9,$[47]=t10):t10=$[47];let t11;$[48]!==arrow2||$[49]!==arrowRef||$[50]!==arrowStyle?(t11=arrow2&&/* @__PURE__ */jsx(Arrow,{ref:arrowRef,style:arrowStyle,width:DEFAULT_POPOVER_ARROW_WIDTH,height:DEFAULT_POPOVER_ARROW_HEIGHT,radius:DEFAULT_POPOVER_ARROW_RADIUS}),$[48]=arrow2,$[49]=arrowRef,$[50]=arrowStyle,$[51]=t11):t11=$[51];let t12;return $[52]!==placement||$[53]!==radius||$[54]!==ref||$[55]!==rootStyle2||$[56]!==scheme||$[57]!==shadow||$[58]!==t10||$[59]!==t11||$[60]!==t5||$[61]!==t6||$[62]!==t7||$[63]!==t8||$[64]!==tone?(t12=/* @__PURE__ */jsxs(MotionCard$1,_objectSpread(_objectSpread({"data-ui":"Popover"},t5),{},{"data-placement":placement,radius,ref,scheme,shadow,sizing:"border",style:rootStyle2,tone,variants:POPOVER_MOTION_PROPS.card,transition:POPOVER_MOTION_PROPS.transition,initial:t6,animate:t7,exit:t8,children:[t10,t11]})),$[52]=placement,$[53]=radius,$[54]=ref,$[55]=rootStyle2,$[56]=scheme,$[57]=shadow,$[58]=t10,$[59]=t11,$[60]=t5,$[61]=t6,$[62]=t7,$[63]=t8,$[64]=tone,$[65]=t12):t12=$[65],t12;});PopoverCard.displayName="ForwardRef(PopoverCard)";const ViewportOverlay=()=>{const $=dist.c(2),{zIndex}=useLayer();let t0;return $[0]!==zIndex?(t0=/* @__PURE__ */jsx("div",{style:{height:"100vh",inset:0,position:"fixed",width:"100vw",zIndex}}),$[0]=zIndex,$[1]=t0):t0=$[1],t0;},Popover=forwardRef(function(props,forwardedRef){var _props$placement,_ref73,_ref74,_useElementSize2,_middlewareData$hide,_middlewareData$arrow2,_middlewareData$arrow3,_middlewareData$Sani,_middlewareData$Sani2;const $=dist.c(126),{container,layer}=useTheme_v2(),boundaryElementContext=useBoundaryElement();let _boundaryElement,_fallbackPlacements,_floatingBoundary,_referenceBoundary,_zOffsetProp,childProp,content,disabled,matchReferenceWidth,modal,open,paddingProp,portal,referenceElement,restProps,scheme,t0,t1,t10,t11,t2,t3,t4,t5,t6,t7,t8,t9,updateRef;if($[0]!==props){const{__unstable_margins:t122,animate:t132,arrow:t142,boundaryElement:t152,children:t162,constrainSize:t172,content:t182,disabled:t192,fallbackPlacements:t202,matchReferenceWidth:t212,floatingBoundary:t222,modal:t232,onActivate,open:t242,overflow:t252,padding:t262,placement:t272,placementStrategy:t282,portal:t292,preventOverflow:t302,radius:t312,referenceBoundary:t322,referenceElement:t332,scheme:t342,shadow:t352,tone:t362,width:t372,zOffset:t382,updateRef:t392}=props,t402=_objectWithoutProperties(props,_excluded36);t0=t122,t1=t132,t2=t142,_boundaryElement=t152,childProp=t162,t3=t172,content=t182,disabled=t192,_fallbackPlacements=t202,matchReferenceWidth=t212,_floatingBoundary=t222,modal=t232,open=t242,t4=t252,paddingProp=t262,t5=t272,t6=t282,portal=t292,t7=t302,t8=t312,_referenceBoundary=t322,referenceElement=t332,scheme=t342,t9=t352,t10=t362,t11=t372,_zOffsetProp=t382,updateRef=t392,restProps=t402,$[0]=props,$[1]=_boundaryElement,$[2]=_fallbackPlacements,$[3]=_floatingBoundary,$[4]=_referenceBoundary,$[5]=_zOffsetProp,$[6]=childProp,$[7]=content,$[8]=disabled,$[9]=matchReferenceWidth,$[10]=modal,$[11]=open,$[12]=paddingProp,$[13]=portal,$[14]=referenceElement,$[15]=restProps,$[16]=scheme,$[17]=t0,$[18]=t1,$[19]=t10,$[20]=t11,$[21]=t2,$[22]=t3,$[23]=t4,$[24]=t5,$[25]=t6,$[26]=t7,$[27]=t8,$[28]=t9,$[29]=updateRef;}else _boundaryElement=$[1],_fallbackPlacements=$[2],_floatingBoundary=$[3],_referenceBoundary=$[4],_zOffsetProp=$[5],childProp=$[6],content=$[7],disabled=$[8],matchReferenceWidth=$[9],modal=$[10],open=$[11],paddingProp=$[12],portal=$[13],referenceElement=$[14],restProps=$[15],scheme=$[16],t0=$[17],t1=$[18],t10=$[19],t11=$[20],t2=$[21],t3=$[22],t4=$[23],t5=$[24],t6=$[25],t7=$[26],t8=$[27],t9=$[28],updateRef=$[29];const margins=t0===void 0?DEFAULT_POPOVER_MARGINS:t0,_animate=t1===void 0?!1:t1,arrowProp=t2===void 0?!1:t2,constrainSize=t3===void 0?!1:t3,overflow=t4===void 0?"hidden":t4,placementProp=t5===void 0?"bottom":t5,placementStrategy=t6===void 0?"flip":t6,preventOverflow=t7===void 0?!0:t7,radiusProp=t8===void 0?3:t8,shadowProp=t9===void 0?3:t9,tone=t10===void 0?"inherit":t10,widthProp=t11===void 0?"auto":t11,boundaryElement=_boundaryElement!==null&&_boundaryElement!==void 0?_boundaryElement:boundaryElementContext===null||boundaryElementContext===void 0?void 0:boundaryElementContext.element,fallbackPlacements=_fallbackPlacements!==null&&_fallbackPlacements!==void 0?_fallbackPlacements:DEFAULT_FALLBACK_PLACEMENTS$1[(_props$placement=props.placement)!==null&&_props$placement!==void 0?_props$placement:"bottom"],floatingBoundary=(_ref73=_floatingBoundary!==null&&_floatingBoundary!==void 0?_floatingBoundary:props.boundaryElement)!==null&&_ref73!==void 0?_ref73:boundaryElementContext.element,referenceBoundary=(_ref74=_referenceBoundary!==null&&_referenceBoundary!==void 0?_referenceBoundary:props.boundaryElement)!==null&&_ref74!==void 0?_ref74:boundaryElementContext.element,zOffsetProp=_zOffsetProp!==null&&_zOffsetProp!==void 0?_zOffsetProp:layer.popover.zOffset,animate=usePrefersReducedMotion()?!1:_animate,boundarySize=(_useElementSize2=useElementSize(boundaryElement))===null||_useElementSize2===void 0?void 0:_useElementSize2.border;let t12;$[30]!==paddingProp?(t12=_getArrayProp(paddingProp),$[30]=paddingProp,$[31]=t12):t12=$[31];const padding=t12;let t13;$[32]!==radiusProp?(t13=_getArrayProp(radiusProp),$[32]=radiusProp,$[33]=t13):t13=$[33];const radius=t13;let t14;$[34]!==shadowProp?(t14=_getArrayProp(shadowProp),$[34]=shadowProp,$[35]=t14):t14=$[35];const shadow=t14,widthArrayProp=_getArrayProp(widthProp);let t15;$[36]!==zOffsetProp?(t15=_getArrayProp(zOffsetProp),$[36]=zOffsetProp,$[37]=t15):t15=$[37];const zOffset=t15,ref=useRef$1(null),arrowRef=useRef$1(null);let t16;$[38]===Symbol.for("react.memo_cache_sentinel")?(t16=()=>ref.current,$[38]=t16):t16=$[38],useImperativeHandle(forwardedRef,t16);const mediaIndex=useMediaIndex(),boundaryWidth=constrainSize||preventOverflow?boundarySize===null||boundarySize===void 0?void 0:boundarySize.width:void 0,width=calcCurrentWidth({container,mediaIndex,width:widthArrayProp}),widthRef=useRef$1(width);let t17,t18;$[39]!==width?(t17=()=>{widthRef.current=width;},t18=[width],$[39]=width,$[40]=t17,$[41]=t18):(t17=$[40],t18=$[41]),useEffect$1(t17,t18);let t19;$[42]!==boundaryWidth||$[43]!==width?(t19=calcMaxWidth({boundaryWidth,currentWidth:width}),$[42]=boundaryWidth,$[43]=width,$[44]=t19):t19=$[44];const maxWidth=t19,maxWidthRef=useRef$1(maxWidth);let t20,t21;$[45]!==maxWidth?(t20=()=>{maxWidthRef.current=maxWidth;},t21=[maxWidth],$[45]=maxWidth,$[46]=t20,$[47]=t21):(t20=$[46],t21=$[47]),useEffect$1(t20,t21);const referenceWidthRef=useRef$1(void 0);let t22,t23;$[48]!==matchReferenceWidth||$[49]!==maxWidth||$[50]!==open||$[51]!==width?(t22=()=>{const floatingElement=ref.current;if(!open||!floatingElement)return;const referenceWidth=referenceWidthRef.current;matchReferenceWidth?referenceWidth!==void 0&&(floatingElement.style.width="".concat(referenceWidth,"px")):width!==void 0&&(floatingElement.style.width="".concat(width,"px")),typeof maxWidth=="number"&&(floatingElement.style.maxWidth="".concat(maxWidth,"px"));},t23=[width,matchReferenceWidth,maxWidth,open],$[48]=matchReferenceWidth,$[49]=maxWidth,$[50]=open,$[51]=width,$[52]=t22,$[53]=t23):(t22=$[52],t23=$[53]),useEffect$1(t22,t23);const[referenceWidth_0,setReferenceWidth]=useState(void 0);let t24;$[54]!==animate||$[55]!==arrowProp||$[56]!==constrainSize||$[57]!==fallbackPlacements||$[58]!==floatingBoundary||$[59]!==margins||$[60]!==matchReferenceWidth||$[61]!==placementProp||$[62]!==placementStrategy||$[63]!==preventOverflow||$[64]!==referenceBoundary?(t24={animate,arrowProp,arrowRef,constrainSize,fallbackPlacements,floatingBoundary,margins,matchReferenceWidth,maxWidthRef,placementProp,placementStrategy,preventOverflow,referenceBoundary,referenceWidthRef,rootBoundary:"viewport",setReferenceWidth,widthRef},$[54]=animate,$[55]=arrowProp,$[56]=constrainSize,$[57]=fallbackPlacements,$[58]=floatingBoundary,$[59]=margins,$[60]=matchReferenceWidth,$[61]=placementProp,$[62]=placementStrategy,$[63]=preventOverflow,$[64]=referenceBoundary,$[65]=t24):t24=$[65];const middleware=useMiddleware$1(t24);let t25;$[66]!==referenceElement?(t25=referenceElement?{reference:referenceElement}:void 0,$[66]=referenceElement,$[67]=t25):t25=$[67];let t26;$[68]!==middleware||$[69]!==placementProp||$[70]!==t25?(t26={middleware,placement:placementProp,whileElementsMounted:autoUpdate,elements:t25},$[68]=middleware,$[69]=placementProp,$[70]=t25,$[71]=t26):t26=$[71];const{x,y,middlewareData,placement,refs,strategy,update}=useFloating(t26),referenceHidden=(_middlewareData$hide=middlewareData.hide)===null||_middlewareData$hide===void 0?void 0:_middlewareData$hide.referenceHidden,arrowX=(_middlewareData$arrow2=middlewareData.arrow)===null||_middlewareData$arrow2===void 0?void 0:_middlewareData$arrow2.x,arrowY=(_middlewareData$arrow3=middlewareData.arrow)===null||_middlewareData$arrow3===void 0?void 0:_middlewareData$arrow3.y,originX=(_middlewareData$Sani=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani===void 0?void 0:_middlewareData$Sani.originX,originY=(_middlewareData$Sani2=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani2===void 0?void 0:_middlewareData$Sani2.originY;let t27;$[72]===Symbol.for("react.memo_cache_sentinel")?(t27=arrowEl=>{arrowRef.current=arrowEl;},$[72]=t27):t27=$[72];const setArrow=t27;let t28;$[73]!==refs?(t28=node=>{ref.current=node,refs.setFloating(node);},$[73]=refs,$[74]=t28):t28=$[74];const setFloating=t28;let t29;$[75]!==childProp?(t29=childProp?getElementRef(childProp):null,$[75]=childProp,$[76]=t29):t29=$[76];let t30;$[77]!==refs.reference.current?(t30=()=>refs.reference.current,$[77]=refs.reference.current,$[78]=t30):t30=$[78],useImperativeHandle(t29,t30);let t31;bb0:{if(referenceElement){t31=childProp;break bb0;}if(!childProp){t31=null;break bb0;}let t322;$[79]!==childProp||$[80]!==refs.setReference?(t322=cloneElement(childProp,{ref:refs.setReference}),$[79]=childProp,$[80]=refs.setReference,$[81]=t322):t322=$[81],t31=t322;}const child=t31;let t32,t33;if($[82]!==update?(t32=()=>update,t33=[update],$[82]=update,$[83]=t32,$[84]=t33):(t32=$[83],t33=$[84]),useImperativeHandle(updateRef,t32,t33),disabled){let t342;return $[85]!==childProp?(t342=childProp||/* @__PURE__ */jsx(Fragment,{}),$[85]=childProp,$[86]=t342):t342=$[86],t342;}let t34;$[87]!==modal?(t34=modal&&/* @__PURE__ */jsx(ViewportOverlay,{}),$[87]=modal,$[88]=t34):t34=$[88];const t35=matchReferenceWidth?referenceWidth_0:width;let t36;$[89]!==animate||$[90]!==arrowProp||$[91]!==arrowX||$[92]!==arrowY||$[93]!==content||$[94]!==margins||$[95]!==originX||$[96]!==originY||$[97]!==overflow||$[98]!==padding||$[99]!==placement||$[100]!==radius||$[101]!==referenceHidden||$[102]!==restProps||$[103]!==scheme||$[104]!==setFloating||$[105]!==shadow||$[106]!==strategy||$[107]!==t35||$[108]!==tone||$[109]!==x||$[110]!==y?(t36=/* @__PURE__ */jsx(PopoverCard,_objectSpread(_objectSpread({},restProps),{},{__unstable_margins:margins,animate,arrow:arrowProp,arrowRef:setArrow,arrowX,arrowY,hidden:referenceHidden,overflow,padding,placement,radius,ref:setFloating,scheme,shadow,originX,originY,strategy,tone,width:t35,x,y,children:content})),$[89]=animate,$[90]=arrowProp,$[91]=arrowX,$[92]=arrowY,$[93]=content,$[94]=margins,$[95]=originX,$[96]=originY,$[97]=overflow,$[98]=padding,$[99]=placement,$[100]=radius,$[101]=referenceHidden,$[102]=restProps,$[103]=scheme,$[104]=setFloating,$[105]=shadow,$[106]=strategy,$[107]=t35,$[108]=tone,$[109]=x,$[110]=y,$[111]=t36):t36=$[111];let t37;$[112]!==t34||$[113]!==t36||$[114]!==zOffset?(t37=/* @__PURE__ */jsxs(LayerProvider,{zOffset,children:[t34,t36]}),$[112]=t34,$[113]=t36,$[114]=zOffset,$[115]=t37):t37=$[115];const popover=t37;let t38;$[116]!==open||$[117]!==popover||$[118]!==portal?(t38=open&&(portal?/* @__PURE__ */jsx(Portal,{__unstable_name:typeof portal=="string"?portal:void 0,children:popover}):popover),$[116]=open,$[117]=popover,$[118]=portal,$[119]=t38):t38=$[119];const children=t38;let t39;$[120]!==animate||$[121]!==children?(t39=animate?/* @__PURE__ */jsx(AnimatePresence,{children}):children,$[120]=animate,$[121]=children,$[122]=t39):t39=$[122];let t40;return $[123]!==child||$[124]!==t39?(t40=/* @__PURE__ */jsxs(Fragment,{children:[t39,child]}),$[123]=child,$[124]=t39,$[125]=t40):t40=$[125],t40;});Popover.displayName="ForwardRef(Popover)";function useMiddleware$1(t0){const $=dist.c(42),{animate,arrowProp,arrowRef,constrainSize,fallbackPlacements,floatingBoundary,margins,matchReferenceWidth,maxWidthRef,placementProp,placementStrategy,preventOverflow,referenceBoundary,referenceWidthRef,rootBoundary,setReferenceWidth,widthRef}=t0;let ret;if($[0]!==animate||$[1]!==arrowProp||$[2]!==arrowRef||$[3]!==constrainSize||$[4]!==fallbackPlacements||$[5]!==floatingBoundary||$[6]!==margins||$[7]!==matchReferenceWidth||$[8]!==maxWidthRef||$[9]!==placementProp||$[10]!==placementStrategy||$[11]!==preventOverflow||$[12]!==referenceBoundary||$[13]!==referenceWidthRef||$[14]!==rootBoundary||$[15]!==setReferenceWidth||$[16]!==widthRef){if(ret=[],constrainSize||preventOverflow)if(placementStrategy==="autoPlacement"){let t12;$[18]!==fallbackPlacements||$[19]!==placementProp?(t12=autoPlacement({allowedPlacements:[placementProp].concat(fallbackPlacements)}),$[18]=fallbackPlacements,$[19]=placementProp,$[20]=t12):t12=$[20],ret.push(t12);}else{const t12=floatingBoundary||void 0;let t22;$[21]!==fallbackPlacements||$[22]!==rootBoundary||$[23]!==t12?(t22=flip({boundary:t12,fallbackPlacements,padding:DEFAULT_POPOVER_PADDING,rootBoundary}),$[21]=fallbackPlacements,$[22]=rootBoundary,$[23]=t12,$[24]=t22):t22=$[24],ret.push(t22);}let t1;if($[25]===Symbol.for("react.memo_cache_sentinel")?(t1=offset({mainAxis:DEFAULT_POPOVER_DISTANCE}),$[25]=t1):t1=$[25],ret.push(t1),constrainSize||matchReferenceWidth){const t22=floatingBoundary||void 0;let t32;$[26]!==constrainSize||$[27]!==margins||$[28]!==matchReferenceWidth||$[29]!==maxWidthRef||$[30]!==referenceWidthRef||$[31]!==setReferenceWidth||$[32]!==t22||$[33]!==widthRef?(t32=size({boundaryElement:t22,constrainSize,margins,matchReferenceWidth,maxWidthRef,padding:DEFAULT_POPOVER_PADDING,referenceWidthRef,setReferenceWidth,widthRef}),$[26]=constrainSize,$[27]=margins,$[28]=matchReferenceWidth,$[29]=maxWidthRef,$[30]=referenceWidthRef,$[31]=setReferenceWidth,$[32]=t22,$[33]=widthRef,$[34]=t32):t32=$[34],ret.push(t32);}if(preventOverflow){const t22=floatingBoundary||void 0;let t32;$[35]!==rootBoundary||$[36]!==t22?(t32=shift({boundary:t22,rootBoundary,padding:DEFAULT_POPOVER_PADDING}),$[35]=rootBoundary,$[36]=t22,$[37]=t32):t32=$[37],ret.push(t32);}if(arrowProp){let t22;$[38]!==arrowRef?(t22=arrow({element:arrowRef,padding:DEFAULT_POPOVER_PADDING}),$[38]=arrowRef,$[39]=t22):t22=$[39],ret.push(t22);}animate&&ret.push(origin);const t2=referenceBoundary||void 0;let t3;$[40]!==t2?(t3=hide({boundary:t2,padding:DEFAULT_POPOVER_PADDING,strategy:"referenceHidden"}),$[40]=t2,$[41]=t3):t3=$[41],ret.push(t3),$[0]=animate,$[1]=arrowProp,$[2]=arrowRef,$[3]=constrainSize,$[4]=fallbackPlacements,$[5]=floatingBoundary,$[6]=margins,$[7]=matchReferenceWidth,$[8]=maxWidthRef,$[9]=placementProp,$[10]=placementStrategy,$[11]=preventOverflow,$[12]=referenceBoundary,$[13]=referenceWidthRef,$[14]=rootBoundary,$[15]=setReferenceWidth,$[16]=widthRef,$[17]=ret;}else ret=$[17];return ret;}function radioBaseStyle(){return css(_templateObject34||(_templateObject34=_taggedTemplateLiteral(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));}function inputElementStyle(props){const{color,input}=getTheme_v2(props.theme),dist=(input.radio.size-input.radio.markSize)/2;return css(_templateObject35||(_templateObject35=_taggedTemplateLiteral(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ",";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ",";\n width: ",";\n border-radius: ",";\n background: ",";\n box-shadow: ",";\n\n &::after {\n content: '';\n position: absolute;\n top: ",";\n left: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n background: ",";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ",";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ",";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ",";\n box-shadow: ",";\n &::after {\n background: ",";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ",";\n background: ",";\n\n &::after {\n background: ",";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ",";\n background: ",";\n\n &::after {\n background: ",";\n }\n }\n "])),rem(input.radio.size/2),rem(input.radio.size),rem(input.radio.size),rem(input.radio.size/2),color.input.default.enabled.bg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),rem(dist),rem(dist),rem(input.radio.markSize),rem(input.radio.markSize),rem(input.radio.markSize/2),color.input.default.enabled.fg,focusRingStyle({border:{width:input.border.width,color:color.input.default.enabled.border},focusRing:input.radio.focusRing}),focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.invalid.enabled.border,focusRingBorderStyle({width:input.border.width,color:color.input.invalid.enabled.muted.bg}),color.input.invalid.enabled.muted.bg,color.input.default.readOnly.border,color.input.default.readOnly.bg,color.input.default.readOnly.border,color.input.default.disabled.border,color.input.default.disabled.bg,color.input.default.disabled.border);}const StyledRadio=/* @__PURE__ */styled.div.withConfig({displayName:"StyledRadio",componentId:"sc-ccrwkf-0"})(radioBaseStyle),Input$4=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-ccrwkf-1"})(inputElementStyle),Radio=forwardRef(function(props,forwardedRef){var _props21;const $=dist.c(19);let className,customValidity,disabled,readOnly,restProps,style;$[0]!==props?(_props21=props,{className,disabled,style,customValidity,readOnly}=_props21,restProps=_objectWithoutProperties(_props21,_excluded37),_props21,$[0]=props,$[1]=className,$[2]=customValidity,$[3]=disabled,$[4]=readOnly,$[5]=restProps,$[6]=style):(className=$[1],customValidity=$[2],disabled=$[3],readOnly=$[4],restProps=$[5],style=$[6]);const ref=useRef$1(null);let t0;$[7]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[7]=t0):t0=$[7],useImperativeHandle(forwardedRef,t0),useCustomValidity(ref,customValidity);const t1=!disabled&&readOnly?"":void 0,t2=customValidity?"":void 0,t3=disabled||readOnly;let t4;$[8]!==readOnly||$[9]!==restProps||$[10]!==t1||$[11]!==t2||$[12]!==t3?(t4=/* @__PURE__ */jsx(Input$4,_objectSpread(_objectSpread({"data-read-only":t1,"data-error":t2},restProps),{},{disabled:t3,readOnly,ref,type:"radio"})),$[8]=readOnly,$[9]=restProps,$[10]=t1,$[11]=t2,$[12]=t3,$[13]=t4):t4=$[13];let t5;$[14]===Symbol.for("react.memo_cache_sentinel")?(t5=/* @__PURE__ */jsx("span",{}),$[14]=t5):t5=$[14];let t6;return $[15]!==className||$[16]!==style||$[17]!==t4?(t6=/* @__PURE__ */jsxs(StyledRadio,{className,"data-ui":"Radio",style,children:[t4,t5]}),$[15]=className,$[16]=style,$[17]=t4,$[18]=t6):t6=$[18],t6;});Radio.displayName="ForwardRef(Radio)";function rootStyle(){return css(_templateObject36||(_templateObject36=_taggedTemplateLiteral(["\n position: relative;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}function inputBaseStyle(props){const{font}=getTheme_v2(props.theme);return css(_templateObject37||(_templateObject37=_taggedTemplateLiteral(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ",";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])),font.text.family);}function inputColorStyle(props){const{color,input}=getTheme_v2(props.theme);return css(_templateObject38||(_templateObject38=_taggedTemplateLiteral(["\n /* enabled */\n background-color: ",";\n color: ",";\n box-shadow: ",";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ",";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n "])),color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.default.hovered.bg,color.input.default.hovered.fg,focusRingBorderStyle({color:color.input.default.hovered.border,width:input.border.width}),focusRingStyle({border:{width:input.border.width,color:color.input.default.enabled.border},focusRing:input.select.focusRing}),color.input.default.readOnly.bg,color.input.default.readOnly.fg,focusRingBorderStyle({color:color.input.default.readOnly.border,width:input.border.width}),color.input.default.disabled.bg,color.input.default.disabled.fg,focusRingBorderStyle({color:color.input.default.disabled.border,width:input.border.width}));}function textSize(size2){return{fontSize:rem(size2.fontSize),lineHeight:"".concat(rem(size2.lineHeight))};}function inputTextSizeStyle(props){const{$fontSize}=props,{font,media}=getTheme_v2(props.theme);return _responsive(media,$fontSize,sizeIndex=>textSize(font.text.sizes[sizeIndex]||font.text.sizes[2]));}function inputStyle(){return[responsiveRadiusStyle,inputBaseStyle,inputColorStyle,inputTextSizeStyle,responsiveInputPaddingIconRightStyle];}function iconBoxStyle(props){const{color}=getTheme_v2(props.theme);return css(_templateObject39||(_templateObject39=_taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ",";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ",";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ",";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ",";\n }\n "])),color.input.default.enabled.fg,color.input.default.hovered.fg,color.input.default.disabled.fg,color.input.default.readOnly.fg);}const selectStyle={root:rootStyle,input:inputStyle,iconBox:iconBoxStyle},StyledSelect=/* @__PURE__ */styled.div.withConfig({displayName:"StyledSelect",componentId:"sc-5mxno7-0"})(selectStyle.root),Input$3=/* @__PURE__ */styled.select.withConfig({displayName:"Input",componentId:"sc-5mxno7-1"})(selectStyle.input),IconBox=/* @__PURE__ */styled(Box).withConfig({displayName:"IconBox",componentId:"sc-5mxno7-2"})(selectStyle.iconBox),Select=forwardRef(function(props,forwardedRef){var _props22;const $=dist.c(37);let children,customValidity,disabled,readOnly,restProps,t0,t1,t2,t3;$[0]!==props?(_props22=props,{children,customValidity,disabled,fontSize:t0,padding:t1,radius:t2,readOnly,space:t3}=_props22,restProps=_objectWithoutProperties(_props22,_excluded38),_props22,$[0]=props,$[1]=children,$[2]=customValidity,$[3]=disabled,$[4]=readOnly,$[5]=restProps,$[6]=t0,$[7]=t1,$[8]=t2,$[9]=t3):(children=$[1],customValidity=$[2],disabled=$[3],readOnly=$[4],restProps=$[5],t0=$[6],t1=$[7],t2=$[8],t3=$[9]);const fontSize2=t0===void 0?2:t0,padding=t1===void 0?3:t1,radius=t2===void 0?2:t2,space=t3===void 0?3:t3,ref=useRef$1(null);let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[10]=t4):t4=$[10],useImperativeHandle(forwardedRef,t4),useCustomValidity(ref,customValidity);const t5=!disabled&&readOnly?"":void 0;let t6;$[11]!==fontSize2?(t6=_getArrayProp(fontSize2),$[11]=fontSize2,$[12]=t6):t6=$[12];let t7;$[13]!==padding?(t7=_getArrayProp(padding),$[13]=padding,$[14]=t7):t7=$[14];let t8;$[15]!==radius?(t8=_getArrayProp(radius),$[15]=radius,$[16]=t8):t8=$[16];let t9;$[17]!==space?(t9=_getArrayProp(space),$[17]=space,$[18]=t9):t9=$[18];const t10=disabled||readOnly;let t11;$[19]!==children||$[20]!==restProps||$[21]!==t10||$[22]!==t5||$[23]!==t6||$[24]!==t7||$[25]!==t8||$[26]!==t9?(t11=/* @__PURE__ */jsx(Input$3,_objectSpread(_objectSpread({"data-read-only":t5,"data-ui":"Select"},restProps),{},{$fontSize:t6,$padding:t7,$radius:t8,$space:t9,disabled:t10,ref,children})),$[19]=children,$[20]=restProps,$[21]=t10,$[22]=t5,$[23]=t6,$[24]=t7,$[25]=t8,$[26]=t9,$[27]=t11):t11=$[27];let t12;$[28]===Symbol.for("react.memo_cache_sentinel")?(t12=/* @__PURE__ */jsx(ChevronDownIcon,{}),$[28]=t12):t12=$[28];let t13;$[29]!==fontSize2?(t13=/* @__PURE__ */jsx(Text,{size:fontSize2,children:t12}),$[29]=fontSize2,$[30]=t13):t13=$[30];let t14;$[31]!==padding||$[32]!==t13?(t14=/* @__PURE__ */jsx(IconBox,{padding,children:t13}),$[31]=padding,$[32]=t13,$[33]=t14):t14=$[33];let t15;return $[34]!==t11||$[35]!==t14?(t15=/* @__PURE__ */jsxs(StyledSelect,{"data-ui":"Select",children:[t11,t14]}),$[34]=t11,$[35]=t14,$[36]=t15):t15=$[36],t15;});Select.displayName="ForwardRef(Select)";const BASE_STYLE={"&&:not([hidden])":{display:"grid"},'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"},gridTemplateColumns:"minmax(0, 1fr)",gridAutoRows:"min-content"};function stackBaseStyle(){return BASE_STYLE;}function responsiveStackSpaceStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$space,spaceIndex=>({gridGap:rem(space[spaceIndex])}));}const StyledStack=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledStack",componentId:"sc-8dpfq2-0"})(stackBaseStyle,responsiveStackSpaceStyle),Stack=forwardRef(function(props,ref){var _props23;const $=dist.c(12);let as,restProps,space;$[0]!==props?(_props23=props,{as,space}=_props23,restProps=_objectWithoutProperties(_props23,_excluded39),_props23,$[0]=props,$[1]=as,$[2]=restProps,$[3]=space):(as=$[1],restProps=$[2],space=$[3]);const t0=typeof as=="string"?as:void 0;let t1;$[4]!==space?(t1=_getArrayProp(space),$[4]=space,$[5]=t1):t1=$[5];let t2;return $[6]!==as||$[7]!==ref||$[8]!==restProps||$[9]!==t0||$[10]!==t1?(t2=/* @__PURE__ */jsx(StyledStack,_objectSpread(_objectSpread({"data-as":t0,"data-ui":"Stack"},restProps),{},{$space:t1,forwardedAs:as,ref})),$[6]=as,$[7]=ref,$[8]=restProps,$[9]=t0,$[10]=t1,$[11]=t2):t2=$[11],t2;});Stack.displayName="ForwardRef(Stack)";function switchBaseStyles(){return css(_templateObject40||(_templateObject40=_taggedTemplateLiteral(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}function switchInputStyles(){return css(_templateObject41||(_templateObject41=_taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));}function switchRepresentationStyles(props){const{color,input}=getTheme_v2(props.theme);return css(_templateObject42||(_templateObject42=_taggedTemplateLiteral(["\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ",";\n height: ",";\n border-radius: ",";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ",";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input:checked[data-read-only]:disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n "])),color.input.default.enabled.border,color.input.default.enabled.bg,rem(input.switch.width),rem(input.switch.height),rem(input.switch.height/2),focusRingStyle({focusRing:input.switch.focusRing}),color.input.default.enabled.fg,color.input.default.enabled.bg,color.input.default.hovered.border,color.input.default.hovered.bg,color.input.default.enabled.fg,color.input.default.enabled.bg,color.input.default.disabled.border,color.input.default.disabled.bg,color.input.default.readOnly.border,color.input.default.readOnly.bg,color.input.default.readOnly.fg,color.input.default.readOnly.bg);}function switchTrackStyles(props){const{input}=getTheme_v2(props.theme);return css(_templateObject43||(_templateObject43=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ",";\n height: ",";\n border-radius: ",";\n "])),rem(input.switch.width),rem(input.switch.height),rem(input.switch.height/2));}function switchThumbStyles(props){const{$indeterminate}=props,{input}=getTheme_v2(props.theme),trackWidth=input.switch.width,trackHeight=input.switch.height,trackPadding=input.switch.padding,size2=trackHeight-input.switch.padding*2,checkedOffset=trackWidth-trackPadding*2-size2,indeterminateOffset=trackWidth/2-size2/2-trackPadding,checked=$indeterminate!==!0&&props.$checked===!0;return css(_templateObject44||(_templateObject44=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ",";\n top: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n transition-property: transform;\n transition-duration: ","ms;\n transition-timing-function: ",";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);\n\n ","\n\n ","\n "])),rem(trackPadding),rem(trackPadding),rem(size2),rem(size2),rem(size2/2),input.switch.transitionDurationMs,input.switch.transitionTimingFunction,checked&&css(_templateObject45||(_templateObject45=_taggedTemplateLiteral(["\n transform: translate3d(","px, 0, 0);\n "])),checkedOffset),$indeterminate&&css(_templateObject46||(_templateObject46=_taggedTemplateLiteral(["\n transform: translate3d(","px, 0, 0);\n "])),indeterminateOffset));}const StyledSwitch=/* @__PURE__ */styled.span.withConfig({displayName:"StyledSwitch",componentId:"sc-dw1foe-0"})(switchBaseStyles),Input$2=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-dw1foe-1"})(switchInputStyles),Representation=/* @__PURE__ */styled.span.withConfig({displayName:"Representation",componentId:"sc-dw1foe-2"})(switchRepresentationStyles),Track=/* @__PURE__ */styled.span.withConfig({displayName:"Track",componentId:"sc-dw1foe-3"})(switchTrackStyles),Thumb=/* @__PURE__ */styled.span.withConfig({displayName:"Thumb",componentId:"sc-dw1foe-4"})(switchThumbStyles),Switch=forwardRef(function(props,forwardedRef){var _props24;const $=dist.c(26);let checked,className,disabled,indeterminate,readOnly,restProps,style;$[0]!==props?(_props24=props,{checked,className,disabled,indeterminate,readOnly,style}=_props24,restProps=_objectWithoutProperties(_props24,_excluded40),_props24,$[0]=props,$[1]=checked,$[2]=className,$[3]=disabled,$[4]=indeterminate,$[5]=readOnly,$[6]=restProps,$[7]=style):(checked=$[1],className=$[2],disabled=$[3],indeterminate=$[4],readOnly=$[5],restProps=$[6],style=$[7]);const ref=useRef$1(null);let t0;$[8]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[8]=t0):t0=$[8],useImperativeHandle(forwardedRef,t0);let t1,t2;$[9]!==indeterminate?(t1=()=>{ref.current&&(ref.current.indeterminate=indeterminate||!1);},t2=[indeterminate],$[9]=indeterminate,$[10]=t1,$[11]=t2):(t1=$[10],t2=$[11]),useEffect$1(t1,t2);const t3=!disabled&&readOnly?"":void 0,t4=indeterminate!==!0&&checked,t5=disabled||readOnly;let t6;$[12]!==restProps||$[13]!==t3||$[14]!==t4||$[15]!==t5?(t6=/* @__PURE__ */jsx(Input$2,_objectSpread(_objectSpread({"data-read-only":t3},restProps),{},{checked:t4,disabled:t5,type:"checkbox",ref})),$[12]=restProps,$[13]=t3,$[14]=t4,$[15]=t5,$[16]=t6):t6=$[16];let t7;$[17]===Symbol.for("react.memo_cache_sentinel")?(t7=/* @__PURE__ */jsx(Track,{}),$[17]=t7):t7=$[17];let t8;$[18]!==checked||$[19]!==indeterminate?(t8=/* @__PURE__ */jsxs(Representation,{"aria-hidden":!0,"data-name":"representation",children:[t7,/* @__PURE__ */jsx(Thumb,{$checked:checked,$indeterminate:indeterminate})]}),$[18]=checked,$[19]=indeterminate,$[20]=t8):t8=$[20];let t9;return $[21]!==className||$[22]!==style||$[23]!==t6||$[24]!==t8?(t9=/* @__PURE__ */jsxs(StyledSwitch,{className,"data-ui":"Switch",style,children:[t6,t8]}),$[21]=className,$[22]=style,$[23]=t6,$[24]=t8,$[25]=t9):t9=$[25],t9;});Switch.displayName="ForwardRef(Switch)";const StyledTextArea=/* @__PURE__ */styled.span.withConfig({displayName:"StyledTextArea",componentId:"sc-1d6h1o8-0"})(textInputRootStyle),InputRoot$1=styled.span.withConfig({displayName:"InputRoot",componentId:"sc-1d6h1o8-1"})(_templateObject47||(_templateObject47=_taggedTemplateLiteral(["flex:1;min-width:0;display:block;position:relative;"]))),Input$1=/* @__PURE__ */styled.textarea.withConfig({displayName:"Input",componentId:"sc-1d6h1o8-2"})(responsiveInputPaddingStyle,textInputBaseStyle,textInputFontSizeStyle),Presentation$1=/* @__PURE__ */styled.div.withConfig({displayName:"Presentation",componentId:"sc-1d6h1o8-3"})(responsiveRadiusStyle,textInputRepresentationStyle),TextArea=forwardRef(function(props,forwardedRef){var _props25;const $=dist.c(35);let __unstable_disableFocusRing,customValidity,restProps,t0,t1,t2,t3,t4,weight;$[0]!==props?(_props25=props,{border:t0,customValidity,disabled:t1,fontSize:t2,padding:t3,radius:t4,weight,__unstable_disableFocusRing}=_props25,restProps=_objectWithoutProperties(_props25,_excluded41),_props25,$[0]=props,$[1]=__unstable_disableFocusRing,$[2]=customValidity,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=t3,$[8]=t4,$[9]=weight):(__unstable_disableFocusRing=$[1],customValidity=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],t3=$[7],t4=$[8],weight=$[9]);const border2=t0===void 0?!0:t0,disabled=t1===void 0?!1:t1,fontSize2=t2===void 0?2:t2,padding=t3===void 0?3:t3,radius=t4===void 0?2:t4,ref=useRef$1(null),rootTheme=useRootTheme();let t5;$[10]===Symbol.for("react.memo_cache_sentinel")?(t5=()=>ref.current,$[10]=t5):t5=$[10],useImperativeHandle(forwardedRef,t5),useCustomValidity(ref,customValidity);const t6=rootTheme.scheme,t7=rootTheme.tone;let t8;$[11]!==fontSize2?(t8=_getArrayProp(fontSize2),$[11]=fontSize2,$[12]=t8):t8=$[12];let t9;$[13]!==padding?(t9=_getArrayProp(padding),$[13]=padding,$[14]=t9):t9=$[14];const t10=rootTheme.scheme;let t11;$[15]===Symbol.for("react.memo_cache_sentinel")?(t11=_getArrayProp(0),$[15]=t11):t11=$[15];let t12;$[16]!==disabled||$[17]!==restProps||$[18]!==rootTheme.scheme||$[19]!==rootTheme.tone||$[20]!==t8||$[21]!==t9||$[22]!==weight?(t12=/* @__PURE__ */jsx(Input$1,_objectSpread(_objectSpread({"data-as":"textarea","data-scheme":t6,"data-tone":t7},restProps),{},{$fontSize:t8,$padding:t9,$scheme:t10,$space:t11,$tone:rootTheme.tone,$weight:weight,disabled,ref})),$[16]=disabled,$[17]=restProps,$[18]=rootTheme.scheme,$[19]=rootTheme.tone,$[20]=t8,$[21]=t9,$[22]=weight,$[23]=t12):t12=$[23];let t13;$[24]!==radius?(t13=_getArrayProp(radius),$[24]=radius,$[25]=t13):t13=$[25];const t14=border2?"":void 0;let t15;$[26]!==__unstable_disableFocusRing||$[27]!==rootTheme.scheme||$[28]!==rootTheme.tone||$[29]!==t13||$[30]!==t14?(t15=/* @__PURE__ */jsx(Presentation$1,{$radius:t13,$unstableDisableFocusRing:__unstable_disableFocusRing,$scheme:rootTheme.scheme,$tone:rootTheme.tone,"data-border":t14,"data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone}),$[26]=__unstable_disableFocusRing,$[27]=rootTheme.scheme,$[28]=rootTheme.tone,$[29]=t13,$[30]=t14,$[31]=t15):t15=$[31];let t16;return $[32]!==t12||$[33]!==t15?(t16=/* @__PURE__ */jsx(StyledTextArea,{"data-ui":"TextArea",children:/* @__PURE__ */jsxs(InputRoot$1,{children:[t12,t15]})}),$[32]=t12,$[33]=t15,$[34]=t16):t16=$[34],t16;});TextArea.displayName="ForwardRef(TextArea)";const CLEAR_BUTTON_BOX_STYLE={zIndex:2},StyledTextInput=/* @__PURE__ */styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"StyledTextInput",componentId:"sc-h62wco-0"})(textInputRootStyle),InputRoot=styled.span.withConfig({displayName:"InputRoot",componentId:"sc-h62wco-1"})(_templateObject48||(_templateObject48=_taggedTemplateLiteral(["flex:1;min-width:0;display:block;position:relative;"]))),Prefix=styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"Prefix",componentId:"sc-h62wco-2"})(_templateObject49||(_templateObject49=_taggedTemplateLiteral(["border-top-right-radius:0;border-bottom-right-radius:0;& > span{display:block;margin:-1px;}"]))),Suffix=styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"Suffix",componentId:"sc-h62wco-3"})(_templateObject50||(_templateObject50=_taggedTemplateLiteral(["border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}"]))),Input=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-h62wco-4"})(responsiveInputPaddingStyle,textInputBaseStyle,textInputFontSizeStyle),Presentation=/* @__PURE__ */styled.span.withConfig({displayName:"Presentation",componentId:"sc-h62wco-5"})(responsiveRadiusStyle,textInputRepresentationStyle),LeftBox=styled(Box).withConfig({displayName:"LeftBox",componentId:"sc-h62wco-6"})(_templateObject51||(_templateObject51=_taggedTemplateLiteral(["position:absolute;top:0;left:0;"]))),RightBox=styled(Box).withConfig({displayName:"RightBox",componentId:"sc-h62wco-7"})(_templateObject52||(_templateObject52=_taggedTemplateLiteral(["position:absolute;top:0;right:0;"]))),RightCard=styled(Card).withConfig({displayName:"RightCard",componentId:"sc-h62wco-8"})(_templateObject53||(_templateObject53=_taggedTemplateLiteral(["background-color:transparent;position:absolute;top:0;right:0;"]))),TextInputClearButton=/* @__PURE__ */styled(Button).withConfig({displayName:"TextInputClearButton",componentId:"sc-h62wco-9"})({"&:not([hidden])":{display:"block"}}),TextInput=forwardRef(function(props,forwardedRef){var _props26;const $=dist.c(92);let IconComponent,IconRightComponent,__unstable_disableFocusRing,clearButton,customValidity,onClear,prefix,readOnly,restProps,suffix,t0,t1,t2,t3,t4,t5,t6,weight;$[0]!==props?(_props26=props,{__unstable_disableFocusRing,border:t0,clearButton,disabled:t1,fontSize:t2,icon:IconComponent,iconRight:IconRightComponent,onClear,padding:t3,prefix,radius:t4,readOnly,space:t5,suffix,customValidity,type:t6,weight}=_props26,restProps=_objectWithoutProperties(_props26,_excluded42),_props26,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=__unstable_disableFocusRing,$[4]=clearButton,$[5]=customValidity,$[6]=onClear,$[7]=prefix,$[8]=readOnly,$[9]=restProps,$[10]=suffix,$[11]=t0,$[12]=t1,$[13]=t2,$[14]=t3,$[15]=t4,$[16]=t5,$[17]=t6,$[18]=weight):(IconComponent=$[1],IconRightComponent=$[2],__unstable_disableFocusRing=$[3],clearButton=$[4],customValidity=$[5],onClear=$[6],prefix=$[7],readOnly=$[8],restProps=$[9],suffix=$[10],t0=$[11],t1=$[12],t2=$[13],t3=$[14],t4=$[15],t5=$[16],t6=$[17],weight=$[18]);const border2=t0===void 0?!0:t0,disabled=t1===void 0?!1:t1,fontSizeProp=t2===void 0?2:t2,paddingProp=t3===void 0?3:t3,radiusProp=t4===void 0?2:t4,spaceProp=t5===void 0?3:t5,type=t6===void 0?"text":t6,ref=useRef$1(null),rootTheme=useRootTheme();let t7;$[19]!==fontSizeProp?(t7=_getArrayProp(fontSizeProp),$[19]=fontSizeProp,$[20]=t7):t7=$[20];const fontSize2=t7;let t8;$[21]!==paddingProp?(t8=_getArrayProp(paddingProp),$[21]=paddingProp,$[22]=t8):t8=$[22];const padding=t8;let t9;$[23]!==radiusProp?(t9=_getArrayProp(radiusProp),$[23]=radiusProp,$[24]=t9):t9=$[24];const radius=t9;let t10;$[25]!==spaceProp?(t10=_getArrayProp(spaceProp),$[25]=spaceProp,$[26]=t10):t10=$[26];const space=t10,$hasClearButton=!!clearButton,$hasIcon=!!IconComponent,$hasIconRight=!!IconRightComponent,$hasSuffix=!!suffix,$hasPrefix=!!prefix;let t11;$[27]===Symbol.for("react.memo_cache_sentinel")?(t11=()=>ref.current,$[27]=t11):t11=$[27],useImperativeHandle(forwardedRef,t11),useCustomValidity(ref,customValidity);const handleClearMouseDown=_temp$2$1;let t12;$[28]!==onClear?(t12=event_0=>{var _ref$current2;event_0.preventDefault(),event_0.stopPropagation(),onClear&&onClear(),(_ref$current2=ref.current)===null||_ref$current2===void 0?void 0:_ref$current2.focus();},$[28]=onClear,$[29]=t12):t12=$[29];const handleClearClick=t12;let t13;$[30]!==prefix||$[31]!==radius?(t13=prefix&&/* @__PURE__ */jsx(Prefix,{borderTop:!0,borderLeft:!0,borderBottom:!0,radius,sizing:"border",tone:"inherit",children:/* @__PURE__ */jsx("span",{children:prefix})}),$[30]=prefix,$[31]=radius,$[32]=t13):t13=$[32];const prefixNode=t13,t14=border2?"":void 0;let t15;$[33]!==IconComponent||$[34]!==fontSize2||$[35]!==padding?(t15=IconComponent&&/* @__PURE__ */jsx(LeftBox,{padding,children:/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]})}),$[33]=IconComponent,$[34]=fontSize2,$[35]=padding,$[36]=t15):t15=$[36];let t16;$[37]!==$hasClearButton||$[38]!==IconRightComponent||$[39]!==fontSize2||$[40]!==padding?(t16=!$hasClearButton&&IconRightComponent&&/* @__PURE__ */jsx(RightBox,{padding,children:/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})}),$[37]=$hasClearButton,$[38]=IconRightComponent,$[39]=fontSize2,$[40]=padding,$[41]=t16):t16=$[41];let t17;$[42]!==$hasPrefix||$[43]!==$hasSuffix||$[44]!==__unstable_disableFocusRing||$[45]!==radius||$[46]!==rootTheme.scheme||$[47]!==rootTheme.tone||$[48]!==t14||$[49]!==t15||$[50]!==t16?(t17=/* @__PURE__ */jsxs(Presentation,{$hasPrefix,$unstableDisableFocusRing:__unstable_disableFocusRing,$hasSuffix,$radius:radius,$scheme:rootTheme.scheme,$tone:rootTheme.tone,"data-border":t14,"data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone,children:[t15,t16]}),$[42]=$hasPrefix,$[43]=$hasSuffix,$[44]=__unstable_disableFocusRing,$[45]=radius,$[46]=rootTheme.scheme,$[47]=rootTheme.tone,$[48]=t14,$[49]=t15,$[50]=t16,$[51]=t17):t17=$[51];const presentationNode=t17;let t18;$[52]!==padding?(t18=padding.map(_temp2),$[52]=padding,$[53]=t18):t18=$[53];const clearButtonBoxPadding=t18;let t19;$[54]!==padding?(t19=padding.map(_temp3),$[54]=padding,$[55]=t19):t19=$[55];const clearButtonPadding=t19,clearButtonProps=typeof clearButton=="object"?clearButton:EMPTY_RECORD;let t20;$[56]!==clearButton||$[57]!==clearButtonBoxPadding||$[58]!==clearButtonPadding||$[59]!==clearButtonProps||$[60]!==customValidity||$[61]!==disabled||$[62]!==fontSize2||$[63]!==handleClearClick||$[64]!==radius||$[65]!==readOnly?(t20=!disabled&&!readOnly&&clearButton&&/* @__PURE__ */jsx(RightCard,{forwardedAs:"span",padding:clearButtonBoxPadding,style:CLEAR_BUTTON_BOX_STYLE,tone:customValidity?"critical":"inherit",children:/* @__PURE__ */jsx(TextInputClearButton,_objectSpread(_objectSpread({"aria-label":"Clear","data-qa":"clear-button",fontSize:fontSize2,icon:CloseIcon,mode:"bleed",padding:clearButtonPadding,radius},clearButtonProps),{},{onClick:handleClearClick,onMouseDown:handleClearMouseDown}))}),$[56]=clearButton,$[57]=clearButtonBoxPadding,$[58]=clearButtonPadding,$[59]=clearButtonProps,$[60]=customValidity,$[61]=disabled,$[62]=fontSize2,$[63]=handleClearClick,$[64]=radius,$[65]=readOnly,$[66]=t20):t20=$[66];const clearButtonNode=t20;let t21;$[67]!==radius||$[68]!==suffix?(t21=suffix&&/* @__PURE__ */jsx(Suffix,{borderTop:!0,borderRight:!0,borderBottom:!0,radius,sizing:"border",tone:"inherit",children:/* @__PURE__ */jsx("span",{children:suffix})}),$[67]=radius,$[68]=suffix,$[69]=t21):t21=$[69];const suffixNode=t21,t22=$hasIconRight||$hasClearButton;let t23;$[70]!==$hasIcon||$[71]!==disabled||$[72]!==fontSize2||$[73]!==padding||$[74]!==readOnly||$[75]!==restProps||$[76]!==rootTheme.scheme||$[77]!==rootTheme.tone||$[78]!==space||$[79]!==t22||$[80]!==type||$[81]!==weight?(t23=/* @__PURE__ */jsx(Input,_objectSpread(_objectSpread({"data-as":"input","data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone},restProps),{},{$fontSize:fontSize2,$iconLeft:$hasIcon,$iconRight:t22,$padding:padding,$scheme:rootTheme.scheme,$space:space,$tone:rootTheme.tone,$weight:weight,disabled,readOnly,ref,type})),$[70]=$hasIcon,$[71]=disabled,$[72]=fontSize2,$[73]=padding,$[74]=readOnly,$[75]=restProps,$[76]=rootTheme.scheme,$[77]=rootTheme.tone,$[78]=space,$[79]=t22,$[80]=type,$[81]=weight,$[82]=t23):t23=$[82];let t24;$[83]!==clearButtonNode||$[84]!==presentationNode||$[85]!==t23?(t24=/* @__PURE__ */jsxs(InputRoot,{children:[t23,presentationNode,clearButtonNode]}),$[83]=clearButtonNode,$[84]=presentationNode,$[85]=t23,$[86]=t24):t24=$[86];let t25;return $[87]!==prefixNode||$[88]!==rootTheme.tone||$[89]!==suffixNode||$[90]!==t24?(t25=/* @__PURE__ */jsxs(StyledTextInput,{"data-ui":"TextInput",tone:rootTheme.tone,children:[prefixNode,t24,suffixNode]}),$[87]=prefixNode,$[88]=rootTheme.tone,$[89]=suffixNode,$[90]=t24,$[91]=t25):t25=$[91],t25;});TextInput.displayName="ForwardRef(TextInput)";function _temp$2$1(event){event.preventDefault(),event.stopPropagation();}function _temp2(v){return v===0?0:v===1||v===2?1:v-2;}function _temp3(v_0){return v_0===0||v_0===1?0:v_0===2?1:v_0-1;}function useDelayedState(initialState){const $=dist.c(3),[state,setState]=useState(initialState),delayedAction=useRef$1(void 0);let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=(nextState,delay)=>{const action=()=>{setState(nextState);};if(delayedAction.current&&(clearTimeout(delayedAction.current),delayedAction.current=void 0),!delay)return action();delayedAction.current=setTimeout(action,delay);},$[0]=t0):t0=$[0];const onStateChange=t0;let t1;return $[1]!==state?(t1=[state,onStateChange],$[1]=state,$[2]=t1):t1=$[2],t1;}const DEFAULT_TOOLTIP_ARROW_WIDTH=15,DEFAULT_TOOLTIP_ARROW_HEIGHT=6,DEFAULT_TOOLTIP_ARROW_RADIUS=2,DEFAULT_TOOLTIP_DISTANCE=4,DEFAULT_TOOLTIP_PADDING=4,DEFAULT_FALLBACK_PLACEMENTS={top:["top-end","top-start","bottom","left","right"],"top-start":["top","top-end","bottom-start","left-start","right-start"],"top-end":["top","top-start","bottom-end","left-end","right-end"],bottom:["bottom-end","bottom-start","top","left","right"],"bottom-start":["bottom","bottom-end","top-start","left-start","right-start"],"bottom-end":["bottom","bottom-start","top-end","left-end","right-end"],left:["left-end","left-start","right","top","bottom"],"left-start":["left","left-end","right-start","top-start","bottom-start"],"left-end":["left","left-start","right-end","top-end","bottom-end"],right:["right-end","right-start","left","top","bottom"],"right-start":["right","right-end","left-start","top-start","bottom-start"],"right-end":["right","right-start","left-end","top-end","bottom-end"]},MotionCard=styled(motion.create(Card)).withConfig({displayName:"MotionCard",componentId:"sc-1xn138w-0"})(_templateObject54||(_templateObject54=_taggedTemplateLiteral(["will-change:transform;"]))),TooltipCard=forwardRef(function(props,ref){var _props27;const $=dist.c(48);let animate,arrow2,arrowRef,arrowX,arrowY,children,originX,originY,padding,placement,radius,restProps,scheme,shadow,style;$[0]!==props?(_props27=props,{animate,arrow:arrow2,arrowRef,arrowX,arrowY,children,originX,originY,padding,placement,radius,scheme,shadow,style}=_props27,restProps=_objectWithoutProperties(_props27,_excluded43),_props27,$[0]=props,$[1]=animate,$[2]=arrow2,$[3]=arrowRef,$[4]=arrowX,$[5]=arrowY,$[6]=children,$[7]=originX,$[8]=originY,$[9]=padding,$[10]=placement,$[11]=radius,$[12]=restProps,$[13]=scheme,$[14]=shadow,$[15]=style):(animate=$[1],arrow2=$[2],arrowRef=$[3],arrowX=$[4],arrowY=$[5],children=$[6],originX=$[7],originY=$[8],padding=$[9],placement=$[10],radius=$[11],restProps=$[12],scheme=$[13],shadow=$[14],style=$[15]);const t0=animate?"transform":void 0;let t1;$[16]!==originX||$[17]!==originY||$[18]!==style||$[19]!==t0?(t1=_objectSpread({originX,originY,willChange:t0},style),$[16]=originX,$[17]=originY,$[18]=style,$[19]=t0,$[20]=t1):t1=$[20];const rootStyle2=t1,t2=arrowX!==null?arrowX:void 0,t3=arrowY!==null?arrowY:void 0;let t4;$[21]!==t2||$[22]!==t3?(t4={left:t2,top:t3,right:void 0,bottom:void 0},$[21]=t2,$[22]=t3,$[23]=t4):t4=$[23];const arrowStyle=t4,t5=restProps;let t6;$[24]!==animate?(t6=animate?["hidden","initial"]:void 0,$[24]=animate,$[25]=t6):t6=$[25];let t7;$[26]!==animate?(t7=animate?["visible","scaleIn"]:void 0,$[26]=animate,$[27]=t7):t7=$[27];let t8;$[28]!==animate?(t8=animate?["hidden","scaleOut"]:void 0,$[28]=animate,$[29]=t8):t8=$[29];let t9;$[30]!==arrow2||$[31]!==arrowRef||$[32]!==arrowStyle?(t9=arrow2&&/* @__PURE__ */jsx(Arrow,{ref:arrowRef,style:arrowStyle,width:DEFAULT_TOOLTIP_ARROW_WIDTH,height:DEFAULT_TOOLTIP_ARROW_HEIGHT,radius:DEFAULT_TOOLTIP_ARROW_RADIUS}),$[30]=arrow2,$[31]=arrowRef,$[32]=arrowStyle,$[33]=t9):t9=$[33];let t10;return $[34]!==children||$[35]!==padding||$[36]!==placement||$[37]!==radius||$[38]!==ref||$[39]!==rootStyle2||$[40]!==scheme||$[41]!==shadow||$[42]!==t5||$[43]!==t6||$[44]!==t7||$[45]!==t8||$[46]!==t9?(t10=/* @__PURE__ */jsxs(MotionCard,_objectSpread(_objectSpread({"data-ui":"Tooltip__card"},t5),{},{"data-placement":placement,padding,radius,ref,scheme,shadow,style:rootStyle2,variants:POPOVER_MOTION_PROPS.card,transition:POPOVER_MOTION_PROPS.transition,initial:t6,animate:t7,exit:t8,children:[children,t9]})),$[34]=children,$[35]=padding,$[36]=placement,$[37]=radius,$[38]=ref,$[39]=rootStyle2,$[40]=scheme,$[41]=shadow,$[42]=t5,$[43]=t6,$[44]=t7,$[45]=t8,$[46]=t9,$[47]=t10):t10=$[47],t10;});TooltipCard.displayName="ForwardRef(TooltipCard)";const TooltipDelayGroupContext=createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup",null);function useTooltipDelayGroup(){return useContext(TooltipDelayGroupContext);}const StyledTooltip=styled(Layer).withConfig({displayName:"StyledTooltip",componentId:"sc-13f2zvh-0"})(_templateObject55||(_templateObject55=_taggedTemplateLiteral(["pointer-events:none;"]))),Tooltip=forwardRef(function(props,forwardedRef){var _props28,_props$placement2,_portal$elements2,_middlewareData$arrow4,_middlewareData$arrow5,_middlewareData$Sani3,_middlewareData$Sani4,_delay2,_delay3,_childProp,_childProp3,_childProp4,_childProp6,_childProp7,_childProp9,_childProp0,_childProp10,_childProp11,_childProp13,_childProp14,_childProp16;const $=dist.c(137),boundaryElementContext=useBoundaryElement(),{layer}=useTheme_v2();let _boundaryElement,_fallbackPlacementsProp,_zOffset,childProp,content,delay,disabled,portalProp,restProps,scheme,t0,t1,t2,t3,t4,t5;$[0]!==props?(_props28=props,{animate:t0,arrow:t1,boundaryElement:_boundaryElement,children:childProp,content,disabled,fallbackPlacements:_fallbackPlacementsProp,padding:t2,placement:t3,portal:portalProp,radius:t4,scheme,shadow:t5,zOffset:_zOffset,delay}=_props28,restProps=_objectWithoutProperties(_props28,_excluded44),_props28,$[0]=props,$[1]=_boundaryElement,$[2]=_fallbackPlacementsProp,$[3]=_zOffset,$[4]=childProp,$[5]=content,$[6]=delay,$[7]=disabled,$[8]=portalProp,$[9]=restProps,$[10]=scheme,$[11]=t0,$[12]=t1,$[13]=t2,$[14]=t3,$[15]=t4,$[16]=t5):(_boundaryElement=$[1],_fallbackPlacementsProp=$[2],_zOffset=$[3],childProp=$[4],content=$[5],delay=$[6],disabled=$[7],portalProp=$[8],restProps=$[9],scheme=$[10],t0=$[11],t1=$[12],t2=$[13],t3=$[14],t4=$[15],t5=$[16]);const _animate=t0===void 0?!1:t0,arrowProp=t1===void 0?!1:t1,padding=t2===void 0?2:t2,placementProp=t3===void 0?"bottom":t3,radius=t4===void 0?2:t4,shadow=t5===void 0?2:t5,boundaryElement=_boundaryElement!==null&&_boundaryElement!==void 0?_boundaryElement:boundaryElementContext===null||boundaryElementContext===void 0?void 0:boundaryElementContext.element,fallbackPlacementsProp=_fallbackPlacementsProp!==null&&_fallbackPlacementsProp!==void 0?_fallbackPlacementsProp:DEFAULT_FALLBACK_PLACEMENTS[(_props$placement2=props.placement)!==null&&_props$placement2!==void 0?_props$placement2:"bottom"],zOffset=_zOffset!==null&&_zOffset!==void 0?_zOffset:layer.tooltip.zOffset,animate=usePrefersReducedMotion()?!1:_animate;let t6;$[17]!==fallbackPlacementsProp?(t6=_getArrayProp(fallbackPlacementsProp),$[17]=fallbackPlacementsProp,$[18]=t6):t6=$[18];const fallbackPlacements=t6,ref=useRef$1(null),[referenceElement,setReferenceElement]=useState(null),arrowRef=useRef$1(null),[tooltipMaxWidth,setTooltipMaxWidth]=useState(0);let t7;$[19]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>ref.current,$[19]=t7):t7=$[19],useImperativeHandle(forwardedRef,t7);const portal=usePortal(),portalElement=typeof portalProp=="string"?((_portal$elements2=portal.elements)===null||_portal$elements2===void 0?void 0:_portal$elements2[portalProp])||null:portal.element;let t8;$[20]!==animate||$[21]!==arrowProp||$[22]!==boundaryElement||$[23]!==fallbackPlacements?(t8={animate,arrowProp,arrowRef,boundaryElement,fallbackPlacements,rootBoundary:"viewport"},$[20]=animate,$[21]=arrowProp,$[22]=boundaryElement,$[23]=fallbackPlacements,$[24]=t8):t8=$[24];const middleware=useMiddleware(t8);let t9;$[25]!==referenceElement?(t9={reference:referenceElement},$[25]=referenceElement,$[26]=t9):t9=$[26];let t10;$[27]!==middleware||$[28]!==placementProp||$[29]!==t9?(t10={middleware,placement:placementProp,whileElementsMounted:autoUpdate,elements:t9},$[27]=middleware,$[28]=placementProp,$[29]=t9,$[30]=t10):t10=$[30];const{floatingStyles,placement,middlewareData,refs,update}=useFloating(t10),arrowX=(_middlewareData$arrow4=middlewareData.arrow)===null||_middlewareData$arrow4===void 0?void 0:_middlewareData$arrow4.x,arrowY=(_middlewareData$arrow5=middlewareData.arrow)===null||_middlewareData$arrow5===void 0?void 0:_middlewareData$arrow5.y,originX=(_middlewareData$Sani3=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani3===void 0?void 0:_middlewareData$Sani3.originX,originY=(_middlewareData$Sani4=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani4===void 0?void 0:_middlewareData$Sani4.originY,tooltipId=useId(),[isOpen,setIsOpen]=useDelayedState(!1),delayGroupContext=useTooltipDelayGroup();let t11;$[31]!==delayGroupContext?(t11=delayGroupContext||{},$[31]=delayGroupContext,$[32]=t11):t11=$[32];const{setIsGroupActive,setOpenTooltipId}=t11,showTooltip=isOpen||(delayGroupContext===null||delayGroupContext===void 0?void 0:delayGroupContext.openTooltipId)===tooltipId,isInsideGroup=delayGroupContext!==null,openDelayProp=typeof delay=="number"?delay:((_delay2=delay)===null||_delay2===void 0?void 0:_delay2.open)||0,closeDelayProp=typeof delay=="number"?delay:((_delay3=delay)===null||_delay3===void 0?void 0:_delay3.close)||0,openDelay=isInsideGroup?delayGroupContext.openDelay:openDelayProp,closeDelay=isInsideGroup?delayGroupContext.closeDelay:closeDelayProp;let t12;$[33]!==closeDelay||$[34]!==isInsideGroup||$[35]!==openDelay||$[36]!==setIsGroupActive||$[37]!==setIsOpen||$[38]!==setOpenTooltipId||$[39]!==tooltipId?(t12=(open,immediate)=>{if(isInsideGroup){if(open){const groupedOpenDelay=immediate?0:openDelay;setIsGroupActive!==null&&setIsGroupActive!==void 0&&setIsGroupActive(open,groupedOpenDelay),setOpenTooltipId===null||setOpenTooltipId===void 0?void 0:setOpenTooltipId(tooltipId,groupedOpenDelay);}else{const groupDeactivateDelay=closeDelay>200?closeDelay:200;setIsGroupActive!==null&&setIsGroupActive!==void 0&&setIsGroupActive(open,groupDeactivateDelay),setOpenTooltipId===null||setOpenTooltipId===void 0?void 0:setOpenTooltipId(null,immediate?0:closeDelay);}}else setIsOpen(open,immediate?0:open?openDelay:closeDelay);},$[33]=closeDelay,$[34]=isInsideGroup,$[35]=openDelay,$[36]=setIsGroupActive,$[37]=setIsOpen,$[38]=setOpenTooltipId,$[39]=tooltipId,$[40]=t12):t12=$[40];const handleIsOpenChange=t12;let t13;$[41]!==((_childProp=childProp)===null||_childProp===void 0?void 0:_childProp.props)||$[42]!==handleIsOpenChange?(t13=e=>{var _childProp2,_childProp2$onBlur;handleIsOpenChange(!1),(_childProp2=childProp)===null||_childProp2===void 0||(_childProp2=_childProp2.props)===null||_childProp2===void 0||(_childProp2$onBlur=_childProp2.onBlur)===null||_childProp2$onBlur===void 0?void 0:_childProp2$onBlur.call(_childProp2,e);},$[41]=(_childProp3=childProp)===null||_childProp3===void 0?void 0:_childProp3.props,$[42]=handleIsOpenChange,$[43]=t13):t13=$[43];const handleBlur=t13;let t14;$[44]!==((_childProp4=childProp)===null||_childProp4===void 0?void 0:_childProp4.props)||$[45]!==handleIsOpenChange?(t14=e_0=>{var _childProp5,_childProp5$props$onC,_childProp5$props;handleIsOpenChange(!1,!0),(_childProp5=childProp)===null||_childProp5===void 0||(_childProp5$props$onC=(_childProp5$props=_childProp5.props).onClick)===null||_childProp5$props$onC===void 0?void 0:_childProp5$props$onC.call(_childProp5$props,e_0);},$[44]=(_childProp6=childProp)===null||_childProp6===void 0?void 0:_childProp6.props,$[45]=handleIsOpenChange,$[46]=t14):t14=$[46];const handleClick=t14;let t15;$[47]!==((_childProp7=childProp)===null||_childProp7===void 0?void 0:_childProp7.props)||$[48]!==handleIsOpenChange?(t15=e_1=>{var _childProp8,_childProp8$props$onC,_childProp8$props;handleIsOpenChange(!1,!0),(_childProp8=childProp)===null||_childProp8===void 0||(_childProp8$props$onC=(_childProp8$props=_childProp8.props).onContextMenu)===null||_childProp8$props$onC===void 0?void 0:_childProp8$props$onC.call(_childProp8$props,e_1);},$[47]=(_childProp9=childProp)===null||_childProp9===void 0?void 0:_childProp9.props,$[48]=handleIsOpenChange,$[49]=t15):t15=$[49];const handleContextMenu=t15;let t16;$[50]!==((_childProp0=childProp)===null||_childProp0===void 0?void 0:_childProp0.props)||$[51]!==handleIsOpenChange?(t16=e_2=>{var _childProp1,_childProp1$onFocus;handleIsOpenChange(!0),(_childProp1=childProp)===null||_childProp1===void 0||(_childProp1=_childProp1.props)===null||_childProp1===void 0||(_childProp1$onFocus=_childProp1.onFocus)===null||_childProp1$onFocus===void 0?void 0:_childProp1$onFocus.call(_childProp1,e_2);},$[50]=(_childProp10=childProp)===null||_childProp10===void 0?void 0:_childProp10.props,$[51]=handleIsOpenChange,$[52]=t16):t16=$[52];const handleFocus=t16;let t17;$[53]!==((_childProp11=childProp)===null||_childProp11===void 0?void 0:_childProp11.props)||$[54]!==handleIsOpenChange?(t17=e_3=>{var _childProp12,_childProp12$onMouseE;handleIsOpenChange(!0),(_childProp12=childProp)===null||_childProp12===void 0||(_childProp12=_childProp12.props)===null||_childProp12===void 0||(_childProp12$onMouseE=_childProp12.onMouseEnter)===null||_childProp12$onMouseE===void 0?void 0:_childProp12$onMouseE.call(_childProp12,e_3);},$[53]=(_childProp13=childProp)===null||_childProp13===void 0?void 0:_childProp13.props,$[54]=handleIsOpenChange,$[55]=t17):t17=$[55];const handleMouseEnter=t17;let t18;$[56]!==((_childProp14=childProp)===null||_childProp14===void 0?void 0:_childProp14.props)||$[57]!==handleIsOpenChange?(t18=e_4=>{var _childProp15,_childProp15$onMouseL;handleIsOpenChange(!1),(_childProp15=childProp)===null||_childProp15===void 0||(_childProp15=_childProp15.props)===null||_childProp15===void 0||(_childProp15$onMouseL=_childProp15.onMouseLeave)===null||_childProp15$onMouseL===void 0?void 0:_childProp15$onMouseL.call(_childProp15,e_4);},$[56]=(_childProp16=childProp)===null||_childProp16===void 0?void 0:_childProp16.props,$[57]=handleIsOpenChange,$[58]=t18):t18=$[58];const handleMouseLeave=t18;let t19;$[59]!==handleIsOpenChange||$[60]!==isInsideGroup||$[61]!==referenceElement||$[62]!==showTooltip?(t19={handleIsOpenChange,referenceElement,showTooltip,isInsideGroup},$[59]=handleIsOpenChange,$[60]=isInsideGroup,$[61]=referenceElement,$[62]=showTooltip,$[63]=t19):t19=$[63],useCloseOnMouseLeave(t19);let t20,t21;$[64]!==disabled||$[65]!==handleIsOpenChange||$[66]!==showTooltip?(t20=()=>{disabled&&showTooltip&&handleIsOpenChange(!1);},t21=[disabled,handleIsOpenChange,showTooltip],$[64]=disabled,$[65]=handleIsOpenChange,$[66]=showTooltip,$[67]=t20,$[68]=t21):(t20=$[67],t21=$[68]),useEffect$1(t20,t21);let t22,t23;$[69]!==content||$[70]!==handleIsOpenChange||$[71]!==showTooltip?(t22=()=>{!content&&showTooltip&&handleIsOpenChange(!1);},t23=[content,handleIsOpenChange,showTooltip],$[69]=content,$[70]=handleIsOpenChange,$[71]=showTooltip,$[72]=t22,$[73]=t23):(t22=$[72],t23=$[73]),useEffect$1(t22,t23);let t24,t25;$[74]!==handleIsOpenChange||$[75]!==showTooltip?(t24=()=>{if(!showTooltip)return;const handleWindowKeyDown=function(event){event.key==="Escape"&&handleIsOpenChange(!1,!0);};return window.addEventListener("keydown",handleWindowKeyDown),()=>{window.removeEventListener("keydown",handleWindowKeyDown);};},t25=[handleIsOpenChange,showTooltip],$[74]=handleIsOpenChange,$[75]=showTooltip,$[76]=t24,$[77]=t25):(t24=$[76],t25=$[77]),useEffect$1(t24,t25);let t26;$[78]!==boundaryElement||$[79]!==(portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth)?(t26=()=>{const availableWidths=[...(boundaryElement?[boundaryElement.offsetWidth]:[]),(portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth)||document.body.offsetWidth];setTooltipMaxWidth(Math.min(...availableWidths)-DEFAULT_TOOLTIP_PADDING*2);},$[78]=boundaryElement,$[79]=portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth,$[80]=t26):t26=$[80];let t27;$[81]!==boundaryElement||$[82]!==portalElement?(t27=[boundaryElement,portalElement],$[81]=boundaryElement,$[82]=portalElement,$[83]=t27):t27=$[83],useLayoutEffect(t26,t27);let t28;$[84]!==update?(t28=arrowEl=>{arrowRef.current=arrowEl,update();},$[84]=update,$[85]=t28):t28=$[85];const setArrow=t28;let t29;$[86]!==refs?(t29=node=>{ref.current=node,refs.setFloating(node);},$[86]=refs,$[87]=t29):t29=$[87];const setFloating=t29;let t30;bb0:{if(!childProp){t30=null;break bb0;}let t312;$[88]!==childProp||$[89]!==handleBlur||$[90]!==handleClick||$[91]!==handleContextMenu||$[92]!==handleFocus||$[93]!==handleMouseEnter||$[94]!==handleMouseLeave?(t312=cloneElement(childProp,{onBlur:handleBlur,onFocus:handleFocus,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onClick:handleClick,onContextMenu:handleContextMenu,ref:setReferenceElement}),$[88]=childProp,$[89]=handleBlur,$[90]=handleClick,$[91]=handleContextMenu,$[92]=handleFocus,$[93]=handleMouseEnter,$[94]=handleMouseLeave,$[95]=t312):t312=$[95],t30=t312;}const child=t30;let t31;$[96]!==childProp?(t31=childProp?getElementRef(childProp):null,$[96]=childProp,$[97]=t31):t31=$[97];let t32,t33;if($[98]!==referenceElement?(t32=()=>referenceElement,t33=[referenceElement],$[98]=referenceElement,$[99]=t32,$[100]=t33):(t32=$[99],t33=$[100]),useImperativeHandle(t31,t32,t33),!child){let t342;return $[101]===Symbol.for("react.memo_cache_sentinel")?(t342=/* @__PURE__ */jsx(Fragment,{}),$[101]=t342):t342=$[101],t342;}if(disabled)return child;const t34=tooltipMaxWidth>0?"".concat(tooltipMaxWidth,"px"):void 0;let t35;$[102]!==floatingStyles||$[103]!==t34?(t35=_objectSpread(_objectSpread({},floatingStyles),{},{maxWidth:t34}),$[102]=floatingStyles,$[103]=t34,$[104]=t35):t35=$[104];let t36;$[105]!==animate||$[106]!==arrowProp||$[107]!==arrowX||$[108]!==arrowY||$[109]!==content||$[110]!==originX||$[111]!==originY||$[112]!==padding||$[113]!==placement||$[114]!==radius||$[115]!==restProps||$[116]!==scheme||$[117]!==setArrow||$[118]!==setFloating||$[119]!==shadow?(t36=/* @__PURE__ */jsx(TooltipCard,_objectSpread(_objectSpread({},restProps),{},{animate,arrow:arrowProp,arrowRef:setArrow,arrowX,arrowY,originX,originY,padding,placement,radius,ref:setFloating,scheme,shadow,children:content})),$[105]=animate,$[106]=arrowProp,$[107]=arrowX,$[108]=arrowY,$[109]=content,$[110]=originX,$[111]=originY,$[112]=padding,$[113]=placement,$[114]=radius,$[115]=restProps,$[116]=scheme,$[117]=setArrow,$[118]=setFloating,$[119]=shadow,$[120]=t36):t36=$[120];let t37;$[121]!==restProps||$[122]!==setFloating||$[123]!==t35||$[124]!==t36||$[125]!==zOffset?(t37=/* @__PURE__ */jsx(StyledTooltip,_objectSpread(_objectSpread({"data-ui":"Tooltip"},restProps),{},{ref:setFloating,style:t35,zOffset,children:t36})),$[121]=restProps,$[122]=setFloating,$[123]=t35,$[124]=t36,$[125]=zOffset,$[126]=t37):t37=$[126];const tooltip=t37;let t38;$[127]!==portalProp||$[128]!==showTooltip||$[129]!==tooltip?(t38=showTooltip&&(portalProp?/* @__PURE__ */jsx(Portal,{__unstable_name:typeof portalProp=="string"?portalProp:void 0,children:tooltip}):tooltip),$[127]=portalProp,$[128]=showTooltip,$[129]=tooltip,$[130]=t38):t38=$[130];const children=t38;let t39;$[131]!==animate||$[132]!==children?(t39=animate?/* @__PURE__ */jsx(AnimatePresence,{children}):children,$[131]=animate,$[132]=children,$[133]=t39):t39=$[133];let t40;return $[134]!==child||$[135]!==t39?(t40=/* @__PURE__ */jsxs(Fragment,{children:[t39,child]}),$[134]=child,$[135]=t39,$[136]=t40):t40=$[136],t40;});Tooltip.displayName="ForwardRef(Tooltip)";function useMiddleware(t0){const $=dist.c(17),{animate,arrowProp,arrowRef,boundaryElement,fallbackPlacements,rootBoundary}=t0;let ret;if($[0]!==animate||$[1]!==arrowProp||$[2]!==arrowRef||$[3]!==boundaryElement||$[4]!==fallbackPlacements||$[5]!==rootBoundary){ret=[];const t1=boundaryElement||void 0;let t2;$[7]!==fallbackPlacements||$[8]!==rootBoundary||$[9]!==t1?(t2=flip({boundary:t1,fallbackPlacements,padding:DEFAULT_TOOLTIP_PADDING,rootBoundary}),$[7]=fallbackPlacements,$[8]=rootBoundary,$[9]=t1,$[10]=t2):t2=$[10],ret.push(t2);let t3;$[11]===Symbol.for("react.memo_cache_sentinel")?(t3=offset({mainAxis:DEFAULT_TOOLTIP_DISTANCE}),$[11]=t3):t3=$[11],ret.push(t3);const t4=boundaryElement||void 0;let t5;if($[12]!==rootBoundary||$[13]!==t4?(t5=shift({boundary:t4,rootBoundary,padding:DEFAULT_TOOLTIP_PADDING}),$[12]=rootBoundary,$[13]=t4,$[14]=t5):t5=$[14],ret.push(t5),arrowProp){let t6;$[15]!==arrowRef?(t6=arrow({element:arrowRef,padding:DEFAULT_TOOLTIP_PADDING}),$[15]=arrowRef,$[16]=t6):t6=$[16],ret.push(t6);}animate&&ret.push(origin),$[0]=animate,$[1]=arrowProp,$[2]=arrowRef,$[3]=boundaryElement,$[4]=fallbackPlacements,$[5]=rootBoundary,$[6]=ret;}else ret=$[6];return ret;}function useCloseOnMouseLeave(t0){const $=dist.c(10),{handleIsOpenChange,referenceElement,showTooltip,isInsideGroup}=t0;let t1;$[0]!==handleIsOpenChange||$[1]!==referenceElement?(t1=(target,teardown)=>{referenceElement&&(referenceElement===target||target instanceof Node&&referenceElement.contains(target)||(handleIsOpenChange(!1),teardown()));},$[0]=handleIsOpenChange,$[1]=referenceElement,$[2]=t1):t1=$[2];const onMouseMove=useEffectEvent(t1);let t2;$[3]!==isInsideGroup||$[4]!==onMouseMove||$[5]!==showTooltip?(t2=()=>{if(!showTooltip||isInsideGroup)return;const handleMouseMove=event=>{onMouseMove(event.target,()=>window.removeEventListener("mousemove",handleMouseMove));};return window.addEventListener("mousemove",handleMouseMove),()=>window.removeEventListener("mousemove",handleMouseMove);},$[3]=isInsideGroup,$[4]=onMouseMove,$[5]=showTooltip,$[6]=t2):t2=$[6];let t3;$[7]!==isInsideGroup||$[8]!==showTooltip?(t3=[isInsideGroup,showTooltip],$[7]=isInsideGroup,$[8]=showTooltip,$[9]=t3):t3=$[9],useEffect$1(t2,t3);}const StyledHotkeys=styled.kbd.withConfig({displayName:"StyledHotkeys",componentId:"sc-b37mge-0"})(_templateObject56||(_templateObject56=_taggedTemplateLiteral(["font:inherit;padding:1px;&:not([hidden]){display:block;}"]))),Key=styled(KBD).withConfig({displayName:"Key",componentId:"sc-b37mge-1"})(_templateObject57||(_templateObject57=_taggedTemplateLiteral(["&:not([hidden]){display:block;}"]))),Hotkeys=forwardRef(function(props,ref){var _props29;const $=dist.c(26);let fontSize2,keys,padding,radius,restProps,t0;$[0]!==props?(_props29=props,{fontSize:fontSize2,keys,padding,radius,space:t0}=_props29,restProps=_objectWithoutProperties(_props29,_excluded45),_props29,$[0]=props,$[1]=fontSize2,$[2]=keys,$[3]=padding,$[4]=radius,$[5]=restProps,$[6]=t0):(fontSize2=$[1],keys=$[2],padding=$[3],radius=$[4],restProps=$[5],t0=$[6]);const spaceProp=t0===void 0?0.5:t0;let t1;$[7]!==spaceProp?(t1=_getArrayProp(spaceProp),$[7]=spaceProp,$[8]=t1):t1=$[8];const space=t1;if(!keys||keys.length===0){let t22;return $[9]===Symbol.for("react.memo_cache_sentinel")?(t22=/* @__PURE__ */jsx(Fragment,{}),$[9]=t22):t22=$[9],t22;}let t2;if($[10]!==fontSize2||$[11]!==keys||$[12]!==padding||$[13]!==radius){let t32;$[15]!==fontSize2||$[16]!==padding||$[17]!==radius?(t32=(key2,i)=>/* @__PURE__ */jsx(Key,{fontSize:fontSize2,padding,radius,children:key2},i),$[15]=fontSize2,$[16]=padding,$[17]=radius,$[18]=t32):t32=$[18],t2=keys.map(t32),$[10]=fontSize2,$[11]=keys,$[12]=padding,$[13]=radius,$[14]=t2;}else t2=$[14];let t3;$[19]!==space||$[20]!==t2?(t3=/* @__PURE__ */jsx(Inline,{as:"span",space,children:t2}),$[19]=space,$[20]=t2,$[21]=t3):t3=$[21];let t4;return $[22]!==ref||$[23]!==restProps||$[24]!==t3?(t4=/* @__PURE__ */jsx(StyledHotkeys,_objectSpread(_objectSpread({"data-ui":"Hotkeys"},restProps),{},{ref,children:t3})),$[22]=ref,$[23]=restProps,$[24]=t3,$[25]=t4):t4=$[25],t4;});Hotkeys.displayName="ForwardRef(Hotkeys)";const MenuContext=createGlobalScopedContext("@sanity/ui/context/menu",null);function _isFocusable(element){return isHTMLAnchorElement(element)&&element.getAttribute("data-disabled")!=="true"||isHTMLButtonElement(element)&&!element.disabled;}function _getFocusableElements(elements){return elements.filter(_isFocusable);}function _getDOMPath(rootElement,el){const path=[];let e=el;for(;e!==rootElement;){const parentElement=e.parentElement;if(!parentElement)return path;const index=Array.from(parentElement.childNodes).indexOf(e);if(path.unshift(index),parentElement===rootElement)return path;e=parentElement;}return path;}const EMPTY_PATH=[];function _sortElements(rootElement,elements){if(!rootElement)return;const map=/* @__PURE__ */new WeakMap();for(const el of elements)map.set(el,_getDOMPath(rootElement,el));const _sort=(a,b)=>{const _a=map.get(a)||EMPTY_PATH,_b=map.get(b)||EMPTY_PATH,len=Math.max(_a.length,_b.length);for(let i=0;i<len;i+=1){const aIndex=_a[i]||-1,bIndex=_b[i]||-1;if(aIndex!==bIndex)return aIndex-bIndex;}return 0;};elements.sort(_sort);}function useMenuController(props){const $=dist.c(21),{onKeyDown,originElement,shouldFocus,rootElementRef}=props;let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=[],$[0]=t0):t0=$[0];const elementsRef=useRef$1(t0),[activeIndex,_setActiveIndex]=useState(-1),activeIndexRef=useRef$1(activeIndex),[activeElement,setActiveElement]=useState(null);let t1;$[1]===Symbol.for("react.memo_cache_sentinel")?(t1=nextActiveIndex=>{_setActiveIndex(nextActiveIndex),activeIndexRef.current=nextActiveIndex,setActiveElement(elementsRef.current[nextActiveIndex]||null);},$[1]=t1):t1=$[1];const setActiveIndex=t1;let t2;$[2]!==rootElementRef?(t2=(element,selected)=>{if(!element)return _temp$1;if(elementsRef.current.indexOf(element)===-1&&(elementsRef.current.push(element),_sortElements(rootElementRef.current,elementsRef.current)),selected){const selectedIndex=elementsRef.current.indexOf(element);setActiveIndex(selectedIndex);}return()=>{const idx=elementsRef.current.indexOf(element);idx>-1&&elementsRef.current.splice(idx,1);};},$[2]=rootElementRef,$[3]=t2):t2=$[3];const mount=t2;let t3;$[4]!==onKeyDown||$[5]!==originElement?(t3=event=>{if(event.key==="Tab"){originElement&&originElement.focus();return;}if(event.key==="Home"){event.preventDefault(),event.stopPropagation();const el=_getFocusableElements(elementsRef.current)[0];if(!el)return;const currentIndex=elementsRef.current.indexOf(el);setActiveIndex(currentIndex);return;}if(event.key==="End"){event.preventDefault(),event.stopPropagation();const focusableElements_0=_getFocusableElements(elementsRef.current),el_0=focusableElements_0[focusableElements_0.length-1];if(!el_0)return;const currentIndex_0=elementsRef.current.indexOf(el_0);setActiveIndex(currentIndex_0);return;}if(event.key==="ArrowUp"){event.preventDefault(),event.stopPropagation();const focusableElements_1=_getFocusableElements(elementsRef.current),focusableLen=focusableElements_1.length;if(focusableLen===0)return;const focusedElement=elementsRef.current[activeIndexRef.current];let focusedIndex=focusableElements_1.indexOf(focusedElement);focusedIndex=(focusedIndex-1+focusableLen)%focusableLen;const el_1=focusableElements_1[focusedIndex],currentIndex_1=elementsRef.current.indexOf(el_1);setActiveIndex(currentIndex_1);return;}if(event.key==="ArrowDown"){event.preventDefault(),event.stopPropagation();const focusableElements_2=_getFocusableElements(elementsRef.current),focusableLen_0=focusableElements_2.length;if(focusableLen_0===0)return;const focusedElement_0=elementsRef.current[activeIndexRef.current];let focusedIndex_0=focusableElements_2.indexOf(focusedElement_0);focusedIndex_0=(focusedIndex_0+1)%focusableLen_0;const el_2=focusableElements_2[focusedIndex_0],currentIndex_2=elementsRef.current.indexOf(el_2);setActiveIndex(currentIndex_2);return;}onKeyDown&&onKeyDown(event);},$[4]=onKeyDown,$[5]=originElement,$[6]=t3):t3=$[6];const handleKeyDown=t3;let t4;$[7]===Symbol.for("react.memo_cache_sentinel")?(t4=event_0=>{const element_0=event_0.currentTarget,currentIndex_3=elementsRef.current.indexOf(element_0);setActiveIndex(currentIndex_3);},$[7]=t4):t4=$[7];const handleItemMouseEnter=t4;let t5;$[8]!==rootElementRef?(t5=()=>{var _rootElementRef$curre;setActiveIndex(-2),(_rootElementRef$curre=rootElementRef.current)===null||_rootElementRef$curre===void 0?void 0:_rootElementRef$curre.focus();},$[8]=rootElementRef,$[9]=t5):t5=$[9];const handleItemMouseLeave=t5;let t6,t7;$[10]!==activeIndex||$[11]!==rootElementRef||$[12]!==shouldFocus?(t6=()=>{if(!rootElementRef.current)return;const rafId=requestAnimationFrame(()=>{var _ref75;if(activeIndex===-1){if(shouldFocus==="first"){const el_3=_getFocusableElements(elementsRef.current)[0];if(el_3){const currentIndex_4=elementsRef.current.indexOf(el_3);setActiveIndex(currentIndex_4);}}if(shouldFocus==="last"){const focusableElements_4=_getFocusableElements(elementsRef.current),el_4=focusableElements_4[focusableElements_4.length-1];if(el_4){const currentIndex_5=elementsRef.current.indexOf(el_4);setActiveIndex(currentIndex_5);}}return;}(_ref75=elementsRef.current[activeIndex]||null)===null||_ref75===void 0||_ref75.focus();});return()=>cancelAnimationFrame(rafId);},t7=[activeIndex,rootElementRef,setActiveIndex,shouldFocus],$[10]=activeIndex,$[11]=rootElementRef,$[12]=shouldFocus,$[13]=t6,$[14]=t7):(t6=$[13],t7=$[14]),useEffect$1(t6,t7);let t8;return $[15]!==activeElement||$[16]!==activeIndex||$[17]!==handleItemMouseLeave||$[18]!==handleKeyDown||$[19]!==mount?(t8={activeElement,activeIndex,handleItemMouseEnter,handleItemMouseLeave,handleKeyDown,mount},$[15]=activeElement,$[16]=activeIndex,$[17]=handleItemMouseLeave,$[18]=handleKeyDown,$[19]=mount,$[20]=t8):t8=$[20],t8;}function _temp$1(){}const StyledMenu=styled(Box).withConfig({displayName:"StyledMenu",componentId:"sc-xt0tnv-0"})(_templateObject58||(_templateObject58=_taggedTemplateLiteral(["outline:none;overflow:auto;"]))),Menu=forwardRef(function(props,forwardedRef){const $=dist.c(49);let _shouldFocus,children,onClickOutside,onEscape,onItemClick,onItemSelect,onKeyDown,originElement,registerElement,restProps,t0,t1;if($[0]!==props){const{children:t22,focusFirst,focusLast,onClickOutside:t32,onEscape:t42,onItemClick:t52,onItemSelect:t62,onKeyDown:t72,originElement:t82,padding:t92,registerElement:t102,shouldFocus:t112,space:t122}=props,t13=_objectWithoutProperties(props,_excluded46);children=t22,onClickOutside=t32,onEscape=t42,onItemClick=t52,onItemSelect=t62,onKeyDown=t72,originElement=t82,t0=t92,registerElement=t102,_shouldFocus=t112,t1=t122,restProps=t13,$[0]=props,$[1]=_shouldFocus,$[2]=children,$[3]=onClickOutside,$[4]=onEscape,$[5]=onItemClick,$[6]=onItemSelect,$[7]=onKeyDown,$[8]=originElement,$[9]=registerElement,$[10]=restProps,$[11]=t0,$[12]=t1;}else _shouldFocus=$[1],children=$[2],onClickOutside=$[3],onEscape=$[4],onItemClick=$[5],onItemSelect=$[6],onKeyDown=$[7],originElement=$[8],registerElement=$[9],restProps=$[10],t0=$[11],t1=$[12];const padding=t0===void 0?1:t0,space=t1===void 0?1:t1,shouldFocus=_shouldFocus!==null&&_shouldFocus!==void 0?_shouldFocus:props.focusFirst&&"first"||props.focusLast&&"last"||null,ref=useRef$1(null);let t2;$[13]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>ref.current,$[13]=t2):t2=$[13],useImperativeHandle(forwardedRef,t2);const{isTopLayer}=useLayer();let t3;$[14]!==onKeyDown||$[15]!==originElement||$[16]!==shouldFocus?(t3={onKeyDown,originElement,shouldFocus,rootElementRef:ref},$[14]=onKeyDown,$[15]=originElement,$[16]=shouldFocus,$[17]=t3):t3=$[17];const{activeElement,activeIndex,handleItemMouseEnter,handleItemMouseLeave,handleKeyDown,mount}=useMenuController(t3),unregisterElementRef=useRef$1(null);let t4;$[18]!==registerElement?(t4=el=>{unregisterElementRef.current&&(unregisterElementRef.current(),unregisterElementRef.current=null),ref.current=el,ref.current&®isterElement&&(unregisterElementRef.current=registerElement(ref.current));},$[18]=registerElement,$[19]=t4):t4=$[19];const handleRefChange=t4;let t5,t6;$[20]!==activeIndex||$[21]!==onItemSelect?(t5=()=>{onItemSelect&&onItemSelect(activeIndex);},t6=[activeIndex,onItemSelect],$[20]=activeIndex,$[21]=onItemSelect,$[22]=t5,$[23]=t6):(t5=$[22],t6=$[23]),useEffect$1(t5,t6);let t7;$[24]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>[ref.current],$[24]=t7):t7=$[24],useClickOutsideEvent(isTopLayer&&onClickOutside,t7);let t8;$[25]!==isTopLayer||$[26]!==onEscape?(t8=event=>{isTopLayer&&event.key==="Escape"&&(event.stopPropagation(),onEscape&&onEscape());},$[25]=isTopLayer,$[26]=onEscape,$[27]=t8):t8=$[27],useGlobalKeyDown(t8);let t9;$[28]!==activeElement||$[29]!==handleItemMouseEnter||$[30]!==handleItemMouseLeave||$[31]!==mount||$[32]!==onClickOutside||$[33]!==onEscape||$[34]!==onItemClick||$[35]!==registerElement?(t9={version:2,activeElement,mount,onClickOutside,onEscape,onItemClick,onItemMouseEnter:handleItemMouseEnter,onItemMouseLeave:handleItemMouseLeave,registerElement},$[28]=activeElement,$[29]=handleItemMouseEnter,$[30]=handleItemMouseLeave,$[31]=mount,$[32]=onClickOutside,$[33]=onEscape,$[34]=onItemClick,$[35]=registerElement,$[36]=t9):t9=$[36];const value=t9;let t10;$[37]!==children||$[38]!==space?(t10=/* @__PURE__ */jsx(Stack,{space,children}),$[37]=children,$[38]=space,$[39]=t10):t10=$[39];let t11;$[40]!==handleKeyDown||$[41]!==handleRefChange||$[42]!==padding||$[43]!==restProps||$[44]!==t10?(t11=/* @__PURE__ */jsx(StyledMenu,_objectSpread(_objectSpread({"data-ui":"Menu"},restProps),{},{onKeyDown:handleKeyDown,padding,ref:handleRefChange,role:"menu",tabIndex:-1,children:t10})),$[40]=handleKeyDown,$[41]=handleRefChange,$[42]=padding,$[43]=restProps,$[44]=t10,$[45]=t11):t11=$[45];let t12;return $[46]!==t11||$[47]!==value?(t12=/* @__PURE__ */jsx(MenuContext.Provider,{value,children:t11}),$[46]=t11,$[47]=value,$[48]=t12):t12=$[48],t12;});Menu.displayName="ForwardRef(Menu)";const MenuDivider=styled.hr.withConfig({displayName:"MenuDivider",componentId:"sc-uhoxwu-0"})(_templateObject59||(_templateObject59=_taggedTemplateLiteral(["height:1px;border:0;background:var(--card-hairline-soft-color);margin:0;"])));MenuDivider.displayName="MenuDivider";function selectableBaseStyle(){return css(_templateObject60||(_templateObject60=_taggedTemplateLiteral(["\n background-color: inherit;\n color: inherit;\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n text-decoration: none;\n }\n "])));}function selectableColorStyle(props){var _style$card2;const{$tone}=props,{color,style}=getTheme_v2(props.theme),tone=color.selectable[$tone];return css(_templateObject61||(_templateObject61=_taggedTemplateLiteral(["\n ","\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ","\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ","\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ","\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n &:active {\n ","\n }\n }\n }\n }\n }\n\n ","\n "])),_cardColorStyle(color,tone.enabled),_cardColorStyle(color,tone.disabled),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.selected),_cardColorStyle(color,tone.hovered),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.disabled),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.selected),_cardColorStyle(color,tone.hovered),_cardColorStyle(color,tone.pressed),style===null||style===void 0||(_style$card2=style.card)===null||_style$card2===void 0?void 0:_style$card2.root);}const Selectable=/* @__PURE__ */styled(Box).withConfig({displayName:"Selectable",componentId:"sc-1w01ang-0"})(responsiveRadiusStyle,selectableBaseStyle,selectableColorStyle);Selectable.displayName="Selectable";function useMenu(){const value=useContext(MenuContext);if(!value)throw new Error("useMenu(): missing context value");if(!isRecord(value)||value.version!==2)throw new Error("useMenu(): the context value is not compatible");return value;}const MenuItem=forwardRef(function(props,forwardedRef){var _props30;const $=dist.c(75);let IconComponent,IconRightComponent,children,disabled,hotkeys,onClick,paddingBottom,paddingLeft,paddingRight,paddingTop,paddingX,paddingY,pressed,restProps,selectedProp,t0,t1,t2,t3,t4,t5,text;$[0]!==props?(_props30=props,{as:t0,children,disabled,fontSize:t1,hotkeys,icon:IconComponent,iconRight:IconRightComponent,onClick,padding:t2,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft,pressed,radius:t3,selected:selectedProp,space:t4,text,tone:t5}=_props30,restProps=_objectWithoutProperties(_props30,_excluded47),_props30,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=children,$[4]=disabled,$[5]=hotkeys,$[6]=onClick,$[7]=paddingBottom,$[8]=paddingLeft,$[9]=paddingRight,$[10]=paddingTop,$[11]=paddingX,$[12]=paddingY,$[13]=pressed,$[14]=restProps,$[15]=selectedProp,$[16]=t0,$[17]=t1,$[18]=t2,$[19]=t3,$[20]=t4,$[21]=t5,$[22]=text):(IconComponent=$[1],IconRightComponent=$[2],children=$[3],disabled=$[4],hotkeys=$[5],onClick=$[6],paddingBottom=$[7],paddingLeft=$[8],paddingRight=$[9],paddingTop=$[10],paddingX=$[11],paddingY=$[12],pressed=$[13],restProps=$[14],selectedProp=$[15],t0=$[16],t1=$[17],t2=$[18],t3=$[19],t4=$[20],t5=$[21],text=$[22]);const as=t0===void 0?"button":t0,fontSize2=t1===void 0?1:t1,padding=t2===void 0?3:t2,radius=t3===void 0?2:t3,space=t4===void 0?3:t4,tone=t5===void 0?"default":t5,{scheme}=useRootTheme(),menu=useMenu(),{activeElement,mount,onItemClick,onItemMouseEnter:_onItemMouseEnter,onItemMouseLeave:_onItemMouseLeave}=menu,onItemMouseEnter=_onItemMouseEnter!==null&&_onItemMouseEnter!==void 0?_onItemMouseEnter:menu.onItemMouseEnter,onItemMouseLeave=_onItemMouseLeave!==null&&_onItemMouseLeave!==void 0?_onItemMouseLeave:menu.onItemMouseLeave,[rootElement,setRootElement]=useState(null),active=!!activeElement&&activeElement===rootElement,ref=useRef$1(null);let t6;$[23]===Symbol.for("react.memo_cache_sentinel")?(t6=()=>ref.current,$[23]=t6):t6=$[23],useImperativeHandle(forwardedRef,t6);let t7,t8;$[24]!==mount||$[25]!==rootElement||$[26]!==selectedProp?(t7=()=>mount(rootElement,selectedProp),t8=[mount,rootElement,selectedProp],$[24]=mount,$[25]=rootElement,$[26]=selectedProp,$[27]=t7,$[28]=t8):(t7=$[27],t8=$[28]),useEffect$1(t7,t8);let t9;$[29]!==disabled||$[30]!==onClick||$[31]!==onItemClick?(t9=event=>{disabled||(onClick&&onClick(event),onItemClick&&onItemClick());},$[29]=disabled,$[30]=onClick,$[31]=onItemClick,$[32]=t9):t9=$[32];const handleClick=t9;let t10;$[33]!==padding||$[34]!==paddingBottom||$[35]!==paddingLeft||$[36]!==paddingRight||$[37]!==paddingTop||$[38]!==paddingX||$[39]!==paddingY?(t10={padding,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft},$[33]=padding,$[34]=paddingBottom,$[35]=paddingLeft,$[36]=paddingRight,$[37]=paddingTop,$[38]=paddingX,$[39]=paddingY,$[40]=t10):t10=$[40];const paddingProps=t10;let t11;$[41]!==fontSize2?(t11=_getArrayProp(fontSize2).map(_temp),$[41]=fontSize2,$[42]=t11):t11=$[42];const hotkeysFontSize=t11;let t12;$[43]===Symbol.for("react.memo_cache_sentinel")?(t12=el=>{ref.current=el,setRootElement(el);},$[43]=t12):t12=$[43];const setRef=t12,t13=as!=="button"&&pressed?"":void 0,t14=active?"":void 0,t15=disabled?"":void 0;let t16;$[44]!==radius?(t16=_getArrayProp(radius),$[44]=radius,$[45]=t16):t16=$[45];let t17;$[46]===Symbol.for("react.memo_cache_sentinel")?(t17=_getArrayProp(0),$[46]=t17):t17=$[46];const t18=disabled?"default":tone,t19=as==="button"?"button":void 0;let t20;$[47]!==IconComponent||$[48]!==IconRightComponent||$[49]!==fontSize2||$[50]!==hotkeys||$[51]!==hotkeysFontSize||$[52]!==paddingProps||$[53]!==space||$[54]!==text?(t20=(IconComponent||text||IconRightComponent)&&/* @__PURE__ */jsxs(Flex,_objectSpread(_objectSpread({as:"span",gap:space,align:"center"},paddingProps),{},{children:[IconComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]}),text&&/* @__PURE__ */jsx(Box,{flex:1,children:/* @__PURE__ */jsx(Text,{size:fontSize2,textOverflow:"ellipsis",weight:"medium",children:text})}),hotkeys&&/* @__PURE__ */jsx(Hotkeys,{fontSize:hotkeysFontSize,keys:hotkeys,style:{marginTop:-4,marginBottom:-4}}),IconRightComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})]})),$[47]=IconComponent,$[48]=IconRightComponent,$[49]=fontSize2,$[50]=hotkeys,$[51]=hotkeysFontSize,$[52]=paddingProps,$[53]=space,$[54]=text,$[55]=t20):t20=$[55];let t21;$[56]!==children||$[57]!==paddingProps?(t21=children&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},paddingProps),{},{children})),$[56]=children,$[57]=paddingProps,$[58]=t21):t21=$[58];let t22;return $[59]!==as||$[60]!==disabled||$[61]!==handleClick||$[62]!==onItemMouseEnter||$[63]!==onItemMouseLeave||$[64]!==restProps||$[65]!==scheme||$[66]!==t13||$[67]!==t14||$[68]!==t15||$[69]!==t16||$[70]!==t18||$[71]!==t19||$[72]!==t20||$[73]!==t21?(t22=/* @__PURE__ */jsxs(Selectable,_objectSpread(_objectSpread({"data-ui":"MenuItem",role:"menuitem"},restProps),{},{"data-pressed":t13,"data-selected":t14,"data-disabled":t15,forwardedAs:as,$radius:t16,$padding:t17,$tone:t18,$scheme:scheme,disabled,onClick:handleClick,onMouseEnter:onItemMouseEnter,onMouseLeave:onItemMouseLeave,ref:setRef,tabIndex:-1,type:t19,children:[t20,t21]})),$[59]=as,$[60]=disabled,$[61]=handleClick,$[62]=onItemMouseEnter,$[63]=onItemMouseLeave,$[64]=restProps,$[65]=scheme,$[66]=t13,$[67]=t14,$[68]=t15,$[69]=t16,$[70]=t18,$[71]=t19,$[72]=t20,$[73]=t21,$[74]=t22):t22=$[74],t22;});MenuItem.displayName="ForwardRef(MenuItem)";function _temp(s){return s-1;}const CustomButton=styled(Button).withConfig({displayName:"CustomButton",componentId:"sc-1kns779-0"})(_templateObject62||(_templateObject62=_taggedTemplateLiteral(["max-width:100%;"]))),Tab=forwardRef(function(props,forwardedRef){var _props31;const $=dist.c(30);let focused,icon,id,label,onClick,onFocus,restProps,selected,t0,t1;$[0]!==props?(_props31=props,{icon,id,focused,fontSize:t0,label,onClick,onFocus,padding:t1,selected}=_props31,restProps=_objectWithoutProperties(_props31,_excluded48),_props31,$[0]=props,$[1]=focused,$[2]=icon,$[3]=id,$[4]=label,$[5]=onClick,$[6]=onFocus,$[7]=restProps,$[8]=selected,$[9]=t0,$[10]=t1):(focused=$[1],icon=$[2],id=$[3],label=$[4],onClick=$[5],onFocus=$[6],restProps=$[7],selected=$[8],t0=$[9],t1=$[10]);const fontSize2=t0===void 0?1:t0,padding=t1===void 0?2:t1,ref=useRef$1(null),focusedRef=useRef$1(!1);let t2;$[11]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>ref.current,$[11]=t2):t2=$[11],useImperativeHandle(forwardedRef,t2);let t3;$[12]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>{focusedRef.current=!1;},$[12]=t3):t3=$[12];const handleBlur=t3;let t4;$[13]!==onFocus?(t4=event=>{focusedRef.current=!0,onFocus&&onFocus(event);},$[13]=onFocus,$[14]=t4):t4=$[14];const handleFocus=t4;let t5,t6;$[15]!==focused?(t5=()=>{focused&&!focusedRef.current&&(ref.current&&ref.current.focus(),focusedRef.current=!0);},t6=[focused],$[15]=focused,$[16]=t5,$[17]=t6):(t5=$[16],t6=$[17]),useEffect$1(t5,t6);const t7=selected?"true":"false",t8=selected?0:-1;let t9;return $[18]!==fontSize2||$[19]!==handleFocus||$[20]!==icon||$[21]!==id||$[22]!==label||$[23]!==onClick||$[24]!==padding||$[25]!==restProps||$[26]!==selected||$[27]!==t7||$[28]!==t8?(t9=/* @__PURE__ */jsx(CustomButton,_objectSpread(_objectSpread({"data-ui":"Tab"},restProps),{},{"aria-selected":t7,fontSize:fontSize2,icon,id,mode:"bleed",onClick,onBlur:handleBlur,onFocus:handleFocus,padding,ref,role:"tab",selected,tabIndex:t8,text:label,type:"button"})),$[18]=fontSize2,$[19]=handleFocus,$[20]=icon,$[21]=id,$[22]=label,$[23]=onClick,$[24]=padding,$[25]=restProps,$[26]=selected,$[27]=t7,$[28]=t8,$[29]=t9):t9=$[29],t9;});Tab.displayName="ForwardRef(Tab)";const CustomInline=styled(Inline).withConfig({displayName:"CustomInline",componentId:"sc-5cm04m-0"})(_templateObject63||(_templateObject63=_taggedTemplateLiteral(["& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}"]))),TabList=forwardRef(function(props,ref){var _props32;const $=dist.c(15);let childrenProp,restProps;$[0]!==props?(_props32=props,{children:childrenProp}=_props32,restProps=_objectWithoutProperties(_props32,_excluded49),_props32,$[0]=props,$[1]=childrenProp,$[2]=restProps):(childrenProp=$[1],restProps=$[2]);const[focusedIndex,setFocusedIndex]=useState(-1);let t0;if($[3]!==childrenProp||$[4]!==focusedIndex){const children=Children.toArray(childrenProp).filter(isValidElement$1);let t12;$[6]!==focusedIndex?(t12=(child,childIndex)=>cloneElement(child,{focused:focusedIndex===childIndex,key:childIndex,onFocus:()=>setFocusedIndex(childIndex)}),$[6]=focusedIndex,$[7]=t12):t12=$[7],t0=children.map(t12),$[3]=childrenProp,$[4]=focusedIndex,$[5]=t0;}else t0=$[5];const tabs=t0,numTabs=tabs.length;let t1;$[8]!==numTabs?(t1=event=>{event.key==="ArrowLeft"&&setFocusedIndex(prevIndex=>(prevIndex+numTabs-1)%numTabs),event.key==="ArrowRight"&&setFocusedIndex(prevIndex_0=>(prevIndex_0+1)%numTabs);},$[8]=numTabs,$[9]=t1):t1=$[9];const handleKeyDown=t1;let t2;return $[10]!==handleKeyDown||$[11]!==ref||$[12]!==restProps||$[13]!==tabs?(t2=/* @__PURE__ */jsx(CustomInline,_objectSpread(_objectSpread({"data-ui":"TabList"},restProps),{},{onKeyDown:handleKeyDown,ref,role:"tablist",children:tabs})),$[10]=handleKeyDown,$[11]=ref,$[12]=restProps,$[13]=tabs,$[14]=t2):t2=$[14],t2;});TabList.displayName="ForwardRef(TabList)";function _raf(fn){const frameId=requestAnimationFrame(fn);return()=>{cancelAnimationFrame(frameId);};}function _hasFocus(element){return!!document.activeElement&&element.contains(document.activeElement);}function isFocusable(element){return element.tabIndex>0||element.tabIndex===0&&element.getAttribute("tabIndex")!==null?!0:isHTMLAnchorElement(element)?!!element.href&&element.rel!=="ignore":isHTMLInputElement(element)?element.type!=="hidden"&&element.type!=="file"&&!element.disabled:isHTMLButtonElement(element)||isHTMLSelectElement(element)||isHTMLTextAreaElement(element)?!element.disabled:!1;}function attemptFocus(element){if(!isFocusable(element))return!1;try{element.focus();}catch(_unused3){}return document.activeElement===element;}function focusFirstDescendant(element){for(let i=0;i<element.childNodes.length;i++){const child=element.childNodes[i];if(isHTMLElement(child)&&(attemptFocus(child)||focusFirstDescendant(child)))return!0;}return!1;}function focusLastDescendant(element){for(let i=element.childNodes.length-1;i>=0;i--){const child=element.childNodes[i];if(isHTMLElement(child)&&(attemptFocus(child)||focusLastDescendant(child)))return!0;}return!1;}const StyledAutocomplete=styled.div.withConfig({displayName:"StyledAutocomplete",componentId:"sc-1igauft-0"})(_templateObject64||(_templateObject64=_taggedTemplateLiteral(["line-height:0;"]))),ListBox=styled(Box).withConfig({displayName:"ListBox",componentId:"sc-1igauft-1"})(_templateObject65||(_templateObject65=_taggedTemplateLiteral(["& > ul{list-style:none;padding:0;margin:0;}"]))),rotate=keyframes$1(_templateObject66||(_templateObject66=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"]))),AnimatedSpinnerIcon=styled(SpinnerIcon).withConfig({displayName:"AnimatedSpinnerIcon",componentId:"sc-1igauft-2"})(_templateObject67||(_templateObject67=_taggedTemplateLiteral(["animation:"," 500ms linear infinite;"])),rotate);function AutocompleteOption(props){const $=dist.c(11),{children,id,onSelect,selected,value}=props;let t0;$[0]!==onSelect||$[1]!==value?(t0=()=>{setTimeout(()=>{onSelect(value);},0);},$[0]=onSelect,$[1]=value,$[2]=t0):t0=$[2];const handleClick=t0;let t1;$[3]!==handleClick?(t1=event=>{event.key==="Enter"&&!_isEnterToClickElement(event.currentTarget)&&handleClick();},$[3]=handleClick,$[4]=t1):t1=$[4];const handleKeyDown=t1;let t2;return $[5]!==children||$[6]!==handleClick||$[7]!==handleKeyDown||$[8]!==id||$[9]!==selected?(t2=/* @__PURE__ */jsx("li",{"aria-selected":selected,"data-ui":"AutocompleteOption",id,role:"option",onClick:handleClick,onKeyDown:handleKeyDown,children}),$[5]=children,$[6]=handleClick,$[7]=handleKeyDown,$[8]=id,$[9]=selected,$[10]=t2):t2=$[10],t2;}function autocompleteReducer(state,msg){return msg.type==="input/change"?_objectSpread(_objectSpread({},state),{},{activeValue:null,focused:!0,query:msg.query}):msg.type==="input/focus"?_objectSpread(_objectSpread({},state),{},{focused:!0}):msg.type==="root/blur"?_objectSpread(_objectSpread({},state),{},{focused:!1,query:null}):msg.type==="root/clear"?_objectSpread(_objectSpread({},state),{},{activeValue:null,query:null,value:null}):msg.type==="root/escape"?_objectSpread(_objectSpread({},state),{},{focused:!1,query:null}):msg.type==="root/open"?_objectSpread(_objectSpread({},state),{},{query:state.query||msg.query}):msg.type==="root/setActiveValue"?_objectSpread(_objectSpread({},state),{},{activeValue:msg.value,listFocused:msg.listFocused||state.listFocused}):msg.type==="root/setListFocused"?_objectSpread(_objectSpread({},state),{},{listFocused:msg.listFocused}):msg.type==="value/change"?_objectSpread(_objectSpread({},state),{},{activeValue:msg.value,query:null,value:msg.value}):state;}const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS=["Control","Shift","Alt","Enter","Home","End","PageUp","PageDown","Meta","Tab","CapsLock"],AUTOCOMPLETE_POPOVER_PLACEMENT="bottom-start",AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS=["bottom-start","top-start"],DEFAULT_RENDER_VALUE=(value,option)=>option?option.value:value,DEFAULT_FILTER_OPTION=(query,option)=>option.value.toLowerCase().indexOf(query.toLowerCase())>-1,InnerAutocomplete=forwardRef(function(props,forwardedRef){var _props33;const $=dist.c(181);let customValidity,disabled,filterOptionProp,icon,id,loading,onBlur,onChange,onFocus,onQueryChange,onSelect,openButton,openOnFocus,optionsProp,prefix,readOnly,relatedElements,renderOptionProp,renderPopover,restProps,suffix,t0,t1,t2,t3,t4,t5,t6,valueProp;$[0]!==props?(_props33=props,{border:t0,customValidity,disabled,filterOption:filterOptionProp,fontSize:t1,icon,id,listBox:t2,loading,onBlur,onChange,onFocus,onQueryChange,onSelect,openButton,openOnFocus,options:optionsProp,padding:t3,popover:t4,prefix,radius:t5,readOnly,relatedElements,renderOption:renderOptionProp,renderPopover,renderValue:t6,suffix,value:valueProp}=_props33,restProps=_objectWithoutProperties(_props33,_excluded50),_props33,$[0]=props,$[1]=customValidity,$[2]=disabled,$[3]=filterOptionProp,$[4]=icon,$[5]=id,$[6]=loading,$[7]=onBlur,$[8]=onChange,$[9]=onFocus,$[10]=onQueryChange,$[11]=onSelect,$[12]=openButton,$[13]=openOnFocus,$[14]=optionsProp,$[15]=prefix,$[16]=readOnly,$[17]=relatedElements,$[18]=renderOptionProp,$[19]=renderPopover,$[20]=restProps,$[21]=suffix,$[22]=t0,$[23]=t1,$[24]=t2,$[25]=t3,$[26]=t4,$[27]=t5,$[28]=t6,$[29]=valueProp):(customValidity=$[1],disabled=$[2],filterOptionProp=$[3],icon=$[4],id=$[5],loading=$[6],onBlur=$[7],onChange=$[8],onFocus=$[9],onQueryChange=$[10],onSelect=$[11],openButton=$[12],openOnFocus=$[13],optionsProp=$[14],prefix=$[15],readOnly=$[16],relatedElements=$[17],renderOptionProp=$[18],renderPopover=$[19],restProps=$[20],suffix=$[21],t0=$[22],t1=$[23],t2=$[24],t3=$[25],t4=$[26],t5=$[27],t6=$[28],valueProp=$[29]);const border=t0===void 0?!0:t0,fontSize=t1===void 0?2:t1,listBox=t2===void 0?EMPTY_RECORD:t2,paddingProp=t3===void 0?3:t3,popover=t4===void 0?EMPTY_RECORD:t4,radius=t5===void 0?2:t5,renderValue=t6===void 0?DEFAULT_RENDER_VALUE:t6,t7=valueProp||null,t8=valueProp||null;let t9;$[30]!==t7||$[31]!==t8?(t9={activeValue:t7,focused:!1,listFocused:!1,query:null,value:t8},$[30]=t7,$[31]=t8,$[32]=t9):t9=$[32];const[state,dispatch]=useReducer(autocompleteReducer,t9),{activeValue,focused,listFocused,query,value}=state;let t10;$[33]!==fontSize||$[34]!==paddingProp?(t10=t112=>{const{value:value_0}=t112;return/* @__PURE__ */jsx(Card,{"data-as":"button",padding:paddingProp,radius:2,tone:"inherit",children:/* @__PURE__ */jsx(Text,{size:fontSize,textOverflow:"ellipsis",children:value_0})});},$[33]=fontSize,$[34]=paddingProp,$[35]=t10):t10=$[35];const renderOption=typeof renderOptionProp=="function"?renderOptionProp:t10,filterOption=typeof filterOptionProp=="function"?filterOptionProp:DEFAULT_FILTER_OPTION,rootElementRef=useRef$1(null),resultsPopoverElementRef=useRef$1(null),inputElementRef=useRef$1(null),listBoxElementRef=useRef$1(null),[inputElement,_setInputElement]=useState(null);let t11;$[36]===Symbol.for("react.memo_cache_sentinel")?(t11=node=>{startTransition(()=>_setInputElement(node));},$[36]=t11):t11=$[36];const setInputElement=t11,listFocusedRef=useRef$1(!1),valueRef=useRef$1(value),valuePropRef=useRef$1(valueProp),popoverMouseWithinRef=useRef$1(!1);let t12,t13;$[37]!==inputElement?(t12=()=>inputElement,t13=[inputElement],$[37]=inputElement,$[38]=t12,$[39]=t13):(t12=$[38],t13=$[39]),useImperativeHandle(inputElementRef,t12,t13);let t14,t15;$[40]!==inputElement?(t14=()=>inputElement,t15=[inputElement],$[40]=inputElement,$[41]=t14,$[42]=t15):(t14=$[41],t15=$[42]),useImperativeHandle(forwardedRef,t14,t15);const listBoxId="".concat(id,"-listbox"),options=Array.isArray(optionsProp)?optionsProp:EMPTY_ARRAY,padding=_getArrayProp(paddingProp);let t16;$[43]!==options||$[44]!==value?(t16=value!==null?options.find(o=>o.value===value):void 0,$[43]=options,$[44]=value,$[45]=t16):t16=$[45];const currentOption=t16;let t17;if($[46]!==filterOption||$[47]!==options||$[48]!==query){let t182;$[50]!==filterOption||$[51]!==query?(t182=option=>query?filterOption(query,option):!0,$[50]=filterOption,$[51]=query,$[52]=t182):t182=$[52],t17=options.filter(t182),$[46]=filterOption,$[47]=options,$[48]=query,$[49]=t17;}else t17=$[49];const filteredOptions=t17,filteredOptionsLen=filteredOptions.length,activeItemId=activeValue?"".concat(id,"-option-").concat(activeValue):void 0,expanded=query!==null&&loading||focused&&query!==null;let t18;$[53]!==onBlur||$[54]!==onQueryChange||$[55]!==relatedElements?(t18=event=>{setTimeout(()=>{if(popoverMouseWithinRef.current)return;const elements=(relatedElements||[]).concat(rootElementRef.current?[rootElementRef.current]:[],resultsPopoverElementRef.current?[resultsPopoverElementRef.current]:[]);let focusInside=!1;if(document.activeElement){for(const e of elements)if(e===document.activeElement||e.contains(document.activeElement)){focusInside=!0;break;}}focusInside===!1&&(dispatch({type:"root/blur"}),popoverMouseWithinRef.current=!1,onQueryChange&&onQueryChange(null),onBlur&&onBlur(event));},0);},$[53]=onBlur,$[54]=onQueryChange,$[55]=relatedElements,$[56]=t18):t18=$[56];const handleRootBlur=t18;let t19;$[57]===Symbol.for("react.memo_cache_sentinel")?(t19=event_0=>{const listBoxElement=listBoxElementRef.current,focusedElement=event_0.target instanceof HTMLElement?event_0.target:null,listFocused_0=(listBoxElement===null||listBoxElement===void 0?void 0:listBoxElement.contains(focusedElement))||!1;listFocused_0!==listFocusedRef.current&&(listFocusedRef.current=listFocused_0,dispatch({type:"root/setListFocused",listFocused:listFocused_0}));},$[57]=t19):t19=$[57];const handleRootFocus=t19;let t20;$[58]!==onChange||$[59]!==onQueryChange||$[60]!==onSelect?(t20=v=>{var _inputElementRef$curr;dispatch({type:"value/change",value:v}),popoverMouseWithinRef.current=!1,onSelect&&onSelect(v),valueRef.current=v,onChange&&onChange(v),onQueryChange&&onQueryChange(null),(_inputElementRef$curr=inputElementRef.current)===null||_inputElementRef$curr===void 0?void 0:_inputElementRef$curr.focus();},$[58]=onChange,$[59]=onQueryChange,$[60]=onSelect,$[61]=t20):t20=$[61];const handleOptionSelect=t20;let t21;$[62]!==activeValue||$[63]!==filteredOptions||$[64]!==filteredOptionsLen||$[65]!==onQueryChange?(t21=event_1=>{if(event_1.key==="ArrowDown"){if(event_1.preventDefault(),!filteredOptionsLen)return;const activeOption=filteredOptions.find(o_0=>o_0.value===activeValue),activeIndex=activeOption?filteredOptions.indexOf(activeOption):-1,nextActiveOption=filteredOptions[(activeIndex+1)%filteredOptionsLen];nextActiveOption&&dispatch({type:"root/setActiveValue",value:nextActiveOption.value,listFocused:!0});return;}if(event_1.key==="ArrowUp"){if(event_1.preventDefault(),!filteredOptionsLen)return;const activeOption_0=filteredOptions.find(o_1=>o_1.value===activeValue),activeIndex_0=activeOption_0?filteredOptions.indexOf(activeOption_0):-1,nextActiveOption_0=filteredOptions[activeIndex_0===-1?filteredOptionsLen-1:(filteredOptionsLen+activeIndex_0-1)%filteredOptionsLen];nextActiveOption_0&&dispatch({type:"root/setActiveValue",value:nextActiveOption_0.value,listFocused:!0});return;}if(event_1.key==="Escape"){var _inputElementRef$curr2;dispatch({type:"root/escape"}),popoverMouseWithinRef.current=!1,onQueryChange&&onQueryChange(null),(_inputElementRef$curr2=inputElementRef.current)===null||_inputElementRef$curr2===void 0?void 0:_inputElementRef$curr2.focus();return;}const target=event_1.target,listEl=listBoxElementRef.current;if((listEl===target||listEl!==null&&listEl!==void 0&&listEl.contains(target))&&!AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)){var _inputElementRef$curr3;(_inputElementRef$curr3=inputElementRef.current)===null||_inputElementRef$curr3===void 0||_inputElementRef$curr3.focus();return;}},$[62]=activeValue,$[63]=filteredOptions,$[64]=filteredOptionsLen,$[65]=onQueryChange,$[66]=t21):t21=$[66];const handleRootKeyDown=t21;let t22;$[67]!==onQueryChange?(t22=event_2=>{const nextQuery=event_2.currentTarget.value;dispatch({type:"input/change",query:nextQuery}),onQueryChange&&onQueryChange(nextQuery);},$[67]=onQueryChange,$[68]=t22):t22=$[68];const handleInputChange=t22;let t23;$[69]!==currentOption||$[70]!==renderValue||$[71]!==value?(t23=()=>{dispatch({type:"root/open",query:value?renderValue(value,currentOption):""});},$[69]=currentOption,$[70]=renderValue,$[71]=value,$[72]=t23):t23=$[72];const dispatchOpen=t23;let t24;$[73]!==dispatchOpen||$[74]!==focused||$[75]!==onFocus||$[76]!==openOnFocus?(t24=event_3=>{focused||(dispatch({type:"input/focus"}),onFocus&&onFocus(event_3),openOnFocus&&dispatchOpen());},$[73]=dispatchOpen,$[74]=focused,$[75]=onFocus,$[76]=openOnFocus,$[77]=t24):t24=$[77];const handleInputFocus=t24;let t25;$[78]===Symbol.for("react.memo_cache_sentinel")?(t25=()=>{popoverMouseWithinRef.current=!0;},$[78]=t25):t25=$[78];const handlePopoverMouseEnter=t25;let t26;$[79]===Symbol.for("react.memo_cache_sentinel")?(t26=()=>{popoverMouseWithinRef.current=!1;},$[79]=t26):t26=$[79];const handlePopoverMouseLeave=t26;let t27;$[80]!==onChange||$[81]!==onQueryChange?(t27=()=>{var _inputElementRef$curr4;dispatch({type:"root/clear"}),valueRef.current="",onChange&&onChange(""),onQueryChange&&onQueryChange(null),(_inputElementRef$curr4=inputElementRef.current)===null||_inputElementRef$curr4===void 0?void 0:_inputElementRef$curr4.focus();},$[80]=onChange,$[81]=onQueryChange,$[82]=t27):t27=$[82];const handleClearButtonClick=t27;let t28;$[83]===Symbol.for("react.memo_cache_sentinel")?(t28=()=>{dispatch({type:"input/focus"});},$[83]=t28):t28=$[83];const handleClearButtonFocus=t28;let t29,t30;$[84]!==valueProp?(t29=()=>{if(valueProp!==valuePropRef.current){valuePropRef.current=valueProp,valueProp!==void 0&&(dispatch({type:"value/change",value:valueProp}),valueRef.current=valueProp);return;}valueProp!==valueRef.current&&(valueRef.current=valueProp||null,dispatch({type:"value/change",value:valueProp||null}));},t30=[valueProp],$[84]=valueProp,$[85]=t29,$[86]=t30):(t29=$[85],t30=$[86]),useEffect$1(t29,t30);let t31,t32;$[87]!==focused?(t31=()=>{!focused&&valueRef.current&&dispatch({type:"root/setActiveValue",value:valueRef.current});},t32=[focused],$[87]=focused,$[88]=t31,$[89]=t32):(t31=$[88],t32=$[89]),useEffect$1(t31,t32);let t33,t34;$[90]!==activeValue||$[91]!==filteredOptions?(t33=()=>{const listElement=listBoxElementRef.current;if(!listElement)return;const activeOption_1=filteredOptions.find(o_2=>o_2.value===activeValue);if(activeOption_1){const activeIndex_1=filteredOptions.indexOf(activeOption_1),activeItemElement=listElement.childNodes[activeIndex_1];if(activeItemElement){if(_hasFocus(activeItemElement))return;focusFirstDescendant(activeItemElement);}}},t34=[activeValue,filteredOptions],$[90]=activeValue,$[91]=filteredOptions,$[92]=t33,$[93]=t34):(t33=$[92],t34=$[93]),useEffect$1(t33,t34);let t35;bb0:{if(!loading&&!disabled&&value){let t362;$[94]===Symbol.for("react.memo_cache_sentinel")?(t362={"aria-label":"Clear",onFocus:handleClearButtonFocus},$[94]=t362):t362=$[94],t35=t362;break bb0;}t35=void 0;}const clearButton=t35,openButtonBoxPadding=padding.map(_temp$3),openButtonPadding=padding.map(_temp2$1),openButtonProps=typeof openButton=="object"?openButton:EMPTY_RECORD;let t36;$[95]!==dispatchOpen||$[96]!==openButtonProps?(t36=event_4=>{dispatchOpen(),openButtonProps.onClick&&openButtonProps.onClick(event_4),_raf(()=>{var _inputElementRef$curr5;return(_inputElementRef$curr5=inputElementRef.current)===null||_inputElementRef$curr5===void 0?void 0:_inputElementRef$curr5.focus();});},$[95]=dispatchOpen,$[96]=openButtonProps,$[97]=t36):t36=$[97];const handleOpenClick=t36;let t37;$[98]!==disabled||$[99]!==expanded||$[100]!==fontSize||$[101]!==handleOpenClick||$[102]!==openButton||$[103]!==openButtonBoxPadding||$[104]!==openButtonPadding||$[105]!==openButtonProps||$[106]!==readOnly?(t37=!disabled&&!readOnly&&openButton?/* @__PURE__ */jsx(Box,{"aria-hidden":expanded,padding:openButtonBoxPadding,children:/* @__PURE__ */jsx(Button,_objectSpread(_objectSpread({"aria-label":"Open",disabled:expanded,fontSize,icon:ChevronDownIcon,mode:"bleed",padding:openButtonPadding},openButtonProps),{},{onClick:handleOpenClick}))}):void 0,$[98]=disabled,$[99]=expanded,$[100]=fontSize,$[101]=handleOpenClick,$[102]=openButton,$[103]=openButtonBoxPadding,$[104]=openButtonPadding,$[105]=openButtonProps,$[106]=readOnly,$[107]=t37):t37=$[107];const openButtonNode=t37;let t38;bb1:{if(query===null){if(value!==null){let t392;$[108]!==currentOption||$[109]!==renderValue||$[110]!==value?(t392=renderValue(value,currentOption),$[108]=currentOption,$[109]=renderValue,$[110]=value,$[111]=t392):t392=$[111],t38=t392;break bb1;}t38="";break bb1;}t38=query;}const inputValue=t38;let t39;$[112]!==listFocused?(t39=event_5=>{var _inputElementRef$curr6;event_5.key==="Tab"&&listFocused&&((_inputElementRef$curr6=inputElementRef.current)===null||_inputElementRef$curr6===void 0?void 0:_inputElementRef$curr6.focus());},$[112]=listFocused,$[113]=t39):t39=$[113];const handleListBoxKeyDown=t39;let t40;bb2:{if(filteredOptions.length===0){t40=null;break bb2;}let t412;if($[114]!==activeValue||$[115]!==currentOption||$[116]!==filteredOptions||$[117]!==handleOptionSelect||$[118]!==id||$[119]!==listFocused||$[120]!==loading||$[121]!==renderOption){let t423;$[123]!==activeValue||$[124]!==currentOption||$[125]!==handleOptionSelect||$[126]!==id||$[127]!==listFocused||$[128]!==loading||$[129]!==renderOption?(t423=option_0=>{const active=activeValue!==null?option_0.value===activeValue:currentOption===option_0;return/* @__PURE__ */jsx(AutocompleteOption,{id:"".concat(id,"-option-").concat(option_0.value),onSelect:handleOptionSelect,selected:active,value:option_0.value,children:cloneElement(renderOption(option_0),{disabled:loading,selected:active,tabIndex:listFocused&&active?0:-1})},option_0.value);},$[123]=activeValue,$[124]=currentOption,$[125]=handleOptionSelect,$[126]=id,$[127]=listFocused,$[128]=loading,$[129]=renderOption,$[130]=t423):t423=$[130],t412=filteredOptions.map(t423),$[114]=activeValue,$[115]=currentOption,$[116]=filteredOptions,$[117]=handleOptionSelect,$[118]=id,$[119]=listFocused,$[120]=loading,$[121]=renderOption,$[122]=t412;}else t412=$[122];let t422;$[131]!==listBoxId||$[132]!==t412?(t422=/* @__PURE__ */jsx(Stack,{as:"ul","aria-multiselectable":!1,"data-ui":"AutoComplete__resultsList",id:listBoxId,ref:listBoxElementRef,role:"listbox",space:1,children:t412}),$[131]=listBoxId,$[132]=t412,$[133]=t422):t422=$[133];let t432;$[134]!==handleListBoxKeyDown||$[135]!==listBox||$[136]!==t422?(t432=/* @__PURE__ */jsx(ListBox,_objectSpread(_objectSpread({"data-ui":"AutoComplete__results",onKeyDown:handleListBoxKeyDown,padding:1},listBox),{},{tabIndex:-1,children:t422})),$[134]=handleListBoxKeyDown,$[135]=listBox,$[136]=t422,$[137]=t432):t432=$[137],t40=t432;}const content2=t40;let t41;bb3:{if(renderPopover){const t423=!expanded;let t432;$[138]!==content2||$[139]!==handlePopoverMouseEnter||$[140]!==handlePopoverMouseLeave||$[141]!==inputElement||$[142]!==renderPopover||$[143]!==t423?(t432=/* @__PURE__ */jsx(RenderPopover,{content:content2,hidden:t423,inputElement,onMouseEnter:handlePopoverMouseEnter,onMouseLeave:handlePopoverMouseLeave,resultsPopoverElementRef,renderPopover}),$[138]=content2,$[139]=handlePopoverMouseEnter,$[140]=handlePopoverMouseLeave,$[141]=inputElement,$[142]=renderPopover,$[143]=t423,$[144]=t432):t432=$[144],t41=t432;break bb3;}if(filteredOptionsLen===0){t41=null;break bb3;}let t422;$[145]!==content2||$[146]!==expanded||$[147]!==handlePopoverMouseEnter||$[148]!==handlePopoverMouseLeave||$[149]!==inputElement||$[150]!==popover||$[151]!==radius?(t422=/* @__PURE__ */jsx(Popover,_objectSpread({arrow:!1,constrainSize:!0,content:content2,fallbackPlacements:AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS,matchReferenceWidth:!0,onMouseEnter:handlePopoverMouseEnter,onMouseLeave:handlePopoverMouseLeave,open:expanded,overflow:"auto",placement:AUTOCOMPLETE_POPOVER_PLACEMENT,portal:!0,radius,ref:resultsPopoverElementRef,referenceElement:inputElement},popover)),$[145]=content2,$[146]=expanded,$[147]=handlePopoverMouseEnter,$[148]=handlePopoverMouseLeave,$[149]=inputElement,$[150]=popover,$[151]=radius,$[152]=t422):t422=$[152],t41=t422;}const results=t41,t42=loading&&AnimatedSpinnerIcon,t43=suffix||openButtonNode;let t44;$[153]!==activeItemId||$[154]!==border||$[155]!==clearButton||$[156]!==customValidity||$[157]!==disabled||$[158]!==expanded||$[159]!==fontSize||$[160]!==handleClearButtonClick||$[161]!==handleInputChange||$[162]!==handleInputFocus||$[163]!==icon||$[164]!==id||$[165]!==inputValue||$[166]!==listBoxId||$[167]!==padding||$[168]!==prefix||$[169]!==radius||$[170]!==readOnly||$[171]!==restProps||$[172]!==t42||$[173]!==t43?(t44=/* @__PURE__ */jsx(TextInput,_objectSpread(_objectSpread({},restProps),{},{"aria-activedescendant":activeItemId,"aria-autocomplete":"list","aria-expanded":expanded,"aria-owns":listBoxId,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",border,clearButton,customValidity,disabled,fontSize,icon,iconRight:t42,id,inputMode:"search",onChange:handleInputChange,onClear:handleClearButtonClick,onFocus:handleInputFocus,padding,prefix,radius,readOnly,ref:setInputElement,role:"combobox",spellCheck:!1,suffix:t43,value:inputValue})),$[153]=activeItemId,$[154]=border,$[155]=clearButton,$[156]=customValidity,$[157]=disabled,$[158]=expanded,$[159]=fontSize,$[160]=handleClearButtonClick,$[161]=handleInputChange,$[162]=handleInputFocus,$[163]=icon,$[164]=id,$[165]=inputValue,$[166]=listBoxId,$[167]=padding,$[168]=prefix,$[169]=radius,$[170]=readOnly,$[171]=restProps,$[172]=t42,$[173]=t43,$[174]=t44):t44=$[174];let t45;return $[175]!==handleRootBlur||$[176]!==handleRootFocus||$[177]!==handleRootKeyDown||$[178]!==results||$[179]!==t44?(t45=/* @__PURE__ */jsxs(StyledAutocomplete,{"data-ui":"Autocomplete",onBlur:handleRootBlur,onFocus:handleRootFocus,onKeyDown:handleRootKeyDown,ref:rootElementRef,children:[t44,results]}),$[175]=handleRootBlur,$[176]=handleRootFocus,$[177]=handleRootKeyDown,$[178]=results,$[179]=t44,$[180]=t45):t45=$[180],t45;});function RenderPopover(_ref76){let{renderPopover,content:content2,hidden,inputElement,onMouseEnter,onMouseLeave,resultsPopoverElementRef}=_ref76;return renderPopover({content:content2,hidden,inputElement,onMouseEnter,onMouseLeave},resultsPopoverElementRef);}InnerAutocomplete.displayName="ForwardRef(Autocomplete)";function _temp$3(v_0){return v_0===0?0:v_0===1||v_0===2?1:v_0-2;}function _temp2$1(v_1){return Math.max(v_1-1,0);}const StyledBreadcrumbs=styled.ol.withConfig({displayName:"StyledBreadcrumbs",componentId:"sc-1es8h8q-0"})(_templateObject68||(_templateObject68=_taggedTemplateLiteral(["margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;"]))),ExpandButton=styled(Button).withConfig({displayName:"ExpandButton",componentId:"sc-1es8h8q-1"})(_templateObject69||(_templateObject69=_taggedTemplateLiteral(["appearance:none;margin:-4px;"]))),Breadcrumbs=forwardRef(function(props,ref){var _props34;const $=dist.c(29);let children,maxLength,restProps,separator,t0;$[0]!==props?(_props34=props,{children,maxLength,separator,space:t0}=_props34,restProps=_objectWithoutProperties(_props34,_excluded51),_props34,$[0]=props,$[1]=children,$[2]=maxLength,$[3]=restProps,$[4]=separator,$[5]=t0):(children=$[1],maxLength=$[2],restProps=$[3],separator=$[4],t0=$[5]);const spaceRaw=t0===void 0?2:t0;let t1;$[6]!==spaceRaw?(t1=_getArrayProp(spaceRaw),$[6]=spaceRaw,$[7]=t1):t1=$[7];const space=t1,[open,setOpen]=useState(!1),expandElementRef=useRef$1(null),popoverElementRef=useRef$1(null);let t2;$[8]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>setOpen(!1),$[8]=t2):t2=$[8];const collapse=t2;let t3;$[9]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>setOpen(!0),$[9]=t3):t3=$[9];const expand=t3;let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>[expandElementRef.current,popoverElementRef.current],$[10]=t4):t4=$[10],useClickOutsideEvent(collapse,t4);let t5;$[11]!==children?(t5=Children.toArray(children).filter(isValidElement$1),$[11]=children,$[12]=t5):t5=$[12];const rawItems=t5;let t6;$[13]!==maxLength||$[14]!==open||$[15]!==rawItems||$[16]!==space?(t6={collapse,expand,expandElementRef,maxLength,open,popoverElementRef,rawItems,space},$[13]=maxLength,$[14]=open,$[15]=rawItems,$[16]=space,$[17]=t6):t6=$[17];const items=useItems(t6);let t7;if($[18]!==items||$[19]!==separator||$[20]!==space){let t82;$[22]!==separator||$[23]!==space?(t82=(item,itemIndex)=>/* @__PURE__ */jsxs(Fragment$1,{children:[itemIndex>0&&/* @__PURE__ */jsx(Box,{"aria-hidden":!0,as:"li",paddingX:space,children:separator||/* @__PURE__ */jsx(Text,{muted:!0,children:"/"})}),/* @__PURE__ */jsx(Box,{as:"li",children:item})]},itemIndex),$[22]=separator,$[23]=space,$[24]=t82):t82=$[24],t7=items.map(t82),$[18]=items,$[19]=separator,$[20]=space,$[21]=t7;}else t7=$[21];let t8;return $[25]!==ref||$[26]!==restProps||$[27]!==t7?(t8=/* @__PURE__ */jsx(StyledBreadcrumbs,_objectSpread(_objectSpread({"data-ui":"Breadcrumbs"},restProps),{},{ref,children:t7})),$[25]=ref,$[26]=restProps,$[27]=t7,$[28]=t8):t8=$[28],t8;});Breadcrumbs.displayName="ForwardRef(Breadcrumbs)";function useItems(t0){const $=dist.c(28),{collapse,expand,expandElementRef,maxLength,open,popoverElementRef,rawItems,space}=t0,len=rawItems.length;if(maxLength&&len>maxLength){const beforeLength=Math.ceil(maxLength/2),afterLength=Math.floor(maxLength/2);let t1;if($[0]!==afterLength||$[1]!==beforeLength||$[2]!==collapse||$[3]!==expand||$[4]!==expandElementRef||$[5]!==len||$[6]!==open||$[7]!==popoverElementRef||$[8]!==rawItems||$[9]!==space){const t2=rawItems.slice(0,beforeLength-1);let t3;$[11]!==afterLength||$[12]!==beforeLength||$[13]!==len||$[14]!==rawItems?(t3=rawItems.slice(beforeLength-1,len-afterLength),$[11]=afterLength,$[12]=beforeLength,$[13]=len,$[14]=rawItems,$[15]=t3):t3=$[15];let t4;$[16]!==space||$[17]!==t3?(t4=/* @__PURE__ */jsx(Stack,{as:"ol",overflow:"auto",padding:space,space,children:t3}),$[16]=space,$[17]=t3,$[18]=t4):t4=$[18];const t5=open?collapse:expand;let t6;$[19]!==expandElementRef||$[20]!==open||$[21]!==t5?(t6=/* @__PURE__ */jsx(ExpandButton,{fontSize:1,mode:"bleed",onClick:t5,padding:1,ref:expandElementRef,selected:open,text:"\u2026"}),$[19]=expandElementRef,$[20]=open,$[21]=t5,$[22]=t6):t6=$[22];let t7;$[23]!==open||$[24]!==popoverElementRef||$[25]!==t4||$[26]!==t6?(t7=/* @__PURE__ */jsx(Popover,{constrainSize:!0,content:t4,open,placement:"top",portal:!0,ref:popoverElementRef,children:t6},"button"),$[23]=open,$[24]=popoverElementRef,$[25]=t4,$[26]=t6,$[27]=t7):t7=$[27],t1=[...t2,t7,...rawItems.slice(len-afterLength)],$[0]=afterLength,$[1]=beforeLength,$[2]=collapse,$[3]=expand,$[4]=expandElementRef,$[5]=len,$[6]=open,$[7]=popoverElementRef,$[8]=rawItems,$[9]=space,$[10]=t1;}else t1=$[10];return t1;}return rawItems;}function dialogStyle(_ref77){let{theme}=_ref77;const{color}=getTheme_v2(theme);return{"&:not([hidden])":{display:"flex"},top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center",outline:"none",background:color.backdrop};}function responsiveDialogPositionStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$position,position=>({"&&":{position}}));}function animationDialogStyle(props){return props.$animate?css(_templateObject70||(_templateObject70=_taggedTemplateLiteral(["\n @keyframes zoomIn {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n animation: fadeIn 200ms ease-out;\n // Animates the dialog card.\n & > [data-ui='DialogCard'] {\n animation: zoomIn 200ms ease-out;\n }\n "]))):css(_templateObject71||(_templateObject71=_taggedTemplateLiteral([""])));}const DialogContext=createGlobalScopedContext("@sanity/ui/context/dialog",{version:0});function useDialog(){return useContext(DialogContext);}function isTargetWithinScope(boundaryElement,portalElement,target){return!boundaryElement||!portalElement?!0:containsOrEqualsElement(boundaryElement,target)||containsOrEqualsElement(portalElement,target);}const StyledDialog=/* @__PURE__ */styled(Layer).withConfig({displayName:"StyledDialog",componentId:"sc-4n4xb3-0"})(responsivePaddingStyle,dialogStyle,responsiveDialogPositionStyle,animationDialogStyle),DialogContainer=styled(Container).withConfig({displayName:"DialogContainer",componentId:"sc-4n4xb3-1"})(_templateObject72||(_templateObject72=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;"]))),DialogCardRoot=styled(Card).withConfig({displayName:"DialogCardRoot",componentId:"sc-4n4xb3-2"})(_templateObject73||(_templateObject73=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;"]))),DialogLayout=styled(Flex).withConfig({displayName:"DialogLayout",componentId:"sc-4n4xb3-3"})(_templateObject74||(_templateObject74=_taggedTemplateLiteral(["flex:1;min-height:0;width:100%;"]))),DialogHeader=styled(Box).withConfig({displayName:"DialogHeader",componentId:"sc-4n4xb3-4"})(_templateObject75||(_templateObject75=_taggedTemplateLiteral(["position:relative;z-index:2;"]))),DialogContent=styled(Box).withConfig({displayName:"DialogContent",componentId:"sc-4n4xb3-5"})(_templateObject76||(_templateObject76=_taggedTemplateLiteral(["position:relative;z-index:1;overflow:auto;outline:none;"]))),DialogFooter=styled(Box).withConfig({displayName:"DialogFooter",componentId:"sc-4n4xb3-6"})(_templateObject77||(_templateObject77=_taggedTemplateLiteral(["position:relative;z-index:3;"]))),DialogCard=forwardRef(function(props,forwardedRef){var _portal$elements3;const $=dist.c(44),{__unstable_autoFocus:autoFocus,__unstable_hideCloseButton:hideCloseButton,children,contentRef:forwardedContentRef,footer,header,id,onClickOutside,onClose,portal:portalProp,radius:radiusProp,scheme,shadow:shadowProp,width:widthProp}=props,portal=usePortal(),portalElement=portalProp?((_portal$elements3=portal.elements)===null||_portal$elements3===void 0?void 0:_portal$elements3[portalProp])||null:portal.element,boundaryElement=useBoundaryElement().element;let t0;$[0]!==radiusProp?(t0=_getArrayProp(radiusProp),$[0]=radiusProp,$[1]=t0):t0=$[1];const radius=t0;let t1;$[2]!==shadowProp?(t1=_getArrayProp(shadowProp),$[2]=shadowProp,$[3]=t1):t1=$[3];const shadow=t1;let t2;$[4]!==widthProp?(t2=_getArrayProp(widthProp),$[4]=widthProp,$[5]=t2):t2=$[5];const width=t2,ref=useRef$1(null),contentRef=useRef$1(null),layer=useLayer(),{isTopLayer}=layer,labelId="".concat(id,"_label"),showCloseButton=!!onClose&&hideCloseButton===!1,showHeader=!!header||showCloseButton;let t3;$[6]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>ref.current,$[6]=t3):t3=$[6],useImperativeHandle(forwardedRef,t3);let t4;$[7]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>contentRef.current,$[7]=t4):t4=$[7],useImperativeHandle(forwardedContentRef,t4);let t5,t6;$[8]!==autoFocus?(t5=()=>{autoFocus&&ref.current&&focusFirstDescendant(ref.current);},t6=[autoFocus,ref],$[8]=autoFocus,$[9]=t5,$[10]=t6):(t5=$[9],t6=$[10]),useEffect$1(t5,t6);let t7;$[11]!==boundaryElement||$[12]!==isTopLayer||$[13]!==onClose||$[14]!==portalElement?(t7=event=>{if(!isTopLayer||!onClose)return;const target=document.activeElement;target&&!isTargetWithinScope(boundaryElement,portalElement,target)||event.key==="Escape"&&(event.preventDefault(),event.stopPropagation(),onClose());},$[11]=boundaryElement,$[12]=isTopLayer,$[13]=onClose,$[14]=portalElement,$[15]=t7):t7=$[15],useGlobalKeyDown(t7);let t8;$[16]!==boundaryElement||$[17]!==isTopLayer||$[18]!==onClickOutside||$[19]!==portalElement?(t8=isTopLayer&&onClickOutside&&(event_0=>{const target_0=event_0.target;target_0&&!isTargetWithinScope(boundaryElement,portalElement,target_0)||onClickOutside();}),$[16]=boundaryElement,$[17]=isTopLayer,$[18]=onClickOutside,$[19]=portalElement,$[20]=t8):t8=$[20];let t9;$[21]===Symbol.for("react.memo_cache_sentinel")?(t9=()=>[ref.current],$[21]=t9):t9=$[21],useClickOutsideEvent(t8,t9);let t10;$[22]!==header||$[23]!==labelId||$[24]!==onClose||$[25]!==showCloseButton||$[26]!==showHeader?(t10=showHeader&&/* @__PURE__ */jsx(DialogHeader,{children:/* @__PURE__ */jsxs(Flex,{align:"flex-start",padding:3,children:[/* @__PURE__ */jsx(Box,{flex:1,padding:2,children:header&&/* @__PURE__ */jsx(Text,{id:labelId,size:1,weight:"semibold",children:header})}),showCloseButton&&/* @__PURE__ */jsx(Box,{flex:"none",children:/* @__PURE__ */jsx(Button,{"aria-label":"Close dialog",disabled:!onClose,icon:CloseIcon,mode:"bleed",onClick:onClose,padding:2})})]})}),$[22]=header,$[23]=labelId,$[24]=onClose,$[25]=showCloseButton,$[26]=showHeader,$[27]=t10):t10=$[27];let t11;$[28]!==children?(t11=/* @__PURE__ */jsx(DialogContent,{flex:1,ref:contentRef,tabIndex:-1,children}),$[28]=children,$[29]=t11):t11=$[29];let t12;$[30]!==footer?(t12=footer&&/* @__PURE__ */jsx(DialogFooter,{children:footer}),$[30]=footer,$[31]=t12):t12=$[31];let t13;$[32]!==t10||$[33]!==t11||$[34]!==t12?(t13=/* @__PURE__ */jsxs(DialogLayout,{direction:"column",children:[t10,t11,t12]}),$[32]=t10,$[33]=t11,$[34]=t12,$[35]=t13):t13=$[35];let t14;$[36]!==radius||$[37]!==scheme||$[38]!==shadow||$[39]!==t13?(t14=/* @__PURE__ */jsx(DialogCardRoot,{radius,ref,scheme,shadow,children:t13}),$[36]=radius,$[37]=scheme,$[38]=shadow,$[39]=t13,$[40]=t14):t14=$[40];let t15;return $[41]!==t14||$[42]!==width?(t15=/* @__PURE__ */jsx(DialogContainer,{"data-ui":"DialogCard",width,children:t14}),$[41]=t14,$[42]=width,$[43]=t15):t15=$[43],t15;});DialogCard.displayName="ForwardRef(DialogCard)";const Dialog=forwardRef(function(props,ref){var _props35,_portal$elements4;const $=dist.c(70),dialog=useDialog(),{layer}=useTheme_v2();let _positionProp,_zOffsetProp,children,contentRef,footer,header,id,onActivate,onClickOutside,onClose,onFocus,portalProp,restProps,scheme,t0,t1,t2,t3,t4,t5,t6;$[0]!==props?(_props35=props,{__unstable_autoFocus:t0,__unstable_hideCloseButton:t1,cardRadius:t2,cardShadow:t3,children,contentRef,footer,header,id,onActivate,onClickOutside,onClose,onFocus,padding:t4,portal:portalProp,position:_positionProp,scheme,width:t5,zOffset:_zOffsetProp,animate:t6}=_props35,restProps=_objectWithoutProperties(_props35,_excluded52),_props35,$[0]=props,$[1]=_positionProp,$[2]=_zOffsetProp,$[3]=children,$[4]=contentRef,$[5]=footer,$[6]=header,$[7]=id,$[8]=onActivate,$[9]=onClickOutside,$[10]=onClose,$[11]=onFocus,$[12]=portalProp,$[13]=restProps,$[14]=scheme,$[15]=t0,$[16]=t1,$[17]=t2,$[18]=t3,$[19]=t4,$[20]=t5,$[21]=t6):(_positionProp=$[1],_zOffsetProp=$[2],children=$[3],contentRef=$[4],footer=$[5],header=$[6],id=$[7],onActivate=$[8],onClickOutside=$[9],onClose=$[10],onFocus=$[11],portalProp=$[12],restProps=$[13],scheme=$[14],t0=$[15],t1=$[16],t2=$[17],t3=$[18],t4=$[19],t5=$[20],t6=$[21]);const autoFocus=t0===void 0?!0:t0,hideCloseButton=t1===void 0?!1:t1,cardRadiusProp=t2===void 0?4:t2,cardShadow=t3===void 0?3:t3,paddingProp=t4===void 0?3:t4,widthProp=t5===void 0?0:t5,_animate=t6===void 0?!1:t6,positionProp=_positionProp!==null&&_positionProp!==void 0?_positionProp:dialog.position||"fixed",zOffsetProp=_zOffsetProp!==null&&_zOffsetProp!==void 0?_zOffsetProp:dialog.zOffset||layer.dialog.zOffset,animate=usePrefersReducedMotion()?!1:_animate,portal=usePortal(),portalElement=portalProp?((_portal$elements4=portal.elements)===null||_portal$elements4===void 0?void 0:_portal$elements4[portalProp])||null:portal.element,boundaryElement=useBoundaryElement().element;let t7;$[22]!==cardRadiusProp?(t7=_getArrayProp(cardRadiusProp),$[22]=cardRadiusProp,$[23]=t7):t7=$[23];const cardRadius=t7;let t8;$[24]!==paddingProp?(t8=_getArrayProp(paddingProp),$[24]=paddingProp,$[25]=t8):t8=$[25];const padding=t8;let t9;$[26]!==positionProp?(t9=_getArrayProp(positionProp),$[26]=positionProp,$[27]=t9):t9=$[27];const position=t9;let t10;$[28]!==widthProp?(t10=_getArrayProp(widthProp),$[28]=widthProp,$[29]=t10):t10=$[29];const width=t10;let t11;$[30]!==zOffsetProp?(t11=_getArrayProp(zOffsetProp),$[30]=zOffsetProp,$[31]=t11):t11=$[31];const zOffset=t11,preDivRef=useRef$1(null),postDivRef=useRef$1(null),cardRef=useRef$1(null),focusedElementRef=useRef$1(null);let t12;$[32]!==onFocus?(t12=event=>{var _onFocus2;(_onFocus2=onFocus)===null||_onFocus2===void 0||_onFocus2(event);const target=event.target,cardElement=cardRef.current;if(cardElement&&target===preDivRef.current){focusLastDescendant(cardElement);return;}if(cardElement&&target===postDivRef.current){focusFirstDescendant(cardElement);return;}isHTMLElement(event.target)&&(focusedElementRef.current=event.target);},$[32]=onFocus,$[33]=t12):t12=$[33];const handleFocus=t12,labelId="".concat(id,"_label"),rootClickTimeoutRef=useRef$1(void 0);let t13;$[34]!==boundaryElement||$[35]!==portalElement?(t13=()=>{rootClickTimeoutRef.current&&clearTimeout(rootClickTimeoutRef.current),rootClickTimeoutRef.current=setTimeout(()=>{const activeElement=document.activeElement;if(activeElement&&!isTargetWithinScope(boundaryElement,portalElement,activeElement)){const target_0=focusedElementRef.current;if(!target_0||!document.body.contains(target_0)){const cardElement_0=cardRef.current;cardElement_0&&focusFirstDescendant(cardElement_0);return;}target_0.focus();}},0);},$[34]=boundaryElement,$[35]=portalElement,$[36]=t13):t13=$[36];const handleRootClick=t13;let t14;$[37]===Symbol.for("react.memo_cache_sentinel")?(t14=/* @__PURE__ */jsx("div",{ref:preDivRef,tabIndex:0}),$[37]=t14):t14=$[37];let t15;$[38]!==autoFocus||$[39]!==cardRadius||$[40]!==cardShadow||$[41]!==children||$[42]!==contentRef||$[43]!==footer||$[44]!==header||$[45]!==hideCloseButton||$[46]!==id||$[47]!==onClickOutside||$[48]!==onClose||$[49]!==portalProp||$[50]!==scheme||$[51]!==width?(t15=/* @__PURE__ */jsx(DialogCard,{__unstable_autoFocus:autoFocus,__unstable_hideCloseButton:hideCloseButton,contentRef,footer,header,id,onClickOutside,onClose,portal:portalProp,radius:cardRadius,ref:cardRef,scheme,shadow:cardShadow,width,children}),$[38]=autoFocus,$[39]=cardRadius,$[40]=cardShadow,$[41]=children,$[42]=contentRef,$[43]=footer,$[44]=header,$[45]=hideCloseButton,$[46]=id,$[47]=onClickOutside,$[48]=onClose,$[49]=portalProp,$[50]=scheme,$[51]=width,$[52]=t15):t15=$[52];let t16;$[53]===Symbol.for("react.memo_cache_sentinel")?(t16=/* @__PURE__ */jsx("div",{ref:postDivRef,tabIndex:0}),$[53]=t16):t16=$[53];let t17;$[54]!==animate||$[55]!==handleFocus||$[56]!==handleRootClick||$[57]!==id||$[58]!==labelId||$[59]!==onActivate||$[60]!==padding||$[61]!==position||$[62]!==ref||$[63]!==restProps||$[64]!==t15||$[65]!==zOffset?(t17=/* @__PURE__ */jsxs(StyledDialog,_objectSpread(_objectSpread({},restProps),{},{$animate:animate,$padding:padding,$position:position,"aria-labelledby":labelId,"aria-modal":!0,"data-ui":"Dialog",id,onActivate,onClick:handleRootClick,onFocus:handleFocus,ref,role:"dialog",zOffset,children:[t14,t15,t16]})),$[54]=animate,$[55]=handleFocus,$[56]=handleRootClick,$[57]=id,$[58]=labelId,$[59]=onActivate,$[60]=padding,$[61]=position,$[62]=ref,$[63]=restProps,$[64]=t15,$[65]=zOffset,$[66]=t17):t17=$[66];let t18;return $[67]!==portalProp||$[68]!==t17?(t18=/* @__PURE__ */jsx(Portal,{__unstable_name:portalProp,children:t17}),$[67]=portalProp,$[68]=t17,$[69]=t18):t18=$[69],t18;});Dialog.displayName="ForwardRef(Dialog)";const MenuButton=forwardRef(function(props,forwardedRef){var _buttonProp$props$sel;const $=dist.c(62),{__unstable_disableRestoreFocusOnClose:t0,boundaryElement:deprecated_boundaryElement,button:buttonProp,id,menu:menuProp,onClose,onOpen,placement:deprecated_placement,popoverScheme:deprecated_popoverScheme,portal:t1,popover,popoverRadius:deprecated_popoverRadius,preventOverflow:deprecated_preventOverflow}=props,disableRestoreFocusOnClose=t0===void 0?!1:t0,deprecated_portal=t1===void 0?!0:t1,[open,setOpen]=useState(!1),[shouldFocus,setShouldFocus]=useState(null),[buttonElement,setButtonElement]=useState(null);let t2;$[0]===Symbol.for("react.memo_cache_sentinel")?(t2=[],$[0]=t2):t2=$[0];const[menuElements,setChildMenuElements]=useState(t2),openRef=useRef$1(open);let t3,t4;$[1]!==onOpen||$[2]!==open?(t3=()=>{onOpen&&open&&!openRef.current&&onOpen();},t4=[onOpen,open],$[1]=onOpen,$[2]=open,$[3]=t3,$[4]=t4):(t3=$[3],t4=$[4]),useEffect$1(t3,t4);let t5,t6;$[5]!==onClose||$[6]!==open?(t5=()=>{onClose&&!open&&openRef.current&&onClose();},t6=[onClose,open],$[5]=onClose,$[6]=open,$[7]=t5,$[8]=t6):(t5=$[7],t6=$[8]),useEffect$1(t5,t6);let t7,t8;$[9]!==open?(t7=()=>{openRef.current=open;},t8=[open],$[9]=open,$[10]=t7,$[11]=t8):(t7=$[10],t8=$[11]),useEffect$1(t7,t8);let t9;$[12]===Symbol.for("react.memo_cache_sentinel")?(t9=()=>{setOpen(_temp$2),setShouldFocus(null);},$[12]=t9):t9=$[12];const handleButtonClick=t9;let t10;$[13]!==open?(t10=event=>{open&&event.preventDefault();},$[13]=open,$[14]=t10):t10=$[14];const handleMouseDown=t10;let t11;$[15]===Symbol.for("react.memo_cache_sentinel")?(t11=event_0=>{if(event_0.key==="ArrowDown"||event_0.key==="Enter"||event_0.key===" "){event_0.preventDefault(),setOpen(!0),setShouldFocus("first");return;}if(event_0.key==="ArrowUp"){event_0.preventDefault(),setOpen(!0),setShouldFocus("last");return;}},$[15]=t11):t11=$[15];const handleButtonKeyDown=t11;let t12;$[16]!==buttonElement||$[17]!==menuElements?(t12=event_1=>{const target=event_1.target;if(target instanceof Node&&!(buttonElement&&(target===buttonElement||buttonElement.contains(target)))){for(const el of menuElements)if(target===el||el.contains(target))return;setOpen(!1);}},$[16]=buttonElement,$[17]=menuElements,$[18]=t12):t12=$[18];const handleMenuClickOutside=t12;let t13;$[19]!==buttonElement||$[20]!==disableRestoreFocusOnClose?(t13=()=>{setOpen(!1),!disableRestoreFocusOnClose&&buttonElement&&buttonElement.focus();},$[19]=buttonElement,$[20]=disableRestoreFocusOnClose,$[21]=t13):t13=$[21];const handleMenuEscape=t13;let t14;$[22]!==menuElements?(t14=event_2=>{const target_0=event_2.relatedTarget;if(target_0 instanceof Node){for(const el_0 of menuElements)if(el_0===target_0||el_0.contains(target_0))return;setOpen(!1);}},$[22]=menuElements,$[23]=t14):t14=$[23];const handleBlur=t14;let t15;$[24]!==buttonElement||$[25]!==disableRestoreFocusOnClose?(t15=()=>{setOpen(!1),!disableRestoreFocusOnClose&&buttonElement&&buttonElement.focus();},$[24]=buttonElement,$[25]=disableRestoreFocusOnClose,$[26]=t15):t15=$[26];const handleItemClick=t15;let t16;$[27]===Symbol.for("react.memo_cache_sentinel")?(t16=el_1=>(setChildMenuElements(els=>els.concat([el_1])),()=>setChildMenuElements(els_0=>els_0.filter(_el=>_el!==el_1))),$[27]=t16):t16=$[27];const registerElement=t16;let t17;$[28]!==buttonElement||$[29]!==handleBlur||$[30]!==handleItemClick||$[31]!==handleMenuClickOutside||$[32]!==handleMenuEscape||$[33]!==id||$[34]!==menuProp||$[35]!==shouldFocus?(t17=menuProp&&cloneElement(menuProp,{"aria-labelledby":id,onBlurCapture:handleBlur,onClickOutside:handleMenuClickOutside,onEscape:handleMenuEscape,onItemClick:handleItemClick,originElement:buttonElement,registerElement,shouldFocus}),$[28]=buttonElement,$[29]=handleBlur,$[30]=handleItemClick,$[31]=handleMenuClickOutside,$[32]=handleMenuEscape,$[33]=id,$[34]=menuProp,$[35]=shouldFocus,$[36]=t17):t17=$[36];const menu=t17;let t18;$[37]!==buttonProp||$[38]!==handleMouseDown||$[39]!==id||$[40]!==open?(t18=buttonProp&&cloneElement(buttonProp,{"data-ui":"MenuButton",id,onClick:handleButtonClick,onKeyDown:handleButtonKeyDown,onMouseDown:handleMouseDown,"aria-haspopup":!0,"aria-expanded":open,ref:setButtonElement,selected:(_buttonProp$props$sel=buttonProp.props.selected)!==null&&_buttonProp$props$sel!==void 0?_buttonProp$props$sel:open}),$[37]=buttonProp,$[38]=handleMouseDown,$[39]=id,$[40]=open,$[41]=t18):t18=$[41];const button=t18;let t19,t20;$[42]!==buttonElement?(t19=()=>buttonElement,t20=[buttonElement],$[42]=buttonElement,$[43]=t19,$[44]=t20):(t19=$[43],t20=$[44]),useImperativeHandle(forwardedRef,t19,t20);let t21;$[45]!==popover?(t21=popover||{},$[45]=popover,$[46]=t21):t21=$[46];let t22;$[47]!==deprecated_boundaryElement||$[48]!==deprecated_placement||$[49]!==deprecated_popoverRadius||$[50]!==deprecated_popoverScheme||$[51]!==deprecated_portal||$[52]!==deprecated_preventOverflow||$[53]!==t21?(t22=_objectSpread({boundaryElement:deprecated_boundaryElement,overflow:"auto",placement:deprecated_placement,portal:deprecated_portal,preventOverflow:deprecated_preventOverflow,radius:deprecated_popoverRadius,scheme:deprecated_popoverScheme},t21),$[47]=deprecated_boundaryElement,$[48]=deprecated_placement,$[49]=deprecated_popoverRadius,$[50]=deprecated_popoverScheme,$[51]=deprecated_portal,$[52]=deprecated_preventOverflow,$[53]=t21,$[54]=t22):t22=$[54];const popoverProps=t22;let t23;$[55]!==button?(t23=button||/* @__PURE__ */jsx(Fragment,{}),$[55]=button,$[56]=t23):t23=$[56];let t24;return $[57]!==menu||$[58]!==open||$[59]!==popoverProps||$[60]!==t23?(t24=/* @__PURE__ */jsx(Popover,_objectSpread(_objectSpread({"data-ui":"MenuButton__popover"},popoverProps),{},{content:menu,open,children:t23})),$[57]=menu,$[58]=open,$[59]=popoverProps,$[60]=t23,$[61]=t24):t24=$[61],t24;});MenuButton.displayName="ForwardRef(MenuButton)";function _temp$2(v){return!v;}const keyframe=keyframes$1(_templateObject78||(_templateObject78=_taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"]))),animation=css(_templateObject79||(_templateObject79=_taggedTemplateLiteral(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ",";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])),keyframe),skeletonStyle=css(_templateObject80||(_templateObject80=_taggedTemplateLiteral(["\n opacity: ",";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ","\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])),_ref78=>{let{$visible}=_ref78;return $visible?1:0;},_ref79=>{let{$animated}=_ref79;return $animated?animation:css(_templateObject81||(_templateObject81=_taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));}),StyledSkeleton$1=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledSkeleton",componentId:"sc-ebtpni-0"})(responsiveRadiusStyle,skeletonStyle),Skeleton=forwardRef(function(props,ref){var _props36;const $=dist.c(16);let delay,radius,restProps,t0;$[0]!==props?(_props36=props,{animated:t0,delay,radius}=_props36,restProps=_objectWithoutProperties(_props36,_excluded53),_props36,$[0]=props,$[1]=delay,$[2]=radius,$[3]=restProps,$[4]=t0):(delay=$[1],radius=$[2],restProps=$[3],t0=$[4]);const animated=t0===void 0?!1:t0,[visible,setVisible]=useState(!delay);let t1,t2;$[5]!==delay?(t1=()=>{if(!delay)return;const timeout=setTimeout(()=>{setVisible(!0);},delay);return()=>{clearTimeout(timeout);};},t2=[delay],$[5]=delay,$[6]=t1,$[7]=t2):(t1=$[6],t2=$[7]),useEffect$1(t1,t2);let t3;$[8]!==radius?(t3=_getArrayProp(radius),$[8]=radius,$[9]=t3):t3=$[9];const t4=delay?visible:!0;let t5;return $[10]!==animated||$[11]!==ref||$[12]!==restProps||$[13]!==t3||$[14]!==t4?(t5=/* @__PURE__ */jsx(StyledSkeleton$1,_objectSpread(_objectSpread({},restProps),{},{$animated:animated,$radius:t3,$visible:t4,ref})),$[10]=animated,$[11]=ref,$[12]=restProps,$[13]=t3,$[14]=t4,$[15]=t5):t5=$[15],t5;});Skeleton.displayName="ForwardRef(Skeleton)";const StyledSkeleton=/* @__PURE__ */styled(Skeleton).withConfig({displayName:"StyledSkeleton",componentId:"sc-2p7a1v-0"})(props=>{const{$size,$style}=props,{font,media}=getTheme_v2(props.theme),fontStyle=font[$style];return _responsive(media,$size,sizeIndex=>{const fontSize=fontStyle.sizes[sizeIndex];return{height:fontSize.lineHeight-fontSize.ascenderHeight-fontSize.descenderHeight};});}),TextSkeleton=forwardRef(function(props,ref){var _props37;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props37=props,{size:t0}=_props37,restProps=_objectWithoutProperties(_props37,_excluded54),_props37,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"text"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});TextSkeleton.displayName="ForwardRef(TextSkeleton)";const LabelSkeleton=forwardRef(function(props,ref){var _props38;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props38=props,{size:t0}=_props38,restProps=_objectWithoutProperties(_props38,_excluded55),_props38,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"label"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});LabelSkeleton.displayName="ForwardRef(LabelSkeleton)";const HeadingSkeleton=forwardRef(function(props,ref){var _props39;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props39=props,{size:t0}=_props39,restProps=_objectWithoutProperties(_props39,_excluded56),_props39,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"heading"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});HeadingSkeleton.displayName="ForwardRef(HeadingSkeleton)";const CodeSkeleton=forwardRef(function(props,ref){var _props40;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props40=props,{size:t0}=_props40,restProps=_objectWithoutProperties(_props40,_excluded57),_props40,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"code"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});CodeSkeleton.displayName="ForwardRef(CodeSkeleton)";const TabPanel=forwardRef(function(props,ref){var _props41;const $=dist.c(9);let flex,restProps;$[0]!==props?(_props41=props,{flex}=_props41,restProps=_objectWithoutProperties(_props41,_excluded58),_props41,$[0]=props,$[1]=flex,$[2]=restProps):(flex=$[1],restProps=$[2]);const t0=props.tabIndex===void 0?0:props.tabIndex;let t1;return $[3]!==flex||$[4]!==props.children||$[5]!==ref||$[6]!==restProps||$[7]!==t0?(t1=/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({"data-ui":"TabPanel"},restProps),{},{flex,ref,role:"tabpanel",tabIndex:t0,children:props.children})),$[3]=flex,$[4]=props.children,$[5]=ref,$[6]=restProps,$[7]=t0,$[8]=t1):t1=$[8],t1;});TabPanel.displayName="ForwardRef(TabPanel)";const LOADING_BAR_HEIGHT=2;styled(Flex).withConfig({displayName:"TextBox",componentId:"sc-1rr7rxo-0"})(_templateObject82||(_templateObject82=_taggedTemplateLiteral(["overflow-x:auto;"])));const StyledToast=styled(Card).withConfig({displayName:"StyledToast",componentId:"sc-1rr7rxo-1"})(_templateObject83||(_templateObject83=_taggedTemplateLiteral(["pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(","px / 2);}"])),LOADING_BAR_HEIGHT),LoadingBar=styled.div.withConfig({displayName:"LoadingBar",componentId:"sc-1rr7rxo-2"})(_templateObject84||(_templateObject84=_taggedTemplateLiteral(["display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;"])));styled(Card).withConfig({displayName:"LoadingBarMask",componentId:"sc-1rr7rxo-3"})(_templateObject85||(_templateObject85=_taggedTemplateLiteral(["position:absolute;top:0;left:-","px;right:-","px;bottom:","px;z-index:1;"])),LOADING_BAR_HEIGHT,LOADING_BAR_HEIGHT,LOADING_BAR_HEIGHT);const LoadingBarProgress=styled(Card).withConfig({displayName:"LoadingBarProgress",componentId:"sc-1rr7rxo-4"})(_templateObject86||(_templateObject86=_taggedTemplateLiteral(["display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:",";"])),props=>{const{color}=getTheme_v2(props.theme);return color.button.default[props.tone].enabled.bg;});motion.create(StyledToast);motion.create(Flex);motion.create(Text);motion.create(LoadingBar);motion.create(LoadingBarProgress);createGlobalScopedContext("@sanity/ui/context/toast",null);styled(Grid).withConfig({displayName:"StyledLayer",componentId:"sc-1tbwn58-0"})(_templateObject87||(_templateObject87=_taggedTemplateLiteral(["box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;"])));function _findPrevItemElement(state,itemElements,focusedElement){const idx=itemElements.indexOf(focusedElement),els=itemElements.slice(0,idx),len=els.length;for(let i=len-1;i>=0;i-=1){const itemKey=els[i].getAttribute("data-tree-key");if(!itemKey)continue;const segments=itemKey.split("/");segments.pop();const p=[];let expanded=!0;for(let j=0;j<segments.length;j+=1){var _state$k;p.push(segments[j]);const k=p.join("/");if(!((_state$k=state[k])!==null&&_state$k!==void 0&&_state$k.expanded)){expanded=!1;break;}}if(expanded)return els[i];}return null;}function _findNextItemElement(state,itemElements,focusedElement){const idx=itemElements.indexOf(focusedElement),els=itemElements.slice(idx),len=itemElements.length;for(let i=1;i<len;i+=1){if(!els[i])continue;const itemKey=els[i].getAttribute("data-tree-key");if(!itemKey)continue;const segments=itemKey.split("/");segments.pop();const p=[];let expanded=!0;for(let j=0;j<segments.length;j+=1){var _state$k2;p.push(segments[j]);const k=p.join("/");if(!((_state$k2=state[k])!==null&&_state$k2!==void 0&&_state$k2.expanded)){expanded=!1;break;}}if(expanded)return els[i];}return null;}function _focusItemElement(el){if(el.getAttribute("role")==="treeitem"&&el.focus(),el.getAttribute("role")==="none"){const firstChild=el.firstChild;firstChild&&firstChild instanceof HTMLElement&&firstChild.focus();}}const TreeContext=createGlobalScopedContext("@sanity/ui/context/tree",null),Tree=forwardRef(function(props,forwardedRef){var _props42;const $=dist.c(37);let children,onFocus,restProps,t0;$[0]!==props?(_props42=props,{children,space:t0,onFocus}=_props42,restProps=_objectWithoutProperties(_props42,_excluded59),_props42,$[0]=props,$[1]=children,$[2]=onFocus,$[3]=restProps,$[4]=t0):(children=$[1],onFocus=$[2],restProps=$[3],t0=$[4]);const space=t0===void 0?1:t0,ref=useRef$1(null),[focusedElement,setFocusedElement]=useState(null),focusedElementRef=useRef$1(focusedElement);let t1;$[5]===Symbol.for("react.memo_cache_sentinel")?(t1=[],$[5]=t1):t1=$[5];const path=t1;let t2;$[6]===Symbol.for("react.memo_cache_sentinel")?(t2=[],$[6]=t2):t2=$[6];const[itemElements,setItemElements]=useState(t2);let t3;$[7]===Symbol.for("react.memo_cache_sentinel")?(t3={},$[7]=t3):t3=$[7];const[state,setState]=useState(t3),stateRef=useRef$1(state);let t4;$[8]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[8]=t4):t4=$[8],useImperativeHandle(forwardedRef,t4);let t5,t6;$[9]!==focusedElement?(t5=()=>{focusedElementRef.current=focusedElement;},t6=[focusedElement],$[9]=focusedElement,$[10]=t5,$[11]=t6):(t5=$[10],t6=$[11]),useEffect$1(t5,t6);let t7,t8;$[12]!==state?(t7=()=>{stateRef.current=state;},t8=[state],$[12]=state,$[13]=t7,$[14]=t8):(t7=$[13],t8=$[14]),useEffect$1(t7,t8);let t9;$[15]===Symbol.for("react.memo_cache_sentinel")?(t9=(element,path_0,expanded,selected)=>(setState(s=>_objectSpread(_objectSpread({},s),{},{[path_0]:{element,expanded}})),selected&&setFocusedElement(element),()=>{setState(s_0=>{const newState=_objectSpread({},s_0);return delete newState[path_0],newState;});}),$[15]=t9):t9=$[15];const registerItem=t9;let t10;$[16]===Symbol.for("react.memo_cache_sentinel")?(t10=(path_1,expanded_0)=>{setState(s_1=>{const itemState=s_1[path_1];return itemState?_objectSpread(_objectSpread({},s_1),{},{[path_1]:_objectSpread(_objectSpread({},itemState),{},{expanded:expanded_0})}):s_1;});},$[16]=t10):t10=$[16];const setExpanded=t10,t11=focusedElement||itemElements[0]||null;let t12;$[17]!==space||$[18]!==state||$[19]!==t11?(t12={version:0,focusedElement:t11,level:0,path,registerItem,setExpanded,setFocusedElement,space,state},$[17]=space,$[18]=state,$[19]=t11,$[20]=t12):t12=$[20];const contextValue=t12;let t13;$[21]!==itemElements?(t13=event=>{if(focusedElementRef.current){if(event.key==="ArrowDown"){event.preventDefault();const nextEl=_findNextItemElement(stateRef.current,itemElements,focusedElementRef.current);nextEl&&(_focusItemElement(nextEl),setFocusedElement(nextEl));return;}if(event.key==="ArrowUp"){event.preventDefault();const prevEl=_findPrevItemElement(stateRef.current,itemElements,focusedElementRef.current);prevEl&&(_focusItemElement(prevEl),setFocusedElement(prevEl));return;}if(event.key==="ArrowLeft"){event.preventDefault();const itemKey=focusedElementRef.current.getAttribute("data-tree-key");if(!itemKey)return;const itemState_0=stateRef.current[itemKey];if(!itemState_0)return;if(itemState_0.expanded)setState(s_2=>{const itemState_1=s_2[itemKey];return itemState_1?_objectSpread(_objectSpread({},s_2),{},{[itemKey]:_objectSpread(_objectSpread({},itemState_1),{},{expanded:!1})}):s_2;});else{const itemPath=itemKey.split("/");itemPath.pop();const parentKey=itemPath.join("/"),parentState=parentKey&&stateRef.current[parentKey];parentState&&(parentState.element.focus(),setFocusedElement(parentState.element));}return;}if(event.key==="ArrowRight"){var _stateRef$current$foc;event.preventDefault();const focusedKey=focusedElementRef.current.getAttribute("data-tree-key");if(!focusedKey)return;((_stateRef$current$foc=stateRef.current[focusedKey])===null||_stateRef$current$foc===void 0?void 0:_stateRef$current$foc.expanded)||setState(s_3=>{const itemState_2=s_3[focusedKey];return itemState_2?_objectSpread(_objectSpread({},s_3),{},{[focusedKey]:_objectSpread(_objectSpread({},itemState_2),{},{expanded:!0})}):s_3;});return;}}},$[21]=itemElements,$[22]=t13):t13=$[22];const handleKeyDown=t13;let t14;$[23]!==onFocus?(t14=event_0=>{var _onFocus3;setFocusedElement(event_0.target),(_onFocus3=onFocus)===null||_onFocus3===void 0?void 0:_onFocus3(event_0);},$[23]=onFocus,$[24]=t14):t14=$[24];const handleFocus=t14;let t15;$[25]===Symbol.for("react.memo_cache_sentinel")?(t15=()=>{if(!ref.current)return;const _itemElements=Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));setItemElements(_itemElements);},$[25]=t15):t15=$[25];let t16;$[26]!==children?(t16=[children],$[26]=children,$[27]=t16):t16=$[27],useEffect$1(t15,t16);let t17;$[28]!==children||$[29]!==handleFocus||$[30]!==handleKeyDown||$[31]!==restProps||$[32]!==space?(t17=/* @__PURE__ */jsx(Stack,_objectSpread(_objectSpread({as:"ul","data-ui":"Tree"},restProps),{},{onFocus:handleFocus,onKeyDown:handleKeyDown,ref,role:"tree",space,children})),$[28]=children,$[29]=handleFocus,$[30]=handleKeyDown,$[31]=restProps,$[32]=space,$[33]=t17):t17=$[33];let t18;return $[34]!==contextValue||$[35]!==t17?(t18=/* @__PURE__ */jsx(TreeContext.Provider,{value:contextValue,children:t17}),$[34]=contextValue,$[35]=t17,$[36]=t18):t18=$[36],t18;});Tree.displayName="ForwardRef(Tree)";styled(Text).withConfig({displayName:"ToggleArrowText",componentId:"sc-iiskig-2"})(_templateObject88||(_templateObject88=_taggedTemplateLiteral(["& > svg{transition:transform 100ms;}"])));const listenOptions={includeResult:false,includePreviousRevision:false,visibility:"query",events:["welcome","mutation","reconnect"]};function useClient(){return useClient$1({apiVersion:"2023-02-01"});}const isSchemaMulti=type=>{return type.jsonType!=="object";};const isSchemaReference=type=>{return"to"in type||"of"in type&&type.of[0]&&"to"in type.of[0];};const filterUniqueTags=function(){let tags=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return tags.flat(Infinity).filter((firstTag,index)=>{const firstTagStringified=JSON.stringify({label:firstTag.label,value:firstTag.value});return index===tags.flat(Infinity).findIndex(secondTag=>{return JSON.stringify({label:secondTag.label,value:secondTag.value})===firstTagStringified;});});};const get=(object,path,defaultValue)=>{if(!object)return defaultValue;let props=false;let prop;if(Array.isArray(path))props=path.slice(0);if(typeof path==="string")props=path.split(".");if(!Array.isArray(props))throw new Error("path must be an array or a string");let obj=object;while(props.length){prop=props.shift();if(!prop)return defaultValue;if(!obj)return defaultValue;if(obj===null||typeof obj!=="object"||Array.isArray(obj))return defaultValue;if(!(prop in obj))return defaultValue;obj=obj[prop];}return obj;};function prototypeCheck(prop){if(prop==="__proto__"||prop==="constructor"||prop==="prototype")return false;return true;}const setAtPath=(object,path,value)=>{let props=false;if(Array.isArray(path))props=path.slice(0);if(typeof path==="string")props=path.split(".");if(!Array.isArray(props))throw new Error("path must be an array or a string");const lastProp=props.pop();if(!lastProp)return false;if(!prototypeCheck(lastProp))throw new Error("setting of prototype values not supported");let thisProp;let obj=object;while(thisProp=props.shift()){if(!prototypeCheck(thisProp))throw new Error("setting of prototype values not supported");if(!thisProp)return false;if(!(thisProp in obj))obj[thisProp]={};obj=obj[thisProp];if(!obj||typeof obj!=="object")return false;}obj[lastProp]=value;return true;};function isPlainObject(value){return typeof value==="object"&&value!==null&&value.constructor===Object&&Object.prototype.toString.call(value)==="[object Object]";}var __defProp$2=Object.defineProperty;var __getOwnPropSymbols$2=Object.getOwnPropertySymbols;var __hasOwnProp$2=Object.prototype.hasOwnProperty;var __propIsEnum$2=Object.prototype.propertyIsEnumerable;var __defNormalProp$2=(obj,key,value)=>key in obj?__defProp$2(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues$2=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp$2.call(b,prop))__defNormalProp$2(a,prop,b[prop]);if(__getOwnPropSymbols$2)for(var prop of __getOwnPropSymbols$2(b)){if(__propIsEnum$2.call(b,prop))__defNormalProp$2(a,prop,b[prop]);}return a;};const useLoading=_ref80=>{let{initialLoadingOptions={},initialState=true}=_ref80;const[loadingOptions,setLoadingOptions]=React__default.useState(initialLoadingOptions);const[isLoading,setIsLoading]=React__default.useState(initialState);React__default.useEffect(()=>{let loaded=false;if(Object.keys(loadingOptions).length){for(const option in loadingOptions){if(loadingOptions[option])loaded=true;}}setIsLoading(loaded);},[loadingOptions]);const setLoadOption=React__default.useCallback(properties=>{setLoadingOptions(oldValue=>{return __spreadValues$2(__spreadValues$2({},oldValue),properties);});},[]);return[isLoading,loadingOptions,setLoadOption];};const useOptions=_ref81=>{let{initialState=[]}=_ref81;const[options,setOptions]=React__default.useState(initialState);const[groupOptions,setGroupOptions]=React__default.useState({});React__default.useEffect(()=>{const opts=[];for(const group in groupOptions){if(Array.isArray(groupOptions[group]))opts.push(...groupOptions[group]);}setOptions(filterUniqueTags(opts));},[groupOptions]);const setTagOption=React__default.useCallback(properties=>{setGroupOptions(oldValue=>__spreadValues$2(__spreadValues$2({},oldValue),properties));},[]);return[options,groupOptions,setTagOption];};var __defProp$1=Object.defineProperty;var __defProps$1=Object.defineProperties;var __getOwnPropDescs$1=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols$1=Object.getOwnPropertySymbols;var __hasOwnProp$1=Object.prototype.hasOwnProperty;var __propIsEnum$1=Object.prototype.propertyIsEnumerable;var __defNormalProp$1=(obj,key,value)=>key in obj?__defProp$1(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues$1=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp$1.call(b,prop))__defNormalProp$1(a,prop,b[prop]);if(__getOwnPropSymbols$1)for(var prop of __getOwnPropSymbols$1(b)){if(__propIsEnum$1.call(b,prop))__defNormalProp$1(a,prop,b[prop]);}return a;};var __spreadProps$1=(a,b)=>__defProps$1(a,__getOwnPropDescs$1(b));const prepareTag=_ref82=>{let{customLabel="label",customValue="value"}=_ref82;return tag=>{const tempTag=__spreadProps$1(__spreadValues$1({},tag),{_type:"tag",_key:tag.value,_labelTemp:tag.label,_valueTemp:tag.value,label:get(tag,customLabel),value:get(tag,customValue)});return tempTag;};};function revertTag(_ref83){let{customLabel="label",customValue="value",isReference}=_ref83;return tag=>{if(isReference===true){const tempTag2={_ref:tag._id,_type:"reference"};return tempTag2;}const tempTag=__spreadProps$1(__spreadValues$1({},tag),{label:tag._labelTemp,value:tag._valueTemp});setAtPath(tempTag,customLabel,tag.label);setAtPath(tempTag,customValue,tag.value);delete tempTag._labelTemp;delete tempTag._valueTemp;if(tempTag.label===void 0)delete tempTag.label;if(tempTag.value===void 0)delete tempTag.value;return tempTag;};}const prepareTags=async _ref84=>{let{client,tags,customLabel="label",customValue="value"}=_ref84;const prepare=prepareTag({customLabel,customValue});if(tags===void 0||tags===null)return void 0;if(Array.isArray(tags)&&!tags.length)return[];if(Array.isArray(tags)&&tags.length&&!isPlainObject(tags[0])){const normalized=tags.map(tag=>{const value=String(tag);const tempTag={label:value,value};setAtPath(tempTag,customLabel,value);setAtPath(tempTag,customValue,value);return tempTag;});return normalized.map(prepare);}if(Array.isArray(tags)&&isPlainObject(tags[0])&&"_ref"in tags[0]&&"_type"in tags[0]){return(await client.fetch("*[_id in $refs]",{refs:tags.map(tag=>tag._ref)})).map(prepare);}if(Array.isArray(tags))return tags.map(prepare);if(!isPlainObject(tags)){const value=String(tags);const tempTag={label:value,value};setAtPath(tempTag,customLabel,value);setAtPath(tempTag,customValue,value);return prepare(tempTag);}if(isPlainObject(tags)&&"_ref"in tags&&"_type"in tags)return prepare(await client.fetch("*[_id == $ref][0]",{ref:tags._ref}));return prepare(tags);};const prepareTagsAsList=async preparedTagsOptions=>{const preparedTags=await prepareTags(preparedTagsOptions);if(preparedTags===void 0)return[];if(!Array.isArray(preparedTags))return[preparedTags];return preparedTags;};function revertTags(_ref85){let{tags,customLabel="label",customValue="value",isMulti,isReference}=_ref85;const revert=revertTag({customLabel,customValue,isReference});if(tags===void 0)return void 0;if(isMulti){const tagsArray=Array.isArray(tags)?tags:[tags];return tagsArray.map(revert);}const tag=Array.isArray(tags)?tags[0]:tags;return revert(tag);}const refineTagsPipe=_ref86=>{let{client,customLabel="label",customValue="value"}=_ref86;return pipe$1(map(val=>Array.isArray(val)?val.flat(Infinity):val),switchMap(val=>prepareTagsAsList({client,tags:val,customLabel,customValue})),map(val=>filterUniqueTags(val)));};const getGeneralObservable=_ref87=>{let{client,query,params,customLabel="label",customValue="value"}=_ref87;return client.listen(query,params,listenOptions).pipe(switchMap(()=>client.fetch(query,params)),refineTagsPipe({client,customLabel,customValue}));};function getSelectedTags(_ref88){let{client,tags,isMulti,customLabel="label",customValue="value"}=_ref88;const tagFunction=async()=>tags;return defer(()=>from(tagFunction())).pipe(refineTagsPipe({client,customLabel,customValue}),map(val=>isMulti?val:val[0]));}const predefinedTagWrapper=async predefinedTags=>{const tags=await predefinedTags();if(!Array.isArray(tags))return[tags];return tags;};const getPredefinedTags=_ref89=>{let{client,predefinedTags,customLabel="label",customValue="value"}=_ref89;const tagFunction=predefinedTags instanceof Function?predefinedTags:async()=>predefinedTags;return defer(()=>from(predefinedTagWrapper(tagFunction)).pipe(refineTagsPipe({client,customLabel,customValue})));};const getTagsFromReference=_ref90=>{let{client,document,customLabel="label",customValue="value"}=_ref90;const query='\n *[ _type == $document && defined(@[$customLabel]) && defined(@[$customValue])] {\n _id,\n "value": coalesce(@[$customValue].current,@[$customValue]),\n "label": @[$customLabel]\n }\n ';const params={document,customLabel:customLabel.split(".")[0],customValue:customValue.split(".")[0]};return getGeneralObservable({client,query,params,customLabel,customValue});};const getTagsFromRelated=_ref91=>{let{client,documentType,field,isMulti,customLabel="label",customValue="value"}=_ref91;const query="\n *[\n _type == $documentType &&\n defined(@[$field]) &&\n defined(@[$field][]) == $isMulti &&\n (\n (!$isMulti && defined(@[$field]->[$customLabel]) && defined(@[$field]->[$customValue])) ||\n (!$isMulti && defined(@[$field][$customLabel]) && defined(@[$field][$customValue])) ||\n ($isMulti && defined(@[$field][]->[$customLabel]) && defined(@[$field][]->[$customValue])) ||\n ($isMulti && defined(@[$field][][$customLabel]) && defined(@[$field][][$customValue]))\n )\n ][$field]\n ";const params={documentType,field,isMulti,customLabel:customLabel.split(".")[0],customValue:customValue.split(".")[0]};return getGeneralObservable({client,query,params,customLabel,customValue});};const ReferenceCreateWarning=()=>/* @__PURE__ */jsxs(Card,{padding:[3,3,4],marginBottom:[3,3,4],radius:2,shadow:1,tone:"caution",children:["Tag References cannot be created inline. Please set the ",/* @__PURE__ */jsx("code",{children:"allowCreate"})," option explicitly to ",/* @__PURE__ */jsx("code",{children:"false"})," to remove this warning message."]});const ReferencePredefinedWarning=()=>/* @__PURE__ */jsxs(Card,{padding:[3,3,4],marginBottom:[3,3,4],radius:2,shadow:1,tone:"caution",children:["Tag References cannot have predefined tags. Please unset the ",/* @__PURE__ */jsx("code",{children:"predefinedTags"})," option to remove this warning message."]});function styleInject(css,ref){if(ref===void 0)ref={};var insertAt=ref.insertAt;if(!css||typeof document==='undefined'){return;}var head=document.head||document.getElementsByTagName('head')[0];var style=document.createElement('style');style.type='text/css';if(insertAt==='top'){if(head.firstChild){head.insertBefore(style,head.firstChild);}else{head.appendChild(style);}}else{head.appendChild(style);}if(style.styleSheet){style.styleSheet.cssText=css;}else{style.appendChild(document.createTextNode(css));}}var css_248z=".TagsInput-module_control__Om-kz {\n background-color: var(--card-bg-color) !important;\n border-color: var(--card-border-color) !important;\n transition: none !important;\n}\n\n.TagsInput-module_input__fdTrV {\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_control__Om-kz:hover {\n border-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_menu__l2H-i {\n background-color: var(--card-bg-color) !important;\n border: 1px solid var(--card-border-color) !important;\n}\n\n.TagsInput-module_option__cqS2H {\n background-color: var(--card-bg-color) !important;\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_option__cqS2H:hover {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_indicatorSeparator__koEIb {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_placeholder__ZjU5A,\n.TagsInput-module_singleValue__bIhOY {\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_multiValue__zq4m6 {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_multiValueLabel__R9vFQ {\n color: var(--card-fg-color) !important;\n}\n\n.TagsInput-module_multiValueRemove__2zX5H {\n color: var(--card-fg-color) !important;\n}\n\n.TagsInput-module_multiValueRemove__2zX5H:hover {\n color: #de350b !important;\n}\n";var styles={"control":"TagsInput-module_control__Om-kz","input":"TagsInput-module_input__fdTrV","menu":"TagsInput-module_menu__l2H-i","option":"TagsInput-module_option__cqS2H","indicatorSeparator":"TagsInput-module_indicatorSeparator__koEIb","placeholder":"TagsInput-module_placeholder__ZjU5A","singleValue":"TagsInput-module_singleValue__bIhOY","multiValue":"TagsInput-module_multiValue__zq4m6","multiValueLabel":"TagsInput-module_multiValueLabel__R9vFQ","multiValueRemove":"TagsInput-module_multiValueRemove__2zX5H"};styleInject(css_248z);var __defProp=Object.defineProperty;var __defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty;var __propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp.call(b,prop))__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b)){if(__propIsEnum.call(b,prop))__defNormalProp(a,prop,b[prop]);}return a;};var __spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));const TagsInput=forwardRef((props,ref)=>{const client=useClient();const documentType=useFormValue(["_type"]);const[selected,setSelected]=React__default.useState(void 0);const[isLoading,,setLoadOption]=useLoading({});const[options,,setTagOption]=useOptions({});const prefersDark=usePrefersDark();const{schemaType,// Schema information
|
|
2335
|
+
"--card-bg2-color":color.muted.bg,"--card-link-color":color.link.fg,"--card-hairline-soft-color":color.border,"--card-hairline-hard-color":color.border};}function buttonBaseStyles(props){const{$width}=props,{style}=getTheme_v2(props.theme);return css(_templateObject13||(_templateObject13=_taggedTemplateLiteral(["\n ",";\n\n -webkit-font-smoothing: inherit;\n appearance: none;\n display: inline-flex;\n align-items: center;\n font: inherit;\n border: 0;\n outline: none;\n user-select: none;\n text-decoration: none;\n border: 0;\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n white-space: nowrap;\n text-align: left;\n position: relative;\n vertical-align: top;\n\n ","\n\n & > span {\n display: block;\n flex: 1;\n min-width: 0;\n border-radius: inherit;\n }\n\n &::-moz-focus-inner {\n border: 0;\n padding: 0;\n }\n "])),style===null||style===void 0?void 0:style.button,$width==="fill"&&css(_templateObject14||(_templateObject14=_taggedTemplateLiteral(["\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n "]))));}function combineBoxShadow(){for(var _len7=arguments.length,boxShadows=new Array(_len7),_key7=0;_key7<_len7;_key7++){boxShadows[_key7]=arguments[_key7];}return boxShadows.filter(Boolean).join(",");}function buttonColorStyles(props){var _style$button;const{$mode}=props,{button,color:baseColor,style}=getTheme_v2(props.theme),shadow=props.$mode==="ghost",mode=baseColor.button[$mode]||baseColor.button.default,color=mode[props.$tone]||mode.default,border2={width:button.border.width,color:"var(--card-border-color)"},defaultBoxShadow=void 0;return[_cardColorStyle(baseColor,color.enabled),{backgroundColor:"var(--card-bg-color)",color:"var(--card-fg-color)",boxShadow:focusRingBorderStyle(border2),'&:disabled, &[data-disabled="true"]':_cardColorStyle(baseColor,color.disabled),"&:not([data-disabled='true'])":{boxShadow:combineBoxShadow(focusRingBorderStyle(border2),shadow?defaultBoxShadow:void 0),"&:focus":{boxShadow:focusRingStyle({base:baseColor,border:{width:2,color:baseColor.bg},focusRing:button.focusRing})},"&:focus:not(:focus-visible)":{boxShadow:combineBoxShadow(focusRingBorderStyle(border2),shadow?defaultBoxShadow:void 0)},"@media (hover: hover)":{"&:hover":_cardColorStyle(baseColor,color.hovered),"&:active":_cardColorStyle(baseColor,color.pressed),"&[data-hovered]":_cardColorStyle(baseColor,color.hovered)},"&[data-selected]":_cardColorStyle(baseColor,color.pressed)}},style===null||style===void 0||(_style$button=style.button)===null||_style$button===void 0?void 0:_style$button.root].filter(Boolean);}const StyledButton=/* @__PURE__ */styled.button.withConfig({displayName:"StyledButton",componentId:"sc-aaekt4-0"})(responsiveRadiusStyle,buttonBaseStyles,buttonColorStyles),LoadingBox=styled.div.withConfig({displayName:"LoadingBox",componentId:"sc-aaekt4-1"})(_templateObject15||(_templateObject15=_taggedTemplateLiteral(["position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;"]))),Button=forwardRef(function(props,ref){var _props8;const $=dist.c(86);let IconComponent,IconRightComponent,children,disabled,loading,paddingBottomProp,paddingLeftProp,paddingRightProp,paddingTopProp,paddingXProp,paddingYProp,restProps,selected,t0,t1,t2,t3,t4,t5,t6,t7,t8,text,textAlign,textWeight,width;$[0]!==props?(_props8=props,{children,disabled,fontSize:t0,icon:IconComponent,iconRight:IconRightComponent,justify:t1,loading,mode:t2,padding:t3,paddingX:paddingXProp,paddingY:paddingYProp,paddingTop:paddingTopProp,paddingBottom:paddingBottomProp,paddingLeft:paddingLeftProp,paddingRight:paddingRightProp,radius:t4,selected,space:t5,text,textAlign,textWeight,tone:t6,type:t7,muted:t8,width}=_props8,restProps=_objectWithoutProperties(_props8,_excluded22),_props8,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=children,$[4]=disabled,$[5]=loading,$[6]=paddingBottomProp,$[7]=paddingLeftProp,$[8]=paddingRightProp,$[9]=paddingTopProp,$[10]=paddingXProp,$[11]=paddingYProp,$[12]=restProps,$[13]=selected,$[14]=t0,$[15]=t1,$[16]=t2,$[17]=t3,$[18]=t4,$[19]=t5,$[20]=t6,$[21]=t7,$[22]=t8,$[23]=text,$[24]=textAlign,$[25]=textWeight,$[26]=width):(IconComponent=$[1],IconRightComponent=$[2],children=$[3],disabled=$[4],loading=$[5],paddingBottomProp=$[6],paddingLeftProp=$[7],paddingRightProp=$[8],paddingTopProp=$[9],paddingXProp=$[10],paddingYProp=$[11],restProps=$[12],selected=$[13],t0=$[14],t1=$[15],t2=$[16],t3=$[17],t4=$[18],t5=$[19],t6=$[20],t7=$[21],t8=$[22],text=$[23],textAlign=$[24],textWeight=$[25],width=$[26]);const fontSize2=t0===void 0?1:t0,justifyProp=t1===void 0?"center":t1,mode=t2===void 0?"default":t2,paddingProp=t3===void 0?3:t3,radiusProp=t4===void 0?2:t4,spaceProp=t5===void 0?3:t5,tone=t6===void 0?"default":t6,type=t7===void 0?"button":t7,muted=t8===void 0?!1:t8,{button}=useTheme_v2();let t9;$[27]!==justifyProp?(t9=_getArrayProp(justifyProp),$[27]=justifyProp,$[28]=t9):t9=$[28];const justify=t9;let t10;$[29]!==paddingProp?(t10=_getArrayProp(paddingProp),$[29]=paddingProp,$[30]=t10):t10=$[30];const padding=t10;let t11;$[31]!==paddingXProp?(t11=_getArrayProp(paddingXProp),$[31]=paddingXProp,$[32]=t11):t11=$[32];const paddingX=t11;let t12;$[33]!==paddingYProp?(t12=_getArrayProp(paddingYProp),$[33]=paddingYProp,$[34]=t12):t12=$[34];const paddingY=t12;let t13;$[35]!==paddingTopProp?(t13=_getArrayProp(paddingTopProp),$[35]=paddingTopProp,$[36]=t13):t13=$[36];const paddingTop=t13;let t14;$[37]!==paddingBottomProp?(t14=_getArrayProp(paddingBottomProp),$[37]=paddingBottomProp,$[38]=t14):t14=$[38];const paddingBottom=t14;let t15;$[39]!==paddingLeftProp?(t15=_getArrayProp(paddingLeftProp),$[39]=paddingLeftProp,$[40]=t15):t15=$[40];const paddingLeft=t15;let t16;$[41]!==paddingRightProp?(t16=_getArrayProp(paddingRightProp),$[41]=paddingRightProp,$[42]=t16):t16=$[42];const paddingRight=t16;let t17;$[43]!==radiusProp?(t17=_getArrayProp(radiusProp),$[43]=radiusProp,$[44]=t17):t17=$[44];const radius=t17;let t18;$[45]!==spaceProp?(t18=_getArrayProp(spaceProp),$[45]=spaceProp,$[46]=t18):t18=$[46];const space=t18;let t19;$[47]!==padding||$[48]!==paddingBottom||$[49]!==paddingLeft||$[50]!==paddingRight||$[51]!==paddingTop||$[52]!==paddingX||$[53]!==paddingY?(t19={padding,paddingX,paddingY,paddingTop,paddingBottom,paddingLeft,paddingRight},$[47]=padding,$[48]=paddingBottom,$[49]=paddingLeft,$[50]=paddingRight,$[51]=paddingTop,$[52]=paddingX,$[53]=paddingY,$[54]=t19):t19=$[54];const boxProps=t19,t20=!!(loading||disabled),t21=selected?"":void 0,t22=!!(loading||disabled);let t23;$[55]!==loading?(t23=!!loading&&/* @__PURE__ */jsx(LoadingBox,{children:/* @__PURE__ */jsx(Spinner,{})}),$[55]=loading,$[56]=t23):t23=$[56];let t24;$[57]!==IconComponent||$[58]!==IconRightComponent||$[59]!==boxProps||$[60]!==button||$[61]!==fontSize2||$[62]!==justify||$[63]!==muted||$[64]!==space||$[65]!==text||$[66]!==textAlign||$[67]!==textWeight?(t24=(IconComponent||text||IconRightComponent)&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},boxProps),{},{children:/* @__PURE__ */jsxs(Flex,{as:"span",justify,gap:space,children:[IconComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]}),text&&/* @__PURE__ */jsx(Box,{children:/* @__PURE__ */jsx(Text,{muted,align:textAlign,size:fontSize2,textOverflow:"ellipsis",weight:textWeight!==null&&textWeight!==void 0?textWeight:button.textWeight,children:text})}),IconRightComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})]})})),$[57]=IconComponent,$[58]=IconRightComponent,$[59]=boxProps,$[60]=button,$[61]=fontSize2,$[62]=justify,$[63]=muted,$[64]=space,$[65]=text,$[66]=textAlign,$[67]=textWeight,$[68]=t24):t24=$[68];let t25;$[69]!==boxProps||$[70]!==children?(t25=children&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},boxProps),{},{children})),$[69]=boxProps,$[70]=children,$[71]=t25):t25=$[71];let t26;return $[72]!==mode||$[73]!==radius||$[74]!==ref||$[75]!==restProps||$[76]!==t20||$[77]!==t21||$[78]!==t22||$[79]!==t23||$[80]!==t24||$[81]!==t25||$[82]!==tone||$[83]!==type||$[84]!==width?(t26=/* @__PURE__ */jsxs(StyledButton,_objectSpread(_objectSpread({"data-ui":"Button"},restProps),{},{$mode:mode,$radius:radius,$tone:tone,"data-disabled":t20,"data-selected":t21,disabled:t22,ref,type,$width:width,children:[t23,t24,t25]})),$[72]=mode,$[73]=radius,$[74]=ref,$[75]=restProps,$[76]=t20,$[77]=t21,$[78]=t22,$[79]=t23,$[80]=t24,$[81]=t25,$[82]=tone,$[83]=type,$[84]=width,$[85]=t26):t26=$[85],t26;});Button.displayName="ForwardRef(Button)";function cardStyle(props){return[cardBaseStyle(props),cardColorStyle(props)];}function cardBaseStyle(props){const{$checkered}=props,{space}=getTheme_v2(props.theme);return css(_templateObject16||(_templateObject16=_taggedTemplateLiteral(["\n ","\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n outline: none;\n text-decoration: none;\n }\n\n /* &:is(pre) */\n &[data-as='pre'] {\n font: inherit;\n }\n "])),$checkered&&css(_templateObject17||(_templateObject17=_taggedTemplateLiteral(["\n background-size: ","px ","px;\n background-position: 50% 50%;\n background-image: var(--card-bg-image);\n "])),space[3],space[3]));}function cardColorStyle(props){var _style$card;const{$checkered,$focusRing,$muted}=props,{card,color,style}=getTheme_v2(props.theme),border2={width:card.border.width,color:"var(--card-border-color)"};return css(_templateObject18||(_templateObject18=_taggedTemplateLiteral(["\n color-scheme: ",";\n\n ","\n\n background-color: ",";\n color: var(--card-fg-color);\n\n /* &:is(button) */\n &[data-as='button'] {\n --card-focus-ring-box-shadow: none;\n\n cursor: default;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &:disabled {\n ","\n }\n\n &:not(:disabled) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ",";\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n cursor: pointer;\n box-shadow: var(--card-focus-ring-box-shadow);\n\n &[data-disabled] {\n ","\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-pressed]):not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n\n &:focus-visible {\n --card-focus-ring-box-shadow: ",";\n }\n }\n }\n\n ","\n "])),color._dark?"dark":"light",_cardColorStyle(color,color,$checkered),$muted?"var(--card-muted-bg-color)":"var(--card-bg-color)",_cardColorStyle(color,color.selectable.default.disabled,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),_cardColorStyle(color,color.selectable.default.selected,$checkered),_cardColorStyle(color,color.selectable.default.hovered,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),$focusRing?focusRingStyle({base:color,border:border2,focusRing:card.focusRing}):void 0,_cardColorStyle(color,color.selectable.default.disabled,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),_cardColorStyle(color,color.selectable.default.selected,$checkered),_cardColorStyle(color,color.selectable.default.hovered,$checkered),_cardColorStyle(color,color.selectable.default.pressed,$checkered),$focusRing?focusRingStyle({base:color,border:border2,focusRing:card.focusRing}):void 0,style===null||style===void 0||(_style$card=style.card)===null||_style$card===void 0?void 0:_style$card.root);}const StyledCard=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledCard",componentId:"sc-osnro2-0"})(responsiveBorderStyle,responsiveRadiusStyle,responsiveShadowStyle,cardStyle),Card=forwardRef(function(props,ref){var _props9;const $=dist.c(56);let asProp,border2,borderBottom2,borderLeft2,borderRight2,borderTop2,muted,pressed,restProps,scheme,selected,shadow,t0,t1,t2,t3;$[0]!==props?(_props9=props,{__unstable_checkered:t0,__unstable_focusRing:t1,as:asProp,border:border2,borderTop:borderTop2,borderRight:borderRight2,borderBottom:borderBottom2,borderLeft:borderLeft2,muted,pressed,radius:t2,scheme,selected,shadow,tone:t3}=_props9,restProps=_objectWithoutProperties(_props9,_excluded23),_props9,$[0]=props,$[1]=asProp,$[2]=border2,$[3]=borderBottom2,$[4]=borderLeft2,$[5]=borderRight2,$[6]=borderTop2,$[7]=muted,$[8]=pressed,$[9]=restProps,$[10]=scheme,$[11]=selected,$[12]=shadow,$[13]=t0,$[14]=t1,$[15]=t2,$[16]=t3):(asProp=$[1],border2=$[2],borderBottom2=$[3],borderLeft2=$[4],borderRight2=$[5],borderTop2=$[6],muted=$[7],pressed=$[8],restProps=$[9],scheme=$[10],selected=$[11],shadow=$[12],t0=$[13],t1=$[14],t2=$[15],t3=$[16]);const checkered=t0===void 0?!1:t0,focusRing=t1===void 0?!1:t1,radius=t2===void 0?0:t2,toneProp=t3===void 0?"default":t3,as=reactIsExports.isValidElementType(asProp)?asProp:"div",rootTheme=useRootTheme(),tone=toneProp==="inherit"?rootTheme.tone:toneProp,t4=typeof as=="string"?as:void 0,t5=rootTheme.scheme;let t6;$[17]!==border2?(t6=_getArrayProp(border2),$[17]=border2,$[18]=t6):t6=$[18];let t7;$[19]!==borderTop2?(t7=_getArrayProp(borderTop2),$[19]=borderTop2,$[20]=t7):t7=$[20];let t8;$[21]!==borderRight2?(t8=_getArrayProp(borderRight2),$[21]=borderRight2,$[22]=t8):t8=$[22];let t9;$[23]!==borderBottom2?(t9=_getArrayProp(borderBottom2),$[23]=borderBottom2,$[24]=t9):t9=$[24];let t10;$[25]!==borderLeft2?(t10=_getArrayProp(borderLeft2),$[25]=borderLeft2,$[26]=t10):t10=$[26];let t11;$[27]!==radius?(t11=_getArrayProp(radius),$[27]=radius,$[28]=t11):t11=$[28];let t12;$[29]!==shadow?(t12=_getArrayProp(shadow),$[29]=shadow,$[30]=t12):t12=$[30];const t13=checkered?"":void 0,t14=pressed?"":void 0,t15=selected?"":void 0;let t16;$[31]!==as||$[32]!==checkered||$[33]!==focusRing||$[34]!==muted||$[35]!==ref||$[36]!==restProps||$[37]!==rootTheme.scheme||$[38]!==selected||$[39]!==t10||$[40]!==t11||$[41]!==t12||$[42]!==t13||$[43]!==t14||$[44]!==t15||$[45]!==t4||$[46]!==t6||$[47]!==t7||$[48]!==t8||$[49]!==t9||$[50]!==tone?(t16=/* @__PURE__ */jsx(StyledCard,_objectSpread(_objectSpread({"data-as":t4,"data-scheme":t5,"data-ui":"Card","data-tone":tone},restProps),{},{$border:t6,$borderTop:t7,$borderRight:t8,$borderBottom:t9,$borderLeft:t10,$checkered:checkered,$focusRing:focusRing,$muted:muted,$radius:t11,$shadow:t12,$tone:tone,"data-checkered":t13,"data-pressed":t14,"data-selected":t15,forwardedAs:as,ref,selected})),$[31]=as,$[32]=checkered,$[33]=focusRing,$[34]=muted,$[35]=ref,$[36]=restProps,$[37]=rootTheme.scheme,$[38]=selected,$[39]=t10,$[40]=t11,$[41]=t12,$[42]=t13,$[43]=t14,$[44]=t15,$[45]=t4,$[46]=t6,$[47]=t7,$[48]=t8,$[49]=t9,$[50]=tone,$[51]=t16):t16=$[51];let t17;return $[52]!==scheme||$[53]!==t16||$[54]!==tone?(t17=/* @__PURE__ */jsx(ThemeColorProvider,{scheme,tone,children:t16}),$[52]=scheme,$[53]=t16,$[54]=tone,$[55]=t17):t17=$[55],t17;});Card.displayName="ForwardRef(Card)";function useClickOutsideEvent(listener,t0,boundaryElement){const $=dist.c(9),elementsArg=t0===void 0?_temp$8:t0;let t1;$[0]!==boundaryElement||$[1]!==elementsArg||$[2]!==listener?(t1=evt=>{if(!listener)return;const target=evt.target;if(!(target instanceof Node))return;const resolvedBoundaryElement=boundaryElement===null||boundaryElement===void 0?void 0:boundaryElement();if(resolvedBoundaryElement&&!resolvedBoundaryElement.contains(target))return;const elements=elementsArg().flat();for(const el of elements)if(el&&(target===el||el.contains(target)))return;listener(evt);},$[0]=boundaryElement,$[1]=elementsArg,$[2]=listener,$[3]=t1):t1=$[3];const onEvent=useEffectEvent(t1),hasListener=!!listener;let t2;$[4]!==hasListener||$[5]!==onEvent?(t2=()=>{if(!hasListener)return;const handleEvent=evt_0=>onEvent(evt_0);return document.addEventListener("mousedown",handleEvent),()=>{document.removeEventListener("mousedown",handleEvent);};},$[4]=hasListener,$[5]=onEvent,$[6]=t2):t2=$[6];let t3;$[7]!==hasListener?(t3=[hasListener],$[7]=hasListener,$[8]=t3):t3=$[8],useEffect$1(t2,t3),useDebugValue(listener?"MouseDown On":"MouseDown Off");}function _temp$8(){return EMPTY_ARRAY;}function useCustomValidity(ref,customValidity){const $=dist.c(4);let t0,t1;$[0]!==customValidity||$[1]!==ref?(t0=()=>{var _ref$current;(_ref$current=ref.current)===null||_ref$current===void 0||_ref$current.setCustomValidity(customValidity||"");},t1=[customValidity,ref],$[0]=customValidity,$[1]=ref,$[2]=t0,$[3]=t1):(t0=$[2],t1=$[3]),useEffect$1(t0,t1);}const _ResizeObserver=typeof document<"u"&&typeof window<"u"&&window.ResizeObserver?window.ResizeObserver:ResizeObserver$1,_elementSizeObserver=_createElementSizeObserver();function _createElementRectValueListener(){return{subscribe(element,subscriber){const resizeObserver=new _ResizeObserver(_ref70=>{let[entry]=_ref70;subscriber({_contentRect:entry.contentRect,border:{width:entry.borderBoxSize[0].inlineSize,height:entry.borderBoxSize[0].blockSize},content:{width:entry.contentRect.width,height:entry.contentRect.height}});});return resizeObserver.observe(element),()=>{resizeObserver.unobserve(element),resizeObserver.disconnect();};}};}function _createElementSizeObserver(){const disposeCache=/* @__PURE__ */new WeakMap(),subscribersCache=/* @__PURE__ */new WeakMap();return{subscribe(element,subscriber){const subscribers=subscribersCache.get(element)||[];let dispose=disposeCache.get(element);return subscribersCache.has(element)||(subscribersCache.set(element,subscribers),dispose=_createElementRectValueListener().subscribe(element,elementRect=>{for(const sub of subscribers)sub(elementRect);})),subscribers.push(subscriber),()=>{const idx=subscribers.indexOf(subscriber);idx>-1&&subscribers.splice(idx,1),subscribers.length===0&&dispose&&dispose();};}};}function useElementSize(element){const $=dist.c(3),[size2,setSize]=useState(null);let t0,t1;return $[0]!==element?(t0=()=>{if(element)return _elementSizeObserver.subscribe(element,setSize);},t1=[element],$[0]=element,$[1]=t0,$[2]=t1):(t0=$[1],t1=$[2]),useEffect$1(t0,t1),size2;}function useGlobalKeyDown(onKeyDown,options){const $=dist.c(7);let t0;$[0]!==onKeyDown?(t0=event=>onKeyDown(event),$[0]=onKeyDown,$[1]=t0):t0=$[1];const handleKeyDown=useEffectEvent(t0);let t1;$[2]!==handleKeyDown||$[3]!==options?(t1=()=>{const handler=event_0=>handleKeyDown(event_0);return window.addEventListener("keydown",handler,options),()=>window.removeEventListener("keydown",handler,options);},$[2]=handleKeyDown,$[3]=options,$[4]=t1):t1=$[4];let t2;$[5]!==options?(t2=[options],$[5]=options,$[6]=t2):t2=$[6],useEffect$1(t1,t2);}function useMatchMedia(mediaQueryString,getServerSnapshot2){const $=dist.c(4);useDebugValue(mediaQueryString);let t0;$[0]!==mediaQueryString?(t0=onStoreChange=>{const media=window.matchMedia(mediaQueryString);return media.addEventListener("change",onStoreChange),()=>media.removeEventListener("change",onStoreChange);},$[0]=mediaQueryString,$[1]=t0):t0=$[1];let t1;return $[2]!==mediaQueryString?(t1=()=>window.matchMedia(mediaQueryString).matches,$[2]=mediaQueryString,$[3]=t1):t1=$[3],useSyncExternalStore(t0,t1,getServerSnapshot2);}function _getMediaQuery(media,index){return index===0?"screen and (max-width: ".concat(media[index]-1,"px)"):index===media.length?"screen and (min-width: ".concat(media[index-1],"px)"):"screen and (min-width: ".concat(media[index-1],"px) and (max-width: ").concat(media[index]-1,"px)");}function _createMediaStore(media){const mediaLen=media.length;let sizes;const getSizes=()=>{if(!sizes){sizes=[];for(let index=mediaLen;index>-1;index-=1){const mediaQuery=_getMediaQuery(media,index);sizes.push({index,mq:window.matchMedia(mediaQuery)});}}return sizes;};return{getSnapshot:()=>{for(const{index,mq}of getSizes())if(mq.matches)return index;return 0;},subscribe:onStoreChange=>{const disposeFns=[];for(const{mq}of getSizes()){const handleChange=()=>{mq.matches&&onStoreChange();};mq.addEventListener("change",handleChange),disposeFns.push(()=>mq.removeEventListener("change",handleChange));}return()=>{for(const disposeFn of disposeFns)disposeFn();};}};}function getServerSnapshot(){return 0;}function useMediaIndex(){const $=dist.c(2),{media}=useTheme_v2();let t0;$[0]!==media?(t0=_createMediaStore(media),$[0]=media,$[1]=t0):t0=$[1];const store=t0;return useSyncExternalStore(store.subscribe,store.getSnapshot,getServerSnapshot);}function usePrefersDark(t0){return useMatchMedia("(prefers-color-scheme: dark)",t0===void 0?_temp$7:t0);}function _temp$7(){return!1;}function usePrefersReducedMotion(t0){return useMatchMedia("(prefers-reduced-motion: reduce)",t0===void 0?_temp$6:t0);}function _temp$6(){return!1;}function checkboxBaseStyles(){return css(_templateObject19||(_templateObject19=_taggedTemplateLiteral(["\n position: relative;\n display: inline-block;\n "])));}function inputElementStyles(props){const{color,input,radius}=getTheme_v2(props.theme),{focusRing}=input.checkbox;return css(_templateObject20||(_templateObject20=_taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n outline: none;\n opacity: 0;\n z-index: 1;\n padding: 0;\n margin: 0;\n\n & + span {\n position: relative;\n display: block;\n height: ",";\n width: ",";\n box-sizing: border-box;\n box-shadow: ",";\n border-radius: ",";\n line-height: 1;\n background-color: ",";\n\n & > svg {\n display: block;\n position: absolute;\n opacity: 0;\n height: 100%;\n width: 100%;\n\n & > path {\n vector-effect: non-scaling-stroke;\n stroke-width: 1.5px !important;\n }\n }\n }\n\n &:checked + span {\n background: ",";\n box-shadow: ",";\n color: ",";\n }\n\n /* focus */\n &:not(:disabled):focus:focus-visible + span {\n box-shadow: ",";\n }\n\n /* focus when checked - uses a different offset */\n &:not(:disabled):focus:focus-visible&:checked + span {\n box-shadow: ",";\n }\n\n &[data-error] + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n &[data-error]&:checked + span {\n background-color: ",";\n color: ",";\n }\n &[data-error]&:checked&:not(:disabled):focus:focus-visible + span {\n box-shadow: ",";\n }\n\n &:disabled + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n &:disabled&:checked + span {\n background-color: ",";\n }\n\n &[data-read-only] + span {\n background-color: ",";\n box-shadow: ",";\n color: ",";\n }\n\n &[data-read-only]&:checked + span {\n background-color: ",";\n }\n\n &:checked + span > svg:first-child {\n opacity: 1;\n }\n &:indeterminate + span > svg:last-child {\n opacity: 1;\n }\n "])),rem(input.checkbox.size),rem(input.checkbox.size),focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),rem(radius[2]),color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.fg,width:input.border.width}),color.input.default.enabled.bg,focusRingStyle({focusRing}),focusRingStyle({focusRing:{width:1,offset:1}}),color.input.invalid.enabled.border,focusRingBorderStyle({width:input.border.width,color:color.input.invalid.enabled.muted.bg}),color.input.default.disabled.fg,color.input.invalid.enabled.muted.bg,color.input.default.enabled.bg,focusRingStyle({border:{width:input.border.width,color:color.input.invalid.readOnly.muted.bg},focusRing:{width:1,offset:1}}),color.input.default.disabled.bg,focusRingBorderStyle({width:input.border.width,color:color.input.default.disabled.border}),color.input.default.disabled.fg,color.input.default.disabled.muted.bg,color.input.default.readOnly.bg,focusRingBorderStyle({width:input.border.width,color:color.input.default.readOnly.border}),color.input.default.readOnly.fg,color.input.default.readOnly.muted.bg);}const StyledCheckbox=/* @__PURE__ */styled.div.withConfig({displayName:"StyledCheckbox",componentId:"sc-1l5mt2l-0"})(checkboxBaseStyles),Input$5=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-1l5mt2l-1"})(inputElementStyles),Checkbox=forwardRef(function(props,forwardedRef){var _props0;const $=dist.c(25);let checked,className,customValidity,disabled,indeterminate,readOnly,restProps,style;$[0]!==props?(_props0=props,{checked,className,disabled,indeterminate,customValidity,readOnly,style}=_props0,restProps=_objectWithoutProperties(_props0,_excluded24),_props0,$[0]=props,$[1]=checked,$[2]=className,$[3]=customValidity,$[4]=disabled,$[5]=indeterminate,$[6]=readOnly,$[7]=restProps,$[8]=style):(checked=$[1],className=$[2],customValidity=$[3],disabled=$[4],indeterminate=$[5],readOnly=$[6],restProps=$[7],style=$[8]);const ref=useRef$1(null);let t0;$[9]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[9]=t0):t0=$[9],useImperativeHandle(forwardedRef,t0);let t1,t2;$[10]!==indeterminate?(t1=()=>{ref.current&&(ref.current.indeterminate=indeterminate||!1);},t2=[indeterminate],$[10]=indeterminate,$[11]=t1,$[12]=t2):(t1=$[11],t2=$[12]),useEffect$1(t1,t2),useCustomValidity(ref,customValidity);const t3=!disabled&&readOnly?"":void 0,t4=customValidity?"":void 0,t5=disabled||readOnly;let t6;$[13]!==checked||$[14]!==readOnly||$[15]!==restProps||$[16]!==t3||$[17]!==t4||$[18]!==t5?(t6=/* @__PURE__ */jsx(Input$5,_objectSpread(_objectSpread({"data-read-only":t3,"data-error":t4},restProps),{},{checked,disabled:t5,type:"checkbox",readOnly,ref})),$[13]=checked,$[14]=readOnly,$[15]=restProps,$[16]=t3,$[17]=t4,$[18]=t5,$[19]=t6):t6=$[19];let t7;$[20]===Symbol.for("react.memo_cache_sentinel")?(t7=/* @__PURE__ */jsxs("span",{children:[/* @__PURE__ */jsx(CheckmarkIcon,{}),/* @__PURE__ */jsx(RemoveIcon,{})]}),$[20]=t7):t7=$[20];let t8;return $[21]!==className||$[22]!==style||$[23]!==t6?(t8=/* @__PURE__ */jsxs(StyledCheckbox,{className,"data-ui":"Checkbox",style,children:[t6,t7]}),$[21]=className,$[22]=style,$[23]=t6,$[24]=t8):t8=$[24],t8;});Checkbox.displayName="ForwardRef(Checkbox)";function codeSyntaxHighlightingStyle(_ref71){let{theme}=_ref71;const{color:{syntax:color}}=getTheme_v2(theme);return{"&.atrule":{color:color.atrule},"&.attr-name":{color:color.attrName},"&.attr-value":{color:color.attrValue},"&.attribute":{color:color.attribute},"&.boolean":{color:color.boolean},"&.builtin":{color:color.builtin},"&.cdata":{color:color.cdata},"&.char":{color:color.char},"&.class":{color:color.class},"&.class-name":{color:color.className},"&.comment":{color:color.comment},"&.constant":{color:color.constant},"&.deleted":{color:color.deleted},"&.doctype":{color:color.doctype},"&.entity":{color:color.entity},"&.function":{color:color.function},"&.hexcode":{color:color.hexcode},"&.id":{color:color.id},"&.important":{color:color.important},"&.inserted":{color:color.inserted},"&.keyword":{color:color.keyword},"&.number":{color:color.number},"&.operator":{color:color.operator},"&.prolog":{color:color.prolog},"&.property":{color:color.property},"&.pseudo-class":{color:color.pseudoClass},"&.pseudo-element":{color:color.pseudoElement},"&.punctuation":{color:color.punctuation},"&.regex":{color:color.regex},"&.selector":{color:color.selector},"&.string":{color:color.string},"&.symbol":{color:color.symbol},"&.tag":{color:color.tag},"&.unit":{color:color.unit},"&.url":{color:color.url},"&.variable":{color:color.variable}};}function codeBaseStyle(){return css(_templateObject21||(_templateObject21=_taggedTemplateLiteral(["\n color: var(--card-code-fg-color);\n\n & code {\n font-family: inherit;\n\n &.refractor .token {\n ","\n }\n }\n\n & a {\n color: inherit;\n text-decoration: underline;\n border-radius: 1px;\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),codeSyntaxHighlightingStyle);}const LazyRefractor=lazy(()=>import('./refractor-8ecfc7e2.js')),StyledCode=/* @__PURE__ */styled.pre.withConfig({displayName:"StyledCode",componentId:"sc-4dymyn-0"})(codeBaseStyle,responsiveCodeFontStyle),Code=forwardRef(function(props,ref){var _props1;const $=dist.c(22);let children,language,restProps,t0,weight;$[0]!==props?(_props1=props,{children,language,size:t0,weight}=_props1,restProps=_objectWithoutProperties(_props1,_excluded25),_props1,$[0]=props,$[1]=children,$[2]=language,$[3]=restProps,$[4]=t0,$[5]=weight):(children=$[1],language=$[2],restProps=$[3],t0=$[4],weight=$[5]);const size2=t0===void 0?2:t0;let t1;$[6]!==size2?(t1=_getArrayProp(size2),$[6]=size2,$[7]=t1):t1=$[7];let t2;$[8]!==children?(t2=/* @__PURE__ */jsx("code",{children}),$[8]=children,$[9]=t2):t2=$[9];let t3;$[10]!==children||$[11]!==language?(t3=/* @__PURE__ */jsx(LazyRefractor,{language,value:children}),$[10]=children,$[11]=language,$[12]=t3):t3=$[12];let t4;$[13]!==t2||$[14]!==t3?(t4=/* @__PURE__ */jsx(Suspense,{fallback:t2,children:t3}),$[13]=t2,$[14]=t3,$[15]=t4):t4=$[15];let t5;return $[16]!==ref||$[17]!==restProps||$[18]!==t1||$[19]!==t4||$[20]!==weight?(t5=/* @__PURE__ */jsx(StyledCode,_objectSpread(_objectSpread({"data-ui":"Code"},restProps),{},{$size:t1,$weight:weight,ref,children:t4})),$[16]=ref,$[17]=restProps,$[18]=t1,$[19]=t4,$[20]=weight,$[21]=t5):t5=$[21],t5;});Code.displayName="ForwardRef(Code)";const BASE_STYLE$1={width:"100%",margin:"0 auto"};function containerBaseStyle(){return BASE_STYLE$1;}function responsiveContainerWidthStyle(props){const{container,media}=getTheme_v2(props.theme);return _responsive(media,props.$width,val=>({maxWidth:val==="auto"?"none":rem(container[val])}));}const StyledContainer=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledContainer",componentId:"sc-wyroop-0"})(containerBaseStyle,responsiveContainerWidthStyle),Container=forwardRef(function(props,ref){var _props10;const $=dist.c(11);let as,restProps,t0;$[0]!==props?(_props10=props,{as,width:t0}=_props10,restProps=_objectWithoutProperties(_props10,_excluded26),_props10,$[0]=props,$[1]=as,$[2]=restProps,$[3]=t0):(as=$[1],restProps=$[2],t0=$[3]);const width=t0===void 0?2:t0;let t1;$[4]!==width?(t1=_getArrayProp(width),$[4]=width,$[5]=t1):t1=$[5];let t2;return $[6]!==as||$[7]!==ref||$[8]!==restProps||$[9]!==t1?(t2=/* @__PURE__ */jsx(StyledContainer,_objectSpread(_objectSpread({"data-ui":"Container"},restProps),{},{$width:t1,forwardedAs:as,ref})),$[6]=as,$[7]=ref,$[8]=restProps,$[9]=t1,$[10]=t2):t2=$[10],t2;});Container.displayName="ForwardRef(Container)";const StyledGrid=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledGrid",componentId:"sc-v8t8oz-0"})(responsiveGridStyle),Grid=forwardRef(function(props,ref){var _props11;const $=dist.c(42);let as,autoCols,autoFlow,autoRows,children,columns,gap,gapX,gapY,restProps,rows;$[0]!==props?(_props11=props,{as,autoRows,autoCols,autoFlow,columns,gap,gapX,gapY,rows,children}=_props11,restProps=_objectWithoutProperties(_props11,_excluded27),_props11,$[0]=props,$[1]=as,$[2]=autoCols,$[3]=autoFlow,$[4]=autoRows,$[5]=children,$[6]=columns,$[7]=gap,$[8]=gapX,$[9]=gapY,$[10]=restProps,$[11]=rows):(as=$[1],autoCols=$[2],autoFlow=$[3],autoRows=$[4],children=$[5],columns=$[6],gap=$[7],gapX=$[8],gapY=$[9],restProps=$[10],rows=$[11]);const t0=typeof as=="string"?as:void 0;let t1;$[12]!==autoRows?(t1=_getArrayProp(autoRows),$[12]=autoRows,$[13]=t1):t1=$[13];let t2;$[14]!==autoCols?(t2=_getArrayProp(autoCols),$[14]=autoCols,$[15]=t2):t2=$[15];let t3;$[16]!==autoFlow?(t3=_getArrayProp(autoFlow),$[16]=autoFlow,$[17]=t3):t3=$[17];let t4;$[18]!==columns?(t4=_getArrayProp(columns),$[18]=columns,$[19]=t4):t4=$[19];let t5;$[20]!==gap?(t5=_getArrayProp(gap),$[20]=gap,$[21]=t5):t5=$[21];let t6;$[22]!==gapX?(t6=_getArrayProp(gapX),$[22]=gapX,$[23]=t6):t6=$[23];let t7;$[24]!==gapY?(t7=_getArrayProp(gapY),$[24]=gapY,$[25]=t7):t7=$[25];let t8;$[26]!==rows?(t8=_getArrayProp(rows),$[26]=rows,$[27]=t8):t8=$[27];let t9;return $[28]!==as||$[29]!==children||$[30]!==ref||$[31]!==restProps||$[32]!==t0||$[33]!==t1||$[34]!==t2||$[35]!==t3||$[36]!==t4||$[37]!==t5||$[38]!==t6||$[39]!==t7||$[40]!==t8?(t9=/* @__PURE__ */jsx(StyledGrid,_objectSpread(_objectSpread({"data-as":t0,"data-ui":"Grid"},restProps),{},{$autoRows:t1,$autoCols:t2,$autoFlow:t3,$columns:t4,$gap:t5,$gapX:t6,$gapY:t7,$rows:t8,forwardedAs:as,ref,children})),$[28]=as,$[29]=children,$[30]=ref,$[31]=restProps,$[32]=t0,$[33]=t1,$[34]=t2,$[35]=t3,$[36]=t4,$[37]=t5,$[38]=t6,$[39]=t7,$[40]=t8,$[41]=t9):t9=$[41],t9;});Grid.displayName="ForwardRef(Grid)";function headingBaseStyle(props){const{$accent,$muted}=props,{font}=getTheme_v2(props.theme);return css(_templateObject22||(_templateObject22=_taggedTemplateLiteral(["\n ","\n\n ","\n\n & code {\n font-family: ",";\n border-radius: 1px;\n }\n\n & a {\n text-decoration: none;\n border-radius: 1px;\n color: var(--card-link-color);\n outline: none;\n\n @media (hover: hover) {\n &:hover {\n text-decoration: underline;\n }\n }\n\n &:focus {\n box-shadow:\n 0 0 0 1px var(--card-bg-color),\n 0 0 0 3px var(--card-focus-ring-color);\n }\n\n &:focus:not(:focus-visible) {\n box-shadow: none;\n }\n }\n\n & strong {\n font-weight: ",";\n }\n\n & svg {\n /* Certain popular CSS libraries changes the defaults for SVG display */\n /* Make sure SVGs are rendered as inline elements */\n display: inline;\n }\n\n & [data-sanity-icon] {\n vertical-align: baseline;\n }\n "])),$accent&&css(_templateObject23||(_templateObject23=_taggedTemplateLiteral(["\n color: var(--card-accent-fg-color);\n "]))),$muted&&css(_templateObject24||(_templateObject24=_taggedTemplateLiteral(["\n color: var(--card-muted-fg-color);\n "]))),font.code.family,font.heading.weights.bold);}const StyledHeading=/* @__PURE__ */styled.div.withConfig({displayName:"StyledHeading",componentId:"sc-137lwim-0"})(headingBaseStyle,responsiveTextAlignStyle,responsiveHeadingFont),Heading=forwardRef(function(props,ref){var _props12;const $=dist.c(26);let align,childrenProp,restProps,t0,t1,t2,textOverflow,weight;$[0]!==props?(_props12=props,{accent:t0,align,children:childrenProp,muted:t1,size:t2,textOverflow,weight}=_props12,restProps=_objectWithoutProperties(_props12,_excluded28),_props12,$[0]=props,$[1]=align,$[2]=childrenProp,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=textOverflow,$[8]=weight):(align=$[1],childrenProp=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],textOverflow=$[7],weight=$[8]);const accent=t0===void 0?!1:t0,muted=t1===void 0?!1:t1,size2=t2===void 0?2:t2;let children=childrenProp;if(textOverflow==="ellipsis"){let t32;$[9]!==children?(t32=/* @__PURE__ */jsx(SpanWithTextOverflow,{children}),$[9]=children,$[10]=t32):t32=$[10],children=t32;}let t3;$[11]!==align?(t3=_getArrayProp(align),$[11]=align,$[12]=t3):t3=$[12];let t4;$[13]!==size2?(t4=_getArrayProp(size2),$[13]=size2,$[14]=t4):t4=$[14];let t5;$[15]!==children?(t5=/* @__PURE__ */jsx("span",{children}),$[15]=children,$[16]=t5):t5=$[16];let t6;return $[17]!==accent||$[18]!==muted||$[19]!==ref||$[20]!==restProps||$[21]!==t3||$[22]!==t4||$[23]!==t5||$[24]!==weight?(t6=/* @__PURE__ */jsx(StyledHeading,_objectSpread(_objectSpread({"data-ui":"Heading"},restProps),{},{$accent:accent,$align:t3,$muted:muted,$size:t4,$weight:weight,ref,children:t5})),$[17]=accent,$[18]=muted,$[19]=ref,$[20]=restProps,$[21]=t3,$[22]=t4,$[23]=t5,$[24]=weight,$[25]=t6):t6=$[25],t6;});Heading.displayName="ForwardRef(Heading)";function inlineBaseStyle(){return{lineHeight:"0","&&:not([hidden])":{display:"block"},"& > div":{display:"inline-block",verticalAlign:"middle"}};}function inlineSpaceStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$space,spaceIndex=>{const _space=rem(spaceIndex===0.5?space[1]/2:space[spaceIndex]);return{margin:"-".concat(_space," 0 0 -").concat(_space),"& > div":{padding:"".concat(_space," 0 0 ").concat(_space)}};});}const StyledInline=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledInline",componentId:"sc-1pkiy6j-0"})(inlineBaseStyle,inlineSpaceStyle),Inline=forwardRef(function(props,ref){var _props13;const $=dist.c(15);let as,childrenProp,restProps,space;$[0]!==props?(_props13=props,{as,children:childrenProp,space}=_props13,restProps=_objectWithoutProperties(_props13,_excluded29),_props13,$[0]=props,$[1]=as,$[2]=childrenProp,$[3]=restProps,$[4]=space):(as=$[1],childrenProp=$[2],restProps=$[3],space=$[4]);let t0;$[5]!==childrenProp?(t0=Children.map(childrenProp,_temp$5),$[5]=childrenProp,$[6]=t0):t0=$[6];const children=t0;let t1;$[7]!==space?(t1=_getArrayProp(space),$[7]=space,$[8]=t1):t1=$[8];const t2=ref;let t3;return $[9]!==as||$[10]!==children||$[11]!==restProps||$[12]!==t1||$[13]!==t2?(t3=/* @__PURE__ */jsx(StyledInline,_objectSpread(_objectSpread({"data-ui":"Inline"},restProps),{},{$space:t1,forwardedAs:as,ref:t2,children})),$[9]=as,$[10]=children,$[11]=restProps,$[12]=t1,$[13]=t2,$[14]=t3):t3=$[14],t3;});Inline.displayName="ForwardRef(Inline)";function _temp$5(child){return child&&/* @__PURE__ */jsx("div",{children:child});}function kbdStyle(){return css(_templateObject25||(_templateObject25=_taggedTemplateLiteral(["\n --card-bg-color: var(--card-kbd-bg-color);\n --card-border-color: var(--card-kbd-border-color);\n --card-fg-color: var(--card-kbd-fg-color);\n\n box-shadow: inset 0 0 0 1px var(--card-border-color);\n background: var(--card-bg-color);\n font: inherit;\n\n vertical-align: top;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}const StyledKBD=/* @__PURE__ */styled.kbd.withConfig({displayName:"StyledKBD",componentId:"sc-1w7yd8w-0"})(responsiveRadiusStyle,kbdStyle),KBD=forwardRef(function(props,ref){var _props14;const $=dist.c(19);let children,restProps,t0,t1,t2;$[0]!==props?(_props14=props,{children,fontSize:t0,padding:t1,radius:t2}=_props14,restProps=_objectWithoutProperties(_props14,_excluded30),_props14,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0,$[4]=t1,$[5]=t2):(children=$[1],restProps=$[2],t0=$[3],t1=$[4],t2=$[5]);const fontSize2=t0===void 0?0:t0,padding=t1===void 0?1:t1,radius=t2===void 0?2:t2;let t3;$[6]!==radius?(t3=_getArrayProp(radius),$[6]=radius,$[7]=t3):t3=$[7];let t4;$[8]!==children||$[9]!==fontSize2?(t4=/* @__PURE__ */jsx(Text,{as:"span",size:fontSize2,weight:"semibold",children}),$[8]=children,$[9]=fontSize2,$[10]=t4):t4=$[10];let t5;$[11]!==padding||$[12]!==t4?(t5=/* @__PURE__ */jsx(Box,{as:"span",padding,children:t4}),$[11]=padding,$[12]=t4,$[13]=t5):t5=$[13];let t6;return $[14]!==ref||$[15]!==restProps||$[16]!==t3||$[17]!==t5?(t6=/* @__PURE__ */jsx(StyledKBD,_objectSpread(_objectSpread({"data-ui":"KBD"},restProps),{},{$radius:t3,ref,children:t5})),$[14]=ref,$[15]=restProps,$[16]=t3,$[17]=t5,$[18]=t6):t6=$[18],t6;});KBD.displayName="ForwardRef(KBD)";const origin={name:"@sanity/ui/origin",fn(_ref72){var _middlewareData$shift,_middlewareData$shift2;let{middlewareData,placement,rects}=_ref72;const[side]=placement.split("-"),floatingWidth=rects.floating.width,floatingHeight=rects.floating.height,shiftX=((_middlewareData$shift=middlewareData.shift)===null||_middlewareData$shift===void 0?void 0:_middlewareData$shift.x)||0,shiftY=((_middlewareData$shift2=middlewareData.shift)===null||_middlewareData$shift2===void 0?void 0:_middlewareData$shift2.y)||0;if(floatingWidth<=0||floatingHeight<=0)return{};const isVerticalPlacement=["bottom","top"].includes(side),{originX,originY}=isVerticalPlacement?{originX:clamp(0.5-shiftX/floatingWidth,0,1),originY:side==="bottom"?0:1}:{originX:side==="left"?1:0,originY:clamp(0.5-shiftY/floatingHeight,0,1)};return{data:{originX,originY}};}};function clamp(num,min,max){return Math.min(Math.max(num,min),max);}function moveTowardsLength(movingPoint,targetPoint,amount){const width=targetPoint.x-movingPoint.x,height=targetPoint.y-movingPoint.y,distance=Math.sqrt(width*width+height*height);return moveTowardsFractional(movingPoint,targetPoint,Math.min(1,amount/distance));}function moveTowardsFractional(movingPoint,targetPoint,fraction){return{x:movingPoint.x+(targetPoint.x-movingPoint.x)*fraction,y:movingPoint.y+(targetPoint.y-movingPoint.y)*fraction};}function getRoundedCommands(points){const len=points.length,cmds=[];for(let i=0;i<len;i+=1){const point=points[i],prevPoint=points[i-1],nextPoint=points[i+1];if(prevPoint&&point.radius){const curveStart=moveTowardsLength(point,prevPoint,point.radius),curveEnd=moveTowardsLength(point,nextPoint,point.radius),startControl=moveTowardsFractional(curveStart,point,0.5),endControl=moveTowardsFractional(point,curveEnd,0.5);cmds.push(_objectSpread({type:"point"},curveStart)),cmds.push({type:"curve",curveEnd,startControl,endControl});}else cmds.push(_objectSpread({type:"point"},point));}return cmds;}function compileCommands(cmds){return cmds.map((n,idx)=>n.type==="point"?"".concat(idx===0?"M":"L"," ").concat(n.x," ").concat(n.y):n.type==="curve"?"C ".concat(n.startControl.x," ").concat(n.startControl.y," ").concat(n.endControl.x," ").concat(n.endControl.y," ").concat(n.curveEnd.x," ").concat(n.curveEnd.y):"").join(" ");}const StyledArrow=/* @__PURE__ */styled.div.withConfig({displayName:"StyledArrow",componentId:"sc-12vzy6c-0"})(_ref73=>{let{$w:w}=_ref73;return css(_templateObject26||(_templateObject26=_taggedTemplateLiteral(["\n position: absolute;\n width: ","px;\n height: ","px;\n\n :empty + & {\n display: none;\n }\n\n & > svg {\n display: block;\n line-height: 0;\n transform-origin: ","px ","px;\n }\n\n [data-placement^='top'] > & {\n bottom: -","px;\n\n & > svg {\n transform: rotate(0);\n }\n }\n\n [data-placement^='right'] > & {\n left: -","px;\n\n & > svg {\n transform: rotate(90deg);\n }\n }\n\n [data-placement^='left'] > & {\n right: -","px;\n\n & > svg {\n transform: rotate(-90deg);\n }\n }\n\n [data-placement^='bottom'] > & {\n top: -","px;\n\n & > svg {\n transform: rotate(180deg);\n }\n }\n "])),w,w,w/2,w/2,w,w,w,w);}),StrokePath=styled.path.withConfig({displayName:"StrokePath",componentId:"sc-12vzy6c-1"})(_templateObject27||(_templateObject27=_taggedTemplateLiteral(["stroke:var(--card-shadow-outline-color);"]))),ShapePath=styled.path.withConfig({displayName:"ShapePath",componentId:"sc-12vzy6c-2"})(_templateObject28||(_templateObject28=_taggedTemplateLiteral(["fill:var(--card-bg-color);"]))),Arrow=forwardRef(function(props,ref){var _props15;const $=dist.c(29);let h,restProps,t0,w;$[0]!==props?(_props15=props,{width:w,height:h,radius:t0}=_props15,restProps=_objectWithoutProperties(_props15,_excluded31),_props15,$[0]=props,$[1]=h,$[2]=restProps,$[3]=t0,$[4]=w):(h=$[1],restProps=$[2],t0=$[3],w=$[4]);const radius=t0===void 0?0:t0,{card}=useTheme_v2(),strokeWidth=card.shadow.outline,center=w/2;let t1;if($[5]!==center||$[6]!==h||$[7]!==radius||$[8]!==w){const points=[{x:0,y:0},{x:radius,y:0,radius},{x:center,y:h-1,radius},{x:w-radius,y:0,radius},{x:w,y:0}],cmds=getRoundedCommands(points);t1=compileCommands(cmds),$[5]=center,$[6]=h,$[7]=radius,$[8]=w,$[9]=t1;}else t1=$[9];const path=t1,strokePath="".concat(path),fillPath="".concat(path," M ").concat(w," -1 M 0 -1 Z"),t2="0 0 ".concat(w," ").concat(w);let t3;$[10]!==strokeWidth||$[11]!==w?(t3=/* @__PURE__ */jsx("mask",{id:"stroke-mask",children:/* @__PURE__ */jsx("rect",{x:0,y:strokeWidth,width:w,height:w,fill:"white"})}),$[10]=strokeWidth,$[11]=w,$[12]=t3):t3=$[12];const t4=strokeWidth*2;let t5;$[13]!==strokePath||$[14]!==t4?(t5=/* @__PURE__ */jsx(StrokePath,{d:strokePath,mask:"url(#stroke-mask)",strokeWidth:t4}),$[13]=strokePath,$[14]=t4,$[15]=t5):t5=$[15];let t6;$[16]!==fillPath?(t6=/* @__PURE__ */jsx(ShapePath,{d:fillPath}),$[16]=fillPath,$[17]=t6):t6=$[17];let t7;$[18]!==t2||$[19]!==t3||$[20]!==t5||$[21]!==t6||$[22]!==w?(t7=/* @__PURE__ */jsxs("svg",{width:w,height:w,viewBox:t2,children:[t3,t5,t6]}),$[18]=t2,$[19]=t3,$[20]=t5,$[21]=t6,$[22]=w,$[23]=t7):t7=$[23];let t8;return $[24]!==ref||$[25]!==restProps||$[26]!==t7||$[27]!==w?(t8=/* @__PURE__ */jsx(StyledArrow,_objectSpread(_objectSpread({},restProps),{},{$w:w,ref,children:t7})),$[24]=ref,$[25]=restProps,$[26]=t7,$[27]=w,$[28]=t8):t8=$[28],t8;});Arrow.displayName="ForwardRef(Arrow)";const BoundaryElementContext=createGlobalScopedContext("@sanity/ui/context/boundaryElement",null);function isRecord(value){return!!(value&&typeof value=="object"&&!Array.isArray(value));}const DEFAULT_VALUE={version:0,element:null};function useBoundaryElement(){const value=useContext(BoundaryElementContext);if(value&&(!isRecord(value)||value.version!==0))throw new Error("useBoundaryElement(): the context value is not compatible");return value||DEFAULT_VALUE;}function findMaxBreakpoints(media,width){const ret=[];for(let i=0;i<media.length;i+=1)media[i]>width&&ret.push(i);return ret;}function findMinBreakpoints(media,width){const ret=[];for(let i=0;i<media.length;i+=1)media[i]<=width&&ret.push(i);return ret;}const ElementQuery=forwardRef(function(props,forwardedRef){var _props16,_useElementSize$borde,_useElementSize;const $=dist.c(18),theme=useTheme_v2();let _media,children,restProps;$[0]!==props?(_props16=props,{children,media:_media}=_props16,restProps=_objectWithoutProperties(_props16,_excluded32),_props16,$[0]=props,$[1]=_media,$[2]=children,$[3]=restProps):(_media=$[1],children=$[2],restProps=$[3]);const media=_media!==null&&_media!==void 0?_media:theme.media,[element,setElement]=useState(null),width=(_useElementSize$borde=(_useElementSize=useElementSize(element))===null||_useElementSize===void 0?void 0:_useElementSize.border.width)!==null&&_useElementSize$borde!==void 0?_useElementSize$borde:window.innerWidth;let t0;if($[4]!==media||$[5]!==width){const eq=findMaxBreakpoints(media,width);t0=eq.length?eq.join(" "):void 0,$[4]=media,$[5]=width,$[6]=t0;}else t0=$[6];const max=t0;let t1;if($[7]!==media||$[8]!==width){const eq_0=findMinBreakpoints(media,width);t1=eq_0.length?eq_0.join(" "):void 0,$[7]=media,$[8]=width,$[9]=t1;}else t1=$[9];const min=t1;let t2,t3;$[10]!==element?(t2=()=>element,t3=[element],$[10]=element,$[11]=t2,$[12]=t3):(t2=$[11],t3=$[12]),useImperativeHandle(forwardedRef,t2,t3);let t4;return $[13]!==children||$[14]!==max||$[15]!==min||$[16]!==restProps?(t4=/* @__PURE__ */jsx("div",_objectSpread(_objectSpread({"data-ui":"ElementQuery"},restProps),{},{"data-eq-max":max,"data-eq-min":min,ref:setElement,children})),$[13]=children,$[14]=max,$[15]=min,$[16]=restProps,$[17]=t4):t4=$[17],t4;});ElementQuery.displayName="ForwardRef(ElementQuery)";function getLayerContext(contextValue){if(!isRecord(contextValue)||contextValue.version!==0)throw new Error("the context value is not compatible");if(!contextValue)throw new Error("components using `useLayer()` should be wrapped in a <LayerProvider>.");if(contextValue.version===0)return contextValue;throw new Error("could not get layer context");}const LayerContext=createGlobalScopedContext("@sanity/ui/context/layer",null);function LayerProvider(props){var _parent$level;const $=dist.c(21),{children,zOffset:t0}=props,zOffsetProp=t0===void 0?0:t0,parentContextValue=useContext(LayerContext);let t1;$[0]!==parentContextValue?(t1=parentContextValue&&getLayerContext(parentContextValue),$[0]=parentContextValue,$[1]=t1):t1=$[1];const parent=t1,parentRegisterChild=parent===null||parent===void 0?void 0:parent.registerChild,level=((_parent$level=parent===null||parent===void 0?void 0:parent.level)!==null&&_parent$level!==void 0?_parent$level:0)+1;let t2;$[2]!==zOffsetProp?(t2=_getArrayProp(zOffsetProp),$[2]=zOffsetProp,$[3]=t2):t2=$[3];const zOffset=t2,maxMediaIndex=zOffset.length-1,mediaIndex=Math.min(useMediaIndex(),maxMediaIndex),zIndex=parent?parent.zIndex+zOffset[mediaIndex]:zOffset[mediaIndex];let t3;$[4]===Symbol.for("react.memo_cache_sentinel")?(t3={},$[4]=t3):t3=$[4];const[,setChildLayers]=useState(t3),[size2,setSize]=useState(0),isTopLayer=size2===0;let t4;$[5]!==parentRegisterChild||$[6]!==setChildLayers?(t4=childLevel=>{const parentDispose=parentRegisterChild===null||parentRegisterChild===void 0?void 0:parentRegisterChild(childLevel);return childLevel!==void 0?setChildLayers(state=>{var _state$childLevel;const prevLen=(_state$childLevel=state[childLevel])!==null&&_state$childLevel!==void 0?_state$childLevel:0,nextState=_objectSpread(_objectSpread({},state),{},{[childLevel]:prevLen+1});return setSize(Object.keys(nextState).length),nextState;}):setSize(_temp$4),()=>{childLevel!==void 0?setChildLayers(state_0=>{const nextState_0=_objectSpread({},state_0);return nextState_0[childLevel]===1?(delete nextState_0[childLevel],setSize(Object.keys(nextState_0).length)):nextState_0[childLevel]=nextState_0[childLevel]-1,nextState_0;}):setSize(_temp2$2),parentDispose===null||parentDispose===void 0?void 0:parentDispose();};},$[5]=parentRegisterChild,$[6]=setChildLayers,$[7]=t4):t4=$[7];const registerChild=t4;let t5,t6;$[8]!==level||$[9]!==parentRegisterChild?(t5=()=>parentRegisterChild===null||parentRegisterChild===void 0?void 0:parentRegisterChild(level),t6=[level,parentRegisterChild],$[8]=level,$[9]=parentRegisterChild,$[10]=t5,$[11]=t6):(t5=$[10],t6=$[11]),useEffect$1(t5,t6);let t7;$[12]!==isTopLayer||$[13]!==level||$[14]!==registerChild||$[15]!==size2||$[16]!==zIndex?(t7={version:0,isTopLayer,level,registerChild,size:size2,zIndex},$[12]=isTopLayer,$[13]=level,$[14]=registerChild,$[15]=size2,$[16]=zIndex,$[17]=t7):t7=$[17];const value=t7;let t8;return $[18]!==children||$[19]!==value?(t8=/* @__PURE__ */jsx(LayerContext.Provider,{value,children}),$[18]=children,$[19]=value,$[20]=t8):t8=$[20],t8;}function _temp2$2(v_0){return v_0-1;}function _temp$4(v){return v+1;}LayerProvider.displayName="LayerProvider";function useLayer(){const $=dist.c(2),value=useContext(LayerContext);if(!value)throw new Error("useLayer(): missing context value");try{let t1;return $[0]!==value?(t1=getLayerContext(value),$[0]=value,$[1]=t1):t1=$[1],t1;}catch(t0){const err=t0;throw err instanceof Error?new Error("useLayer(): ".concat(err.message)):new Error("useLayer(): ".concat(err));}}const StyledLayer=/* @__PURE__ */styled.div.withConfig({displayName:"StyledLayer",componentId:"sc-16kojrv-0"})({position:"relative"}),LayerChildren=forwardRef(function(props,forwardedRef){var _props17;const $=dist.c(22);let children,onActivate,onFocus,restProps,t0;$[0]!==props?(_props17=props,{children,onActivate,onFocus,style:t0}=_props17,restProps=_objectWithoutProperties(_props17,_excluded33),_props17,$[0]=props,$[1]=children,$[2]=onActivate,$[3]=onFocus,$[4]=restProps,$[5]=t0):(children=$[1],onActivate=$[2],onFocus=$[3],restProps=$[4],t0=$[5]);const style=t0===void 0?EMPTY_RECORD:t0,{zIndex,isTopLayer}=useLayer(),lastFocusedRef=useRef$1(null),ref=useRef$1(null),isTopLayerRef=useRef$1(isTopLayer);let t1;$[6]===Symbol.for("react.memo_cache_sentinel")?(t1=()=>ref.current,$[6]=t1):t1=$[6],useImperativeHandle(forwardedRef,t1);let t2,t3;$[7]!==isTopLayer||$[8]!==onActivate?(t2=()=>{var _onActivate;isTopLayerRef.current!==isTopLayer&&isTopLayer&&(_onActivate=onActivate)!==null&&_onActivate!==void 0&&_onActivate({activeElement:lastFocusedRef.current}),isTopLayerRef.current=isTopLayer;},t3=[isTopLayer,onActivate],$[7]=isTopLayer,$[8]=onActivate,$[9]=t2,$[10]=t3):(t2=$[9],t3=$[10]),useEffect$1(t2,t3);let t4;$[11]!==isTopLayer||$[12]!==onFocus?(t4=event=>{var _onFocus;(_onFocus=onFocus)===null||_onFocus===void 0||_onFocus(event);const rootElement=ref.current,target=document.activeElement;!isTopLayer||!rootElement||!target||isHTMLElement(target)&&containsOrEqualsElement(rootElement,target)&&(lastFocusedRef.current=target);},$[11]=isTopLayer,$[12]=onFocus,$[13]=t4):t4=$[13];const handleFocus=t4;let t5;$[14]!==style||$[15]!==zIndex?(t5=_objectSpread(_objectSpread({},style),{},{zIndex}),$[14]=style,$[15]=zIndex,$[16]=t5):t5=$[16];let t6;return $[17]!==children||$[18]!==handleFocus||$[19]!==restProps||$[20]!==t5?(t6=/* @__PURE__ */jsx(StyledLayer,_objectSpread(_objectSpread({},restProps),{},{"data-ui":"Layer",onFocus:handleFocus,ref,style:t5,children})),$[17]=children,$[18]=handleFocus,$[19]=restProps,$[20]=t5,$[21]=t6):t6=$[21],t6;}),Layer=forwardRef(function(props,ref){var _props18;const $=dist.c(11);let children,restProps,t0;$[0]!==props?(_props18=props,{children,zOffset:t0}=_props18,restProps=_objectWithoutProperties(_props18,_excluded34),_props18,$[0]=props,$[1]=children,$[2]=restProps,$[3]=t0):(children=$[1],restProps=$[2],t0=$[3]);const zOffset=t0===void 0?1:t0;let t1;$[4]!==children||$[5]!==ref||$[6]!==restProps?(t1=/* @__PURE__ */jsx(LayerChildren,_objectSpread(_objectSpread({},restProps),{},{ref,children})),$[4]=children,$[5]=ref,$[6]=restProps,$[7]=t1):t1=$[7];let t2;return $[8]!==t1||$[9]!==zOffset?(t2=/* @__PURE__ */jsx(LayerProvider,{zOffset,children:t1}),$[8]=t1,$[9]=zOffset,$[10]=t2):t2=$[10],t2;});Layer.displayName="ForwardRef(Layer)";const key="@sanity/ui/context/portal",elementKey=Symbol.for("".concat(key,"/element"));globalScope[elementKey]=null;const defaultContextValue={version:0,boundaryElement:null,get element(){return typeof document>"u"?null:(globalScope[elementKey]||(globalScope[elementKey]=document.createElement("div"),globalScope[elementKey].setAttribute("data-portal",""),document.body.appendChild(globalScope[elementKey])),globalScope[elementKey]);}},PortalContext=createGlobalScopedContext(key,defaultContextValue);function usePortal(){const value=useContext(PortalContext);if(!value)throw new Error("usePortal(): missing context value");if(!isRecord(value)||value.version!==0)throw new Error("usePortal(): the context value is not compatible");return value;}function Portal(props){var _portal$elements;const $=dist.c(3),{children,__unstable_name:name}=props,portal=usePortal(),portalElement=(name?portal.elements&&portal.elements[name]:portal.element)||((_portal$elements=portal.elements)===null||_portal$elements===void 0?void 0:_portal$elements.default);if(!portalElement)return null;let t0;return $[0]!==children||$[1]!==portalElement?(t0=createPortal(children,portalElement),$[0]=children,$[1]=portalElement,$[2]=t0):t0=$[2],t0;}Portal.displayName="Portal";const StyledSrOnly=styled.div.withConfig({displayName:"StyledSrOnly",componentId:"sc-mubr0c-0"})(_templateObject29||(_templateObject29=_taggedTemplateLiteral(["display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;"]))),SrOnly=forwardRef(function(props,ref){const $=dist.c(4),{as,children}=props;let t0;return $[0]!==as||$[1]!==children||$[2]!==ref?(t0=/* @__PURE__ */jsx(StyledSrOnly,{"aria-hidden":!0,as,"data-ui":"SrOnly",ref,children}),$[0]=as,$[1]=children,$[2]=ref,$[3]=t0):t0=$[3],t0;});SrOnly.displayName="ForwardRef(SrOnly)";const StyledVirtualList=styled.div.withConfig({displayName:"StyledVirtualList",componentId:"sc-dlqsj4-0"})(_templateObject30||(_templateObject30=_taggedTemplateLiteral(["position:relative;"]))),ItemWrapper=styled.div.withConfig({displayName:"ItemWrapper",componentId:"sc-dlqsj4-1"})(_templateObject31||(_templateObject31=_taggedTemplateLiteral(["position:absolute;left:0;right:0;"]))),VirtualList=forwardRef(function(props,forwardedRef){var _props19;const $=dist.c(44);let getItemKey,onChange,renderItem,restProps,t0,t1,t2;$[0]!==props?(_props19=props,{as:t0,gap:t1,getItemKey,items:t2,onChange,renderItem}=_props19,restProps=_objectWithoutProperties(_props19,_excluded35),_props19,$[0]=props,$[1]=getItemKey,$[2]=onChange,$[3]=renderItem,$[4]=restProps,$[5]=t0,$[6]=t1,$[7]=t2):(getItemKey=$[1],onChange=$[2],renderItem=$[3],restProps=$[4],t0=$[5],t1=$[6],t2=$[7]);const as=t0===void 0?"div":t0,gap=t1===void 0?0:t1;let t3;$[8]!==t2?(t3=t2===void 0?[]:t2,$[8]=t2,$[9]=t3):t3=$[9];const items=t3,{space}=useTheme_v2(),ref=useRef$1(null),wrapperRef=useRef$1(null),[scrollTop,setScrollTop]=useState(0),[scrollHeight,setScrollHeight]=useState(0),[itemHeight,setItemHeight]=useState(-1);let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[10]=t4):t4=$[10],useImperativeHandle(forwardedRef,t4);let t5;$[11]===Symbol.for("react.memo_cache_sentinel")?(t5=()=>{if(!wrapperRef.current)return;const firstElement=wrapperRef.current.firstChild;firstElement instanceof HTMLElement&&setItemHeight(firstElement.offsetHeight);},$[11]=t5):t5=$[11];let t6;$[12]!==renderItem?(t6=[renderItem],$[12]=renderItem,$[13]=t6):t6=$[13],useEffect$1(t5,t6);let t7,t8;$[14]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>{if(!ref.current)return;const scrollEl=findScrollable(ref.current.parentNode);if(scrollEl){if(!(scrollEl instanceof HTMLElement))return;const handleScroll=()=>{setScrollTop(scrollEl.scrollTop);};scrollEl.addEventListener("scroll",handleScroll,{passive:!0});const ro=new _ResizeObserver(entries=>{setScrollHeight(entries[0].contentRect.height);});return ro.observe(scrollEl),handleScroll(),()=>{scrollEl.removeEventListener("scroll",handleScroll),ro.unobserve(scrollEl),ro.disconnect();};}const handleScroll_0=()=>{setScrollTop(window.scrollY);},handleResize=()=>{setScrollHeight(window.innerHeight);};return window.addEventListener("scroll",handleScroll_0,{passive:!0}),window.addEventListener("resize",handleResize),setScrollHeight(window.innerHeight),handleScroll_0(),()=>{window.removeEventListener("scroll",handleScroll_0),window.removeEventListener("resize",handleResize);};},t8=[],$[14]=t7,$[15]=t8):(t7=$[14],t8=$[15]),useEffect$1(t7,t8);const len=items.length,height=itemHeight?len*(itemHeight+space[gap])-space[gap]:0,fromIndex=height?Math.max(Math.floor(scrollTop/height*len)-2,0):0,toIndex=height?Math.ceil((scrollTop+scrollHeight)/height*len)+1:0;let t10,t9;$[16]!==fromIndex||$[17]!==gap||$[18]!==itemHeight||$[19]!==onChange||$[20]!==scrollHeight||$[21]!==scrollTop||$[22]!==space||$[23]!==toIndex?(t9=()=>{onChange&&onChange({fromIndex,gap:space[gap],itemHeight,scrollHeight,scrollTop,toIndex});},t10=[fromIndex,gap,itemHeight,onChange,scrollHeight,scrollTop,space,toIndex],$[16]=fromIndex,$[17]=gap,$[18]=itemHeight,$[19]=onChange,$[20]=scrollHeight,$[21]=scrollTop,$[22]=space,$[23]=toIndex,$[24]=t10,$[25]=t9):(t10=$[24],t9=$[25]),useEffect$1(t9,t10);let t11;$[26]!==fromIndex||$[27]!==gap||$[28]!==getItemKey||$[29]!==itemHeight||$[30]!==items||$[31]!==renderItem||$[32]!==space||$[33]!==toIndex?(t11={fromIndex,gap,itemHeight,space,toIndex,getItemKey,items,renderItem},$[26]=fromIndex,$[27]=gap,$[28]=getItemKey,$[29]=itemHeight,$[30]=items,$[31]=renderItem,$[32]=space,$[33]=toIndex,$[34]=t11):t11=$[34];const children=useChildren(t11);let t12;$[35]!==height?(t12={height},$[35]=height,$[36]=t12):t12=$[36];let t13;$[37]!==children||$[38]!==t12?(t13=/* @__PURE__ */jsx("div",{ref:wrapperRef,style:t12,children}),$[37]=children,$[38]=t12,$[39]=t13):t13=$[39];let t14;return $[40]!==as||$[41]!==restProps||$[42]!==t13?(t14=/* @__PURE__ */jsx(StyledVirtualList,_objectSpread(_objectSpread({as,"data-ui":"VirtualList"},restProps),{},{ref,children:t13})),$[40]=as,$[41]=restProps,$[42]=t13,$[43]=t14):t14=$[43],t14;});VirtualList.displayName="ForwardRef(VirtualList)";function useChildren(t0){const $=dist.c(21),{fromIndex,gap,getItemKey,itemHeight,items,renderItem,space,toIndex}=t0;if(!renderItem||items.length===0)return null;if(itemHeight===-1){let t12;$[0]!==items[0]||$[1]!==renderItem?(t12=renderItem(items[0]),$[0]=items[0],$[1]=renderItem,$[2]=t12):t12=$[2];let t2;return $[3]!==t12?(t2=[/* @__PURE__ */jsx(ItemWrapper,{children:t12},0)],$[3]=t12,$[4]=t2):t2=$[4],t2;}let t1;if($[5]!==fromIndex||$[6]!==gap||$[7]!==getItemKey||$[8]!==itemHeight||$[9]!==items||$[10]!==renderItem||$[11]!==space||$[12]!==toIndex){let t2;$[14]!==fromIndex||$[15]!==gap||$[16]!==getItemKey||$[17]!==itemHeight||$[18]!==renderItem||$[19]!==space?(t2=(item,_itemIndex)=>{const itemIndex=fromIndex+_itemIndex,node=renderItem(item),key2=getItemKey?getItemKey(item,itemIndex):itemIndex;return/* @__PURE__ */jsx(ItemWrapper,{style:{top:itemIndex*(itemHeight+space[gap])},children:node},key2);},$[14]=fromIndex,$[15]=gap,$[16]=getItemKey,$[17]=itemHeight,$[18]=renderItem,$[19]=space,$[20]=t2):t2=$[20],t1=items.slice(fromIndex,toIndex).map(t2),$[5]=fromIndex,$[6]=gap,$[7]=getItemKey,$[8]=itemHeight,$[9]=items,$[10]=renderItem,$[11]=space,$[12]=toIndex,$[13]=t1;}else t1=$[13];return t1;}function findScrollable(parentNode){let _scrollEl=parentNode;for(;_scrollEl&&!_isScrollable(_scrollEl);)_scrollEl=_scrollEl.parentNode;return _scrollEl;}function getElementRef(element){var _Object$getOwnPropert,_Object$getOwnPropert2;let getter=(_Object$getOwnPropert=Object.getOwnPropertyDescriptor(element.props,"ref"))===null||_Object$getOwnPropert===void 0?void 0:_Object$getOwnPropert.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning;return mayWarn?element.ref:(getter=(_Object$getOwnPropert2=Object.getOwnPropertyDescriptor(element,"ref"))===null||_Object$getOwnPropert2===void 0?void 0:_Object$getOwnPropert2.get,mayWarn=getter&&"isReactWarning"in getter&&getter.isReactWarning,mayWarn?element.props.ref:element.props.ref||element.ref);}const DEFAULT_POPOVER_DISTANCE=4,DEFAULT_POPOVER_PADDING=4,DEFAULT_POPOVER_ARROW_WIDTH=19,DEFAULT_POPOVER_ARROW_HEIGHT=8,DEFAULT_POPOVER_ARROW_RADIUS=2,DEFAULT_POPOVER_MARGINS=[0,0,0,0],DEFAULT_FALLBACK_PLACEMENTS$1={top:["bottom","left","right"],"top-start":["bottom-start","left-start","right-start"],"top-end":["bottom-end","left-end","right-end"],bottom:["top","left","right"],"bottom-start":["top-start","left-start","right-start"],"bottom-end":["top-end","left-end","right-end"],left:["right","top","bottom"],"left-start":["right-start","top-start","bottom-start"],"left-end":["right-end","top-end","bottom-end"],right:["left","top","bottom"],"right-start":["left-start","top-start","bottom-start"],"right-end":["left-end","top-end","bottom-end"]};function size(options){const{constrainSize,margins,matchReferenceWidth,maxWidthRef,padding=0,referenceWidthRef,setReferenceWidth,widthRef}=options;return{name:"@sanity/ui/size",async fn(args){var _maxWidthRef$current;const{elements,placement,platform,rects}=args,{floating,reference}=rects,overflow=await detectOverflow(args,{altBoundary:!0,boundary:options.boundaryElement||void 0,elementContext:"floating",padding,rootBoundary:"viewport"});let maxWidth=1/0,maxHeight=1/0;const floatingW=floating.width,floatingH=floating.height;placement.includes("top")&&(maxWidth=floatingW-(overflow.left+overflow.right),maxHeight=floatingH-overflow.top),placement.includes("right")&&(maxWidth=floatingW-overflow.right,maxHeight=floatingH-(overflow.top+overflow.bottom)),placement.includes("bottom")&&(maxWidth=floatingW-(overflow.left+overflow.right),maxHeight=floatingH-overflow.bottom),placement.includes("left")&&(maxWidth=floatingW-overflow.left,maxHeight=floatingH-(overflow.top+overflow.bottom));const availableWidth=maxWidth-margins[1]-margins[3],availableHeight=maxHeight-margins[0]-margins[2],referenceWidth=reference.width-margins[1]-margins[3];referenceWidthRef.current=referenceWidth,setReferenceWidth(referenceWidth),matchReferenceWidth?elements.floating.style.width="".concat(referenceWidth,"px"):widthRef.current!==void 0&&(elements.floating.style.width="".concat(widthRef.current,"px")),constrainSize&&(elements.floating.style.maxWidth="".concat(Math.min(availableWidth,(_maxWidthRef$current=maxWidthRef.current)!==null&&_maxWidthRef$current!==void 0?_maxWidthRef$current:1/0),"px"),elements.floating.style.maxHeight="".concat(availableHeight,"px"));const nextDimensions=await platform.getDimensions(elements.floating),targetH=nextDimensions.height,targetW=nextDimensions.width;return floatingW!==targetW||floatingH!==targetH?{reset:{rects:!0}}:{};}};}function calcCurrentWidth(params){const{container,mediaIndex,width}=params,w=width[mediaIndex],currentWidth=w===void 0?width[width.length-1]:w;return typeof currentWidth=="number"?container[currentWidth]:void 0;}function calcMaxWidth(params){const{boundaryWidth,currentWidth}=params;if(!(currentWidth===void 0&&boundaryWidth===void 0))return Math.min(currentWidth!==null&¤tWidth!==void 0?currentWidth:1/0,(boundaryWidth||1/0)-DEFAULT_POPOVER_PADDING*2);}const MotionCard$1=styled(motion.create(Card)).withConfig({displayName:"MotionCard",componentId:"sc-ihg31s-0"})(_templateObject32||(_templateObject32=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}flex-direction:column;width:max-content;min-width:min-content;will-change:transform;"]))),MotionFlex=styled(motion.create(Flex)).withConfig({displayName:"MotionFlex",componentId:"sc-ihg31s-1"})(_templateObject33||(_templateObject33=_taggedTemplateLiteral(["will-change:opacity;"]))),PopoverCard=forwardRef(function(props,ref){var _props20;const $=dist.c(66);let animate,arrow2,arrowRef,arrowX,arrowY,children,marginsProp,originX,originY,overflow,padding,placement,radius,restProps,scheme,shadow,strategy,style,tone,width,xProp,yProp;$[0]!==props?(_props20=props,{__unstable_margins:marginsProp,animate,arrow:arrow2,arrowRef,arrowX,arrowY,children,padding,placement,originX,originY,overflow,radius,scheme,shadow,strategy,style,tone,width,x:xProp,y:yProp}=_props20,restProps=_objectWithoutProperties(_props20,_excluded36),_props20,$[0]=props,$[1]=animate,$[2]=arrow2,$[3]=arrowRef,$[4]=arrowX,$[5]=arrowY,$[6]=children,$[7]=marginsProp,$[8]=originX,$[9]=originY,$[10]=overflow,$[11]=padding,$[12]=placement,$[13]=radius,$[14]=restProps,$[15]=scheme,$[16]=shadow,$[17]=strategy,$[18]=style,$[19]=tone,$[20]=width,$[21]=xProp,$[22]=yProp):(animate=$[1],arrow2=$[2],arrowRef=$[3],arrowX=$[4],arrowY=$[5],children=$[6],marginsProp=$[7],originX=$[8],originY=$[9],overflow=$[10],padding=$[11],placement=$[12],radius=$[13],restProps=$[14],scheme=$[15],shadow=$[16],strategy=$[17],style=$[18],tone=$[19],width=$[20],xProp=$[21],yProp=$[22]);const{zIndex}=useLayer(),margins=marginsProp||DEFAULT_POPOVER_MARGINS,x=(xProp!==null&&xProp!==void 0?xProp:0)+margins[3],y=(yProp!==null&&yProp!==void 0?yProp:0)+margins[0],t0=animate?"transform":void 0;let t1;$[23]!==originX||$[24]!==originY||$[25]!==strategy||$[26]!==style||$[27]!==t0||$[28]!==width||$[29]!==x||$[30]!==y||$[31]!==zIndex?(t1=_objectSpread({left:x,originX,originY,position:strategy,top:y,width,zIndex,willChange:t0},style),$[23]=originX,$[24]=originY,$[25]=strategy,$[26]=style,$[27]=t0,$[28]=width,$[29]=x,$[30]=y,$[31]=zIndex,$[32]=t1):t1=$[32];const rootStyle2=t1,t2=arrowX!==null?arrowX:void 0,t3=arrowY!==null?arrowY:void 0;let t4;$[33]!==t2||$[34]!==t3?(t4={left:t2,top:t3,right:void 0,bottom:void 0},$[33]=t2,$[34]=t3,$[35]=t4):t4=$[35];const arrowStyle=t4,t5=restProps;let t6;$[36]!==animate?(t6=animate?["hidden","initial"]:void 0,$[36]=animate,$[37]=t6):t6=$[37];let t7;$[38]!==animate?(t7=animate?["visible","scaleIn"]:void 0,$[38]=animate,$[39]=t7):t7=$[39];let t8;$[40]!==animate?(t8=animate?["hidden","scaleOut"]:void 0,$[40]=animate,$[41]=t8):t8=$[41];let t9;$[42]!==children||$[43]!==padding?(t9=/* @__PURE__ */jsx(Flex,{direction:"column",flex:1,padding,children}),$[42]=children,$[43]=padding,$[44]=t9):t9=$[44];let t10;$[45]!==overflow||$[46]!==t9?(t10=/* @__PURE__ */jsx(MotionFlex,{"data-ui":"Popover__wrapper",direction:"column",flex:1,overflow,variants:POPOVER_MOTION_PROPS.children,transition:POPOVER_MOTION_PROPS.transition,children:t9}),$[45]=overflow,$[46]=t9,$[47]=t10):t10=$[47];let t11;$[48]!==arrow2||$[49]!==arrowRef||$[50]!==arrowStyle?(t11=arrow2&&/* @__PURE__ */jsx(Arrow,{ref:arrowRef,style:arrowStyle,width:DEFAULT_POPOVER_ARROW_WIDTH,height:DEFAULT_POPOVER_ARROW_HEIGHT,radius:DEFAULT_POPOVER_ARROW_RADIUS}),$[48]=arrow2,$[49]=arrowRef,$[50]=arrowStyle,$[51]=t11):t11=$[51];let t12;return $[52]!==placement||$[53]!==radius||$[54]!==ref||$[55]!==rootStyle2||$[56]!==scheme||$[57]!==shadow||$[58]!==t10||$[59]!==t11||$[60]!==t5||$[61]!==t6||$[62]!==t7||$[63]!==t8||$[64]!==tone?(t12=/* @__PURE__ */jsxs(MotionCard$1,_objectSpread(_objectSpread({"data-ui":"Popover"},t5),{},{"data-placement":placement,radius,ref,scheme,shadow,sizing:"border",style:rootStyle2,tone,variants:POPOVER_MOTION_PROPS.card,transition:POPOVER_MOTION_PROPS.transition,initial:t6,animate:t7,exit:t8,children:[t10,t11]})),$[52]=placement,$[53]=radius,$[54]=ref,$[55]=rootStyle2,$[56]=scheme,$[57]=shadow,$[58]=t10,$[59]=t11,$[60]=t5,$[61]=t6,$[62]=t7,$[63]=t8,$[64]=tone,$[65]=t12):t12=$[65],t12;});PopoverCard.displayName="ForwardRef(PopoverCard)";const ViewportOverlay=()=>{const $=dist.c(2),{zIndex}=useLayer();let t0;return $[0]!==zIndex?(t0=/* @__PURE__ */jsx("div",{style:{height:"100vh",inset:0,position:"fixed",width:"100vw",zIndex}}),$[0]=zIndex,$[1]=t0):t0=$[1],t0;},Popover=forwardRef(function(props,forwardedRef){var _props$placement,_ref74,_ref75,_useElementSize2,_middlewareData$hide,_middlewareData$arrow2,_middlewareData$arrow3,_middlewareData$Sani,_middlewareData$Sani2;const $=dist.c(126),{container,layer}=useTheme_v2(),boundaryElementContext=useBoundaryElement();let _boundaryElement,_fallbackPlacements,_floatingBoundary,_referenceBoundary,_zOffsetProp,childProp,content,disabled,matchReferenceWidth,modal,open,paddingProp,portal,referenceElement,restProps,scheme,t0,t1,t10,t11,t2,t3,t4,t5,t6,t7,t8,t9,updateRef;if($[0]!==props){const{__unstable_margins:t122,animate:t132,arrow:t142,boundaryElement:t152,children:t162,constrainSize:t172,content:t182,disabled:t192,fallbackPlacements:t202,matchReferenceWidth:t212,floatingBoundary:t222,modal:t232,onActivate,open:t242,overflow:t252,padding:t262,placement:t272,placementStrategy:t282,portal:t292,preventOverflow:t302,radius:t312,referenceBoundary:t322,referenceElement:t332,scheme:t342,shadow:t352,tone:t362,width:t372,zOffset:t382,updateRef:t392}=props,t402=_objectWithoutProperties(props,_excluded37);t0=t122,t1=t132,t2=t142,_boundaryElement=t152,childProp=t162,t3=t172,content=t182,disabled=t192,_fallbackPlacements=t202,matchReferenceWidth=t212,_floatingBoundary=t222,modal=t232,open=t242,t4=t252,paddingProp=t262,t5=t272,t6=t282,portal=t292,t7=t302,t8=t312,_referenceBoundary=t322,referenceElement=t332,scheme=t342,t9=t352,t10=t362,t11=t372,_zOffsetProp=t382,updateRef=t392,restProps=t402,$[0]=props,$[1]=_boundaryElement,$[2]=_fallbackPlacements,$[3]=_floatingBoundary,$[4]=_referenceBoundary,$[5]=_zOffsetProp,$[6]=childProp,$[7]=content,$[8]=disabled,$[9]=matchReferenceWidth,$[10]=modal,$[11]=open,$[12]=paddingProp,$[13]=portal,$[14]=referenceElement,$[15]=restProps,$[16]=scheme,$[17]=t0,$[18]=t1,$[19]=t10,$[20]=t11,$[21]=t2,$[22]=t3,$[23]=t4,$[24]=t5,$[25]=t6,$[26]=t7,$[27]=t8,$[28]=t9,$[29]=updateRef;}else _boundaryElement=$[1],_fallbackPlacements=$[2],_floatingBoundary=$[3],_referenceBoundary=$[4],_zOffsetProp=$[5],childProp=$[6],content=$[7],disabled=$[8],matchReferenceWidth=$[9],modal=$[10],open=$[11],paddingProp=$[12],portal=$[13],referenceElement=$[14],restProps=$[15],scheme=$[16],t0=$[17],t1=$[18],t10=$[19],t11=$[20],t2=$[21],t3=$[22],t4=$[23],t5=$[24],t6=$[25],t7=$[26],t8=$[27],t9=$[28],updateRef=$[29];const margins=t0===void 0?DEFAULT_POPOVER_MARGINS:t0,_animate=t1===void 0?!1:t1,arrowProp=t2===void 0?!1:t2,constrainSize=t3===void 0?!1:t3,overflow=t4===void 0?"hidden":t4,placementProp=t5===void 0?"bottom":t5,placementStrategy=t6===void 0?"flip":t6,preventOverflow=t7===void 0?!0:t7,radiusProp=t8===void 0?3:t8,shadowProp=t9===void 0?3:t9,tone=t10===void 0?"inherit":t10,widthProp=t11===void 0?"auto":t11,boundaryElement=_boundaryElement!==null&&_boundaryElement!==void 0?_boundaryElement:boundaryElementContext===null||boundaryElementContext===void 0?void 0:boundaryElementContext.element,fallbackPlacements=_fallbackPlacements!==null&&_fallbackPlacements!==void 0?_fallbackPlacements:DEFAULT_FALLBACK_PLACEMENTS$1[(_props$placement=props.placement)!==null&&_props$placement!==void 0?_props$placement:"bottom"],floatingBoundary=(_ref74=_floatingBoundary!==null&&_floatingBoundary!==void 0?_floatingBoundary:props.boundaryElement)!==null&&_ref74!==void 0?_ref74:boundaryElementContext.element,referenceBoundary=(_ref75=_referenceBoundary!==null&&_referenceBoundary!==void 0?_referenceBoundary:props.boundaryElement)!==null&&_ref75!==void 0?_ref75:boundaryElementContext.element,zOffsetProp=_zOffsetProp!==null&&_zOffsetProp!==void 0?_zOffsetProp:layer.popover.zOffset,animate=usePrefersReducedMotion()?!1:_animate,boundarySize=(_useElementSize2=useElementSize(boundaryElement))===null||_useElementSize2===void 0?void 0:_useElementSize2.border;let t12;$[30]!==paddingProp?(t12=_getArrayProp(paddingProp),$[30]=paddingProp,$[31]=t12):t12=$[31];const padding=t12;let t13;$[32]!==radiusProp?(t13=_getArrayProp(radiusProp),$[32]=radiusProp,$[33]=t13):t13=$[33];const radius=t13;let t14;$[34]!==shadowProp?(t14=_getArrayProp(shadowProp),$[34]=shadowProp,$[35]=t14):t14=$[35];const shadow=t14,widthArrayProp=_getArrayProp(widthProp);let t15;$[36]!==zOffsetProp?(t15=_getArrayProp(zOffsetProp),$[36]=zOffsetProp,$[37]=t15):t15=$[37];const zOffset=t15,ref=useRef$1(null),arrowRef=useRef$1(null);let t16;$[38]===Symbol.for("react.memo_cache_sentinel")?(t16=()=>ref.current,$[38]=t16):t16=$[38],useImperativeHandle(forwardedRef,t16);const mediaIndex=useMediaIndex(),boundaryWidth=constrainSize||preventOverflow?boundarySize===null||boundarySize===void 0?void 0:boundarySize.width:void 0,width=calcCurrentWidth({container,mediaIndex,width:widthArrayProp}),widthRef=useRef$1(width);let t17,t18;$[39]!==width?(t17=()=>{widthRef.current=width;},t18=[width],$[39]=width,$[40]=t17,$[41]=t18):(t17=$[40],t18=$[41]),useEffect$1(t17,t18);let t19;$[42]!==boundaryWidth||$[43]!==width?(t19=calcMaxWidth({boundaryWidth,currentWidth:width}),$[42]=boundaryWidth,$[43]=width,$[44]=t19):t19=$[44];const maxWidth=t19,maxWidthRef=useRef$1(maxWidth);let t20,t21;$[45]!==maxWidth?(t20=()=>{maxWidthRef.current=maxWidth;},t21=[maxWidth],$[45]=maxWidth,$[46]=t20,$[47]=t21):(t20=$[46],t21=$[47]),useEffect$1(t20,t21);const referenceWidthRef=useRef$1(void 0);let t22,t23;$[48]!==matchReferenceWidth||$[49]!==maxWidth||$[50]!==open||$[51]!==width?(t22=()=>{const floatingElement=ref.current;if(!open||!floatingElement)return;const referenceWidth=referenceWidthRef.current;matchReferenceWidth?referenceWidth!==void 0&&(floatingElement.style.width="".concat(referenceWidth,"px")):width!==void 0&&(floatingElement.style.width="".concat(width,"px")),typeof maxWidth=="number"&&(floatingElement.style.maxWidth="".concat(maxWidth,"px"));},t23=[width,matchReferenceWidth,maxWidth,open],$[48]=matchReferenceWidth,$[49]=maxWidth,$[50]=open,$[51]=width,$[52]=t22,$[53]=t23):(t22=$[52],t23=$[53]),useEffect$1(t22,t23);const[referenceWidth_0,setReferenceWidth]=useState(void 0);let t24;$[54]!==animate||$[55]!==arrowProp||$[56]!==constrainSize||$[57]!==fallbackPlacements||$[58]!==floatingBoundary||$[59]!==margins||$[60]!==matchReferenceWidth||$[61]!==placementProp||$[62]!==placementStrategy||$[63]!==preventOverflow||$[64]!==referenceBoundary?(t24={animate,arrowProp,arrowRef,constrainSize,fallbackPlacements,floatingBoundary,margins,matchReferenceWidth,maxWidthRef,placementProp,placementStrategy,preventOverflow,referenceBoundary,referenceWidthRef,rootBoundary:"viewport",setReferenceWidth,widthRef},$[54]=animate,$[55]=arrowProp,$[56]=constrainSize,$[57]=fallbackPlacements,$[58]=floatingBoundary,$[59]=margins,$[60]=matchReferenceWidth,$[61]=placementProp,$[62]=placementStrategy,$[63]=preventOverflow,$[64]=referenceBoundary,$[65]=t24):t24=$[65];const middleware=useMiddleware$1(t24);let t25;$[66]!==referenceElement?(t25=referenceElement?{reference:referenceElement}:void 0,$[66]=referenceElement,$[67]=t25):t25=$[67];let t26;$[68]!==middleware||$[69]!==placementProp||$[70]!==t25?(t26={middleware,placement:placementProp,whileElementsMounted:autoUpdate,elements:t25},$[68]=middleware,$[69]=placementProp,$[70]=t25,$[71]=t26):t26=$[71];const{x,y,middlewareData,placement,refs,strategy,update}=useFloating(t26),referenceHidden=(_middlewareData$hide=middlewareData.hide)===null||_middlewareData$hide===void 0?void 0:_middlewareData$hide.referenceHidden,arrowX=(_middlewareData$arrow2=middlewareData.arrow)===null||_middlewareData$arrow2===void 0?void 0:_middlewareData$arrow2.x,arrowY=(_middlewareData$arrow3=middlewareData.arrow)===null||_middlewareData$arrow3===void 0?void 0:_middlewareData$arrow3.y,originX=(_middlewareData$Sani=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani===void 0?void 0:_middlewareData$Sani.originX,originY=(_middlewareData$Sani2=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani2===void 0?void 0:_middlewareData$Sani2.originY;let t27;$[72]===Symbol.for("react.memo_cache_sentinel")?(t27=arrowEl=>{arrowRef.current=arrowEl;},$[72]=t27):t27=$[72];const setArrow=t27;let t28;$[73]!==refs?(t28=node=>{ref.current=node,refs.setFloating(node);},$[73]=refs,$[74]=t28):t28=$[74];const setFloating=t28;let t29;$[75]!==childProp?(t29=childProp?getElementRef(childProp):null,$[75]=childProp,$[76]=t29):t29=$[76];let t30;$[77]!==refs.reference.current?(t30=()=>refs.reference.current,$[77]=refs.reference.current,$[78]=t30):t30=$[78],useImperativeHandle(t29,t30);let t31;bb0:{if(referenceElement){t31=childProp;break bb0;}if(!childProp){t31=null;break bb0;}let t322;$[79]!==childProp||$[80]!==refs.setReference?(t322=cloneElement(childProp,{ref:refs.setReference}),$[79]=childProp,$[80]=refs.setReference,$[81]=t322):t322=$[81],t31=t322;}const child=t31;let t32,t33;if($[82]!==update?(t32=()=>update,t33=[update],$[82]=update,$[83]=t32,$[84]=t33):(t32=$[83],t33=$[84]),useImperativeHandle(updateRef,t32,t33),disabled){let t342;return $[85]!==childProp?(t342=childProp||/* @__PURE__ */jsx(Fragment,{}),$[85]=childProp,$[86]=t342):t342=$[86],t342;}let t34;$[87]!==modal?(t34=modal&&/* @__PURE__ */jsx(ViewportOverlay,{}),$[87]=modal,$[88]=t34):t34=$[88];const t35=matchReferenceWidth?referenceWidth_0:width;let t36;$[89]!==animate||$[90]!==arrowProp||$[91]!==arrowX||$[92]!==arrowY||$[93]!==content||$[94]!==margins||$[95]!==originX||$[96]!==originY||$[97]!==overflow||$[98]!==padding||$[99]!==placement||$[100]!==radius||$[101]!==referenceHidden||$[102]!==restProps||$[103]!==scheme||$[104]!==setFloating||$[105]!==shadow||$[106]!==strategy||$[107]!==t35||$[108]!==tone||$[109]!==x||$[110]!==y?(t36=/* @__PURE__ */jsx(PopoverCard,_objectSpread(_objectSpread({},restProps),{},{__unstable_margins:margins,animate,arrow:arrowProp,arrowRef:setArrow,arrowX,arrowY,hidden:referenceHidden,overflow,padding,placement,radius,ref:setFloating,scheme,shadow,originX,originY,strategy,tone,width:t35,x,y,children:content})),$[89]=animate,$[90]=arrowProp,$[91]=arrowX,$[92]=arrowY,$[93]=content,$[94]=margins,$[95]=originX,$[96]=originY,$[97]=overflow,$[98]=padding,$[99]=placement,$[100]=radius,$[101]=referenceHidden,$[102]=restProps,$[103]=scheme,$[104]=setFloating,$[105]=shadow,$[106]=strategy,$[107]=t35,$[108]=tone,$[109]=x,$[110]=y,$[111]=t36):t36=$[111];let t37;$[112]!==t34||$[113]!==t36||$[114]!==zOffset?(t37=/* @__PURE__ */jsxs(LayerProvider,{zOffset,children:[t34,t36]}),$[112]=t34,$[113]=t36,$[114]=zOffset,$[115]=t37):t37=$[115];const popover=t37;let t38;$[116]!==open||$[117]!==popover||$[118]!==portal?(t38=open&&(portal?/* @__PURE__ */jsx(Portal,{__unstable_name:typeof portal=="string"?portal:void 0,children:popover}):popover),$[116]=open,$[117]=popover,$[118]=portal,$[119]=t38):t38=$[119];const children=t38;let t39;$[120]!==animate||$[121]!==children?(t39=animate?/* @__PURE__ */jsx(AnimatePresence,{children}):children,$[120]=animate,$[121]=children,$[122]=t39):t39=$[122];let t40;return $[123]!==child||$[124]!==t39?(t40=/* @__PURE__ */jsxs(Fragment,{children:[t39,child]}),$[123]=child,$[124]=t39,$[125]=t40):t40=$[125],t40;});Popover.displayName="ForwardRef(Popover)";function useMiddleware$1(t0){const $=dist.c(42),{animate,arrowProp,arrowRef,constrainSize,fallbackPlacements,floatingBoundary,margins,matchReferenceWidth,maxWidthRef,placementProp,placementStrategy,preventOverflow,referenceBoundary,referenceWidthRef,rootBoundary,setReferenceWidth,widthRef}=t0;let ret;if($[0]!==animate||$[1]!==arrowProp||$[2]!==arrowRef||$[3]!==constrainSize||$[4]!==fallbackPlacements||$[5]!==floatingBoundary||$[6]!==margins||$[7]!==matchReferenceWidth||$[8]!==maxWidthRef||$[9]!==placementProp||$[10]!==placementStrategy||$[11]!==preventOverflow||$[12]!==referenceBoundary||$[13]!==referenceWidthRef||$[14]!==rootBoundary||$[15]!==setReferenceWidth||$[16]!==widthRef){if(ret=[],constrainSize||preventOverflow)if(placementStrategy==="autoPlacement"){let t12;$[18]!==fallbackPlacements||$[19]!==placementProp?(t12=autoPlacement({allowedPlacements:[placementProp].concat(fallbackPlacements)}),$[18]=fallbackPlacements,$[19]=placementProp,$[20]=t12):t12=$[20],ret.push(t12);}else{const t12=floatingBoundary||void 0;let t22;$[21]!==fallbackPlacements||$[22]!==rootBoundary||$[23]!==t12?(t22=flip({boundary:t12,fallbackPlacements,padding:DEFAULT_POPOVER_PADDING,rootBoundary}),$[21]=fallbackPlacements,$[22]=rootBoundary,$[23]=t12,$[24]=t22):t22=$[24],ret.push(t22);}let t1;if($[25]===Symbol.for("react.memo_cache_sentinel")?(t1=offset({mainAxis:DEFAULT_POPOVER_DISTANCE}),$[25]=t1):t1=$[25],ret.push(t1),constrainSize||matchReferenceWidth){const t22=floatingBoundary||void 0;let t32;$[26]!==constrainSize||$[27]!==margins||$[28]!==matchReferenceWidth||$[29]!==maxWidthRef||$[30]!==referenceWidthRef||$[31]!==setReferenceWidth||$[32]!==t22||$[33]!==widthRef?(t32=size({boundaryElement:t22,constrainSize,margins,matchReferenceWidth,maxWidthRef,padding:DEFAULT_POPOVER_PADDING,referenceWidthRef,setReferenceWidth,widthRef}),$[26]=constrainSize,$[27]=margins,$[28]=matchReferenceWidth,$[29]=maxWidthRef,$[30]=referenceWidthRef,$[31]=setReferenceWidth,$[32]=t22,$[33]=widthRef,$[34]=t32):t32=$[34],ret.push(t32);}if(preventOverflow){const t22=floatingBoundary||void 0;let t32;$[35]!==rootBoundary||$[36]!==t22?(t32=shift({boundary:t22,rootBoundary,padding:DEFAULT_POPOVER_PADDING}),$[35]=rootBoundary,$[36]=t22,$[37]=t32):t32=$[37],ret.push(t32);}if(arrowProp){let t22;$[38]!==arrowRef?(t22=arrow({element:arrowRef,padding:DEFAULT_POPOVER_PADDING}),$[38]=arrowRef,$[39]=t22):t22=$[39],ret.push(t22);}animate&&ret.push(origin);const t2=referenceBoundary||void 0;let t3;$[40]!==t2?(t3=hide({boundary:t2,padding:DEFAULT_POPOVER_PADDING,strategy:"referenceHidden"}),$[40]=t2,$[41]=t3):t3=$[41],ret.push(t3),$[0]=animate,$[1]=arrowProp,$[2]=arrowRef,$[3]=constrainSize,$[4]=fallbackPlacements,$[5]=floatingBoundary,$[6]=margins,$[7]=matchReferenceWidth,$[8]=maxWidthRef,$[9]=placementProp,$[10]=placementStrategy,$[11]=preventOverflow,$[12]=referenceBoundary,$[13]=referenceWidthRef,$[14]=rootBoundary,$[15]=setReferenceWidth,$[16]=widthRef,$[17]=ret;}else ret=$[17];return ret;}function radioBaseStyle(){return css(_templateObject34||(_templateObject34=_taggedTemplateLiteral(["\n position: relative;\n\n &:not([hidden]) {\n display: inline-block;\n }\n\n &[data-read-only] {\n outline: 1px solid red;\n }\n "])));}function inputElementStyle(props){const{color,input}=getTheme_v2(props.theme),dist=(input.radio.size-input.radio.markSize)/2;return css(_templateObject35||(_templateObject35=_taggedTemplateLiteral(["\n appearance: none;\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n z-index: 1;\n padding: 0;\n margin: 0;\n border-radius: ",";\n border: none;\n\n /* enabled */\n & + span {\n display: block;\n position: relative;\n height: ",";\n width: ",";\n border-radius: ",";\n background: ",";\n box-shadow: ",";\n\n &::after {\n content: '';\n position: absolute;\n top: ",";\n left: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n background: ",";\n opacity: 0;\n }\n }\n\n /* focused */\n &:not(:disabled):focus + span {\n box-shadow: ",";\n }\n\n &:not(:disabled):focus:not(:focus-visible) + span {\n box-shadow: ",";\n }\n\n &:checked + span::after {\n opacity: 1;\n }\n\n /* customValidity */\n &[data-error] + span {\n background-color: ",";\n box-shadow: ",";\n &::after {\n background: ",";\n }\n }\n\n /* read only */\n &[data-read-only] + span {\n box-shadow: 0 0 0 1px ",";\n background: ",";\n\n &::after {\n background: ",";\n }\n }\n\n /* disabled */\n &:not([data-read-only]):disabled + span {\n box-shadow: 0 0 0 1px ",";\n background: ",";\n\n &::after {\n background: ",";\n }\n }\n "])),rem(input.radio.size/2),rem(input.radio.size),rem(input.radio.size),rem(input.radio.size/2),color.input.default.enabled.bg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),rem(dist),rem(dist),rem(input.radio.markSize),rem(input.radio.markSize),rem(input.radio.markSize/2),color.input.default.enabled.fg,focusRingStyle({border:{width:input.border.width,color:color.input.default.enabled.border},focusRing:input.radio.focusRing}),focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.invalid.enabled.border,focusRingBorderStyle({width:input.border.width,color:color.input.invalid.enabled.muted.bg}),color.input.invalid.enabled.muted.bg,color.input.default.readOnly.border,color.input.default.readOnly.bg,color.input.default.readOnly.border,color.input.default.disabled.border,color.input.default.disabled.bg,color.input.default.disabled.border);}const StyledRadio=/* @__PURE__ */styled.div.withConfig({displayName:"StyledRadio",componentId:"sc-ccrwkf-0"})(radioBaseStyle),Input$4=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-ccrwkf-1"})(inputElementStyle),Radio=forwardRef(function(props,forwardedRef){var _props21;const $=dist.c(19);let className,customValidity,disabled,readOnly,restProps,style;$[0]!==props?(_props21=props,{className,disabled,style,customValidity,readOnly}=_props21,restProps=_objectWithoutProperties(_props21,_excluded38),_props21,$[0]=props,$[1]=className,$[2]=customValidity,$[3]=disabled,$[4]=readOnly,$[5]=restProps,$[6]=style):(className=$[1],customValidity=$[2],disabled=$[3],readOnly=$[4],restProps=$[5],style=$[6]);const ref=useRef$1(null);let t0;$[7]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[7]=t0):t0=$[7],useImperativeHandle(forwardedRef,t0),useCustomValidity(ref,customValidity);const t1=!disabled&&readOnly?"":void 0,t2=customValidity?"":void 0,t3=disabled||readOnly;let t4;$[8]!==readOnly||$[9]!==restProps||$[10]!==t1||$[11]!==t2||$[12]!==t3?(t4=/* @__PURE__ */jsx(Input$4,_objectSpread(_objectSpread({"data-read-only":t1,"data-error":t2},restProps),{},{disabled:t3,readOnly,ref,type:"radio"})),$[8]=readOnly,$[9]=restProps,$[10]=t1,$[11]=t2,$[12]=t3,$[13]=t4):t4=$[13];let t5;$[14]===Symbol.for("react.memo_cache_sentinel")?(t5=/* @__PURE__ */jsx("span",{}),$[14]=t5):t5=$[14];let t6;return $[15]!==className||$[16]!==style||$[17]!==t4?(t6=/* @__PURE__ */jsxs(StyledRadio,{className,"data-ui":"Radio",style,children:[t4,t5]}),$[15]=className,$[16]=style,$[17]=t4,$[18]=t6):t6=$[18],t6;});Radio.displayName="ForwardRef(Radio)";function rootStyle(){return css(_templateObject36||(_templateObject36=_taggedTemplateLiteral(["\n position: relative;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}function inputBaseStyle(props){const{font}=getTheme_v2(props.theme);return css(_templateObject37||(_templateObject37=_taggedTemplateLiteral(["\n -webkit-font-smoothing: antialiased;\n appearance: none;\n border: 0;\n font-family: ",";\n color: inherit;\n width: 100%;\n outline: none;\n margin: 0;\n\n &:disabled {\n opacity: 1;\n }\n "])),font.text.family);}function inputColorStyle(props){const{color,input}=getTheme_v2(props.theme);return css(_templateObject38||(_templateObject38=_taggedTemplateLiteral(["\n /* enabled */\n background-color: ",";\n color: ",";\n box-shadow: ",";\n\n /* hovered */\n @media (hover: hover) {\n &:not(:disabled):hover {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n }\n\n /* focused */\n &:not(:disabled):focus {\n box-shadow: ",";\n }\n\n /* read-only */\n &[data-read-only] {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n\n /* disabled */\n &:not([data-read-only]):disabled {\n background-color: ",";\n color: ",";\n box-shadow: ",";\n }\n "])),color.input.default.enabled.bg,color.input.default.enabled.fg,focusRingBorderStyle({color:color.input.default.enabled.border,width:input.border.width}),color.input.default.hovered.bg,color.input.default.hovered.fg,focusRingBorderStyle({color:color.input.default.hovered.border,width:input.border.width}),focusRingStyle({border:{width:input.border.width,color:color.input.default.enabled.border},focusRing:input.select.focusRing}),color.input.default.readOnly.bg,color.input.default.readOnly.fg,focusRingBorderStyle({color:color.input.default.readOnly.border,width:input.border.width}),color.input.default.disabled.bg,color.input.default.disabled.fg,focusRingBorderStyle({color:color.input.default.disabled.border,width:input.border.width}));}function textSize(size2){return{fontSize:rem(size2.fontSize),lineHeight:"".concat(rem(size2.lineHeight))};}function inputTextSizeStyle(props){const{$fontSize}=props,{font,media}=getTheme_v2(props.theme);return _responsive(media,$fontSize,sizeIndex=>textSize(font.text.sizes[sizeIndex]||font.text.sizes[2]));}function inputStyle(){return[responsiveRadiusStyle,inputBaseStyle,inputColorStyle,inputTextSizeStyle,responsiveInputPaddingIconRightStyle];}function iconBoxStyle(props){const{color}=getTheme_v2(props.theme);return css(_templateObject39||(_templateObject39=_taggedTemplateLiteral(["\n pointer-events: none;\n position: absolute;\n top: 0;\n right: 0;\n\n /* enabled */\n --card-fg-color: ",";\n\n /* hover */\n @media (hover: hover) {\n select:not(disabled):not(:read-only):hover + && {\n --card-fg-color: ",";\n }\n }\n\n /* disabled */\n select:disabled + && {\n --card-fg-color: ",";\n }\n\n /* read-only */\n select[data-read-only] + && {\n --card-fg-color: ",";\n }\n "])),color.input.default.enabled.fg,color.input.default.hovered.fg,color.input.default.disabled.fg,color.input.default.readOnly.fg);}const selectStyle={root:rootStyle,input:inputStyle,iconBox:iconBoxStyle},StyledSelect=/* @__PURE__ */styled.div.withConfig({displayName:"StyledSelect",componentId:"sc-5mxno7-0"})(selectStyle.root),Input$3=/* @__PURE__ */styled.select.withConfig({displayName:"Input",componentId:"sc-5mxno7-1"})(selectStyle.input),IconBox=/* @__PURE__ */styled(Box).withConfig({displayName:"IconBox",componentId:"sc-5mxno7-2"})(selectStyle.iconBox),Select=forwardRef(function(props,forwardedRef){var _props22;const $=dist.c(37);let children,customValidity,disabled,readOnly,restProps,t0,t1,t2,t3;$[0]!==props?(_props22=props,{children,customValidity,disabled,fontSize:t0,padding:t1,radius:t2,readOnly,space:t3}=_props22,restProps=_objectWithoutProperties(_props22,_excluded39),_props22,$[0]=props,$[1]=children,$[2]=customValidity,$[3]=disabled,$[4]=readOnly,$[5]=restProps,$[6]=t0,$[7]=t1,$[8]=t2,$[9]=t3):(children=$[1],customValidity=$[2],disabled=$[3],readOnly=$[4],restProps=$[5],t0=$[6],t1=$[7],t2=$[8],t3=$[9]);const fontSize2=t0===void 0?2:t0,padding=t1===void 0?3:t1,radius=t2===void 0?2:t2,space=t3===void 0?3:t3,ref=useRef$1(null);let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[10]=t4):t4=$[10],useImperativeHandle(forwardedRef,t4),useCustomValidity(ref,customValidity);const t5=!disabled&&readOnly?"":void 0;let t6;$[11]!==fontSize2?(t6=_getArrayProp(fontSize2),$[11]=fontSize2,$[12]=t6):t6=$[12];let t7;$[13]!==padding?(t7=_getArrayProp(padding),$[13]=padding,$[14]=t7):t7=$[14];let t8;$[15]!==radius?(t8=_getArrayProp(radius),$[15]=radius,$[16]=t8):t8=$[16];let t9;$[17]!==space?(t9=_getArrayProp(space),$[17]=space,$[18]=t9):t9=$[18];const t10=disabled||readOnly;let t11;$[19]!==children||$[20]!==restProps||$[21]!==t10||$[22]!==t5||$[23]!==t6||$[24]!==t7||$[25]!==t8||$[26]!==t9?(t11=/* @__PURE__ */jsx(Input$3,_objectSpread(_objectSpread({"data-read-only":t5,"data-ui":"Select"},restProps),{},{$fontSize:t6,$padding:t7,$radius:t8,$space:t9,disabled:t10,ref,children})),$[19]=children,$[20]=restProps,$[21]=t10,$[22]=t5,$[23]=t6,$[24]=t7,$[25]=t8,$[26]=t9,$[27]=t11):t11=$[27];let t12;$[28]===Symbol.for("react.memo_cache_sentinel")?(t12=/* @__PURE__ */jsx(ChevronDownIcon,{}),$[28]=t12):t12=$[28];let t13;$[29]!==fontSize2?(t13=/* @__PURE__ */jsx(Text,{size:fontSize2,children:t12}),$[29]=fontSize2,$[30]=t13):t13=$[30];let t14;$[31]!==padding||$[32]!==t13?(t14=/* @__PURE__ */jsx(IconBox,{padding,children:t13}),$[31]=padding,$[32]=t13,$[33]=t14):t14=$[33];let t15;return $[34]!==t11||$[35]!==t14?(t15=/* @__PURE__ */jsxs(StyledSelect,{"data-ui":"Select",children:[t11,t14]}),$[34]=t11,$[35]=t14,$[36]=t15):t15=$[36],t15;});Select.displayName="ForwardRef(Select)";const BASE_STYLE={"&&:not([hidden])":{display:"grid"},'&[data-as="ul"],&[data-as="ol"]':{listStyle:"none"},gridTemplateColumns:"minmax(0, 1fr)",gridAutoRows:"min-content"};function stackBaseStyle(){return BASE_STYLE;}function responsiveStackSpaceStyle(props){const{media,space}=getTheme_v2(props.theme);return _responsive(media,props.$space,spaceIndex=>({gridGap:rem(space[spaceIndex])}));}const StyledStack=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledStack",componentId:"sc-8dpfq2-0"})(stackBaseStyle,responsiveStackSpaceStyle),Stack=forwardRef(function(props,ref){var _props23;const $=dist.c(12);let as,restProps,space;$[0]!==props?(_props23=props,{as,space}=_props23,restProps=_objectWithoutProperties(_props23,_excluded40),_props23,$[0]=props,$[1]=as,$[2]=restProps,$[3]=space):(as=$[1],restProps=$[2],space=$[3]);const t0=typeof as=="string"?as:void 0;let t1;$[4]!==space?(t1=_getArrayProp(space),$[4]=space,$[5]=t1):t1=$[5];let t2;return $[6]!==as||$[7]!==ref||$[8]!==restProps||$[9]!==t0||$[10]!==t1?(t2=/* @__PURE__ */jsx(StyledStack,_objectSpread(_objectSpread({"data-as":t0,"data-ui":"Stack"},restProps),{},{$space:t1,forwardedAs:as,ref})),$[6]=as,$[7]=ref,$[8]=restProps,$[9]=t0,$[10]=t1,$[11]=t2):t2=$[11],t2;});Stack.displayName="ForwardRef(Stack)";function switchBaseStyles(){return css(_templateObject40||(_templateObject40=_taggedTemplateLiteral(["\n position: relative;\n &:not([hidden]) {\n display: inline-block;\n }\n "])));}function switchInputStyles(){return css(_templateObject41||(_templateObject41=_taggedTemplateLiteral(["\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n opacity: 0;\n height: 100%;\n width: 100%;\n outline: none;\n padding: 0;\n margin: 0;\n\n /* Place the input element above the representation element */\n z-index: 1;\n "])));}function switchRepresentationStyles(props){const{color,input}=getTheme_v2(props.theme);return css(_templateObject42||(_templateObject42=_taggedTemplateLiteral(["\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n --switch-box-shadow: none;\n\n &:not([hidden]) {\n display: block;\n }\n position: relative;\n width: ",";\n height: ",";\n border-radius: ",";\n\n /* Make sure it\u2019s not possible to interact with the wrapper element */\n pointer-events: none;\n\n &:after {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 1;\n box-shadow: var(--switch-box-shadow);\n border-radius: inherit;\n }\n\n /* Focus styles */\n input:focus + && {\n --switch-box-shadow: ",";\n }\n\n input:focus:not(:focus-visible) + && {\n --switch-box-shadow: none;\n }\n\n input:checked + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n @media (hover: hover) {\n input:not(:disabled):hover + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input:not(:disabled):checked:hover + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n }\n\n input:not([data-read-only]):disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input[data-read-only]:disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n\n input:checked[data-read-only]:disabled + && {\n --switch-bg-color: ",";\n --switch-fg-color: ",";\n }\n "])),color.input.default.enabled.border,color.input.default.enabled.bg,rem(input.switch.width),rem(input.switch.height),rem(input.switch.height/2),focusRingStyle({focusRing:input.switch.focusRing}),color.input.default.enabled.fg,color.input.default.enabled.bg,color.input.default.hovered.border,color.input.default.hovered.bg,color.input.default.enabled.fg,color.input.default.enabled.bg,color.input.default.disabled.border,color.input.default.disabled.bg,color.input.default.readOnly.border,color.input.default.readOnly.bg,color.input.default.readOnly.fg,color.input.default.readOnly.bg);}function switchTrackStyles(props){const{input}=getTheme_v2(props.theme);return css(_templateObject43||(_templateObject43=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n background-color: var(--switch-bg-color);\n position: absolute;\n left: 0;\n top: 0;\n width: ",";\n height: ",";\n border-radius: ",";\n "])),rem(input.switch.width),rem(input.switch.height),rem(input.switch.height/2));}function switchThumbStyles(props){const{$indeterminate}=props,{input}=getTheme_v2(props.theme),trackWidth=input.switch.width,trackHeight=input.switch.height,trackPadding=input.switch.padding,size2=trackHeight-input.switch.padding*2,checkedOffset=trackWidth-trackPadding*2-size2,indeterminateOffset=trackWidth/2-size2/2-trackPadding,checked=$indeterminate!==!0&&props.$checked===!0;return css(_templateObject44||(_templateObject44=_taggedTemplateLiteral(["\n &:not([hidden]) {\n display: block;\n }\n position: absolute;\n left: ",";\n top: ",";\n height: ",";\n width: ",";\n border-radius: ",";\n transition-property: transform;\n transition-duration: ","ms;\n transition-timing-function: ",";\n background: var(--switch-fg-color);\n transform: translate3d(0, 0, 0);\n box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.05);\n\n ","\n\n ","\n "])),rem(trackPadding),rem(trackPadding),rem(size2),rem(size2),rem(size2/2),input.switch.transitionDurationMs,input.switch.transitionTimingFunction,checked&&css(_templateObject45||(_templateObject45=_taggedTemplateLiteral(["\n transform: translate3d(","px, 0, 0);\n "])),checkedOffset),$indeterminate&&css(_templateObject46||(_templateObject46=_taggedTemplateLiteral(["\n transform: translate3d(","px, 0, 0);\n "])),indeterminateOffset));}const StyledSwitch=/* @__PURE__ */styled.span.withConfig({displayName:"StyledSwitch",componentId:"sc-dw1foe-0"})(switchBaseStyles),Input$2=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-dw1foe-1"})(switchInputStyles),Representation=/* @__PURE__ */styled.span.withConfig({displayName:"Representation",componentId:"sc-dw1foe-2"})(switchRepresentationStyles),Track=/* @__PURE__ */styled.span.withConfig({displayName:"Track",componentId:"sc-dw1foe-3"})(switchTrackStyles),Thumb=/* @__PURE__ */styled.span.withConfig({displayName:"Thumb",componentId:"sc-dw1foe-4"})(switchThumbStyles),Switch=forwardRef(function(props,forwardedRef){var _props24;const $=dist.c(26);let checked,className,disabled,indeterminate,readOnly,restProps,style;$[0]!==props?(_props24=props,{checked,className,disabled,indeterminate,readOnly,style}=_props24,restProps=_objectWithoutProperties(_props24,_excluded41),_props24,$[0]=props,$[1]=checked,$[2]=className,$[3]=disabled,$[4]=indeterminate,$[5]=readOnly,$[6]=restProps,$[7]=style):(checked=$[1],className=$[2],disabled=$[3],indeterminate=$[4],readOnly=$[5],restProps=$[6],style=$[7]);const ref=useRef$1(null);let t0;$[8]===Symbol.for("react.memo_cache_sentinel")?(t0=()=>ref.current,$[8]=t0):t0=$[8],useImperativeHandle(forwardedRef,t0);let t1,t2;$[9]!==indeterminate?(t1=()=>{ref.current&&(ref.current.indeterminate=indeterminate||!1);},t2=[indeterminate],$[9]=indeterminate,$[10]=t1,$[11]=t2):(t1=$[10],t2=$[11]),useEffect$1(t1,t2);const t3=!disabled&&readOnly?"":void 0,t4=indeterminate!==!0&&checked,t5=disabled||readOnly;let t6;$[12]!==restProps||$[13]!==t3||$[14]!==t4||$[15]!==t5?(t6=/* @__PURE__ */jsx(Input$2,_objectSpread(_objectSpread({"data-read-only":t3},restProps),{},{checked:t4,disabled:t5,type:"checkbox",ref})),$[12]=restProps,$[13]=t3,$[14]=t4,$[15]=t5,$[16]=t6):t6=$[16];let t7;$[17]===Symbol.for("react.memo_cache_sentinel")?(t7=/* @__PURE__ */jsx(Track,{}),$[17]=t7):t7=$[17];let t8;$[18]!==checked||$[19]!==indeterminate?(t8=/* @__PURE__ */jsxs(Representation,{"aria-hidden":!0,"data-name":"representation",children:[t7,/* @__PURE__ */jsx(Thumb,{$checked:checked,$indeterminate:indeterminate})]}),$[18]=checked,$[19]=indeterminate,$[20]=t8):t8=$[20];let t9;return $[21]!==className||$[22]!==style||$[23]!==t6||$[24]!==t8?(t9=/* @__PURE__ */jsxs(StyledSwitch,{className,"data-ui":"Switch",style,children:[t6,t8]}),$[21]=className,$[22]=style,$[23]=t6,$[24]=t8,$[25]=t9):t9=$[25],t9;});Switch.displayName="ForwardRef(Switch)";const StyledTextArea=/* @__PURE__ */styled.span.withConfig({displayName:"StyledTextArea",componentId:"sc-1d6h1o8-0"})(textInputRootStyle),InputRoot$1=styled.span.withConfig({displayName:"InputRoot",componentId:"sc-1d6h1o8-1"})(_templateObject47||(_templateObject47=_taggedTemplateLiteral(["flex:1;min-width:0;display:block;position:relative;"]))),Input$1=/* @__PURE__ */styled.textarea.withConfig({displayName:"Input",componentId:"sc-1d6h1o8-2"})(responsiveInputPaddingStyle,textInputBaseStyle,textInputFontSizeStyle),Presentation$1=/* @__PURE__ */styled.div.withConfig({displayName:"Presentation",componentId:"sc-1d6h1o8-3"})(responsiveRadiusStyle,textInputRepresentationStyle),TextArea=forwardRef(function(props,forwardedRef){var _props25;const $=dist.c(35);let __unstable_disableFocusRing,customValidity,restProps,t0,t1,t2,t3,t4,weight;$[0]!==props?(_props25=props,{border:t0,customValidity,disabled:t1,fontSize:t2,padding:t3,radius:t4,weight,__unstable_disableFocusRing}=_props25,restProps=_objectWithoutProperties(_props25,_excluded42),_props25,$[0]=props,$[1]=__unstable_disableFocusRing,$[2]=customValidity,$[3]=restProps,$[4]=t0,$[5]=t1,$[6]=t2,$[7]=t3,$[8]=t4,$[9]=weight):(__unstable_disableFocusRing=$[1],customValidity=$[2],restProps=$[3],t0=$[4],t1=$[5],t2=$[6],t3=$[7],t4=$[8],weight=$[9]);const border2=t0===void 0?!0:t0,disabled=t1===void 0?!1:t1,fontSize2=t2===void 0?2:t2,padding=t3===void 0?3:t3,radius=t4===void 0?2:t4,ref=useRef$1(null),rootTheme=useRootTheme();let t5;$[10]===Symbol.for("react.memo_cache_sentinel")?(t5=()=>ref.current,$[10]=t5):t5=$[10],useImperativeHandle(forwardedRef,t5),useCustomValidity(ref,customValidity);const t6=rootTheme.scheme,t7=rootTheme.tone;let t8;$[11]!==fontSize2?(t8=_getArrayProp(fontSize2),$[11]=fontSize2,$[12]=t8):t8=$[12];let t9;$[13]!==padding?(t9=_getArrayProp(padding),$[13]=padding,$[14]=t9):t9=$[14];const t10=rootTheme.scheme;let t11;$[15]===Symbol.for("react.memo_cache_sentinel")?(t11=_getArrayProp(0),$[15]=t11):t11=$[15];let t12;$[16]!==disabled||$[17]!==restProps||$[18]!==rootTheme.scheme||$[19]!==rootTheme.tone||$[20]!==t8||$[21]!==t9||$[22]!==weight?(t12=/* @__PURE__ */jsx(Input$1,_objectSpread(_objectSpread({"data-as":"textarea","data-scheme":t6,"data-tone":t7},restProps),{},{$fontSize:t8,$padding:t9,$scheme:t10,$space:t11,$tone:rootTheme.tone,$weight:weight,disabled,ref})),$[16]=disabled,$[17]=restProps,$[18]=rootTheme.scheme,$[19]=rootTheme.tone,$[20]=t8,$[21]=t9,$[22]=weight,$[23]=t12):t12=$[23];let t13;$[24]!==radius?(t13=_getArrayProp(radius),$[24]=radius,$[25]=t13):t13=$[25];const t14=border2?"":void 0;let t15;$[26]!==__unstable_disableFocusRing||$[27]!==rootTheme.scheme||$[28]!==rootTheme.tone||$[29]!==t13||$[30]!==t14?(t15=/* @__PURE__ */jsx(Presentation$1,{$radius:t13,$unstableDisableFocusRing:__unstable_disableFocusRing,$scheme:rootTheme.scheme,$tone:rootTheme.tone,"data-border":t14,"data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone}),$[26]=__unstable_disableFocusRing,$[27]=rootTheme.scheme,$[28]=rootTheme.tone,$[29]=t13,$[30]=t14,$[31]=t15):t15=$[31];let t16;return $[32]!==t12||$[33]!==t15?(t16=/* @__PURE__ */jsx(StyledTextArea,{"data-ui":"TextArea",children:/* @__PURE__ */jsxs(InputRoot$1,{children:[t12,t15]})}),$[32]=t12,$[33]=t15,$[34]=t16):t16=$[34],t16;});TextArea.displayName="ForwardRef(TextArea)";const CLEAR_BUTTON_BOX_STYLE={zIndex:2},StyledTextInput=/* @__PURE__ */styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"StyledTextInput",componentId:"sc-h62wco-0"})(textInputRootStyle),InputRoot=styled.span.withConfig({displayName:"InputRoot",componentId:"sc-h62wco-1"})(_templateObject48||(_templateObject48=_taggedTemplateLiteral(["flex:1;min-width:0;display:block;position:relative;"]))),Prefix=styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"Prefix",componentId:"sc-h62wco-2"})(_templateObject49||(_templateObject49=_taggedTemplateLiteral(["border-top-right-radius:0;border-bottom-right-radius:0;& > span{display:block;margin:-1px;}"]))),Suffix=styled(Card).attrs({forwardedAs:"span"}).withConfig({displayName:"Suffix",componentId:"sc-h62wco-3"})(_templateObject50||(_templateObject50=_taggedTemplateLiteral(["border-top-left-radius:0;border-bottom-left-radius:0;& > span{display:block;margin:-1px;}"]))),Input=/* @__PURE__ */styled.input.withConfig({displayName:"Input",componentId:"sc-h62wco-4"})(responsiveInputPaddingStyle,textInputBaseStyle,textInputFontSizeStyle),Presentation=/* @__PURE__ */styled.span.withConfig({displayName:"Presentation",componentId:"sc-h62wco-5"})(responsiveRadiusStyle,textInputRepresentationStyle),LeftBox=styled(Box).withConfig({displayName:"LeftBox",componentId:"sc-h62wco-6"})(_templateObject51||(_templateObject51=_taggedTemplateLiteral(["position:absolute;top:0;left:0;"]))),RightBox=styled(Box).withConfig({displayName:"RightBox",componentId:"sc-h62wco-7"})(_templateObject52||(_templateObject52=_taggedTemplateLiteral(["position:absolute;top:0;right:0;"]))),RightCard=styled(Card).withConfig({displayName:"RightCard",componentId:"sc-h62wco-8"})(_templateObject53||(_templateObject53=_taggedTemplateLiteral(["background-color:transparent;position:absolute;top:0;right:0;"]))),TextInputClearButton=/* @__PURE__ */styled(Button).withConfig({displayName:"TextInputClearButton",componentId:"sc-h62wco-9"})({"&:not([hidden])":{display:"block"}}),TextInput=forwardRef(function(props,forwardedRef){var _props26;const $=dist.c(92);let IconComponent,IconRightComponent,__unstable_disableFocusRing,clearButton,customValidity,onClear,prefix,readOnly,restProps,suffix,t0,t1,t2,t3,t4,t5,t6,weight;$[0]!==props?(_props26=props,{__unstable_disableFocusRing,border:t0,clearButton,disabled:t1,fontSize:t2,icon:IconComponent,iconRight:IconRightComponent,onClear,padding:t3,prefix,radius:t4,readOnly,space:t5,suffix,customValidity,type:t6,weight}=_props26,restProps=_objectWithoutProperties(_props26,_excluded43),_props26,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=__unstable_disableFocusRing,$[4]=clearButton,$[5]=customValidity,$[6]=onClear,$[7]=prefix,$[8]=readOnly,$[9]=restProps,$[10]=suffix,$[11]=t0,$[12]=t1,$[13]=t2,$[14]=t3,$[15]=t4,$[16]=t5,$[17]=t6,$[18]=weight):(IconComponent=$[1],IconRightComponent=$[2],__unstable_disableFocusRing=$[3],clearButton=$[4],customValidity=$[5],onClear=$[6],prefix=$[7],readOnly=$[8],restProps=$[9],suffix=$[10],t0=$[11],t1=$[12],t2=$[13],t3=$[14],t4=$[15],t5=$[16],t6=$[17],weight=$[18]);const border2=t0===void 0?!0:t0,disabled=t1===void 0?!1:t1,fontSizeProp=t2===void 0?2:t2,paddingProp=t3===void 0?3:t3,radiusProp=t4===void 0?2:t4,spaceProp=t5===void 0?3:t5,type=t6===void 0?"text":t6,ref=useRef$1(null),rootTheme=useRootTheme();let t7;$[19]!==fontSizeProp?(t7=_getArrayProp(fontSizeProp),$[19]=fontSizeProp,$[20]=t7):t7=$[20];const fontSize2=t7;let t8;$[21]!==paddingProp?(t8=_getArrayProp(paddingProp),$[21]=paddingProp,$[22]=t8):t8=$[22];const padding=t8;let t9;$[23]!==radiusProp?(t9=_getArrayProp(radiusProp),$[23]=radiusProp,$[24]=t9):t9=$[24];const radius=t9;let t10;$[25]!==spaceProp?(t10=_getArrayProp(spaceProp),$[25]=spaceProp,$[26]=t10):t10=$[26];const space=t10,$hasClearButton=!!clearButton,$hasIcon=!!IconComponent,$hasIconRight=!!IconRightComponent,$hasSuffix=!!suffix,$hasPrefix=!!prefix;let t11;$[27]===Symbol.for("react.memo_cache_sentinel")?(t11=()=>ref.current,$[27]=t11):t11=$[27],useImperativeHandle(forwardedRef,t11),useCustomValidity(ref,customValidity);const handleClearMouseDown=_temp$2$1;let t12;$[28]!==onClear?(t12=event_0=>{var _ref$current2;event_0.preventDefault(),event_0.stopPropagation(),onClear&&onClear(),(_ref$current2=ref.current)===null||_ref$current2===void 0?void 0:_ref$current2.focus();},$[28]=onClear,$[29]=t12):t12=$[29];const handleClearClick=t12;let t13;$[30]!==prefix||$[31]!==radius?(t13=prefix&&/* @__PURE__ */jsx(Prefix,{borderTop:!0,borderLeft:!0,borderBottom:!0,radius,sizing:"border",tone:"inherit",children:/* @__PURE__ */jsx("span",{children:prefix})}),$[30]=prefix,$[31]=radius,$[32]=t13):t13=$[32];const prefixNode=t13,t14=border2?"":void 0;let t15;$[33]!==IconComponent||$[34]!==fontSize2||$[35]!==padding?(t15=IconComponent&&/* @__PURE__ */jsx(LeftBox,{padding,children:/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]})}),$[33]=IconComponent,$[34]=fontSize2,$[35]=padding,$[36]=t15):t15=$[36];let t16;$[37]!==$hasClearButton||$[38]!==IconRightComponent||$[39]!==fontSize2||$[40]!==padding?(t16=!$hasClearButton&&IconRightComponent&&/* @__PURE__ */jsx(RightBox,{padding,children:/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})}),$[37]=$hasClearButton,$[38]=IconRightComponent,$[39]=fontSize2,$[40]=padding,$[41]=t16):t16=$[41];let t17;$[42]!==$hasPrefix||$[43]!==$hasSuffix||$[44]!==__unstable_disableFocusRing||$[45]!==radius||$[46]!==rootTheme.scheme||$[47]!==rootTheme.tone||$[48]!==t14||$[49]!==t15||$[50]!==t16?(t17=/* @__PURE__ */jsxs(Presentation,{$hasPrefix,$unstableDisableFocusRing:__unstable_disableFocusRing,$hasSuffix,$radius:radius,$scheme:rootTheme.scheme,$tone:rootTheme.tone,"data-border":t14,"data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone,children:[t15,t16]}),$[42]=$hasPrefix,$[43]=$hasSuffix,$[44]=__unstable_disableFocusRing,$[45]=radius,$[46]=rootTheme.scheme,$[47]=rootTheme.tone,$[48]=t14,$[49]=t15,$[50]=t16,$[51]=t17):t17=$[51];const presentationNode=t17;let t18;$[52]!==padding?(t18=padding.map(_temp2),$[52]=padding,$[53]=t18):t18=$[53];const clearButtonBoxPadding=t18;let t19;$[54]!==padding?(t19=padding.map(_temp3),$[54]=padding,$[55]=t19):t19=$[55];const clearButtonPadding=t19,clearButtonProps=typeof clearButton=="object"?clearButton:EMPTY_RECORD;let t20;$[56]!==clearButton||$[57]!==clearButtonBoxPadding||$[58]!==clearButtonPadding||$[59]!==clearButtonProps||$[60]!==customValidity||$[61]!==disabled||$[62]!==fontSize2||$[63]!==handleClearClick||$[64]!==radius||$[65]!==readOnly?(t20=!disabled&&!readOnly&&clearButton&&/* @__PURE__ */jsx(RightCard,{forwardedAs:"span",padding:clearButtonBoxPadding,style:CLEAR_BUTTON_BOX_STYLE,tone:customValidity?"critical":"inherit",children:/* @__PURE__ */jsx(TextInputClearButton,_objectSpread(_objectSpread({"aria-label":"Clear","data-qa":"clear-button",fontSize:fontSize2,icon:CloseIcon,mode:"bleed",padding:clearButtonPadding,radius},clearButtonProps),{},{onClick:handleClearClick,onMouseDown:handleClearMouseDown}))}),$[56]=clearButton,$[57]=clearButtonBoxPadding,$[58]=clearButtonPadding,$[59]=clearButtonProps,$[60]=customValidity,$[61]=disabled,$[62]=fontSize2,$[63]=handleClearClick,$[64]=radius,$[65]=readOnly,$[66]=t20):t20=$[66];const clearButtonNode=t20;let t21;$[67]!==radius||$[68]!==suffix?(t21=suffix&&/* @__PURE__ */jsx(Suffix,{borderTop:!0,borderRight:!0,borderBottom:!0,radius,sizing:"border",tone:"inherit",children:/* @__PURE__ */jsx("span",{children:suffix})}),$[67]=radius,$[68]=suffix,$[69]=t21):t21=$[69];const suffixNode=t21,t22=$hasIconRight||$hasClearButton;let t23;$[70]!==$hasIcon||$[71]!==disabled||$[72]!==fontSize2||$[73]!==padding||$[74]!==readOnly||$[75]!==restProps||$[76]!==rootTheme.scheme||$[77]!==rootTheme.tone||$[78]!==space||$[79]!==t22||$[80]!==type||$[81]!==weight?(t23=/* @__PURE__ */jsx(Input,_objectSpread(_objectSpread({"data-as":"input","data-scheme":rootTheme.scheme,"data-tone":rootTheme.tone},restProps),{},{$fontSize:fontSize2,$iconLeft:$hasIcon,$iconRight:t22,$padding:padding,$scheme:rootTheme.scheme,$space:space,$tone:rootTheme.tone,$weight:weight,disabled,readOnly,ref,type})),$[70]=$hasIcon,$[71]=disabled,$[72]=fontSize2,$[73]=padding,$[74]=readOnly,$[75]=restProps,$[76]=rootTheme.scheme,$[77]=rootTheme.tone,$[78]=space,$[79]=t22,$[80]=type,$[81]=weight,$[82]=t23):t23=$[82];let t24;$[83]!==clearButtonNode||$[84]!==presentationNode||$[85]!==t23?(t24=/* @__PURE__ */jsxs(InputRoot,{children:[t23,presentationNode,clearButtonNode]}),$[83]=clearButtonNode,$[84]=presentationNode,$[85]=t23,$[86]=t24):t24=$[86];let t25;return $[87]!==prefixNode||$[88]!==rootTheme.tone||$[89]!==suffixNode||$[90]!==t24?(t25=/* @__PURE__ */jsxs(StyledTextInput,{"data-ui":"TextInput",tone:rootTheme.tone,children:[prefixNode,t24,suffixNode]}),$[87]=prefixNode,$[88]=rootTheme.tone,$[89]=suffixNode,$[90]=t24,$[91]=t25):t25=$[91],t25;});TextInput.displayName="ForwardRef(TextInput)";function _temp$2$1(event){event.preventDefault(),event.stopPropagation();}function _temp2(v){return v===0?0:v===1||v===2?1:v-2;}function _temp3(v_0){return v_0===0||v_0===1?0:v_0===2?1:v_0-1;}function useDelayedState(initialState){const $=dist.c(3),[state,setState]=useState(initialState),delayedAction=useRef$1(void 0);let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=(nextState,delay)=>{const action=()=>{setState(nextState);};if(delayedAction.current&&(clearTimeout(delayedAction.current),delayedAction.current=void 0),!delay)return action();delayedAction.current=setTimeout(action,delay);},$[0]=t0):t0=$[0];const onStateChange=t0;let t1;return $[1]!==state?(t1=[state,onStateChange],$[1]=state,$[2]=t1):t1=$[2],t1;}const DEFAULT_TOOLTIP_ARROW_WIDTH=15,DEFAULT_TOOLTIP_ARROW_HEIGHT=6,DEFAULT_TOOLTIP_ARROW_RADIUS=2,DEFAULT_TOOLTIP_DISTANCE=4,DEFAULT_TOOLTIP_PADDING=4,DEFAULT_FALLBACK_PLACEMENTS={top:["top-end","top-start","bottom","left","right"],"top-start":["top","top-end","bottom-start","left-start","right-start"],"top-end":["top","top-start","bottom-end","left-end","right-end"],bottom:["bottom-end","bottom-start","top","left","right"],"bottom-start":["bottom","bottom-end","top-start","left-start","right-start"],"bottom-end":["bottom","bottom-start","top-end","left-end","right-end"],left:["left-end","left-start","right","top","bottom"],"left-start":["left","left-end","right-start","top-start","bottom-start"],"left-end":["left","left-start","right-end","top-end","bottom-end"],right:["right-end","right-start","left","top","bottom"],"right-start":["right","right-end","left-start","top-start","bottom-start"],"right-end":["right","right-start","left-end","top-end","bottom-end"]},MotionCard=styled(motion.create(Card)).withConfig({displayName:"MotionCard",componentId:"sc-1xn138w-0"})(_templateObject54||(_templateObject54=_taggedTemplateLiteral(["will-change:transform;"]))),TooltipCard=forwardRef(function(props,ref){var _props27;const $=dist.c(48);let animate,arrow2,arrowRef,arrowX,arrowY,children,originX,originY,padding,placement,radius,restProps,scheme,shadow,style;$[0]!==props?(_props27=props,{animate,arrow:arrow2,arrowRef,arrowX,arrowY,children,originX,originY,padding,placement,radius,scheme,shadow,style}=_props27,restProps=_objectWithoutProperties(_props27,_excluded44),_props27,$[0]=props,$[1]=animate,$[2]=arrow2,$[3]=arrowRef,$[4]=arrowX,$[5]=arrowY,$[6]=children,$[7]=originX,$[8]=originY,$[9]=padding,$[10]=placement,$[11]=radius,$[12]=restProps,$[13]=scheme,$[14]=shadow,$[15]=style):(animate=$[1],arrow2=$[2],arrowRef=$[3],arrowX=$[4],arrowY=$[5],children=$[6],originX=$[7],originY=$[8],padding=$[9],placement=$[10],radius=$[11],restProps=$[12],scheme=$[13],shadow=$[14],style=$[15]);const t0=animate?"transform":void 0;let t1;$[16]!==originX||$[17]!==originY||$[18]!==style||$[19]!==t0?(t1=_objectSpread({originX,originY,willChange:t0},style),$[16]=originX,$[17]=originY,$[18]=style,$[19]=t0,$[20]=t1):t1=$[20];const rootStyle2=t1,t2=arrowX!==null?arrowX:void 0,t3=arrowY!==null?arrowY:void 0;let t4;$[21]!==t2||$[22]!==t3?(t4={left:t2,top:t3,right:void 0,bottom:void 0},$[21]=t2,$[22]=t3,$[23]=t4):t4=$[23];const arrowStyle=t4,t5=restProps;let t6;$[24]!==animate?(t6=animate?["hidden","initial"]:void 0,$[24]=animate,$[25]=t6):t6=$[25];let t7;$[26]!==animate?(t7=animate?["visible","scaleIn"]:void 0,$[26]=animate,$[27]=t7):t7=$[27];let t8;$[28]!==animate?(t8=animate?["hidden","scaleOut"]:void 0,$[28]=animate,$[29]=t8):t8=$[29];let t9;$[30]!==arrow2||$[31]!==arrowRef||$[32]!==arrowStyle?(t9=arrow2&&/* @__PURE__ */jsx(Arrow,{ref:arrowRef,style:arrowStyle,width:DEFAULT_TOOLTIP_ARROW_WIDTH,height:DEFAULT_TOOLTIP_ARROW_HEIGHT,radius:DEFAULT_TOOLTIP_ARROW_RADIUS}),$[30]=arrow2,$[31]=arrowRef,$[32]=arrowStyle,$[33]=t9):t9=$[33];let t10;return $[34]!==children||$[35]!==padding||$[36]!==placement||$[37]!==radius||$[38]!==ref||$[39]!==rootStyle2||$[40]!==scheme||$[41]!==shadow||$[42]!==t5||$[43]!==t6||$[44]!==t7||$[45]!==t8||$[46]!==t9?(t10=/* @__PURE__ */jsxs(MotionCard,_objectSpread(_objectSpread({"data-ui":"Tooltip__card"},t5),{},{"data-placement":placement,padding,radius,ref,scheme,shadow,style:rootStyle2,variants:POPOVER_MOTION_PROPS.card,transition:POPOVER_MOTION_PROPS.transition,initial:t6,animate:t7,exit:t8,children:[children,t9]})),$[34]=children,$[35]=padding,$[36]=placement,$[37]=radius,$[38]=ref,$[39]=rootStyle2,$[40]=scheme,$[41]=shadow,$[42]=t5,$[43]=t6,$[44]=t7,$[45]=t8,$[46]=t9,$[47]=t10):t10=$[47],t10;});TooltipCard.displayName="ForwardRef(TooltipCard)";const TooltipDelayGroupContext=createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup",null);function useTooltipDelayGroup(){return useContext(TooltipDelayGroupContext);}const StyledTooltip=styled(Layer).withConfig({displayName:"StyledTooltip",componentId:"sc-13f2zvh-0"})(_templateObject55||(_templateObject55=_taggedTemplateLiteral(["pointer-events:none;"]))),Tooltip=forwardRef(function(props,forwardedRef){var _props28,_props$placement2,_portal$elements2,_middlewareData$arrow4,_middlewareData$arrow5,_middlewareData$Sani3,_middlewareData$Sani4,_delay2,_delay3,_childProp,_childProp3,_childProp4,_childProp6,_childProp7,_childProp9,_childProp0,_childProp10,_childProp11,_childProp13,_childProp14,_childProp16;const $=dist.c(137),boundaryElementContext=useBoundaryElement(),{layer}=useTheme_v2();let _boundaryElement,_fallbackPlacementsProp,_zOffset,childProp,content,delay,disabled,portalProp,restProps,scheme,t0,t1,t2,t3,t4,t5;$[0]!==props?(_props28=props,{animate:t0,arrow:t1,boundaryElement:_boundaryElement,children:childProp,content,disabled,fallbackPlacements:_fallbackPlacementsProp,padding:t2,placement:t3,portal:portalProp,radius:t4,scheme,shadow:t5,zOffset:_zOffset,delay}=_props28,restProps=_objectWithoutProperties(_props28,_excluded45),_props28,$[0]=props,$[1]=_boundaryElement,$[2]=_fallbackPlacementsProp,$[3]=_zOffset,$[4]=childProp,$[5]=content,$[6]=delay,$[7]=disabled,$[8]=portalProp,$[9]=restProps,$[10]=scheme,$[11]=t0,$[12]=t1,$[13]=t2,$[14]=t3,$[15]=t4,$[16]=t5):(_boundaryElement=$[1],_fallbackPlacementsProp=$[2],_zOffset=$[3],childProp=$[4],content=$[5],delay=$[6],disabled=$[7],portalProp=$[8],restProps=$[9],scheme=$[10],t0=$[11],t1=$[12],t2=$[13],t3=$[14],t4=$[15],t5=$[16]);const _animate=t0===void 0?!1:t0,arrowProp=t1===void 0?!1:t1,padding=t2===void 0?2:t2,placementProp=t3===void 0?"bottom":t3,radius=t4===void 0?2:t4,shadow=t5===void 0?2:t5,boundaryElement=_boundaryElement!==null&&_boundaryElement!==void 0?_boundaryElement:boundaryElementContext===null||boundaryElementContext===void 0?void 0:boundaryElementContext.element,fallbackPlacementsProp=_fallbackPlacementsProp!==null&&_fallbackPlacementsProp!==void 0?_fallbackPlacementsProp:DEFAULT_FALLBACK_PLACEMENTS[(_props$placement2=props.placement)!==null&&_props$placement2!==void 0?_props$placement2:"bottom"],zOffset=_zOffset!==null&&_zOffset!==void 0?_zOffset:layer.tooltip.zOffset,animate=usePrefersReducedMotion()?!1:_animate;let t6;$[17]!==fallbackPlacementsProp?(t6=_getArrayProp(fallbackPlacementsProp),$[17]=fallbackPlacementsProp,$[18]=t6):t6=$[18];const fallbackPlacements=t6,ref=useRef$1(null),[referenceElement,setReferenceElement]=useState(null),arrowRef=useRef$1(null),[tooltipMaxWidth,setTooltipMaxWidth]=useState(0);let t7;$[19]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>ref.current,$[19]=t7):t7=$[19],useImperativeHandle(forwardedRef,t7);const portal=usePortal(),portalElement=typeof portalProp=="string"?((_portal$elements2=portal.elements)===null||_portal$elements2===void 0?void 0:_portal$elements2[portalProp])||null:portal.element;let t8;$[20]!==animate||$[21]!==arrowProp||$[22]!==boundaryElement||$[23]!==fallbackPlacements?(t8={animate,arrowProp,arrowRef,boundaryElement,fallbackPlacements,rootBoundary:"viewport"},$[20]=animate,$[21]=arrowProp,$[22]=boundaryElement,$[23]=fallbackPlacements,$[24]=t8):t8=$[24];const middleware=useMiddleware(t8);let t9;$[25]!==referenceElement?(t9={reference:referenceElement},$[25]=referenceElement,$[26]=t9):t9=$[26];let t10;$[27]!==middleware||$[28]!==placementProp||$[29]!==t9?(t10={middleware,placement:placementProp,whileElementsMounted:autoUpdate,elements:t9},$[27]=middleware,$[28]=placementProp,$[29]=t9,$[30]=t10):t10=$[30];const{floatingStyles,placement,middlewareData,refs,update}=useFloating(t10),arrowX=(_middlewareData$arrow4=middlewareData.arrow)===null||_middlewareData$arrow4===void 0?void 0:_middlewareData$arrow4.x,arrowY=(_middlewareData$arrow5=middlewareData.arrow)===null||_middlewareData$arrow5===void 0?void 0:_middlewareData$arrow5.y,originX=(_middlewareData$Sani3=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani3===void 0?void 0:_middlewareData$Sani3.originX,originY=(_middlewareData$Sani4=middlewareData["@sanity/ui/origin"])===null||_middlewareData$Sani4===void 0?void 0:_middlewareData$Sani4.originY,tooltipId=useId(),[isOpen,setIsOpen]=useDelayedState(!1),delayGroupContext=useTooltipDelayGroup();let t11;$[31]!==delayGroupContext?(t11=delayGroupContext||{},$[31]=delayGroupContext,$[32]=t11):t11=$[32];const{setIsGroupActive,setOpenTooltipId}=t11,showTooltip=isOpen||(delayGroupContext===null||delayGroupContext===void 0?void 0:delayGroupContext.openTooltipId)===tooltipId,isInsideGroup=delayGroupContext!==null,openDelayProp=typeof delay=="number"?delay:((_delay2=delay)===null||_delay2===void 0?void 0:_delay2.open)||0,closeDelayProp=typeof delay=="number"?delay:((_delay3=delay)===null||_delay3===void 0?void 0:_delay3.close)||0,openDelay=isInsideGroup?delayGroupContext.openDelay:openDelayProp,closeDelay=isInsideGroup?delayGroupContext.closeDelay:closeDelayProp;let t12;$[33]!==closeDelay||$[34]!==isInsideGroup||$[35]!==openDelay||$[36]!==setIsGroupActive||$[37]!==setIsOpen||$[38]!==setOpenTooltipId||$[39]!==tooltipId?(t12=(open,immediate)=>{if(isInsideGroup){if(open){const groupedOpenDelay=immediate?0:openDelay;setIsGroupActive!==null&&setIsGroupActive!==void 0&&setIsGroupActive(open,groupedOpenDelay),setOpenTooltipId===null||setOpenTooltipId===void 0?void 0:setOpenTooltipId(tooltipId,groupedOpenDelay);}else{const groupDeactivateDelay=closeDelay>200?closeDelay:200;setIsGroupActive!==null&&setIsGroupActive!==void 0&&setIsGroupActive(open,groupDeactivateDelay),setOpenTooltipId===null||setOpenTooltipId===void 0?void 0:setOpenTooltipId(null,immediate?0:closeDelay);}}else setIsOpen(open,immediate?0:open?openDelay:closeDelay);},$[33]=closeDelay,$[34]=isInsideGroup,$[35]=openDelay,$[36]=setIsGroupActive,$[37]=setIsOpen,$[38]=setOpenTooltipId,$[39]=tooltipId,$[40]=t12):t12=$[40];const handleIsOpenChange=t12;let t13;$[41]!==((_childProp=childProp)===null||_childProp===void 0?void 0:_childProp.props)||$[42]!==handleIsOpenChange?(t13=e=>{var _childProp2,_childProp2$onBlur;handleIsOpenChange(!1),(_childProp2=childProp)===null||_childProp2===void 0||(_childProp2=_childProp2.props)===null||_childProp2===void 0||(_childProp2$onBlur=_childProp2.onBlur)===null||_childProp2$onBlur===void 0?void 0:_childProp2$onBlur.call(_childProp2,e);},$[41]=(_childProp3=childProp)===null||_childProp3===void 0?void 0:_childProp3.props,$[42]=handleIsOpenChange,$[43]=t13):t13=$[43];const handleBlur=t13;let t14;$[44]!==((_childProp4=childProp)===null||_childProp4===void 0?void 0:_childProp4.props)||$[45]!==handleIsOpenChange?(t14=e_0=>{var _childProp5,_childProp5$props$onC,_childProp5$props;handleIsOpenChange(!1,!0),(_childProp5=childProp)===null||_childProp5===void 0||(_childProp5$props$onC=(_childProp5$props=_childProp5.props).onClick)===null||_childProp5$props$onC===void 0?void 0:_childProp5$props$onC.call(_childProp5$props,e_0);},$[44]=(_childProp6=childProp)===null||_childProp6===void 0?void 0:_childProp6.props,$[45]=handleIsOpenChange,$[46]=t14):t14=$[46];const handleClick=t14;let t15;$[47]!==((_childProp7=childProp)===null||_childProp7===void 0?void 0:_childProp7.props)||$[48]!==handleIsOpenChange?(t15=e_1=>{var _childProp8,_childProp8$props$onC,_childProp8$props;handleIsOpenChange(!1,!0),(_childProp8=childProp)===null||_childProp8===void 0||(_childProp8$props$onC=(_childProp8$props=_childProp8.props).onContextMenu)===null||_childProp8$props$onC===void 0?void 0:_childProp8$props$onC.call(_childProp8$props,e_1);},$[47]=(_childProp9=childProp)===null||_childProp9===void 0?void 0:_childProp9.props,$[48]=handleIsOpenChange,$[49]=t15):t15=$[49];const handleContextMenu=t15;let t16;$[50]!==((_childProp0=childProp)===null||_childProp0===void 0?void 0:_childProp0.props)||$[51]!==handleIsOpenChange?(t16=e_2=>{var _childProp1,_childProp1$onFocus;handleIsOpenChange(!0),(_childProp1=childProp)===null||_childProp1===void 0||(_childProp1=_childProp1.props)===null||_childProp1===void 0||(_childProp1$onFocus=_childProp1.onFocus)===null||_childProp1$onFocus===void 0?void 0:_childProp1$onFocus.call(_childProp1,e_2);},$[50]=(_childProp10=childProp)===null||_childProp10===void 0?void 0:_childProp10.props,$[51]=handleIsOpenChange,$[52]=t16):t16=$[52];const handleFocus=t16;let t17;$[53]!==((_childProp11=childProp)===null||_childProp11===void 0?void 0:_childProp11.props)||$[54]!==handleIsOpenChange?(t17=e_3=>{var _childProp12,_childProp12$onMouseE;handleIsOpenChange(!0),(_childProp12=childProp)===null||_childProp12===void 0||(_childProp12=_childProp12.props)===null||_childProp12===void 0||(_childProp12$onMouseE=_childProp12.onMouseEnter)===null||_childProp12$onMouseE===void 0?void 0:_childProp12$onMouseE.call(_childProp12,e_3);},$[53]=(_childProp13=childProp)===null||_childProp13===void 0?void 0:_childProp13.props,$[54]=handleIsOpenChange,$[55]=t17):t17=$[55];const handleMouseEnter=t17;let t18;$[56]!==((_childProp14=childProp)===null||_childProp14===void 0?void 0:_childProp14.props)||$[57]!==handleIsOpenChange?(t18=e_4=>{var _childProp15,_childProp15$onMouseL;handleIsOpenChange(!1),(_childProp15=childProp)===null||_childProp15===void 0||(_childProp15=_childProp15.props)===null||_childProp15===void 0||(_childProp15$onMouseL=_childProp15.onMouseLeave)===null||_childProp15$onMouseL===void 0?void 0:_childProp15$onMouseL.call(_childProp15,e_4);},$[56]=(_childProp16=childProp)===null||_childProp16===void 0?void 0:_childProp16.props,$[57]=handleIsOpenChange,$[58]=t18):t18=$[58];const handleMouseLeave=t18;let t19;$[59]!==handleIsOpenChange||$[60]!==isInsideGroup||$[61]!==referenceElement||$[62]!==showTooltip?(t19={handleIsOpenChange,referenceElement,showTooltip,isInsideGroup},$[59]=handleIsOpenChange,$[60]=isInsideGroup,$[61]=referenceElement,$[62]=showTooltip,$[63]=t19):t19=$[63],useCloseOnMouseLeave(t19);let t20,t21;$[64]!==disabled||$[65]!==handleIsOpenChange||$[66]!==showTooltip?(t20=()=>{disabled&&showTooltip&&handleIsOpenChange(!1);},t21=[disabled,handleIsOpenChange,showTooltip],$[64]=disabled,$[65]=handleIsOpenChange,$[66]=showTooltip,$[67]=t20,$[68]=t21):(t20=$[67],t21=$[68]),useEffect$1(t20,t21);let t22,t23;$[69]!==content||$[70]!==handleIsOpenChange||$[71]!==showTooltip?(t22=()=>{!content&&showTooltip&&handleIsOpenChange(!1);},t23=[content,handleIsOpenChange,showTooltip],$[69]=content,$[70]=handleIsOpenChange,$[71]=showTooltip,$[72]=t22,$[73]=t23):(t22=$[72],t23=$[73]),useEffect$1(t22,t23);let t24,t25;$[74]!==handleIsOpenChange||$[75]!==showTooltip?(t24=()=>{if(!showTooltip)return;const handleWindowKeyDown=function(event){event.key==="Escape"&&handleIsOpenChange(!1,!0);};return window.addEventListener("keydown",handleWindowKeyDown),()=>{window.removeEventListener("keydown",handleWindowKeyDown);};},t25=[handleIsOpenChange,showTooltip],$[74]=handleIsOpenChange,$[75]=showTooltip,$[76]=t24,$[77]=t25):(t24=$[76],t25=$[77]),useEffect$1(t24,t25);let t26;$[78]!==boundaryElement||$[79]!==(portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth)?(t26=()=>{const availableWidths=[...(boundaryElement?[boundaryElement.offsetWidth]:[]),(portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth)||document.body.offsetWidth];setTooltipMaxWidth(Math.min(...availableWidths)-DEFAULT_TOOLTIP_PADDING*2);},$[78]=boundaryElement,$[79]=portalElement===null||portalElement===void 0?void 0:portalElement.offsetWidth,$[80]=t26):t26=$[80];let t27;$[81]!==boundaryElement||$[82]!==portalElement?(t27=[boundaryElement,portalElement],$[81]=boundaryElement,$[82]=portalElement,$[83]=t27):t27=$[83],useLayoutEffect(t26,t27);let t28;$[84]!==update?(t28=arrowEl=>{arrowRef.current=arrowEl,update();},$[84]=update,$[85]=t28):t28=$[85];const setArrow=t28;let t29;$[86]!==refs?(t29=node=>{ref.current=node,refs.setFloating(node);},$[86]=refs,$[87]=t29):t29=$[87];const setFloating=t29;let t30;bb0:{if(!childProp){t30=null;break bb0;}let t312;$[88]!==childProp||$[89]!==handleBlur||$[90]!==handleClick||$[91]!==handleContextMenu||$[92]!==handleFocus||$[93]!==handleMouseEnter||$[94]!==handleMouseLeave?(t312=cloneElement(childProp,{onBlur:handleBlur,onFocus:handleFocus,onMouseEnter:handleMouseEnter,onMouseLeave:handleMouseLeave,onClick:handleClick,onContextMenu:handleContextMenu,ref:setReferenceElement}),$[88]=childProp,$[89]=handleBlur,$[90]=handleClick,$[91]=handleContextMenu,$[92]=handleFocus,$[93]=handleMouseEnter,$[94]=handleMouseLeave,$[95]=t312):t312=$[95],t30=t312;}const child=t30;let t31;$[96]!==childProp?(t31=childProp?getElementRef(childProp):null,$[96]=childProp,$[97]=t31):t31=$[97];let t32,t33;if($[98]!==referenceElement?(t32=()=>referenceElement,t33=[referenceElement],$[98]=referenceElement,$[99]=t32,$[100]=t33):(t32=$[99],t33=$[100]),useImperativeHandle(t31,t32,t33),!child){let t342;return $[101]===Symbol.for("react.memo_cache_sentinel")?(t342=/* @__PURE__ */jsx(Fragment,{}),$[101]=t342):t342=$[101],t342;}if(disabled)return child;const t34=tooltipMaxWidth>0?"".concat(tooltipMaxWidth,"px"):void 0;let t35;$[102]!==floatingStyles||$[103]!==t34?(t35=_objectSpread(_objectSpread({},floatingStyles),{},{maxWidth:t34}),$[102]=floatingStyles,$[103]=t34,$[104]=t35):t35=$[104];let t36;$[105]!==animate||$[106]!==arrowProp||$[107]!==arrowX||$[108]!==arrowY||$[109]!==content||$[110]!==originX||$[111]!==originY||$[112]!==padding||$[113]!==placement||$[114]!==radius||$[115]!==restProps||$[116]!==scheme||$[117]!==setArrow||$[118]!==setFloating||$[119]!==shadow?(t36=/* @__PURE__ */jsx(TooltipCard,_objectSpread(_objectSpread({},restProps),{},{animate,arrow:arrowProp,arrowRef:setArrow,arrowX,arrowY,originX,originY,padding,placement,radius,ref:setFloating,scheme,shadow,children:content})),$[105]=animate,$[106]=arrowProp,$[107]=arrowX,$[108]=arrowY,$[109]=content,$[110]=originX,$[111]=originY,$[112]=padding,$[113]=placement,$[114]=radius,$[115]=restProps,$[116]=scheme,$[117]=setArrow,$[118]=setFloating,$[119]=shadow,$[120]=t36):t36=$[120];let t37;$[121]!==restProps||$[122]!==setFloating||$[123]!==t35||$[124]!==t36||$[125]!==zOffset?(t37=/* @__PURE__ */jsx(StyledTooltip,_objectSpread(_objectSpread({"data-ui":"Tooltip"},restProps),{},{ref:setFloating,style:t35,zOffset,children:t36})),$[121]=restProps,$[122]=setFloating,$[123]=t35,$[124]=t36,$[125]=zOffset,$[126]=t37):t37=$[126];const tooltip=t37;let t38;$[127]!==portalProp||$[128]!==showTooltip||$[129]!==tooltip?(t38=showTooltip&&(portalProp?/* @__PURE__ */jsx(Portal,{__unstable_name:typeof portalProp=="string"?portalProp:void 0,children:tooltip}):tooltip),$[127]=portalProp,$[128]=showTooltip,$[129]=tooltip,$[130]=t38):t38=$[130];const children=t38;let t39;$[131]!==animate||$[132]!==children?(t39=animate?/* @__PURE__ */jsx(AnimatePresence,{children}):children,$[131]=animate,$[132]=children,$[133]=t39):t39=$[133];let t40;return $[134]!==child||$[135]!==t39?(t40=/* @__PURE__ */jsxs(Fragment,{children:[t39,child]}),$[134]=child,$[135]=t39,$[136]=t40):t40=$[136],t40;});Tooltip.displayName="ForwardRef(Tooltip)";function useMiddleware(t0){const $=dist.c(17),{animate,arrowProp,arrowRef,boundaryElement,fallbackPlacements,rootBoundary}=t0;let ret;if($[0]!==animate||$[1]!==arrowProp||$[2]!==arrowRef||$[3]!==boundaryElement||$[4]!==fallbackPlacements||$[5]!==rootBoundary){ret=[];const t1=boundaryElement||void 0;let t2;$[7]!==fallbackPlacements||$[8]!==rootBoundary||$[9]!==t1?(t2=flip({boundary:t1,fallbackPlacements,padding:DEFAULT_TOOLTIP_PADDING,rootBoundary}),$[7]=fallbackPlacements,$[8]=rootBoundary,$[9]=t1,$[10]=t2):t2=$[10],ret.push(t2);let t3;$[11]===Symbol.for("react.memo_cache_sentinel")?(t3=offset({mainAxis:DEFAULT_TOOLTIP_DISTANCE}),$[11]=t3):t3=$[11],ret.push(t3);const t4=boundaryElement||void 0;let t5;if($[12]!==rootBoundary||$[13]!==t4?(t5=shift({boundary:t4,rootBoundary,padding:DEFAULT_TOOLTIP_PADDING}),$[12]=rootBoundary,$[13]=t4,$[14]=t5):t5=$[14],ret.push(t5),arrowProp){let t6;$[15]!==arrowRef?(t6=arrow({element:arrowRef,padding:DEFAULT_TOOLTIP_PADDING}),$[15]=arrowRef,$[16]=t6):t6=$[16],ret.push(t6);}animate&&ret.push(origin),$[0]=animate,$[1]=arrowProp,$[2]=arrowRef,$[3]=boundaryElement,$[4]=fallbackPlacements,$[5]=rootBoundary,$[6]=ret;}else ret=$[6];return ret;}function useCloseOnMouseLeave(t0){const $=dist.c(10),{handleIsOpenChange,referenceElement,showTooltip,isInsideGroup}=t0;let t1;$[0]!==handleIsOpenChange||$[1]!==referenceElement?(t1=(target,teardown)=>{referenceElement&&(referenceElement===target||target instanceof Node&&referenceElement.contains(target)||(handleIsOpenChange(!1),teardown()));},$[0]=handleIsOpenChange,$[1]=referenceElement,$[2]=t1):t1=$[2];const onMouseMove=useEffectEvent(t1);let t2;$[3]!==isInsideGroup||$[4]!==onMouseMove||$[5]!==showTooltip?(t2=()=>{if(!showTooltip||isInsideGroup)return;const handleMouseMove=event=>{onMouseMove(event.target,()=>window.removeEventListener("mousemove",handleMouseMove));};return window.addEventListener("mousemove",handleMouseMove),()=>window.removeEventListener("mousemove",handleMouseMove);},$[3]=isInsideGroup,$[4]=onMouseMove,$[5]=showTooltip,$[6]=t2):t2=$[6];let t3;$[7]!==isInsideGroup||$[8]!==showTooltip?(t3=[isInsideGroup,showTooltip],$[7]=isInsideGroup,$[8]=showTooltip,$[9]=t3):t3=$[9],useEffect$1(t2,t3);}const StyledHotkeys=styled.kbd.withConfig({displayName:"StyledHotkeys",componentId:"sc-b37mge-0"})(_templateObject56||(_templateObject56=_taggedTemplateLiteral(["font:inherit;padding:1px;&:not([hidden]){display:block;}"]))),Key=styled(KBD).withConfig({displayName:"Key",componentId:"sc-b37mge-1"})(_templateObject57||(_templateObject57=_taggedTemplateLiteral(["&:not([hidden]){display:block;}"]))),Hotkeys=forwardRef(function(props,ref){var _props29;const $=dist.c(26);let fontSize2,keys,padding,radius,restProps,t0;$[0]!==props?(_props29=props,{fontSize:fontSize2,keys,padding,radius,space:t0}=_props29,restProps=_objectWithoutProperties(_props29,_excluded46),_props29,$[0]=props,$[1]=fontSize2,$[2]=keys,$[3]=padding,$[4]=radius,$[5]=restProps,$[6]=t0):(fontSize2=$[1],keys=$[2],padding=$[3],radius=$[4],restProps=$[5],t0=$[6]);const spaceProp=t0===void 0?0.5:t0;let t1;$[7]!==spaceProp?(t1=_getArrayProp(spaceProp),$[7]=spaceProp,$[8]=t1):t1=$[8];const space=t1;if(!keys||keys.length===0){let t22;return $[9]===Symbol.for("react.memo_cache_sentinel")?(t22=/* @__PURE__ */jsx(Fragment,{}),$[9]=t22):t22=$[9],t22;}let t2;if($[10]!==fontSize2||$[11]!==keys||$[12]!==padding||$[13]!==radius){let t32;$[15]!==fontSize2||$[16]!==padding||$[17]!==radius?(t32=(key2,i)=>/* @__PURE__ */jsx(Key,{fontSize:fontSize2,padding,radius,children:key2},i),$[15]=fontSize2,$[16]=padding,$[17]=radius,$[18]=t32):t32=$[18],t2=keys.map(t32),$[10]=fontSize2,$[11]=keys,$[12]=padding,$[13]=radius,$[14]=t2;}else t2=$[14];let t3;$[19]!==space||$[20]!==t2?(t3=/* @__PURE__ */jsx(Inline,{as:"span",space,children:t2}),$[19]=space,$[20]=t2,$[21]=t3):t3=$[21];let t4;return $[22]!==ref||$[23]!==restProps||$[24]!==t3?(t4=/* @__PURE__ */jsx(StyledHotkeys,_objectSpread(_objectSpread({"data-ui":"Hotkeys"},restProps),{},{ref,children:t3})),$[22]=ref,$[23]=restProps,$[24]=t3,$[25]=t4):t4=$[25],t4;});Hotkeys.displayName="ForwardRef(Hotkeys)";const MenuContext=createGlobalScopedContext("@sanity/ui/context/menu",null);function _isFocusable(element){return isHTMLAnchorElement(element)&&element.getAttribute("data-disabled")!=="true"||isHTMLButtonElement(element)&&!element.disabled;}function _getFocusableElements(elements){return elements.filter(_isFocusable);}function _getDOMPath(rootElement,el){const path=[];let e=el;for(;e!==rootElement;){const parentElement=e.parentElement;if(!parentElement)return path;const index=Array.from(parentElement.childNodes).indexOf(e);if(path.unshift(index),parentElement===rootElement)return path;e=parentElement;}return path;}const EMPTY_PATH=[];function _sortElements(rootElement,elements){if(!rootElement)return;const map=/* @__PURE__ */new WeakMap();for(const el of elements)map.set(el,_getDOMPath(rootElement,el));const _sort=(a,b)=>{const _a=map.get(a)||EMPTY_PATH,_b=map.get(b)||EMPTY_PATH,len=Math.max(_a.length,_b.length);for(let i=0;i<len;i+=1){const aIndex=_a[i]||-1,bIndex=_b[i]||-1;if(aIndex!==bIndex)return aIndex-bIndex;}return 0;};elements.sort(_sort);}function useMenuController(props){const $=dist.c(21),{onKeyDown,originElement,shouldFocus,rootElementRef}=props;let t0;$[0]===Symbol.for("react.memo_cache_sentinel")?(t0=[],$[0]=t0):t0=$[0];const elementsRef=useRef$1(t0),[activeIndex,_setActiveIndex]=useState(-1),activeIndexRef=useRef$1(activeIndex),[activeElement,setActiveElement]=useState(null);let t1;$[1]===Symbol.for("react.memo_cache_sentinel")?(t1=nextActiveIndex=>{_setActiveIndex(nextActiveIndex),activeIndexRef.current=nextActiveIndex,setActiveElement(elementsRef.current[nextActiveIndex]||null);},$[1]=t1):t1=$[1];const setActiveIndex=t1;let t2;$[2]!==rootElementRef?(t2=(element,selected)=>{if(!element)return _temp$1;if(elementsRef.current.indexOf(element)===-1&&(elementsRef.current.push(element),_sortElements(rootElementRef.current,elementsRef.current)),selected){const selectedIndex=elementsRef.current.indexOf(element);setActiveIndex(selectedIndex);}return()=>{const idx=elementsRef.current.indexOf(element);idx>-1&&elementsRef.current.splice(idx,1);};},$[2]=rootElementRef,$[3]=t2):t2=$[3];const mount=t2;let t3;$[4]!==onKeyDown||$[5]!==originElement?(t3=event=>{if(event.key==="Tab"){originElement&&originElement.focus();return;}if(event.key==="Home"){event.preventDefault(),event.stopPropagation();const el=_getFocusableElements(elementsRef.current)[0];if(!el)return;const currentIndex=elementsRef.current.indexOf(el);setActiveIndex(currentIndex);return;}if(event.key==="End"){event.preventDefault(),event.stopPropagation();const focusableElements_0=_getFocusableElements(elementsRef.current),el_0=focusableElements_0[focusableElements_0.length-1];if(!el_0)return;const currentIndex_0=elementsRef.current.indexOf(el_0);setActiveIndex(currentIndex_0);return;}if(event.key==="ArrowUp"){event.preventDefault(),event.stopPropagation();const focusableElements_1=_getFocusableElements(elementsRef.current),focusableLen=focusableElements_1.length;if(focusableLen===0)return;const focusedElement=elementsRef.current[activeIndexRef.current];let focusedIndex=focusableElements_1.indexOf(focusedElement);focusedIndex=(focusedIndex-1+focusableLen)%focusableLen;const el_1=focusableElements_1[focusedIndex],currentIndex_1=elementsRef.current.indexOf(el_1);setActiveIndex(currentIndex_1);return;}if(event.key==="ArrowDown"){event.preventDefault(),event.stopPropagation();const focusableElements_2=_getFocusableElements(elementsRef.current),focusableLen_0=focusableElements_2.length;if(focusableLen_0===0)return;const focusedElement_0=elementsRef.current[activeIndexRef.current];let focusedIndex_0=focusableElements_2.indexOf(focusedElement_0);focusedIndex_0=(focusedIndex_0+1)%focusableLen_0;const el_2=focusableElements_2[focusedIndex_0],currentIndex_2=elementsRef.current.indexOf(el_2);setActiveIndex(currentIndex_2);return;}onKeyDown&&onKeyDown(event);},$[4]=onKeyDown,$[5]=originElement,$[6]=t3):t3=$[6];const handleKeyDown=t3;let t4;$[7]===Symbol.for("react.memo_cache_sentinel")?(t4=event_0=>{const element_0=event_0.currentTarget,currentIndex_3=elementsRef.current.indexOf(element_0);setActiveIndex(currentIndex_3);},$[7]=t4):t4=$[7];const handleItemMouseEnter=t4;let t5;$[8]!==rootElementRef?(t5=()=>{var _rootElementRef$curre;setActiveIndex(-2),(_rootElementRef$curre=rootElementRef.current)===null||_rootElementRef$curre===void 0?void 0:_rootElementRef$curre.focus();},$[8]=rootElementRef,$[9]=t5):t5=$[9];const handleItemMouseLeave=t5;let t6,t7;$[10]!==activeIndex||$[11]!==rootElementRef||$[12]!==shouldFocus?(t6=()=>{if(!rootElementRef.current)return;const rafId=requestAnimationFrame(()=>{var _ref76;if(activeIndex===-1){if(shouldFocus==="first"){const el_3=_getFocusableElements(elementsRef.current)[0];if(el_3){const currentIndex_4=elementsRef.current.indexOf(el_3);setActiveIndex(currentIndex_4);}}if(shouldFocus==="last"){const focusableElements_4=_getFocusableElements(elementsRef.current),el_4=focusableElements_4[focusableElements_4.length-1];if(el_4){const currentIndex_5=elementsRef.current.indexOf(el_4);setActiveIndex(currentIndex_5);}}return;}(_ref76=elementsRef.current[activeIndex]||null)===null||_ref76===void 0||_ref76.focus();});return()=>cancelAnimationFrame(rafId);},t7=[activeIndex,rootElementRef,setActiveIndex,shouldFocus],$[10]=activeIndex,$[11]=rootElementRef,$[12]=shouldFocus,$[13]=t6,$[14]=t7):(t6=$[13],t7=$[14]),useEffect$1(t6,t7);let t8;return $[15]!==activeElement||$[16]!==activeIndex||$[17]!==handleItemMouseLeave||$[18]!==handleKeyDown||$[19]!==mount?(t8={activeElement,activeIndex,handleItemMouseEnter,handleItemMouseLeave,handleKeyDown,mount},$[15]=activeElement,$[16]=activeIndex,$[17]=handleItemMouseLeave,$[18]=handleKeyDown,$[19]=mount,$[20]=t8):t8=$[20],t8;}function _temp$1(){}const StyledMenu=styled(Box).withConfig({displayName:"StyledMenu",componentId:"sc-xt0tnv-0"})(_templateObject58||(_templateObject58=_taggedTemplateLiteral(["outline:none;overflow:auto;"]))),Menu=forwardRef(function(props,forwardedRef){const $=dist.c(49);let _shouldFocus,children,onClickOutside,onEscape,onItemClick,onItemSelect,onKeyDown,originElement,registerElement,restProps,t0,t1;if($[0]!==props){const{children:t22,focusFirst,focusLast,onClickOutside:t32,onEscape:t42,onItemClick:t52,onItemSelect:t62,onKeyDown:t72,originElement:t82,padding:t92,registerElement:t102,shouldFocus:t112,space:t122}=props,t13=_objectWithoutProperties(props,_excluded47);children=t22,onClickOutside=t32,onEscape=t42,onItemClick=t52,onItemSelect=t62,onKeyDown=t72,originElement=t82,t0=t92,registerElement=t102,_shouldFocus=t112,t1=t122,restProps=t13,$[0]=props,$[1]=_shouldFocus,$[2]=children,$[3]=onClickOutside,$[4]=onEscape,$[5]=onItemClick,$[6]=onItemSelect,$[7]=onKeyDown,$[8]=originElement,$[9]=registerElement,$[10]=restProps,$[11]=t0,$[12]=t1;}else _shouldFocus=$[1],children=$[2],onClickOutside=$[3],onEscape=$[4],onItemClick=$[5],onItemSelect=$[6],onKeyDown=$[7],originElement=$[8],registerElement=$[9],restProps=$[10],t0=$[11],t1=$[12];const padding=t0===void 0?1:t0,space=t1===void 0?1:t1,shouldFocus=_shouldFocus!==null&&_shouldFocus!==void 0?_shouldFocus:props.focusFirst&&"first"||props.focusLast&&"last"||null,ref=useRef$1(null);let t2;$[13]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>ref.current,$[13]=t2):t2=$[13],useImperativeHandle(forwardedRef,t2);const{isTopLayer}=useLayer();let t3;$[14]!==onKeyDown||$[15]!==originElement||$[16]!==shouldFocus?(t3={onKeyDown,originElement,shouldFocus,rootElementRef:ref},$[14]=onKeyDown,$[15]=originElement,$[16]=shouldFocus,$[17]=t3):t3=$[17];const{activeElement,activeIndex,handleItemMouseEnter,handleItemMouseLeave,handleKeyDown,mount}=useMenuController(t3),unregisterElementRef=useRef$1(null);let t4;$[18]!==registerElement?(t4=el=>{unregisterElementRef.current&&(unregisterElementRef.current(),unregisterElementRef.current=null),ref.current=el,ref.current&®isterElement&&(unregisterElementRef.current=registerElement(ref.current));},$[18]=registerElement,$[19]=t4):t4=$[19];const handleRefChange=t4;let t5,t6;$[20]!==activeIndex||$[21]!==onItemSelect?(t5=()=>{onItemSelect&&onItemSelect(activeIndex);},t6=[activeIndex,onItemSelect],$[20]=activeIndex,$[21]=onItemSelect,$[22]=t5,$[23]=t6):(t5=$[22],t6=$[23]),useEffect$1(t5,t6);let t7;$[24]===Symbol.for("react.memo_cache_sentinel")?(t7=()=>[ref.current],$[24]=t7):t7=$[24],useClickOutsideEvent(isTopLayer&&onClickOutside,t7);let t8;$[25]!==isTopLayer||$[26]!==onEscape?(t8=event=>{isTopLayer&&event.key==="Escape"&&(event.stopPropagation(),onEscape&&onEscape());},$[25]=isTopLayer,$[26]=onEscape,$[27]=t8):t8=$[27],useGlobalKeyDown(t8);let t9;$[28]!==activeElement||$[29]!==handleItemMouseEnter||$[30]!==handleItemMouseLeave||$[31]!==mount||$[32]!==onClickOutside||$[33]!==onEscape||$[34]!==onItemClick||$[35]!==registerElement?(t9={version:2,activeElement,mount,onClickOutside,onEscape,onItemClick,onItemMouseEnter:handleItemMouseEnter,onItemMouseLeave:handleItemMouseLeave,registerElement},$[28]=activeElement,$[29]=handleItemMouseEnter,$[30]=handleItemMouseLeave,$[31]=mount,$[32]=onClickOutside,$[33]=onEscape,$[34]=onItemClick,$[35]=registerElement,$[36]=t9):t9=$[36];const value=t9;let t10;$[37]!==children||$[38]!==space?(t10=/* @__PURE__ */jsx(Stack,{space,children}),$[37]=children,$[38]=space,$[39]=t10):t10=$[39];let t11;$[40]!==handleKeyDown||$[41]!==handleRefChange||$[42]!==padding||$[43]!==restProps||$[44]!==t10?(t11=/* @__PURE__ */jsx(StyledMenu,_objectSpread(_objectSpread({"data-ui":"Menu"},restProps),{},{onKeyDown:handleKeyDown,padding,ref:handleRefChange,role:"menu",tabIndex:-1,children:t10})),$[40]=handleKeyDown,$[41]=handleRefChange,$[42]=padding,$[43]=restProps,$[44]=t10,$[45]=t11):t11=$[45];let t12;return $[46]!==t11||$[47]!==value?(t12=/* @__PURE__ */jsx(MenuContext.Provider,{value,children:t11}),$[46]=t11,$[47]=value,$[48]=t12):t12=$[48],t12;});Menu.displayName="ForwardRef(Menu)";const MenuDivider=styled.hr.withConfig({displayName:"MenuDivider",componentId:"sc-uhoxwu-0"})(_templateObject59||(_templateObject59=_taggedTemplateLiteral(["height:1px;border:0;background:var(--card-hairline-soft-color);margin:0;"])));MenuDivider.displayName="MenuDivider";function selectableBaseStyle(){return css(_templateObject60||(_templateObject60=_taggedTemplateLiteral(["\n background-color: inherit;\n color: inherit;\n\n &[data-as='button'] {\n -webkit-font-smoothing: inherit;\n appearance: none;\n outline: none;\n font: inherit;\n text-align: inherit;\n border: 0;\n width: -moz-available;\n width: -webkit-fill-available;\n width: stretch;\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n text-decoration: none;\n }\n "])));}function selectableColorStyle(props){var _style$card2;const{$tone}=props,{color,style}=getTheme_v2(props.theme),tone=color.selectable[$tone];return css(_templateObject61||(_templateObject61=_taggedTemplateLiteral(["\n ","\n\n background-color: var(--card-bg-color);\n color: var(--card-fg-color);\n outline: none;\n\n /* &:is(button) */\n &[data-as='button'] {\n &:disabled {\n ","\n }\n\n &:not(:disabled) {\n &[aria-pressed='true'] {\n ","\n }\n\n &[data-selected],\n &[aria-selected='true'] > & {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n\n &:active {\n ","\n }\n }\n }\n }\n }\n\n /* &:is(a) */\n &[data-as='a'] {\n &[data-disabled] {\n ","\n }\n\n &:not([data-disabled]) {\n &[data-pressed] {\n ","\n }\n\n &[data-selected] {\n ","\n }\n\n @media (hover: hover) {\n &:not([data-selected]) {\n &[data-hovered],\n &:hover {\n ","\n }\n &:active {\n ","\n }\n }\n }\n }\n }\n\n ","\n "])),_cardColorStyle(color,tone.enabled),_cardColorStyle(color,tone.disabled),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.selected),_cardColorStyle(color,tone.hovered),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.disabled),_cardColorStyle(color,tone.pressed),_cardColorStyle(color,tone.selected),_cardColorStyle(color,tone.hovered),_cardColorStyle(color,tone.pressed),style===null||style===void 0||(_style$card2=style.card)===null||_style$card2===void 0?void 0:_style$card2.root);}const Selectable=/* @__PURE__ */styled(Box).withConfig({displayName:"Selectable",componentId:"sc-1w01ang-0"})(responsiveRadiusStyle,selectableBaseStyle,selectableColorStyle);Selectable.displayName="Selectable";function useMenu(){const value=useContext(MenuContext);if(!value)throw new Error("useMenu(): missing context value");if(!isRecord(value)||value.version!==2)throw new Error("useMenu(): the context value is not compatible");return value;}const MenuItem=forwardRef(function(props,forwardedRef){var _props30;const $=dist.c(75);let IconComponent,IconRightComponent,children,disabled,hotkeys,onClick,paddingBottom,paddingLeft,paddingRight,paddingTop,paddingX,paddingY,pressed,restProps,selectedProp,t0,t1,t2,t3,t4,t5,text;$[0]!==props?(_props30=props,{as:t0,children,disabled,fontSize:t1,hotkeys,icon:IconComponent,iconRight:IconRightComponent,onClick,padding:t2,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft,pressed,radius:t3,selected:selectedProp,space:t4,text,tone:t5}=_props30,restProps=_objectWithoutProperties(_props30,_excluded48),_props30,$[0]=props,$[1]=IconComponent,$[2]=IconRightComponent,$[3]=children,$[4]=disabled,$[5]=hotkeys,$[6]=onClick,$[7]=paddingBottom,$[8]=paddingLeft,$[9]=paddingRight,$[10]=paddingTop,$[11]=paddingX,$[12]=paddingY,$[13]=pressed,$[14]=restProps,$[15]=selectedProp,$[16]=t0,$[17]=t1,$[18]=t2,$[19]=t3,$[20]=t4,$[21]=t5,$[22]=text):(IconComponent=$[1],IconRightComponent=$[2],children=$[3],disabled=$[4],hotkeys=$[5],onClick=$[6],paddingBottom=$[7],paddingLeft=$[8],paddingRight=$[9],paddingTop=$[10],paddingX=$[11],paddingY=$[12],pressed=$[13],restProps=$[14],selectedProp=$[15],t0=$[16],t1=$[17],t2=$[18],t3=$[19],t4=$[20],t5=$[21],text=$[22]);const as=t0===void 0?"button":t0,fontSize2=t1===void 0?1:t1,padding=t2===void 0?3:t2,radius=t3===void 0?2:t3,space=t4===void 0?3:t4,tone=t5===void 0?"default":t5,{scheme}=useRootTheme(),menu=useMenu(),{activeElement,mount,onItemClick,onItemMouseEnter:_onItemMouseEnter,onItemMouseLeave:_onItemMouseLeave}=menu,onItemMouseEnter=_onItemMouseEnter!==null&&_onItemMouseEnter!==void 0?_onItemMouseEnter:menu.onItemMouseEnter,onItemMouseLeave=_onItemMouseLeave!==null&&_onItemMouseLeave!==void 0?_onItemMouseLeave:menu.onItemMouseLeave,[rootElement,setRootElement]=useState(null),active=!!activeElement&&activeElement===rootElement,ref=useRef$1(null);let t6;$[23]===Symbol.for("react.memo_cache_sentinel")?(t6=()=>ref.current,$[23]=t6):t6=$[23],useImperativeHandle(forwardedRef,t6);let t7,t8;$[24]!==mount||$[25]!==rootElement||$[26]!==selectedProp?(t7=()=>mount(rootElement,selectedProp),t8=[mount,rootElement,selectedProp],$[24]=mount,$[25]=rootElement,$[26]=selectedProp,$[27]=t7,$[28]=t8):(t7=$[27],t8=$[28]),useEffect$1(t7,t8);let t9;$[29]!==disabled||$[30]!==onClick||$[31]!==onItemClick?(t9=event=>{disabled||(onClick&&onClick(event),onItemClick&&onItemClick());},$[29]=disabled,$[30]=onClick,$[31]=onItemClick,$[32]=t9):t9=$[32];const handleClick=t9;let t10;$[33]!==padding||$[34]!==paddingBottom||$[35]!==paddingLeft||$[36]!==paddingRight||$[37]!==paddingTop||$[38]!==paddingX||$[39]!==paddingY?(t10={padding,paddingX,paddingY,paddingTop,paddingRight,paddingBottom,paddingLeft},$[33]=padding,$[34]=paddingBottom,$[35]=paddingLeft,$[36]=paddingRight,$[37]=paddingTop,$[38]=paddingX,$[39]=paddingY,$[40]=t10):t10=$[40];const paddingProps=t10;let t11;$[41]!==fontSize2?(t11=_getArrayProp(fontSize2).map(_temp),$[41]=fontSize2,$[42]=t11):t11=$[42];const hotkeysFontSize=t11;let t12;$[43]===Symbol.for("react.memo_cache_sentinel")?(t12=el=>{ref.current=el,setRootElement(el);},$[43]=t12):t12=$[43];const setRef=t12,t13=as!=="button"&&pressed?"":void 0,t14=active?"":void 0,t15=disabled?"":void 0;let t16;$[44]!==radius?(t16=_getArrayProp(radius),$[44]=radius,$[45]=t16):t16=$[45];let t17;$[46]===Symbol.for("react.memo_cache_sentinel")?(t17=_getArrayProp(0),$[46]=t17):t17=$[46];const t18=disabled?"default":tone,t19=as==="button"?"button":void 0;let t20;$[47]!==IconComponent||$[48]!==IconRightComponent||$[49]!==fontSize2||$[50]!==hotkeys||$[51]!==hotkeysFontSize||$[52]!==paddingProps||$[53]!==space||$[54]!==text?(t20=(IconComponent||text||IconRightComponent)&&/* @__PURE__ */jsxs(Flex,_objectSpread(_objectSpread({as:"span",gap:space,align:"center"},paddingProps),{},{children:[IconComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconComponent)&&IconComponent,reactIsExports.isValidElementType(IconComponent)&&/* @__PURE__ */jsx(IconComponent,{})]}),text&&/* @__PURE__ */jsx(Box,{flex:1,children:/* @__PURE__ */jsx(Text,{size:fontSize2,textOverflow:"ellipsis",weight:"medium",children:text})}),hotkeys&&/* @__PURE__ */jsx(Hotkeys,{fontSize:hotkeysFontSize,keys:hotkeys,style:{marginTop:-4,marginBottom:-4}}),IconRightComponent&&/* @__PURE__ */jsxs(Text,{size:fontSize2,children:[isValidElement$1(IconRightComponent)&&IconRightComponent,reactIsExports.isValidElementType(IconRightComponent)&&/* @__PURE__ */jsx(IconRightComponent,{})]})]})),$[47]=IconComponent,$[48]=IconRightComponent,$[49]=fontSize2,$[50]=hotkeys,$[51]=hotkeysFontSize,$[52]=paddingProps,$[53]=space,$[54]=text,$[55]=t20):t20=$[55];let t21;$[56]!==children||$[57]!==paddingProps?(t21=children&&/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({as:"span"},paddingProps),{},{children})),$[56]=children,$[57]=paddingProps,$[58]=t21):t21=$[58];let t22;return $[59]!==as||$[60]!==disabled||$[61]!==handleClick||$[62]!==onItemMouseEnter||$[63]!==onItemMouseLeave||$[64]!==restProps||$[65]!==scheme||$[66]!==t13||$[67]!==t14||$[68]!==t15||$[69]!==t16||$[70]!==t18||$[71]!==t19||$[72]!==t20||$[73]!==t21?(t22=/* @__PURE__ */jsxs(Selectable,_objectSpread(_objectSpread({"data-ui":"MenuItem",role:"menuitem"},restProps),{},{"data-pressed":t13,"data-selected":t14,"data-disabled":t15,forwardedAs:as,$radius:t16,$padding:t17,$tone:t18,$scheme:scheme,disabled,onClick:handleClick,onMouseEnter:onItemMouseEnter,onMouseLeave:onItemMouseLeave,ref:setRef,tabIndex:-1,type:t19,children:[t20,t21]})),$[59]=as,$[60]=disabled,$[61]=handleClick,$[62]=onItemMouseEnter,$[63]=onItemMouseLeave,$[64]=restProps,$[65]=scheme,$[66]=t13,$[67]=t14,$[68]=t15,$[69]=t16,$[70]=t18,$[71]=t19,$[72]=t20,$[73]=t21,$[74]=t22):t22=$[74],t22;});MenuItem.displayName="ForwardRef(MenuItem)";function _temp(s){return s-1;}const CustomButton=styled(Button).withConfig({displayName:"CustomButton",componentId:"sc-1kns779-0"})(_templateObject62||(_templateObject62=_taggedTemplateLiteral(["max-width:100%;"]))),Tab=forwardRef(function(props,forwardedRef){var _props31;const $=dist.c(30);let focused,icon,id,label,onClick,onFocus,restProps,selected,t0,t1;$[0]!==props?(_props31=props,{icon,id,focused,fontSize:t0,label,onClick,onFocus,padding:t1,selected}=_props31,restProps=_objectWithoutProperties(_props31,_excluded49),_props31,$[0]=props,$[1]=focused,$[2]=icon,$[3]=id,$[4]=label,$[5]=onClick,$[6]=onFocus,$[7]=restProps,$[8]=selected,$[9]=t0,$[10]=t1):(focused=$[1],icon=$[2],id=$[3],label=$[4],onClick=$[5],onFocus=$[6],restProps=$[7],selected=$[8],t0=$[9],t1=$[10]);const fontSize2=t0===void 0?1:t0,padding=t1===void 0?2:t1,ref=useRef$1(null),focusedRef=useRef$1(!1);let t2;$[11]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>ref.current,$[11]=t2):t2=$[11],useImperativeHandle(forwardedRef,t2);let t3;$[12]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>{focusedRef.current=!1;},$[12]=t3):t3=$[12];const handleBlur=t3;let t4;$[13]!==onFocus?(t4=event=>{focusedRef.current=!0,onFocus&&onFocus(event);},$[13]=onFocus,$[14]=t4):t4=$[14];const handleFocus=t4;let t5,t6;$[15]!==focused?(t5=()=>{focused&&!focusedRef.current&&(ref.current&&ref.current.focus(),focusedRef.current=!0);},t6=[focused],$[15]=focused,$[16]=t5,$[17]=t6):(t5=$[16],t6=$[17]),useEffect$1(t5,t6);const t7=selected?"true":"false",t8=selected?0:-1;let t9;return $[18]!==fontSize2||$[19]!==handleFocus||$[20]!==icon||$[21]!==id||$[22]!==label||$[23]!==onClick||$[24]!==padding||$[25]!==restProps||$[26]!==selected||$[27]!==t7||$[28]!==t8?(t9=/* @__PURE__ */jsx(CustomButton,_objectSpread(_objectSpread({"data-ui":"Tab"},restProps),{},{"aria-selected":t7,fontSize:fontSize2,icon,id,mode:"bleed",onClick,onBlur:handleBlur,onFocus:handleFocus,padding,ref,role:"tab",selected,tabIndex:t8,text:label,type:"button"})),$[18]=fontSize2,$[19]=handleFocus,$[20]=icon,$[21]=id,$[22]=label,$[23]=onClick,$[24]=padding,$[25]=restProps,$[26]=selected,$[27]=t7,$[28]=t8,$[29]=t9):t9=$[29],t9;});Tab.displayName="ForwardRef(Tab)";const CustomInline=styled(Inline).withConfig({displayName:"CustomInline",componentId:"sc-5cm04m-0"})(_templateObject63||(_templateObject63=_taggedTemplateLiteral(["& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}"]))),TabList=forwardRef(function(props,ref){var _props32;const $=dist.c(15);let childrenProp,restProps;$[0]!==props?(_props32=props,{children:childrenProp}=_props32,restProps=_objectWithoutProperties(_props32,_excluded50),_props32,$[0]=props,$[1]=childrenProp,$[2]=restProps):(childrenProp=$[1],restProps=$[2]);const[focusedIndex,setFocusedIndex]=useState(-1);let t0;if($[3]!==childrenProp||$[4]!==focusedIndex){const children=Children.toArray(childrenProp).filter(isValidElement$1);let t12;$[6]!==focusedIndex?(t12=(child,childIndex)=>cloneElement(child,{focused:focusedIndex===childIndex,key:childIndex,onFocus:()=>setFocusedIndex(childIndex)}),$[6]=focusedIndex,$[7]=t12):t12=$[7],t0=children.map(t12),$[3]=childrenProp,$[4]=focusedIndex,$[5]=t0;}else t0=$[5];const tabs=t0,numTabs=tabs.length;let t1;$[8]!==numTabs?(t1=event=>{event.key==="ArrowLeft"&&setFocusedIndex(prevIndex=>(prevIndex+numTabs-1)%numTabs),event.key==="ArrowRight"&&setFocusedIndex(prevIndex_0=>(prevIndex_0+1)%numTabs);},$[8]=numTabs,$[9]=t1):t1=$[9];const handleKeyDown=t1;let t2;return $[10]!==handleKeyDown||$[11]!==ref||$[12]!==restProps||$[13]!==tabs?(t2=/* @__PURE__ */jsx(CustomInline,_objectSpread(_objectSpread({"data-ui":"TabList"},restProps),{},{onKeyDown:handleKeyDown,ref,role:"tablist",children:tabs})),$[10]=handleKeyDown,$[11]=ref,$[12]=restProps,$[13]=tabs,$[14]=t2):t2=$[14],t2;});TabList.displayName="ForwardRef(TabList)";function _raf(fn){const frameId=requestAnimationFrame(fn);return()=>{cancelAnimationFrame(frameId);};}function _hasFocus(element){return!!document.activeElement&&element.contains(document.activeElement);}function isFocusable(element){return element.tabIndex>0||element.tabIndex===0&&element.getAttribute("tabIndex")!==null?!0:isHTMLAnchorElement(element)?!!element.href&&element.rel!=="ignore":isHTMLInputElement(element)?element.type!=="hidden"&&element.type!=="file"&&!element.disabled:isHTMLButtonElement(element)||isHTMLSelectElement(element)||isHTMLTextAreaElement(element)?!element.disabled:!1;}function attemptFocus(element){if(!isFocusable(element))return!1;try{element.focus();}catch(_unused3){}return document.activeElement===element;}function focusFirstDescendant(element){for(let i=0;i<element.childNodes.length;i++){const child=element.childNodes[i];if(isHTMLElement(child)&&(attemptFocus(child)||focusFirstDescendant(child)))return!0;}return!1;}function focusLastDescendant(element){for(let i=element.childNodes.length-1;i>=0;i--){const child=element.childNodes[i];if(isHTMLElement(child)&&(attemptFocus(child)||focusLastDescendant(child)))return!0;}return!1;}const StyledAutocomplete=styled.div.withConfig({displayName:"StyledAutocomplete",componentId:"sc-1igauft-0"})(_templateObject64||(_templateObject64=_taggedTemplateLiteral(["line-height:0;"]))),ListBox=styled(Box).withConfig({displayName:"ListBox",componentId:"sc-1igauft-1"})(_templateObject65||(_templateObject65=_taggedTemplateLiteral(["& > ul{list-style:none;padding:0;margin:0;}"]))),rotate=keyframes$1(_templateObject66||(_templateObject66=_taggedTemplateLiteral(["\n from {\n transform: rotate(0deg);\n }\n\n to {\n transform: rotate(360deg);\n }\n"]))),AnimatedSpinnerIcon=styled(SpinnerIcon).withConfig({displayName:"AnimatedSpinnerIcon",componentId:"sc-1igauft-2"})(_templateObject67||(_templateObject67=_taggedTemplateLiteral(["animation:"," 500ms linear infinite;"])),rotate);function AutocompleteOption(props){const $=dist.c(11),{children,id,onSelect,selected,value}=props;let t0;$[0]!==onSelect||$[1]!==value?(t0=()=>{setTimeout(()=>{onSelect(value);},0);},$[0]=onSelect,$[1]=value,$[2]=t0):t0=$[2];const handleClick=t0;let t1;$[3]!==handleClick?(t1=event=>{event.key==="Enter"&&!_isEnterToClickElement(event.currentTarget)&&handleClick();},$[3]=handleClick,$[4]=t1):t1=$[4];const handleKeyDown=t1;let t2;return $[5]!==children||$[6]!==handleClick||$[7]!==handleKeyDown||$[8]!==id||$[9]!==selected?(t2=/* @__PURE__ */jsx("li",{"aria-selected":selected,"data-ui":"AutocompleteOption",id,role:"option",onClick:handleClick,onKeyDown:handleKeyDown,children}),$[5]=children,$[6]=handleClick,$[7]=handleKeyDown,$[8]=id,$[9]=selected,$[10]=t2):t2=$[10],t2;}function autocompleteReducer(state,msg){return msg.type==="input/change"?_objectSpread(_objectSpread({},state),{},{activeValue:null,focused:!0,query:msg.query}):msg.type==="input/focus"?_objectSpread(_objectSpread({},state),{},{focused:!0}):msg.type==="root/blur"?_objectSpread(_objectSpread({},state),{},{focused:!1,query:null}):msg.type==="root/clear"?_objectSpread(_objectSpread({},state),{},{activeValue:null,query:null,value:null}):msg.type==="root/escape"?_objectSpread(_objectSpread({},state),{},{focused:!1,query:null}):msg.type==="root/open"?_objectSpread(_objectSpread({},state),{},{query:state.query||msg.query}):msg.type==="root/setActiveValue"?_objectSpread(_objectSpread({},state),{},{activeValue:msg.value,listFocused:msg.listFocused||state.listFocused}):msg.type==="root/setListFocused"?_objectSpread(_objectSpread({},state),{},{listFocused:msg.listFocused}):msg.type==="value/change"?_objectSpread(_objectSpread({},state),{},{activeValue:msg.value,query:null,value:msg.value}):state;}const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS=["Control","Shift","Alt","Enter","Home","End","PageUp","PageDown","Meta","Tab","CapsLock"],AUTOCOMPLETE_POPOVER_PLACEMENT="bottom-start",AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS=["bottom-start","top-start"],DEFAULT_RENDER_VALUE=(value,option)=>option?option.value:value,DEFAULT_FILTER_OPTION=(query,option)=>option.value.toLowerCase().indexOf(query.toLowerCase())>-1,InnerAutocomplete=forwardRef(function(props,forwardedRef){var _props33;const $=dist.c(181);let customValidity,disabled,filterOptionProp,icon,id,loading,onBlur,onChange,onFocus,onQueryChange,onSelect,openButton,openOnFocus,optionsProp,prefix,readOnly,relatedElements,renderOptionProp,renderPopover,restProps,suffix,t0,t1,t2,t3,t4,t5,t6,valueProp;$[0]!==props?(_props33=props,{border:t0,customValidity,disabled,filterOption:filterOptionProp,fontSize:t1,icon,id,listBox:t2,loading,onBlur,onChange,onFocus,onQueryChange,onSelect,openButton,openOnFocus,options:optionsProp,padding:t3,popover:t4,prefix,radius:t5,readOnly,relatedElements,renderOption:renderOptionProp,renderPopover,renderValue:t6,suffix,value:valueProp}=_props33,restProps=_objectWithoutProperties(_props33,_excluded51),_props33,$[0]=props,$[1]=customValidity,$[2]=disabled,$[3]=filterOptionProp,$[4]=icon,$[5]=id,$[6]=loading,$[7]=onBlur,$[8]=onChange,$[9]=onFocus,$[10]=onQueryChange,$[11]=onSelect,$[12]=openButton,$[13]=openOnFocus,$[14]=optionsProp,$[15]=prefix,$[16]=readOnly,$[17]=relatedElements,$[18]=renderOptionProp,$[19]=renderPopover,$[20]=restProps,$[21]=suffix,$[22]=t0,$[23]=t1,$[24]=t2,$[25]=t3,$[26]=t4,$[27]=t5,$[28]=t6,$[29]=valueProp):(customValidity=$[1],disabled=$[2],filterOptionProp=$[3],icon=$[4],id=$[5],loading=$[6],onBlur=$[7],onChange=$[8],onFocus=$[9],onQueryChange=$[10],onSelect=$[11],openButton=$[12],openOnFocus=$[13],optionsProp=$[14],prefix=$[15],readOnly=$[16],relatedElements=$[17],renderOptionProp=$[18],renderPopover=$[19],restProps=$[20],suffix=$[21],t0=$[22],t1=$[23],t2=$[24],t3=$[25],t4=$[26],t5=$[27],t6=$[28],valueProp=$[29]);const border=t0===void 0?!0:t0,fontSize=t1===void 0?2:t1,listBox=t2===void 0?EMPTY_RECORD:t2,paddingProp=t3===void 0?3:t3,popover=t4===void 0?EMPTY_RECORD:t4,radius=t5===void 0?2:t5,renderValue=t6===void 0?DEFAULT_RENDER_VALUE:t6,t7=valueProp||null,t8=valueProp||null;let t9;$[30]!==t7||$[31]!==t8?(t9={activeValue:t7,focused:!1,listFocused:!1,query:null,value:t8},$[30]=t7,$[31]=t8,$[32]=t9):t9=$[32];const[state,dispatch]=useReducer(autocompleteReducer,t9),{activeValue,focused,listFocused,query,value}=state;let t10;$[33]!==fontSize||$[34]!==paddingProp?(t10=t112=>{const{value:value_0}=t112;return/* @__PURE__ */jsx(Card,{"data-as":"button",padding:paddingProp,radius:2,tone:"inherit",children:/* @__PURE__ */jsx(Text,{size:fontSize,textOverflow:"ellipsis",children:value_0})});},$[33]=fontSize,$[34]=paddingProp,$[35]=t10):t10=$[35];const renderOption=typeof renderOptionProp=="function"?renderOptionProp:t10,filterOption=typeof filterOptionProp=="function"?filterOptionProp:DEFAULT_FILTER_OPTION,rootElementRef=useRef$1(null),resultsPopoverElementRef=useRef$1(null),inputElementRef=useRef$1(null),listBoxElementRef=useRef$1(null),[inputElement,_setInputElement]=useState(null);let t11;$[36]===Symbol.for("react.memo_cache_sentinel")?(t11=node=>{startTransition(()=>_setInputElement(node));},$[36]=t11):t11=$[36];const setInputElement=t11,listFocusedRef=useRef$1(!1),valueRef=useRef$1(value),valuePropRef=useRef$1(valueProp),popoverMouseWithinRef=useRef$1(!1);let t12,t13;$[37]!==inputElement?(t12=()=>inputElement,t13=[inputElement],$[37]=inputElement,$[38]=t12,$[39]=t13):(t12=$[38],t13=$[39]),useImperativeHandle(inputElementRef,t12,t13);let t14,t15;$[40]!==inputElement?(t14=()=>inputElement,t15=[inputElement],$[40]=inputElement,$[41]=t14,$[42]=t15):(t14=$[41],t15=$[42]),useImperativeHandle(forwardedRef,t14,t15);const listBoxId="".concat(id,"-listbox"),options=Array.isArray(optionsProp)?optionsProp:EMPTY_ARRAY,padding=_getArrayProp(paddingProp);let t16;$[43]!==options||$[44]!==value?(t16=value!==null?options.find(o=>o.value===value):void 0,$[43]=options,$[44]=value,$[45]=t16):t16=$[45];const currentOption=t16;let t17;if($[46]!==filterOption||$[47]!==options||$[48]!==query){let t182;$[50]!==filterOption||$[51]!==query?(t182=option=>query?filterOption(query,option):!0,$[50]=filterOption,$[51]=query,$[52]=t182):t182=$[52],t17=options.filter(t182),$[46]=filterOption,$[47]=options,$[48]=query,$[49]=t17;}else t17=$[49];const filteredOptions=t17,filteredOptionsLen=filteredOptions.length,activeItemId=activeValue?"".concat(id,"-option-").concat(activeValue):void 0,expanded=query!==null&&loading||focused&&query!==null;let t18;$[53]!==onBlur||$[54]!==onQueryChange||$[55]!==relatedElements?(t18=event=>{setTimeout(()=>{if(popoverMouseWithinRef.current)return;const elements=(relatedElements||[]).concat(rootElementRef.current?[rootElementRef.current]:[],resultsPopoverElementRef.current?[resultsPopoverElementRef.current]:[]);let focusInside=!1;if(document.activeElement){for(const e of elements)if(e===document.activeElement||e.contains(document.activeElement)){focusInside=!0;break;}}focusInside===!1&&(dispatch({type:"root/blur"}),popoverMouseWithinRef.current=!1,onQueryChange&&onQueryChange(null),onBlur&&onBlur(event));},0);},$[53]=onBlur,$[54]=onQueryChange,$[55]=relatedElements,$[56]=t18):t18=$[56];const handleRootBlur=t18;let t19;$[57]===Symbol.for("react.memo_cache_sentinel")?(t19=event_0=>{const listBoxElement=listBoxElementRef.current,focusedElement=event_0.target instanceof HTMLElement?event_0.target:null,listFocused_0=(listBoxElement===null||listBoxElement===void 0?void 0:listBoxElement.contains(focusedElement))||!1;listFocused_0!==listFocusedRef.current&&(listFocusedRef.current=listFocused_0,dispatch({type:"root/setListFocused",listFocused:listFocused_0}));},$[57]=t19):t19=$[57];const handleRootFocus=t19;let t20;$[58]!==onChange||$[59]!==onQueryChange||$[60]!==onSelect?(t20=v=>{var _inputElementRef$curr;dispatch({type:"value/change",value:v}),popoverMouseWithinRef.current=!1,onSelect&&onSelect(v),valueRef.current=v,onChange&&onChange(v),onQueryChange&&onQueryChange(null),(_inputElementRef$curr=inputElementRef.current)===null||_inputElementRef$curr===void 0?void 0:_inputElementRef$curr.focus();},$[58]=onChange,$[59]=onQueryChange,$[60]=onSelect,$[61]=t20):t20=$[61];const handleOptionSelect=t20;let t21;$[62]!==activeValue||$[63]!==filteredOptions||$[64]!==filteredOptionsLen||$[65]!==onQueryChange?(t21=event_1=>{if(event_1.key==="ArrowDown"){if(event_1.preventDefault(),!filteredOptionsLen)return;const activeOption=filteredOptions.find(o_0=>o_0.value===activeValue),activeIndex=activeOption?filteredOptions.indexOf(activeOption):-1,nextActiveOption=filteredOptions[(activeIndex+1)%filteredOptionsLen];nextActiveOption&&dispatch({type:"root/setActiveValue",value:nextActiveOption.value,listFocused:!0});return;}if(event_1.key==="ArrowUp"){if(event_1.preventDefault(),!filteredOptionsLen)return;const activeOption_0=filteredOptions.find(o_1=>o_1.value===activeValue),activeIndex_0=activeOption_0?filteredOptions.indexOf(activeOption_0):-1,nextActiveOption_0=filteredOptions[activeIndex_0===-1?filteredOptionsLen-1:(filteredOptionsLen+activeIndex_0-1)%filteredOptionsLen];nextActiveOption_0&&dispatch({type:"root/setActiveValue",value:nextActiveOption_0.value,listFocused:!0});return;}if(event_1.key==="Escape"){var _inputElementRef$curr2;dispatch({type:"root/escape"}),popoverMouseWithinRef.current=!1,onQueryChange&&onQueryChange(null),(_inputElementRef$curr2=inputElementRef.current)===null||_inputElementRef$curr2===void 0?void 0:_inputElementRef$curr2.focus();return;}const target=event_1.target,listEl=listBoxElementRef.current;if((listEl===target||listEl!==null&&listEl!==void 0&&listEl.contains(target))&&!AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)){var _inputElementRef$curr3;(_inputElementRef$curr3=inputElementRef.current)===null||_inputElementRef$curr3===void 0||_inputElementRef$curr3.focus();return;}},$[62]=activeValue,$[63]=filteredOptions,$[64]=filteredOptionsLen,$[65]=onQueryChange,$[66]=t21):t21=$[66];const handleRootKeyDown=t21;let t22;$[67]!==onQueryChange?(t22=event_2=>{const nextQuery=event_2.currentTarget.value;dispatch({type:"input/change",query:nextQuery}),onQueryChange&&onQueryChange(nextQuery);},$[67]=onQueryChange,$[68]=t22):t22=$[68];const handleInputChange=t22;let t23;$[69]!==currentOption||$[70]!==renderValue||$[71]!==value?(t23=()=>{dispatch({type:"root/open",query:value?renderValue(value,currentOption):""});},$[69]=currentOption,$[70]=renderValue,$[71]=value,$[72]=t23):t23=$[72];const dispatchOpen=t23;let t24;$[73]!==dispatchOpen||$[74]!==focused||$[75]!==onFocus||$[76]!==openOnFocus?(t24=event_3=>{focused||(dispatch({type:"input/focus"}),onFocus&&onFocus(event_3),openOnFocus&&dispatchOpen());},$[73]=dispatchOpen,$[74]=focused,$[75]=onFocus,$[76]=openOnFocus,$[77]=t24):t24=$[77];const handleInputFocus=t24;let t25;$[78]===Symbol.for("react.memo_cache_sentinel")?(t25=()=>{popoverMouseWithinRef.current=!0;},$[78]=t25):t25=$[78];const handlePopoverMouseEnter=t25;let t26;$[79]===Symbol.for("react.memo_cache_sentinel")?(t26=()=>{popoverMouseWithinRef.current=!1;},$[79]=t26):t26=$[79];const handlePopoverMouseLeave=t26;let t27;$[80]!==onChange||$[81]!==onQueryChange?(t27=()=>{var _inputElementRef$curr4;dispatch({type:"root/clear"}),valueRef.current="",onChange&&onChange(""),onQueryChange&&onQueryChange(null),(_inputElementRef$curr4=inputElementRef.current)===null||_inputElementRef$curr4===void 0?void 0:_inputElementRef$curr4.focus();},$[80]=onChange,$[81]=onQueryChange,$[82]=t27):t27=$[82];const handleClearButtonClick=t27;let t28;$[83]===Symbol.for("react.memo_cache_sentinel")?(t28=()=>{dispatch({type:"input/focus"});},$[83]=t28):t28=$[83];const handleClearButtonFocus=t28;let t29,t30;$[84]!==valueProp?(t29=()=>{if(valueProp!==valuePropRef.current){valuePropRef.current=valueProp,valueProp!==void 0&&(dispatch({type:"value/change",value:valueProp}),valueRef.current=valueProp);return;}valueProp!==valueRef.current&&(valueRef.current=valueProp||null,dispatch({type:"value/change",value:valueProp||null}));},t30=[valueProp],$[84]=valueProp,$[85]=t29,$[86]=t30):(t29=$[85],t30=$[86]),useEffect$1(t29,t30);let t31,t32;$[87]!==focused?(t31=()=>{!focused&&valueRef.current&&dispatch({type:"root/setActiveValue",value:valueRef.current});},t32=[focused],$[87]=focused,$[88]=t31,$[89]=t32):(t31=$[88],t32=$[89]),useEffect$1(t31,t32);let t33,t34;$[90]!==activeValue||$[91]!==filteredOptions?(t33=()=>{const listElement=listBoxElementRef.current;if(!listElement)return;const activeOption_1=filteredOptions.find(o_2=>o_2.value===activeValue);if(activeOption_1){const activeIndex_1=filteredOptions.indexOf(activeOption_1),activeItemElement=listElement.childNodes[activeIndex_1];if(activeItemElement){if(_hasFocus(activeItemElement))return;focusFirstDescendant(activeItemElement);}}},t34=[activeValue,filteredOptions],$[90]=activeValue,$[91]=filteredOptions,$[92]=t33,$[93]=t34):(t33=$[92],t34=$[93]),useEffect$1(t33,t34);let t35;bb0:{if(!loading&&!disabled&&value){let t362;$[94]===Symbol.for("react.memo_cache_sentinel")?(t362={"aria-label":"Clear",onFocus:handleClearButtonFocus},$[94]=t362):t362=$[94],t35=t362;break bb0;}t35=void 0;}const clearButton=t35,openButtonBoxPadding=padding.map(_temp$3),openButtonPadding=padding.map(_temp2$1),openButtonProps=typeof openButton=="object"?openButton:EMPTY_RECORD;let t36;$[95]!==dispatchOpen||$[96]!==openButtonProps?(t36=event_4=>{dispatchOpen(),openButtonProps.onClick&&openButtonProps.onClick(event_4),_raf(()=>{var _inputElementRef$curr5;return(_inputElementRef$curr5=inputElementRef.current)===null||_inputElementRef$curr5===void 0?void 0:_inputElementRef$curr5.focus();});},$[95]=dispatchOpen,$[96]=openButtonProps,$[97]=t36):t36=$[97];const handleOpenClick=t36;let t37;$[98]!==disabled||$[99]!==expanded||$[100]!==fontSize||$[101]!==handleOpenClick||$[102]!==openButton||$[103]!==openButtonBoxPadding||$[104]!==openButtonPadding||$[105]!==openButtonProps||$[106]!==readOnly?(t37=!disabled&&!readOnly&&openButton?/* @__PURE__ */jsx(Box,{"aria-hidden":expanded,padding:openButtonBoxPadding,children:/* @__PURE__ */jsx(Button,_objectSpread(_objectSpread({"aria-label":"Open",disabled:expanded,fontSize,icon:ChevronDownIcon,mode:"bleed",padding:openButtonPadding},openButtonProps),{},{onClick:handleOpenClick}))}):void 0,$[98]=disabled,$[99]=expanded,$[100]=fontSize,$[101]=handleOpenClick,$[102]=openButton,$[103]=openButtonBoxPadding,$[104]=openButtonPadding,$[105]=openButtonProps,$[106]=readOnly,$[107]=t37):t37=$[107];const openButtonNode=t37;let t38;bb1:{if(query===null){if(value!==null){let t392;$[108]!==currentOption||$[109]!==renderValue||$[110]!==value?(t392=renderValue(value,currentOption),$[108]=currentOption,$[109]=renderValue,$[110]=value,$[111]=t392):t392=$[111],t38=t392;break bb1;}t38="";break bb1;}t38=query;}const inputValue=t38;let t39;$[112]!==listFocused?(t39=event_5=>{var _inputElementRef$curr6;event_5.key==="Tab"&&listFocused&&((_inputElementRef$curr6=inputElementRef.current)===null||_inputElementRef$curr6===void 0?void 0:_inputElementRef$curr6.focus());},$[112]=listFocused,$[113]=t39):t39=$[113];const handleListBoxKeyDown=t39;let t40;bb2:{if(filteredOptions.length===0){t40=null;break bb2;}let t412;if($[114]!==activeValue||$[115]!==currentOption||$[116]!==filteredOptions||$[117]!==handleOptionSelect||$[118]!==id||$[119]!==listFocused||$[120]!==loading||$[121]!==renderOption){let t423;$[123]!==activeValue||$[124]!==currentOption||$[125]!==handleOptionSelect||$[126]!==id||$[127]!==listFocused||$[128]!==loading||$[129]!==renderOption?(t423=option_0=>{const active=activeValue!==null?option_0.value===activeValue:currentOption===option_0;return/* @__PURE__ */jsx(AutocompleteOption,{id:"".concat(id,"-option-").concat(option_0.value),onSelect:handleOptionSelect,selected:active,value:option_0.value,children:cloneElement(renderOption(option_0),{disabled:loading,selected:active,tabIndex:listFocused&&active?0:-1})},option_0.value);},$[123]=activeValue,$[124]=currentOption,$[125]=handleOptionSelect,$[126]=id,$[127]=listFocused,$[128]=loading,$[129]=renderOption,$[130]=t423):t423=$[130],t412=filteredOptions.map(t423),$[114]=activeValue,$[115]=currentOption,$[116]=filteredOptions,$[117]=handleOptionSelect,$[118]=id,$[119]=listFocused,$[120]=loading,$[121]=renderOption,$[122]=t412;}else t412=$[122];let t422;$[131]!==listBoxId||$[132]!==t412?(t422=/* @__PURE__ */jsx(Stack,{as:"ul","aria-multiselectable":!1,"data-ui":"AutoComplete__resultsList",id:listBoxId,ref:listBoxElementRef,role:"listbox",space:1,children:t412}),$[131]=listBoxId,$[132]=t412,$[133]=t422):t422=$[133];let t432;$[134]!==handleListBoxKeyDown||$[135]!==listBox||$[136]!==t422?(t432=/* @__PURE__ */jsx(ListBox,_objectSpread(_objectSpread({"data-ui":"AutoComplete__results",onKeyDown:handleListBoxKeyDown,padding:1},listBox),{},{tabIndex:-1,children:t422})),$[134]=handleListBoxKeyDown,$[135]=listBox,$[136]=t422,$[137]=t432):t432=$[137],t40=t432;}const content2=t40;let t41;bb3:{if(renderPopover){const t423=!expanded;let t432;$[138]!==content2||$[139]!==handlePopoverMouseEnter||$[140]!==handlePopoverMouseLeave||$[141]!==inputElement||$[142]!==renderPopover||$[143]!==t423?(t432=/* @__PURE__ */jsx(RenderPopover,{content:content2,hidden:t423,inputElement,onMouseEnter:handlePopoverMouseEnter,onMouseLeave:handlePopoverMouseLeave,resultsPopoverElementRef,renderPopover}),$[138]=content2,$[139]=handlePopoverMouseEnter,$[140]=handlePopoverMouseLeave,$[141]=inputElement,$[142]=renderPopover,$[143]=t423,$[144]=t432):t432=$[144],t41=t432;break bb3;}if(filteredOptionsLen===0){t41=null;break bb3;}let t422;$[145]!==content2||$[146]!==expanded||$[147]!==handlePopoverMouseEnter||$[148]!==handlePopoverMouseLeave||$[149]!==inputElement||$[150]!==popover||$[151]!==radius?(t422=/* @__PURE__ */jsx(Popover,_objectSpread({arrow:!1,constrainSize:!0,content:content2,fallbackPlacements:AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS,matchReferenceWidth:!0,onMouseEnter:handlePopoverMouseEnter,onMouseLeave:handlePopoverMouseLeave,open:expanded,overflow:"auto",placement:AUTOCOMPLETE_POPOVER_PLACEMENT,portal:!0,radius,ref:resultsPopoverElementRef,referenceElement:inputElement},popover)),$[145]=content2,$[146]=expanded,$[147]=handlePopoverMouseEnter,$[148]=handlePopoverMouseLeave,$[149]=inputElement,$[150]=popover,$[151]=radius,$[152]=t422):t422=$[152],t41=t422;}const results=t41,t42=loading&&AnimatedSpinnerIcon,t43=suffix||openButtonNode;let t44;$[153]!==activeItemId||$[154]!==border||$[155]!==clearButton||$[156]!==customValidity||$[157]!==disabled||$[158]!==expanded||$[159]!==fontSize||$[160]!==handleClearButtonClick||$[161]!==handleInputChange||$[162]!==handleInputFocus||$[163]!==icon||$[164]!==id||$[165]!==inputValue||$[166]!==listBoxId||$[167]!==padding||$[168]!==prefix||$[169]!==radius||$[170]!==readOnly||$[171]!==restProps||$[172]!==t42||$[173]!==t43?(t44=/* @__PURE__ */jsx(TextInput,_objectSpread(_objectSpread({},restProps),{},{"aria-activedescendant":activeItemId,"aria-autocomplete":"list","aria-expanded":expanded,"aria-owns":listBoxId,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",border,clearButton,customValidity,disabled,fontSize,icon,iconRight:t42,id,inputMode:"search",onChange:handleInputChange,onClear:handleClearButtonClick,onFocus:handleInputFocus,padding,prefix,radius,readOnly,ref:setInputElement,role:"combobox",spellCheck:!1,suffix:t43,value:inputValue})),$[153]=activeItemId,$[154]=border,$[155]=clearButton,$[156]=customValidity,$[157]=disabled,$[158]=expanded,$[159]=fontSize,$[160]=handleClearButtonClick,$[161]=handleInputChange,$[162]=handleInputFocus,$[163]=icon,$[164]=id,$[165]=inputValue,$[166]=listBoxId,$[167]=padding,$[168]=prefix,$[169]=radius,$[170]=readOnly,$[171]=restProps,$[172]=t42,$[173]=t43,$[174]=t44):t44=$[174];let t45;return $[175]!==handleRootBlur||$[176]!==handleRootFocus||$[177]!==handleRootKeyDown||$[178]!==results||$[179]!==t44?(t45=/* @__PURE__ */jsxs(StyledAutocomplete,{"data-ui":"Autocomplete",onBlur:handleRootBlur,onFocus:handleRootFocus,onKeyDown:handleRootKeyDown,ref:rootElementRef,children:[t44,results]}),$[175]=handleRootBlur,$[176]=handleRootFocus,$[177]=handleRootKeyDown,$[178]=results,$[179]=t44,$[180]=t45):t45=$[180],t45;});function RenderPopover(_ref77){let{renderPopover,content:content2,hidden,inputElement,onMouseEnter,onMouseLeave,resultsPopoverElementRef}=_ref77;return renderPopover({content:content2,hidden,inputElement,onMouseEnter,onMouseLeave},resultsPopoverElementRef);}InnerAutocomplete.displayName="ForwardRef(Autocomplete)";function _temp$3(v_0){return v_0===0?0:v_0===1||v_0===2?1:v_0-2;}function _temp2$1(v_1){return Math.max(v_1-1,0);}const StyledBreadcrumbs=styled.ol.withConfig({displayName:"StyledBreadcrumbs",componentId:"sc-1es8h8q-0"})(_templateObject68||(_templateObject68=_taggedTemplateLiteral(["margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;"]))),ExpandButton=styled(Button).withConfig({displayName:"ExpandButton",componentId:"sc-1es8h8q-1"})(_templateObject69||(_templateObject69=_taggedTemplateLiteral(["appearance:none;margin:-4px;"]))),Breadcrumbs=forwardRef(function(props,ref){var _props34;const $=dist.c(29);let children,maxLength,restProps,separator,t0;$[0]!==props?(_props34=props,{children,maxLength,separator,space:t0}=_props34,restProps=_objectWithoutProperties(_props34,_excluded52),_props34,$[0]=props,$[1]=children,$[2]=maxLength,$[3]=restProps,$[4]=separator,$[5]=t0):(children=$[1],maxLength=$[2],restProps=$[3],separator=$[4],t0=$[5]);const spaceRaw=t0===void 0?2:t0;let t1;$[6]!==spaceRaw?(t1=_getArrayProp(spaceRaw),$[6]=spaceRaw,$[7]=t1):t1=$[7];const space=t1,[open,setOpen]=useState(!1),expandElementRef=useRef$1(null),popoverElementRef=useRef$1(null);let t2;$[8]===Symbol.for("react.memo_cache_sentinel")?(t2=()=>setOpen(!1),$[8]=t2):t2=$[8];const collapse=t2;let t3;$[9]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>setOpen(!0),$[9]=t3):t3=$[9];const expand=t3;let t4;$[10]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>[expandElementRef.current,popoverElementRef.current],$[10]=t4):t4=$[10],useClickOutsideEvent(collapse,t4);let t5;$[11]!==children?(t5=Children.toArray(children).filter(isValidElement$1),$[11]=children,$[12]=t5):t5=$[12];const rawItems=t5;let t6;$[13]!==maxLength||$[14]!==open||$[15]!==rawItems||$[16]!==space?(t6={collapse,expand,expandElementRef,maxLength,open,popoverElementRef,rawItems,space},$[13]=maxLength,$[14]=open,$[15]=rawItems,$[16]=space,$[17]=t6):t6=$[17];const items=useItems(t6);let t7;if($[18]!==items||$[19]!==separator||$[20]!==space){let t82;$[22]!==separator||$[23]!==space?(t82=(item,itemIndex)=>/* @__PURE__ */jsxs(Fragment$1,{children:[itemIndex>0&&/* @__PURE__ */jsx(Box,{"aria-hidden":!0,as:"li",paddingX:space,children:separator||/* @__PURE__ */jsx(Text,{muted:!0,children:"/"})}),/* @__PURE__ */jsx(Box,{as:"li",children:item})]},itemIndex),$[22]=separator,$[23]=space,$[24]=t82):t82=$[24],t7=items.map(t82),$[18]=items,$[19]=separator,$[20]=space,$[21]=t7;}else t7=$[21];let t8;return $[25]!==ref||$[26]!==restProps||$[27]!==t7?(t8=/* @__PURE__ */jsx(StyledBreadcrumbs,_objectSpread(_objectSpread({"data-ui":"Breadcrumbs"},restProps),{},{ref,children:t7})),$[25]=ref,$[26]=restProps,$[27]=t7,$[28]=t8):t8=$[28],t8;});Breadcrumbs.displayName="ForwardRef(Breadcrumbs)";function useItems(t0){const $=dist.c(28),{collapse,expand,expandElementRef,maxLength,open,popoverElementRef,rawItems,space}=t0,len=rawItems.length;if(maxLength&&len>maxLength){const beforeLength=Math.ceil(maxLength/2),afterLength=Math.floor(maxLength/2);let t1;if($[0]!==afterLength||$[1]!==beforeLength||$[2]!==collapse||$[3]!==expand||$[4]!==expandElementRef||$[5]!==len||$[6]!==open||$[7]!==popoverElementRef||$[8]!==rawItems||$[9]!==space){const t2=rawItems.slice(0,beforeLength-1);let t3;$[11]!==afterLength||$[12]!==beforeLength||$[13]!==len||$[14]!==rawItems?(t3=rawItems.slice(beforeLength-1,len-afterLength),$[11]=afterLength,$[12]=beforeLength,$[13]=len,$[14]=rawItems,$[15]=t3):t3=$[15];let t4;$[16]!==space||$[17]!==t3?(t4=/* @__PURE__ */jsx(Stack,{as:"ol",overflow:"auto",padding:space,space,children:t3}),$[16]=space,$[17]=t3,$[18]=t4):t4=$[18];const t5=open?collapse:expand;let t6;$[19]!==expandElementRef||$[20]!==open||$[21]!==t5?(t6=/* @__PURE__ */jsx(ExpandButton,{fontSize:1,mode:"bleed",onClick:t5,padding:1,ref:expandElementRef,selected:open,text:"\u2026"}),$[19]=expandElementRef,$[20]=open,$[21]=t5,$[22]=t6):t6=$[22];let t7;$[23]!==open||$[24]!==popoverElementRef||$[25]!==t4||$[26]!==t6?(t7=/* @__PURE__ */jsx(Popover,{constrainSize:!0,content:t4,open,placement:"top",portal:!0,ref:popoverElementRef,children:t6},"button"),$[23]=open,$[24]=popoverElementRef,$[25]=t4,$[26]=t6,$[27]=t7):t7=$[27],t1=[...t2,t7,...rawItems.slice(len-afterLength)],$[0]=afterLength,$[1]=beforeLength,$[2]=collapse,$[3]=expand,$[4]=expandElementRef,$[5]=len,$[6]=open,$[7]=popoverElementRef,$[8]=rawItems,$[9]=space,$[10]=t1;}else t1=$[10];return t1;}return rawItems;}function dialogStyle(_ref78){let{theme}=_ref78;const{color}=getTheme_v2(theme);return{"&:not([hidden])":{display:"flex"},top:0,left:0,right:0,bottom:0,alignItems:"center",justifyContent:"center",outline:"none",background:color.backdrop};}function responsiveDialogPositionStyle(props){const{media}=getTheme_v2(props.theme);return _responsive(media,props.$position,position=>({"&&":{position}}));}function animationDialogStyle(props){return props.$animate?css(_templateObject70||(_templateObject70=_taggedTemplateLiteral(["\n @keyframes zoomIn {\n from {\n opacity: 0;\n transform: scale(0.95);\n }\n to {\n opacity: 1;\n transform: scale(1);\n }\n }\n @keyframes fadeIn {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n }\n\n animation: fadeIn 200ms ease-out;\n // Animates the dialog card.\n & > [data-ui='DialogCard'] {\n animation: zoomIn 200ms ease-out;\n }\n "]))):css(_templateObject71||(_templateObject71=_taggedTemplateLiteral([""])));}const DialogContext=createGlobalScopedContext("@sanity/ui/context/dialog",{version:0});function useDialog(){return useContext(DialogContext);}function isTargetWithinScope(boundaryElement,portalElement,target){return!boundaryElement||!portalElement?!0:containsOrEqualsElement(boundaryElement,target)||containsOrEqualsElement(portalElement,target);}const StyledDialog=/* @__PURE__ */styled(Layer).withConfig({displayName:"StyledDialog",componentId:"sc-4n4xb3-0"})(responsivePaddingStyle,dialogStyle,responsiveDialogPositionStyle,animationDialogStyle),DialogContainer=styled(Container).withConfig({displayName:"DialogContainer",componentId:"sc-4n4xb3-1"})(_templateObject72||(_templateObject72=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}width:100%;height:100%;flex-direction:column;align-items:center;justify-content:center;"]))),DialogCardRoot=styled(Card).withConfig({displayName:"DialogCardRoot",componentId:"sc-4n4xb3-2"})(_templateObject73||(_templateObject73=_taggedTemplateLiteral(["&:not([hidden]){display:flex;}width:100%;min-height:0;max-height:100%;overflow:hidden;overflow:clip;"]))),DialogLayout=styled(Flex).withConfig({displayName:"DialogLayout",componentId:"sc-4n4xb3-3"})(_templateObject74||(_templateObject74=_taggedTemplateLiteral(["flex:1;min-height:0;width:100%;"]))),DialogHeader=styled(Box).withConfig({displayName:"DialogHeader",componentId:"sc-4n4xb3-4"})(_templateObject75||(_templateObject75=_taggedTemplateLiteral(["position:relative;z-index:2;"]))),DialogContent=styled(Box).withConfig({displayName:"DialogContent",componentId:"sc-4n4xb3-5"})(_templateObject76||(_templateObject76=_taggedTemplateLiteral(["position:relative;z-index:1;overflow:auto;outline:none;"]))),DialogFooter=styled(Box).withConfig({displayName:"DialogFooter",componentId:"sc-4n4xb3-6"})(_templateObject77||(_templateObject77=_taggedTemplateLiteral(["position:relative;z-index:3;"]))),DialogCard=forwardRef(function(props,forwardedRef){var _portal$elements3;const $=dist.c(44),{__unstable_autoFocus:autoFocus,__unstable_hideCloseButton:hideCloseButton,children,contentRef:forwardedContentRef,footer,header,id,onClickOutside,onClose,portal:portalProp,radius:radiusProp,scheme,shadow:shadowProp,width:widthProp}=props,portal=usePortal(),portalElement=portalProp?((_portal$elements3=portal.elements)===null||_portal$elements3===void 0?void 0:_portal$elements3[portalProp])||null:portal.element,boundaryElement=useBoundaryElement().element;let t0;$[0]!==radiusProp?(t0=_getArrayProp(radiusProp),$[0]=radiusProp,$[1]=t0):t0=$[1];const radius=t0;let t1;$[2]!==shadowProp?(t1=_getArrayProp(shadowProp),$[2]=shadowProp,$[3]=t1):t1=$[3];const shadow=t1;let t2;$[4]!==widthProp?(t2=_getArrayProp(widthProp),$[4]=widthProp,$[5]=t2):t2=$[5];const width=t2,ref=useRef$1(null),contentRef=useRef$1(null),layer=useLayer(),{isTopLayer}=layer,labelId="".concat(id,"_label"),showCloseButton=!!onClose&&hideCloseButton===!1,showHeader=!!header||showCloseButton;let t3;$[6]===Symbol.for("react.memo_cache_sentinel")?(t3=()=>ref.current,$[6]=t3):t3=$[6],useImperativeHandle(forwardedRef,t3);let t4;$[7]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>contentRef.current,$[7]=t4):t4=$[7],useImperativeHandle(forwardedContentRef,t4);let t5,t6;$[8]!==autoFocus?(t5=()=>{autoFocus&&ref.current&&focusFirstDescendant(ref.current);},t6=[autoFocus,ref],$[8]=autoFocus,$[9]=t5,$[10]=t6):(t5=$[9],t6=$[10]),useEffect$1(t5,t6);let t7;$[11]!==boundaryElement||$[12]!==isTopLayer||$[13]!==onClose||$[14]!==portalElement?(t7=event=>{if(!isTopLayer||!onClose)return;const target=document.activeElement;target&&!isTargetWithinScope(boundaryElement,portalElement,target)||event.key==="Escape"&&(event.preventDefault(),event.stopPropagation(),onClose());},$[11]=boundaryElement,$[12]=isTopLayer,$[13]=onClose,$[14]=portalElement,$[15]=t7):t7=$[15],useGlobalKeyDown(t7);let t8;$[16]!==boundaryElement||$[17]!==isTopLayer||$[18]!==onClickOutside||$[19]!==portalElement?(t8=isTopLayer&&onClickOutside&&(event_0=>{const target_0=event_0.target;target_0&&!isTargetWithinScope(boundaryElement,portalElement,target_0)||onClickOutside();}),$[16]=boundaryElement,$[17]=isTopLayer,$[18]=onClickOutside,$[19]=portalElement,$[20]=t8):t8=$[20];let t9;$[21]===Symbol.for("react.memo_cache_sentinel")?(t9=()=>[ref.current],$[21]=t9):t9=$[21],useClickOutsideEvent(t8,t9);let t10;$[22]!==header||$[23]!==labelId||$[24]!==onClose||$[25]!==showCloseButton||$[26]!==showHeader?(t10=showHeader&&/* @__PURE__ */jsx(DialogHeader,{children:/* @__PURE__ */jsxs(Flex,{align:"flex-start",padding:3,children:[/* @__PURE__ */jsx(Box,{flex:1,padding:2,children:header&&/* @__PURE__ */jsx(Text,{id:labelId,size:1,weight:"semibold",children:header})}),showCloseButton&&/* @__PURE__ */jsx(Box,{flex:"none",children:/* @__PURE__ */jsx(Button,{"aria-label":"Close dialog",disabled:!onClose,icon:CloseIcon,mode:"bleed",onClick:onClose,padding:2})})]})}),$[22]=header,$[23]=labelId,$[24]=onClose,$[25]=showCloseButton,$[26]=showHeader,$[27]=t10):t10=$[27];let t11;$[28]!==children?(t11=/* @__PURE__ */jsx(DialogContent,{flex:1,ref:contentRef,tabIndex:-1,children}),$[28]=children,$[29]=t11):t11=$[29];let t12;$[30]!==footer?(t12=footer&&/* @__PURE__ */jsx(DialogFooter,{children:footer}),$[30]=footer,$[31]=t12):t12=$[31];let t13;$[32]!==t10||$[33]!==t11||$[34]!==t12?(t13=/* @__PURE__ */jsxs(DialogLayout,{direction:"column",children:[t10,t11,t12]}),$[32]=t10,$[33]=t11,$[34]=t12,$[35]=t13):t13=$[35];let t14;$[36]!==radius||$[37]!==scheme||$[38]!==shadow||$[39]!==t13?(t14=/* @__PURE__ */jsx(DialogCardRoot,{radius,ref,scheme,shadow,children:t13}),$[36]=radius,$[37]=scheme,$[38]=shadow,$[39]=t13,$[40]=t14):t14=$[40];let t15;return $[41]!==t14||$[42]!==width?(t15=/* @__PURE__ */jsx(DialogContainer,{"data-ui":"DialogCard",width,children:t14}),$[41]=t14,$[42]=width,$[43]=t15):t15=$[43],t15;});DialogCard.displayName="ForwardRef(DialogCard)";const Dialog=forwardRef(function(props,ref){var _props35,_portal$elements4;const $=dist.c(70),dialog=useDialog(),{layer}=useTheme_v2();let _positionProp,_zOffsetProp,children,contentRef,footer,header,id,onActivate,onClickOutside,onClose,onFocus,portalProp,restProps,scheme,t0,t1,t2,t3,t4,t5,t6;$[0]!==props?(_props35=props,{__unstable_autoFocus:t0,__unstable_hideCloseButton:t1,cardRadius:t2,cardShadow:t3,children,contentRef,footer,header,id,onActivate,onClickOutside,onClose,onFocus,padding:t4,portal:portalProp,position:_positionProp,scheme,width:t5,zOffset:_zOffsetProp,animate:t6}=_props35,restProps=_objectWithoutProperties(_props35,_excluded53),_props35,$[0]=props,$[1]=_positionProp,$[2]=_zOffsetProp,$[3]=children,$[4]=contentRef,$[5]=footer,$[6]=header,$[7]=id,$[8]=onActivate,$[9]=onClickOutside,$[10]=onClose,$[11]=onFocus,$[12]=portalProp,$[13]=restProps,$[14]=scheme,$[15]=t0,$[16]=t1,$[17]=t2,$[18]=t3,$[19]=t4,$[20]=t5,$[21]=t6):(_positionProp=$[1],_zOffsetProp=$[2],children=$[3],contentRef=$[4],footer=$[5],header=$[6],id=$[7],onActivate=$[8],onClickOutside=$[9],onClose=$[10],onFocus=$[11],portalProp=$[12],restProps=$[13],scheme=$[14],t0=$[15],t1=$[16],t2=$[17],t3=$[18],t4=$[19],t5=$[20],t6=$[21]);const autoFocus=t0===void 0?!0:t0,hideCloseButton=t1===void 0?!1:t1,cardRadiusProp=t2===void 0?4:t2,cardShadow=t3===void 0?3:t3,paddingProp=t4===void 0?3:t4,widthProp=t5===void 0?0:t5,_animate=t6===void 0?!1:t6,positionProp=_positionProp!==null&&_positionProp!==void 0?_positionProp:dialog.position||"fixed",zOffsetProp=_zOffsetProp!==null&&_zOffsetProp!==void 0?_zOffsetProp:dialog.zOffset||layer.dialog.zOffset,animate=usePrefersReducedMotion()?!1:_animate,portal=usePortal(),portalElement=portalProp?((_portal$elements4=portal.elements)===null||_portal$elements4===void 0?void 0:_portal$elements4[portalProp])||null:portal.element,boundaryElement=useBoundaryElement().element;let t7;$[22]!==cardRadiusProp?(t7=_getArrayProp(cardRadiusProp),$[22]=cardRadiusProp,$[23]=t7):t7=$[23];const cardRadius=t7;let t8;$[24]!==paddingProp?(t8=_getArrayProp(paddingProp),$[24]=paddingProp,$[25]=t8):t8=$[25];const padding=t8;let t9;$[26]!==positionProp?(t9=_getArrayProp(positionProp),$[26]=positionProp,$[27]=t9):t9=$[27];const position=t9;let t10;$[28]!==widthProp?(t10=_getArrayProp(widthProp),$[28]=widthProp,$[29]=t10):t10=$[29];const width=t10;let t11;$[30]!==zOffsetProp?(t11=_getArrayProp(zOffsetProp),$[30]=zOffsetProp,$[31]=t11):t11=$[31];const zOffset=t11,preDivRef=useRef$1(null),postDivRef=useRef$1(null),cardRef=useRef$1(null),focusedElementRef=useRef$1(null);let t12;$[32]!==onFocus?(t12=event=>{var _onFocus2;(_onFocus2=onFocus)===null||_onFocus2===void 0||_onFocus2(event);const target=event.target,cardElement=cardRef.current;if(cardElement&&target===preDivRef.current){focusLastDescendant(cardElement);return;}if(cardElement&&target===postDivRef.current){focusFirstDescendant(cardElement);return;}isHTMLElement(event.target)&&(focusedElementRef.current=event.target);},$[32]=onFocus,$[33]=t12):t12=$[33];const handleFocus=t12,labelId="".concat(id,"_label"),rootClickTimeoutRef=useRef$1(void 0);let t13;$[34]!==boundaryElement||$[35]!==portalElement?(t13=()=>{rootClickTimeoutRef.current&&clearTimeout(rootClickTimeoutRef.current),rootClickTimeoutRef.current=setTimeout(()=>{const activeElement=document.activeElement;if(activeElement&&!isTargetWithinScope(boundaryElement,portalElement,activeElement)){const target_0=focusedElementRef.current;if(!target_0||!document.body.contains(target_0)){const cardElement_0=cardRef.current;cardElement_0&&focusFirstDescendant(cardElement_0);return;}target_0.focus();}},0);},$[34]=boundaryElement,$[35]=portalElement,$[36]=t13):t13=$[36];const handleRootClick=t13;let t14;$[37]===Symbol.for("react.memo_cache_sentinel")?(t14=/* @__PURE__ */jsx("div",{ref:preDivRef,tabIndex:0}),$[37]=t14):t14=$[37];let t15;$[38]!==autoFocus||$[39]!==cardRadius||$[40]!==cardShadow||$[41]!==children||$[42]!==contentRef||$[43]!==footer||$[44]!==header||$[45]!==hideCloseButton||$[46]!==id||$[47]!==onClickOutside||$[48]!==onClose||$[49]!==portalProp||$[50]!==scheme||$[51]!==width?(t15=/* @__PURE__ */jsx(DialogCard,{__unstable_autoFocus:autoFocus,__unstable_hideCloseButton:hideCloseButton,contentRef,footer,header,id,onClickOutside,onClose,portal:portalProp,radius:cardRadius,ref:cardRef,scheme,shadow:cardShadow,width,children}),$[38]=autoFocus,$[39]=cardRadius,$[40]=cardShadow,$[41]=children,$[42]=contentRef,$[43]=footer,$[44]=header,$[45]=hideCloseButton,$[46]=id,$[47]=onClickOutside,$[48]=onClose,$[49]=portalProp,$[50]=scheme,$[51]=width,$[52]=t15):t15=$[52];let t16;$[53]===Symbol.for("react.memo_cache_sentinel")?(t16=/* @__PURE__ */jsx("div",{ref:postDivRef,tabIndex:0}),$[53]=t16):t16=$[53];let t17;$[54]!==animate||$[55]!==handleFocus||$[56]!==handleRootClick||$[57]!==id||$[58]!==labelId||$[59]!==onActivate||$[60]!==padding||$[61]!==position||$[62]!==ref||$[63]!==restProps||$[64]!==t15||$[65]!==zOffset?(t17=/* @__PURE__ */jsxs(StyledDialog,_objectSpread(_objectSpread({},restProps),{},{$animate:animate,$padding:padding,$position:position,"aria-labelledby":labelId,"aria-modal":!0,"data-ui":"Dialog",id,onActivate,onClick:handleRootClick,onFocus:handleFocus,ref,role:"dialog",zOffset,children:[t14,t15,t16]})),$[54]=animate,$[55]=handleFocus,$[56]=handleRootClick,$[57]=id,$[58]=labelId,$[59]=onActivate,$[60]=padding,$[61]=position,$[62]=ref,$[63]=restProps,$[64]=t15,$[65]=zOffset,$[66]=t17):t17=$[66];let t18;return $[67]!==portalProp||$[68]!==t17?(t18=/* @__PURE__ */jsx(Portal,{__unstable_name:portalProp,children:t17}),$[67]=portalProp,$[68]=t17,$[69]=t18):t18=$[69],t18;});Dialog.displayName="ForwardRef(Dialog)";const MenuButton=forwardRef(function(props,forwardedRef){var _buttonProp$props$sel;const $=dist.c(62),{__unstable_disableRestoreFocusOnClose:t0,boundaryElement:deprecated_boundaryElement,button:buttonProp,id,menu:menuProp,onClose,onOpen,placement:deprecated_placement,popoverScheme:deprecated_popoverScheme,portal:t1,popover,popoverRadius:deprecated_popoverRadius,preventOverflow:deprecated_preventOverflow}=props,disableRestoreFocusOnClose=t0===void 0?!1:t0,deprecated_portal=t1===void 0?!0:t1,[open,setOpen]=useState(!1),[shouldFocus,setShouldFocus]=useState(null),[buttonElement,setButtonElement]=useState(null);let t2;$[0]===Symbol.for("react.memo_cache_sentinel")?(t2=[],$[0]=t2):t2=$[0];const[menuElements,setChildMenuElements]=useState(t2),openRef=useRef$1(open);let t3,t4;$[1]!==onOpen||$[2]!==open?(t3=()=>{onOpen&&open&&!openRef.current&&onOpen();},t4=[onOpen,open],$[1]=onOpen,$[2]=open,$[3]=t3,$[4]=t4):(t3=$[3],t4=$[4]),useEffect$1(t3,t4);let t5,t6;$[5]!==onClose||$[6]!==open?(t5=()=>{onClose&&!open&&openRef.current&&onClose();},t6=[onClose,open],$[5]=onClose,$[6]=open,$[7]=t5,$[8]=t6):(t5=$[7],t6=$[8]),useEffect$1(t5,t6);let t7,t8;$[9]!==open?(t7=()=>{openRef.current=open;},t8=[open],$[9]=open,$[10]=t7,$[11]=t8):(t7=$[10],t8=$[11]),useEffect$1(t7,t8);let t9;$[12]===Symbol.for("react.memo_cache_sentinel")?(t9=()=>{setOpen(_temp$2),setShouldFocus(null);},$[12]=t9):t9=$[12];const handleButtonClick=t9;let t10;$[13]!==open?(t10=event=>{open&&event.preventDefault();},$[13]=open,$[14]=t10):t10=$[14];const handleMouseDown=t10;let t11;$[15]===Symbol.for("react.memo_cache_sentinel")?(t11=event_0=>{if(event_0.key==="ArrowDown"||event_0.key==="Enter"||event_0.key===" "){event_0.preventDefault(),setOpen(!0),setShouldFocus("first");return;}if(event_0.key==="ArrowUp"){event_0.preventDefault(),setOpen(!0),setShouldFocus("last");return;}},$[15]=t11):t11=$[15];const handleButtonKeyDown=t11;let t12;$[16]!==buttonElement||$[17]!==menuElements?(t12=event_1=>{const target=event_1.target;if(target instanceof Node&&!(buttonElement&&(target===buttonElement||buttonElement.contains(target)))){for(const el of menuElements)if(target===el||el.contains(target))return;setOpen(!1);}},$[16]=buttonElement,$[17]=menuElements,$[18]=t12):t12=$[18];const handleMenuClickOutside=t12;let t13;$[19]!==buttonElement||$[20]!==disableRestoreFocusOnClose?(t13=()=>{setOpen(!1),!disableRestoreFocusOnClose&&buttonElement&&buttonElement.focus();},$[19]=buttonElement,$[20]=disableRestoreFocusOnClose,$[21]=t13):t13=$[21];const handleMenuEscape=t13;let t14;$[22]!==menuElements?(t14=event_2=>{const target_0=event_2.relatedTarget;if(target_0 instanceof Node){for(const el_0 of menuElements)if(el_0===target_0||el_0.contains(target_0))return;setOpen(!1);}},$[22]=menuElements,$[23]=t14):t14=$[23];const handleBlur=t14;let t15;$[24]!==buttonElement||$[25]!==disableRestoreFocusOnClose?(t15=()=>{setOpen(!1),!disableRestoreFocusOnClose&&buttonElement&&buttonElement.focus();},$[24]=buttonElement,$[25]=disableRestoreFocusOnClose,$[26]=t15):t15=$[26];const handleItemClick=t15;let t16;$[27]===Symbol.for("react.memo_cache_sentinel")?(t16=el_1=>(setChildMenuElements(els=>els.concat([el_1])),()=>setChildMenuElements(els_0=>els_0.filter(_el=>_el!==el_1))),$[27]=t16):t16=$[27];const registerElement=t16;let t17;$[28]!==buttonElement||$[29]!==handleBlur||$[30]!==handleItemClick||$[31]!==handleMenuClickOutside||$[32]!==handleMenuEscape||$[33]!==id||$[34]!==menuProp||$[35]!==shouldFocus?(t17=menuProp&&cloneElement(menuProp,{"aria-labelledby":id,onBlurCapture:handleBlur,onClickOutside:handleMenuClickOutside,onEscape:handleMenuEscape,onItemClick:handleItemClick,originElement:buttonElement,registerElement,shouldFocus}),$[28]=buttonElement,$[29]=handleBlur,$[30]=handleItemClick,$[31]=handleMenuClickOutside,$[32]=handleMenuEscape,$[33]=id,$[34]=menuProp,$[35]=shouldFocus,$[36]=t17):t17=$[36];const menu=t17;let t18;$[37]!==buttonProp||$[38]!==handleMouseDown||$[39]!==id||$[40]!==open?(t18=buttonProp&&cloneElement(buttonProp,{"data-ui":"MenuButton",id,onClick:handleButtonClick,onKeyDown:handleButtonKeyDown,onMouseDown:handleMouseDown,"aria-haspopup":!0,"aria-expanded":open,ref:setButtonElement,selected:(_buttonProp$props$sel=buttonProp.props.selected)!==null&&_buttonProp$props$sel!==void 0?_buttonProp$props$sel:open}),$[37]=buttonProp,$[38]=handleMouseDown,$[39]=id,$[40]=open,$[41]=t18):t18=$[41];const button=t18;let t19,t20;$[42]!==buttonElement?(t19=()=>buttonElement,t20=[buttonElement],$[42]=buttonElement,$[43]=t19,$[44]=t20):(t19=$[43],t20=$[44]),useImperativeHandle(forwardedRef,t19,t20);let t21;$[45]!==popover?(t21=popover||{},$[45]=popover,$[46]=t21):t21=$[46];let t22;$[47]!==deprecated_boundaryElement||$[48]!==deprecated_placement||$[49]!==deprecated_popoverRadius||$[50]!==deprecated_popoverScheme||$[51]!==deprecated_portal||$[52]!==deprecated_preventOverflow||$[53]!==t21?(t22=_objectSpread({boundaryElement:deprecated_boundaryElement,overflow:"auto",placement:deprecated_placement,portal:deprecated_portal,preventOverflow:deprecated_preventOverflow,radius:deprecated_popoverRadius,scheme:deprecated_popoverScheme},t21),$[47]=deprecated_boundaryElement,$[48]=deprecated_placement,$[49]=deprecated_popoverRadius,$[50]=deprecated_popoverScheme,$[51]=deprecated_portal,$[52]=deprecated_preventOverflow,$[53]=t21,$[54]=t22):t22=$[54];const popoverProps=t22;let t23;$[55]!==button?(t23=button||/* @__PURE__ */jsx(Fragment,{}),$[55]=button,$[56]=t23):t23=$[56];let t24;return $[57]!==menu||$[58]!==open||$[59]!==popoverProps||$[60]!==t23?(t24=/* @__PURE__ */jsx(Popover,_objectSpread(_objectSpread({"data-ui":"MenuButton__popover"},popoverProps),{},{content:menu,open,children:t23})),$[57]=menu,$[58]=open,$[59]=popoverProps,$[60]=t23,$[61]=t24):t24=$[61],t24;});MenuButton.displayName="ForwardRef(MenuButton)";function _temp$2(v){return!v;}const keyframe=keyframes$1(_templateObject78||(_templateObject78=_taggedTemplateLiteral(["\n 0% {\n background-position: 100%;\n }\n 100% {\n background-position: -100%;\n }\n"]))),animation=css(_templateObject79||(_templateObject79=_taggedTemplateLiteral(["\n background-image: linear-gradient(\n to right,\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-to),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from),\n var(--card-skeleton-color-from)\n );\n background-position: 100%;\n background-size: 200% 100%;\n background-attachment: fixed;\n animation-name: ",";\n animation-timing-function: ease-in-out;\n animation-iteration-count: infinite;\n animation-duration: 2000ms;\n"])),keyframe),skeletonStyle=css(_templateObject80||(_templateObject80=_taggedTemplateLiteral(["\n opacity: ",";\n transition: opacity 200ms ease-in;\n\n @media screen and (prefers-reduced-motion: no-preference) {\n ","\n }\n\n @media screen and (prefers-reduced-motion: reduce) {\n background-color: var(--card-skeleton-color-from);\n }\n"])),_ref79=>{let{$visible}=_ref79;return $visible?1:0;},_ref80=>{let{$animated}=_ref80;return $animated?animation:css(_templateObject81||(_templateObject81=_taggedTemplateLiteral(["\n background-color: var(--card-skeleton-color-from);\n "])));}),StyledSkeleton$1=/* @__PURE__ */styled(Box).withConfig({displayName:"StyledSkeleton",componentId:"sc-ebtpni-0"})(responsiveRadiusStyle,skeletonStyle),Skeleton=forwardRef(function(props,ref){var _props36;const $=dist.c(16);let delay,radius,restProps,t0;$[0]!==props?(_props36=props,{animated:t0,delay,radius}=_props36,restProps=_objectWithoutProperties(_props36,_excluded54),_props36,$[0]=props,$[1]=delay,$[2]=radius,$[3]=restProps,$[4]=t0):(delay=$[1],radius=$[2],restProps=$[3],t0=$[4]);const animated=t0===void 0?!1:t0,[visible,setVisible]=useState(!delay);let t1,t2;$[5]!==delay?(t1=()=>{if(!delay)return;const timeout=setTimeout(()=>{setVisible(!0);},delay);return()=>{clearTimeout(timeout);};},t2=[delay],$[5]=delay,$[6]=t1,$[7]=t2):(t1=$[6],t2=$[7]),useEffect$1(t1,t2);let t3;$[8]!==radius?(t3=_getArrayProp(radius),$[8]=radius,$[9]=t3):t3=$[9];const t4=delay?visible:!0;let t5;return $[10]!==animated||$[11]!==ref||$[12]!==restProps||$[13]!==t3||$[14]!==t4?(t5=/* @__PURE__ */jsx(StyledSkeleton$1,_objectSpread(_objectSpread({},restProps),{},{$animated:animated,$radius:t3,$visible:t4,ref})),$[10]=animated,$[11]=ref,$[12]=restProps,$[13]=t3,$[14]=t4,$[15]=t5):t5=$[15],t5;});Skeleton.displayName="ForwardRef(Skeleton)";const StyledSkeleton=/* @__PURE__ */styled(Skeleton).withConfig({displayName:"StyledSkeleton",componentId:"sc-2p7a1v-0"})(props=>{const{$size,$style}=props,{font,media}=getTheme_v2(props.theme),fontStyle=font[$style];return _responsive(media,$size,sizeIndex=>{const fontSize=fontStyle.sizes[sizeIndex];return{height:fontSize.lineHeight-fontSize.ascenderHeight-fontSize.descenderHeight};});}),TextSkeleton=forwardRef(function(props,ref){var _props37;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props37=props,{size:t0}=_props37,restProps=_objectWithoutProperties(_props37,_excluded55),_props37,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"text"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});TextSkeleton.displayName="ForwardRef(TextSkeleton)";const LabelSkeleton=forwardRef(function(props,ref){var _props38;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props38=props,{size:t0}=_props38,restProps=_objectWithoutProperties(_props38,_excluded56),_props38,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"label"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});LabelSkeleton.displayName="ForwardRef(LabelSkeleton)";const HeadingSkeleton=forwardRef(function(props,ref){var _props39;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props39=props,{size:t0}=_props39,restProps=_objectWithoutProperties(_props39,_excluded57),_props39,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"heading"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});HeadingSkeleton.displayName="ForwardRef(HeadingSkeleton)";const CodeSkeleton=forwardRef(function(props,ref){var _props40;const $=dist.c(9);let restProps,t0;$[0]!==props?(_props40=props,{size:t0}=_props40,restProps=_objectWithoutProperties(_props40,_excluded58),_props40,$[0]=props,$[1]=restProps,$[2]=t0):(restProps=$[1],t0=$[2]);const size=t0===void 0?2:t0;let t1;$[3]!==size?(t1=_getArrayProp(size),$[3]=size,$[4]=t1):t1=$[4];const $size=t1;let t2;return $[5]!==$size||$[6]!==ref||$[7]!==restProps?(t2=/* @__PURE__ */jsx(StyledSkeleton,_objectSpread(_objectSpread({},restProps),{},{$size,ref,$style:"code"})),$[5]=$size,$[6]=ref,$[7]=restProps,$[8]=t2):t2=$[8],t2;});CodeSkeleton.displayName="ForwardRef(CodeSkeleton)";const TabPanel=forwardRef(function(props,ref){var _props41;const $=dist.c(9);let flex,restProps;$[0]!==props?(_props41=props,{flex}=_props41,restProps=_objectWithoutProperties(_props41,_excluded59),_props41,$[0]=props,$[1]=flex,$[2]=restProps):(flex=$[1],restProps=$[2]);const t0=props.tabIndex===void 0?0:props.tabIndex;let t1;return $[3]!==flex||$[4]!==props.children||$[5]!==ref||$[6]!==restProps||$[7]!==t0?(t1=/* @__PURE__ */jsx(Box,_objectSpread(_objectSpread({"data-ui":"TabPanel"},restProps),{},{flex,ref,role:"tabpanel",tabIndex:t0,children:props.children})),$[3]=flex,$[4]=props.children,$[5]=ref,$[6]=restProps,$[7]=t0,$[8]=t1):t1=$[8],t1;});TabPanel.displayName="ForwardRef(TabPanel)";const LOADING_BAR_HEIGHT=2;styled(Flex).withConfig({displayName:"TextBox",componentId:"sc-1rr7rxo-0"})(_templateObject82||(_templateObject82=_taggedTemplateLiteral(["overflow-x:auto;"])));const StyledToast=styled(Card).withConfig({displayName:"StyledToast",componentId:"sc-1rr7rxo-1"})(_templateObject83||(_templateObject83=_taggedTemplateLiteral(["pointer-events:all;width:100%;position:relative;overflow:hidden;overflow:clip;&[data-has-duration]{padding-bottom:calc(","px / 2);}"])),LOADING_BAR_HEIGHT),LoadingBar=styled.div.withConfig({displayName:"LoadingBar",componentId:"sc-1rr7rxo-2"})(_templateObject84||(_templateObject84=_taggedTemplateLiteral(["display:flex;position:absolute;bottom:0px;top:0px;left:0px;right:0px;pointer-events:none;z-index:-1;overflow:hidden;overflow:clip;background:transparent;align-items:flex-end;will-change:opacity;"])));styled(Card).withConfig({displayName:"LoadingBarMask",componentId:"sc-1rr7rxo-3"})(_templateObject85||(_templateObject85=_taggedTemplateLiteral(["position:absolute;top:0;left:-","px;right:-","px;bottom:","px;z-index:1;"])),LOADING_BAR_HEIGHT,LOADING_BAR_HEIGHT,LOADING_BAR_HEIGHT);const LoadingBarProgress=styled(Card).withConfig({displayName:"LoadingBarProgress",componentId:"sc-1rr7rxo-4"})(_templateObject86||(_templateObject86=_taggedTemplateLiteral(["display:block;height:100%;width:100%;transform-origin:0% 50%;background-color:",";"])),props=>{const{color}=getTheme_v2(props.theme);return color.button.default[props.tone].enabled.bg;});motion.create(StyledToast);motion.create(Flex);motion.create(Text);motion.create(LoadingBar);motion.create(LoadingBarProgress);createGlobalScopedContext("@sanity/ui/context/toast",null);styled(Grid).withConfig({displayName:"StyledLayer",componentId:"sc-1tbwn58-0"})(_templateObject87||(_templateObject87=_taggedTemplateLiteral(["box-sizing:border-box;position:fixed;right:0;bottom:0;list-style:none;pointer-events:none;max-width:420px;width:100%;"])));function _findPrevItemElement(state,itemElements,focusedElement){const idx=itemElements.indexOf(focusedElement),els=itemElements.slice(0,idx),len=els.length;for(let i=len-1;i>=0;i-=1){const itemKey=els[i].getAttribute("data-tree-key");if(!itemKey)continue;const segments=itemKey.split("/");segments.pop();const p=[];let expanded=!0;for(let j=0;j<segments.length;j+=1){var _state$k;p.push(segments[j]);const k=p.join("/");if(!((_state$k=state[k])!==null&&_state$k!==void 0&&_state$k.expanded)){expanded=!1;break;}}if(expanded)return els[i];}return null;}function _findNextItemElement(state,itemElements,focusedElement){const idx=itemElements.indexOf(focusedElement),els=itemElements.slice(idx),len=itemElements.length;for(let i=1;i<len;i+=1){if(!els[i])continue;const itemKey=els[i].getAttribute("data-tree-key");if(!itemKey)continue;const segments=itemKey.split("/");segments.pop();const p=[];let expanded=!0;for(let j=0;j<segments.length;j+=1){var _state$k2;p.push(segments[j]);const k=p.join("/");if(!((_state$k2=state[k])!==null&&_state$k2!==void 0&&_state$k2.expanded)){expanded=!1;break;}}if(expanded)return els[i];}return null;}function _focusItemElement(el){if(el.getAttribute("role")==="treeitem"&&el.focus(),el.getAttribute("role")==="none"){const firstChild=el.firstChild;firstChild&&firstChild instanceof HTMLElement&&firstChild.focus();}}const TreeContext=createGlobalScopedContext("@sanity/ui/context/tree",null),Tree=forwardRef(function(props,forwardedRef){var _props42;const $=dist.c(37);let children,onFocus,restProps,t0;$[0]!==props?(_props42=props,{children,space:t0,onFocus}=_props42,restProps=_objectWithoutProperties(_props42,_excluded60),_props42,$[0]=props,$[1]=children,$[2]=onFocus,$[3]=restProps,$[4]=t0):(children=$[1],onFocus=$[2],restProps=$[3],t0=$[4]);const space=t0===void 0?1:t0,ref=useRef$1(null),[focusedElement,setFocusedElement]=useState(null),focusedElementRef=useRef$1(focusedElement);let t1;$[5]===Symbol.for("react.memo_cache_sentinel")?(t1=[],$[5]=t1):t1=$[5];const path=t1;let t2;$[6]===Symbol.for("react.memo_cache_sentinel")?(t2=[],$[6]=t2):t2=$[6];const[itemElements,setItemElements]=useState(t2);let t3;$[7]===Symbol.for("react.memo_cache_sentinel")?(t3={},$[7]=t3):t3=$[7];const[state,setState]=useState(t3),stateRef=useRef$1(state);let t4;$[8]===Symbol.for("react.memo_cache_sentinel")?(t4=()=>ref.current,$[8]=t4):t4=$[8],useImperativeHandle(forwardedRef,t4);let t5,t6;$[9]!==focusedElement?(t5=()=>{focusedElementRef.current=focusedElement;},t6=[focusedElement],$[9]=focusedElement,$[10]=t5,$[11]=t6):(t5=$[10],t6=$[11]),useEffect$1(t5,t6);let t7,t8;$[12]!==state?(t7=()=>{stateRef.current=state;},t8=[state],$[12]=state,$[13]=t7,$[14]=t8):(t7=$[13],t8=$[14]),useEffect$1(t7,t8);let t9;$[15]===Symbol.for("react.memo_cache_sentinel")?(t9=(element,path_0,expanded,selected)=>(setState(s=>_objectSpread(_objectSpread({},s),{},{[path_0]:{element,expanded}})),selected&&setFocusedElement(element),()=>{setState(s_0=>{const newState=_objectSpread({},s_0);return delete newState[path_0],newState;});}),$[15]=t9):t9=$[15];const registerItem=t9;let t10;$[16]===Symbol.for("react.memo_cache_sentinel")?(t10=(path_1,expanded_0)=>{setState(s_1=>{const itemState=s_1[path_1];return itemState?_objectSpread(_objectSpread({},s_1),{},{[path_1]:_objectSpread(_objectSpread({},itemState),{},{expanded:expanded_0})}):s_1;});},$[16]=t10):t10=$[16];const setExpanded=t10,t11=focusedElement||itemElements[0]||null;let t12;$[17]!==space||$[18]!==state||$[19]!==t11?(t12={version:0,focusedElement:t11,level:0,path,registerItem,setExpanded,setFocusedElement,space,state},$[17]=space,$[18]=state,$[19]=t11,$[20]=t12):t12=$[20];const contextValue=t12;let t13;$[21]!==itemElements?(t13=event=>{if(focusedElementRef.current){if(event.key==="ArrowDown"){event.preventDefault();const nextEl=_findNextItemElement(stateRef.current,itemElements,focusedElementRef.current);nextEl&&(_focusItemElement(nextEl),setFocusedElement(nextEl));return;}if(event.key==="ArrowUp"){event.preventDefault();const prevEl=_findPrevItemElement(stateRef.current,itemElements,focusedElementRef.current);prevEl&&(_focusItemElement(prevEl),setFocusedElement(prevEl));return;}if(event.key==="ArrowLeft"){event.preventDefault();const itemKey=focusedElementRef.current.getAttribute("data-tree-key");if(!itemKey)return;const itemState_0=stateRef.current[itemKey];if(!itemState_0)return;if(itemState_0.expanded)setState(s_2=>{const itemState_1=s_2[itemKey];return itemState_1?_objectSpread(_objectSpread({},s_2),{},{[itemKey]:_objectSpread(_objectSpread({},itemState_1),{},{expanded:!1})}):s_2;});else{const itemPath=itemKey.split("/");itemPath.pop();const parentKey=itemPath.join("/"),parentState=parentKey&&stateRef.current[parentKey];parentState&&(parentState.element.focus(),setFocusedElement(parentState.element));}return;}if(event.key==="ArrowRight"){var _stateRef$current$foc;event.preventDefault();const focusedKey=focusedElementRef.current.getAttribute("data-tree-key");if(!focusedKey)return;((_stateRef$current$foc=stateRef.current[focusedKey])===null||_stateRef$current$foc===void 0?void 0:_stateRef$current$foc.expanded)||setState(s_3=>{const itemState_2=s_3[focusedKey];return itemState_2?_objectSpread(_objectSpread({},s_3),{},{[focusedKey]:_objectSpread(_objectSpread({},itemState_2),{},{expanded:!0})}):s_3;});return;}}},$[21]=itemElements,$[22]=t13):t13=$[22];const handleKeyDown=t13;let t14;$[23]!==onFocus?(t14=event_0=>{var _onFocus3;setFocusedElement(event_0.target),(_onFocus3=onFocus)===null||_onFocus3===void 0?void 0:_onFocus3(event_0);},$[23]=onFocus,$[24]=t14):t14=$[24];const handleFocus=t14;let t15;$[25]===Symbol.for("react.memo_cache_sentinel")?(t15=()=>{if(!ref.current)return;const _itemElements=Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));setItemElements(_itemElements);},$[25]=t15):t15=$[25];let t16;$[26]!==children?(t16=[children],$[26]=children,$[27]=t16):t16=$[27],useEffect$1(t15,t16);let t17;$[28]!==children||$[29]!==handleFocus||$[30]!==handleKeyDown||$[31]!==restProps||$[32]!==space?(t17=/* @__PURE__ */jsx(Stack,_objectSpread(_objectSpread({as:"ul","data-ui":"Tree"},restProps),{},{onFocus:handleFocus,onKeyDown:handleKeyDown,ref,role:"tree",space,children})),$[28]=children,$[29]=handleFocus,$[30]=handleKeyDown,$[31]=restProps,$[32]=space,$[33]=t17):t17=$[33];let t18;return $[34]!==contextValue||$[35]!==t17?(t18=/* @__PURE__ */jsx(TreeContext.Provider,{value:contextValue,children:t17}),$[34]=contextValue,$[35]=t17,$[36]=t18):t18=$[36],t18;});Tree.displayName="ForwardRef(Tree)";styled(Text).withConfig({displayName:"ToggleArrowText",componentId:"sc-iiskig-2"})(_templateObject88||(_templateObject88=_taggedTemplateLiteral(["& > svg{transition:transform 100ms;}"])));const listenOptions={includeResult:false,includePreviousRevision:false,visibility:"query",events:["welcome","mutation","reconnect"]};function useClient(){return useClient$1({apiVersion:"2023-02-01"});}const isSchemaMulti=type=>{return type.jsonType!=="object";};const isSchemaReference=type=>{return"to"in type||"of"in type&&type.of[0]&&"to"in type.of[0];};const filterUniqueTags=function(){let tags=arguments.length>0&&arguments[0]!==undefined?arguments[0]:[];return tags.flat(Infinity).filter((firstTag,index)=>{const firstTagStringified=JSON.stringify({label:firstTag.label,value:firstTag.value});return index===tags.flat(Infinity).findIndex(secondTag=>{return JSON.stringify({label:secondTag.label,value:secondTag.value})===firstTagStringified;});});};const get=(object,path,defaultValue)=>{if(!object)return defaultValue;let props=false;let prop;if(Array.isArray(path))props=path.slice(0);if(typeof path==="string")props=path.split(".");if(!Array.isArray(props))throw new Error("path must be an array or a string");let obj=object;while(props.length){prop=props.shift();if(!prop)return defaultValue;if(!obj)return defaultValue;if(obj===null||typeof obj!=="object"||Array.isArray(obj))return defaultValue;if(!(prop in obj))return defaultValue;obj=obj[prop];}return obj;};function prototypeCheck(prop){if(prop==="__proto__"||prop==="constructor"||prop==="prototype")return false;return true;}const setAtPath=(object,path,value)=>{let props=false;if(Array.isArray(path))props=path.slice(0);if(typeof path==="string")props=path.split(".");if(!Array.isArray(props))throw new Error("path must be an array or a string");const lastProp=props.pop();if(!lastProp)return false;if(!prototypeCheck(lastProp))throw new Error("setting of prototype values not supported");let thisProp;let obj=object;while(thisProp=props.shift()){if(!prototypeCheck(thisProp))throw new Error("setting of prototype values not supported");if(!thisProp)return false;if(!(thisProp in obj))obj[thisProp]={};obj=obj[thisProp];if(!obj||typeof obj!=="object")return false;}obj[lastProp]=value;return true;};function isPlainObject(value){return typeof value==="object"&&value!==null&&value.constructor===Object&&Object.prototype.toString.call(value)==="[object Object]";}var __defProp$2=Object.defineProperty;var __getOwnPropSymbols$2=Object.getOwnPropertySymbols;var __hasOwnProp$2=Object.prototype.hasOwnProperty;var __propIsEnum$2=Object.prototype.propertyIsEnumerable;var __defNormalProp$2=(obj,key,value)=>key in obj?__defProp$2(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues$2=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp$2.call(b,prop))__defNormalProp$2(a,prop,b[prop]);if(__getOwnPropSymbols$2)for(var prop of __getOwnPropSymbols$2(b)){if(__propIsEnum$2.call(b,prop))__defNormalProp$2(a,prop,b[prop]);}return a;};const useLoading=_ref81=>{let{initialLoadingOptions={},initialState=true}=_ref81;const[loadingOptions,setLoadingOptions]=React__default.useState(initialLoadingOptions);const[isLoading,setIsLoading]=React__default.useState(initialState);React__default.useEffect(()=>{let loaded=false;if(Object.keys(loadingOptions).length){for(const option in loadingOptions){if(loadingOptions[option])loaded=true;}}setIsLoading(loaded);},[loadingOptions]);const setLoadOption=React__default.useCallback(properties=>{setLoadingOptions(oldValue=>{return __spreadValues$2(__spreadValues$2({},oldValue),properties);});},[]);return[isLoading,loadingOptions,setLoadOption];};const useOptions=_ref82=>{let{initialState=[]}=_ref82;const[options,setOptions]=React__default.useState(initialState);const[groupOptions,setGroupOptions]=React__default.useState({});React__default.useEffect(()=>{const opts=[];for(const group in groupOptions){if(Array.isArray(groupOptions[group]))opts.push(...groupOptions[group]);}setOptions(filterUniqueTags(opts));},[groupOptions]);const setTagOption=React__default.useCallback(properties=>{setGroupOptions(oldValue=>__spreadValues$2(__spreadValues$2({},oldValue),properties));},[]);return[options,groupOptions,setTagOption];};var __defProp$1=Object.defineProperty;var __defProps$1=Object.defineProperties;var __getOwnPropDescs$1=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols$1=Object.getOwnPropertySymbols;var __hasOwnProp$1=Object.prototype.hasOwnProperty;var __propIsEnum$1=Object.prototype.propertyIsEnumerable;var __defNormalProp$1=(obj,key,value)=>key in obj?__defProp$1(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues$1=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp$1.call(b,prop))__defNormalProp$1(a,prop,b[prop]);if(__getOwnPropSymbols$1)for(var prop of __getOwnPropSymbols$1(b)){if(__propIsEnum$1.call(b,prop))__defNormalProp$1(a,prop,b[prop]);}return a;};var __spreadProps$1=(a,b)=>__defProps$1(a,__getOwnPropDescs$1(b));const prepareTag=_ref83=>{let{customLabel="label",customValue="value"}=_ref83;return tag=>{const tempTag=__spreadProps$1(__spreadValues$1({},tag),{_type:"tag",_key:tag.value,_labelTemp:tag.label,_valueTemp:tag.value,label:get(tag,customLabel),value:get(tag,customValue)});return tempTag;};};function revertTag(_ref84){let{customLabel="label",customValue="value",isReference}=_ref84;return tag=>{if(isReference===true){const tempTag2={_ref:tag._id,_type:"reference"};return tempTag2;}const tempTag=__spreadProps$1(__spreadValues$1({},tag),{label:tag._labelTemp,value:tag._valueTemp});setAtPath(tempTag,customLabel,tag.label);setAtPath(tempTag,customValue,tag.value);delete tempTag._labelTemp;delete tempTag._valueTemp;if(tempTag.label===void 0)delete tempTag.label;if(tempTag.value===void 0)delete tempTag.value;return tempTag;};}const prepareTags=async _ref85=>{let{client,tags,customLabel="label",customValue="value"}=_ref85;const prepare=prepareTag({customLabel,customValue});if(tags===void 0||tags===null)return void 0;if(Array.isArray(tags)&&!tags.length)return[];if(Array.isArray(tags)&&tags.length&&!isPlainObject(tags[0])){const normalized=tags.map(tag=>{const value=String(tag);const tempTag={label:value,value};setAtPath(tempTag,customLabel,value);setAtPath(tempTag,customValue,value);return tempTag;});return normalized.map(prepare);}if(Array.isArray(tags)&&isPlainObject(tags[0])&&"_ref"in tags[0]&&"_type"in tags[0]){return(await client.fetch("*[_id in $refs]",{refs:tags.map(tag=>tag._ref)})).map(prepare);}if(Array.isArray(tags))return tags.map(prepare);if(!isPlainObject(tags)){const value=String(tags);const tempTag={label:value,value};setAtPath(tempTag,customLabel,value);setAtPath(tempTag,customValue,value);return prepare(tempTag);}if(isPlainObject(tags)&&"_ref"in tags&&"_type"in tags)return prepare(await client.fetch("*[_id == $ref][0]",{ref:tags._ref}));return prepare(tags);};const prepareTagsAsList=async preparedTagsOptions=>{const preparedTags=await prepareTags(preparedTagsOptions);if(preparedTags===void 0)return[];if(!Array.isArray(preparedTags))return[preparedTags];return preparedTags;};function revertTags(_ref86){let{tags,customLabel="label",customValue="value",isMulti,isReference}=_ref86;const revert=revertTag({customLabel,customValue,isReference});if(tags===void 0)return void 0;if(isMulti){const tagsArray=Array.isArray(tags)?tags:[tags];return tagsArray.map(revert);}const tag=Array.isArray(tags)?tags[0]:tags;return revert(tag);}const refineTagsPipe=_ref87=>{let{client,customLabel="label",customValue="value"}=_ref87;return pipe$1(map(val=>Array.isArray(val)?val.flat(Infinity):val),switchMap(val=>prepareTagsAsList({client,tags:val,customLabel,customValue})),map(val=>filterUniqueTags(val)));};const getGeneralObservable=_ref88=>{let{client,query,params,customLabel="label",customValue="value"}=_ref88;return client.listen(query,params,listenOptions).pipe(switchMap(()=>client.fetch(query,params)),refineTagsPipe({client,customLabel,customValue}));};function getSelectedTags(_ref89){let{client,tags,isMulti,customLabel="label",customValue="value"}=_ref89;const tagFunction=async()=>tags;return defer(()=>from(tagFunction())).pipe(refineTagsPipe({client,customLabel,customValue}),map(val=>isMulti?val:val[0]));}const predefinedTagWrapper=async predefinedTags=>{const tags=await predefinedTags();if(!Array.isArray(tags))return[tags];return tags;};const getPredefinedTags=_ref90=>{let{client,predefinedTags,customLabel="label",customValue="value"}=_ref90;const tagFunction=predefinedTags instanceof Function?predefinedTags:async()=>predefinedTags;return defer(()=>from(predefinedTagWrapper(tagFunction)).pipe(refineTagsPipe({client,customLabel,customValue})));};const getTagsFromReference=_ref91=>{let{client,document,customLabel="label",customValue="value"}=_ref91;const query='\n *[ _type == $document && defined(@[$customLabel]) && defined(@[$customValue])] {\n _id,\n "value": coalesce(@[$customValue].current,@[$customValue]),\n "label": @[$customLabel]\n }\n ';const params={document,customLabel:customLabel.split(".")[0],customValue:customValue.split(".")[0]};return getGeneralObservable({client,query,params,customLabel,customValue});};const getTagsFromRelated=_ref92=>{let{client,documentType,field,isMulti,customLabel="label",customValue="value"}=_ref92;const query="\n *[\n _type == $documentType &&\n defined(@[$field]) &&\n defined(@[$field][]) == $isMulti &&\n (\n (!$isMulti && defined(@[$field]->[$customLabel]) && defined(@[$field]->[$customValue])) ||\n (!$isMulti && defined(@[$field][$customLabel]) && defined(@[$field][$customValue])) ||\n ($isMulti && defined(@[$field][]->[$customLabel]) && defined(@[$field][]->[$customValue])) ||\n ($isMulti && defined(@[$field][][$customLabel]) && defined(@[$field][][$customValue]))\n )\n ][$field]\n ";const params={documentType,field,isMulti,customLabel:customLabel.split(".")[0],customValue:customValue.split(".")[0]};return getGeneralObservable({client,query,params,customLabel,customValue});};const ReferenceCreateWarning=()=>/* @__PURE__ */jsxs(Card,{padding:[3,3,4],marginBottom:[3,3,4],radius:2,shadow:1,tone:"caution",children:["Tag References cannot be created inline. Please set the ",/* @__PURE__ */jsx("code",{children:"allowCreate"})," option explicitly to ",/* @__PURE__ */jsx("code",{children:"false"})," to remove this warning message."]});const ReferencePredefinedWarning=()=>/* @__PURE__ */jsxs(Card,{padding:[3,3,4],marginBottom:[3,3,4],radius:2,shadow:1,tone:"caution",children:["Tag References cannot have predefined tags. Please unset the ",/* @__PURE__ */jsx("code",{children:"predefinedTags"})," option to remove this warning message."]});function styleInject(css,ref){if(ref===void 0)ref={};var insertAt=ref.insertAt;if(!css||typeof document==='undefined'){return;}var head=document.head||document.getElementsByTagName('head')[0];var style=document.createElement('style');style.type='text/css';if(insertAt==='top'){if(head.firstChild){head.insertBefore(style,head.firstChild);}else{head.appendChild(style);}}else{head.appendChild(style);}if(style.styleSheet){style.styleSheet.cssText=css;}else{style.appendChild(document.createTextNode(css));}}var css_248z=".TagsInput-module_control__Om-kz {\n background-color: var(--card-bg-color) !important;\n border-color: var(--card-border-color) !important;\n transition: none !important;\n}\n\n.TagsInput-module_input__fdTrV {\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_control__Om-kz:hover {\n border-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_menu__l2H-i {\n background-color: var(--card-bg-color) !important;\n border: 1px solid var(--card-border-color) !important;\n}\n\n.TagsInput-module_option__cqS2H {\n background-color: var(--card-bg-color) !important;\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_option__cqS2H:hover {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_indicatorSeparator__koEIb {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_placeholder__ZjU5A,\n.TagsInput-module_singleValue__bIhOY {\n color: var(--input-fg-color) !important;\n}\n\n.TagsInput-module_multiValue__zq4m6 {\n background-color: var(--card-border-color) !important;\n}\n\n.TagsInput-module_multiValueLabel__R9vFQ {\n color: var(--card-fg-color) !important;\n}\n\n.TagsInput-module_multiValueRemove__2zX5H {\n color: var(--card-fg-color) !important;\n}\n\n.TagsInput-module_multiValueRemove__2zX5H:hover {\n color: #de350b !important;\n}\n";var styles={"control":"TagsInput-module_control__Om-kz","input":"TagsInput-module_input__fdTrV","menu":"TagsInput-module_menu__l2H-i","option":"TagsInput-module_option__cqS2H","indicatorSeparator":"TagsInput-module_indicatorSeparator__koEIb","placeholder":"TagsInput-module_placeholder__ZjU5A","singleValue":"TagsInput-module_singleValue__bIhOY","multiValue":"TagsInput-module_multiValue__zq4m6","multiValueLabel":"TagsInput-module_multiValueLabel__R9vFQ","multiValueRemove":"TagsInput-module_multiValueRemove__2zX5H"};styleInject(css_248z);var __defProp=Object.defineProperty;var __defProps=Object.defineProperties;var __getOwnPropDescs=Object.getOwnPropertyDescriptors;var __getOwnPropSymbols=Object.getOwnPropertySymbols;var __hasOwnProp=Object.prototype.hasOwnProperty;var __propIsEnum=Object.prototype.propertyIsEnumerable;var __defNormalProp=(obj,key,value)=>key in obj?__defProp(obj,key,{enumerable:true,configurable:true,writable:true,value}):obj[key]=value;var __spreadValues=(a,b)=>{for(var prop in b||(b={}))if(__hasOwnProp.call(b,prop))__defNormalProp(a,prop,b[prop]);if(__getOwnPropSymbols)for(var prop of __getOwnPropSymbols(b)){if(__propIsEnum.call(b,prop))__defNormalProp(a,prop,b[prop]);}return a;};var __spreadProps=(a,b)=>__defProps(a,__getOwnPropDescs(b));const TagsInput=forwardRef((props,ref)=>{const client=useClient();const documentType=useFormValue(["_type"]);const[selected,setSelected]=React__default.useState(void 0);const[isLoading,,setLoadOption]=useLoading({});const[options,,setTagOption]=useOptions({});const prefersDark=usePrefersDark();const{schemaType,// Schema information
|
|
2296
2336
|
value,// Current field value
|
|
2297
2337
|
readOnly,// Boolean if field is not editable
|
|
2298
2338
|
onChange// Method to handle patch events
|
|
2299
|
-
}=props;const isMulti=isSchemaMulti(schemaType);const isReference=isSchemaReference(schemaType);const{predefinedTags=
|
|
2300
|
-
unsubscribe:()=>{}};let selectedSubscription=defaultSubscription;let predefinedSubscription=defaultSubscription;let relatedSubscription=defaultSubscription;let referenceSubscription=defaultSubscription;setLoadOption({selectedTags:true,predefinedTags:true,referenceTags:true,relatedTags:true});selectedSubscription=getSelectedTags({client,tags:value,customLabel,customValue,isMulti}).subscribe(tags=>{setSelected(tags);setLoadOption({selectedTags:false});});predefinedSubscription=getPredefinedTags({client,predefinedTags,customLabel,customValue}).subscribe(tags=>{setTagOption({predefinedTags:tags});setLoadOption({predefinedTags:false});});if(typeof includeFromReference==="string"){referenceSubscription=getTagsFromReference({client,document:includeFromReference,customLabel,customValue}).subscribe(tags=>{setTagOption({referenceTags:tags});setLoadOption({referenceTags:false});});}else{setLoadOption({referenceTags:false});}if(typeof includeFromRelated==="string"){relatedSubscription=getTagsFromRelated({client,documentType,field:includeFromRelated,isMulti,customLabel,customValue}).subscribe(tags=>{setTagOption({relatedTags:tags});setLoadOption({relatedTags:false});});}else{setLoadOption({relatedTags:false});}return()=>{selectedSubscription.unsubscribe();predefinedSubscription.unsubscribe();relatedSubscription.unsubscribe();referenceSubscription.unsubscribe();};},[client,value,customLabel,customValue,isMulti,
|
|
2339
|
+
}=props;const isMulti=isSchemaMulti(schemaType);const isReference=isSchemaReference(schemaType);const{predefinedTags=void 0,includeFromReference=false,includeFromRelated=false,customLabel="label",customValue="value",allowCreate=true,onCreate=async val=>{const tag={};setAtPath(tag,customLabel,val);setAtPath(tag,customValue,val);return tag;},checkValid=(inputValue,currentValues)=>!currentValues.includes(inputValue)&&!!inputValue&&inputValue.trim()===inputValue,reactSelectOptions={}}=schemaType.options?schemaType.options:{};const resolvedPredefinedTags=Array.isArray(predefinedTags)&&!predefinedTags.length?void 0:predefinedTags;const isReferenceCreateWarning=schemaType.options&&allowCreate&&isReference;const isReferencePredefinedWarning=schemaType.options&&!!resolvedPredefinedTags&&isReference;useEffect$1(()=>{const defaultSubscription={// eslint-disable-next-line no-empty-function
|
|
2340
|
+
unsubscribe:()=>{}};let selectedSubscription=defaultSubscription;let predefinedSubscription=defaultSubscription;let relatedSubscription=defaultSubscription;let referenceSubscription=defaultSubscription;setLoadOption({selectedTags:true,predefinedTags:true,referenceTags:true,relatedTags:true});selectedSubscription=getSelectedTags({client,tags:value,customLabel,customValue,isMulti}).subscribe(tags=>{setSelected(tags);setLoadOption({selectedTags:false});});if(resolvedPredefinedTags===void 0){setTagOption({predefinedTags:[]});setLoadOption({predefinedTags:false});}else{predefinedSubscription=getPredefinedTags({client,predefinedTags:resolvedPredefinedTags,customLabel,customValue}).subscribe(tags=>{setTagOption({predefinedTags:tags});setLoadOption({predefinedTags:false});});}if(typeof includeFromReference==="string"){referenceSubscription=getTagsFromReference({client,document:includeFromReference,customLabel,customValue}).subscribe(tags=>{setTagOption({referenceTags:tags});setLoadOption({referenceTags:false});});}else{setLoadOption({referenceTags:false});}if(typeof includeFromRelated==="string"){relatedSubscription=getTagsFromRelated({client,documentType,field:includeFromRelated,isMulti,customLabel,customValue}).subscribe(tags=>{setTagOption({relatedTags:tags});setLoadOption({relatedTags:false});});}else{setLoadOption({relatedTags:false});}return()=>{selectedSubscription.unsubscribe();predefinedSubscription.unsubscribe();relatedSubscription.unsubscribe();referenceSubscription.unsubscribe();};},[client,value,customLabel,customValue,isMulti,resolvedPredefinedTags,includeFromReference,includeFromRelated,documentType,setLoadOption,setTagOption]);const handleChange=useCallback(inputValue=>{setSelected(inputValue);const tagsForEvent=revertTags({tags:inputValue,customLabel,customValue,isMulti,isReference});onChange(tagsForEvent?set(tagsForEvent):unset(tagsForEvent));},[onChange,customLabel,customValue,isMulti,isReference]);const handleCreate=React__default.useCallback(async inputValue=>{setLoadOption({handleCreate:true});const newCreateValue=await prepareTags({client,customLabel,customValue,tags:await onCreate(inputValue)});if(Array.isArray(selected)){handleChange([...selected,newCreateValue]);}else{handleChange(newCreateValue);}setLoadOption({handleCreate:false});},[client,customLabel,customValue,onCreate,selected,handleChange,setLoadOption]);const selectOptions=__spreadValues({isLoading,ref,isMulti,options,value:selected,isValidNewOption:(inputValue,selectedValues,selectedOptions)=>{return checkValid(inputValue,[...selectedOptions.map(opt=>opt.value),...selectedValues.map(val=>val.value)]);},onCreateOption:handleCreate,onChange:handleChange,isDisabled:readOnly||isLoading,styles:{menu:base=>__spreadProps(__spreadValues({},base),{zIndex:15// Adjusted dropdown menu z-index to prevent overlap with background items
|
|
2301
2341
|
})},classNames:prefersDark?{container:()=>styles.container,control:()=>styles.control,input:()=>styles.input,menu:()=>styles.menu,option:()=>styles.option,indicatorSeparator:()=>styles.indicatorSeparator,placeholder:()=>styles.placeholder,singleValue:()=>styles.singleValue,multiValue:()=>styles.multiValue,multiValueLabel:()=>styles.multiValueLabel,multiValueRemove:()=>styles.multiValueRemove}:{container:()=>styles.container,control:()=>styles.control,input:()=>styles.input,menu:()=>styles.menu,option:()=>styles.option,indicatorSeparator:()=>styles.indicatorSeparator,placeholder:()=>styles.placeholder,singleValue:()=>styles.singleValue,multiValue:()=>styles.multiValue,multiValueLabel:()=>styles.multiValueLabel,multiValueRemove:()=>styles.multiValueRemove}},reactSelectOptions);return/* @__PURE__ */jsxs(Fragment,{children:[isReferenceCreateWarning&&/* @__PURE__ */jsx(ReferenceCreateWarning,{}),isReferencePredefinedWarning&&/* @__PURE__ */jsx(ReferencePredefinedWarning,{}),allowCreate&&!isReference?/* @__PURE__ */jsx(CreatableSelect,__spreadValues({},selectOptions)):/* @__PURE__ */jsx(Select$1,__spreadValues({},selectOptions))]});});TagsInput.displayName="TagsInput";const tagSchema={name:"tag",title:"Tag",type:"object",components:{input:TagsInput},fields:[{name:"value",type:"string"},{name:"label",type:"string"}]};const tagsSchema={name:"tags",title:"Tags",type:"array",components:{input:TagsInput},of:[{type:"tag"}]};const tags=definePlugin(()=>({name:"sanity-plugin-tags",schema:{types:[tagSchema,tagsSchema]}}));export{dist,tags};
|
|
2302
|
-
//# sourceMappingURL=index-
|
|
2342
|
+
//# sourceMappingURL=index-672a6732.js.map
|