@melt-js/libs-react-leva 0.0.0-stage → 2026.11.13
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/README.md +115 -2
- package/hel_dist/assets/index-DMdT4ab7.js +80 -0
- package/hel_dist/assets/index-DMdT4ab7.js.map +1 -0
- package/hel_dist/hel-meta.json +70 -0
- package/hel_dist/index.html +24 -0
- package/hel_proxy/entry.js +32 -0
- package/hel_proxy/entry.js.map +1 -0
- package/hel_proxy_es/entry.js +21 -0
- package/hel_proxy_es/entry.js.map +1 -0
- package/package.json +76 -3
- package/scripts/check.mjs +18 -0
- package/scripts/gen-schema.mjs +305 -0
- package/scripts/meta.mjs +46 -0
- package/scripts/prepublishOnly.mjs +45 -0
- package/src/PropsPanel.tsx +52 -0
- package/src/PropsPlayground.tsx +152 -0
- package/src/configs/subApp.ts +8 -0
- package/src/core/__tests__/pure.test.ts +47 -0
- package/src/core/leva.ts +40 -0
- package/src/core/schema.ts +57 -0
- package/src/entrance/libProperties.ts +16 -0
- package/src/entrance/libTypes.ts +16 -0
- package/src/index.ts +19 -0
- package/src/loadApp.tsx +44 -0
- package/src/shims/jsx-runtime.mjs +18 -0
- package/src/shims/react-dom-client.mjs +8 -0
- package/src/shims/react-dom.mjs +8 -0
- package/src/shims/react-is.mjs +2 -0
- package/src/shims/react.mjs +72 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
(function(f,Pt){typeof exports=="object"&&typeof module<"u"?Pt(require("react"),require("react-dom/client"),require("react-dom")):typeof define=="function"&&define.amd?define(["react","react-dom/client","react-dom"],Pt):(f=typeof globalThis<"u"?globalThis:f||self,Pt(f.React,f.ReactDOM,f.ReactDOM))})(this,(function(f,Pt,Hu){"use strict";function zi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}function Uu(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}const E=zi(f),Dr=zi(Hu),m1="modulepreload",v1=function(e){return"https://unpkg.com/@melt-js/libs-react-leva@2026.11.13/hel_dist/"+e},b1={},Xt=function(t,n,r){let o=Promise.resolve();function i(s){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=s,window.dispatchEvent(a),!a.defaultPrevented)throw s}return o.then(s=>{for(const a of s||[])a.status==="rejected"&&i(a.reason);return t().catch(i)})};async function Wu(){const{isMasterApp:e}=await Xt(async()=>{const{isMasterApp:o}=await Promise.resolve().then(()=>Qu);return{isMasterApp:o}},void 0),{libReady:t}=await Xt(async()=>{const{libReady:o}=await Promise.resolve().then(()=>xp);return{libReady:o}},void 0),{LIB_NAME:n}=await Xt(async()=>{const{LIB_NAME:o}=await Promise.resolve().then(()=>Cp);return{LIB_NAME:o}},void 0),r=await Xt(()=>Promise.resolve().then(()=>f1),void 0);t(n,r.default),e()&&await Xt(()=>Promise.resolve().then(()=>h1),void 0)}Wu().catch(console.error);var Ir=Gu();Yu();var Ku=Xu();function Lr(){return window||global}function Gu(){var e=Lr(),t=e.__HEL_LOAD_ASSETS_FLAG__,n=e.__HEL_ISO_FLAG__,r=e.__MASTER_APP_LOADED__;return{isLoadAssetsCalled:t===1,isFirstMod:n===void 0,isBeforeCore:r===void 0}}function Yu(){var e=Lr();e.__HEL_ISO_FLAG__===void 0&&(e.__HEL_ISO_FLAG__=1)}function qu(){var e="";try{throw new Error("codeHost")}catch(o){var t=o.stack.split(`
|
|
2
|
+
`);e=t[t.length-1]||""}var n=e.split("//")[1]||"",r=n.split("/")[0];return r}function Xu(){var e=Lr(),t=e.location,n=e.__HEL_MICRO_SHARED__,r=Ir.isFirstMod,o=Ir.isBeforeCore,i=Ir.isLoadAssetsCalled;if(i||!r)return!1;if(o)return!0;var s=qu();if(t&&t.host===s)return!0;if(n){var a=n.cacheRoot,l=a.appGroupName2platform,c=a.appName2platform,u=l||c||{};if(!Object.keys(u).length)return!0}return!1}function Ju(){return Ku}var Zu=Ju;const Qu=Object.freeze(Object.defineProperty({__proto__:null,isMasterApp:Zu},Symbol.toStringTag,{value:"Module"}));function kr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ef(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var Jt={exports:{}};function Mr(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tf(e){if(Array.isArray(e))return e}function nf(e){if(Array.isArray(e))return Mr(e)}function rf(e,t){var n=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=Rr(e))||t){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(l){throw l},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
3
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var l=n.next();return s=l.done,l},e:function(l){a=!0,i=l},f:function(){try{s||n.return==null||n.return()}finally{if(a)throw i}}}}function Nr(e,t,n){return(t=uf(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function of(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function sf(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,o,i,s,a=[],l=!0,c=!1;try{if(i=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(a.push(r.value),a.length!==t);l=!0);}catch(u){c=!0,o=u}finally{try{if(!l&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(c)throw o}}return a}}function af(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
4
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lf(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
5
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hi(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Zt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hi(Object(n),!0).forEach(function(r){Nr(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hi(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Ln(e,t){return tf(e)||sf(e,t)||Rr(e,t)||af()}function jr(e){return nf(e)||of(e)||Rr(e)||lf()}function cf(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uf(e){var t=cf(e,"string");return typeof t=="symbol"?t:t+""}function $t(e){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(e)}function Rr(e,t){if(e){if(typeof e=="string")return Mr(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Mr(e,t):void 0}}var je=null;function ff(){if(typeof window<"u"){je=window;return}if(typeof global<"u"){je=global;return}throw new Error("unable to locate global object")}function _e(){return je||ff(),je}function df(e){var t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=null;(t=je)!==null&&t!==void 0&&t.__HEL_MICRO_SHARED__&&(r=je.__HEL_MICRO_SHARED__),n?je=Zt(Zt({},je),e):je=e,r&&(je.__HEL_MICRO_SHARED__=r)}function kn(){return _e()}function Ui(){var e=_e();return e.MutationObserver||e.WebKitMutationObserver||e.MozMutationObserver}function Wi(e,t){for(var n=null,r=e.length,o=0;o<r;o++){var i=e[o];if(i.tagName===t){n=i;break}}return n}function Ki(e){return Object.keys(e)}function pf(){var e=function(o){var i=o||{},s=i.search||"";if(!s){var a=i.hash||"",l=a.split("?")[1]||"";l&&(s="?".concat(l))}return s};try{var t;return e((t=_e())===null||t===void 0||(t=t.top)===null||t===void 0?void 0:t.location)}catch{var n;return e((n=_e())===null||n===void 0?void 0:n.location)}}function Gi(e){var t,n=(t=_e())===null||t===void 0?void 0:t.localStorage;return n==null?void 0:n.getItem(e)}function Yi(e,t){var n,r=(n=_e())===null||n===void 0?void 0:n.localStorage;return r==null?void 0:r.setItem(e,t)}function hf(){var e=pf(),t={};if(e!=null&&e.startsWith("?")){var n=e.substring(1),r=n.split("&");r.forEach(function(o){var i=o.split("="),s=Ln(i,2),a=s[0],l=s[1];t[a]=l})}return t}function qi(){var e="";try{throw new Error("getJsRunLocation")}catch(r){var t=r.stack.split(`
|
|
6
|
+
`),n=t.length;e=t[n-1]||t[n-2]||""}return e}function Ie(e,t,n,r){var o=q(e,t);o[n]=r}function q(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=e[t];return r||(r=n,e[t]=r),r}function Xi(e,t){Object.keys(t).forEach(function(n){var r=t[n];[null,void 0,""].includes(r)||(e[n]=r)})}function Fr(e,t){e.includes(t)||e.push(t)}function Ji(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=t.nullValues,r=n===void 0?[null,void 0,""]:n,o=t.emptyObjIsNull,i=o===void 0?!0:o,s=t.emptyArrIsNull,a=s===void 0?!0:s,l=r.includes(e);if(l)return!0;if(Array.isArray(e))return a?e.length===0:!1;if($t(e)==="object"){var c=Ki(e),u=c.length;return i?u===0:!1}return!1}function Zi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return t}function gf(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function mf(){var e=_e();return e.process&&e.global&&!e.document}function vf(e,t,n){if(e&&typeof e!="string")return e;try{var r=JSON.parse(e);return r||t}catch(o){if(t!==void 0)return t;throw n?new Error(n):o}}var Qi=Ji,Vr=Fr,es=Ki;function bf(e,t){var n=[];return e.forEach(function(r){return Vr(n,r)}),t.forEach(function(r){return Vr(n,r)}),n}function ts(e,t){var n=t||function(o){return!Qi(o)},r={};return es(e).forEach(function(o){n(e[o])&&(r[o]=e[o])}),r}function yf(e,t,n){var r=n,o=rf(e),i;try{for(o.s();!(i=o.n()).done;){var s=i.value,a=s[t];if(![null,void 0,""].includes(a)){r=a;break}}}catch(l){o.e(l)}finally{o.f()}return r}function ns(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"MULTI",n=e.split(`
|
|
7
|
+
`),r=n.length-1,o=n.map(function(i,s){var a;if(!i&&(s===0||s===r))return"";var l=function(d,p){var h=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"",g=d;return d.endsWith("<br/>")?(g=d.substring(0,g.length-5),"".concat(g).concat(p)):"".concat(g).concat(h)},c=((a=i.trimStart)===null||a===void 0?void 0:a.call(i))||i;return t==="MULTI"?"".concat(l(c,""),`
|
|
8
|
+
`):(c=l(c,`
|
|
9
|
+
`," "),c)}).join("");return o}function rs(e){return ns(e,"ONE")}function Ef(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,n=_e(),r=rs(e),o=n.alert||Zi;if(t){var i;!((i=n.location)===null||i===void 0)&&i.port&&o(r);return}o(r)}function We(e,t,n){e.dataset?e.dataset[t]=n:e.setAttribute("data-".concat(t),n)}function Mn(e){We(e,"heldisabled","1"),e.disabled=!0}var _f=Object.freeze({__proto__:null,noop:Zi,hasProp:gf,isServer:mf,safeParse:vf,isNull:Qi,noDupPush:Vr,okeys:es,merge2List:bf,purify:ts,getObjsVal:yf,pfstr:ns,nbstr:rs,nbalert:Ef,setDataset:We,disableNode:Mn});function wf(e,t){var n=this,r=t.fn,o=t.fnName,i=t.arg1PlatObjFnKeys,s=i.includes(o);return function(){for(var a=function(g){return Zt({platform:e},ts(g||{}))},l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=c[0],p=c[1];return s?c[0]=a(d):c[1]=a(p),r.apply(n,c)}}function os(e,t,n){var r=n||{},o=r.ignoreKeys,i=o===void 0?[]:o,s=r.arg1PlatObjFnKeys,a=s===void 0?[]:s,l={};return Object.keys(t).forEach(function(c){var u=t[c];if(i.includes(c)){l[c]=u;return}var d=$t(u);if(d&&d==="object"){l[c]=os(e,u,n);return}if(d==="function"){l[c]=wf(e,{arg1PlatObjFnKeys:a,fn:u,fnName:c});return}l[c]=u}),l}var Sf="hel",is="unpkg",Br={NONE:0,LOG:1,TRACE:2},Z="__default_online_ver__",ss=is,te={CORE_VER:"4.13.1",DEFAULT_API_PREFIX:"https://unpkg.com",DEFAULT_API_URL:"/openapi/v1/app/info",DEFAULT_ONLINE_VER:Z,DEFAULT_USER_LS_KEY:"HelUserRtxName",DEFAULT_PLAT:ss,LS_LOG_MODE:"HelConfig.logMode",LS_LOG_FILTER:"HelConfig.logFilter",PLAT_HEL:Sf,PLAT_UNPKG:is,KEY_CSS_STR:"CSS_STR",KEY_ASSET_CTX:"ASSET_CTX",KEY_STYLE_TAG_ADDED:"STYLE_TAG_ADDED",KEY_CSS_LINK_TAG_ADDED:"CSS_LINK_TAG_ADDED",KEY_IGNORE_CSS_PREFIX_LIST:"IGNORE_CSS_PREFIX_LIST",KEY_IGNORE_STYLE_TAG_KEY:"IGNORE_STYLE_TAG_KEY",KEY_IGNORE_CSS_PREFIX_2_KEYS:"IGNORE_CSS_PREFIX_2_KEYS"},Qt={SUB_APP_LOADED:"subAppLoaded",SUB_LIB_LOADED:"SubLibLoaded",STYLE_STR_FETCHED:"StyleStrFetched",STYLE_TAG_ADDED:"StyleTagAdded",CSS_LINK_TAG_ADDED:"CssLinkTagAdded"},en={NOT_LOAD:0,LOADING:1,LOADED:2},as=te.LS_LOG_FILTER,ls=te.LS_LOG_MODE,tn=Br.NONE,cs=Br.LOG,xf=Br.TRACE,at={isIncludeFilter:function(t,n){if(!n.includes(","))return t.includes(n);var r=n.split(",");return r.some(function(o){return t.includes(o)})},getLogFilter:function(){return ht().logFilter},setLogFilter:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;ht().logFilter=t,n&&Yi(as,t)},setLogMode:function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,r=parseInt(t,10);[tn,cs,xf].includes(r)&&(ht().logMode=r,n&&Yi(ls,r))},getLogMode:function(){return ht().logMode}},lt={};function Cf(){if(!ht().isInit){ht().isInit=!0;var e=hf(),t=e.hellog,n=e.hellogf,r=t||Gi(ls)||tn;at.setLogMode(r,!1);var o=n||Gi(as)||"";at.setLogFilter(o,!1)}}function Of(){return{logMode:tn,logFilter:"",isInit:!1}}function Pf(){if(lt=kn().__HEL_MICRO_DEBUG__,!Ji(lt)){lt.logMode===void 0&&(lt.logMode=tn,lt.logFilter="");return}lt=Of(),kn().__HEL_MICRO_DEBUG__=lt;try{Cf()}catch{}}function Nn(){return at.getLogMode()!==tn}function ht(){return lt}var us=" %c--> HEL LOG:",fs="color:#ad4e00;font-weight:600";function me(){if(Nn()){for(var e=at.getLogMode()===cs?console.log:console.trace||console.log,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var o=n[0],i=n.slice(1);if(typeof o!="string")return e.apply(void 0,[us,fs].concat(n));var s=at.getLogFilter(),a=["".concat(us," ").concat(o),fs].concat(jr(i));if(s){at.isIncludeFilter(o,s)&&e.apply(void 0,jr(a));return}e.apply(void 0,jr(a))}}var nn={};function $f(e){!Nn()||nn[e]||(nn[e]=Date.now())}function zr(e,t,n){if(!(!Nn()||!nn[e])){var r=nn[e];me("[[ PerfCheck ]] (".concat(e,"/").concat(t,") costs ").concat(Date.now()-r," ms")),n&&ds(e)}}function ds(e){nn[e]=0}var Af=te.DEFAULT_API_URL,Tf=te.DEFAULT_USER_LS_KEY,Hr=te.PLAT_HEL,ps=te.PLAT_UNPKG,Df=te.DEFAULT_API_PREFIX,If=te.CORE_VER,Lf=te.KEY_CSS_LINK_TAG_ADDED,kf=te.KEY_STYLE_TAG_ADDED,hs=te.KEY_IGNORE_CSS_PREFIX_LIST,Mf=te.KEY_IGNORE_STYLE_TAG_KEY,Nf=te.KEY_IGNORE_CSS_PREFIX_2_KEYS;function Ur(e){var t=e||{},n=t.apiPrefix;return{apiMode:"get",apiPrefix:n,apiSuffix:"",apiPathOfApp:Af,apiPathOfAppVersion:"",getSubAppAndItsVersionFn:null,customMetaUrl:"",customMetaJsonpUrl:"",getMeta:null,onFetchMetaFailed:null,strictMatchVer:!0,getUserName:null,userLsKey:Tf,shouldUseGray:null,trustAppNames:null,semverApi:null,hook:{}}}function Wr(e){var t=Zt(Zt({isConfigOverwrite:!1,platform:e,appName2Comp:{},appName2Lib:{},appName2isLibAssigned:{},appName2EmitApp:{},appName2verLoadStatus:{},appName2verEmitLib:{},appName2verEmitApp:{},appName2verStyleStr:{},appName2verStyleFetched:{},appName2verExtraCssList:{},appName2verAppVersion:{},appName2verCustomData:{},appName2app:{},appName2appVersion:{},appName2styleStr:{},appGroupName2firstVer:{},isOriginInitCalled:!1},Ur()),{},{origin:Ur({apiPrefix:Df})});return t}function Kr(){var e={};return{on:function(n,r){var o=e[n];if(!o){var i=[];e[n]=i,o=i}o.push(r)},emit:function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var s=e[n];if(s){var a=s.slice();a.forEach(function(l){return l.apply(void 0,o)})}},off:function(n,r){var o=e[n];if(o)for(var i=0,s=o.length;i<s;i++){var a=o[i];if(a===r){o.splice(i,1);break}}}}}function jf(){var e=Wr(ps),t=Wr(Hr),n={platform:Hr,platformHint:"the platform value here does not make any sense!",appName2platform:{},appGroupName2platform:{},caches:Nr(Nr({},ps,e),Hr,t),common:{}},r=Kr(),o=Kr();return{ver:If,isStyleObInit:!1,nativeHeadAppend:null,nativeBodyAppend:null,patchedHeadAppend:null,patchedBodyAppend:null,createFeature:qi(),eventBus:r,userEventBus:o,cacheRoot:n,unpkgCache:e,helCache:t,dev:{setLogMode:at.setLogMode,setLogFilter:at.setLogFilter}}}function gs(e){var t=[Lf,kf,hs,Mf,Nf],n=function(o){return o===hs?[]:{}};t.forEach(function(r){return q(e,r,n(r))})}function Rf(){var e=gt();if(e){var t=e.cacheRoot;q(t,"appGroupName2platform"),q(t,"common");var n=t.caches;Object.keys(n).forEach(function(r){var o=n[r];q(o,"appGroupName2firstVer"),q(o,"appName2isLibAssigned"),q(o,"appName2verExtraCssList"),q(o,"appName2verCustomData"),q(o,"hook"),q(o,"origin",Ur()),q(o.origin,"hook")}),gs(t.common),e.userEventBus||(e.userEventBus=Kr());return}e=jf(),gs(e.cacheRoot.common),kn().__HEL_MICRO_SHARED__=e}function gt(){var e=kn().__HEL_MICRO_SHARED__;return e}function jn(){return ss}function Q(e){var t=e||jn(),n=mt(),r=n.caches[t];if(!r){var o=$t(e);if(o!=="string")throw console.error("invalid plaform:",e),new Error("fatal error: platform only can be a string, now it is ".concat(o));var i=Wr(e);n.caches[t]=i,r=i}return r}function mt(){return gt().cacheRoot}var Ke={getCustomData:function(t,n,r){var o=r.versionId,i=r.platform,s=Q(i),a=s.appName2verCustomData,l=q(a,t),c=q(l,n);return c[o||Z]},getAppMeta:function(t,n){var r=Q(n),o=r.appName2app;return o[t]},setVerLoadStatus:function(t,n,r,o){var i=o||{},s=i.versionId,a=i.platform,l=Q(a)[r],c=s||Z;Ie(l,t,c,n)},getVerLoadStatus:function(t,n,r){var o,i=r||{},s=i.versionId,a=i.platform,l=Q(a)[n],c=s||Z;return((o=l[t])===null||o===void 0?void 0:o[c])||en.NOT_LOAD},ensureOnlineModule:function(t,n,r){if(!t[Z]){var o=Ke.getAppMeta(n,r),i=t[o==null?void 0:o.online_version];i&&(t[Z]=i)}}};function Ff(e,t){var n,r=t||{},o=r.versionId,i=r.platform,s=Q(i),a=s.appName2verEmitApp,l=s.appName2Comp,c=s.strictMatchVer,u=s.appName2EmitApp,d=(n=r.strictMatchVer)!==null&&n!==void 0?n:c,p=q(a,e);Ke.ensureOnlineModule(p,e,i);var h=o||Z,g=p[h],m=l[e],b=m?{Comp:m}:null,v=d?null:u[e]||b,y=g||v||null;return me("[[ core:getVerApp ]] appName,options,result:",e,r,y),y}function ms(e,t){me("[[ core:setEmitApp ]] appName,emitApp:",e,t);var n=t.versionId,r=t.platform,o=Q(r),i=o.appName2verEmitApp,s=o.appName2Comp,a=o.appName2EmitApp,l=q(i,e);l[Z]||(s[e]=t.Comp,a[e]=t,Ie(i,e,Z,t)),n&&Ie(i,e,n,t)}var vs=te.KEY_CSS_LINK_TAG_ADDED,Gr=te.KEY_STYLE_TAG_ADDED,bs=te.KEY_IGNORE_CSS_PREFIX_LIST,Vf=te.KEY_IGNORE_STYLE_TAG_KEY,Yr=te.KEY_IGNORE_CSS_PREFIX_2_KEYS;function ys(e){var t=mt(),n=t.common,r=q(n,e);return r}function Rn(e){var t=mt(),n=t.common;return n[e]}function rn(e,t){var n=ys(e),r=n[t];return r!==void 0?r:null}function on(e,t,n){var r=ys(e);r[t]=n}var Oe={setIgnoreCssPrefix:function(t){var n=Rn(bs);Fr(n,t)},setIgnoreStyleTagKey:function(t){var n=Oe.getIgnoreStyleTagMap();n[t]=1},getIgnoreStyleTagMap:function(){var t=Rn(Vf);return t},setIgnoreCssPrefixKey:function(t,n){var r=rn(Yr,t);r||(r=[],on(Yr,t,r)),Fr(r,n)},getIgnoreCssPrefixKeys:function(t){var n=Rn(Yr);return n[t]||[]},getMatchedIgnoreCssPrefix:function(t){for(var n=Rn(bs),r="",o=0;o<n.length;o++){var i=n[o];if(t.startsWith(i)){r=i;break}}return r},getIgnoreCssPrefixCssUrlList:function(t){var n=rn(vs,t);return n||(n=[],on(vs,t,n)),n},setIgnoreCssPrefixCssUrl:function(t,n){var r=Oe.getIgnoreCssPrefixCssUrlList(t);r.push(n)},getStyleTagText:function(t){var n=rn(Gr,t)||"";return n},clearStyleTagText:function(t){on(Gr,t,"")},appendStyleTagText:function(t,n){var r=Oe.getStyleTagText(t);on(Gr,t,"".concat(r," ").concat(n))}};function qr(e,t){var n=e.apiMode,r=e.apiPrefix,o=e.apiSuffix,i=e.apiPathOfApp,s=e.apiPathOfAppVersion,a=e.getSubAppAndItsVersionFn,l=e.onFetchMetaFailed,c=e.strictMatchVer,u=e.getUserName,d=e.userLsKey,p=e.shouldUseGray,h=e.getApiPrefix,g=e.trustAppNames,m=e.platform,b=e.origin,v=e.hook,y=e.customMetaUrl,S=e.customMetaJsonpUrl,w=e.getMeta,C={apiMode:n,apiPrefix:r,apiSuffix:o,apiPathOfApp:i,apiPathOfAppVersion:s,getSubAppAndItsVersionFn:a,onFetchMetaFailed:l,strictMatchVer:c,getUserName:u,userLsKey:d,shouldUseGray:p,getApiPrefix:h,trustAppNames:g,hook:v,platform:m,customMetaUrl:y,customMetaJsonpUrl:S,getMeta:w};return t&&(C.origin=b),C}function Bf(e){var t=Q(e);return qr(t,!0)}function zf(e){var t=gt(),n=t.nativeHeadAppend,r=t.nativeBodyAppend,o=e.headAppend||null,i=e.bodyAppend||null,s=function(l){return"pass same ".concat(l," handle, hel will ignore it for avlid 'Maximum call stack size exceeded'")};o&&o===n?console.error(s("headAppend")):t.patchedHeadAppend=o,i&&i===r?console.error(s("bodyAppend")):t.patchedBodyAppend=i}function Hf(e,t){var n=Q(t),r=qr(e);n.isConfigOverwrite||(n.isConfigOverwrite=!0,Xi(n,r))}function Uf(e,t){var n=Q(e),r="[[ core:originInit ]] invalid call, it can only been called";if(n.isConfigOverwrite){me("".concat(r," before init"));return}if(n.isOriginInitCalled){me("".concat(r," one time"));return}var o=qr(t);n.isOriginInitCalled=!0,Xi(n.origin,o)}function Fn(e){return mt().appGroupName2platform[e]||jn()}function Wf(e,t,n){var r=mt().appGroupName2platform;return(n||!r[e])&&(r[e]=t),Fn(e)}function Xr(e){return mt().appName2platform[e]||jn()}function Kf(e,t,n){var r=mt().appName2platform;return(n||!r[e])&&(r[e]=t),Xr(e)}function Es(e,t){var n=t.customKey,r=t.platform,o=r===void 0?Xr(e):r,i=Q(o),s=i.appName2verCustomData,a=q(s,e),l=q(a,n);return l}function Gf(e,t){var n=Es(e,t),r=n[t.versionId||Z];return r!==void 0?r:null}function Yf(e,t){var n=t.customValue,r=t.versionId,o=Es(e,t);o[r||Z]=n,o[Z]||(o[Z]=n)}var qf=Qt.STYLE_TAG_ADDED,Xf=Qt.CSS_LINK_TAG_ADDED;function At(){return gt().eventBus}function Jf(){return gt().userEventBus}var Vn={styleTagAdded:function(t){return"".concat(qf,"/").concat(t)},cssLinkTagAdded:function(t){return"".concat(Xf,"(").concat(t,")")}};function Zf(e,t){var n,r=t||{},o=r.versionId,i=r.platform,s=Q(i),a=s.appName2verEmitLib,l=s.appName2Lib,c=s.strictMatchVer,u=s.appName2isLibAssigned,d=(n=r.strictMatchVer)!==null&&n!==void 0?n:c,p=q(a,e);Ke.ensureOnlineModule(p,e);var h=o||Z,g=p[h],m=u[e]?l[e]:null,b=d?null:m,v=g||b||null;return me("[[ core:getVerLib ]] appName,options,result:",e,r,v),v}function _s(e,t,n){var r=n||{},o=r.appGroupName,i=t.versionId,s=t.appProperties,a=t.platform||n.platform,l=Q(a),c=l.appName2verEmitLib,u=l.appName2Lib,d=l.appName2isLibAssigned,p=Ke.getAppMeta(e,a),h=function(b){var v=u[b];v?$t(v)==="object"&&Object.keys(v).length===0&&Object.assign(v,s):u[b]=s,d[b]=!0};h(e),o?h(o):p&&h(p.app_group_name),me("[[ core:setEmitLib ]] appMeta:",p);var g=q(c,e);g[Z]||Ie(c,e,Z,s),i&&Ie(c,e,i,s)}function ws(e,t){var n=Q(t),r=n.appName2app;return r[e]}function Qf(e,t){var n=Q(t),r=n.appName2app;r[e.name]=e}function Jr(e,t,n){Ke.setVerLoadStatus(e,t,"appName2verLoadStatus",n)}function ed(e,t){return Ke.getVerLoadStatus(e,"appName2verLoadStatus",t)}function td(e,t,n){Ke.setVerLoadStatus(e,t,"appName2verStyleFetched",n)}function nd(e,t){return Ke.getVerLoadStatus(e,"appName2verStyleFetched",t)}function rd(e,t){var n,r=t||{},o=r.platform,i=r.versionId,s=Q(o),a=s.appName2verStyleStr,l=s.appName2styleStr,c=l[e]||"";return i?((n=a[e])===null||n===void 0?void 0:n[i])||c||"":c}function od(e,t,n){var r=n||{},o=r.platform,i=r.versionId,s=Q(o),a=s.appName2verStyleStr,l=s.appName2verStyleFetched,c=s.appName2styleStr;if(!i){c[e]=t;return}Ie(a,e,i,t),Ie(l,e,i,en.LOADED)}function id(e,t,n){var r=n||{},o=r.versionId,i=r.platform,s=Q(i),a=s.appName2verExtraCssList;me("[[ core:setVerExtraCssList ]] cssList:",t);var l=q(a,e);l[Z]||Ie(a,e,Z,t),o&&Ie(a,e,o,t)}function sd(e,t){var n=t||{},r=n.versionId,o=n.platform,i=Q(o),s=i.appName2verExtraCssList,a=q(s,e),l=a[r]||a[Z]||[];return me("[[ core:getVerExtraCssList ]] options,cssList:",n,l),l}function ad(e,t){var n,r=t||{},o=r.platform,i=r.versionId,s=Q(o),a=s.appName2verAppVersion,l=s.appName2appVersion,c=l[e]||null;return i&&((n=a[e])===null||n===void 0?void 0:n[i])||c}function ld(e,t,n){var r=n||{},o=r.platform,i=Q(o),s=i.appName2verAppVersion,a=i.appGroupName2firstVer,l=i.appName2appVersion,c=t.version_tag||t.sub_app_version;if(c){var u=Ke.getAppMeta(e,o),d=q(s,e);d[Z]||(Ie(s,e,Z,t),l[e]=t),Ie(s,e,c,t),a[u.app_group_name]=t.sub_app_version}}function sn(e,t){var n=e.split("@"),r=n.slice(1),o=r.join("@");return o||t||e}function Ss(e){return e==="js"||e==="mjs"}function Zr(e,t){var n=qi();me("[[ core:tryGetVersion ]] may include ver source > ".concat(n));var r=Q(t),o=r.appGroupName2firstVer,i=o[e]||"";if(n.includes("https://")||n.includes("http://")){var s=n.split("//"),a=Ln(s,2),l=a[1],c=l.split("/");if(i){var u=l.includes("/".concat(i,"/"));if(u){var d=i.startsWith("@");if(d){var m=i.split("/")[1]||"";return sn(m)}else{var p=c.indexOf(i),h=c[p-1],g=h.startsWith("@");if(!g)return sn(i)}}var b=c[1],v=c[2];if(b==="static"&&Ss(v)||Ss(b))return sn(i)}var y=l.indexOf("@");if(y>=0){var S=c.filter(function(M){return M.includes("@")}),w=S.findIndex(function(M){return M.startsWith("@")});if(w>=0){var C=S[w+1]||"";return sn(C,i)}var _=S[0]||"";return sn(_,i)}var x=l.split("/".concat(t,"/")),k=Ln(x,2),R=k[1],O=R===void 0?"":R,T=O.split("/"),D=Ln(T,1),P=D[0];return P||i}return i}function Qr(e,t){if(e===Z)return t||"";if(e.includes("_")){var n=e.substring(0,e.length-15);return n}return t||""}var eo=!1,to=!1;function cd(e){if(e&&(eo=!1,to=!1),!to){to=!0;var t=_e();t.__MASTER_APP_LOADED__===void 0&&(t.__MASTER_APP_LOADED__=!0,eo=!0)}}function ud(){var e=`WARNING: calling isSubApp is unsafe, use hel-iso.isSubApp instead,
|
|
10
|
+
`;return e+="more details see: https://tnfe.github.io/hel/docs/tutorial/attention-is-subapp",console.log("%c".concat(e),"color:red;"),!eo}function fd(e,t){var n=t.platform,r=t.groupName,o=t.name,i=t.ver,s=t.elName;We(e,"el",s),We(e,"plat",n),We(e,"gname",r),We(e,"name",o),We(e,"ver",i)}var dd=te.KEY_ASSET_CTX;function no(e,t){if(!t||!["LINK","SCRIPT"].includes(t.tagName))return e(t);var n=t.href,r=t.tagName,o=t.src,i=n||o||"",s=r==="LINK",a=rn(dd,i)||{},l=a.platform,c=a.groupName,u=a.name,d=a.ver,p=a.beforeAppend,h=t;if(p){var g=s?"href":"src",m=t.getAttribute(g),b=function(S){return t.setAttribute(g,S)};h=p({el:t,nativeAppend:e,setAssetUrl:b,url:m,tagName:r})||t}var v=s?"HelLink":"HelScript";return l&&fd(h,{platform:l,groupName:c,name:u,ver:d,elName:v}),e(h)}function pd(){var e=_e();if(!(e.__POWERED_BY_QIANKUN__||e.__DISABLE_HEL_MONKEY_PATCH__)){var t=gt(),n=e.document,r=t.nativeHeadAppend,o=t.nativeBodyAppend;if(!(r||!n)){var i=n.head,s=n.body;if(r=i.appendChild.bind(i),t.nativeHeadAppend=r,s)o=s.appendChild.bind(s),t.nativeBodyAppend=o;else{var a=Ui(),l=new a(function(d){for(var p,h=0;h<d.length;h++){var g=d[h].addedNodes;if(p=Wi(g,"BODY"),p)break}p&&(o=p.appendChild.bind(p),t.nativeBodyAppend=o,p.appendChild=function(m){return no(u(o,p,"body"),m)},l.disconnect())}),c=Wi(n.childNodes,"HTML");c&&l.observe(c,{childList:!0})}var u=function(p,h,g){var m=t.patchedHeadAppend,b=t.patchedBodyAppend,v=g==="head";if(m&&v)return m;if(b&&!v)return b;if(e.__POWERED_BY_WUJIE__)return p;var y=e.Element;return y?y.prototype.appendChild.bind(h):p};i.appendChild=function(d){return no(u(r,i,"head"),d)},s&&(s.appendChild=function(d){return no(u(o,s,"body"),d)})}}}var xs="preFetch";function hd(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.platform||Fn(e),o=n.versionId||Zr(e,r),i=n.appName||Qr(o,e);me("[[ core:libReady ]] appGroupName ".concat(e,", appName ").concat(i,", versionId ").concat(o));var s=ws(i,r);s!=null&&s.__fromCust&&(o=n.versionId||s.online_version,i=s.name,me("[[ core:libReady ]] fromCust, appGroupName ".concat(e,", appName ").concat(i,", versionId ").concat(o)));var a={platform:r,appName:i,appGroupName:e,versionId:o,appProperties:t,Comp:function(){},lifecycle:{}};_s(i,a,{appGroupName:e,platform:r}),Jr(i,en.LOADED,{versionId:o,platform:r});var l=At();zr(xs,"libReady"),l.emit(Qt.SUB_LIB_LOADED,a)}function gd(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.lifecycle,o=n.platform||Fn(e),i=n.versionId||Zr(e,o),s=n.appName||Qr(i,e),a={Comp:t,appName:s,appGroupName:e,lifecycle:r,platform:o,versionId:i,isLib:!1};ms(s,a),Jr(s,en.LOADED,{versionId:i,platform:o});var l=At();zr(xs,"appReady"),l.emit(Qt.SUB_APP_LOADED,a)}var Cs="/* @helstart ",md=" @helend */",vd=Cs.length;function bd(e,t){var n=At(),r=Oe.getMatchedIgnoreCssPrefix(t);return r&&(Oe.setIgnoreCssPrefixCssUrl(r,t),n.emit(Vn.cssLinkTagAdded(r),{nodes:[e]})),r}function yd(e){var t=_e();if(t){var n=t.document.head.querySelectorAll('style[data-gname="'.concat(e,'"]'));if(n.length){Oe.clearStyleTagText(e),n.forEach(function(o){Mn(o),Oe.appendStyleTagText(e,o.innerText)});var r=At();r.emit(Vn.styleTagAdded(e),{nodes:n})}}}function Ed(e,t){var n=e.tagName,r=e.innerText,o=e.href;if(["STYLE","LINK"].includes(n)){if(n==="STYLE"){if(!r)return;var i=r.indexOf(Cs);if(i<0)return;var s=r.indexOf(md);if(s<0)return;var a=r.substring(vd+i,s);if(a){var l=a.trim(),c="",u=l;if(l.includes("/")){var d=l.split("/");c=d[0],u=d[1]}We(e,"gname",u),c&&We(e,"plat",c),t[l]&&Mn(e);var p=At();Oe.appendStyleTagText(l,r),p.emit(Vn.styleTagAdded(l),{nodes:[e]})}return}var h=bd(e,o);h&&Mn(e)}}function _d(e,t){var n=e.tagName,r=e.src,o=r===void 0?"":r;if(n!=="SCRIPT"||!o.endsWith(".hot-update.js"))return!1;var i=Oe.getMatchedIgnoreCssPrefix(o);if(!i)return!1;var s=Oe.getIgnoreCssPrefixKeys(i);if(!s.length)return!1;var a=!1;return s.forEach(function(l){t[l]&&(yd(l),a=!0)}),a}function wd(){var e=gt(),t=_e(),n=e.isStyleObInit,r=t.document;if(!(n||!r)){e.isStyleObInit=!0;var o=Oe.getIgnoreStyleTagMap(),i=Ui();if(i){var s=new i(function(a){a.forEach(function(l){for(var c=l.addedNodes,u=l.removedNodes,d=c.length,p=0;p<d;p++)Ed(c[p],o);for(var h=u.length,g=0;g<h&&!_d(u[g],o);g++);})});s.observe(document.head,{childList:!0})}}}Os(),me("hel-micro-core ver ".concat(te.CORE_VER));var Sd=Qt,xd=en,Cd=te,Od=os,Pd=_f,$d=ud;function Os(e){e&&Ps(e),cd(!!e),Rf(),Pf(),pd(),wd()}var Ad=jn,Td=Q,Dd=ht,Id=Nn,Ld=me,kd=$f,Md=zr,Nd=ds,jd=_e,Ps=df,Rd=Ff,Fd=ms,Vd=Zf,Bd=_s,zd=ws,Hd=Qf,Ud=ad,Wd=ld,Kd=Gf,Gd=Yf,Yd=rn,qd=on,Xd=Oe,Jd=ed,Zd=Jr,Qd=nd,ep=td,tp=rd,np=od,rp=sd,op=id,ip=Zr,sp=Qr,ap=Bf,lp=Fn,cp=Wf,up=Kf,fp=Xr,dp=Hf,pp=Uf,hp=zf,gp=At,mp=Jf,vp=Vn,bp=hd,yp=gd;const Ep=ef(Object.freeze(Object.defineProperty({__proto__:null,allowLog:Id,appReady:yp,clearPerfMark:Nd,commonDataUtil:Xd,commonUtil:Pd,evName:vp,getAppMeta:zd,getAppPlatform:lp,getAppPlatformByAppName:fp,getAppStyleStr:tp,getCommonData:Yd,getCustomData:Kd,getGlobalThis:jd,getHelDebug:Dd,getHelEventBus:gp,getPlatform:Ad,getPlatformConfig:ap,getSharedCache:Td,getUserEventBus:mp,getVerApp:Rd,getVerExtraCssList:rp,getVerLib:Vd,getVerLoadStatus:Jd,getVerStyleStrStatus:Qd,getVersion:Ud,helConsts:Cd,helEvents:Sd,helLoadStatus:xd,inectPlatToMod:Od,initGlobalConfig:hp,initPlatformConfig:dp,isSubApp:$d,libReady:bp,log:Ld,originInit:pp,perfMark:kd,perfPeek:Md,resetGlobalThis:Os,setAppMeta:Hd,setAppPlatform:cp,setAppPlatformByAppName:up,setAppStyleStr:np,setCommonData:qd,setCustomData:Gd,setEmitApp:Fd,setEmitLib:Bd,setGlobalThis:Ps,setVerExtraCssList:op,setVerLoadStatus:Zd,setVerStyleStrStatus:ep,setVersion:Wd,tryGetAppName:sp,tryGetVersion:ip},Symbol.toStringTag,{value:"Module"})));var _p=Jt.exports,$s;function wp(){return $s||($s=1,(function(e,t){(function(n,r){r(t,Ep)})(_p,function(n,r){/*! *****************************************************************************
|
|
11
|
+
Copyright (c) Microsoft Corporation.
|
|
12
|
+
|
|
13
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
purpose with or without fee is hereby granted.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
17
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
18
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
19
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
20
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
21
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
22
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
+
***************************************************************************** */var o=function(){return o=Object.assign||function(I){for(var A,U=1,W=arguments.length;U<W;U++)for(var ne in A=arguments[U])Object.prototype.hasOwnProperty.call(A,ne)&&(I[ne]=A[ne]);return I},o.apply(this,arguments)};function i(I,A){var U=A||(r.getAppPlatform===null||r.getAppPlatform===void 0?void 0:r.getAppPlatform(I)),W=r.getSharedCache(U).appName2Lib;return W[I]||(W[I]={}),W[I]}var s="4.12.1";r.log("hel-lib-proxy ver ".concat(s));var a=r.getUserEventBus,l=r.helConsts,c=a();function u(I,A){var U=o({},A||{});return U.platform=U.platform||l.DEFAULT_PLAT,r.getVerLib(I,U)}function d(I,A){var U,W=!0,ne="";A&&(typeof A=="string"?ne=A:(ne=A.platform||"",W=(U=A.asProxy)===null||U===void 0||U));var de=i(I,ne=ne||r.getAppPlatform(I)||l.DEFAULT_PLAT);return typeof Proxy=="function"&&W&&(de=(function(ke,Me,ge){return new Proxy(Me,{get:function(se,ae){var xe=String(ae);return r.log("[[getLibProxy]] call lib [".concat(ke,"] method [").concat(xe,"]")),Object.keys(se).length?se[xe]:i(ke,ge)[xe]}})})(I,de,ne)),r.log("[[ exposeLib ]] libName, libObj",I,de),de}function p(I,A,U){var W=(function(ne){var de={allowDup:!1,platform:r.helConsts.DEFAULT_PLAT};return o(o({},de),ne||{})})(U);r.libReady(I,A,W)}function h(I,A,U){r.appReady(I,A,U)}function g(I,A){return r.getVerApp(I,A)}var m=r.isSubApp;function b(){return!r.isSubApp()}var v=Object.freeze({__proto__:null,VER:s,eventBus:c,getLib:u,exposeLib:d,libReady:p,appReady:h,exposeApp:g,isSubApp:m,isMasterApp:b}),y=r.commonUtil.purify,S=["isMasterApp","isSubApp","eventBus"],w=["appReady","libReady"];function C(I,A){return A&&typeof A=="object"&&!Array.isArray(A)?o({platform:I},y(A)):{platform:I}}function _(I,A){var U={};return Object.keys(I).forEach(function(W){var ne=I[W];if(S.includes(W))U[W]=ne;else if(w.includes(W))U[W]=(function(ke,Me){return function(){for(var ge=[],se=0;se<arguments.length;se++)ge[se]=arguments[se];var ae=ge[0],xe=ge[1],Ce=ge[2];return ke(ae,xe,C(Me,Ce===void 0?{}:Ce))}})(ne,A);else{var de=W==="exposeLib";U[W]=(function(ke,Me,ge){return function(){for(var se=[],ae=0;ae<arguments.length;ae++)se[ae]=arguments[ae];var xe=se[0],Ce=se[1];return ke(xe,!ge||typeof Ce!="string"&&Ce!==void 0?C(Me,Ce):Ce||Me)}})(ne,A,de)}}),U}var x=function I(A){var U=_(v,A);return U.createInstance=I,U},k=s,R=p,O=d,T=u,D=m,P=b,M=c,N=h,H=g,z={VER:k,libReady:R,exposeLib:O,getLib:T,isSubApp:D,isMasterApp:P,eventBus:M,appReady:N,exposeApp:H,createInstance:x};(function(I){var A=r.getGlobalThis();r.commonUtil.isServer()||A.HelLibProxy||(r.log("auto bind hel-lib-proxy to global.HelLibProxy"),A.HelLibProxy=I)})(z),n.VER=k,n.appReady=N,n.createInstance=x,n.default=z,n.eventBus=M,n.exposeApp=H,n.exposeLib=O,n.getLib=T,n.isMasterApp=P,n.isSubApp=D,n.libReady=R,Object.defineProperty(n,"__esModule",{value:!0})})})(Jt,Jt.exports)),Jt.exports}var Sp=wp();const xp=Uu({__proto__:null},[Sp]),Cp=Object.freeze(Object.defineProperty({__proto__:null,LIB_NAME:"libs-react-leva"},Symbol.toStringTag,{value:"Module"}));var ro={exports:{}},an={};/**
|
|
24
|
+
* @license React
|
|
25
|
+
* react-jsx-runtime.production.min.js
|
|
26
|
+
*
|
|
27
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
28
|
+
*
|
|
29
|
+
* This source code is licensed under the MIT license found in the
|
|
30
|
+
* LICENSE file in the root directory of this source tree.
|
|
31
|
+
*/var As;function Op(){if(As)return an;As=1;var e=f,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function s(a,l,c){var u,d={},p=null,h=null;c!==void 0&&(p=""+c),l.key!==void 0&&(p=""+l.key),l.ref!==void 0&&(h=l.ref);for(u in l)r.call(l,u)&&!i.hasOwnProperty(u)&&(d[u]=l[u]);if(a&&a.defaultProps)for(u in l=a.defaultProps,l)d[u]===void 0&&(d[u]=l[u]);return{$$typeof:t,type:a,key:p,ref:h,props:d,_owner:o.current}}return an.Fragment=n,an.jsx=s,an.jsxs=s,an}var Ts;function Pp(){return Ts||(Ts=1,ro.exports=Op()),ro.exports}var B=Pp(),$p=Object.defineProperty,oo=(e,t)=>$p(e,"name",{value:t,configurable:!0});function io(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}oo(io,"setRef");function Ds(...e){return t=>{let n=!1;const r=e.map(o=>{const i=io(o,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let o=0;o<r.length;o++){const i=r[o];typeof i=="function"?i():io(e[o],null)}}}}oo(Ds,"composeRefs");function ct(...e){return E.useCallback(Ds(...e),e)}oo(ct,"useComposedRefs");var Ap=Object.defineProperty,we=(e,t)=>Ap(e,"name",{value:t,configurable:!0});function Is(e){const t=E.forwardRef((n,r)=>{var p;let{children:o,...i}=n,s=null,a=!1;const l=[];o=Fs(o),E.Children.forEach(o,h=>{var g;if(js(h)){a=!0;const m=h;let b="child"in m.props?m.props.child:m.props.children;for(;so(b)&&typeof Bn=="function";)b=Bn(b._payload);s=Tp(m,b),l.push((g=s==null?void 0:s.props)==null?void 0:g.children)}else l.push(h)}),s?s=E.cloneElement(s,void 0,l):!a&&E.Children.count(o)===1&&E.isValidElement(o)&&(s=o);const c=s?Ns(s):void 0,u=ct(r,c);if(!s){if(o||o===0)throw new Error(a?Lp(e):Ip(e));return o}const d=Ms(i,(p=s.props)!=null?p:{});return s.type!==E.Fragment&&(d.ref=r?u:c),E.cloneElement(s,d)});return t.displayName=`${e}.Slot`,t}we(Is,"createSlot");var Ls=Symbol.for("radix.slottable");function ks(e){const t=we(n=>"child"in n?n.children(n.child):n.children,"Slottable");return t.displayName=`${e}.Slottable`,t.__radixId=Ls,t}we(ks,"createSlottable");var Tp=we((e,t)=>"child"in e.props?E.isValidElement(t)?E.cloneElement(t,void 0,e.props.children(t.props.children)):null:E.isValidElement(t)?t:null,"getSlottableElementFromSlottable");function Ms(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{const l=i(...a);return o(...a),l}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"?n[r]=[o,i].filter(Boolean).join(" "):r==="aria-describedby"&&(n[r]=Vs(i,o))}return{...e,...n}}we(Ms,"mergeProps");function Ns(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}we(Ns,"getElementRef");function js(e){return E.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Ls}we(js,"isSlottable");var Dp=Symbol.for("react.lazy");function so(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===Dp&&"_payload"in e&&Rs(e._payload)}we(so,"isLazyComponent");function Rs(e){return typeof e=="object"&&e!==null&&"then"in e}we(Rs,"isPromiseLike");function Fs(e){let t=e;for(;so(t)&&typeof Bn=="function";)t=Bn(t._payload);return t}we(Fs,"useUnwrappedLazy");function Vs(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}we(Vs,"concatAriaDescribedby");var Ip=we(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,"createSlotError"),Lp=we(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,"createSlottableError"),Bn=E[" use ".trim().toString()],kp=Object.defineProperty,Mp=(e,t)=>kp(e,"name",{value:t,configurable:!0}),Np=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],vt=Np.reduce((e,t)=>{const n=Is(`Primitive.${t}`),r=E.forwardRef((o,i)=>{const{asChild:s,...a}=o,l=s?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),B.jsx(l,{...a,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Bs(e,t){e&&Dr.flushSync(()=>e.dispatchEvent(t))}Mp(Bs,"dispatchDiscreteCustomEvent");var Pe=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},jp=Object.defineProperty,Rp=(e,t)=>jp(e,"name",{value:t,configurable:!0}),Fp=E.forwardRef(Rp(function(t,n){var l;const{container:r,...o}=t,[i,s]=E.useState(!1);Pe(()=>s(!0),[]);const a=r||i&&((l=globalThis==null?void 0:globalThis.document)==null?void 0:l.body);return a?Dr.createPortal(B.jsx(vt.div,{...o,ref:n}),a):null},"Portal")),zs=Object.prototype.hasOwnProperty;function ln(e,t){var n,r;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((r=e.length)===t.length)for(;r--&&ln(e[r],t[r]););return r===-1}if(!n||typeof e=="object"){r=0;for(n in e)if(zs.call(e,n)&&++r&&!zs.call(t,n)||!(n in t)||!ln(e[n],t[n]))return!1;return Object.keys(t).length===r}}return e!==e&&t!==t}function zn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r<n.length;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Object.is(e[n[r]],t[n[r]]))return!1;return!0}var Hn=function(t,n,r,o){this.name=t,this.fn=n,this.args=r,this.modifiers=o};Hn.prototype._test=function(t){var n=this.fn;try{Tt(this.modifiers.slice(),n,this)(t)}catch{n=function(){return!1}}try{return Tt(this.modifiers.slice(),n,this)(t)}catch{return!1}},Hn.prototype._check=function(t){try{Tt(this.modifiers.slice(),this.fn,this)(t)}catch{if(Tt(this.modifiers.slice(),function(r){return r},this)(!1))return}if(!Tt(this.modifiers.slice(),this.fn,this)(t))throw null},Hn.prototype._testAsync=function(t){var n=this;return new Promise(function(r,o){Us(n.modifiers.slice(),n.fn,n)(t).then(function(i){i?r(t):o(null)}).catch(function(i){return o(i)})})};function Hs(e,t){return t===void 0&&(t="simple"),typeof e=="object"?e[t]:e}function Tt(e,t,n){if(e.length){var r=e.shift(),o=Tt(e,t,n);return r.perform(o,n)}else return Hs(t)}function Us(e,t,n){if(e.length){var r=e.shift(),o=Us(e,t,n);return r.performAsync(o,n)}else return function(i){return Promise.resolve(Hs(t,"async")(i))}}var Vp=function(t,n,r){this.name=t,this.perform=n,this.performAsync=r},ao=(function(e){function t(n,r,o,i){for(var s=[],a=arguments.length-4;a-- >0;)s[a]=arguments[a+4];e.call(this,s),e.captureStackTrace&&e.captureStackTrace(this,t),this.rule=n,this.value=r,this.cause=o,this.target=i}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t})(Error),Re=function(t,n){t===void 0&&(t=[]),n===void 0&&(n=[]),this.chain=t,this.nextRuleModifiers=n};Re.prototype._applyRule=function(t,n){var r=this;return function(){for(var o=[],i=arguments.length;i--;)o[i]=arguments[i];return r.chain.push(new Hn(n,t.apply(r,o),o,r.nextRuleModifiers)),r.nextRuleModifiers=[],r}},Re.prototype._applyModifier=function(t,n){return this.nextRuleModifiers.push(new Vp(n,t.simple,t.async)),this},Re.prototype._clone=function(){return new Re(this.chain.slice(),this.nextRuleModifiers.slice())},Re.prototype.test=function(t){return this.chain.every(function(n){return n._test(t)})},Re.prototype.testAll=function(t){var n=[];return this.chain.forEach(function(r){try{r._check(t)}catch(o){n.push(new ao(r,t,o))}}),n},Re.prototype.check=function(t){this.chain.forEach(function(n){try{n._check(t)}catch(r){throw new ao(n,t,r)}})},Re.prototype.testAsync=function(t){var n=this;return new Promise(function(r,o){Ws(t,n.chain.slice(),r,o)})};function Ws(e,t,n,r){if(t.length){var o=t.shift();o._testAsync(e).then(function(){Ws(e,t,n,r)},function(i){r(new ao(o,e,i))})}else n(e)}var Ks=function(e,t){return t&&typeof e=="string"&&e.trim().length===0?!0:e==null};function Bp(e,t){return t===void 0&&(t=!1),{simple:function(n){return Ks(n,t)||e.check(n)===void 0},async:function(n){return Ks(n,t)||e.testAsync(n)}}}function ve(){return typeof Proxy<"u"?Gs(new Re):lo(new Re)}var cn={};ve.extend=function(e){Object.assign(cn,e)},ve.clearCustomRules=function(){cn={}};function Gs(e){return new Proxy(e,{get:function(n,r){if(r in n)return n[r];var o=Gs(e._clone());if(r in Un)return o._applyModifier(Un[r],r);if(r in cn)return o._applyRule(cn[r],r);if(r in co)return o._applyRule(co[r],r)}})}function lo(e){var t=function(o,i){return Object.keys(o).forEach(function(s){i[s]=function(){for(var a=[],l=arguments.length;l--;)a[l]=arguments[l];var c=lo(i._clone()),u=c._applyRule(o[s],s).apply(void 0,a);return u}}),i},n=t(co,e),r=t(cn,n);return Object.keys(Un).forEach(function(o){Object.defineProperty(r,o,{get:function(){var i=lo(r._clone());return i._applyModifier(Un[o],o)}})}),r}var Un={not:{simple:function(e){return function(t){return!e(t)}},async:function(e){return function(t){return Promise.resolve(e(t)).then(function(n){return!n}).catch(function(){return!0})}}},some:{simple:function(e){return function(t){return Wn(t).some(function(n){try{return e(n)}catch{return!1}})}},async:function(e){return function(t){return Promise.all(Wn(t).map(function(n){try{return e(n).catch(function(){return!1})}catch{return!1}})).then(function(n){return n.some(Boolean)})}}},every:{simple:function(e){return function(t){return t!==!1&&Wn(t).every(e)}},async:function(e){return function(t){return Promise.all(Wn(t).map(e)).then(function(n){return n.every(Boolean)})}}},strict:{simple:function(e,t){return function(n){return Ys(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&e(n):e(n)}},async:function(e,t){return function(n){return Promise.resolve(e(n)).then(function(r){return Ys(t)&&n&&typeof n=="object"?Object.keys(t.args[0]).length===Object.keys(n).length&&r:r}).catch(function(){return!1})}}}};function Ys(e){return e&&e.name==="schema"&&e.args.length>0&&typeof e.args[0]=="object"}function Wn(e){return typeof e=="string"?e.split(""):e}var co={equal:function(e){return function(t){return t==e}},exact:function(e){return function(t){return t===e}},number:function(e){return e===void 0&&(e=!0),function(t){return typeof t=="number"&&(e||isFinite(t))}},integer:function(){return function(e){var t=Number.isInteger||zp;return t(e)}},numeric:function(){return function(e){return!isNaN(parseFloat(e))&&isFinite(e)}},string:function(){return Dt("string")},boolean:function(){return Dt("boolean")},undefined:function(){return Dt("undefined")},null:function(){return Dt("null")},array:function(){return Dt("array")},object:function(){return Dt("object")},instanceOf:function(e){return function(t){return t instanceof e}},pattern:function(e){return function(t){return e.test(t)}},lowercase:function(){return function(e){return typeof e=="boolean"||e===e.toLowerCase()&&e.trim()!==""}},uppercase:function(){return function(e){return e===e.toUpperCase()&&e.trim()!==""}},vowel:function(){return function(e){return/^[aeiou]+$/i.test(e)}},consonant:function(){return function(e){return/^(?=[^aeiou])([a-z]+)$/i.test(e)}},first:function(e){return function(t){return t[0]==e}},last:function(e){return function(t){return t[t.length-1]==e}},empty:function(){return function(e){return e.length===0}},length:function(e,t){return function(n){return n.length>=e&&n.length<=(t||e)}},minLength:function(e){return function(t){return t.length>=e}},maxLength:function(e){return function(t){return t.length<=e}},negative:function(){return function(e){return e<0}},positive:function(){return function(e){return e>=0}},between:function(e,t){return function(n){return n>=e&&n<=t}},range:function(e,t){return function(n){return n>=e&&n<=t}},lessThan:function(e){return function(t){return t<e}},lessThanOrEqual:function(e){return function(t){return t<=e}},greaterThan:function(e){return function(t){return t>e}},greaterThanOrEqual:function(e){return function(t){return t>=e}},even:function(){return function(e){return e%2===0}},odd:function(){return function(e){return e%2!==0}},includes:function(e){return function(t){return~t.indexOf(e)}},schema:function(e){return Hp(e)},passesAnyOf:function(){for(var e=[],t=arguments.length;t--;)e[t]=arguments[t];return function(n){return e.some(function(r){return r.test(n)})}},optional:Bp};function Dt(e){return function(t){return Array.isArray(t)&&e==="array"||t===null&&e==="null"||typeof t===e}}function zp(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e}function Hp(e){return{simple:function(t){var n=[];if(Object.keys(e).forEach(function(r){var o=e[r];try{o.check((t||{})[r])}catch(i){i.target=r,n.push(i)}}),n.length>0)throw n;return!0},async:function(t){var n=[],r=Object.keys(e).map(function(o){var i=e[o];return i.testAsync((t||{})[o]).catch(function(s){s.target=o,n.push(s)})});return Promise.all(r).then(function(){if(n.length>0)throw n;return!0})}}}var K="colors",pe="sizes",L="space",Up={gap:L,gridGap:L,columnGap:L,gridColumnGap:L,rowGap:L,gridRowGap:L,inset:L,insetBlock:L,insetBlockEnd:L,insetBlockStart:L,insetInline:L,insetInlineEnd:L,insetInlineStart:L,margin:L,marginTop:L,marginRight:L,marginBottom:L,marginLeft:L,marginBlock:L,marginBlockEnd:L,marginBlockStart:L,marginInline:L,marginInlineEnd:L,marginInlineStart:L,padding:L,paddingTop:L,paddingRight:L,paddingBottom:L,paddingLeft:L,paddingBlock:L,paddingBlockEnd:L,paddingBlockStart:L,paddingInline:L,paddingInlineEnd:L,paddingInlineStart:L,top:L,right:L,bottom:L,left:L,scrollMargin:L,scrollMarginTop:L,scrollMarginRight:L,scrollMarginBottom:L,scrollMarginLeft:L,scrollMarginX:L,scrollMarginY:L,scrollMarginBlock:L,scrollMarginBlockEnd:L,scrollMarginBlockStart:L,scrollMarginInline:L,scrollMarginInlineEnd:L,scrollMarginInlineStart:L,scrollPadding:L,scrollPaddingTop:L,scrollPaddingRight:L,scrollPaddingBottom:L,scrollPaddingLeft:L,scrollPaddingX:L,scrollPaddingY:L,scrollPaddingBlock:L,scrollPaddingBlockEnd:L,scrollPaddingBlockStart:L,scrollPaddingInline:L,scrollPaddingInlineEnd:L,scrollPaddingInlineStart:L,fontSize:"fontSizes",background:K,backgroundColor:K,backgroundImage:K,borderImage:K,border:K,borderBlock:K,borderBlockEnd:K,borderBlockStart:K,borderBottom:K,borderBottomColor:K,borderColor:K,borderInline:K,borderInlineEnd:K,borderInlineStart:K,borderLeft:K,borderLeftColor:K,borderRight:K,borderRightColor:K,borderTop:K,borderTopColor:K,caretColor:K,color:K,columnRuleColor:K,fill:K,outline:K,outlineColor:K,stroke:K,textDecorationColor:K,fontFamily:"fonts",fontWeight:"fontWeights",lineHeight:"lineHeights",letterSpacing:"letterSpacings",blockSize:pe,minBlockSize:pe,maxBlockSize:pe,inlineSize:pe,minInlineSize:pe,maxInlineSize:pe,width:pe,minWidth:pe,maxWidth:pe,height:pe,minHeight:pe,maxHeight:pe,flexBasis:pe,gridTemplateColumns:pe,gridTemplateRows:pe,borderWidth:"borderWidths",borderTopWidth:"borderWidths",borderRightWidth:"borderWidths",borderBottomWidth:"borderWidths",borderLeftWidth:"borderWidths",borderStyle:"borderStyles",borderTopStyle:"borderStyles",borderRightStyle:"borderStyles",borderBottomStyle:"borderStyles",borderLeftStyle:"borderStyles",borderRadius:"radii",borderTopLeftRadius:"radii",borderTopRightRadius:"radii",borderBottomRightRadius:"radii",borderBottomLeftRadius:"radii",boxShadow:"shadows",textShadow:"shadows",transition:"transitions",zIndex:"zIndices"},Wp=(e,t)=>typeof t=="function"?{"()":Function.prototype.toString.call(t)}:t,It=()=>{const e=Object.create(null);return(t,n,...r)=>{const o=(i=>JSON.stringify(i,Wp))(t);return o in e?e[o]:e[o]=n(t,...r)}},bt=Symbol.for("sxs.internal"),uo=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),qs=e=>{for(const t in e)return!0;return!1},{hasOwnProperty:Kp}=Object.prototype,fo=e=>e.includes("-")?e:e.replace(/[A-Z]/g,(t=>"-"+t.toLowerCase())),Gp=/\s+(?![^()]*\))/,Lt=e=>t=>e(...typeof t=="string"?String(t).split(Gp):[t]),Xs={appearance:e=>({WebkitAppearance:e,appearance:e}),backfaceVisibility:e=>({WebkitBackfaceVisibility:e,backfaceVisibility:e}),backdropFilter:e=>({WebkitBackdropFilter:e,backdropFilter:e}),backgroundClip:e=>({WebkitBackgroundClip:e,backgroundClip:e}),boxDecorationBreak:e=>({WebkitBoxDecorationBreak:e,boxDecorationBreak:e}),clipPath:e=>({WebkitClipPath:e,clipPath:e}),content:e=>({content:e.includes('"')||e.includes("'")||/^([A-Za-z]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)$/.test(e)?e:`"${e}"`}),hyphens:e=>({WebkitHyphens:e,hyphens:e}),maskImage:e=>({WebkitMaskImage:e,maskImage:e}),maskSize:e=>({WebkitMaskSize:e,maskSize:e}),tabSize:e=>({MozTabSize:e,tabSize:e}),textSizeAdjust:e=>({WebkitTextSizeAdjust:e,textSizeAdjust:e}),userSelect:e=>({WebkitUserSelect:e,userSelect:e}),marginBlock:Lt(((e,t)=>({marginBlockStart:e,marginBlockEnd:t||e}))),marginInline:Lt(((e,t)=>({marginInlineStart:e,marginInlineEnd:t||e}))),maxSize:Lt(((e,t)=>({maxBlockSize:e,maxInlineSize:t||e}))),minSize:Lt(((e,t)=>({minBlockSize:e,minInlineSize:t||e}))),paddingBlock:Lt(((e,t)=>({paddingBlockStart:e,paddingBlockEnd:t||e}))),paddingInline:Lt(((e,t)=>({paddingInlineStart:e,paddingInlineEnd:t||e})))},po=/([\d.]+)([^]*)/,Yp=(e,t)=>e.length?e.reduce(((n,r)=>(n.push(...t.map((o=>o.includes("&")?o.replace(/&/g,/[ +>|~]/.test(r)&&/&.*&/.test(o)?`:is(${r})`:r):r+" "+o))),n)),[]):t,qp=(e,t)=>e in Xp&&typeof t=="string"?t.replace(/^((?:[^]*[^\w-])?)(fit-content|stretch)((?:[^\w-][^]*)?)$/,((n,r,o,i)=>r+(o==="stretch"?`-moz-available${i};${fo(e)}:${r}-webkit-fill-available`:`-moz-fit-content${i};${fo(e)}:${r}fit-content`)+i)):String(t),Xp={blockSize:1,height:1,inlineSize:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,width:1},Ge=e=>e?e+"-":"",Js=(e,t,n)=>e.replace(/([+-])?((?:\d+(?:\.\d*)?|\.\d+)(?:[Ee][+-]?\d+)?)?(\$|--)([$\w-]+)/g,((r,o,i,s,a)=>s=="$"==!!i?r:(o||s=="--"?"calc(":"")+"var(--"+(s==="$"?Ge(t)+(a.includes("$")?"":Ge(n))+a.replace(/\$/g,"-"):a)+")"+(o||s=="--"?"*"+(o||"")+(i||"1")+")":""))),Jp=/\s*,\s*(?![^()]*\))/,Zp=Object.prototype.toString,kt=(e,t,n,r,o)=>{let i,s,a;const l=(c,u,d)=>{let p,h;const g=m=>{for(p in m){const y=p.charCodeAt(0)===64,S=y&&Array.isArray(m[p])?m[p]:[m[p]];for(h of S){const w=/[A-Z]/.test(v=p)?v:v.replace(/-[^]/g,(_=>_[1].toUpperCase())),C=typeof h=="object"&&h&&h.toString===Zp&&(!r.utils[w]||!u.length);if(w in r.utils&&!C){const _=r.utils[w];if(_!==s){s=_,g(_(h)),s=null;continue}}else if(w in Xs){const _=Xs[w];if(_!==a){a=_,g(_(h)),a=null;continue}}if(y&&(b=p.slice(1)in r.media?"@media "+r.media[p.slice(1)]:p,p=b.replace(/\(\s*([\w-]+)\s*(=|<|<=|>|>=)\s*([\w-]+)\s*(?:(<|<=|>|>=)\s*([\w-]+)\s*)?\)/g,((_,x,k,R,O,T)=>{const D=po.test(x),P=.0625*(D?-1:1),[M,N]=D?[R,x]:[x,R];return"("+(k[0]==="="?"":k[0]===">"===D?"max-":"min-")+M+":"+(k[0]!=="="&&k.length===1?N.replace(po,((H,z,I)=>Number(z)+P*(k===">"?1:-1)+I)):N)+(O?") and ("+(O[0]===">"?"min-":"max-")+M+":"+(O.length===1?T.replace(po,((H,z,I)=>Number(z)+P*(O===">"?-1:1)+I)):T):"")+")"}))),C){const _=y?d.concat(p):[...d],x=y?[...u]:Yp(u,p.split(Jp));i!==void 0&&o(Zs(...i)),i=void 0,l(h,x,_)}else i===void 0&&(i=[[],u,d]),p=y||p.charCodeAt(0)!==36?p:`--${Ge(r.prefix)}${p.slice(1).replace(/\$/g,"-")}`,h=C?h:typeof h=="number"?h&&w in Qp?String(h)+"px":String(h):Js(qp(w,h==null?"":h),r.prefix,r.themeMap[w]),i[0].push(`${y?`${p} `:`${fo(p)}:`}${h}`)}}var b,v};g(c),i!==void 0&&o(Zs(...i)),i=void 0};l(e,t,n)},Zs=(e,t,n)=>`${n.map((r=>`${r}{`)).join("")}${t.length?`${t.join(",")}{`:""}${e.join(";")}${t.length?"}":""}${Array(n.length?n.length+1:0).join("}")}`,Qp={animationDelay:1,animationDuration:1,backgroundSize:1,blockSize:1,border:1,borderBlock:1,borderBlockEnd:1,borderBlockEndWidth:1,borderBlockStart:1,borderBlockStartWidth:1,borderBlockWidth:1,borderBottom:1,borderBottomLeftRadius:1,borderBottomRightRadius:1,borderBottomWidth:1,borderEndEndRadius:1,borderEndStartRadius:1,borderInlineEnd:1,borderInlineEndWidth:1,borderInlineStart:1,borderInlineStartWidth:1,borderInlineWidth:1,borderLeft:1,borderLeftWidth:1,borderRadius:1,borderRight:1,borderRightWidth:1,borderSpacing:1,borderStartEndRadius:1,borderStartStartRadius:1,borderTop:1,borderTopLeftRadius:1,borderTopRightRadius:1,borderTopWidth:1,borderWidth:1,bottom:1,columnGap:1,columnRule:1,columnRuleWidth:1,columnWidth:1,containIntrinsicSize:1,flexBasis:1,fontSize:1,gap:1,gridAutoColumns:1,gridAutoRows:1,gridTemplateColumns:1,gridTemplateRows:1,height:1,inlineSize:1,inset:1,insetBlock:1,insetBlockEnd:1,insetBlockStart:1,insetInline:1,insetInlineEnd:1,insetInlineStart:1,left:1,letterSpacing:1,margin:1,marginBlock:1,marginBlockEnd:1,marginBlockStart:1,marginBottom:1,marginInline:1,marginInlineEnd:1,marginInlineStart:1,marginLeft:1,marginRight:1,marginTop:1,maxBlockSize:1,maxHeight:1,maxInlineSize:1,maxWidth:1,minBlockSize:1,minHeight:1,minInlineSize:1,minWidth:1,offsetDistance:1,offsetRotate:1,outline:1,outlineOffset:1,outlineWidth:1,overflowClipMargin:1,padding:1,paddingBlock:1,paddingBlockEnd:1,paddingBlockStart:1,paddingBottom:1,paddingInline:1,paddingInlineEnd:1,paddingInlineStart:1,paddingLeft:1,paddingRight:1,paddingTop:1,perspective:1,right:1,rowGap:1,scrollMargin:1,scrollMarginBlock:1,scrollMarginBlockEnd:1,scrollMarginBlockStart:1,scrollMarginBottom:1,scrollMarginInline:1,scrollMarginInlineEnd:1,scrollMarginInlineStart:1,scrollMarginLeft:1,scrollMarginRight:1,scrollMarginTop:1,scrollPadding:1,scrollPaddingBlock:1,scrollPaddingBlockEnd:1,scrollPaddingBlockStart:1,scrollPaddingBottom:1,scrollPaddingInline:1,scrollPaddingInlineEnd:1,scrollPaddingInlineStart:1,scrollPaddingLeft:1,scrollPaddingRight:1,scrollPaddingTop:1,shapeMargin:1,textDecoration:1,textDecorationThickness:1,textIndent:1,textUnderlineOffset:1,top:1,transitionDelay:1,transitionDuration:1,verticalAlign:1,width:1,wordSpacing:1},Qs=e=>String.fromCharCode(e+(e>25?39:97)),yt=e=>(t=>{let n,r="";for(n=Math.abs(t);n>52;n=n/52|0)r=Qs(n%52)+r;return Qs(n%52)+r})(((t,n)=>{let r=n.length;for(;r;)t=33*t^n.charCodeAt(--r);return t})(5381,JSON.stringify(e))>>>0),un=["themed","global","styled","onevar","resonevar","allvar","inline"],eh=e=>{if(e.href&&!e.href.startsWith(location.origin))return!1;try{return!!e.cssRules}catch{return!1}},th=e=>{let t;const n=()=>{const{cssRules:o}=t.sheet;return[].map.call(o,((i,s)=>{const{cssText:a}=i;let l="";if(a.startsWith("--sxs"))return"";if(o[s-1]&&(l=o[s-1].cssText).startsWith("--sxs")){if(!i.cssRules.length)return"";for(const c in t.rules)if(t.rules[c].group===i)return`--sxs{--sxs:${[...t.rules[c].cache].join(" ")}}${a}`;return i.cssRules.length?`${l}${a}`:""}return a})).join("")},r=()=>{if(t){const{rules:a,sheet:l}=t;if(!l.deleteRule){for(;Object(Object(l.cssRules)[0]).type===3;)l.cssRules.splice(0,1);l.cssRules=[]}for(const c in a)delete a[c]}const o=Object(e).styleSheets||[];for(const a of o)if(eh(a)){for(let l=0,c=a.cssRules;c[l];++l){const u=Object(c[l]);if(u.type!==1)continue;const d=Object(c[l+1]);if(d.type!==4)continue;++l;const{cssText:p}=u;if(!p.startsWith("--sxs"))continue;const h=p.slice(14,-3).trim().split(/\s+/),g=un[h[0]];g&&(t||(t={sheet:a,reset:r,rules:{},toString:n}),t.rules[g]={group:d,index:l,cache:new Set(h)})}if(t)break}if(!t){const a=(l,c)=>({type:c,cssRules:[],insertRule(u,d){this.cssRules.splice(d,0,a(u,{import:3,undefined:1}[(u.toLowerCase().match(/^@([a-z]+)/)||[])[1]]||4))},get cssText(){return l==="@media{}"?`@media{${[].map.call(this.cssRules,(u=>u.cssText)).join("")}}`:l}});t={sheet:e?(e.head||e).appendChild(document.createElement("style")).sheet:a("","text/css"),rules:{},reset:r,toString:n}}const{sheet:i,rules:s}=t;for(let a=un.length-1;a>=0;--a){const l=un[a];if(!s[l]){const c=un[a+1],u=s[c]?s[c].index:i.cssRules.length;i.insertRule("@media{}",u),i.insertRule(`--sxs{--sxs:${a}}`,u),s[l]={group:i.cssRules[u+1],index:u,cache:new Set([a])}}nh(s[l])}};return r(),t},nh=e=>{const t=e.group;let n=t.cssRules.length;e.apply=r=>{try{t.insertRule(r,n),++n}catch{}}},fn=Symbol(),rh=It(),ea=(e,t)=>rh(e,(()=>(...n)=>{let r={type:null,composers:new Set};for(const o of n)if(o!=null)if(o[bt]){r.type==null&&(r.type=o[bt].type);for(const i of o[bt].composers)r.composers.add(i)}else o.constructor!==Object||o.$$typeof?r.type==null&&(r.type=o):r.composers.add(oh(o,e));return r.type==null&&(r.type="span"),r.composers.size||r.composers.add(["PJLV",{},[],[],{},[]]),ih(e,r,t)})),oh=({variants:e,compoundVariants:t,defaultVariants:n,...r},o)=>{const i=`${Ge(o.prefix)}c-${yt(r)}`,s=[],a=[],l=Object.create(null),c=[];for(const p in n)l[p]=String(n[p]);if(typeof e=="object"&&e)for(const p in e){u=l,d=p,Kp.call(u,d)||(l[p]="undefined");const h=e[p];for(const g in h){const m={[p]:String(g)};String(g)==="undefined"&&c.push(p);const b=h[g],v=[m,b,!qs(b)];s.push(v)}}var u,d;if(typeof t=="object"&&t)for(const p of t){let{css:h,...g}=p;h=typeof h=="object"&&h||{};for(const b in g)g[b]=String(g[b]);const m=[g,h,!qs(h)];a.push(m)}return[i,r,s,a,l,c]},ih=(e,t,n)=>{const[r,o,i,s]=sh(t.composers),a=typeof t.type=="function"||t.type.$$typeof?(d=>{function p(){for(let h=0;h<p[fn].length;h++){const[g,m]=p[fn][h];d.rules[g].apply(m)}return p[fn]=[],null}return p[fn]=[],p.rules={},un.forEach((h=>p.rules[h]={apply:g=>p[fn].push([h,g])})),p})(n):null,l=(a||n).rules,c=`.${r}${o.length>1?`:where(.${o.slice(1).join(".")})`:""}`,u=d=>{d=typeof d=="object"&&d||ah;const{css:p,...h}=d,g={};for(const v in i)if(delete h[v],v in d){let y=d[v];typeof y=="object"&&y?g[v]={"@initial":i[v],...y}:(y=String(y),g[v]=y!=="undefined"||s.has(v)?y:i[v])}else g[v]=i[v];const m=new Set([...o]);for(const[v,y,S,w]of t.composers){n.rules.styled.cache.has(v)||(n.rules.styled.cache.add(v),kt(y,[`.${v}`],[],e,(x=>{l.styled.apply(x)})));const C=ta(S,g,e.media),_=ta(w,g,e.media,!0);for(const x of C)if(x!==void 0)for(const[k,R,O]of x){const T=`${v}-${yt(R)}-${k}`;m.add(T);const D=(O?n.rules.resonevar:n.rules.onevar).cache,P=O?l.resonevar:l.onevar;D.has(T)||(D.add(T),kt(R,[`.${T}`],[],e,(M=>{P.apply(M)})))}for(const x of _)if(x!==void 0)for(const[k,R]of x){const O=`${v}-${yt(R)}-${k}`;m.add(O),n.rules.allvar.cache.has(O)||(n.rules.allvar.cache.add(O),kt(R,[`.${O}`],[],e,(T=>{l.allvar.apply(T)})))}}if(typeof p=="object"&&p){const v=`${r}-i${yt(p)}-css`;m.add(v),n.rules.inline.cache.has(v)||(n.rules.inline.cache.add(v),kt(p,[`.${v}`],[],e,(y=>{l.inline.apply(y)})))}for(const v of String(d.className||"").trim().split(/\s+/))v&&m.add(v);const b=h.className=[...m].join(" ");return{type:t.type,className:b,selector:c,props:h,toString:()=>b,deferredInjector:a}};return uo(u,{className:r,selector:c,[bt]:t,toString:()=>(n.rules.styled.cache.has(r)||u(),r)})},sh=e=>{let t="";const n=[],r={},o=[];for(const[i,,,,s,a]of e){t===""&&(t=i),n.push(i),o.push(...a);for(const l in s){const c=s[l];(r[l]===void 0||c!=="undefined"||a.includes(c))&&(r[l]=c)}}return[t,n,r,new Set(o)]},ta=(e,t,n,r)=>{const o=[];e:for(let[i,s,a]of e){if(a)continue;let l,c=0,u=!1;for(l in i){const d=i[l];let p=t[l];if(p!==d){if(typeof p!="object"||!p)continue e;{let h,g,m=0;for(const b in p){if(d===String(p[b])){if(b!=="@initial"){const v=b.slice(1);(g=g||[]).push(v in n?n[v]:b.replace(/^@media ?/,"")),u=!0}c+=m,h=!0}++m}if(g&&g.length&&(s={["@media "+g.join(", ")]:s}),!h)continue e}}}(o[c]=o[c]||[]).push([r?"cv":`${l}-${i[l]}`,s,u])}return o},ah={},lh=It(),ch=(e,t)=>lh(e,(()=>(...n)=>{const r=()=>{for(let o of n){o=typeof o=="object"&&o||{};let i=yt(o);if(!t.rules.global.cache.has(i)){if(t.rules.global.cache.add(i),"@import"in o){let s=[].indexOf.call(t.sheet.cssRules,t.rules.themed.group)-1;for(let a of[].concat(o["@import"]))a=a.includes('"')||a.includes("'")?a:`"${a}"`,t.sheet.insertRule(`@import ${a};`,s++);delete o["@import"]}kt(o,[],[],e,(s=>{t.rules.global.apply(s)}))}}return""};return uo(r,{toString:r})})),uh=It(),fh=(e,t)=>uh(e,(()=>n=>{const r=`${Ge(e.prefix)}k-${yt(n)}`,o=()=>{if(!t.rules.global.cache.has(r)){t.rules.global.cache.add(r);const i=[];kt(n,[],[],e,(a=>i.push(a)));const s=`@keyframes ${r}{${i.join("")}}`;t.rules.global.apply(s)}return r};return uo(o,{get name(){return o()},toString:o})})),dh=class{constructor(t,n,r,o){this.token=t==null?"":String(t),this.value=n==null?"":String(n),this.scale=r==null?"":String(r),this.prefix=o==null?"":String(o)}get computedValue(){return"var("+this.variable+")"}get variable(){return"--"+Ge(this.prefix)+Ge(this.scale)+this.token}toString(){return this.computedValue}},ph=It(),hh=(e,t)=>ph(e,(()=>(n,r)=>{r=typeof n=="object"&&n||Object(r);const o=`.${n=(n=typeof n=="string"?n:"")||`${Ge(e.prefix)}t-${yt(r)}`}`,i={},s=[];for(const l in r){i[l]={};for(const c in r[l]){const u=`--${Ge(e.prefix)}${l}-${c}`,d=Js(String(r[l][c]),e.prefix,l);i[l][c]=new dh(c,d,l,e.prefix),s.push(`${u}:${d}`)}}const a=()=>{if(s.length&&!t.rules.themed.cache.has(n)){t.rules.themed.cache.add(n);const l=`${r===e.theme?":root,":""}.${n}{${s.join(";")}}`;t.rules.themed.apply(l)}return n};return{...i,get className(){return a()},selector:o,toString:a}})),gh=It(),mh=It(),vh=e=>{const t=(n=>{let r=!1;const o=gh(n,(i=>{r=!0;const s="prefix"in(i=typeof i=="object"&&i||{})?String(i.prefix):"",a=typeof i.media=="object"&&i.media||{},l=typeof i.root=="object"?i.root||null:globalThis.document||null,c=typeof i.theme=="object"&&i.theme||{},u={prefix:s,media:a,theme:c,themeMap:typeof i.themeMap=="object"&&i.themeMap||{...Up},utils:typeof i.utils=="object"&&i.utils||{}},d=th(l),p={css:ea(u,d),globalCss:ch(u,d),keyframes:fh(u,d),createTheme:hh(u,d),reset(){d.reset(),p.theme.toString()},theme:{},sheet:d,config:u,prefix:s,getCssText:d.toString,toString:d.toString};return String(p.theme=p.createTheme(c)),p}));return r||o.reset(),o})(e);return t.styled=(({config:n,sheet:r})=>mh(n,(()=>{const o=ea(n,r);return(...i)=>{const s=o(...i),a=s[bt].type,l=f.forwardRef(((c,u)=>{const d=c&&c.as||a,{props:p,deferredInjector:h}=s(c);return delete p.as,p.ref=u,h?f.createElement(f.Fragment,null,f.createElement(d,p),f.createElement(h,null)):f.createElement(d,p)}));return l.className=s.className,l.displayName=`Styled.${a.displayName||a.name||a}`,l.selector=s.selector,l.toString=()=>s.selector,l[bt]=s[bt],l}})))(t),t};function bh(e,t,n){return Math.max(t,Math.min(e,n))}const ce={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function na(e,t,n){return t===0||Math.abs(t)===1/0?Math.pow(e,n*5):e*t*n/(t+n*e)}function ra(e,t,n,r=.15){return r===0?bh(e,t,n):e<t?-na(t-e,n-t,r)+t:e>n?+na(e-n,n-t,r)+n:e}function yh(e,[t,n],[r,o]){const[[i,s],[a,l]]=e;return[ra(t,i,s,r),ra(n,a,l,o)]}function Eh(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _h(e){var t=Eh(e,"string");return typeof t=="symbol"?t:String(t)}function be(e,t,n){return t=_h(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function oa(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function X(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?oa(Object(n),!0).forEach(function(r){be(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):oa(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const ia={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function sa(e){return e?e[0].toUpperCase()+e.slice(1):""}const wh=["enter","leave"];function Sh(e=!1,t){return e&&!wh.includes(t)}function xh(e,t="",n=!1){const r=ia[e],o=r&&r[t]||t;return"on"+sa(e)+sa(o)+(Sh(n,o)?"Capture":"")}const Ch=["gotpointercapture","lostpointercapture"];function Oh(e){let t=e.substring(2).toLowerCase();const n=!!~t.indexOf("passive");n&&(t=t.replace("passive",""));const r=Ch.includes(t)?"capturecapture":"capture",o=!!~t.indexOf(r);return o&&(t=t.replace("capture","")),{device:t,capture:o,passive:n}}function Ph(e,t=""){const n=ia[e],r=n&&n[t]||t;return e+r}function Kn(e){return"touches"in e}function aa(e){return Kn(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function $h(e){return Array.from(e.touches).filter(t=>{var n,r;return t.target===e.currentTarget||((n=e.currentTarget)===null||n===void 0||(r=n.contains)===null||r===void 0?void 0:r.call(n,t.target))})}function Ah(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function la(e){return Kn(e)?Ah(e)[0]:e}function Th(e){return $h(e).map(t=>t.identifier)}function ho(e){const t=la(e);return Kn(e)?t.identifier:t.pointerId}function ca(e){const t=la(e);return[t.clientX,t.clientY]}function Dh(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i}=e;Object.assign(t,{shiftKey:n,altKey:r,metaKey:o,ctrlKey:i})}return t}function Gn(e,...t){return typeof e=="function"?e(...t):e}function Ih(){}function Lh(...e){return e.length===0?Ih:e.length===1?e[0]:function(){let t;for(const n of e)t=n.apply(this,arguments)||t;return t}}function ua(e,t){return Object.assign({},t,e||{})}const kh=32;class Mh{constructor(t,n,r){this.ctrl=t,this.args=n,this.key=r,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:n,ingKey:r,args:o}=this;n[r]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=o,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const n=this.state,r=this.config;n._active||(this.reset(),this.computeInitial(),n._active=!0,n.target=t.target,n.currentTarget=t.currentTarget,n.lastOffset=r.from?Gn(r.from,n):n.offset,n.offset=n.lastOffset,n.startTime=n.timeStamp=t.timeStamp)}computeValues(t){const n=this.state;n._values=t,n.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:n,config:r,shared:o}=this;n.args=this.args;let i=0;if(t&&(n.event=t,r.preventDefault&&t.cancelable&&n.event.preventDefault(),n.type=t.type,o.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,o.locked=!!document.pointerLockElement,Object.assign(o,Dh(t)),o.down=o.pressed=o.buttons%2===1||o.touches>0,i=t.timeStamp-n.timeStamp,n.timeStamp=t.timeStamp,n.elapsedTime=n.timeStamp-n.startTime),n._active){const _=n._delta.map(Math.abs);ce.addTo(n._distance,_)}this.axisIntent&&this.axisIntent(t);const[s,a]=n._movement,[l,c]=r.threshold,{_step:u,values:d}=n;if(r.hasCustomTransform?(u[0]===!1&&(u[0]=Math.abs(s)>=l&&d[0]),u[1]===!1&&(u[1]=Math.abs(a)>=c&&d[1])):(u[0]===!1&&(u[0]=Math.abs(s)>=l&&Math.sign(s)*l),u[1]===!1&&(u[1]=Math.abs(a)>=c&&Math.sign(a)*c)),n.intentional=u[0]!==!1||u[1]!==!1,!n.intentional)return;const p=[0,0];if(r.hasCustomTransform){const[_,x]=d;p[0]=u[0]!==!1?_-u[0]:0,p[1]=u[1]!==!1?x-u[1]:0}else p[0]=u[0]!==!1?s-u[0]:0,p[1]=u[1]!==!1?a-u[1]:0;this.restrictToAxis&&!n._blocked&&this.restrictToAxis(p);const h=n.offset,g=n._active&&!n._blocked||n.active;g&&(n.first=n._active&&!n.active,n.last=!n._active&&n.active,n.active=o[this.ingKey]=n._active,t&&(n.first&&("bounds"in r&&(n._bounds=Gn(r.bounds,n)),this.setup&&this.setup()),n.movement=p,this.computeOffset()));const[m,b]=n.offset,[[v,y],[S,w]]=n._bounds;n.overflow=[m<v?-1:m>y?1:0,b<S?-1:b>w?1:0],n._movementBound[0]=n.overflow[0]?n._movementBound[0]===!1?n._movement[0]:n._movementBound[0]:!1,n._movementBound[1]=n.overflow[1]?n._movementBound[1]===!1?n._movement[1]:n._movementBound[1]:!1;const C=n._active?r.rubberband||[0,0]:[0,0];if(n.offset=yh(n._bounds,n.offset,C),n.delta=ce.sub(n.offset,h),this.computeMovement(),g&&(!n.last||i>kh)){n.delta=ce.sub(n.offset,h);const _=n.delta.map(Math.abs);ce.addTo(n.distance,_),n.direction=n.delta.map(Math.sign),n._direction=n._delta.map(Math.sign),!n.first&&i>0&&(n.velocity=[_[0]/i,_[1]/i],n.timeDelta=i)}}emit(){const t=this.state,n=this.shared,r=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!r.triggerAllEvents)return;const o=this.handler(X(X(X({},n),t),{},{[this.aliasKey]:t.values}));o!==void 0&&(t.memo=o)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function Nh([e,t],n){const r=Math.abs(e),o=Math.abs(t);if(r>o&&r>n)return"x";if(o>r&&o>n)return"y"}class jh extends Mh{constructor(...t){super(...t),be(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=ce.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=ce.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const n=this.state,r=this.config;if(!n.axis&&t){const o=typeof r.axisThreshold=="object"?r.axisThreshold[aa(t)]:r.axisThreshold;n.axis=Nh(n._movement,o)}n._blocked=(r.lockDirection||!!r.axis)&&!n.axis||!!r.axis&&r.axis!==n.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const Rh=e=>e,fa=.15,da={enabled(e=!0){return e},eventOptions(e,t,n){return X(X({},n.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[fa,fa];case!1:return[0,0];default:return ce.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return ce.toVector(e)},transform(e,t,n){const r=e||n.shared.transform;return this.hasCustomTransform=!!r,r||Rh},threshold(e){return ce.toVector(e,0)}},Fh=0,dn=X(X({},da),{},{axis(e,t,{axis:n}){if(this.lockDirection=n==="lock",!this.lockDirection)return n},axisThreshold(e=Fh){return e},bounds(e={}){if(typeof e=="function")return i=>dn.bounds(e(i));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:n=1/0,top:r=-1/0,bottom:o=1/0}=e;return[[t,n],[r,o]]}}),pa={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class Vh extends jh{constructor(...t){super(...t),be(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const n=t._bounds.getBoundingClientRect(),r=t.currentTarget.getBoundingClientRect(),o={left:n.left-r.left+t.offset[0],right:n.right-r.right+t.offset[0],top:n.top-r.top+t.offset[1],bottom:n.bottom-r.bottom+t.offset[1]};t._bounds=dn.bounds(o)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const n=this.config,r=this.state;if(t.buttons!=null&&(Array.isArray(n.pointerButtons)?!n.pointerButtons.includes(t.buttons):n.pointerButtons!==-1&&n.pointerButtons!==t.buttons))return;const o=this.ctrl.setEventIds(t);n.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(o&&o.size>1&&r._pointerActive)&&(this.start(t),this.setupPointer(t),r._pointerId=ho(t),r._pointerActive=!0,this.computeValues(ca(t)),this.computeInitial(),n.preventScrollAxis&&aa(t)!=="mouse"?(r._active=!1,this.setupScrollPrevention(t)):n.delay>0?(this.setupDelayTrigger(t),n.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const n=this.state;n._active=!0,n._preventScroll=!0,n._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const n=this.state,r=this.config;if(!n._pointerActive)return;const o=ho(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;const i=ca(t);if(document.pointerLockElement===t.target?n._delta=[t.movementX,t.movementY]:(n._delta=ce.sub(i,n._values),this.computeValues(i)),ce.addTo(n._movement,n._delta),this.compute(t),n._delayed&&n.intentional){this.timeoutStore.remove("dragDelay"),n.active=!1,this.startPointerDrag(t);return}if(r.preventScrollAxis&&!n._preventScroll)if(n.axis)if(n.axis===r.preventScrollAxis||r.preventScrollAxis==="xy"){n._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{}const n=this.state,r=this.config;if(!n._active||!n._pointerActive)return;const o=ho(t);if(n._pointerId!==void 0&&o!==n._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[i,s]=n._distance;if(n.tap=i<=r.tapsThreshold&&s<=r.tapsThreshold,n.tap&&r.filterTaps)n._force=!0;else{const[a,l]=n._delta,[c,u]=n._movement,[d,p]=r.swipe.velocity,[h,g]=r.swipe.distance,m=r.swipe.duration;if(n.elapsedTime<m){const b=Math.abs(a/n.timeDelta),v=Math.abs(l/n.timeDelta);b>d&&Math.abs(c)>h&&(n.swipe[0]=Math.sign(a)),v>p&&Math.abs(u)>g&&(n.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const n=this.config,r=n.device;n.pointerLock&&t.currentTarget.requestPointerLock(),n.pointerCapture||(this.eventStore.add(this.sharedConfig.window,r,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,r,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,Bh(t);const n=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",n),this.eventStore.add(this.sharedConfig.window,"touch","cancel",n),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const n=pa[t.key];if(n){const r=this.state,o=t.shiftKey?10:t.altKey?.1:1;this.start(t),r._delta=n(this.config.keyboardDisplacement,o),r._keyboardActive=!0,ce.addTo(r._movement,r._delta),this.compute(t),this.emit()}}keyUp(t){t.key in pa&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const n=this.config.device;t(n,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(n,"change",this.pointerMove.bind(this)),t(n,"end",this.pointerUp.bind(this)),t(n,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Bh(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const pn=typeof window<"u"&&window.document&&window.document.createElement;function ha(){return pn&&"ontouchstart"in window}function zh(){return ha()||pn&&window.navigator.maxTouchPoints>1}function Hh(){return pn&&"onpointerdown"in window}function Uh(){return pn&&"exitPointerLock"in window.document}function Wh(){try{return"constructor"in GestureEvent}catch{return!1}}const $e={isBrowser:pn,gesture:Wh(),touch:ha(),touchscreen:zh(),pointer:Hh(),pointerLock:Uh()},Kh=250,Gh=180,Yh=.5,qh=50,Xh=250,Jh=10,ga={mouse:0,touch:0,pen:8},Zh=X(X({},dn),{},{device(e,t,{pointer:{touch:n=!1,lock:r=!1,mouse:o=!1}={}}){return this.pointerLock=r&&$e.pointerLock,$e.touch&&n?"touch":this.pointerLock?"mouse":$e.pointer&&!o?"pointer":$e.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:n}){if(this.preventScrollDelay=typeof n=="number"?n:n||n===void 0&&e?Kh:void 0,!(!$e.touchscreen||n===!1))return e||(n!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:n=!0,buttons:r=1,keys:o=!0}={}}){return this.pointerButtons=r,this.keys=o,!this.pointerLock&&this.device==="pointer"&&n},threshold(e,t,{filterTaps:n=!1,tapsThreshold:r=3,axis:o=void 0}){const i=ce.toVector(e,n?r:o?1:0);return this.filterTaps=n,this.tapsThreshold=r,i},swipe({velocity:e=Yh,distance:t=qh,duration:n=Xh}={}){return{velocity:this.transform(ce.toVector(e)),distance:this.transform(ce.toVector(t)),duration:n}},delay(e=0){switch(e){case!0:return Gh;case!1:return 0;default:return e}},axisThreshold(e){return e?X(X({},ga),e):ga},keyboardDisplacement(e=Jh){return e}});X(X({},da),{},{device(e,t,{shared:n,pointer:{touch:r=!1}={}}){if(n.target&&!$e.touch&&$e.gesture)return"gesture";if($e.touch&&r)return"touch";if($e.touchscreen){if($e.pointer)return"pointer";if($e.touch)return"touch"}},bounds(e,t,{scaleBounds:n={},angleBounds:r={}}){const o=s=>{const a=ua(Gn(n,s),{min:-1/0,max:1/0});return[a.min,a.max]},i=s=>{const a=ua(Gn(r,s),{min:-1/0,max:1/0});return[a.min,a.max]};return typeof n!="function"&&typeof r!="function"?[o(),i()]:s=>[o(s),i(s)]},threshold(e,t,n){return this.lockDirection=n.axis==="lock",ce.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}}),X(X({},dn),{},{mouseOnly:(e=!0)=>e}),X(X({},dn),{},{mouseOnly:(e=!0)=>e});const ma=new Map,go=new Map;function Qh(e){ma.set(e.key,e.engine),go.set(e.key,e.resolver)}const eg={key:"drag",engine:Vh,resolver:Zh};function tg(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}function ng(e,t){if(e==null)return{};var n=tg(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}const rg={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=$e.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},og=["target","eventOptions","window","enabled","transform"];function Yn(e={},t){const n={};for(const[r,o]of Object.entries(t))switch(typeof o){case"function":n[r]=o.call(n,e[r],r,e);break;case"object":n[r]=Yn(e[r],o);break;case"boolean":o&&(n[r]=e[r]);break}return n}function ig(e,t,n={}){const r=e,{target:o,eventOptions:i,window:s,enabled:a,transform:l}=r,c=ng(r,og);if(n.shared=Yn({target:o,eventOptions:i,window:s,enabled:a,transform:l},rg),t){const u=go.get(t);n[t]=Yn(X({shared:n.shared},c),u)}else for(const u in c){const d=go.get(u);d&&(n[u]=Yn(X({shared:n.shared},c[u]),d))}return n}class va{constructor(t,n){be(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=n}add(t,n,r,o,i){const s=this._listeners,a=Ph(n,r),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=X(X({},l),i);t.addEventListener(a,o,c);const u=()=>{t.removeEventListener(a,o,c),s.delete(u)};return s.add(u),u}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class sg{constructor(){be(this,"_timeouts",new Map)}add(t,n,r=140,...o){this.remove(t),this._timeouts.set(t,window.setTimeout(n,r,...o))}remove(t){const n=this._timeouts.get(t);n&&window.clearTimeout(n)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}class ag{constructor(t){be(this,"gestures",new Set),be(this,"_targetEventStore",new va(this)),be(this,"gestureEventStores",{}),be(this,"gestureTimeoutStores",{}),be(this,"handlers",{}),be(this,"config",{}),be(this,"pointerIds",new Set),be(this,"touchIds",new Set),be(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),lg(this,t)}setEventIds(t){if(Kn(t))return this.touchIds=new Set(Th(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,n){this.handlers=t,this.nativeHandlers=n}applyConfig(t,n){this.config=ig(t,n,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const n=this.config.shared,r={};let o;if(!(n.target&&(o=n.target(),!o))){if(n.enabled){for(const s of this.gestures){const a=this.config[s],l=ba(r,a.eventOptions,!!o);if(a.enabled){const c=ma.get(s);new c(this,t,s).bind(l)}}const i=ba(r,n.eventOptions,!!o);for(const s in this.nativeHandlers)i(s,"",a=>this.nativeHandlers[s](X(X({},this.state.shared),{},{event:a,args:t})),void 0,!0)}for(const i in r)r[i]=Lh(...r[i]);if(!o)return r;for(const i in r){const{device:s,capture:a,passive:l}=Oh(i);this._targetEventStore.add(o,s,"",r[i],{capture:a,passive:l})}}}}function Mt(e,t){e.gestures.add(t),e.gestureEventStores[t]=new va(e,t),e.gestureTimeoutStores[t]=new sg}function lg(e,t){t.drag&&Mt(e,"drag"),t.wheel&&Mt(e,"wheel"),t.scroll&&Mt(e,"scroll"),t.move&&Mt(e,"move"),t.pinch&&Mt(e,"pinch"),t.hover&&Mt(e,"hover")}const ba=(e,t,n)=>(r,o,i,s={},a=!1)=>{var l,c;const u=(l=s.capture)!==null&&l!==void 0?l:t.capture,d=(c=s.passive)!==null&&c!==void 0?c:t.passive;let p=a?r:xh(r,o,u);n&&d&&(p+="Passive"),e[p]=e[p]||[],e[p].push(i)};function cg(e,t={},n,r){const o=f.useMemo(()=>new ag(e),[]);if(o.applyHandlers(e,r),o.applyConfig(t,n),f.useEffect(o.effect.bind(o)),f.useEffect(()=>o.clean.bind(o),[]),t.target===void 0)return o.bind.bind(o)}function ug(e,t){return Qh(eg),cg({drag:e},t||{},"drag")}var fg=Object.defineProperty,Nt=(e,t)=>fg(e,"name",{value:t,configurable:!0}),ya=!!(typeof window<"u"&&window.document&&window.document.createElement);function Fe(e,t,{checkForDefaultPrevented:n=!0}={}){return Nt(function(o){if(e==null||e(o),n===!1||!o||!o.defaultPrevented)return t==null?void 0:t(o)},"handleEvent")}Nt(Fe,"composeEventHandlers");function dg(e){var t,n;if(!ya)throw new Error("Cannot access window outside of the DOM");return(n=(t=e==null?void 0:e.ownerDocument)==null?void 0:t.defaultView)!=null?n:window}Nt(dg,"getOwnerWindow");function mo(e){var t;if(!ya)throw new Error("Cannot access document outside of the DOM");return(t=e==null?void 0:e.ownerDocument)!=null?t:document}Nt(mo,"getOwnerDocument");function Ea(e,t=!1){const{activeElement:n}=mo(e);if(!(n!=null&&n.nodeName))return null;if(_a(n)&&n.contentDocument)return Ea(n.contentDocument.body,t);if(t){const r=n.getAttribute("aria-activedescendant");if(r){const o=mo(n).getElementById(r);if(o)return o}}return n}Nt(Ea,"getActiveElement");function _a(e){return e.tagName==="IFRAME"}Nt(_a,"isFrame");var pg=Object.defineProperty,Ae=(e,t)=>pg(e,"name",{value:t,configurable:!0});function hg(e,t){const n=E.createContext(t);n.displayName=e+"Context";const r=Ae(i=>{const{children:s,...a}=i,l=E.useMemo(()=>a,Object.values(a));return B.jsx(n.Provider,{value:l,children:s})},"Provider");r.displayName=e+"Provider";function o(i,s={}){const{optional:a=!1}=s,l=E.useContext(n);if(l)return l;if(t!==void 0)return t;if(!a)throw new Error(`\`${i}\` must be used within \`${e}\``)}return Ae(o,"useContext"),[r,o]}Ae(hg,"createContext");function vo(e,t=[]){let n=[];function r(i,s){const a=E.createContext(s);a.displayName=i+"Context";const l=n.length;n=[...n,s];const c=Ae(d=>{var v;const{scope:p,children:h,...g}=d,m=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,b=E.useMemo(()=>g,Object.values(g));return B.jsx(m.Provider,{value:b,children:h})},"Provider");c.displayName=i+"Provider";function u(d,p,h={}){var v;const{optional:g=!1}=h,m=((v=p==null?void 0:p[e])==null?void 0:v[l])||a,b=E.useContext(m);if(b)return b;if(s!==void 0)return s;if(!g)throw new Error(`\`${d}\` must be used within \`${i}\``)}return Ae(u,"useContext"),[c,u]}Ae(r,"createContext");const o=Ae(()=>{const i=n.map(s=>E.createContext(s));return Ae(function(a){const l=(a==null?void 0:a[e])||i;return E.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])},"useScope")},"createScope");return o.scopeName=e,[r,wa(o,...t)]}Ae(vo,"createContextScope");function wa(...e){const t=e[0];if(e.length===1)return t;const n=Ae(()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return Ae(function(i){const s=r.reduce((a,{useScope:l,scopeName:c})=>{const d=l(i)[`__scope${c}`];return{...a,...d}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])},"useComposedScopes")},"createScope");return n.scopeName=t.scopeName,n}Ae(wa,"composeContextScopes");var gg=Object.defineProperty,mg=(e,t)=>gg(e,"name",{value:t,configurable:!0}),Sa=E[" useInsertionEffect ".trim().toString()];function hn(e){const t=E.useRef(e);return typeof Sa=="function"?Sa(()=>{t.current=e}):Pe(()=>{t.current=e}),E.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}mg(hn,"useCallbackRef");var vg=Object.defineProperty,ie=(e,t)=>vg(e,"name",{value:t,configurable:!0}),bo="dismissableLayer.update",bg="dismissableLayer.pointerDownOutside",yg="dismissableLayer.focusOutside",xa,Ca=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Eg=E.forwardRef(ie(function(t,n){var D;const{disableOutsidePointerEvents:r=!1,deferPointerDownOutside:o=!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=t,d=E.useContext(Ca),[p,h]=E.useState(null),g=(D=p==null?void 0:p.ownerDocument)!=null?D:globalThis==null?void 0:globalThis.document,[,m]=E.useState({}),b=ct(n,h),v=Array.from(d.layers),[y]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),S=y?v.indexOf(y):-1,w=p?v.indexOf(p):-1,C=d.layersWithOutsidePointerEventsDisabled.size>0,_=w>=S,x=E.useRef(!1),k=Oa(P=>{s==null||s(P),l==null||l(P),P.defaultPrevented||c==null||c()},{ownerDocument:g,deferPointerDownOutside:o,isDeferredPointerDownOutsideRef:x,dismissableSurfaces:d.dismissableSurfaces,shouldHandlePointerDownOutside:E.useCallback(P=>{if(!(P instanceof Node))return!1;const M=[...d.branches].some(N=>N.contains(P));return _&&!M},[d.branches,_])}),R=Pa(P=>{if(o&&x.current)return;const M=P.target;[...d.branches].some(H=>H.contains(M))||(a==null||a(P),l==null||l(P),P.defaultPrevented||c==null||c())},g),O=p?w===v.length-1:!1,T=hn(P=>{P.key==="Escape"&&(i==null||i(P),!P.defaultPrevented&&c&&(P.preventDefault(),c()))});return E.useEffect(()=>{if(O)return g.addEventListener("keydown",T,{capture:!0}),()=>g.removeEventListener("keydown",T,{capture:!0})},[g,O,T]),E.useEffect(()=>{if(p)return r&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(xa=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),yo(),()=>{r&&(d.layersWithOutsidePointerEventsDisabled.delete(p),d.layersWithOutsidePointerEventsDisabled.size===0&&(g.body.style.pointerEvents=xa))}},[p,g,r,d]),E.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),yo())},[p,d]),E.useEffect(()=>{const P=ie(()=>m({}),"handleUpdate");return document.addEventListener(bo,P),()=>document.removeEventListener(bo,P)},[]),B.jsx(vt.div,{...u,ref:b,style:{pointerEvents:C?_?"auto":"none":void 0,...t.style},onFocusCapture:Fe(t.onFocusCapture,R.onFocusCapture),onBlurCapture:Fe(t.onBlurCapture,R.onBlurCapture),onPointerDownCapture:Fe(t.onPointerDownCapture,k.onPointerDownCapture)})},"DismissableLayer"));function _g(){const e=E.useContext(Ca),[t,n]=E.useState(null);return E.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ie(_g,"useDismissableLayerSurface");var wg=ie(()=>!0,"IS_TRUE");function Oa(e,t){const{ownerDocument:n=globalThis==null?void 0:globalThis.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:o,dismissableSurfaces:i,shouldHandlePointerDownOutside:s=wg}=t,a=hn(e),l=E.useRef(!1),c=E.useRef(!1),u=E.useRef(new Map),d=E.useRef(()=>{});return E.useEffect(()=>{function p(){c.current=!1,o.current=!1,u.current.clear()}ie(p,"resetOutsideInteraction");function h(){return Array.from(u.current.values()).some(Boolean)}ie(h,"isOutsideInteractionIntercepted");function g(S){if(!c.current)return;const w=S.target;w instanceof Node&&[...i].some(_=>_.contains(w))||u.current.set(S.type,!0),S.type==="click"&&window.setTimeout(()=>{c.current&&d.current()},0)}ie(g,"handleInteractionCapture");function m(S){c.current&&u.current.set(S.type,!1)}ie(m,"handleInteractionBubble");const b=ie(S=>{if(S.target&&!l.current){let w=function(){n.removeEventListener("click",d.current);const _=h();p(),_||Eo(bg,a,C,{discrete:!0})};if(ie(w,"handleAndDispatchPointerDownOutsideEvent"),!s(S.target)){n.removeEventListener("click",d.current),p(),l.current=!1;return}const C={originalEvent:S};c.current=!0,o.current=r&&S.button===0,u.current.clear(),!r||S.button!==0?w():(n.removeEventListener("click",d.current),d.current=w,n.addEventListener("click",d.current,{once:!0}))}else n.removeEventListener("click",d.current),p();l.current=!1},"handlePointerDown"),v=["pointerup","mousedown","mouseup","touchstart","touchend","click"];for(const S of v)n.addEventListener(S,g,!0),n.addEventListener(S,m);const y=window.setTimeout(()=>{n.addEventListener("pointerdown",b)},0);return()=>{window.clearTimeout(y),n.removeEventListener("pointerdown",b),n.removeEventListener("click",d.current);for(const S of v)n.removeEventListener(S,g,!0),n.removeEventListener(S,m)}},[n,a,r,o,i,s]),{onPointerDownCapture:ie(()=>l.current=!0,"onPointerDownCapture")}}ie(Oa,"usePointerDownOutside");function Pa(e,t=globalThis==null?void 0:globalThis.document){const n=hn(e),r=E.useRef(!1);return E.useEffect(()=>{const o=ie(i=>{i.target&&!r.current&&Eo(yg,n,{originalEvent:i},{discrete:!1})},"handleFocus");return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:ie(()=>r.current=!0,"onFocusCapture"),onBlurCapture:ie(()=>r.current=!1,"onBlurCapture")}}ie(Pa,"useFocusOutside");function yo(){const e=new CustomEvent(bo);document.dispatchEvent(e)}ie(yo,"dispatchUpdate");function Eo(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?Bs(o,i):o.dispatchEvent(i)}ie(Eo,"handleAndDispatchCustomEvent");var Sg=Object.defineProperty,ue=(e,t)=>Sg(e,"name",{value:t,configurable:!0}),$a=E.createContext(null);function xg({registry:e,children:t}){return e?B.jsx($a.Provider,{value:e,children:t}):t}ue(xg,"FocusScopeBranchProvider");function Cg(){const[e,t]=E.useState([]),n=E.useMemo(()=>({add:ue(r=>t(o=>o.includes(r)?o:[...o,r]),"add"),remove:ue(r=>t(o=>o.filter(i=>i!==r)),"remove")}),[]);return{nodes:e,registry:n}}ue(Cg,"useFocusScopeBranchRegistry");function Aa(e){const t=E.useContext($a);E.useEffect(()=>{if(!(!e||!t))return t.add(e),()=>t.remove(e)},[e,t])}ue(Aa,"useFocusScopeBranch");function Og(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(La(r,{select:t}),document.activeElement!==n)return}ue(Og,"focusFirst");function Pg(e){const t=Ta(e),n=_o(t,e),r=_o(t.reverse(),e);return[n,r]}ue(Pg,"getTabbableEdges");function Ta(e){const t=[],r=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ue(o=>{const i=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||i?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},"acceptNode")});for(;r.nextNode();)t.push(r.currentNode);return t}ue(Ta,"getTabbableCandidates");function _o(e,t){const n=typeof t.checkVisibility=="function"&&t.checkVisibility({checkVisibilityCSS:!0});for(const r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Da(r,{upTo:t})))return r}ue(_o,"findVisible");function Da(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}ue(Da,"isHidden");function Ia(e){return e.tagName==="INPUT"&&typeof e.select=="function"}ue(Ia,"isSelectableInput");function La(e,{select:t=!1}={}){var n;if(e&&e.focus){const o=((n=e.ownerDocument)!=null?n:document).activeElement;e.focus({preventScroll:!0}),e!==o&&Ia(e)&&t&&e.select()}}ue(La,"focus");function $g(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=wo(e,t),e.unshift(t)},remove(t){var n;e=wo(e,t),(n=e[0])==null||n.resume()}}}ue($g,"createFocusScopesStack");function wo(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}ue(wo,"arrayRemove");function Ag(e){return e.filter(t=>t.tagName!=="A")}ue(Ag,"removeLinks");var Tg=Object.defineProperty,Dg=(e,t)=>Tg(e,"name",{value:t,configurable:!0}),Ig=E[" useId ".trim().toString()]||(()=>{}),Lg=0;function ka(e){const[t,n]=E.useState(Ig());return Pe(()=>{e||n(r=>r!=null?r:String(Lg++))},[e]),e||(t?`radix-${t}`:"")}Dg(ka,"useId");const kg=["top","right","bottom","left"],ut=Math.min,Ye=Math.max,qn=Math.round,Xn=Math.floor,qe=e=>({x:e,y:e}),Mg={left:"right",right:"left",bottom:"top",top:"bottom"};function Ma(e,t,n){return Ye(e,ut(t,n))}function Xe(e,t){return typeof e=="function"?e(t):e}function ft(e){return e.split("-")[0]}function jt(e){return e.split("-")[1]}function So(e){return e==="x"?"y":"x"}function xo(e){return e==="y"?"height":"width"}function Ve(e){const t=e[0];return t==="t"||t==="b"?"y":"x"}function Co(e){return So(Ve(e))}function Ng(e,t,n){n===void 0&&(n=!1);const r=jt(e),o=Co(e),i=xo(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=Jn(s)),[s,Jn(s)]}function jg(e){const t=Jn(e);return[Oo(e),t,Oo(t)]}function Oo(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const Na=["left","right"],ja=["right","left"],Rg=["top","bottom"],Fg=["bottom","top"];function Vg(e,t,n){switch(e){case"top":case"bottom":return n?t?ja:Na:t?Na:ja;case"left":case"right":return t?Rg:Fg;default:return[]}}function Bg(e,t,n,r){const o=jt(e);let i=Vg(ft(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(Oo)))),i}function Jn(e){const t=ft(e);return Mg[t]+e.slice(t.length)}function zg(e){var t,n,r,o;return{top:(t=e.top)!=null?t:0,right:(n=e.right)!=null?n:0,bottom:(r=e.bottom)!=null?r:0,left:(o=e.left)!=null?o:0}}function Ra(e){return typeof e!="number"?zg(e):{top:e,right:e,bottom:e,left:e}}function Zn(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Fa(e,t,n){let{reference:r,floating:o}=e;const i=Ve(t),s=Co(t),a=xo(s),l=ft(t),c=i==="y",u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let h;switch(l){case"top":h={x:u,y:r.y-o.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:d};break;case"left":h={x:r.x-o.width,y:d};break;default:h={x:r.x,y:r.y}}const g=jt(t);return g&&(h[s]+=p*(g==="end"?1:-1)*(n&&c?-1:1)),h}async function Hg(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=Xe(t,e),g=Ra(h),b=a[p?d==="floating"?"reference":"floating":d],v=Zn(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(b)))==null||n?b:b.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y=d==="floating"?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,S=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(S))&&await(i.getScale==null?void 0:i.getScale(S))||{x:1,y:1},C=Zn(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:S,strategy:l}):y);return{top:(v.top-C.top+g.top)/w.y,bottom:(C.bottom-v.bottom+g.bottom)/w.y,left:(v.left-C.left+g.left)/w.x,right:(C.right-v.right+g.right)/w.x}}const Ug=50,Wg=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=s.detectOverflow?s:{...s,detectOverflow:Hg},l=await(s.isRTL==null?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Fa(c,r,l),p=r,h=0;const g={};for(let m=0;m<i.length;m++){const b=i[m];if(!b)continue;const{name:v,fn:y}=b,{x:S,y:w,data:C,reset:_}=await y({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:g,rects:c,platform:a,elements:{reference:e,floating:t}});u=S!=null?S:u,d=w!=null?w:d,g[v]={...g[v],...C},_&&h<Ug&&(h++,typeof _=="object"&&(_.placement&&(p=_.placement),_.rects&&(c=_.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:o}):_.rects),{x:u,y:d}=Fa(c,p,l)),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:g}},Kg=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=Xe(e,t)||{};if(c==null)return{};const d=Ra(u),p={x:n,y:r},h=Co(o),g=xo(h),m=await s.getDimensions(c),b=h==="y",v=b?"top":"left",y=b?"bottom":"right",S=b?"clientHeight":"clientWidth",w=i.reference[g]+i.reference[h]-p[h]-i.floating[g],C=p[h]-i.reference[h],_=await(s.getOffsetParent==null?void 0:s.getOffsetParent(c));let x=_?_[S]:0;(!x||!await(s.isElement==null?void 0:s.isElement(_)))&&(x=a.floating[S]||i.floating[g]);const k=w/2-C/2,R=x/2-m[g]/2-1,O=ut(d[v],R),T=ut(d[y],R),D=x-m[g]-T,P=x/2-m[g]/2+k,M=Ma(O,P,D),N=!l.arrow&&jt(o)!=null&&P!==M&&i.reference[g]/2-(P<O?O:T)-m[g]/2<0,H=N?P<O?P-O:P-D:0;return{[h]:p[h]+H,data:{[h]:M,centerOffset:P-M-H,...N&&{alignmentOffset:H}},reset:N}}}),Gg=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=Xe(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const v=ft(o),y=Ve(a),S=ft(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),C=p||(S||!m?[Jn(a)]:jg(a)),_=g!=="none";!p&&_&&C.push(...Bg(a,m,g,w));const x=[a,...C],k=await l.detectOverflow(t,b),R=[];let O=((r=i.flip)==null?void 0:r.overflows)||[];if(u&&R.push(k[v]),d){const M=Ng(o,s,w);R.push(k[M[0]],k[M[1]])}if(O=[...O,{placement:o,overflows:R}],!R.every(M=>M<=0)){var T,D;const M=(((T=i.flip)==null?void 0:T.index)||0)+1,N=x[M];if(N&&(!(d==="alignment"?y!==Ve(N):!1)||O.every(I=>Ve(I.placement)===y?I.overflows[0]>0:!0)))return{data:{index:M,overflows:O},reset:{placement:N}};let H=(D=O.filter(z=>z.overflows[0]<=0).sort((z,I)=>z.overflows[1]-I.overflows[1])[0])==null?void 0:D.placement;if(!H)switch(h){case"bestFit":{var P;const z=(P=O.filter(I=>{if(_){const A=Ve(I.placement);return A===y||A==="y"}return!0}).map(I=>[I.placement,I.overflows.filter(A=>A>0).reduce((A,U)=>A+U,0)]).sort((I,A)=>I[1]-A[1])[0])==null?void 0:P[0];z&&(H=z);break}case"initialPlacement":H=a;break}if(o!==H)return{reset:{placement:H}}}return{}}}};function Va(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Ba(e){return kg.some(t=>e[t]>=0)}const Yg=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n,platform:r}=t,{strategy:o="referenceHidden",...i}=Xe(e,t);switch(o){case"referenceHidden":{const s=await r.detectOverflow(t,{...i,elementContext:"reference"}),a=Va(s,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:Ba(a)}}}case"escaped":{const s=await r.detectOverflow(t,{...i,altBoundary:!0}),a=Va(s,n.floating);return{data:{escapedOffsets:a,escaped:Ba(a)}}}default:return{}}}}},za=new Set(["left","top"]);async function qg(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=ft(n),a=jt(n),l=Ve(n)==="y",c=za.has(s)?-1:1,u=i&&l?-1:1,d=Xe(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:g}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof g=="number"&&(h=a==="end"?g*-1:g),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}const Xg=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await qg(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},Jg=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o,platform:i}=t,{mainAxis:s=!0,crossAxis:a=!1,limiter:l={fn:y=>{let{x:S,y:w}=y;return{x:S,y:w}}},...c}=Xe(e,t),u={x:n,y:r},d=await i.detectOverflow(t,c),p=Ve(o),h=So(p);let g=u[h],m=u[p];const b=(y,S)=>Ma(S+d[y==="y"?"top":"left"],S,S-d[y==="y"?"bottom":"right"]);s&&(g=b(h,g)),a&&(m=b(p,m));const v=l.fn({...t,[h]:g,[p]:m});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:s,[p]:a}}}}}},Zg=function(e){return e===void 0&&(e={}),{options:e,fn(t){var n,r;const{x:o,y:i,placement:s,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Xe(e,t),p={x:o,y:i},h=Ve(s),g=So(h);let m=p[g],b=p[h];const v=Xe(c,t),y=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:(n=v.mainAxis)!=null?n:0,crossAxis:(r=v.crossAxis)!=null?r:0};if(u){const C=g==="y"?"height":"width",_=a.reference[g]-a.floating[C]+y.mainAxis,x=a.reference[g]+a.reference[C]-y.mainAxis;m<_?m=_:m>x&&(m=x)}if(d){var S,w;const C=g==="y"?"width":"height",_=za.has(ft(s)),x=a.reference[h]-a.floating[C]+(_&&((S=l.offset)==null?void 0:S[h])||0)+(_?0:y.crossAxis),k=a.reference[h]+a.reference[C]+(_?0:((w=l.offset)==null?void 0:w[h])||0)-(_?y.crossAxis:0);b<x?b=x:b>k&&(b=k)}return{[g]:m,[h]:b}}}},Qg=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=Xe(e,t),l=await o.detectOverflow(t,a),c=ft(n),u=jt(n),d=Ve(n)==="y",{width:p,height:h}=r.floating;let g,m;c==="top"||c==="bottom"?(g=c,m=u===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,g=u==="end"?"top":"bottom");const b=h-l.top-l.bottom,v=p-l.left-l.right,y=ut(h-l[g],b),S=ut(p-l[m],v),w=t.middlewareData.shift,C=!w;let _=y,x=S;w!=null&&w.enabled.x&&(x=v),w!=null&&w.enabled.y&&(_=b),C&&!u&&(d?x=p-2*Ye(l.left,l.right):_=h-2*Ye(l.top,l.bottom)),await s({...t,availableWidth:x,availableHeight:_});const k=await o.getDimensions(i.floating);return p!==k.width||h!==k.height?{reset:{rects:!0}}:{}}}};function Qn(){return typeof window<"u"}function Rt(e){return Ha(e)?(e.nodeName||"").toLowerCase():"#document"}function ye(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Je(e){var t;return(t=(Ha(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Ha(e){return Qn()?e instanceof Node||e instanceof ye(e).Node:!1}function Be(e){return Qn()?e instanceof Element||e instanceof ye(e).Element:!1}function dt(e){return Qn()?e instanceof HTMLElement||e instanceof ye(e).HTMLElement:!1}function Ua(e){return!Qn()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof ye(e).ShadowRoot}function er(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ze(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&o!=="inline"&&o!=="contents"}function em(e){return/^(table|td|th)$/.test(Rt(e))}function tr(e){try{if(e.matches(":popover-open"))return!0}catch{}try{return e.matches(":modal")}catch{return!1}}const tm=/transform|translate|scale|rotate|perspective|filter/,nm=/paint|layout|strict|content/,Et=e=>!!e&&e!=="none";let Po;function $o(e){const t=Be(e)?ze(e):e;return Et(t.transform)||Et(t.translate)||Et(t.scale)||Et(t.rotate)||Et(t.perspective)||!Ao()&&(Et(t.backdropFilter)||Et(t.filter))||tm.test(t.willChange||"")||nm.test(t.contain||"")}function rm(e){let t=_t(e);for(;dt(t)&&!gn(t);){if($o(t))return t;if(tr(t))return null;t=_t(t)}return null}function Ao(){return Po==null&&(Po=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),Po}function gn(e){return/^(html|body|#document)$/.test(Rt(e))}function ze(e){return ye(e).getComputedStyle(e)}function nr(e){return Be(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _t(e){if(Rt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Ua(e)&&e.host||Je(e);return Ua(t)?t.host:t}function Wa(e){const t=_t(e);return gn(t)?(e.ownerDocument||e).body:dt(t)&&er(t)?t:Wa(t)}function mn(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Wa(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=ye(o);if(i){const a=To(s);return t.concat(s,s.visualViewport||[],er(o)?o:[],a&&n?mn(a):[])}else return t.concat(o,mn(o,[],n))}function To(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ka(e){const t=ze(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=dt(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=qn(n)!==i||qn(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Do(e){return Be(e)?e:e.contextElement}function Ft(e){const t=Do(e);if(!dt(t))return qe(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=Ka(t);let s=(i?qn(n.width):n.width)/r,a=(i?qn(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const om=qe(0);function Ga(e){const t=ye(e);return!Ao()||!t.visualViewport?om:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function im(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===ye(e)}function wt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Do(e);let s=qe(1);t&&(r?Be(r)&&(s=Ft(r)):s=Ft(e));const a=im(i,n,r)?Ga(i):qe(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i&&r){const p=ye(i),h=Be(r)?ye(r):r;let g=p,m=To(g);for(;m&&h!==g;){const b=Ft(m),v=m.getBoundingClientRect(),y=ze(m),S=v.left+(m.clientLeft+parseFloat(y.paddingLeft))*b.x,w=v.top+(m.clientTop+parseFloat(y.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=S,c+=w,g=ye(m),m=To(g)}}return Zn({width:u,height:d,x:l,y:c})}function rr(e,t){const n=nr(e).scrollLeft;return t?t.left+n:wt(Je(e)).left+n}function Ya(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-rr(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function sm(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Je(r),a=t?tr(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=qe(1);const u=qe(0),d=dt(r);if((d||!i)&&((Rt(r)!=="body"||er(s))&&(l=nr(r)),d)){const h=wt(r);c=Ft(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}const p=s&&!d&&!i?Ya(s,l):qe(0);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-l.scrollTop*c.y+u.y+p.y}}function am(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function lm(e){const t=nr(e),n=e.ownerDocument.body,r=Ye(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),o=Ye(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+rr(e);const s=-t.scrollTop;return ze(n).direction==="rtl"&&(i+=Ye(e.clientWidth,n.clientWidth)-r),{width:r,height:o,x:i,y:s}}const cm=25;function um(e,t,n){n===void 0&&(n="viewport");const r=n==="layoutViewport",o=ye(e),i=Je(e),s=o.visualViewport;let a=i.clientWidth,l=i.clientHeight,c=0,u=0;if(s){const p=!Ao()||t==="fixed";r?p||(c=-s.offsetLeft,u=-s.offsetTop):(a=s.width,l=s.height,p&&(c=s.offsetLeft,u=s.offsetTop))}if(rr(i)<=0){const p=i.ownerDocument,h=p.body,g=getComputedStyle(h),m=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,b=Math.abs(i.clientWidth-h.clientWidth-m),v=getComputedStyle(i).scrollbarGutter==="stable both-edges"?b/2:b;v<=cm&&(a-=v)}return{width:a,height:l,x:c,y:u}}function fm(e,t){const n=wt(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Ft(e),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,c=r*i.y;return{width:s,height:a,x:l,y:c}}function qa(e,t,n){let r;if(t==="viewport"||t==="layoutViewport")r=um(e,n,t);else if(t==="document")r=lm(Je(e));else if(Be(t))r=fm(t,n);else{const o=Ga(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Zn(r)}function dm(e,t){const n=t.get(e);if(n)return n;let r=mn(e,[],!1).filter(a=>Be(a)&&Rt(a)!=="body"),o=null;const i=ze(e).position==="fixed";let s=i?_t(e):e;for(;Be(s)&&!gn(s);){const a=ze(s),l=$o(s),c=o?o.position:i?"fixed":"";!l&&(c==="fixed"||c==="absolute"&&a.position==="static")?r=r.filter(d=>d!==s):o=a,s=_t(s)}return t.set(e,r),r}function pm(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?tr(t)?[]:dm(t,this._c):[].concat(n),r],a=qa(t,s[0],o);let l=a.top,c=a.right,u=a.bottom,d=a.left;for(let p=1;p<s.length;p++){const h=qa(t,s[p],o);l=Ye(h.top,l),c=ut(h.right,c),u=ut(h.bottom,u),d=Ye(h.left,d)}return{width:c-d,height:u-l,x:d,y:l}}function hm(e){const{width:t,height:n}=Ka(e);return{width:t,height:n}}function gm(e,t,n){const r=dt(t),o=Je(t),i=n==="fixed",s=wt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=qe(0);if((r||!i)&&((Rt(t)!=="body"||er(o))&&(a=nr(t)),r)){const p=wt(t,!0,i,t);l.x=p.x+t.clientLeft,l.y=p.y+t.clientTop}!r&&o&&(l.x=rr(o));const c=o&&!r&&!i?Ya(o,a):qe(0),u=s.left+a.scrollLeft-l.x-c.x,d=s.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:s.width,height:s.height}}function Io(e){return ze(e).position==="static"}function Xa(e,t){if(!dt(e)||ze(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Je(e)===n&&(n=n.ownerDocument.body),n}function Ja(e,t){const n=ye(e);if(tr(e))return n;if(!dt(e)){let o=_t(e);for(;o&&!gn(o);){if(Be(o)&&!Io(o))return o;o=_t(o)}return n}let r=Xa(e,t);for(;r&&em(r)&&Io(r);)r=Xa(r,t);return r&&gn(r)&&Io(r)&&!$o(r)?n:r||rm(e)||n}const mm=async function(e){const t=this.getOffsetParent||Ja,n=this.getDimensions,r=await n(e.floating);return{reference:gm(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function vm(e){return ze(e).direction==="rtl"}const bm={convertOffsetParentRelativeRectToViewportRelativeRect:sm,getDocumentElement:Je,getClippingRect:pm,getOffsetParent:Ja,getElementRects:mm,getClientRects:am,getDimensions:hm,getScale:Ft,isElement:Be,isRTL:vm};function Za(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ym(e,t,n){let r=null,o;const i=Je(e);function s(){var u;clearTimeout(o),(u=r)==null||u.disconnect(),r=null}function a(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),s();const p=e.getBoundingClientRect(),{left:h,top:g,width:m,height:b}=p;if(u||t(),!m||!b)return;const v=Xn(g),y=Xn(i.clientWidth-(h+m)),S=Xn(i.clientHeight-(g+b)),w=Xn(h),_={rootMargin:-v+"px "+-y+"px "+-S+"px "+-w+"px",threshold:Ye(0,ut(1,d))||1};let x=!0;function k(R){const O=R[0].intersectionRatio;if(!Za(p,e.getBoundingClientRect()))return a();if(O!==d){if(!x)return a();O?a(!1,O):o=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{r=new IntersectionObserver(k,{..._,root:i.ownerDocument})}catch{r=new IntersectionObserver(k,_)}r.observe(e)}const l=ye(e),c=()=>a(n);return l.addEventListener("resize",c),a(!0),()=>{l.removeEventListener("resize",c),s()}}function Em(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=Do(e),u=o||i?[...c?mn(c):[],...t?mn(t):[]]:[];u.forEach(v=>{o&&v.addEventListener("scroll",n),i&&v.addEventListener("resize",n)});const d=c&&a?ym(c,n,i):null;let p=-1,h=null;s&&(h=new ResizeObserver(v=>{let[y]=v;y&&y.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var S;(S=h)==null||S.observe(t)})),n()}),c&&!l&&h.observe(c),t&&h.observe(t));let g,m=l?wt(e):null;l&&b();function b(){const v=wt(e);m&&!Za(m,v)&&n(),m=v,g=requestAnimationFrame(b)}return n(),()=>{var v;u.forEach(y=>{o&&y.removeEventListener("scroll",n),i&&y.removeEventListener("resize",n)}),d==null||d(),(v=h)==null||v.disconnect(),h=null,l&&cancelAnimationFrame(g)}}const _m=Xg,wm=Jg,Sm=Gg,xm=Qg,Cm=Yg,Qa=Kg,Om=Zg,Pm=(e,t,n)=>{const r=new Map,o=n!=null?n:{},i={...bm,...o.platform,_c:r};return Wg(e,t,{...o,platform:i})};var or=typeof document<"u"?f.useLayoutEffect:f.useEffect;function ir(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!ir(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!ir(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function el(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function tl(e,t){const n=el(e);return Math.round(t*n)/n}function nl(e){const t=E.useRef(e);return or(()=>{t.current=e}),t}function $m(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:c}=e,[u,d]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=E.useState(r);ir(p,r)||h(r);const[g,m]=E.useState(null),[b,v]=E.useState(null),y=E.useCallback(z=>{z!==_.current&&(_.current=z,m(z))},[]),S=E.useCallback(z=>{z!==x.current&&(x.current=z,v(z))},[]),w=i||g,C=s||b,_=E.useRef(null),x=E.useRef(null),k=E.useRef(u),R=l!=null,O=nl(l),T=nl(o),D=E.useCallback(()=>{if(!_.current||!x.current)return;const z={placement:t,strategy:n,middleware:p};T.current&&(z.platform=T.current),Pm(_.current,x.current,z).then(I=>{const A={...I,isPositioned:!0};P.current&&!ir(k.current,A)&&(k.current=A,Dr.flushSync(()=>{d(A)}))})},[p,t,n,T]);or(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,d(z=>({...z,isPositioned:!1})))},[c]);const P=E.useRef(!1);or(()=>(P.current=!0,()=>{P.current=!1}),[]),or(()=>{if(w&&(_.current=w),C&&(x.current=C),w&&C){if(O.current)return O.current(w,C,D);D()}},[w,C,D,O,R]);const M=E.useMemo(()=>({reference:_,floating:x,setReference:y,setFloating:S}),[y,S]),N=E.useMemo(()=>({reference:w,floating:C}),[w,C]),H=E.useMemo(()=>{const z={position:n,left:0,top:0};if(!N.floating)return z;const I=tl(N.floating,u.x),A=tl(N.floating,u.y);return a?{...z,transform:"translate("+I+"px, "+A+"px)",...el(N.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:A}},[n,a,N.floating,u.x,u.y]);return E.useMemo(()=>({...u,update:D,refs:M,elements:N,floatingStyles:H}),[u,D,M,N,H])}const Am=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Qa({element:r.current,padding:o}).fn(n):{}:r?Qa({element:r,padding:o}).fn(n):{}}}},Tm=(e,t)=>({..._m(e),options:[e,t]}),Dm=(e,t)=>({...wm(e),options:[e,t]}),Im=(e,t)=>({...Om(e),options:[e,t]}),Lm=(e,t)=>({...Sm(e),options:[e,t]}),km=(e,t)=>({...xm(e),options:[e,t]}),Mm=(e,t)=>({...Cm(e),options:[e,t]}),Nm=(e,t)=>({...Am(e),options:[e,t]});var jm=Object.defineProperty,Rm=(e,t)=>jm(e,"name",{value:t,configurable:!0}),Fm=E.forwardRef(Rm(function(t,n){const{children:r,width:o=10,height:i=5,...s}=t;return B.jsx(vt.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?r:B.jsx("polygon",{points:"0,0 30,0 15,10"})})},"Arrow")),Vm=Object.defineProperty,Bm=(e,t)=>Vm(e,"name",{value:t,configurable:!0});function rl(e){const[t,n]=E.useState(void 0);return Pe(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let r=0;const o=new ResizeObserver(i=>{if(!Array.isArray(i)||!i.length)return;const s=i[0];window.cancelAnimationFrame(r),r=window.requestAnimationFrame(()=>{let a,l;if("borderBoxSize"in s){const c=s.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=e.offsetWidth,l=e.offsetHeight;n({width:a,height:l})})});return o.observe(e,{box:"border-box"}),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}else n(void 0)},[e]),t}Bm(rl,"useSize");var zm=Object.defineProperty,Ze=(e,t)=>zm(e,"name",{value:t,configurable:!0}),ol={Partial:"partial"},il={Optimized:"optimized",Always:"always"},sl="Popper",[al,ll]=vo(sl),[Hm,cl]=al(sl),Um=Ze(e=>{const{__scopePopper:t,children:n}=e,[r,o]=E.useState(null),[i,s]=E.useState(void 0);return B.jsx(Hm,{scope:t,anchor:r,onAnchorChange:o,placementState:i,setPlacementState:s,children:n})},"Popper"),Wm="PopperAnchor",Km=E.forwardRef(Ze(function(t,n){const{__scopePopper:r,virtualRef:o,...i}=t,s=cl(Wm,r),a=E.useRef(null),l=s.onAnchorChange,c=E.useCallback(m=>{a.current=m,m&&l(m)},[l]),u=ct(n,c),d=E.useRef(null);E.useEffect(()=>{if(!o)return;const m=d.current;d.current=o.current,m!==d.current&&l(d.current)});const p=s.placementState&&sr(s.placementState),h=p==null?void 0:p[0],g=p==null?void 0:p[1];return o?null:B.jsx(vt.div,{"data-radix-popper-side":h,"data-radix-popper-align":g,...i,ref:u})},"PopperAnchor")),ul="PopperContent",[Gm,Ym]=al(ul),qm=E.forwardRef(Ze(function(t,n){var xe,Ce,An,Tn,st,Yt,Ct,Ot,Or;const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:s="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:p=ol.Partial,hideWhenDetached:h=!1,updatePositionStrategy:g=il.Optimized,onPlaced:m,...b}=t,v=cl(ul,r),[y,S]=E.useState(null),w=ct(n,S),[C,_]=E.useState(null),x=rl(C),k=(xe=x==null?void 0:x.width)!=null?xe:0,R=(Ce=x==null?void 0:x.height)!=null?Ce:0,O=o+(s!=="center"?"-"+s:""),T=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},D=Array.isArray(u)?u:[u],P=D.length>0,M={padding:T,boundary:D.filter(fl),altBoundary:P},{refs:N,floatingStyles:H,placement:z,isPositioned:I,middlewareData:A}=$m({strategy:"fixed",placement:O,whileElementsMounted:Ze((...Dn)=>Em(...Dn,{animationFrame:g===il.Always}),"whileElementsMounted"),elements:{reference:v.anchor},middleware:[Tm({mainAxis:i+R,alignmentAxis:a}),c&&Dm({mainAxis:!0,crossAxis:!1,...p===ol.Partial?{limiter:Im()}:{},...M}),c&&Lm({...M}),km({...M,apply:Ze(({elements:Dn,rects:Pr,availableWidth:$r,availableHeight:Ar})=>{const{width:ki,height:$}=Pr.reference,V=Dn.floating.style;V.setProperty("--radix-popper-available-width",`${$r}px`),V.setProperty("--radix-popper-available-height",`${Ar}px`),V.setProperty("--radix-popper-anchor-width",`${ki}px`),V.setProperty("--radix-popper-anchor-height",`${$}px`)},"apply")}),C&&Nm({element:C,padding:l}),Qm({arrowWidth:k,arrowHeight:R}),h&&Mm(P?{strategy:"referenceHidden",...M}:{strategy:"referenceHidden",padding:M.padding,altBoundary:M.altBoundary})]}),U=v.setPlacementState;Pe(()=>(U(z),()=>{U(void 0)}),[z,U]);const[W,ne]=sr(z),de=hn(m);Pe(()=>{I&&(de==null||de())},[I,de]);const ke=(An=A.arrow)==null?void 0:An.x,Me=(Tn=A.arrow)==null?void 0:Tn.y,ge=((st=A.arrow)==null?void 0:st.centerOffset)!==0,[se,ae]=E.useState();return Pe(()=>{y&&ae(window.getComputedStyle(y).zIndex)},[y]),B.jsx("div",{ref:N.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:I?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:se,"--radix-popper-transform-origin":[(Yt=A.transformOrigin)==null?void 0:Yt.x,(Ct=A.transformOrigin)==null?void 0:Ct.y].join(" "),...((Ot=A.hide)==null?void 0:Ot.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:B.jsx(Gm,{scope:r,placedSide:W,placedAlign:ne,onArrowChange:_,arrowX:ke,arrowY:Me,shouldHideArrow:ge,children:B.jsx(vt.div,{"data-side":W,"data-align":ne,...b,ref:w,style:{...b.style,animation:I?(Or=b.style)==null?void 0:Or.animation:"none"}})})})},"PopperContent")),Xm="PopperArrow",Jm={top:"bottom",right:"left",bottom:"top",left:"right"},Zm=E.forwardRef(Ze(function(t,n){const{__scopePopper:r,...o}=t,i=Ym(Xm,r),s=Jm[i.placedSide];return B.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:B.jsx(Fm,{...o,ref:n,style:{...o.style,display:"block"}})})},"PopperArrow"));function fl(e){return e!==null}Ze(fl,"isNotNull");var Qm=Ze(e=>({name:"transformOrigin",options:e,fn(t){var b,v,y,S,w;const{placement:n,rects:r,middlewareData:o}=t,s=((b=o.arrow)==null?void 0:b.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[c,u]=sr(n),d={start:"0%",center:"50%",end:"100%"}[u],p=((y=(v=o.arrow)==null?void 0:v.x)!=null?y:0)+a/2,h=((w=(S=o.arrow)==null?void 0:S.y)!=null?w:0)+l/2;let g="",m="";return c==="bottom"?(g=s?d:`${p}px`,m=`${-l}px`):c==="top"?(g=s?d:`${p}px`,m=`${r.floating.height+l}px`):c==="right"?(g=`${-l}px`,m=s?d:`${h}px`):c==="left"&&(g=`${r.floating.width+l}px`,m=s?d:`${h}px`),{data:{x:g,y:m}}}}),"transformOrigin");function sr(e){const[t,n="center"]=e.split("-");return[t,n]}Ze(sr,"getSideAndAlignFromPlacement");var ev=Object.defineProperty,Qe=(e,t)=>ev(e,"name",{value:t,configurable:!0});function dl(e,t){return E.useReducer((n,r)=>{const o=t[n][r];return o!=null?o:n},e)}Qe(dl,"useStateMachine");var tv=Qe(e=>{const{present:t,children:n}=e,r=pl(t),o=typeof n=="function"?n({present:r.isPresent}):E.Children.only(n),i=hl(r.ref,gl(o));return typeof n=="function"||r.isPresent?E.cloneElement(o,{ref:i}):null},"Presence");function pl(e){const[t,n]=E.useState(),r=E.useRef(null),o=E.useRef(e),i=E.useRef("none"),s=E.useRef(void 0),a=e?"mounted":"unmounted",[l,c]=dl(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{var u;l==="mounted"?(i.current=(u=s.current)!=null?u:Vt(r.current),s.current=void 0):i.current="none"},[l]),Pe(()=>{const u=r.current,d=o.current;if(d!==e){const h=i.current,g=Vt(u);e?(s.current=g,c("MOUNT")):g==="none"||(u==null?void 0:u.display)==="none"?c("UNMOUNT"):c(d&&h!==g?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),Pe(()=>{var u;if(t){let d;const p=(u=t.ownerDocument.defaultView)!=null?u:window,h=Qe(m=>{const v=Vt(r.current).includes(CSS.escape(m.animationName));if(m.target===t&&v&&(c("ANIMATION_END"),!o.current)){const y=t.style.animationFillMode;t.style.animationFillMode="forwards",d=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=y)})}},"handleAnimationEnd"),g=Qe(m=>{m.target===t&&(i.current=Vt(r.current))},"handleAnimationStart");return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",h),t.addEventListener("animationend",h),()=>{p.clearTimeout(d),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",h),t.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:E.useCallback(u=>{if(u){const d=getComputedStyle(u);r.current=d,s.current=Vt(d)}else r.current=null;n(u)},[])}}Qe(pl,"usePresence");function Lo(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}Qe(Lo,"setRef");function hl(...e){const t=E.useRef(e);return t.current=e,E.useCallback(n=>{const r=t.current;let o=!1;const i=r.map(s=>{const a=Lo(s,n);return!o&&typeof a=="function"&&(o=!0),a});if(o)return()=>{for(let s=0;s<i.length;s++){const a=i[s];typeof a=="function"?a():Lo(r[s],null)}}},[])}Qe(hl,"useStableComposedRefs");function Vt(e){return(e==null?void 0:e.animationName)||"none"}Qe(Vt,"getAnimationName");function gl(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Qe(gl,"getElementRef");var nv=Object.defineProperty,rv=(e,t)=>nv(e,"name",{value:t,configurable:!0}),ml=E[" useEffectEvent ".trim().toString()],vl=E[" useInsertionEffect ".trim().toString()];function bl(e){if(typeof ml=="function")return ml(e);const t=E.useRef(()=>{throw new Error("Cannot call an event handler while rendering.")});return typeof vl=="function"?vl(()=>{t.current=e}):Pe(()=>{t.current=e}),E.useMemo(()=>((...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)}),[])}rv(bl,"useEffectEvent");var ov=Object.defineProperty,vn=(e,t)=>ov(e,"name",{value:t,configurable:!0}),iv=E[" useInsertionEffect ".trim().toString()]||Pe;function yl({prop:e,defaultProp:t,onChange:n=vn(()=>{},"onChange"),caller:r}){const[o,i,s]=El({defaultProp:t,onChange:n}),a=e!==void 0,l=a?e:o,c=E.useCallback(u=>{var d;if(a){const p=_l(u)?u(e):u;p!==e&&((d=s.current)==null||d.call(s,p))}else i(u)},[a,e,i,s]);return[l,c]}vn(yl,"useControllableState");function El({defaultProp:e,onChange:t}){const[n,r]=E.useState(e),o=E.useRef(n),i=E.useRef(t);return iv(()=>{i.current=t},[t]),E.useEffect(()=>{var s;o.current!==n&&((s=i.current)==null||s.call(i,n),o.current=n)},[n,o]),[n,r,i]}vn(El,"useUncontrolledState");function _l(e){return typeof e=="function"}vn(_l,"isFunction");var wl=Symbol("RADIX:SYNC_STATE");function sv(e,t,n,r){const{prop:o,defaultProp:i,onChange:s,caller:a}=t,l=o!==void 0,c=bl(s),u=[{...n,state:i}];r&&u.push(r);const[d,p]=E.useReducer((b,v)=>{if(v.type===wl)return{...b,state:v.state};const y=e(b,v);return l&&!Object.is(y.state,b.state)&&c(y.state),y},...u),h=d.state,g=E.useRef(h);E.useEffect(()=>{g.current!==h&&(g.current=h,l||c(h))},[h,g,l]);const m=E.useMemo(()=>o!==void 0?{...d,state:o}:d,[d,o]);return E.useEffect(()=>{l&&!Object.is(o,d.state)&&p({type:wl,state:o})},[o,d.state,l]),[m,p]}vn(sv,"useControllableStateReducer");var av=Object.defineProperty,lv=(e,t)=>av(e,"name",{value:t,configurable:!0}),cv=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),uv=E.forwardRef(lv(function(t,n){return B.jsx(vt.span,{...t,ref:n,style:{...cv,...t.style}})},"VisuallyHidden")),fv=Object.defineProperty,oe=(e,t)=>fv(e,"name",{value:t,configurable:!0}),[ko,_1]=vo("Tooltip",[ll]),ar=ll(),dv="TooltipProvider",pv=700,Mo="tooltip.open",[hv,No]=ko(dv),gv=oe(e=>{const{__scopeTooltip:t,delayDuration:n=pv,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,s=E.useRef(!0),a=E.useRef(!1),l=E.useRef(0);return E.useEffect(()=>{const c=l.current;return()=>window.clearTimeout(c)},[]),B.jsx(hv,{scope:t,isOpenDelayedRef:s,delayDuration:n,onOpen:E.useCallback(()=>{r<=0||(window.clearTimeout(l.current),s.current=!1)},[r]),onClose:E.useCallback(()=>{r<=0||(window.clearTimeout(l.current),l.current=window.setTimeout(()=>s.current=!0,r))},[r]),isPointerInTransitRef:a,onPointerInTransitChange:E.useCallback(c=>{a.current=c},[]),disableHoverableContent:o,children:i})},"TooltipProvider"),jo="Tooltip",[mv,lr]=ko(jo),vv=oe(e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=No(jo,e.__scopeTooltip),c=ar(t),[u,d]=E.useState(null),[p,h]=E.useState(void 0),g=ka(),m=E.useRef(0),b=s!=null?s:l.disableHoverableContent,v=a!=null?a:l.delayDuration,y=E.useRef(!1),[S,w]=yl({prop:r,defaultProp:o!=null?o:!1,onChange:oe(O=>{O?(l.onOpen(),document.dispatchEvent(new CustomEvent(Mo))):l.onClose(),i==null||i(O)},"onChange"),caller:jo}),C=E.useMemo(()=>S?y.current?"delayed-open":"instant-open":"closed",[S]),_=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,y.current=!1,w(!0)},[w]),x=E.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),k=E.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{y.current=!0,w(!0),m.current=0},v)},[v,w]);E.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]);const R=p!=null?p:g;return B.jsx(Um,{...c,children:B.jsx(mv,{scope:t,contentId:R,setContentId:h,open:S,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:E.useCallback(()=>{l.isOpenDelayedRef.current?k():_()},[l.isOpenDelayedRef,k,_]),onTriggerLeave:E.useCallback(()=>{b?x():(window.clearTimeout(m.current),m.current=0)},[x,b]),onOpen:_,onClose:x,disableHoverableContent:b,children:n})})},"Tooltip"),Sl="TooltipTrigger",bv=E.forwardRef(oe(function(t,n){const{__scopeTooltip:r,"aria-describedby":o,...i}=t,s=lr(Sl,r),a=No(Sl,r),l=ar(r),c=E.useRef(null),u=ct(n,c,s.onTriggerChange),d=E.useRef(!1),p=E.useRef(!1),h=E.useCallback(()=>d.current=!1,[]);return E.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),B.jsx(Km,{asChild:!0,...l,children:B.jsx(vt.button,{"aria-describedby":s.open?Dl(o,s.contentId):o,"data-state":s.stateAttribute,...i,ref:u,onPointerMove:Fe(t.onPointerMove,g=>{g.pointerType!=="touch"&&!p.current&&!a.isPointerInTransitRef.current&&(s.onTriggerEnter(),p.current=!0)}),onPointerLeave:Fe(t.onPointerLeave,()=>{s.onTriggerLeave(),p.current=!1}),onPointerDown:Fe(t.onPointerDown,()=>{s.open&&s.onClose(),d.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:Fe(t.onFocus,()=>{d.current||s.onOpen()}),onBlur:Fe(t.onBlur,s.onClose),onClick:Fe(t.onClick,s.onClose)})})},"TooltipTrigger")),yv="TooltipPortal",[w1,Ev]=ko(yv,{forceMount:void 0}),bn="TooltipContent",_v=E.forwardRef(oe(function(t,n){const r=Ev(bn,t.__scopeTooltip),{forceMount:o=r.forceMount,side:i="top",...s}=t,a=lr(bn,t.__scopeTooltip);return B.jsx(tv,{present:o||a.open,children:a.disableHoverableContent?B.jsx(xl,{side:i,...s,ref:n}):B.jsx(wv,{side:i,...s,ref:n})})},"TooltipContent")),wv=E.forwardRef(oe(function(t,n){const r=lr(bn,t.__scopeTooltip),o=No(bn,t.__scopeTooltip),i=E.useRef(null),s=ct(n,i),[a,l]=E.useState(null),{trigger:c,onClose:u}=r,d=i.current,{onPointerInTransitChange:p}=o,h=E.useCallback(()=>{l(null),p(!1)},[p]),g=E.useCallback((m,b)=>{const v=m.currentTarget,y={x:m.clientX,y:m.clientY},S=Cl(y,v.getBoundingClientRect()),w=Ol(y,S),C=Pl(b.getBoundingClientRect()),_=Al([...w,...C]);l(_),p(!0)},[p]);return E.useEffect(()=>()=>h(),[h]),E.useEffect(()=>{if(c&&d){const m=oe(v=>g(v,d),"handleTriggerLeave"),b=oe(v=>g(v,c),"handleContentLeave");return c.addEventListener("pointerleave",m),d.addEventListener("pointerleave",b),()=>{c.removeEventListener("pointerleave",m),d.removeEventListener("pointerleave",b)}}},[c,d,g,h]),E.useEffect(()=>{if(a){const m=oe(b=>{const v=b.target,y={x:b.clientX,y:b.clientY},S=(c==null?void 0:c.contains(v))||(d==null?void 0:d.contains(v)),w=!$l(y,a);S?h():w&&(h(),u())},"handleTrackPointerGrace");return document.addEventListener("pointermove",m),()=>document.removeEventListener("pointermove",m)}},[c,d,a,u,h]),B.jsx(xl,{...t,ref:s})},"TooltipContentHoverable")),Sv=ks("TooltipContent"),xl=E.forwardRef(oe(function(t,n){const{__scopeTooltip:r,children:o,"aria-label":i,id:s,onEscapeKeyDown:a,onPointerDownOutside:l,...c}=t,u=lr(bn,r),d=ar(r),{onClose:p}=u,[h,g]=E.useState(null),m=ct(n,g);Aa(h),E.useEffect(()=>(document.addEventListener(Mo,p),()=>document.removeEventListener(Mo,p)),[p]),E.useEffect(()=>{if(u.trigger){const v=oe(y=>{y.target instanceof Node&&y.target.contains(u.trigger)&&p()},"handleScroll");return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[u.trigger,p]);const{setContentId:b}=u;return Pe(()=>(b(s),()=>{b(void 0)}),[s,b]),B.jsx(Eg,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:p,children:B.jsxs(qm,{"data-state":u.stateAttribute,role:i?void 0:"tooltip",id:i?void 0:u.contentId,...d,...c,ref:m,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[B.jsx(Sv,{children:o}),i?B.jsx(uv,{id:u.contentId,role:"tooltip",children:i}):null]})})},"TooltipContentImpl")),xv=E.forwardRef(oe(function(t,n){const{__scopeTooltip:r,...o}=t,i=ar(r);return B.jsx(Zm,{...i,...o,ref:n})},"TooltipArrow"));function Cl(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}oe(Cl,"getExitSideFromRect");function Ol(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}oe(Ol,"getPaddedExitPoints");function Pl(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}oe(Pl,"getPointsFromRect");function $l(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const a=t[i],l=t[s],c=a.x,u=a.y,d=l.x,p=l.y;u>r!=p>r&&n<(d-c)*(r-u)/(p-u)+c&&(o=!o)}return o}oe($l,"isPointInPolygon");function Al(e){const t=e.slice();return t.sort((n,r)=>n.x<r.x?-1:n.x>r.x?1:n.y<r.y?-1:n.y>r.y?1:0),Tl(t)}oe(Al,"getHull");function Tl(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const o=e[r];for(;t.length>=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}oe(Tl,"getHullPresorted");function Dl(...e){const t=new Set;for(const n of e)if(typeof n=="string")for(const r of String(n).trim().split(/\s+/))r&&t.add(r);return t.size>0?Array.from(t).join(" "):void 0}oe(Dl,"concatAriaDescribedby");function Cv(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function G(e,t){if(e==null)return{};var n,r,o=Cv(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}let re=(function(e){return e[e.UNSUPPORTED_INPUT=0]="UNSUPPORTED_INPUT",e[e.NO_COMPONENT_FOR_TYPE=1]="NO_COMPONENT_FOR_TYPE",e[e.UNKNOWN_INPUT=2]="UNKNOWN_INPUT",e[e.DUPLICATE_KEYS=3]="DUPLICATE_KEYS",e[e.ALREADY_REGISTERED_TYPE=4]="ALREADY_REGISTERED_TYPE",e[e.CLIPBOARD_ERROR=5]="CLIPBOARD_ERROR",e[e.THEME_ERROR=6]="THEME_ERROR",e[e.PATH_DOESNT_EXIST=7]="PATH_DOESNT_EXIST",e[e.INPUT_TYPE_OVERRIDE=8]="INPUT_TYPE_OVERRIDE",e[e.EMPTY_KEY=9]="EMPTY_KEY",e})({});const Ov={[re.UNSUPPORTED_INPUT]:(e,t)=>[`An input with type \`${e}\` input was found at path \`${t}\` but it's not supported yet.`],[re.NO_COMPONENT_FOR_TYPE]:(e,t)=>[`Type \`${e}\` found at path \`${t}\` can't be displayed in panel because no component supports it yet.`],[re.UNKNOWN_INPUT]:(e,t)=>[`input at path \`${e}\` is not recognized.`,t],[re.DUPLICATE_KEYS]:(e,t,n)=>[`Key \`${e}\` of path \`${t}\` already exists at path \`${n}\`. Even nested keys need to be unique. Rename one of the keys.`],[re.ALREADY_REGISTERED_TYPE]:e=>[`Type ${e} has already been registered. You can't register a component with the same type.`],[re.CLIPBOARD_ERROR]:e=>["Error copying the value",e],[re.THEME_ERROR]:(e,t)=>[`Error accessing the theme \`${e}.${t}\` value.`],[re.PATH_DOESNT_EXIST]:e=>[`Error getting the value at path \`${e}\`. There is probably an error in your \`render\` function.`],[re.INPUT_TYPE_OVERRIDE]:(e,t,n)=>[`Input at path \`${e}\` already exists with type: \`${t}\`. Its type cannot be overridden with type \`${n}\`.`],[re.EMPTY_KEY]:()=>["Keys can not be empty, if you want to hide a label use whitespace."]};function Il(e,t,...n){const r=Ov[t],[o,...i]=r(...n);console[e]("LEVA: "+o,...i)}const et=Il.bind(null,"warn"),Pv=Il.bind(null,"log"),$v=["value"],Av=["schema"],Tv=["value"],Ll=[],St={};function kl(e){let{value:t}=e,n=G(e,$v);for(let r of Ll){const o=r(t,n);if(o)return o}}function tt(e,t){let{schema:n}=t,r=G(t,Av);if(e in St){et(re.ALREADY_REGISTERED_TYPE,e);return}Ll.push((o,i)=>n(o,i)&&e),St[e]=r}function S1(e){return e}function Ro(e,t,n,r){const{normalize:o}=St[e];if(o)return o(t,n,r);if(typeof t!="object"||!("value"in t))return{value:t};const{value:i}=t,s=G(t,Tv);return{value:i,settings:s}}function Dv(e,t,n,r,o,i){const{sanitize:s}=St[e];return s?s(t,n,r,o,i):t}function Ml(e,t,n){const{format:r}=St[e];return r?r(t,n):t}function Iv(e,t){if(typeof e!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Lv(e){var t=Iv(e,"string");return typeof t=="symbol"?t:t+""}function kv(e,t,n){return(t=Lv(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Nl(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function F(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Nl(Object(n),!0).forEach(function(r){kv(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Nl(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const pt=(e,t,n)=>e>n?n:e<t?t:e,Mv=e=>{if(e===""||typeof e=="number")return e;try{const t=Bt(e);if(!isNaN(t))return t}catch{}return parseFloat(e)},Nv=Math.log(10);function jl(e){let t=Math.abs(+String(e).replace(".",""));if(t===0)return .01;for(;t!==0&&t%10===0;)t/=10;const n=Math.floor(Math.log(t)/Nv)+1,r=Math.floor(Math.log10(Math.abs(e))),o=Math.pow(10,r-n);return Math.max(o,.001)}const cr=(e,t,n)=>n===t?0:(pt(e,t,n)-t)/(n-t),ur=(e,t,n)=>e*(n-t)+t,jv=()=>"_"+Math.random().toString(36).substr(2,9),Rl=/\(([^\(\)]+)\)/,Fl=/(-?\d+(?:\.\d+)?)\s*\^\s*(-?\d+(?:\.\d+)?)/,Vl=/(-?\d+(?:\.\d+)?)\s*([*/])\s*(-?\d+(?:\.\d+)?)/,Bl=/(-?\d+(?:\.\d+)?)\s*([+-])\s*(-?\d+(?:\.\d+)?)/;function Bt(e){return e=e.replace(/\s+/g,""),Rl.test(e)?Bt(e.replace(Rl,(t,n)=>Bt(n).toString())):Fl.test(e)?Bt(e.replace(Fl,(t,n,r)=>Math.pow(Number(n),Number(r)).toString())):Vl.test(e)?Bt(e.replace(Vl,(t,n,r,o)=>r==="*"?(Number(n)*Number(o)).toString():Number(o)===0?(()=>{throw new Error("Division by zero")})():(Number(n)/Number(o)).toString())):Bl.test(e)?Bt(e.replace(Bl,(t,n,r,o)=>r==="+"?(Number(n)+Number(o)).toString():(Number(n)-Number(o)).toString())):Number(e)}function Rv(e,t){return t.reduce((n,r)=>(e&&e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}function Fv(e,t){const n=F({},e);return t.forEach(r=>r in e&&delete n[r]),n}function Vv(e,t){return e.reduce((n,r,o)=>Object.assign(n,{[t[o]]:r}),{})}function zl(e){return Object.prototype.toString.call(e)==="[object Object]"}const Bv=e=>zl(e)&&Object.keys(e).length===0;let nt=(function(e){return e.BUTTON="BUTTON",e.BUTTON_GROUP="BUTTON_GROUP",e.MONITOR="MONITOR",e.FOLDER="FOLDER",e})({}),rt=(function(e){return e.SELECT="SELECT",e.IMAGE="IMAGE",e.NUMBER="NUMBER",e.COLOR="COLOR",e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.INTERVAL="INTERVAL",e.VECTOR3D="VECTOR3D",e.VECTOR2D="VECTOR2D",e})({});const zv=["type","__customInput"],Hv=["render","label","optional","order","disabled","hint","onChange","onEditStart","onEditEnd","transient"],Uv=["type"];function Hl(e,t,n={},r){var o,i;if(typeof e!="object"||Array.isArray(e))return{type:r,input:e,options:F({key:t,label:t,optional:!1,disabled:!1,order:0},n)};if("__customInput"in e){const{type:C,__customInput:_}=e,x=G(e,zv);return Hl(_,t,x,C)}const{render:s,label:a,optional:l,order:c=0,disabled:u,hint:d,onChange:p,onEditStart:h,onEditEnd:g,transient:m}=e,b=G(e,Hv),v=F({render:s,key:t,label:a!=null?a:t,hint:d,transient:m!=null?m:!!p,onEditStart:h,onEditEnd:g,disabled:u,optional:l,order:c},n);let{type:y}=b,S=G(b,Uv);if(y=r!=null?r:y,y in nt)return{type:y,input:S,options:v};let w;return r&&zl(S)&&"value"in S?w=S.value:w=Bv(S)?void 0:S,{type:y,input:w,options:F(F({},v),{},{onChange:p,optional:(o=v.optional)!==null&&o!==void 0?o:!1,disabled:(i=v.disabled)!==null&&i!==void 0?i:!1})}}function Wv(e,t,n,r){const o=Hl(e,t),{type:i,input:s,options:a}=o;if(i)return i in nt?o:{type:i,input:Ro(i,s,n,r),options:a};let l=kl(s);return l?{type:l,input:Ro(l,s,n,r),options:a}:(l=kl({value:s}),l?{type:l,input:Ro(l,{value:s},n,r),options:a}:!1)}function Ul(e,t,n,r,o){const{value:i,type:s,settings:a}=e;e.value=Wl({type:s,value:i,settings:a},t,n,r),e.fromPanel=o}const Kv=function(t,n,r){this.type="LEVA_ERROR",this.message="LEVA: "+t,this.previousValue=n,this.error=r};function Wl({type:e,value:t,settings:n},r,o,i){const s=e!=="SELECT"&&typeof r=="function"?r(t):r;let a;try{a=Dv(e,s,n,t,o,i)}catch(l){throw new Kv(`The value \`${r}\` did not result in a correct value.`,t,l)}return ln(a,t)?t:a}const Kl=(e,t,n=!1)=>{let r=0;return function(){const o=arguments,i=n&&!r,s=()=>e.apply(this,o);window.clearTimeout(r),r=window.setTimeout(s,t),i&&s()}},Gl=e=>e.shiftKey?5:e.altKey?1/5:1,Gv=["value"],Yv=["min","max"],qv=e=>{if(typeof e=="number")return!0;if(typeof e=="string"){const t=parseFloat(e);return isNaN(t)?!1:e.substring((""+t).length).trim().length<4}return!1},Yl=(e,{min:t=-1/0,max:n=1/0,suffix:r})=>{const o=parseFloat(e);if(e===""||isNaN(o))throw Error("Invalid number");const i=pt(o,t,n);return r?i+r:i},Xv=(e,{pad:t=0,suffix:n})=>{const r=parseFloat(e).toFixed(t);return n?r+n:r},ql=e=>{let{value:t}=e,n=G(e,Gv);const{min:r=-1/0,max:o=1/0}=n,i=G(n,Yv);let s=parseFloat(t);const a=typeof t=="string"?t.substring((""+s).length):void 0;s=pt(s,r,o);let l=n.step;l||(Number.isFinite(r)?Number.isFinite(o)?l=+(Math.abs(o-r)/100).toPrecision(1):l=+(Math.abs(s-r)/100).toPrecision(1):Number.isFinite(o)&&(l=+(Math.abs(o-s)/100).toPrecision(1)));const c=l?jl(l)*10:jl(s);l=l||c/10;const u=Math.round(pt(Math.log10(1/c),0,2));return{value:a?s+a:s,settings:F({initialValue:s,step:l,pad:u,min:r,max:o,suffix:a},i)}},Xl=(e,{step:t,initialValue:n})=>{const r=Math.round((e-n)/t);return n+r*t};var Jl=Object.freeze({__proto__:null,schema:qv,sanitize:Yl,format:Xv,normalize:ql,sanitizeStep:Xl});function ee(){return ee=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ee.apply(null,arguments)}const Zl=f.createContext({});function fe(){return f.useContext(Zl)}const Fo=f.createContext(null),Ql=f.createContext(null),ec=f.createContext(null);function yn(){return f.useContext(Ql)}function Jv(){return f.useContext(ec)}const tc=()=>({colors:{elevation1:"#292d39",elevation2:"#181c20",elevation3:"#373c4b",accent1:"#0066dc",accent2:"#007bff",accent3:"#3c93ff",highlight1:"#535760",highlight2:"#8c92a4",highlight3:"#fefefe",vivid1:"#ffcc00",folderWidgetColor:"$highlight2",folderTextColor:"$highlight3",toolTipBackground:"$highlight3",toolTipText:"$elevation2"},radii:{xs:"2px",sm:"3px",lg:"10px"},space:{xs:"3px",sm:"6px",md:"10px",rowGap:"7px",colGap:"7px"},fonts:{mono:"ui-monospace, SFMono-Regular, Menlo, 'Roboto Mono', monospace",sans:"system-ui, sans-serif"},fontSizes:{root:"11px",toolTip:"$root"},sizes:{rootWidth:"280px",controlWidth:"160px",numberInputMinWidth:"38px",scrubberWidth:"8px",scrubberHeight:"16px",rowHeight:"24px",folderTitleHeight:"20px",checkboxSize:"16px",joystickWidth:"100px",joystickHeight:"100px",colorPickerWidth:"$controlWidth",colorPickerHeight:"100px",imagePreviewWidth:"$controlWidth",imagePreviewHeight:"100px",monitorHeight:"60px",titleBarHeight:"39px"},shadows:{level1:"0 0 9px 0 #00000088",level2:"0 4px 14px #00000033"},borderWidths:{root:"0px",input:"1px",focus:"1px",hover:"1px",active:"1px",folder:"1px"},fontWeights:{label:"normal",folder:"normal",button:"normal"}});function fr(e,t){const[n,r]=e.split(" "),o={};return n!=="none"&&(o.boxShadow=`${t.inset?"inset ":""}0 0 0 $borderWidths${[t.key]} $colors${n!=="default"&&n||t.borderColor}`),r&&(o.backgroundColor=r),o}const En={$inputStyle:()=>e=>fr(e,{key:"$input",borderColor:"$highlight1",inset:!0}),$focusStyle:()=>e=>fr(e,{key:"$focus",borderColor:"$accent2"}),$hoverStyle:()=>e=>fr(e,{key:"$hover",borderColor:"$accent1",inset:!0}),$activeStyle:()=>e=>fr(e,{key:"$active",borderColor:"$accent1",inset:!0})},_n=vh({prefix:"leva",theme:tc(),utils:F(F({},En),{},{$flex:()=>({display:"flex",alignItems:"center"}),$flexCenter:()=>({display:"flex",alignItems:"center",justifyContent:"center"}),$reset:()=>({outline:"none",fontSize:"inherit",fontWeight:"inherit",color:"inherit",fontFamily:"inherit",border:"none",backgroundColor:"transparent",appearance:"none"}),$draggable:()=>({touchAction:"none",WebkitUserDrag:"none",userSelect:"none"}),$focus:e=>({"&:focus":En.$focusStyle()(e)}),$focusWithin:e=>({"&:focus-within":En.$focusStyle()(e)}),$hover:e=>({"&:hover":En.$hoverStyle()(e)}),$active:e=>({"&:active":En.$activeStyle()(e)})})}),j=_n.styled;_n.css;const Zv=_n.createTheme,Qv=_n.globalCss;_n.keyframes;const eb=Qv({".leva__panel__dragged":{WebkitUserDrag:"none",userSelect:"none",input:{userSelect:"none"},"*":{cursor:"ew-resize !important"}}});function tb(e){const t=tc();if(!e)return{theme:t,className:""};Object.keys(e).forEach(r=>{Object.assign(t[r],e[r])});const n=Zv(t);return{theme:t,className:n.className}}function ot(e,t){const{theme:n}=f.useContext(Fo);if(!(e in n)||!(t in n[e]))return et(re.THEME_ERROR,e,t),"";let r=t;for(;;){let o=n[e][r];if(typeof o=="string"&&o.charAt(0)==="$")r=o.substr(1);else return o}}const nc=j("input",{$reset:"",padding:"0 $sm",width:0,minWidth:0,flex:1,height:"100%",variants:{levaType:{number:{textAlign:"right"}},as:{textarea:{padding:"$sm"}}}}),rc=j("div",{$draggable:"",height:"100%",$flexCenter:"",position:"relative",padding:"0 $xs",fontSize:"0.8em",opacity:.8,cursor:"default",touchAction:"none",[`& + ${nc}`]:{paddingLeft:0}}),nb=j(rc,{cursor:"ew-resize",marginRight:"-$xs",textTransform:"uppercase",opacity:.3,"&:hover":{opacity:1},variants:{dragging:{true:{backgroundColor:"$accent2",opacity:1}}}}),rb=j("div",{$flex:"",position:"relative",borderRadius:"$sm",overflow:"hidden",color:"inherit",height:"$rowHeight",backgroundColor:"$elevation3",$inputStyle:"$elevation1",$hover:"",$focusWithin:"",variants:{textArea:{true:{height:"auto"}}}}),ob=["innerLabel","value","onUpdate","onChange","onKeyDown","type","id","inputType","rows"],ib=["onUpdate"];function Vo(e){let{innerLabel:t,value:n,onUpdate:r,onChange:o,onKeyDown:i,type:s,id:a,inputType:l="text",rows:c=0}=e,u=G(e,ob);const{id:d,emitOnEditStart:p,emitOnEditEnd:h,disabled:g}=fe(),m=a||d,b=f.useRef(null),v=c>0,y=v?"textarea":"input",S=f.useCallback(_=>x=>{const k=x.currentTarget.value;_(k)},[]);f.useEffect(()=>{const _=b.current,x=S(k=>{r(k),h()});return _==null||_.addEventListener("blur",x),()=>_==null?void 0:_.removeEventListener("blur",x)},[S,r,h]);const w=f.useCallback(_=>{_.key==="Enter"&&S(r)(_)},[S,r]),C=Object.assign({as:y},v?{rows:c}:{},u);return f.createElement(rb,{textArea:v},t&&typeof t=="string"?f.createElement(rc,null,t):t,f.createElement(nc,ee({levaType:s,ref:b,id:m,type:l,autoComplete:"off",spellCheck:"false",value:n,onChange:S(o),onFocus:()=>p(),onKeyPress:w,onKeyDown:i,disabled:g},C)))}function sb(e){let{onUpdate:t}=e,n=G(e,ib);const r=f.useCallback(i=>t(Mv(i)),[t]),o=f.useCallback(i=>{const s=i.key==="ArrowUp"?1:i.key==="ArrowDown"?-1:0;if(s){i.preventDefault();const a=i.altKey?.1:i.shiftKey?10:1;t(l=>parseFloat(l)+s*a)}},[t]);return f.createElement(Vo,ee({},n,{onUpdate:r,onKeyDown:o,type:"number"}))}const dr=j("div",{}),Bo=j("div",{position:"relative",background:"$elevation2",transition:"height 300ms ease",variants:{fill:{true:{},false:{}},flat:{false:{},true:{}},isRoot:{true:{},false:{paddingLeft:"$md","&::after":{content:'""',position:"absolute",left:0,top:0,width:"$borderWidths$folder",height:"100%",backgroundColor:"$folderWidgetColor",opacity:.4,transform:"translateX(-50%)"}}}},compoundVariants:[{isRoot:!0,fill:!1,css:{overflowY:"auto",maxHeight:"calc(100vh - 20px - $$titleBarHeight)"}},{isRoot:!0,flat:!1,css:{borderRadius:"$lg"}}]}),ab=j("div",{$flex:"",color:"$folderTextColor",userSelect:"none",cursor:"pointer",height:"$folderTitleHeight",fontWeight:"$folder","> svg":{marginLeft:-4,marginRight:4,cursor:"pointer",fill:"$folderWidgetColor",opacity:.6},"&:hover > svg":{fill:"$folderWidgetColor"},[`&:hover + ${Bo}::after`]:{opacity:.6},[`${dr}:hover > & + ${Bo}::after`]:{opacity:.6},[`${dr}:hover > & > svg`]:{opacity:1}}),oc=j("div",{position:"relative",display:"grid",gridTemplateColumns:"100%",rowGap:"$rowGap",transition:"opacity 250ms ease",variants:{toggled:{true:{opacity:1,transitionDelay:"250ms"},false:{opacity:0,transitionDelay:"0ms",pointerEvents:"none"}},isRoot:{true:{"& > div":{paddingLeft:"$md",paddingRight:"$md"},"& > div:first-of-type":{paddingTop:"$sm"},"& > div:last-of-type":{paddingBottom:"$sm"},[`> ${dr}:not(:first-of-type)`]:{paddingTop:"$sm",marginTop:"$md",borderTop:"$borderWidths$folder solid $colors$elevation1"}}}}}),ic=j("div",{position:"relative",zIndex:100,display:"grid",rowGap:"$rowGap",gridTemplateRows:"minmax($sizes$rowHeight, max-content)",alignItems:"center",color:"$highlight2",[`${oc} > &`]:{"&:first-of-type":{marginTop:"$rowGap"},"&:last-of-type":{marginBottom:"$rowGap"}},variants:{disabled:{true:{pointerEvents:"none"},false:{"&:hover,&:focus-within":{color:"$highlight3"}}}}}),sc=j(ic,{gridTemplateColumns:"auto $sizes$controlWidth",columnGap:"$colGap"}),lb=j("div",{$flex:"",height:"100%",position:"relative",overflow:"hidden","& > div":{marginLeft:"$colGap",padding:"0 $xs",opacity:.4},"& > div:hover":{opacity:.8},"& > div > svg":{display:"none",cursor:"pointer",width:13,minWidth:13,height:13,backgroundColor:"$elevation2"},"&:hover > div > svg":{display:"block"},variants:{align:{top:{height:"100%",alignItems:"flex-start",paddingTop:"$sm"}}}}),cb=j("input",{$reset:"",height:0,width:0,opacity:0,margin:0,"& + label":{position:"relative",$flexCenter:"",height:"100%",userSelect:"none",cursor:"pointer",paddingLeft:2,paddingRight:"$sm",pointerEvents:"auto"},"& + label:after":{content:'""',width:6,height:6,backgroundColor:"$elevation3",borderRadius:"50%",$activeStyle:""},"&:focus + label:after":{$focusStyle:""},"& + label:active:after":{backgroundColor:"$accent1",$focusStyle:""},"&:checked + label:after":{backgroundColor:"$accent1"}}),zo=j("label",{fontWeight:"$label",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap","& > svg":{display:"block"}}),ub=j("div",{opacity:1,variants:{disabled:{true:{opacity:.6,pointerEvents:"none",[`& ${zo}`]:{pointerEvents:"auto"}}}}}),ac=j("div",{position:"fixed",top:0,bottom:0,right:0,left:0,zIndex:1e3,userSelect:"none"}),fb=j("div",{background:"$toolTipBackground",fontFamily:"$sans",fontSize:"$toolTip",padding:"$xs $sm",color:"$toolTipText",borderRadius:"$xs",boxShadow:"$level2",maxWidth:260}),db=j(xv,{fill:"$toolTipBackground"});function Ho({children:e,container:t=(n=>globalThis==null||(n=globalThis.document)===null||n===void 0?void 0:n.body)()}){const{className:n}=f.useContext(Fo);return f.createElement(Fp,{className:n,container:t},e)}const pb=["align"];function hb(){const{id:e,disable:t,disabled:n}=fe();return f.createElement(f.Fragment,null,f.createElement(cb,{id:e+"__disable",type:"checkbox",checked:!n,onChange:()=>t(!n)}),f.createElement("label",{htmlFor:e+"__disable"}))}function gb(e){const{id:t,optional:n,hint:r}=fe(),o=e.htmlFor||t||void 0,i=!r&&typeof e.children=="string"?e.children:void 0;return f.createElement(f.Fragment,null,n&&f.createElement(hb,null),r!==void 0?f.createElement(vv,null,f.createElement(bv,{asChild:!0},f.createElement(zo,ee({htmlFor:o},e))),f.createElement(_v,{side:"top",sideOffset:2},f.createElement(fb,null,r,f.createElement(db,null)))):f.createElement(zo,ee({htmlFor:o,title:i},e)))}function Le(e){let{align:t}=e,n=G(e,pb);const{value:r,label:o,key:i,disabled:s}=fe(),{hideCopyButton:a}=Jv(),l=!a&&i!==void 0,[c,u]=f.useState(!1),d=async()=>{try{await navigator.clipboard.writeText(JSON.stringify({[i]:r!=null?r:""})),u(!0)}catch{et(re.CLIPBOARD_ERROR,{[i]:r})}};return f.createElement(lb,{align:t,onPointerLeave:()=>u(!1)},f.createElement(gb,n),l&&!s&&f.createElement("div",{title:`Click to copy ${typeof o=="string"?o:i} value`},c?f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},f.createElement("path",{d:"M9 2a1 1 0 000 2h2a1 1 0 100-2H9z"}),f.createElement("path",{fillRule:"evenodd",d:"M4 5a2 2 0 012-2 3 3 0 003 3h2a3 3 0 003-3 2 2 0 012 2v11a2 2 0 01-2 2H6a2 2 0 01-2-2V5zm9.707 5.707a1 1 0 00-1.414-1.414L9 12.586l-1.293-1.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z",clipRule:"evenodd"})):f.createElement("svg",{onClick:d,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor"},f.createElement("path",{d:"M8 3a1 1 0 011-1h2a1 1 0 110 2H9a1 1 0 01-1-1z"}),f.createElement("path",{d:"M6 3a2 2 0 00-2 2v11a2 2 0 002 2h8a2 2 0 002-2V5a2 2 0 00-2-2 3 3 0 01-3 3H9a3 3 0 01-3-3z"}))))}const mb=["toggled"],vb=j("svg",{fill:"currentColor",transition:"transform 350ms ease, fill 250ms ease"});function Uo(e){let{toggled:t}=e,n=G(e,mb);return f.createElement(vb,ee({width:"9",height:"5",viewBox:"0 0 9 5",xmlns:"http://www.w3.org/2000/svg",style:{transform:`rotate(${t?0:-90}deg)`}},n),f.createElement("path",{d:"M3.8 4.4c.4.3 1 .3 1.4 0L8 1.7A1 1 0 007.4 0H1.6a1 1 0 00-.7 1.7l3 2.7z"}))}const bb=["input"];function Te(e){let{input:t}=e,n=G(e,bb);return t?f.createElement(sc,n):f.createElement(ic,n)}function lc({value:e,type:t,settings:n,setValue:r}){const[o,i]=f.useState(Ml(t,e,n)),s=f.useRef(e),a=f.useRef(n);a.current=n;const l=f.useCallback(u=>i(Ml(t,u,a.current)),[t]),c=f.useCallback(u=>{try{r(u)}catch(d){const{type:p,previousValue:h}=d;if(p!=="LEVA_ERROR")throw d;l(h)}},[l,r]);return f.useEffect(()=>{ln(e,s.current)||l(e),s.current=e},[e,l]),{displayValue:o,onChange:i,onUpdate:c}}function wn(e,t){const{emitOnEditStart:n,emitOnEditEnd:r}=fe();return ug(o=>{o.first&&(document.body.classList.add("leva__panel__dragged"),n==null||n());const i=e(o);return o.last&&(document.body.classList.remove("leva__panel__dragged"),r==null||r()),i},t)}function yb(e){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(!1);return f.useEffect(()=>{const o=Kl(()=>{t.current.width=t.current.offsetWidth*window.devicePixelRatio,t.current.height=t.current.offsetHeight*window.devicePixelRatio,e(t.current,n.current)},250);return window.addEventListener("resize",o),r.current||(o(),r.current=!0),()=>window.removeEventListener("resize",o)},[e]),f.useEffect(()=>{n.current=t.current.getContext("2d")},[]),[t,n]}function cc(){const e=f.useRef(null),t=f.useRef({x:0,y:0}),n=f.useCallback(r=>{Object.assign(t.current,r),e.current&&(e.current.style.transform=`translate3d(${t.current.x}px, ${t.current.y}px, 0)`)},[]);return[e,n]}const Eb=["__refCount"],Wo=(e,t)=>{if(!e[t])return null;const n=e[t];return G(n,Eb)};function _b(e){const t=yn(),[n,r]=f.useState(Wo(t.getData(),e)),o=f.useCallback(c=>t.setValueAtPath(e,c,!0),[e,t]),i=f.useCallback(c=>t.setSettingsAtPath(e,c),[e,t]),s=f.useCallback(c=>t.disableInputAtPath(e,c),[e,t]),a=f.useCallback(()=>t.emitOnEditStart(e),[e,t]),l=f.useCallback(()=>t.emitOnEditEnd(e),[e,t]);return f.useEffect(()=>{r(Wo(t.getData(),e));const c=t.useStore.subscribe(u=>Wo(u.data,e),r,{equalityFn:zn});return()=>c()},[t,e]),[n,{set:o,setSettings:i,disable:s,storeId:t.storeId,emitOnEditStart:a,emitOnEditEnd:l}]}const wb=j("div",{variants:{hasRange:{true:{position:"relative",display:"grid",gridTemplateColumns:"auto $sizes$numberInputMinWidth",columnGap:"$colGap",alignItems:"center"}}}}),uc=j("div",{position:"relative",width:"100%",height:2,borderRadius:"$xs",backgroundColor:"$elevation1"}),Ko=j("div",{position:"absolute",width:"$scrubberWidth",height:"$scrubberHeight",borderRadius:"$xs",boxShadow:"0 0 0 2px $colors$elevation2",backgroundColor:"$accent2",cursor:"pointer",$active:"none $accent1",$hover:"none $accent3",variants:{position:{left:{borderTopRightRadius:0,borderBottomRightRadius:0,transform:"translateX(calc(-0.5 * ($sizes$scrubberWidth + 4px)))"},right:{borderTopLeftRadius:0,borderBottomLeftRadius:0,transform:"translateX(calc(0.5 * ($sizes$scrubberWidth + 4px)))"}}}}),fc=j("div",{position:"relative",$flex:"",height:"100%",cursor:"pointer",touchAction:"none"}),dc=j("div",{position:"absolute",height:"100%",backgroundColor:"$accent2"});function Sb({value:e,min:t,max:n,onDrag:r,step:o,initialValue:i}){const s=f.useRef(null),a=f.useRef(null),l=f.useRef(0),c=ot("sizes","scrubberWidth"),u=wn(({event:p,first:h,xy:[g],movement:[m],memo:b})=>{if(h){const{width:y,left:S}=s.current.getBoundingClientRect();l.current=y-parseFloat(c),b=(p==null?void 0:p.target)===a.current?e:ur((g-S)/y,t,n)}const v=b+ur(m/l.current,0,n-t);return r(Xl(v,{step:o,initialValue:i})),b}),d=cr(e,t,n);return f.createElement(fc,ee({ref:s},u()),f.createElement(uc,null,f.createElement(dc,{style:{left:0,right:`${(1-d)*100}%`}})),f.createElement(Ko,{ref:a,style:{left:`calc(${d} * (100% - ${c}))`}}))}const xb=f.memo(({label:e,onUpdate:t,step:n,innerLabelTrim:r})=>{const[o,i]=f.useState(!1),s=wn(({active:a,delta:[l],event:c,memo:u=0,first:d,last:p,target:h})=>(d&&h.requestPointerLock(),p&&document.exitPointerLock(),i(a),u+=l/2,Math.abs(u)>=1&&(t(g=>parseFloat(g)+Math.floor(u)*n*Gl(c)),u=0),u));return f.createElement(nb,ee({dragging:o,title:e.length>1?e:""},s()),e.slice(0,r))});function pc({label:e,id:t,displayValue:n,onUpdate:r,onChange:o,settings:i,innerLabelTrim:s=1}){const a=s>0&&f.createElement(xb,{label:e,step:i.step,onUpdate:r,innerLabelTrim:s});return f.createElement(sb,{id:t,value:String(n),onUpdate:r,onChange:o,innerLabel:a})}function Cb(){const e=fe(),{label:t,value:n,onUpdate:r,settings:o,id:i}=e,{min:s,max:a}=o,l=a!==1/0&&s!==-1/0;return f.createElement(Te,{input:!0},f.createElement(Le,null,t),f.createElement(wb,{hasRange:l},l&&f.createElement(Sb,ee({value:parseFloat(n),onDrag:r},o)),f.createElement(pc,ee({},e,{id:i,label:"value",innerLabelTrim:l?0:1}))))}const{sanitizeStep:Ob}=Jl,Pb=G(Jl,["sanitizeStep"]);var $b=F({component:Cb},Pb),Ab=Object.freeze({__proto__:null,schema:(e,t)=>ve().schema({options:ve().passesAnyOf(ve().object(),ve().array())}).test(t),sanitize:(e,{values:t})=>{if(t.indexOf(e)<0)throw Error("Selected value doesn't match Select options");return e},format:(e,{values:t})=>t.indexOf(e),normalize:e=>{let{value:t,options:n}=e,r,o;return Array.isArray(n)?(o=n,r=n.map(i=>String(i))):(o=Object.values(n),r=Object.keys(n)),"value"in e?o.includes(t)||(r.unshift(String(t)),o.unshift(t)):t=o[0],Object.values(n).includes(t)||(n[String(t)]=t),{value:t,settings:{keys:r,values:o}}}});const Tb=j("div",{$flexCenter:"",position:"relative","> svg":{pointerEvents:"none",position:"absolute",right:"$md"}}),Go=j("select",{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:0}),Db=j("div",{display:"flex",alignItems:"center",width:"100%",height:"$rowHeight",backgroundColor:"$elevation3",borderRadius:"$sm",padding:"0 $sm",cursor:"pointer",[`${Go}:focus + &`]:{$focusStyle:""},[`${Go}:hover + &`]:{$hoverStyle:""}});function Ib({displayValue:e,value:t,onUpdate:n,id:r,settings:o,disabled:i}){const{keys:s,values:a}=o,l=f.useRef();return t===a[e]&&(l.current=s[e]),f.createElement(Tb,null,f.createElement(Go,{id:r,value:e,onChange:c=>n(a[Number(c.currentTarget.value)]),disabled:i},s.map((c,u)=>f.createElement("option",{key:c,value:u},c))),f.createElement(Db,null,l.current),f.createElement(Uo,{toggled:!0}))}function Lb(){const{label:e,value:t,displayValue:n,onUpdate:r,id:o,disabled:i,settings:s}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(Ib,{id:o,value:t,displayValue:n,onUpdate:r,settings:s,disabled:i}))}var kb=F({component:Lb},Ab),Mb=Object.freeze({__proto__:null,schema:e=>ve().string().test(e),sanitize:e=>{if(typeof e!="string")throw Error("Invalid string");return e},normalize:({value:e,editable:t=!0,rows:n=!1})=>({value:e,settings:{editable:t,rows:typeof n=="number"?n:n?5:0}})});const Nb=["displayValue","onUpdate","onChange","editable"],jb=j("div",{whiteSpace:"pre-wrap"});function Rb(e){let{displayValue:t,onUpdate:n,onChange:r,editable:o=!0}=e,i=G(e,Nb);return o?f.createElement(Vo,ee({value:t,onUpdate:n,onChange:r},i)):f.createElement(jb,null,t)}function Fb(){const{label:e,settings:t,displayValue:n,onUpdate:r,onChange:o}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(Rb,ee({displayValue:n,onUpdate:r,onChange:o},t)))}var Vb=F({component:Fb},Mb),Bb=Object.freeze({__proto__:null,schema:e=>ve().boolean().test(e),sanitize:e=>{if(typeof e!="boolean")throw Error("Invalid boolean");return e}});const zb=j("div",{position:"relative",$flex:"",height:"$rowHeight",input:{$reset:"",height:0,width:0,opacity:0,margin:0},label:{position:"relative",$flexCenter:"",userSelect:"none",cursor:"pointer",height:"$checkboxSize",width:"$checkboxSize",backgroundColor:"$elevation3",borderRadius:"$sm",$hover:""},"input:focus + label":{$focusStyle:""},"input:focus:checked + label, input:checked + label:hover":{$hoverStyle:"$accent3"},"input + label:active":{backgroundColor:"$accent1"},"input:checked + label:active":{backgroundColor:"$accent1"},"label > svg":{display:"none",width:"90%",height:"90%",stroke:"$highlight3"},"input:checked + label":{backgroundColor:"$accent2"},"input:checked + label > svg":{display:"block"}});function Hb({value:e,onUpdate:t,id:n,disabled:r}){return f.createElement(zb,null,f.createElement("input",{id:n,type:"checkbox",checked:e,onChange:o=>t(o.currentTarget.checked),disabled:r}),f.createElement("label",{htmlFor:n},f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},f.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"}))))}function Ub(){const{label:e,value:t,onUpdate:n,disabled:r,id:o}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(Hb,{value:t,onUpdate:n,id:o,disabled:r}))}var Wb=F({component:Ub},Bb);const Kb=["locked"];function Gb({value:e,id:t,valueKey:n,settings:r,onUpdate:o,innerLabelTrim:i}){const s=f.useRef(e[n]);s.current=e[n];const a=f.useCallback(c=>o({[n]:Wl({type:"NUMBER",value:s.current,settings:r},c)}),[o,r,n]),l=lc({type:"NUMBER",value:e[n],settings:r,setValue:a});return f.createElement(pc,{id:t,label:n,value:e[n],displayValue:l.displayValue,onUpdate:l.onUpdate,onChange:l.onChange,settings:r,innerLabelTrim:i})}const Yb=j("div",{display:"grid",columnGap:"$colGap",gridAutoFlow:"column dense",alignItems:"center",variants:{withLock:{true:{gridTemplateColumns:"10px auto","> svg":{cursor:"pointer"}}}}});function qb(e){let{locked:t}=e,n=G(e,Kb);return f.createElement("svg",ee({width:"10",height:"10",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},n),t?f.createElement("path",{d:"M5 4.63601C5 3.76031 5.24219 3.1054 5.64323 2.67357C6.03934 2.24705 6.64582 1.9783 7.5014 1.9783C8.35745 1.9783 8.96306 2.24652 9.35823 2.67208C9.75838 3.10299 10 3.75708 10 4.63325V5.99999H5V4.63601ZM4 5.99999V4.63601C4 3.58148 4.29339 2.65754 4.91049 1.99307C5.53252 1.32329 6.42675 0.978302 7.5014 0.978302C8.57583 0.978302 9.46952 1.32233 10.091 1.99162C10.7076 2.65557 11 3.57896 11 4.63325V5.99999H12C12.5523 5.99999 13 6.44771 13 6.99999V13C13 13.5523 12.5523 14 12 14H3C2.44772 14 2 13.5523 2 13V6.99999C2 6.44771 2.44772 5.99999 3 5.99999H4ZM3 6.99999H12V13H3V6.99999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}):f.createElement("path",{d:"M9 3.63601C9 2.76044 9.24207 2.11211 9.64154 1.68623C10.0366 1.26502 10.6432 1 11.5014 1C12.4485 1 13.0839 1.30552 13.4722 1.80636C13.8031 2.23312 14 2.84313 14 3.63325H15C15 2.68242 14.7626 1.83856 14.2625 1.19361C13.6389 0.38943 12.6743 0 11.5014 0C10.4294 0 9.53523 0.337871 8.91218 1.0021C8.29351 1.66167 8 2.58135 8 3.63601V6H1C0.447715 6 0 6.44772 0 7V13C0 13.5523 0.447715 14 1 14H10C10.5523 14 11 13.5523 11 13V7C11 6.44772 10.5523 6 10 6H9V3.63601ZM1 7H10V13H1V7Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}function Yo({value:e,onUpdate:t,settings:n,innerLabelTrim:r}){const{id:o,setSettings:i}=fe(),{lock:s,locked:a}=n;return f.createElement(Yb,{withLock:s},s&&f.createElement(qb,{locked:a,onClick:()=>i({locked:!a})}),Object.keys(e).map((l,c)=>f.createElement(Gb,{id:c===0?o:`${o}.${l}`,key:l,valueKey:l,value:e,settings:n[l],onUpdate:t,innerLabelTrim:r})))}const hc=(e,t)=>{const n={};let r=0,o=1/0;Object.entries(e).forEach(([i,s])=>{n[i]=ql(F({value:s},t[i])).settings,r=Math.max(r,n[i].step),o=Math.min(o,n[i].pad)});for(let i in n){const{step:s,min:a,max:l}=t[i]||{};!isFinite(s)&&(!isFinite(a)||!isFinite(l))&&(n[i].step=r,n[i].pad=o)}return n},Xb=["lock"],Jb=["value"];function Zb(e){const t=ve().array().length(e).every.number(),n=r=>{if(!r||typeof r!="object")return!1;const o=Object.values(r);return o.length===e&&o.every(i=>isFinite(i))};return r=>t.test(r)||n(r)}function Qb(e){return Array.isArray(e)?"array":"object"}function Sn(e,t,n){return Qb(e)===t?e:t==="array"?Object.values(e):Vv(e,n)}const ey=(e,t,n)=>{const r=Sn(e,"object",t.keys);for(let s in r)r[s]=Yl(r[s],t[s]);const o=Object.keys(r);let i={};if(o.length===t.keys.length)i=r;else{const s=Sn(n,"object",t.keys);if(o.length===1&&t.locked){const a=o[0],l=r[a],c=s[a],u=c!==0?l/c:1;for(let d in s)d===a?i[a]=l:i[d]=s[d]*u}else i=F(F({},s),r)}return Sn(i,t.format,t.keys)},ty=(e,t)=>Sn(e,"object",t.keys),ny=e=>!!e&&("step"in e||"min"in e||"max"in e);function ry(e,t,n=[]){const{lock:r=!1}=t,o=G(t,Xb),i=Array.isArray(e)?"array":"object",s=i==="object"?Object.keys(e):n,a=Sn(e,"object",s),l=ny(o)?s.reduce((u,d)=>Object.assign(u,{[d]:o}),{}):o,c=hc(a,l);return{value:i==="array"?e:a,settings:F(F({},c),{},{format:i,keys:s,lock:r,locked:!1})}}function gc(e){return{schema:Zb(e.length),normalize:t=>{let{value:n}=t,r=G(t,Jb);return ry(n,r,e)},format:(t,n)=>ty(t,n),sanitize:(t,n,r)=>ey(t,n,r)}}for(var oy={grad:.9,turn:360,rad:360/(2*Math.PI)},it=function(e){return typeof e=="string"?e.length>0:typeof e=="number"},He=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},pr=function(e){var t=Math.round(100*e)/100;return Math.round(255*t)===255*e?t:Math.round(1e3*e)/1e3},Se=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e>t?e:t},mc=function(e){return(e=isFinite(e)?e%360:0)<0?e+360:e},qo=function(e,t){return t===void 0&&(t=0),He(e,t)%360},vc=function(e){return{r:Se(e.r,0,255),g:Se(e.g,0,255),b:Se(e.b,0,255),a:Se(e.a)}},Xo=function(e){return{r:He(e.r),g:He(e.g),b:He(e.b),a:pr(e.a)}},iy=/^#([0-9a-f]{3,8})$/i,zt=function(e,t){var n=e.charCodeAt(t);return(15&n)+9*(n>>6)},hr=function(e,t){return zt(e,t)<<4|zt(e,t+1)},bc=[],gr=0;gr<256;gr++)bc.push((gr<16?"0":"")+gr.toString(16));var mr=function(e){return bc[Se(e,0,255)]},yc=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},Ec=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:255*[r,a,s,s,l,r][c],g:255*[l,r,r,a,s,s][c],b:255*[s,s,l,r,r,a][c],a:o}},_c=function(e){return{h:mc(e.h),s:Se(e.s,0,100),l:Se(e.l,0,100),a:Se(e.a)}},wc=function(e){return{h:qo(e.h),s:He(e.s),l:He(e.l),a:pr(e.a)}},Sc=function(e){return Ec((n=(t=e).s,{h:t.h,s:(n*=((r=t.l)<50?r:100-r)/100)>0?2*n/(r+n)*100:0,v:r+n,a:t.a}));var t,n,r},Ht=function(e){return{h:(t=yc(e)).h,s:(o=(200-(n=t.s))*(r=t.v)/100)>0&&o<200?n*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,n,r,o},sy=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s*,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)%\s*,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)%\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,ay=/^hsla?\(\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?\s+([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)%\s+([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)%\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,ly=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*(?:,\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,cy=/^rgba?\(\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s+([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*(?:\/\s*([+-]?(?:\d*\.\d+|\d+)(?:e[+-]?\d+)?)(%)?\s*)?\)$/i,Jo={string:[[function(e){if(!iy.test(e))return null;var t=e.length;return t<=5?{r:17*zt(e,1),g:17*zt(e,2),b:17*zt(e,3),a:t===5?17*zt(e,4)/255:1}:t===7||t===9?{r:hr(e,1),g:hr(e,3),b:hr(e,5),a:t===9?hr(e,7)/255:1}:null},"hex"],[function(e){var t=ly.exec(e)||cy.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:vc({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(e){var t=sy.exec(e)||ay.exec(e);if(!t)return null;var n,r,o=_c({h:(n=t[1],r=t[2],r===void 0&&(r="deg"),Number(n)*(oy[r.toLowerCase()]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return Sc(o)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=o===void 0?1:o;return it(t)&&it(n)&&it(r)?vc({r:Number(t),g:Number(n),b:Number(r),a:Number(i)}):null},"rgb"],[function(e){var t=e.h,n=e.s,r=e.l,o=e.a,i=o===void 0?1:o;if(!it(t)||!it(n)||!it(r))return null;var s=_c({h:Number(t),s:Number(n),l:Number(r),a:Number(i)});return Sc(s)},"hsl"],[function(e){var t=e.h,n=e.s,r=e.v,o=e.a,i=o===void 0?1:o;if(!it(t)||!it(n)||!it(r))return null;var s=(function(a){return{h:mc(a.h),s:Se(a.s,0,100),v:Se(a.v,0,100),a:Se(a.a)}})({h:Number(t),s:Number(n),v:Number(r),a:Number(i)});return Ec(s)},"hsv"]]},xc=function(e,t){for(var n=0;n<t.length;n++){var r=t[n][0](e);if(r)return[r,t[n][1]]}return[null,void 0]},Cc=function(e){return typeof e=="string"?xc(e.trim(),Jo.string):typeof e=="object"&&e!==null?xc(e,Jo.object):[null,void 0]},uy=function(e){return Cc(e)[1]},Zo=function(e,t){var n=Ht(e);return{h:n.h,s:Se(n.s+100*t,0,100),l:n.l,a:n.a}},Qo=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Oc=function(e,t){var n=Ht(e);return{h:n.h,s:n.s,l:Se(n.l+100*t,0,100),a:n.a}},ei=(function(){function e(t){this.parsed=Cc(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return this.parsed!==null},e.prototype.brightness=function(){return He(Qo(this.rgba),2)},e.prototype.isDark=function(){return Qo(this.rgba)<.5},e.prototype.isLight=function(){return Qo(this.rgba)>=.5},e.prototype.toHex=function(){return t=Xo(this.rgba),n=t.r,r=t.g,o=t.b,s=(i=t.a)<1?mr(He(255*i)):"","#"+mr(n)+mr(r)+mr(o)+s;var t,n,r,o,i,s},e.prototype.toRgb=function(){return Xo(this.rgba)},e.prototype.toRgbString=function(){return t=Xo(this.rgba),n=t.r,r=t.g,o=t.b,(i=t.a)<1?"rgba("+n+", "+r+", "+o+", "+i+")":"rgb("+n+", "+r+", "+o+")";var t,n,r,o,i},e.prototype.toHsl=function(){return wc(Ht(this.rgba))},e.prototype.toHslString=function(){return t=wc(Ht(this.rgba)),n=t.h,r=t.s,o=t.l,(i=t.a)<1?"hsla("+n+", "+r+"%, "+o+"%, "+i+")":"hsl("+n+", "+r+"%, "+o+"%)";var t,n,r,o,i},e.prototype.toHsv=function(){return t=yc(this.rgba),{h:qo(t.h),s:He(t.s),v:He(t.v),a:pr(t.a)};var t},e.prototype.invert=function(){return he({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},e.prototype.saturate=function(t){return t===void 0&&(t=.1),he(Zo(this.rgba,t))},e.prototype.desaturate=function(t){return t===void 0&&(t=.1),he(Zo(this.rgba,-t))},e.prototype.grayscale=function(){return he(Zo(this.rgba,-1))},e.prototype.lighten=function(t){return t===void 0&&(t=.1),he(Oc(this.rgba,t))},e.prototype.darken=function(t){return t===void 0&&(t=.1),he(Oc(this.rgba,-t))},e.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(Ht(this.rgba).h+t)},e.prototype.alpha=function(t){return typeof t=="number"?he({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):pr(this.rgba.a);var n},e.prototype.hue=function(t){var n=Ht(this.rgba);return typeof t=="number"?he({h:t,s:n.s,l:n.l,a:n.a}):qo(n.h)},e.prototype.isEqual=function(t){return this.toHex()===he(t).toHex()},e})(),he=function(e){return e instanceof ei?e:new ei(e)},Pc=[],fy=function(e){e.forEach(function(t){Pc.indexOf(t)<0&&(t(ei,Jo),Pc.push(t))})},dy=function(e,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in n)r[n[o]]=o;var i={};e.prototype.toName=function(s){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var a,l,c=r[this.toHex()];if(c)return c;if(s!=null&&s.closest){var u=this.toRgb(),d=1/0,p="black";if(!i.length)for(var h in n)i[h]=new e(n[h]).toRgb();for(var g in n){var m=(a=u,l=i[g],Math.pow(a.r-l.r,2)+Math.pow(a.g-l.g,2)+Math.pow(a.b-l.b,2));m<d&&(d=m,p=g)}return p}},t.string.push([function(s){var a=s.toLowerCase(),l=a==="transparent"?"#0000":n[a];return l?new e(l).toRgb():null},"name"])};function Ut(){return(Ut=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function ti(e,t){if(e==null)return{};var n,r,o={},i=Object.keys(e);for(r=0;r<i.length;r++)t.indexOf(n=i[r])>=0||(o[n]=e[n]);return o}function xn(e){var t=f.useRef(e),n=f.useRef(function(r){t.current&&t.current(r)});return t.current=e,n.current}var Wt=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),e>n?n:e<t?t:e},Cn=function(e){return"touches"in e},ni=function(e){return e&&e.ownerDocument.defaultView||self},$c=function(e,t,n){var r=e.getBoundingClientRect(),o=Cn(t)?(function(i,s){for(var a=0;a<i.length;a++)if(i[a].identifier===s)return i[a];return i[0]})(t.touches,n):t;return{left:Wt((o.pageX-(r.left+ni(e).pageXOffset))/r.width),top:Wt((o.pageY-(r.top+ni(e).pageYOffset))/r.height)}},Ac=function(e){!Cn(e)&&e.preventDefault()},ri=f.memo(function(e){var t=e.onMove,n=e.onKey,r=e.onEnd,o=ti(e,["onMove","onKey","onEnd"]),i=f.useRef(null),s=xn(t),a=xn(n),l=xn(r),c=f.useRef(null),u=f.useRef(!1),d=f.useMemo(function(){var b=function(S){Ac(S),(Cn(S)?S.touches.length>0:S.buttons>0)&&i.current?s($c(i.current,S,c.current)):(y(!1),l())},v=function(){y(!1),l()};function y(S){var w=u.current,C=ni(i.current),_=S?C.addEventListener:C.removeEventListener;_(w?"touchmove":"mousemove",b),_(w?"touchend":"mouseup",v)}return[function(S){var w=S.nativeEvent,C=i.current;if(C&&(Ac(w),!(function(x,k){return k&&!Cn(x)})(w,u.current)&&C)){if(Cn(w)){u.current=!0;var _=w.changedTouches||[];_.length&&(c.current=_[0].identifier)}C.focus(),s($c(C,w,c.current)),y(!0)}},function(S){var w=S.which||S.keyCode;w<37||w>40||(S.preventDefault(),a({left:w===39?.05:w===37?-.05:0,top:w===40?.05:w===38?-.05:0}))},function(S){var w=S.which||S.keyCode;w>=37&&w<=40&&l()},y]},[a,s,l]),p=d[0],h=d[1],g=d[2],m=d[3];return f.useEffect(function(){return m},[m]),f.createElement("div",Ut({},o,{onTouchStart:p,onMouseDown:p,className:"react-colorful__interactive",ref:i,onKeyDown:h,onKeyUp:g,tabIndex:0,role:"slider"}))}),On=function(e){return e.filter(Boolean).join(" ")},oi=function(e){var t=e.color,n=e.left,r=e.top,o=r===void 0?.5:r,i=On(["react-colorful__pointer",e.className]);return f.createElement("div",{className:i,style:{top:100*o+"%",left:100*n+"%"}},f.createElement("div",{className:"react-colorful__pointer-fill",style:{backgroundColor:t}}))},De=function(e,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*e)/n},Tc=function(e){var t=e.s,n=e.v,r=e.a,o=(200-t)*n/100;return{h:De(e.h),s:De(o>0&&o<200?t*n/100/(o<=100?o:200-o)*100:0),l:De(o/2),a:De(r,2)}},ii=function(e){var t=Tc(e);return"hsl("+t.h+", "+t.s+"%, "+t.l+"%)"},si=function(e){var t=Tc(e);return"hsla("+t.h+", "+t.s+"%, "+t.l+"%, "+t.a+")"},Dc=function(e){var t=e.h,n=e.s,r=e.v,o=e.a;t=t/360*6,n/=100,r/=100;var i=Math.floor(t),s=r*(1-n),a=r*(1-(t-i)*n),l=r*(1-(1-t+i)*n),c=i%6;return{r:De(255*[r,a,s,s,l,r][c]),g:De(255*[l,r,r,a,s,s][c]),b:De(255*[s,s,l,r,r,a][c]),a:De(o,2)}},Ic=function(e){var t=e.r,n=e.g,r=e.b,o=e.a,i=Math.max(t,n,r),s=i-Math.min(t,n,r),a=s?i===t?(n-r)/s:i===n?2+(r-t)/s:4+(t-n)/s:0;return{h:60*(a<0?a+6:a),s:i?s/i*100:0,v:i/255*100,a:o}},Lc=f.memo(function(e){var t=e.hue,n=e.onChange,r=e.onChangeEnd,o=On(["react-colorful__hue",e.className]);return f.createElement("div",{className:o},f.createElement(ri,{onMove:function(i){n({h:360*i.left})},onKey:function(i){n({h:Wt(t+360*i.left,0,360)})},onEnd:r,"aria-label":"Hue","aria-valuenow":De(t),"aria-valuemax":"360","aria-valuemin":"0"},f.createElement(oi,{className:"react-colorful__hue-pointer",left:t/360,color:ii({h:t,s:100,v:100,a:1})})))}),kc=f.memo(function(e){var t=e.hsva,n=e.onChange,r=e.onChangeEnd,o={backgroundColor:ii({h:t.h,s:100,v:100,a:1})};return f.createElement("div",{className:"react-colorful__saturation",style:o},f.createElement(ri,{onMove:function(i){n({s:100*i.left,v:100-100*i.top})},onKey:function(i){n({s:Wt(t.s+100*i.left,0,100),v:Wt(t.v-100*i.top,0,100)})},onEnd:r,"aria-label":"Color","aria-valuetext":"Saturation "+De(t.s)+"%, Brightness "+De(t.v)+"%"},f.createElement(oi,{className:"react-colorful__saturation-pointer",top:1-t.v/100,left:t.s/100,color:ii(t)})))}),ai=function(e,t){if(e===t)return!0;for(var n in e)if(e[n]!==t[n])return!1;return!0};function Mc(e,t,n,r){var o=xn(n),i=xn(r),s=f.useState(function(){return e.toHsva(t)}),a=s[0],l=s[1],c=f.useRef({color:t,hsva:a}),u=f.useRef(!1);f.useEffect(function(){if(!e.equal(t,c.current.color)){var h=e.toHsva(t);c.current={hsva:h,color:t},l(h),u.current=!1}},[t,e]),f.useEffect(function(){var h;ai(a,c.current.hsva)||e.equal(h=e.fromHsva(a),c.current.color)||(c.current={hsva:a,color:h},o(h),u.current=!0)},[a,e,o]);var d=f.useCallback(function(h){l(function(g){return Object.assign({},g,h)})},[]),p=f.useCallback(function(){u.current&&(u.current=!1,i(c.current.color))},[i]);return[a,d,p]}var py=typeof window<"u"?f.useLayoutEffect:f.useEffect,hy=function(){return typeof __webpack_nonce__<"u"?__webpack_nonce__:void 0},Nc=new WeakMap,jc=function(e){py(function(){var t=e.current;if(typeof document<"u"&&t){var n=t.getRootNode?t.getRootNode():t.ownerDocument,r=n&&("head"in n||"host"in n)?n:t.ownerDocument;if(!Nc.has(r)){var o="head"in r?r.head:r,i=(o.ownerDocument||document).createElement("style");i.innerHTML=`.react-colorful{position:relative;display:flex;flex-direction:column;width:200px;height:200px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:default}.react-colorful__saturation{position:relative;flex-grow:1;border-color:transparent;border-bottom:12px solid #000;border-radius:8px 8px 0 0;background-image:linear-gradient(0deg,#000,transparent),linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.react-colorful__alpha-gradient,.react-colorful__pointer-fill{content:"";position:absolute;left:0;top:0;right:0;bottom:0;pointer-events:none;border-radius:inherit}.react-colorful__alpha-gradient,.react-colorful__saturation{box-shadow:inset 0 0 0 1px rgba(0,0,0,.05)}.react-colorful__alpha,.react-colorful__hue{position:relative;height:24px}.react-colorful__hue{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red)}.react-colorful__last-control{border-radius:0 0 8px 8px}.react-colorful__interactive{position:absolute;left:0;top:0;right:0;bottom:0;border-radius:inherit;outline:none;touch-action:none}.react-colorful__pointer{position:absolute;z-index:1;box-sizing:border-box;width:28px;height:28px;transform:translate(-50%,-50%);background-color:#fff;border:2px solid #fff;border-radius:50%;box-shadow:0 2px 4px rgba(0,0,0,.2)}.react-colorful__interactive:focus .react-colorful__pointer{transform:translate(-50%,-50%) scale(1.1)}.react-colorful__alpha,.react-colorful__alpha-pointer{background-color:#fff;background-image:url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')}.react-colorful__saturation-pointer{z-index:3}.react-colorful__hue-pointer{z-index:2}`;var s=hy();s&&i.setAttribute("nonce",s),Nc.set(r,i),o.appendChild(i)}}},[])},gy=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,s=e.onChangeEnd,a=ti(e,["className","colorModel","color","onChange","onChangeEnd"]),l=f.useRef(null);jc(l);var c=Mc(n,o,i,s),u=c[0],d=c[1],p=c[2],h=On(["react-colorful",t]);return f.createElement("div",Ut({},a,{ref:l,className:h}),f.createElement(kc,{hsva:u,onChange:d,onChangeEnd:p}),f.createElement(Lc,{hue:u.h,onChange:d,onChangeEnd:p,className:"react-colorful__last-control"}))},my=function(e){var t=e.className,n=e.hsva,r=e.onChange,o=e.onChangeEnd,i={backgroundImage:"linear-gradient(90deg, "+si(Object.assign({},n,{a:0}))+", "+si(Object.assign({},n,{a:1}))+")"},s=On(["react-colorful__alpha",t]),a=De(100*n.a);return f.createElement("div",{className:s},f.createElement("div",{className:"react-colorful__alpha-gradient",style:i}),f.createElement(ri,{onMove:function(l){r({a:l.left})},onKey:function(l){r({a:Wt(n.a+l.left)})},onEnd:o,"aria-label":"Alpha","aria-valuetext":a+"%","aria-valuenow":a,"aria-valuemin":"0","aria-valuemax":"100"},f.createElement(oi,{className:"react-colorful__alpha-pointer",left:n.a,color:si(n)})))},vy=function(e){var t=e.className,n=e.colorModel,r=e.color,o=r===void 0?n.defaultColor:r,i=e.onChange,s=e.onChangeEnd,a=ti(e,["className","colorModel","color","onChange","onChangeEnd"]),l=f.useRef(null);jc(l);var c=Mc(n,o,i,s),u=c[0],d=c[1],p=c[2],h=On(["react-colorful",t]);return f.createElement("div",Ut({},a,{ref:l,className:h}),f.createElement(kc,{hsva:u,onChange:d,onChangeEnd:p}),f.createElement(Lc,{hue:u.h,onChange:d,onChangeEnd:p}),f.createElement(my,{hsva:u,onChange:d,onChangeEnd:p,className:"react-colorful__last-control"}))},by={defaultColor:{r:0,g:0,b:0,a:1},toHsva:Ic,fromHsva:Dc,equal:ai},yy=function(e){return f.createElement(vy,Ut({},e,{colorModel:by}))},Ey={defaultColor:{r:0,g:0,b:0},toHsva:function(e){return Ic({r:e.r,g:e.g,b:e.b,a:1})},fromHsva:function(e){return{r:(t=Dc(e)).r,g:t.g,b:t.b};var t},equal:ai},_y=function(e){return f.createElement(gy,Ut({},e,{colorModel:Ey}))},li={exports:{}},ci,Rc;function wy(){if(Rc)return ci;Rc=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ci=e,ci}var ui,Fc;function Sy(){if(Fc)return ui;Fc=1;var e=wy();function t(){}function n(){}return n.resetWarningCache=t,ui=function(){function r(s,a,l,c,u,d){if(d!==e){var p=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw p.name="Invariant Violation",p}}r.isRequired=r;function o(){return r}var i={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return i.PropTypes=i,i},ui}var Vc;function xy(){return Vc||(Vc=1,li.exports=Sy()()),li.exports}var Cy=xy();const Y=kr(Cy);function Kt(e,t,n,r){function o(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function a(u){try{c(r.next(u))}catch(d){s(d)}}function l(u){try{c(r.throw(u))}catch(d){s(d)}}function c(u){u.done?i(u.value):o(u.value).then(a,l)}c((r=r.apply(e,t||[])).next())})}function Gt(e,t){var n={label:0,sent:function(){if(i[0]&1)throw i[1];return i[1]},trys:[],ops:[]},r,o,i,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(c){return function(u){return l([c,u])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(n=0)),n;)try{if(r=1,o&&(i=c[0]&2?o.return:c[0]?o.throw||((i=o.return)&&i.call(o),0):o.next)&&!(i=i.call(o,c[1])).done)return i;switch(o=0,i&&(c=[c[0]&2,i.value]),c[0]){case 0:case 1:i=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,o=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(i=n.trys,!(i=i.length>0&&i[i.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!i||c[1]>i[0]&&c[1]<i[3])){n.label=c[1];break}if(c[0]===6&&n.label<i[1]){n.label=i[1],i=c;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(c);break}i[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(u){c=[6,u],o=0}finally{r=i=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function Oy(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),o,i=[],s;try{for(;(t===void 0||t-- >0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function Py(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Oy(arguments[t]));return e}typeof SuppressedError=="function"&&SuppressedError;var $y=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Pn(e,t){var n=Ay(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function Ay(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),o=$y.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var Ty=[".DS_Store","Thumbs.db"];function Dy(e){return Kt(this,void 0,void 0,function(){return Gt(this,function(t){return vr(e)&&Iy(e)?[2,Ny(e.dataTransfer,e.type)]:Ly(e)?[2,ky(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,My(e)]:[2,[]]})})}function Iy(e){return vr(e.dataTransfer)}function Ly(e){return vr(e)&&vr(e.target)}function vr(e){return typeof e=="object"&&e!==null}function ky(e){return fi(e.target.files).map(function(t){return Pn(t)})}function My(e){return Kt(this,void 0,void 0,function(){var t;return Gt(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return Pn(r)})]}})})}function Ny(e,t){return Kt(this,void 0,void 0,function(){var n,r;return Gt(this,function(o){switch(o.label){case 0:return e===null?[2,[]]:e.items?(n=fi(e.items).filter(function(i){return i.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(jy))]):[3,2];case 1:return r=o.sent(),[2,Bc(zc(r))];case 2:return[2,Bc(fi(e.files).map(function(i){return Pn(i)}))]}})})}function Bc(e){return e.filter(function(t){return Ty.indexOf(t.name)===-1})}function fi(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function jy(e){if(typeof e.webkitGetAsEntry!="function")return Hc(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?Uc(t):Hc(e)}function zc(e){return e.reduce(function(t,n){return Py(t,Array.isArray(n)?zc(n):[n])},[])}function Hc(e){var t=e.getAsFile();if(!t)return Promise.reject(e+" is not a File");var n=Pn(t);return Promise.resolve(n)}function Ry(e){return Kt(this,void 0,void 0,function(){return Gt(this,function(t){return[2,e.isDirectory?Uc(e):Fy(e)]})})}function Uc(e){var t=e.createReader();return new Promise(function(n,r){var o=[];function i(){var s=this;t.readEntries(function(a){return Kt(s,void 0,void 0,function(){var l,c,u;return Gt(this,function(d){switch(d.label){case 0:if(a.length)return[3,5];d.label=1;case 1:return d.trys.push([1,3,,4]),[4,Promise.all(o)];case 2:return l=d.sent(),n(l),[3,4];case 3:return c=d.sent(),r(c),[3,4];case 4:return[3,6];case 5:u=Promise.all(a.map(Ry)),o.push(u),i(),d.label=6;case 6:return[2]}})})},function(a){r(a)})}i()})}function Fy(e){return Kt(this,void 0,void 0,function(){return Gt(this,function(t){return[2,new Promise(function(n,r){e.file(function(o){var i=Pn(o,e.fullPath);n(i)},function(o){r(o)})})]})})}var br={},Wc;function Vy(){return Wc||(Wc=1,br.__esModule=!0,br.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(function(s){var a=s.trim().toLowerCase();return a.charAt(0)==="."?r.toLowerCase().endsWith(a):a.endsWith("/*")?i===a.replace(/\/.*$/,""):o===a})}return!0}),br}var By=Vy();const zy=kr(By);function Kc(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function Gc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Kc(Object(n),!0).forEach(function(r){Yc(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Kc(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Yc(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function qc(e,t){return Ky(e)||Wy(e,t)||Uy(e,t)||Hy()}function Hy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
32
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uy(e,t){if(e){if(typeof e=="string")return Xc(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xc(e,t)}}function Xc(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Wy(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function Ky(e){if(Array.isArray(e))return e}var Gy="file-invalid-type",Yy="file-too-large",qy="file-too-small",Xy="too-many-files",Jy=function(t){t=Array.isArray(t)&&t.length===1?t[0]:t;var n=Array.isArray(t)?"one of ".concat(t.join(", ")):t;return{code:Gy,message:"File type must be ".concat(n)}},Jc=function(t){return{code:Yy,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Zc=function(t){return{code:qy,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},Zy={code:Xy,message:"Too many files"};function Qc(e,t){var n=e.type==="application/x-moz-file"||zy(e,t);return[n,n?null:Jy(t)]}function eu(e,t,n){if($n(e.size))if($n(t)&&$n(n)){if(e.size>n)return[!1,Jc(n)];if(e.size<t)return[!1,Zc(t)]}else{if($n(t)&&e.size<t)return[!1,Zc(t)];if($n(n)&&e.size>n)return[!1,Jc(n)]}return[!0,null]}function $n(e){return e!=null}function Qy(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,i=e.multiple,s=e.maxFiles;return!i&&t.length>1||i&&s>=1&&t.length>s?!1:t.every(function(a){var l=Qc(a,n),c=qc(l,1),u=c[0],d=eu(a,r,o),p=qc(d,1),h=p[0];return u&&h})}function yr(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Er(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function tu(e){e.preventDefault()}function e0(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function t0(e){return e.indexOf("Edge/")!==-1}function n0(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return e0(e)||t0(e)}function Ue(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,i=new Array(o>1?o-1:0),s=1;s<o;s++)i[s-1]=arguments[s];return t.some(function(a){return!yr(r)&&a&&a.apply(void 0,[r].concat(i)),yr(r)})}}function r0(){return"showOpenFilePicker"in window}function o0(e){return e=typeof e=="string"?e.split(","):e,[{description:"everything",accept:Array.isArray(e)?e.filter(function(t){return t==="audio/*"||t==="video/*"||t==="image/*"||t==="text/*"||/\w+\/[-+.\w]+/g.test(t)}).reduce(function(t,n){return Gc(Gc({},t),{},Yc({},n,[]))},{}):{}}]}function i0(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function s0(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}var a0=["children"],l0=["open"],c0=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],u0=["refKey","onChange","onClick"];function f0(e){return h0(e)||p0(e)||nu(e)||d0()}function d0(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
33
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function p0(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function h0(e){if(Array.isArray(e))return pi(e)}function di(e,t){return v0(e)||m0(e,t)||nu(e,t)||g0()}function g0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
34
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nu(e,t){if(e){if(typeof e=="string")return pi(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return pi(e,t)}}function pi(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m0(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,i=!1,s,a;try{for(n=n.call(e);!(o=(s=n.next()).done)&&(r.push(s.value),!(t&&r.length===t));o=!0);}catch(l){i=!0,a=l}finally{try{!o&&n.return!=null&&n.return()}finally{if(i)throw a}}return r}}function v0(e){if(Array.isArray(e))return e}function ru(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function J(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?ru(Object(n),!0).forEach(function(r){hi(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ru(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function hi(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _r(e,t){if(e==null)return{};var n=b0(e,t),r,o;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(o=0;o<i.length;o++)r=i[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function b0(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i<r.length;i++)o=r[i],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var gi=f.forwardRef(function(e,t){var n=e.children,r=_r(e,a0),o=iu(r),i=o.open,s=_r(o,l0);return f.useImperativeHandle(t,function(){return{open:i}},[i]),f.createElement(f.Fragment,null,n(J(J({},s),{},{open:i})))});gi.displayName="Dropzone";var ou={disabled:!1,getFilesFromEvent:Dy,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0};gi.defaultProps=ou,gi.propTypes={children:Y.func,accept:Y.oneOfType([Y.string,Y.arrayOf(Y.string)]),multiple:Y.bool,preventDropOnDocument:Y.bool,noClick:Y.bool,noKeyboard:Y.bool,noDrag:Y.bool,noDragEventsBubbling:Y.bool,minSize:Y.number,maxSize:Y.number,maxFiles:Y.number,disabled:Y.bool,getFilesFromEvent:Y.func,onFileDialogCancel:Y.func,onFileDialogOpen:Y.func,useFsAccessApi:Y.bool,onDragEnter:Y.func,onDragLeave:Y.func,onDragOver:Y.func,onDrop:Y.func,onDropAccepted:Y.func,onDropRejected:Y.func,validator:Y.func};var mi={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,draggedFiles:[],acceptedFiles:[],fileRejections:[]};function iu(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=J(J({},ou),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,i=t.maxSize,s=t.minSize,a=t.multiple,l=t.maxFiles,c=t.onDragEnter,u=t.onDragLeave,d=t.onDragOver,p=t.onDrop,h=t.onDropAccepted,g=t.onDropRejected,m=t.onFileDialogCancel,b=t.onFileDialogOpen,v=t.useFsAccessApi,y=t.preventDropOnDocument,S=t.noClick,w=t.noKeyboard,C=t.noDrag,_=t.noDragEventsBubbling,x=t.validator,k=f.useMemo(function(){return typeof b=="function"?b:su},[b]),R=f.useMemo(function(){return typeof m=="function"?m:su},[m]),O=f.useRef(null),T=f.useRef(null),D=f.useReducer(y0,mi),P=di(D,2),M=P[0],N=P[1],H=M.isFocused,z=M.isFileDialogActive,I=M.draggedFiles,A=f.useRef(typeof window<"u"&&window.isSecureContext&&v&&r0()),U=function(){!A.current&&z&&setTimeout(function(){if(T.current){var V=T.current.files;V.length||(N({type:"closeDialog"}),R())}},300)};f.useEffect(function(){return window.addEventListener("focus",U,!1),function(){window.removeEventListener("focus",U,!1)}},[T,z,R,A]);var W=f.useRef([]),ne=function(V){O.current&&O.current.contains(V.target)||(V.preventDefault(),W.current=[])};f.useEffect(function(){return y&&(document.addEventListener("dragover",tu,!1),document.addEventListener("drop",ne,!1)),function(){y&&(document.removeEventListener("dragover",tu),document.removeEventListener("drop",ne))}},[O,y]);var de=f.useCallback(function($){$.preventDefault(),$.persist(),Ot($),W.current=[].concat(f0(W.current),[$.target]),Er($)&&Promise.resolve(o($)).then(function(V){yr($)&&!_||(N({draggedFiles:V,isDragActive:!0,type:"setDraggedFiles"}),c&&c($))})},[o,c,_]),ke=f.useCallback(function($){$.preventDefault(),$.persist(),Ot($);var V=Er($);if(V&&$.dataTransfer)try{$.dataTransfer.dropEffect="copy"}catch{}return V&&d&&d($),!1},[d,_]),Me=f.useCallback(function($){$.preventDefault(),$.persist(),Ot($);var V=W.current.filter(function(Ee){return O.current&&O.current.contains(Ee)}),le=V.indexOf($.target);le!==-1&&V.splice(le,1),W.current=V,!(V.length>0)&&(N({isDragActive:!1,type:"setDraggedFiles",draggedFiles:[]}),Er($)&&u&&u($))},[O,u,_]),ge=f.useCallback(function($,V){var le=[],Ee=[];$.forEach(function(Ne){var In=Qc(Ne,n),qt=di(In,2),Mi=qt[0],Ni=qt[1],ji=eu(Ne,s,i),Tr=di(ji,2),Ri=Tr[0],Fi=Tr[1],Vi=x?x(Ne):null;if(Mi&&Ri&&!Vi)le.push(Ne);else{var Bi=[Ni,Fi];Vi&&(Bi=Bi.concat(Vi)),Ee.push({file:Ne,errors:Bi.filter(function(g1){return g1})})}}),(!a&&le.length>1||a&&l>=1&&le.length>l)&&(le.forEach(function(Ne){Ee.push({file:Ne,errors:[Zy]})}),le.splice(0)),N({acceptedFiles:le,fileRejections:Ee,type:"setFiles"}),p&&p(le,Ee,V),Ee.length>0&&g&&g(Ee,V),le.length>0&&h&&h(le,V)},[N,a,n,s,i,l,p,h,g,x]),se=f.useCallback(function($){$.preventDefault(),$.persist(),Ot($),W.current=[],Er($)&&Promise.resolve(o($)).then(function(V){yr($)&&!_||ge(V,$)}),N({type:"reset"})},[o,ge,_]),ae=f.useCallback(function(){if(A.current){N({type:"openDialog"}),k();var $={multiple:a,types:o0(n)};window.showOpenFilePicker($).then(function(V){return o(V)}).then(function(V){ge(V,null),N({type:"closeDialog"})}).catch(function(V){i0(V)?(R(V),N({type:"closeDialog"})):s0(V)&&(A.current=!1,T.current&&(T.current.value=null,T.current.click()))});return}T.current&&(N({type:"openDialog"}),k(),T.current.value=null,T.current.click())},[N,k,R,v,ge,n,a]),xe=f.useCallback(function($){!O.current||!O.current.isEqualNode($.target)||($.key===" "||$.key==="Enter"||$.keyCode===32||$.keyCode===13)&&($.preventDefault(),ae())},[O,ae]),Ce=f.useCallback(function(){N({type:"focus"})},[]),An=f.useCallback(function(){N({type:"blur"})},[]),Tn=f.useCallback(function(){S||(n0()?setTimeout(ae,0):ae())},[S,ae]),st=function(V){return r?null:V},Yt=function(V){return w?null:st(V)},Ct=function(V){return C?null:st(V)},Ot=function(V){_&&V.stopPropagation()},Or=f.useMemo(function(){return function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=$.refKey,le=V===void 0?"ref":V,Ee=$.role,Ne=$.onKeyDown,In=$.onFocus,qt=$.onBlur,Mi=$.onClick,Ni=$.onDragEnter,ji=$.onDragOver,Tr=$.onDragLeave,Ri=$.onDrop,Fi=_r($,c0);return J(J(hi({onKeyDown:Yt(Ue(Ne,xe)),onFocus:Yt(Ue(In,Ce)),onBlur:Yt(Ue(qt,An)),onClick:st(Ue(Mi,Tn)),onDragEnter:Ct(Ue(Ni,de)),onDragOver:Ct(Ue(ji,ke)),onDragLeave:Ct(Ue(Tr,Me)),onDrop:Ct(Ue(Ri,se)),role:typeof Ee=="string"&&Ee!==""?Ee:"button"},le,O),!r&&!w?{tabIndex:0}:{}),Fi)}},[O,xe,Ce,An,Tn,de,ke,Me,se,w,C,r]),Dn=f.useCallback(function($){$.stopPropagation()},[]),Pr=f.useMemo(function(){return function(){var $=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},V=$.refKey,le=V===void 0?"ref":V,Ee=$.onChange,Ne=$.onClick,In=_r($,u0),qt=hi({accept:n,multiple:a,type:"file",style:{display:"none"},onChange:st(Ue(Ee,se)),onClick:st(Ue(Ne,Dn)),tabIndex:-1},le,T);return J(J({},qt),In)}},[T,n,a,se,r]),$r=I.length,Ar=$r>0&&Qy({files:I,accept:n,minSize:s,maxSize:i,multiple:a,maxFiles:l}),ki=$r>0&&!Ar;return J(J({},M),{},{isDragAccept:Ar,isDragReject:ki,isFocused:H&&!r,getRootProps:Or,getInputProps:Pr,rootRef:O,inputRef:T,open:st(ae)})}function y0(e,t){switch(t.type){case"focus":return J(J({},e),{},{isFocused:!0});case"blur":return J(J({},e),{},{isFocused:!1});case"openDialog":return J(J({},mi),{},{isFileDialogActive:!0});case"closeDialog":return J(J({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":var n=t.isDragActive,r=t.draggedFiles;return J(J({},e),{},{draggedFiles:r,isDragActive:n});case"setFiles":return J(J({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return J({},mi);default:return e}}function su(){}function E0(e){let t;const n=new Set,r=(c,u)=>{const d=typeof c=="function"?c(t):c;if(d!==t){const p=t;t=u?d:Object.assign({},t,d),n.forEach(h=>h(t,p))}},o=()=>t,i=(c,u=o,d=Object.is)=>{console.warn("[DEPRECATED] Please use `subscribeWithSelector` middleware");let p=u(t);function h(){const g=u(t);if(!d(p,g)){const m=p;c(p=g,m)}}return n.add(h),()=>n.delete(h)},l={setState:r,getState:o,subscribe:(c,u,d)=>u||d?i(c,u,d):(n.add(c),()=>n.delete(c)),destroy:()=>n.clear()};return t=e(r,o,l),l}const au=typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent)?f.useEffect:f.useLayoutEffect;function _0(e){const t=typeof e=="function"?E0(e):e,n=(r=t.getState,o=Object.is)=>{const[,i]=f.useReducer(b=>b+1,0),s=t.getState(),a=f.useRef(s),l=f.useRef(r),c=f.useRef(o),u=f.useRef(!1),d=f.useRef();d.current===void 0&&(d.current=r(s));let p,h=!1;(a.current!==s||l.current!==r||c.current!==o||u.current)&&(p=r(s),h=!o(d.current,p)),au(()=>{h&&(d.current=p),a.current=s,l.current=r,c.current=o,u.current=!1});const g=f.useRef(s);au(()=>{const b=()=>{try{const y=t.getState(),S=l.current(y);c.current(d.current,S)||(a.current=y,d.current=S,i())}catch{u.current=!0,i()}},v=t.subscribe(b);return t.getState()!==g.current&&b(),v},[]);const m=h?p:d.current;return f.useDebugValue(m),m};return Object.assign(n,t),n[Symbol.iterator]=function(){console.warn("[useStore, api] = create() is deprecated and will be removed in v4");const r=[n,t];return{next(){const o=r.length<=0;return{value:r.shift(),done:o}}}},n}const w0=e=>(t,n,r)=>{const o=r.subscribe;return r.subscribe=(s,a,l)=>{let c=s;if(a){const u=(l==null?void 0:l.equalityFn)||Object.is;let d=s(r.getState());c=p=>{const h=s(p);if(!u(d,h)){const g=d;a(d=h,g)}},l!=null&&l.fireImmediately&&a(d,d)}return o(c)},e(t,n,r)};/*!
|
|
35
|
+
* isobject <https://github.com/jonschlinkert/isobject>
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
38
|
+
* Released under the MIT License.
|
|
39
|
+
*/var vi,lu;function S0(){return lu||(lu=1,vi=function(t){return t!=null&&typeof t=="object"&&Array.isArray(t)===!1}),vi}/*!
|
|
40
|
+
* is-plain-object <https://github.com/jonschlinkert/is-plain-object>
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
43
|
+
* Released under the MIT License.
|
|
44
|
+
*/var bi,cu;function uu(){if(cu)return bi;cu=1;var e=S0();function t(n){return e(n)===!0&&Object.prototype.toString.call(n)==="[object Object]"}return bi=function(r){var o,i;return!(t(r)===!1||(o=r.constructor,typeof o!="function")||(i=o.prototype,t(i)===!1)||i.hasOwnProperty("isPrototypeOf")===!1)},bi}/*!
|
|
45
|
+
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
46
|
+
*
|
|
47
|
+
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
48
|
+
* Released under the MIT License.
|
|
49
|
+
*/var yi,fu;function Ei(){if(fu)return yi;fu=1;var e=uu();return yi=function(n){return e(n)||typeof n=="function"||Array.isArray(n)},yi}/*!
|
|
50
|
+
* for-in <https://github.com/jonschlinkert/for-in>
|
|
51
|
+
*
|
|
52
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
53
|
+
* Released under the MIT License.
|
|
54
|
+
*/var _i,du;function x0(){return du||(du=1,_i=function(t,n,r){for(var o in t)if(n.call(r,t[o],o,t)===!1)break}),_i}var wi,pu;function C0(){if(pu)return wi;pu=1;var e=Ei(),t=x0();function n(s,a){for(var l=arguments.length,c=0;++c<l;){var u=arguments[c];o(u)&&t(u,r,s)}return s}function r(s,a){if(i(a)){var l=this[a];o(s)&&o(l)?n(l,s):this[a]=s}}function o(s){return e(s)&&!Array.isArray(s)}function i(s){return s!=="__proto__"&&s!=="constructor"&&s!=="prototype"}return wi=n,wi}/*!
|
|
55
|
+
* get-value <https://github.com/jonschlinkert/get-value>
|
|
56
|
+
*
|
|
57
|
+
* Copyright (c) 2014-2015, Jon Schlinkert.
|
|
58
|
+
* Licensed under the MIT License.
|
|
59
|
+
*/var Si,hu;function O0(){if(hu)return Si;hu=1,Si=function(n,r,o,i,s){if(!e(n)||!r)return n;if(r=t(r),o&&(r+="."+t(o)),i&&(r+="."+t(i)),s&&(r+="."+t(s)),r in n)return n[r];for(var a=r.split("."),l=a.length,c=-1;n&&++c<l;){for(var u=a[c];u[u.length-1]==="\\";)u=u.slice(0,-1)+"."+a[++c];n=n[u]}return n};function e(n){return n!==null&&(typeof n=="object"||typeof n=="function")}function t(n){return n?Array.isArray(n)?n.join("."):n:""}return Si}/*!
|
|
60
|
+
* assign-symbols <https://github.com/jonschlinkert/assign-symbols>
|
|
61
|
+
*
|
|
62
|
+
* Copyright (c) 2015, Jon Schlinkert.
|
|
63
|
+
* Licensed under the MIT License.
|
|
64
|
+
*/var xi,gu;function P0(){return gu||(gu=1,xi=function(e,t){if(e===null||typeof e>"u")throw new TypeError("expected first argument to be an object.");if(typeof t>"u"||typeof Symbol>"u"||typeof Object.getOwnPropertySymbols!="function")return e;for(var n=Object.prototype.propertyIsEnumerable,r=Object(e),o=arguments.length,i=0;++i<o;)for(var s=Object(arguments[i]),a=Object.getOwnPropertySymbols(s),l=0;l<a.length;l++){var c=a[l];n.call(s,c)&&(r[c]=s[c])}return r}),xi}var Ci,mu;function $0(){if(mu)return Ci;mu=1;var e=Ei(),t=P0();Ci=Object.assign||function(a){if(a===null||typeof a>"u")throw new TypeError("Cannot convert undefined or null to object");i(a)||(a={});for(var l=1;l<arguments.length;l++){var c=arguments[l];r(c)&&(c=o(c)),i(c)&&(n(a,c),t(a,c))}return a};function n(a,l){for(var c in l)s(l,c)&&(a[c]=l[c])}function r(a){return a&&typeof a=="string"}function o(a){var l={};for(var c in a)l[c]=a[c];return l}function i(a){return a&&typeof a=="object"||e(a)}function s(a,l){return Object.prototype.hasOwnProperty.call(a,l)}return Ci}/*!
|
|
65
|
+
* split-string <https://github.com/jonschlinkert/split-string>
|
|
66
|
+
*
|
|
67
|
+
* Copyright (c) 2015-2017, Jon Schlinkert.
|
|
68
|
+
* Released under the MIT License.
|
|
69
|
+
*/var Oi,vu;function A0(){if(vu)return Oi;vu=1;var e=$0();Oi=function(o,i,s){if(typeof o!="string")throw new TypeError("expected a string");typeof i=="function"&&(s=i,i=null),typeof i=="string"&&(i={sep:i});var a=e({sep:"."},i),l=a.quotes||['"',"'","`"],c;a.brackets===!0?c={"<":">","(":")","[":"]","{":"}"}:a.brackets&&(c=a.brackets);var u=[],d=[],p=[""],h=a.sep,g=o.length,m=-1,b;function v(){if(c&&d.length)return c[d[d.length-1]]}for(;++m<g;){var y=o[m],S=o[m+1],w={val:y,idx:m,arr:p,str:o};if(u.push(w),y==="\\"){w.val=r(a,o,m)===!0?y+S:S,w.escaped=!0,typeof s=="function"&&s(w),p[p.length-1]+=w.val,m++;continue}if(c&&c[y]){d.push(y);var C=v(),_=m+1;if(o.indexOf(C,_+1)!==-1)for(;d.length&&_<g;){var x=o[++_];if(x==="\\"){x++;continue}if(l.indexOf(x)!==-1){_=t(o,x,_+1);continue}if(C=v(),d.length&&o.indexOf(C,_+1)===-1)break;if(c[x]){d.push(x);continue}C===x&&d.pop()}if(b=_,b===-1){p[p.length-1]+=y;continue}y=o.slice(m,b+1),w.val=y,w.idx=m=b}if(l.indexOf(y)!==-1){if(b=t(o,y,m+1),b===-1){p[p.length-1]+=y;continue}n(y,a)===!0?y=o.slice(m,b+1):y=o.slice(m+1,b),w.val=y,w.idx=m=b}if(typeof s=="function"&&(s(w,u),y=w.val,m=w.idx),w.val===h&&w.split!==!1){p.push("");continue}p[p.length-1]+=w.val}return p};function t(o,i,s,a){var l=o.indexOf(i,s);return o.charAt(l-1)==="\\"?t(o,i,l+1):l}function n(o,i){return i.keepDoubleQuotes===!0&&o==='"'||i.keepSingleQuotes===!0&&o==="'"?!0:i.keepQuotes}function r(o,i,s){return typeof o.keepEscaping=="function"?o.keepEscaping(i,s):o.keepEscaping===!0||i[s+1]==="\\"}return Oi}/*!
|
|
70
|
+
* is-extendable <https://github.com/jonschlinkert/is-extendable>
|
|
71
|
+
*
|
|
72
|
+
* Copyright (c) 2015, Jon Schlinkert.
|
|
73
|
+
* Licensed under the MIT License.
|
|
74
|
+
*/var Pi,bu;function yu(){return bu||(bu=1,Pi=function(t){return typeof t<"u"&&t!==null&&(typeof t=="object"||typeof t=="function")}),Pi}var $i,Eu;function T0(){if(Eu)return $i;Eu=1;var e=yu();$i=function(o){e(o)||(o={});for(var i=arguments.length,s=1;s<i;s++){var a=arguments[s];e(a)&&t(o,a)}return o};function t(r,o){for(var i in o)n(o,i)&&(r[i]=o[i])}function n(r,o){return Object.prototype.hasOwnProperty.call(r,o)}return $i}/*!
|
|
75
|
+
* set-value <https://github.com/jonschlinkert/set-value>
|
|
76
|
+
*
|
|
77
|
+
* Copyright (c) 2014-2015, 2017, Jon Schlinkert.
|
|
78
|
+
* Released under the MIT License.
|
|
79
|
+
*/var Ai,_u;function D0(){if(_u)return Ai;_u=1;var e=A0(),t=T0(),n=uu(),r=yu();Ai=function(i,s,a){if(!r(i)||(Array.isArray(s)&&(s=[].concat.apply([],s).join(".")),typeof s!="string"))return i;for(var l=e(s,{sep:".",brackets:!0}).filter(o),c=l.length,u=-1,d=i;++u<c;){var p=l[u];if(u!==c-1){r(d[p])||(d[p]={}),d=d[p];continue}n(d[p])&&n(a)?d[p]=t({},d[p],a):d[p]=a}return i};function o(i){return i!=="__proto__"&&i!=="constructor"&&i!=="prototype"}return Ai}var Ti,wu;function I0(){if(wu)return Ti;wu=1;var e=Ei(),t=C0(),n=O0(),r=D0();return Ti=function(i,s,a){if(!e(i))throw new TypeError("expected an object");if(typeof s!="string"||a==null)return t.apply(null,arguments);if(typeof a=="string")return r(i,s,a),i;var l=n(i,s);return e(a)&&e(l)&&(a=t({},l,a)),r(i,s,a),i},Ti}var L0=I0();const k0=kr(L0),Di=(...e)=>e.filter(Boolean).join(".");function M0(e){const t=e.split(".");return[t.pop(),t.join(".")||void 0]}function N0(e,t){return Object.entries(Rv(e,t)).reduce((n,[,{value:r,disabled:o,key:i}])=>(n[i]=o?void 0:r,n),{})}function j0(e,t){const n=f.useRef();return ln(e,n.current)||(n.current=e),n.current}function Su(e,t){var n;return f.useMemo(e,(n=j0(t))!==null&&n!==void 0?n:[])}function R0(e){const t=f.useRef(null),n=f.useRef(null),r=f.useRef(!0);return f.useLayoutEffect(()=>{e||(t.current.style.height="0px",t.current.style.overflow="hidden")},[]),f.useEffect(()=>{if(r.current){r.current=!1;return}let o;const i=t.current,s=()=>{e&&(i.style.removeProperty("height"),i.style.removeProperty("overflow"),n.current.scrollIntoView({behavior:"smooth",block:"nearest"}))};i.addEventListener("transitionend",s,{once:!0});const{height:a}=n.current.getBoundingClientRect();return i.style.height=a+"px",e||(i.style.overflow="hidden",o=window.setTimeout(()=>i.style.height="0px",50)),()=>{i.removeEventListener("transitionend",s),clearTimeout(o)}},[e]),{wrapperRef:t,contentRef:n}}const F0=e=>{const[t,n]=f.useState(e.getVisiblePaths());return f.useEffect(()=>{n(e.getVisiblePaths());const r=e.useStore.subscribe(e.getVisiblePaths,n,{equalityFn:zn});return()=>r()},[e]),t};function V0(e,t,n){return e.useStore(o=>{const i=F(F({},n),o.data);return N0(i,t)},zn)}function xu(e=3){const t=f.useRef(null),n=f.useRef(null),[r,o]=f.useState(!1),i=f.useCallback(()=>o(!0),[]),s=f.useCallback(()=>o(!1),[]);return f.useLayoutEffect(()=>{if(r){const{bottom:a,top:l,left:c}=t.current.getBoundingClientRect(),{height:u}=n.current.getBoundingClientRect(),d=a+u>window.innerHeight-40?"up":"down";n.current.style.position="fixed",n.current.style.zIndex="10000",n.current.style.left=c+"px",d==="down"?n.current.style.top=a+e+"px":n.current.style.bottom=window.innerHeight-l+e+"px"}},[e,r]),{popinRef:t,wrapperRef:n,shown:r,show:i,hide:s}}fy([dy]);const B0={rgb:"toRgb",hsl:"toHsl",hsv:"toHsv",hex:"toHex"};ve.extend({color:()=>e=>he(e).isValid()});const z0=e=>ve().color().test(e);function Cu(e,{format:t,hasAlpha:n,isString:r}){const o=B0[t]+(r&&t!=="hex"?"String":""),i=e[o]();return typeof i=="object"&&!n?Fv(i,["a"]):i}const Ou=(e,t)=>{const n=he(e);if(!n.isValid())throw Error("Invalid color");return Cu(n,t)};var H0=Object.freeze({__proto__:null,schema:z0,sanitize:Ou,format:(e,t)=>Cu(he(e),F(F({},t),{},{isString:!0,format:"hex"})),normalize:({value:e})=>{const t=uy(e),n=t==="name"?"hex":t,r=typeof e=="object"?"a"in e:t==="hex"&&e.length===8||/^(rgba)|(hsla)|(hsva)/.test(e),o={format:n,hasAlpha:r,isString:typeof e=="string"};return{value:Ou(e,o),settings:o}}});const U0=j("div",{position:"relative",boxSizing:"border-box",borderRadius:"$sm",overflow:"hidden",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",backgroundColor:"#fff",backgroundImage:`url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill-opacity=".05"><path d="M8 0h8v8H8zM0 8h8v8H0z"/></svg>')`,$inputStyle:"",$hover:"",zIndex:1,variants:{active:{true:{$inputStyle:"$accent1"}}},"&::before":{content:'""',position:"absolute",top:0,bottom:0,right:0,left:0,backgroundColor:"currentColor",zIndex:1}}),W0=j("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto",columnGap:"$colGap",alignItems:"center"}),K0=j("div",{width:"$colorPickerWidth",height:"$colorPickerHeight",".react-colorful":{width:"100%",height:"100%",boxShadow:"$level2",cursor:"crosshair"},".react-colorful__saturation":{borderRadius:"$sm $sm 0 0"},".react-colorful__alpha, .react-colorful__hue":{height:10},".react-colorful__last-control":{borderRadius:"0 0 $sm $sm"},".react-colorful__pointer":{height:12,width:12}});function Pu(e,t){return t!=="rgb"?he(e).toRgb():e}function G0({value:e,displayValue:t,settings:n,onUpdate:r}){const{emitOnEditStart:o,emitOnEditEnd:i}=fe(),{format:s,hasAlpha:a}=n,{popinRef:l,wrapperRef:c,shown:u,show:d,hide:p}=xu(),h=f.useRef(0),[g,m]=f.useState(()=>Pu(e,s)),b=a?yy:_y,v=()=>{m(Pu(e,s)),d(),o()},y=()=>{p(),i(),window.clearTimeout(h.current)},S=()=>{h.current=window.setTimeout(y,500)};return f.useEffect(()=>()=>window.clearTimeout(h.current),[]),f.createElement(f.Fragment,null,f.createElement(U0,{ref:l,active:u,onClick:()=>v(),style:{color:t}}),u&&f.createElement(Ho,null,f.createElement(ac,{onPointerUp:y}),f.createElement(K0,{ref:c,onMouseEnter:()=>window.clearTimeout(h.current),onMouseLeave:w=>w.buttons===0&&S()},f.createElement(b,{color:g,onChange:r}))))}function Y0(){const{value:e,displayValue:t,label:n,onChange:r,onUpdate:o,settings:i}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,n),f.createElement(W0,null,f.createElement(G0,{value:e,displayValue:t,onChange:r,onUpdate:o,settings:i}),f.createElement(Vo,{value:t,onChange:r,onUpdate:o})))}var q0=F({component:Y0},H0);function X0(){const{label:e,displayValue:t,onUpdate:n,settings:r}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(Yo,{value:t,settings:r,onUpdate:n}))}var J0=F({component:X0},gc(["x","y","z"]));const Z0=j("div",{$flexCenter:"",position:"relative",backgroundColor:"$elevation3",borderRadius:"$sm",cursor:"pointer",height:"$rowHeight",width:"$rowHeight",touchAction:"none",$draggable:"",$hover:"","&:active":{cursor:"none"},"&::after":{content:'""',backgroundColor:"$accent2",height:4,width:4,borderRadius:2}}),Q0=j("div",{$flexCenter:"",width:"$joystickWidth",height:"$joystickHeight",borderRadius:"$sm",boxShadow:"$level2",position:"fixed",zIndex:1e4,overflow:"hidden",$draggable:"",transform:"translate(-50%, -50%)",variants:{isOutOfBounds:{true:{backgroundColor:"$elevation1"},false:{backgroundColor:"$elevation3"}}},"> div":{position:"absolute",$flexCenter:"",borderStyle:"solid",borderWidth:1,borderColor:"$highlight1",backgroundColor:"$elevation3",width:"80%",height:"80%","&::after,&::before":{content:'""',position:"absolute",zindex:10,backgroundColor:"$highlight1"},"&::before":{width:"100%",height:1},"&::after":{height:"100%",width:1}},"> span":{position:"relative",zindex:100,width:10,height:10,backgroundColor:"$accent2",borderRadius:"50%"}});function eE({value:e,settings:t,onUpdate:n}){const r=f.useRef(),o=f.useRef(0),i=f.useRef(0),s=f.useRef(1),[a,l]=f.useState(!1),[c,u]=f.useState(!1),[d,p]=cc(),h=f.useRef(null),g=f.useRef(null);f.useLayoutEffect(()=>{if(a){const{top:D,left:P,width:M,height:N}=h.current.getBoundingClientRect();g.current.style.left=P+M/2+"px",g.current.style.top=D+N/2+"px"}},[a]);const{keys:[m,b],joystick:v}=t,y=v==="invertY"?1:-1,{[m]:{step:S},[b]:{step:w}}=t,C=ot("sizes","joystickWidth"),_=ot("sizes","joystickHeight"),x=parseFloat(C)*.8/2,k=parseFloat(_)*.8/2,R=f.useCallback(()=>{r.current||(u(!0),o.current&&p({x:o.current*x}),i.current&&p({y:i.current*-k}),r.current=window.setInterval(()=>{n(D=>{const P=S*o.current*s.current,M=y*w*i.current*s.current;return Array.isArray(D)?{[m]:D[0]+P,[b]:D[1]+M}:{[m]:D[m]+P,[b]:D[b]+M}})},16))},[x,k,n,p,S,w,m,b,y]),O=f.useCallback(()=>{window.clearTimeout(r.current),r.current=void 0,u(!1)},[]);f.useEffect(()=>{function D(P){s.current=Gl(P)}return window.addEventListener("keydown",D),window.addEventListener("keyup",D),()=>{window.clearTimeout(r.current),window.removeEventListener("keydown",D),window.removeEventListener("keyup",D)}},[]);const T=wn(({first:D,active:P,delta:[M,N],movement:[H,z]})=>{D&&l(!0);const I=pt(H,-x,x),A=pt(z,-k,k);o.current=Math.abs(H)>Math.abs(I)?Math.sign(H-I):0,i.current=Math.abs(z)>Math.abs(A)?Math.sign(A-z):0;let U=e[m],W=e[b];P?(o.current||(U+=M*S*s.current,p({x:I})),i.current||(W-=y*N*w*s.current,p({y:A})),o.current||i.current?R():O(),n({[m]:U,[b]:W})):(l(!1),o.current=0,i.current=0,p({x:0,y:0}),O())});return f.createElement(Z0,ee({ref:h},T()),a&&f.createElement(Ho,null,f.createElement(Q0,{ref:g,isOutOfBounds:c},f.createElement("div",null),f.createElement("span",{ref:d}))))}const tE=j("div",{display:"grid",columnGap:"$colGap",variants:{withJoystick:{true:{gridTemplateColumns:"$sizes$rowHeight auto"},false:{gridTemplateColumns:"auto"}}}});function nE(){const{label:e,displayValue:t,onUpdate:n,settings:r}=fe();return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(tE,{withJoystick:!!r.joystick},r.joystick&&f.createElement(eE,{value:t,settings:r,onUpdate:n}),f.createElement(Yo,{value:t,settings:r,onUpdate:n})))}const rE=["joystick"],$u=gc(["x","y"]),oE=e=>{let{joystick:t=!0}=e,n=G(e,rE);const{value:r,settings:o}=$u.normalize(n);return{value:r,settings:F(F({},o),{},{joystick:t})}};var iE=F(F({component:nE},$u),{},{normalize:oE}),sE=Object.freeze({__proto__:null,sanitize:e=>{if(e!==void 0){if(e instanceof File)try{return URL.createObjectURL(e)}catch{return}if(typeof e=="string"&&e.indexOf("blob:")===0)return e;throw Error("Invalid image format [undefined | blob | File].")}},schema:(e,t)=>typeof t=="object"&&"image"in t,normalize:({image:e})=>({value:e})});const aE=j("div",{position:"relative",display:"grid",gridTemplateColumns:"$sizes$rowHeight auto 20px",columnGap:"$colGap",alignItems:"center"}),lE=j("div",{$flexCenter:"",overflow:"hidden",height:"$rowHeight",background:"$elevation3",textAlign:"center",color:"inherit",borderRadius:"$sm",outline:"none",userSelect:"none",cursor:"pointer",$inputStyle:"",$hover:"",$focusWithin:"",$active:"$accent1 $elevation1",variants:{isDragAccept:{true:{$inputStyle:"$accent1",backgroundColor:"$elevation1"}}}}),cE=j("div",{boxSizing:"border-box",borderRadius:"$sm",height:"$rowHeight",width:"$rowHeight",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center",variants:{hasImage:{true:{cursor:"pointer",$hover:"",$active:""}}}}),uE=j("div",{$flexCenter:"",width:"$imagePreviewWidth",height:"$imagePreviewHeight",borderRadius:"$sm",boxShadow:"$level2",pointerEvents:"none",$inputStyle:"",backgroundSize:"cover",backgroundPosition:"center"}),fE=j("div",{fontSize:"0.8em",height:"100%",padding:"$rowGap $md"}),dE=j("div",{$flexCenter:"",top:"0",right:"0",marginRight:"$sm",height:"100%",cursor:"pointer",variants:{disabled:{true:{color:"$elevation3",cursor:"default"}}},"&::after,&::before":{content:'""',position:"absolute",height:2,width:10,borderRadius:1,backgroundColor:"currentColor"},"&::after":{transform:"rotate(45deg)"},"&::before":{transform:"rotate(-45deg)"}});function pE(){const{label:e,value:t,onUpdate:n,disabled:r}=fe(),{popinRef:o,wrapperRef:i,shown:s,show:a,hide:l}=xu(),c=f.useCallback(g=>{g.length&&n(g[0])},[n]),u=f.useCallback(g=>{g.stopPropagation(),n(void 0)},[n]),{getRootProps:d,getInputProps:p,isDragAccept:h}=iu({maxFiles:1,accept:"image/*",onDrop:c,disabled:r});return f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(aE,null,f.createElement(cE,{ref:o,hasImage:!!t,onPointerDown:()=>!!t&&a(),onPointerUp:l,style:{backgroundImage:t?`url(${t})`:"none"}}),s&&!!t&&f.createElement(Ho,null,f.createElement(ac,{onPointerUp:l,style:{cursor:"pointer"}}),f.createElement(uE,{ref:i,style:{backgroundImage:`url(${t})`}})),f.createElement(lE,d({isDragAccept:h}),f.createElement("input",p()),f.createElement(fE,null,h?"drop image":"click or drop")),f.createElement(dE,{onClick:u,disabled:!t})))}var hE=F({component:pE},sE);const Au=ve().number(),gE=(e,t)=>ve().array().length(2).every.number().test(e)&&ve().schema({min:Au,max:Au}).test(t),wr=e=>({min:e[0],max:e[1]}),Tu=(e,{bounds:[t,n]},r)=>{const o=Array.isArray(e)?wr(e):e,i={min:r[0],max:r[1]},{min:s,max:a}=F(F({},i),o);return[pt(Number(s),t,Math.max(t,a)),pt(Number(a),Math.min(n,s),n)]};var mE=Object.freeze({__proto__:null,schema:gE,format:wr,sanitize:Tu,normalize:({value:e,min:t,max:n})=>{const r={min:t,max:n},o=hc(wr(e),{min:r,max:r}),i=[t,n],s=F(F({},o),{},{bounds:i});return{value:Tu(wr(e),s,e),settings:s}}});const vE=["value","bounds","onDrag"],bE=["bounds"],yE=j("div",{display:"grid",columnGap:"$colGap",gridTemplateColumns:"auto calc($sizes$numberInputMinWidth * 2 + $space$rowGap)"});function EE(e){let{value:t,bounds:[n,r],onDrag:o}=e,i=G(e,vE);const s=f.useRef(null),a=f.useRef(null),l=f.useRef(null),c=f.useRef(0),u=ot("sizes","scrubberWidth"),d=wn(({event:g,first:m,xy:[b],movement:[v],memo:y={}})=>{if(m){const{width:w,left:C}=s.current.getBoundingClientRect();c.current=w-parseFloat(u);const _=(g==null?void 0:g.target)===a.current||(g==null?void 0:g.target)===l.current;y.pos=ur((b-C)/w,n,r);const x=Math.abs(y.pos-t.min)-Math.abs(y.pos-t.max);y.key=x<0||x===0&&y.pos<=t.min?"min":"max",_&&(y.pos=t[y.key])}const S=y.pos+ur(v/c.current,0,r-n);return o({[y.key]:Ob(S,i[y.key])}),y}),p=`calc(${cr(t.min,n,r)} * (100% - ${u} - 8px) + 4px)`,h=`calc(${1-cr(t.max,n,r)} * (100% - ${u} - 8px) + 4px)`;return f.createElement(fc,ee({ref:s},d()),f.createElement(uc,null,f.createElement(dc,{style:{left:p,right:h}})),f.createElement(Ko,{position:"left",ref:a,style:{left:p}}),f.createElement(Ko,{position:"right",ref:l,style:{right:h}}))}function _E(){const{label:e,displayValue:t,onUpdate:n,settings:r}=fe(),o=G(r,bE);return f.createElement(f.Fragment,null,f.createElement(Te,{input:!0},f.createElement(Le,null,e),f.createElement(yE,null,f.createElement(EE,ee({value:t},r,{onDrag:n})),f.createElement(Yo,{value:t,settings:o,onUpdate:n,innerLabelTrim:0}))))}var wE=F({component:_E},mE);const SE=()=>{const e=new Map;return{on:(t,n)=>{let r=e.get(t);r===void 0&&(r=new Set,e.set(t,r)),r.add(n)},off:(t,n)=>{const r=e.get(t);r!==void 0&&(r.delete(n),r.size===0&&e.delete(t))},emit:(t,...n)=>{const r=e.get(t);if(r!==void 0)for(const o of r)o(...n)}}},xE=["type","value"],CE=["onChange","transient","onEditStart","onEditEnd"],OE=function(){const t=_0(w0(()=>({data:{}}))),n=SE();this.storeId=jv(),this.useStore=t;const r={},o=new Set;this.getVisiblePaths=()=>{const s=this.getData(),a=Object.keys(s),l=[];Object.entries(r).forEach(([u,d])=>{d.render&&a.some(p=>p.indexOf(u)===0)&&!d.render(this.get)&&l.push(u+".")});const c=[];return o.forEach(u=>{u in s&&s[u].__refCount>0&&l.every(d=>u.indexOf(d)===-1)&&(!s[u].render||s[u].render(this.get))&&c.push(u)}),c},this.setOrderedPaths=s=>{s.forEach(a=>o.add(a))},this.orderPaths=s=>(this.setOrderedPaths(s),s),this.disposePaths=s=>{t.setState(a=>{const l=a.data;return s.forEach(c=>{if(c in l){const u=l[c];u.__refCount--,u.__refCount===0&&u.type in nt&&delete l[c]}}),{data:l}})},this.dispose=()=>{t.setState(()=>({data:{}}))},this.getFolderSettings=s=>r[s]||{},this.getData=()=>t.getState().data,this.addData=(s,a)=>{t.setState(l=>{const c=l.data;return Object.entries(s).forEach(([u,d])=>{let p=c[u];if(p){const{type:h,value:g}=d,m=G(d,xE);h!==p.type?et(re.INPUT_TYPE_OVERRIDE,u,p.type,h):((p.__refCount===0||a)&&Object.assign(p,m),p.__refCount++)}else c[u]=F(F({},d),{},{__refCount:1})}),{data:c}})},this.setValueAtPath=(s,a,l)=>{t.setState(c=>{const u=c.data;return Ul(u[s],a,s,this,l),{data:u}})},this.setSettingsAtPath=(s,a)=>{t.setState(l=>{const c=l.data;return c[s].settings=F(F({},c[s].settings),a),{data:c}})},this.disableInputAtPath=(s,a)=>{t.setState(l=>{const c=l.data;return c[s].disabled=a,{data:c}})},this.set=(s,a)=>{t.setState(l=>{const c=l.data;return Object.entries(s).forEach(([u,d])=>{try{Ul(c[u],d,void 0,void 0,a)}catch{}}),{data:c}})},this.getInput=s=>{try{return this.getData()[s]}catch{et(re.PATH_DOESNT_EXIST,s)}},this.get=s=>{var a;return(a=this.getInput(s))===null||a===void 0?void 0:a.value},this.emitOnEditStart=s=>{n.emit(`onEditStart:${s}`,this.get(s),s,F(F({},this.getInput(s)),{},{get:this.get}))},this.emitOnEditEnd=s=>{n.emit(`onEditEnd:${s}`,this.get(s),s,F(F({},this.getInput(s)),{},{get:this.get}))},this.subscribeToEditStart=(s,a)=>{const l=`onEditStart:${s}`;return n.on(l,a),()=>n.off(l,a)},this.subscribeToEditEnd=(s,a)=>{const l=`onEditEnd:${s}`;return n.on(l,a),()=>n.off(l,a)};const i=(s,a,l)=>{const c={};return Object.entries(s).forEach(([u,d])=>{if(u==="")return et(re.EMPTY_KEY);let p=Di(a,u);if(d.type===nt.FOLDER){const h=i(d.schema,p,l);Object.assign(c,h),p in r||(r[p]=d.settings)}else if(u in l)et(re.DUPLICATE_KEYS,u,p,l[u].path);else{const h=Wv(d,u,p,c);if(h){const{type:g,options:m,input:b}=h,{onChange:v,transient:y,onEditStart:S,onEditEnd:w}=m,C=G(m,CE);c[p]=F(F(F({type:g},C),b),{},{fromPanel:!0}),l[u]={path:p,onChange:v,transient:y,onEditStart:S,onEditEnd:w}}else et(re.UNKNOWN_INPUT,p,d)}}),c};this.getDataFromSchema=s=>{const a={};return[i(s,"",a),a]}},Du=new OE,PE={collapsed:!1};function $E(e,t){return{type:nt.FOLDER,schema:e,settings:F(F({},PE),t)}}const Iu=e=>"__levaInput"in e,AE=(e,t)=>{const n={},r=t?t.toLowerCase():null;return e.forEach(o=>{const[i,s]=M0(o);(!r||i.toLowerCase().indexOf(r)>-1)&&k0(n,s,{[i]:{__levaInput:!0,path:o}})}),n},TE=["type","label","path","valueKey","value","settings","setValue","disabled"];function DE(e){let{type:t,label:n,path:r,valueKey:o,value:i,settings:s,setValue:a,disabled:l}=e,c=G(e,TE);const{displayValue:u,onChange:d,onUpdate:p}=lc({type:t,value:i,settings:s,setValue:a}),h=St[t].component;return h?f.createElement(Zl.Provider,{value:F({key:o,path:r,id:""+r,label:n,displayValue:u,value:i,onChange:d,onUpdate:p,settings:s,setValue:a,disabled:l},c)},f.createElement(ub,{disabled:l},f.createElement(h,null))):(et(re.NO_COMPONENT_FOR_TYPE,t,r),null)}const IE=j("button",{display:"block",$reset:"",fontWeight:"$button",height:"$rowHeight",borderStyle:"none",borderRadius:"$sm",backgroundColor:"$elevation1",color:"$highlight1","&:not(:disabled)":{color:"$highlight3",backgroundColor:"$accent2",cursor:"pointer",$hover:"$accent3",$active:"$accent3 $accent1",$focus:""}});function LE({onClick:e,settings:t,label:n}){const r=yn();return f.createElement(Te,null,f.createElement(IE,{disabled:t.disabled,onClick:()=>e(r.get)},n))}const kE=j("div",{$flex:"",justifyContent:"flex-end",gap:"$colGap"}),ME=j("button",{$reset:"",cursor:"pointer",borderRadius:"$xs","&:hover":{backgroundColor:"$elevation3"}}),NE=({label:e,opts:t})=>{let n=typeof e=="string"&&e.trim()===""?null:e,r=t;return typeof t.opts=="object"&&(r.label!==void 0&&(n=t.label),r=t.opts),{label:n,opts:r}};function jE(e){const{label:t,opts:n}=NE(e),r=yn();return f.createElement(Te,{input:!!t},t&&f.createElement(Le,null,t),f.createElement(kE,null,Object.entries(n).map(([o,i])=>f.createElement(ME,{key:o,onClick:()=>i(r.get)},o))))}const RE=j("canvas",{height:"$monitorHeight",width:"100%",display:"block",borderRadius:"$sm"}),Lu=100;function FE(e,t){e.push(t),e.length>Lu&&e.shift()}const VE=f.forwardRef(function({initialValue:e},t){const n=ot("colors","highlight3"),r=ot("colors","elevation2"),o=ot("colors","highlight1"),[i,s]=f.useMemo(()=>[he(o).alpha(.4).toRgbString(),he(o).alpha(.1).toRgbString()],[o]),a=f.useRef([e]),l=f.useRef(e),c=f.useRef(e),u=f.useRef(),d=f.useCallback((g,m)=>{if(!g)return;const{width:b,height:v}=g,y=new Path2D,S=b/Lu,w=v*.05;for(let x=0;x<a.current.length;x++){const k=cr(a.current[x],l.current,c.current),R=S*x,O=v-k*(v-w*2)-w;y.lineTo(R,O)}m.clearRect(0,0,b,v);const C=new Path2D(y);C.lineTo(S*(a.current.length+1),v),C.lineTo(0,v),C.lineTo(0,0);const _=m.createLinearGradient(0,0,0,v);_.addColorStop(0,i),_.addColorStop(1,s),m.fillStyle=_,m.fill(C),m.strokeStyle=r,m.lineJoin="round",m.lineWidth=14,m.stroke(y),m.strokeStyle=n,m.lineWidth=2,m.stroke(y)},[n,r,i,s]),[p,h]=yb(d);return f.useImperativeHandle(t,()=>({frame:g=>{(l.current===void 0||g<l.current)&&(l.current=g),(c.current===void 0||g>c.current)&&(c.current=g),FE(a.current,g),u.current=requestAnimationFrame(()=>d(p.current,h.current))}}),[p,h,d]),f.useEffect(()=>()=>cancelAnimationFrame(u.current),[]),f.createElement(RE,{ref:p})}),ku=e=>Number.isFinite(e)?e.toPrecision(2):e.toString(),BE=f.forwardRef(function({initialValue:e},t){const[n,r]=f.useState(ku(e));return f.useImperativeHandle(t,()=>({frame:o=>r(ku(o))}),[]),f.createElement("div",null,n)});function Mu(e){return typeof e=="function"?e():e.current}function zE({label:e,objectOrFn:t,settings:n}){const r=f.useRef(),o=f.useRef(Mu(t));return f.useEffect(()=>{const i=window.setInterval(()=>{var s;document.hidden||(s=r.current)===null||s===void 0||s.frame(Mu(t))},n.interval);return()=>window.clearInterval(i)},[t,n.interval]),f.createElement(Te,{input:!0},f.createElement(Le,{align:"top"},e),n.graph?f.createElement(VE,{ref:r,initialValue:o.current}):f.createElement(BE,{ref:r,initialValue:o.current}))}const HE=["type","label","key"],UE={[nt.BUTTON]:LE,[nt.BUTTON_GROUP]:jE,[nt.MONITOR]:zE},WE=f.memo(({path:e})=>{const[t,{set:n,setSettings:r,disable:o,storeId:i,emitOnEditStart:s,emitOnEditEnd:a}]=_b(e);if(!t)return null;const{type:l,label:c,key:u}=t,d=G(t,HE);if(l in nt){const p=UE[l];return f.createElement(p,ee({label:c,path:e},d))}return l in St?f.createElement(DE,ee({key:i+e,type:l,label:c,storeId:i,path:e,valueKey:u,setValue:n,setSettings:r,disable:o,emitOnEditStart:s,emitOnEditEnd:a},d)):(Pv(re.UNSUPPORTED_INPUT,l,e),null)});function KE({toggle:e,toggled:t,name:n}){return f.createElement(ab,{onClick:()=>e()},f.createElement(Uo,{toggled:t}),f.createElement("div",null,n))}const GE=({name:e,path:t,tree:n})=>{const r=yn(),o=Di(t,e),{collapsed:i,color:s}=r.getFolderSettings(o),[a,l]=f.useState(!i),c=f.useRef(null),u=ot("colors","folderWidgetColor"),d=ot("colors","folderTextColor");return f.useLayoutEffect(()=>{c.current.style.setProperty("--leva-colors-folderWidgetColor",s||u),c.current.style.setProperty("--leva-colors-folderTextColor",s||d)},[s,u,d]),f.createElement(dr,{ref:c},f.createElement(KE,{name:e,toggled:a,toggle:()=>l(p=>!p)}),f.createElement(Nu,{parent:o,tree:n,toggled:a}))},Nu=f.memo(({isRoot:e=!1,fill:t=!1,flat:n=!1,parent:r,tree:o,toggled:i})=>{const{wrapperRef:s,contentRef:a}=R0(i),l=yn(),c=([d,p])=>{var h;return(Iu(p)?(h=l.getInput(p.path))===null||h===void 0?void 0:h.order:l.getFolderSettings(Di(r,d)).order)||0},u=Object.entries(o).sort((d,p)=>c(d)-c(p));return f.createElement(Bo,{ref:s,isRoot:e,fill:t,flat:n},f.createElement(oc,{ref:a,isRoot:e,toggled:i},u.map(([d,p])=>Iu(p)?f.createElement(WE,{key:p.path,valueKey:p.valueKey,path:p.path}):f.createElement(GE,{key:d,name:d,path:r,tree:p}))))}),YE=j("div",{position:"relative",fontFamily:"$mono",fontSize:"$root",color:"$rootText",backgroundColor:"$elevation1",variants:{fill:{false:{position:"fixed",top:"10px",right:"10px",zIndex:1e3,width:"$rootWidth"},true:{position:"relative",width:"100%"}},flat:{false:{borderRadius:"$lg",boxShadow:"$level1"}},oneLineLabels:{true:{[`${sc}`]:{gridTemplateColumns:"auto",gridAutoColumns:"minmax(max-content, 1fr)",gridAutoRows:"minmax($sizes$rowHeight), auto)",rowGap:0,columnGap:0,marginTop:"$rowGap"}}},hideTitleBar:{true:{$$titleBarHeight:"0px"},false:{$$titleBarHeight:"$sizes$titleBarHeight"}}},"&,*,*:after,*:before":{boxSizing:"border-box"},"*::selection":{backgroundColor:"$accent2"}}),ju=40,Sr=j("i",{$flexCenter:"",width:ju,userSelect:"none",cursor:"pointer","> svg":{fill:"$highlight1",transition:"transform 350ms ease, fill 250ms ease"},"&:hover > svg":{fill:"$highlight3"},variants:{active:{true:{"> svg":{fill:"$highlight2"}}}}}),qE=j("div",{display:"flex",alignItems:"stretch",justifyContent:"space-between",height:"$titleBarHeight",variants:{mode:{drag:{cursor:"grab"}}}}),XE=j("div",{$flex:"",position:"relative",width:"100%",overflow:"hidden",transition:"height 250ms ease",color:"$highlight3",paddingLeft:"$md",[`> ${Sr}`]:{height:30},variants:{toggled:{true:{height:30},false:{height:0}}}}),JE=j("input",{$reset:"",flex:1,position:"relative",height:30,width:"100%",backgroundColor:"transparent",fontSize:"10px",borderRadius:"$root","&:focus":{},"&::placeholder":{color:"$highlight2"}}),ZE=j("div",{touchAction:"none",$flexCenter:"",flex:1,"> svg":{fill:"$highlight1"},color:"$highlight1",variants:{drag:{true:{$draggable:"","> svg":{transition:"fill 250ms ease"},"&:hover":{color:"$highlight3"},"&:hover > svg":{fill:"$highlight3"}}},filterEnabled:{false:{paddingRight:ju}}}}),QE=f.forwardRef(({setFilter:e,toggle:t},n)=>{const[r,o]=f.useState(""),i=f.useMemo(()=>Kl(e,250),[e]),s=()=>{e(""),o("")},a=l=>{const c=l.currentTarget.value;t(!0),o(c)};return f.useEffect(()=>{i(r)},[r,i]),f.createElement(f.Fragment,null,f.createElement(JE,{ref:n,value:r,placeholder:"[Open filter with CMD+SHIFT+L]",onPointerDown:l=>l.stopPropagation(),onChange:a}),f.createElement(Sr,{onClick:()=>s(),style:{visibility:r?"visible":"hidden"}},f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"14",width:"14",viewBox:"0 0 20 20",fill:"currentColor"},f.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",clipRule:"evenodd"}))))});function e1({setFilter:e,onDrag:t,onDragStart:n,onDragEnd:r,toggle:o,toggled:i,title:s,drag:a,filterEnabled:l,from:c}){const[u,d]=f.useState(!1),p=f.useRef(null);f.useEffect(()=>{var g,m;u?(g=p.current)===null||g===void 0||g.focus():(m=p.current)===null||m===void 0||m.blur()},[u]);const h=wn(({offset:[g,m],first:b,last:v})=>{t({x:g,y:m}),b&&n({x:g,y:m}),v&&r({x:g,y:m})},{filterTaps:!0,from:({offset:[g,m]})=>[(c==null?void 0:c.x)||g,(c==null?void 0:c.y)||m]});return f.useEffect(()=>{const g=m=>{m.key==="L"&&m.shiftKey&&m.metaKey&&d(b=>!b)};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]),f.createElement(f.Fragment,null,f.createElement(qE,{mode:a?"drag":void 0},f.createElement(Sr,{active:!i,onClick:()=>o()},f.createElement(Uo,{toggled:i,width:12,height:8})),f.createElement(ZE,ee({},a?h():{},{drag:a,filterEnabled:l}),s===void 0&&a?f.createElement("svg",{width:"20",height:"10",viewBox:"0 0 28 14",xmlns:"http://www.w3.org/2000/svg"},f.createElement("circle",{cx:"2",cy:"2",r:"2"}),f.createElement("circle",{cx:"14",cy:"2",r:"2"}),f.createElement("circle",{cx:"26",cy:"2",r:"2"}),f.createElement("circle",{cx:"2",cy:"12",r:"2"}),f.createElement("circle",{cx:"14",cy:"12",r:"2"}),f.createElement("circle",{cx:"26",cy:"12",r:"2"})):s),l&&f.createElement(Sr,{active:u,onClick:()=>d(g=>!g)},f.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",height:"20",viewBox:"0 0 20 20"},f.createElement("path",{d:"M9 9a2 2 0 114 0 2 2 0 01-4 0z"}),f.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm1-13a4 4 0 00-3.446 6.032l-2.261 2.26a1 1 0 101.414 1.415l2.261-2.261A4 4 0 1011 5z",clipRule:"evenodd"})))),f.createElement(XE,{toggled:u},f.createElement(QE,{ref:p,setFilter:e,toggle:o})))}const t1=["store","hidden","theme","collapsed"];function n1(e){let{store:t,hidden:n=!1,theme:r,collapsed:o=!1}=e,i=G(e,t1);const s=Su(()=>tb(r),[r]),[a,l]=f.useState(!o),c=typeof o=="object"?!o.collapsed:a,u=f.useMemo(()=>typeof o=="object"?d=>{typeof d=="function"?o.onChange(!d(!o.collapsed)):o.onChange(!d)}:l,[o]);return!t||n?null:f.createElement(Fo.Provider,{value:s},f.createElement(r1,ee({store:t},i,{toggled:c,setToggle:u,rootClass:s.className})))}const r1=f.memo(({store:e,rootClass:t,fill:n=!1,flat:r=!1,neverHide:o=!1,oneLineLabels:i=!1,titleBar:s={title:void 0,drag:!0,filter:!0,position:void 0,onDrag:void 0,onDragStart:void 0,onDragEnd:void 0},hideCopyButton:a=!1,toggled:l,setToggle:c})=>{var u,d;const p=F0(e),[h,g]=f.useState(""),m=f.useMemo(()=>AE(p,h),[p,h]),[b,v]=cc(),y=o||p.length>0,S=typeof s=="object"&&s.title||void 0,w=typeof s=="object"&&(u=s.drag)!==null&&u!==void 0?u:!0,C=typeof s=="object"&&(d=s.filter)!==null&&d!==void 0?d:!0,_=typeof s=="object"&&s.position||void 0,x=typeof s=="object"&&s.onDrag||void 0,k=typeof s=="object"&&s.onDragStart||void 0,R=typeof s=="object"&&s.onDragEnd||void 0;return f.useEffect(()=>{v({x:_==null?void 0:_.x,y:_==null?void 0:_.y})},[_,v]),eb(),f.createElement(gv,null,f.createElement(ec.Provider,{value:{hideCopyButton:a}},f.createElement(YE,{ref:b,className:t,fill:n,flat:r,oneLineLabels:i,hideTitleBar:!s,style:{display:y?"block":"none"}},s&&f.createElement(e1,{onDrag:O=>{v(O),x==null||x(O)},onDragStart:O=>k==null?void 0:k(O),onDragEnd:O=>R==null?void 0:R(O),setFilter:g,toggle:O=>c(T=>O!=null?O:!T),toggled:l,title:S,drag:w,filterEnabled:C,from:_}),y&&f.createElement(Ql.Provider,{value:e},f.createElement(Nu,{isRoot:!0,fill:n,flat:r,tree:m,toggled:l})))))}),o1=["isRoot"];let xr=!1,xt=null;function i1(e){let{isRoot:t=!1}=e,n=G(e,o1);return f.useEffect(()=>(xr=!0,!t&&xt&&(xt.remove(),xt=null),()=>{t||(xr=!1)}),[t]),f.createElement(n1,ee({store:Du},n))}function s1(e){f.useEffect(()=>{e&&!xr&&(xt||(xt=document.getElementById("leva__root")||Object.assign(document.createElement("div"),{id:"leva__root"}),document.body&&(document.body.appendChild(xt),Pt.createRoot(xt).render(f.createElement(i1,{isRoot:!0})))),xr=!0)},[e])}function a1(e,t,n,r,o){let i,s,a,l,c;return typeof e=="string"?(s=e,i=t,Array.isArray(n)&&(c=n)):(i=e,Array.isArray(t)?c=t:(l=t,c=n)),{schema:i,folderName:s,folderSettings:a,hookSettings:l,deps:c||[]}}function l1(e,t,n,r,o){const{folderName:i,schema:s,folderSettings:a,hookSettings:l,deps:c}=a1(e,t,n),u=typeof s=="function",d=f.useRef(!1),p=f.useRef(!0),h=Su(()=>{d.current=!0;const T=typeof s=="function"?s():s;return i?{[i]:$E(T,a)}:T},c),g=!(l!=null&&l.store);s1(g);const[m]=f.useState(()=>(l==null?void 0:l.store)||Du),[b,v]=f.useMemo(()=>m.getDataFromSchema(h),[m,h]),[y,S,w,C,_]=f.useMemo(()=>{const T=[],D=[],P={},M={},N={};return Object.values(v).forEach(({path:H,onChange:z,onEditStart:I,onEditEnd:A,transient:U})=>{T.push(H),z?(P[H]=z,U||D.push(H)):D.push(H),I&&(M[H]=I),A&&(N[H]=A)}),[T,D,P,M,N]},[v]),x=f.useMemo(()=>m.orderPaths(y),[y,m]),k=V0(m,S,b),R=f.useCallback(T=>{const D=Object.entries(T).reduce((P,[M,N])=>Object.assign(P,{[v[M].path]:N}),{});m.set(D,!1)},[m,v]),O=f.useCallback(T=>m.get(v[T].path),[m,v]);return f.useEffect(()=>{const T=!p.current&&d.current;return m.addData(b,T),p.current=!1,d.current=!1,()=>m.disposePaths(x)},[m,x,b]),f.useEffect(()=>{const T=[];return Object.entries(w).forEach(([D,P])=>{P(m.get(D),D,F({initial:!0,get:m.get},m.getInput(D)));const M=m.useStore.subscribe(N=>{const H=N.data[D];return[H.disabled?void 0:H.value,H]},([N,H])=>P(N,D,F({initial:!1,get:m.get},H)),{equalityFn:zn});T.push(M)}),()=>T.forEach(D=>D())},[m,w]),f.useEffect(()=>{const T=[];return Object.entries(C).forEach(([D,P])=>T.push(m.subscribeToEditStart(D,P))),Object.entries(_).forEach(([D,P])=>T.push(m.subscribeToEditEnd(D,P))),()=>T.forEach(D=>D())},[C,_,m]),u?[k,R,O]:k}tt(rt.SELECT,kb),tt(rt.IMAGE,hE),tt(rt.NUMBER,$b),tt(rt.COLOR,q0),tt(rt.STRING,Vb),tt(rt.BOOLEAN,Wb),tt(rt.INTERVAL,wE),tt(rt.VECTOR3D,J0),tt(rt.VECTOR2D,iE);function Cr(e){return!!(e&&e.bindable)}function Ru(e){return(e||[]).reduce((t,n)=>(Cr(n)&&(t[n.name]=n.value),t),{})}function Fu(e){return(e||[]).filter(t=>!t.isEvent&&!Cr(t)).map(t=>t.name)}function Vu(e){return(e||[]).filter(Cr)}function Bu(e,t){const n=t||{};return Vu(e).reduce((r,o)=>(r[o.name]={value:Object.prototype.hasOwnProperty.call(n,o.name)?n[o.name]:o.value,label:o.description||o.name,...o.control||{}},r),{})}function Ii({compName:e,schema:t,value:n,onChange:r,className:o}){const i=f.useMemo(()=>Bu(t,n),[t,n]),s=f.useMemo(()=>Fu(t),[t]),a=l1(i);return f.useEffect(()=>{r==null||r(a)},[a]),B.jsx("div",{className:`props-panel${o?` ${o}`:""}`,children:s.length>0&&B.jsxs("p",{className:"props-panel__hint",children:["复杂类型暂未生成控件:",s.join("、")]})})}function c1(e){return e?Object.entries(e).reduce((t,[n,r])=>{const o=/^on[A-Z]/.test(n)?n:`on${n.charAt(0).toUpperCase()}${n.slice(1)}`;return t[o]=r,t},{}):{}}function u1(e){return e?/<[a-z][\s\S]*>/i.test(e)?B.jsx("span",{dangerouslySetInnerHTML:{__html:e}}):e:null}function Li({components:e,schemas:t,presets:n={},listeners:r={},stageClasses:o={},stageStyles:i={},slotHtml:s={}}){const a=f.useMemo(()=>Object.keys(t).filter(_=>e[_]),[t,e]),[l,c]=f.useState(""),[u,d]=f.useState({}),[p,h]=f.useState(0);f.useEffect(()=>{!a.includes(l)&&a.length&&S(a[0])},[a]);const g=t[l]||[],m=e[l],b=n[l]||{},v=c1(r[l]),y=s[l]||{};function S(_){if(_===l)return;c(_);const x=n[_]||{};d({...Ru(t[_]||[]),...x})}const w=()=>h(_=>_+1);if(!a.length)return B.jsx("p",{className:"props-playground__empty",children:"PropsPlayground 需要 components(组件映射)和 schemas(propsSchema 映射)两个 props"});const C={...b,...u};return B.jsxs("div",{className:"props-playground",children:[B.jsxs("div",{className:"props-playground__bar",children:[B.jsx("div",{className:"props-playground__tabs",children:a.map(_=>B.jsx("button",{type:"button",className:`props-playground__tab${_===l?" is-active":""}`,onClick:()=>S(_),children:_},_))}),B.jsx("button",{type:"button",className:"props-playground__action",onClick:w,children:"重新挂载"})]}),B.jsxs("div",{className:"props-playground__body",children:[B.jsx("div",{className:`props-playground__stage${o[l]?` ${o[l]}`:""}`,style:i[l],children:m?B.jsx(m,{...C,...v,children:u1(y.default)},`${l}-${p}`):B.jsxs("p",{className:"props-playground__empty",children:["组件 ",l," 未导出"]})}),B.jsx(Ii,{className:"props-playground__panel",compName:l,schema:g,value:u,onChange:d},l)]})]})}const f1=Object.freeze(Object.defineProperty({__proto__:null,PropsPanel:Ii,PropsPlayground:Li,bindableProps:Vu,complexPropNames:Fu,createValues:Ru,default:{PropsPanel:Ii,PropsPlayground:Li},isBindable:Cr,toLevaSchema:Bu},Symbol.toStringTag,{value:"Module"})),d1=e=>B.jsx("div",{style:{padding:24,fontSize:`${e.size}px`},children:e.label}),p1=[{name:"label",type:"string",description:"文案",default:'"hello"',required:!1,version:"",isEvent:!1,bindable:!0,value:"hello"},{name:"size",type:"number",description:"字号",default:"16",required:!1,version:"",isEvent:!1,bindable:!0,value:16,control:{min:12,max:48,step:1}}],zu=document.getElementById("container")||document.getElementById("root");zu&&Pt.createRoot(zu).render(B.jsx(Li,{components:{Toy:d1},schemas:{Toy:p1}}));const h1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}))}));
|
|
80
|
+
//# sourceMappingURL=index-DMdT4ab7.js.map
|