setta 0.0.5.dev2__py3-none-any.whl → 0.0.5.dev3__py3-none-any.whl

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.

Potentially problematic release.


This version of setta might be problematic. Click here for more details.

@@ -88,7 +88,7 @@ function print() { __p += __j.call(arguments, '') }
88
88
  `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){const r=new this(e);return n.forEach(i=>r.set(i)),r}static accessor(e){const r=(this[Vz]=this[Vz]={accessors:{}}).accessors,i=this.prototype;function s(o){const a=Wg(o);r[a]||(JTe(i,o),r[a]=!0)}return Ie.isArray(e)?e.forEach(s):s(e),this}}_5.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);Ie.reduceDescriptors(_5.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(r){this[n]=r}}});Ie.freezeMethods(_5);const Dc=_5;function _6(t,e){const n=this||u$,r=e||n,i=Dc.from(r.headers);let s=r.data;return Ie.forEach(t,function(a){s=a.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function pte(t){return!!(t&&t.__CANCEL__)}function Sy(t,e,n){tn.call(this,t??"canceled",tn.ERR_CANCELED,e,n),this.name="CanceledError"}Ie.inherits(Sy,tn,{__CANCEL__:!0});function ePe(t,e,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?t(n):e(new tn("Request failed with status code "+n.status,[tn.ERR_BAD_REQUEST,tn.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}const tPe=pl.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];Ie.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Ie.isString(r)&&o.push("path="+r),Ie.isString(i)&&o.push("domain="+i),s===!0&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function nPe(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function rPe(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function mte(t,e){return t&&!nPe(e)?rPe(t,e):e}const iPe=pl.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function i(s){let o=s;return e&&(n.setAttribute("href",o),o=n.href),n.setAttribute("href",o),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=i(window.location.href),function(o){const a=Ie.isString(o)?i(o):o;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}();function sPe(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function oPe(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i=0,s=0,o;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[s];o||(o=c),n[i]=l,r[i]=c;let f=s,h=0;for(;f!==i;)h+=n[f++],f=f%t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),c-o<e)return;const d=u&&c-u;return d?Math.round(h*1e3/d):void 0}}function Uz(t,e){let n=0;const r=oPe(50,250);return i=>{const s=i.loaded,o=i.lengthComputable?i.total:void 0,a=s-n,l=r(a),c=s<=o;n=s;const u={loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&c?(o-s)/l:void 0,event:i};u[e?"download":"upload"]=!0,t(u)}}const aPe=typeof XMLHttpRequest<"u",lPe=aPe&&function(t){return new Promise(function(n,r){let i=t.data;const s=Dc.from(t.headers).normalize();let{responseType:o,withXSRFToken:a}=t,l;function c(){t.cancelToken&&t.cancelToken.unsubscribe(l),t.signal&&t.signal.removeEventListener("abort",l)}let u;if(Ie.isFormData(i)){if(pl.hasStandardBrowserEnv||pl.hasStandardBrowserWebWorkerEnv)s.setContentType(!1);else if((u=s.getContentType())!==!1){const[g,...m]=u?u.split(";").map(v=>v.trim()).filter(Boolean):[];s.setContentType([g||"multipart/form-data",...m].join("; "))}}let f=new XMLHttpRequest;if(t.auth){const g=t.auth.username||"",m=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";s.set("Authorization","Basic "+btoa(g+":"+m))}const h=mte(t.baseURL,t.url);f.open(t.method.toUpperCase(),ute(h,t.params,t.paramsSerializer),!0),f.timeout=t.timeout;function d(){if(!f)return;const g=Dc.from("getAllResponseHeaders"in f&&f.getAllResponseHeaders()),v={data:!o||o==="text"||o==="json"?f.responseText:f.response,status:f.status,statusText:f.statusText,headers:g,config:t,request:f};ePe(function(b){n(b),c()},function(b){r(b),c()},v),f=null}if("onloadend"in f?f.onloadend=d:f.onreadystatechange=function(){!f||f.readyState!==4||f.status===0&&!(f.responseURL&&f.responseURL.indexOf("file:")===0)||setTimeout(d)},f.onabort=function(){f&&(r(new tn("Request aborted",tn.ECONNABORTED,t,f)),f=null)},f.onerror=function(){r(new tn("Network Error",tn.ERR_NETWORK,t,f)),f=null},f.ontimeout=function(){let m=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const v=t.transitional||fte;t.timeoutErrorMessage&&(m=t.timeoutErrorMessage),r(new tn(m,v.clarifyTimeoutError?tn.ETIMEDOUT:tn.ECONNABORTED,t,f)),f=null},pl.hasStandardBrowserEnv&&(a&&Ie.isFunction(a)&&(a=a(t)),a||a!==!1&&iPe(h))){const g=t.xsrfHeaderName&&t.xsrfCookieName&&tPe.read(t.xsrfCookieName);g&&s.set(t.xsrfHeaderName,g)}i===void 0&&s.setContentType(null),"setRequestHeader"in f&&Ie.forEach(s.toJSON(),function(m,v){f.setRequestHeader(v,m)}),Ie.isUndefined(t.withCredentials)||(f.withCredentials=!!t.withCredentials),o&&o!=="json"&&(f.responseType=t.responseType),typeof t.onDownloadProgress=="function"&&f.addEventListener("progress",Uz(t.onDownloadProgress,!0)),typeof t.onUploadProgress=="function"&&f.upload&&f.upload.addEventListener("progress",Uz(t.onUploadProgress)),(t.cancelToken||t.signal)&&(l=g=>{f&&(r(!g||g.type?new Sy(null,t,f):g),f.abort(),f=null)},t.cancelToken&&t.cancelToken.subscribe(l),t.signal&&(t.signal.aborted?l():t.signal.addEventListener("abort",l)));const p=sPe(h);if(p&&pl.protocols.indexOf(p)===-1){r(new tn("Unsupported protocol "+p+":",tn.ERR_BAD_REQUEST,t));return}f.send(i||null)})},OT={http:$Te,xhr:lPe};Ie.forEach(OT,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch{}Object.defineProperty(t,"adapterName",{value:e})}});const qz=t=>`- ${t}`,cPe=t=>Ie.isFunction(t)||t===null||t===!1,gte={getAdapter:t=>{t=Ie.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){n=t[s];let o;if(r=n,!cPe(n)&&(r=OT[(o=String(n)).toLowerCase()],r===void 0))throw new tn(`Unknown adapter '${o}'`);if(r)break;i[o||"#"+s]=r}if(!r){const s=Object.entries(i).map(([a,l])=>`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let o=e?s.length>1?`since :
89
89
  `+s.map(qz).join(`
90
90
  `):" "+qz(s[0]):"as no adapter specified";throw new tn("There is no suitable adapter to dispatch the request "+o,"ERR_NOT_SUPPORT")}return r},adapters:OT};function k6(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Sy(null,t)}function Xz(t){return k6(t),t.headers=Dc.from(t.headers),t.data=_6.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),gte.getAdapter(t.adapter||u$.adapter)(t).then(function(r){return k6(t),r.data=_6.call(t,t.transformResponse,r),r.headers=Dc.from(r.headers),r},function(r){return pte(r)||(k6(t),r&&r.response&&(r.response.data=_6.call(t,t.transformResponse,r.response),r.response.headers=Dc.from(r.response.headers))),Promise.reject(r)})}const Hz=t=>t instanceof Dc?t.toJSON():t;function nm(t,e){e=e||{};const n={};function r(c,u,f){return Ie.isPlainObject(c)&&Ie.isPlainObject(u)?Ie.merge.call({caseless:f},c,u):Ie.isPlainObject(u)?Ie.merge({},u):Ie.isArray(u)?u.slice():u}function i(c,u,f){if(Ie.isUndefined(u)){if(!Ie.isUndefined(c))return r(void 0,c,f)}else return r(c,u,f)}function s(c,u){if(!Ie.isUndefined(u))return r(void 0,u)}function o(c,u){if(Ie.isUndefined(u)){if(!Ie.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,f){if(f in e)return r(c,u);if(f in t)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(c,u)=>i(Hz(c),Hz(u),!0)};return Ie.forEach(Object.keys(Object.assign({},t,e)),function(u){const f=l[u]||i,h=f(t[u],e[u],u);Ie.isUndefined(h)&&f!==a||(n[u]=h)}),n}const vte="1.6.5",f$={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{f$[t]=function(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}});const Zz={};f$.transitional=function(e,n,r){function i(s,o){return"[Axios v"+vte+"] Transitional option '"+s+"'"+o+(r?". "+r:"")}return(s,o,a)=>{if(e===!1)throw new tn(i(o," has been removed"+(n?" in "+n:"")),tn.ERR_DEPRECATED);return n&&!Zz[o]&&(Zz[o]=!0,console.warn(i(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};function uPe(t,e,n){if(typeof t!="object")throw new tn("options must be an object",tn.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const a=t[s],l=a===void 0||o(a,s,t);if(l!==!0)throw new tn("option "+s+" must be "+l,tn.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new tn("Unknown option "+s,tn.ERR_BAD_OPTION)}}const yT={assertOptions:uPe,validators:f$},Cu=yT.validators;class f_{constructor(e){this.defaults=e,this.interceptors={request:new Wz,response:new Wz}}request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=nm(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:s}=n;r!==void 0&&yT.assertOptions(r,{silentJSONParsing:Cu.transitional(Cu.boolean),forcedJSONParsing:Cu.transitional(Cu.boolean),clarifyTimeoutError:Cu.transitional(Cu.boolean)},!1),i!=null&&(Ie.isFunction(i)?n.paramsSerializer={serialize:i}:yT.assertOptions(i,{encode:Cu.function,serialize:Cu.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&Ie.merge(s.common,s[n.method]);s&&Ie.forEach(["delete","get","head","post","put","patch","common"],p=>{delete s[p]}),n.headers=Dc.concat(o,s);const a=[];let l=!0;this.interceptors.request.forEach(function(g){typeof g.runWhen=="function"&&g.runWhen(n)===!1||(l=l&&g.synchronous,a.unshift(g.fulfilled,g.rejected))});const c=[];this.interceptors.response.forEach(function(g){c.push(g.fulfilled,g.rejected)});let u,f=0,h;if(!l){const p=[Xz.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(n);f<h;)u=u.then(p[f++],p[f++]);return u}h=a.length;let d=n;for(f=0;f<h;){const p=a[f++],g=a[f++];try{d=p(d)}catch(m){g.call(this,m);break}}try{u=Xz.call(this,d)}catch(p){return Promise.reject(p)}for(f=0,h=c.length;f<h;)u=u.then(c[f++],c[f++]);return u}getUri(e){e=nm(this.defaults,e);const n=mte(e.baseURL,e.url);return ute(n,e.params,e.paramsSerializer)}}Ie.forEach(["delete","get","head","options"],function(e){f_.prototype[e]=function(n,r){return this.request(nm(r||{},{method:e,url:n,data:(r||{}).data}))}});Ie.forEach(["post","put","patch"],function(e){function n(r){return function(s,o,a){return this.request(nm(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}f_.prototype[e]=n(),f_.prototype[e+"Form"]=n(!0)});const MS=f_;class h${constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});const r=this;this.promise.then(i=>{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](i);r._listeners=null}),this.promise.then=i=>{let s;const o=new Promise(a=>{r.subscribe(a),s=a}).then(i);return o.cancel=function(){r.unsubscribe(s)},o},e(function(s,o,a){r.reason||(r.reason=new Sy(s,o,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}static source(){let e;return{token:new h$(function(i){e=i}),cancel:e}}}const fPe=h$;function hPe(t){return function(n){return t.apply(null,n)}}function dPe(t){return Ie.isObject(t)&&t.isAxiosError===!0}const bT={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(bT).forEach(([t,e])=>{bT[e]=t});const pPe=bT;function Ote(t){const e=new MS(t),n=Kee(MS.prototype.request,e);return Ie.extend(n,MS.prototype,e,{allOwnKeys:!0}),Ie.extend(n,e,null,{allOwnKeys:!0}),n.create=function(i){return Ote(nm(t,i))},n}const Ur=Ote(u$);Ur.Axios=MS;Ur.CanceledError=Sy;Ur.CancelToken=fPe;Ur.isCancel=pte;Ur.VERSION=vte;Ur.toFormData=S5;Ur.AxiosError=tn;Ur.Cancel=Ur.CanceledError;Ur.all=function(e){return Promise.all(e)};Ur.spread=hPe;Ur.isAxiosError=dPe;Ur.mergeConfig=nm;Ur.AxiosHeaders=Dc;Ur.formToJSON=t=>dte(Ie.isHTMLForm(t)?new FormData(t):t);Ur.getAdapter=gte.getAdapter;Ur.HttpStatusCode=pPe;Ur.default=Ur;const mPe=Ur;async function jt({address:t,body:e}){return mPe.post(`${Zp.BACKEND}${t}`,e,{headers:{"Content-Type":"application/json"}}).then(n=>n).catch(n=>n)}function d$(t,e){let n=t;for(const[r,i]of Object.entries(e)){const s=new RegExp(`\\{${r}\\}`,"g");n=n.replace(s,i)}return n}async function gPe(t,e){return await jt({body:{project:yte(),sectionId:t,jsonSource:e},address:Y.ROUTE_LOAD_SECTION_JSON_SOURCE})}async function vPe(t,e){return await jt({body:{project:yte(),sectionId:t,forking_from:e},address:Y.ROUTE_SAVE_SECTION_JSON_SOURCE})}function yte(){const{x:t,codeInfoCols:e,variants:n,codeInfo:r}=te.getState();return{sections:t,codeInfo:r,codeInfoCols:e,sectionVariants:n}}async function OPe(t){return await jt({body:{variantName:t},address:Y.ROUTE_GET_JSON_SOURCE_PATH_TO_BE_DELETED})}async function yPe(t){return await jt({body:{filepath:t},address:Y.ROUTE_DELETE_FILE})}const Yz=t=>{t=1831565813+(t|=0)|0;let e=Math.imul(t^t>>>15,1|t);return e=e+Math.imul(e^e>>>7,61|e)^e,((e^e>>>14)>>>0)/4294967296};let bPe=class{constructor(e){this.dictionaries=void 0,this.length=void 0,this.separator=void 0,this.style=void 0,this.seed=void 0;const{length:n,separator:r,dictionaries:i,style:s,seed:o}=e;this.dictionaries=i,this.separator=r,this.length=n,this.style=s,this.seed=o}generate(){if(!this.dictionaries)throw new Error('Cannot find any dictionary. Please provide at least one, or leave the "dictionary" field empty in the config object');if(this.length<=0)throw new Error("Invalid length provided");if(this.length>this.dictionaries.length)throw new Error(`The length cannot be bigger than the number of dictionaries.
91
- Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,r)=>{let i;e?(i=(o=>{if(typeof o=="string"){const a=o.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),l=Math.floor(Number(a));return Yz(l)}return Yz(o)})(e),e=4294967296*i):i=Math.random();let s=r[Math.floor(i*r.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[o,...a]=s.split("");s=o.toUpperCase()+a.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return n?`${n}${this.separator}${s}`:`${s}`},"")}};const Gz={separator:"_",dictionaries:[]},bte=t=>{const e=[...t&&t.dictionaries||Gz.dictionaries],n={...Gz,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new bPe(n).generate()};var xte=["able","above","absent","absolute","abstract","abundant","academic","acceptable","accepted","accessible","accurate","accused","active","actual","acute","added","additional","adequate","adjacent","administrative","adorable","advanced","adverse","advisory","aesthetic","afraid","aggregate","aggressive","agreeable","agreed","agricultural","alert","alive","alleged","allied","alone","alright","alternative","amateur","amazing","ambitious","amused","ancient","angry","annoyed","annual","anonymous","anxious","appalling","apparent","applicable","appropriate","arbitrary","architectural","armed","arrogant","artificial","artistic","ashamed","asleep","assistant","associated","atomic","attractive","automatic","autonomous","available","average","awake","aware","awful","awkward","back","bad","balanced","bare","basic","beautiful","beneficial","better","bewildered","big","binding","biological","bitter","bizarre","blank","blind","blonde","bloody","blushing","boiling","bold","bored","boring","bottom","brainy","brave","breakable","breezy","brief","bright","brilliant","broad","broken","bumpy","burning","busy","calm","capable","capitalist","careful","casual","causal","cautious","central","certain","changing","characteristic","charming","cheap","cheerful","chemical","chief","chilly","chosen","christian","chronic","chubby","circular","civic","civil","civilian","classic","classical","clean","clear","clever","clinical","close","closed","cloudy","clumsy","coastal","cognitive","coherent","cold","collective","colonial","colorful","colossal","coloured","colourful","combative","combined","comfortable","coming","commercial","common","communist","compact","comparable","comparative","compatible","competent","competitive","complete","complex","complicated","comprehensive","compulsory","conceptual","concerned","concrete","condemned","confident","confidential","confused","conscious","conservation","conservative","considerable","consistent","constant","constitutional","contemporary","content","continental","continued","continuing","continuous","controlled","controversial","convenient","conventional","convinced","convincing","cooing","cool","cooperative","corporate","correct","corresponding","costly","courageous","crazy","creative","creepy","criminal","critical","crooked","crowded","crucial","crude","cruel","cuddly","cultural","curious","curly","current","curved","cute","daily","damaged","damp","dangerous","dark","dead","deaf","deafening","dear","decent","decisive","deep","defeated","defensive","defiant","definite","deliberate","delicate","delicious","delighted","delightful","democratic","dependent","depressed","desirable","desperate","detailed","determined","developed","developing","devoted","different","difficult","digital","diplomatic","direct","dirty","disabled","disappointed","disastrous","disciplinary","disgusted","distant","distinct","distinctive","distinguished","disturbed","disturbing","diverse","divine","dizzy","domestic","dominant","double","doubtful","drab","dramatic","dreadful","driving","drunk","dry","dual","due","dull","dusty","dutch","dying","dynamic","eager","early","eastern","easy","economic","educational","eerie","effective","efficient","elaborate","elated","elderly","eldest","electoral","electric","electrical","electronic","elegant","eligible","embarrassed","embarrassing","emotional","empirical","empty","enchanting","encouraging","endless","energetic","enormous","enthusiastic","entire","entitled","envious","environmental","equal","equivalent","essential","established","estimated","ethical","ethnic","eventual","everyday","evident","evil","evolutionary","exact","excellent","exceptional","excess","excessive","excited","exciting","exclusive","existing","exotic","expected","expensive","experienced","experimental","explicit","extended","extensive","external","extra","extraordinary","extreme","exuberant","faint","fair","faithful","familiar","famous","fancy","fantastic","far","fascinating","fashionable","fast","fat","fatal","favourable","favourite","federal","fellow","female","feminist","few","fierce","filthy","final","financial","fine","firm","fiscal","fit","fixed","flaky","flat","flexible","fluffy","fluttering","flying","following","fond","foolish","foreign","formal","formidable","forthcoming","fortunate","forward","fragile","frail","frantic","free","frequent","fresh","friendly","frightened","front","frozen","full","fun","functional","fundamental","funny","furious","future","fuzzy","gastric","gay","general","generous","genetic","gentle","genuine","geographical","giant","gigantic","given","glad","glamorous","gleaming","global","glorious","golden","good","gorgeous","gothic","governing","graceful","gradual","grand","grateful","greasy","great","grieving","grim","gross","grotesque","growing","grubby","grumpy","guilty","handicapped","handsome","happy","hard","harsh","head","healthy","heavy","helpful","helpless","hidden","high","hilarious","hissing","historic","historical","hollow","holy","homeless","homely","hon","honest","horizontal","horrible","hostile","hot","huge","human","hungry","hurt","hushed","husky","icy","ideal","identical","ideological","ill","illegal","imaginative","immediate","immense","imperial","implicit","important","impossible","impressed","impressive","improved","inadequate","inappropriate","inc","inclined","increased","increasing","incredible","independent","indirect","individual","industrial","inevitable","influential","informal","inherent","initial","injured","inland","inner","innocent","innovative","inquisitive","instant","institutional","insufficient","intact","integral","integrated","intellectual","intelligent","intense","intensive","interested","interesting","interim","interior","intermediate","internal","international","intimate","invisible","involved","irrelevant","isolated","itchy","jealous","jittery","joint","jolly","joyous","judicial","juicy","junior","just","keen","key","kind","known","labour","large","late","latin","lazy","leading","left","legal","legislative","legitimate","lengthy","lesser","level","lexical","liable","liberal","light","like","likely","limited","linear","linguistic","liquid","literary","little","live","lively","living","local","logical","lonely","long","loose","lost","loud","lovely","low","loyal","ltd","lucky","mad","magic","magnetic","magnificent","main","major","male","mammoth","managerial","managing","manual","many","marginal","marine","marked","married","marvellous","marxist","mass","massive","mathematical","mature","maximum","mean","meaningful","mechanical","medical","medieval","melodic","melted","mental","mere","metropolitan","mid","middle","mighty","mild","military","miniature","minimal","minimum","ministerial","minor","miserable","misleading","missing","misty","mixed","moaning","mobile","moderate","modern","modest","molecular","monetary","monthly","moral","motionless","muddy","multiple","mushy","musical","mute","mutual","mysterious","naked","narrow","nasty","national","native","natural","naughty","naval","near","nearby","neat","necessary","negative","neighbouring","nervous","net","neutral","new","nice","noble","noisy","normal","northern","nosy","notable","novel","nuclear","numerous","nursing","nutritious","nutty","obedient","objective","obliged","obnoxious","obvious","occasional","occupational","odd","official","ok","okay","old","olympic","only","open","operational","opposite","optimistic","oral","ordinary","organic","organisational","original","orthodox","other","outdoor","outer","outrageous","outside","outstanding","overall","overseas","overwhelming","painful","pale","panicky","parallel","parental","parliamentary","partial","particular","passing","passive","past","patient","payable","peaceful","peculiar","perfect","permanent","persistent","personal","petite","philosophical","physical","plain","planned","plastic","pleasant","pleased","poised","polite","political","poor","popular","positive","possible","potential","powerful","practical","precious","precise","preferred","pregnant","preliminary","premier","prepared","present","presidential","pretty","previous","prickly","primary","prime","primitive","principal","printed","prior","private","probable","productive","professional","profitable","profound","progressive","prominent","promising","proper","proposed","prospective","protective","protestant","proud","provincial","psychiatric","psychological","public","puny","pure","purring","puzzled","quaint","qualified","quarrelsome","querulous","quick","quickest","quiet","quintessential","quixotic","racial","radical","rainy","random","rapid","rare","raspy","rational","ratty","raw","ready","real","realistic","rear","reasonable","recent","reduced","redundant","regional","registered","regular","regulatory","related","relative","relaxed","relevant","reliable","relieved","religious","reluctant","remaining","remarkable","remote","renewed","representative","repulsive","required","resident","residential","resonant","respectable","respective","responsible","resulting","retail","retired","revolutionary","rich","ridiculous","right","rigid","ripe","rising","rival","roasted","robust","rolling","romantic","rotten","rough","round","royal","rubber","rude","ruling","running","rural","sacred","sad","safe","salty","satisfactory","satisfied","scared","scary","scattered","scientific","scornful","scrawny","screeching","secondary","secret","secure","select","selected","selective","selfish","semantic","senior","sensible","sensitive","separate","serious","severe","sexual","shaggy","shaky","shallow","shared","sharp","sheer","shiny","shivering","shocked","short","shrill","shy","sick","significant","silent","silky","silly","similar","simple","single","skilled","skinny","sleepy","slight","slim","slimy","slippery","slow","small","smart","smiling","smoggy","smooth","social","socialist","soft","solar","sole","solid","sophisticated","sore","sorry","sound","sour","southern","soviet","spare","sparkling","spatial","special","specific","specified","spectacular","spicy","spiritual","splendid","spontaneous","sporting","spotless","spotty","square","squealing","stable","stale","standard","static","statistical","statutory","steady","steep","sticky","stiff","still","stingy","stormy","straight","straightforward","strange","strategic","strict","striking","striped","strong","structural","stuck","stupid","subjective","subsequent","substantial","subtle","successful","successive","sudden","sufficient","suitable","sunny","super","superb","superior","supporting","supposed","supreme","sure","surprised","surprising","surrounding","surviving","suspicious","sweet","swift","symbolic","sympathetic","systematic","tall","tame","tart","tasteless","tasty","technical","technological","teenage","temporary","tender","tense","terrible","territorial","testy","then","theoretical","thick","thin","thirsty","thorough","thoughtful","thoughtless","thundering","tight","tiny","tired","top","tory","total","tough","toxic","traditional","tragic","tremendous","tricky","tropical","troubled","typical","ugliest","ugly","ultimate","unable","unacceptable","unaware","uncertain","unchanged","uncomfortable","unconscious","underground","underlying","unemployed","uneven","unexpected","unfair","unfortunate","unhappy","uniform","uninterested","unique","united","universal","unknown","unlikely","unnecessary","unpleasant","unsightly","unusual","unwilling","upper","upset","uptight","urban","urgent","used","useful","useless","usual","vague","valid","valuable","variable","varied","various","varying","vast","verbal","vertical","very","vicarious","vicious","victorious","violent","visible","visiting","visual","vital","vitreous","vivacious","vivid","vocal","vocational","voiceless","voluminous","voluntary","vulnerable","wandering","warm","wasteful","watery","weak","wealthy","weary","wee","weekly","weird","welcome","well","western","wet","whispering","whole","wicked","wide","widespread","wild","wilful","willing","willowy","wily","wise","wispy","wittering","witty","wonderful","wooden","working","worldwide","worried","worrying","worthwhile","worthy","written","wrong","xenacious","xenial","xenogeneic","xenophobic","xeric","xerothermic","yabbering","yammering","yappiest","yappy","yawning","yearling","yearning","yeasty","yelling","yelping","yielding","yodelling","young","youngest","youthful","ytterbic","yucky","yummy","zany","zealous","zeroth","zestful","zesty","zippy","zonal","zoophagous","zygomorphic","zygotic"],wte=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];let Rx;const xPe=new Uint8Array(16);function wPe(){if(!Rx&&(Rx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rx(xPe)}const vi=[];for(let t=0;t<256;++t)vi.push((t+256).toString(16).slice(1));function SPe(t,e=0){return(vi[t[e+0]]+vi[t[e+1]]+vi[t[e+2]]+vi[t[e+3]]+"-"+vi[t[e+4]]+vi[t[e+5]]+"-"+vi[t[e+6]]+vi[t[e+7]]+"-"+vi[t[e+8]]+vi[t[e+9]]+"-"+vi[t[e+10]]+vi[t[e+11]]+vi[t[e+12]]+vi[t[e+13]]+vi[t[e+14]]+vi[t[e+15]]).toLowerCase()}const _Pe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Kz={randomUUID:_Pe};function kPe(t,e,n){if(Kz.randomUUID&&!e&&!t)return Kz.randomUUID();t=t||{};const r=t.random||(t.rng||wPe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return SPe(r)}function Kn(){return kPe()}function xT(t){return t||Kn()}function CPe(t,e){const n=JSON.stringify({filenameGlob:e,key:t});return`${Y.JSON_SOURCE_PREFIX}${n}`}function Ste(t,e,n){return e?CPe([...n,...t],e):Kn()}function EPe(t){const e={dictionaries:[xte,wte],separator:"_",length:2};let n;for(;!n||t.includes(n);)n=bte(e);return n}function Fm(){return bte({dictionaries:[xte,wte],separator:"_",length:2})}const TPe={id:null,name:"",previewImgColor:"bg-blue-500/60 dark:bg-blue-600/30",viewport:null,children:{}},PPe={id:null,name:"",size:{width:"auto",height:"auto"},parentId:null,variantId:null,uiTypeId:null,uiTypeColId:null,social:"",artifactGroupIds:[],defaultVariantId:null,variantIds:[],paramSweepSectionId:null,nonPresetUITypeIds:[],codeLanguage:"python",configLanguage:"python",runInMemory:!1,isFrozen:!1,isHorizontalOrientation:!1,hideParams:!1,hideSearch:!1,hideUnpinnedParams:!1,displayMode:"GUI",pinnedAreaHeight:"auto",isMinimized:!1,canvasSettings:{activeLayerId:null,color:"#ff0000",brushSize:16,brushShape:"butt",eraserBrushSize:16,drawThrottleDelay:0,canvasTransferQueueLength:50,artifactIdUsedToSetCanvasSize:null,mode:"draw"},chartSettings:{type:"line",xAxisColumn:"",secondYAxisColumns:[],xAxisLog:!1,y1AxisLog:!1,y2AxisLog:!1},isTemporary:!1,isReadOnlyTerminal:!1,renderMarkdown:!1,positionAndSizeLocked:!1,jsonSource:"",jsonSourceKeys:[],selectedVariantIds:{},paramFilter:"",jsonSourceMissing:!1,isInOtherProjectConfigs:!1,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0,columnWidth:null,renderedValue:null,subprocessStartMethod:"fork"},APe={name:"",values:{},children:[],selectedItem:null,code:"",codeInfoColId:null,description:"",evRefs:[],templateVars:[],isFrozen:!1,sweep:[],runGroup:{}},RPe={id:null,name:"",editable:!1,rcType:"parameter",defaultVal:"",description:"",positionalOnly:!1,isPinned:!1,isFrozen:!1,isSelected:!1,evRefs:[],ignoreTypeErrors:!1},$Pe={children:{null:[]}},MPe={id:null,type:"TEXT",name:"",presetType:"BASE",config:{}},IPe={value:"",evRefs:[]},DPe={selected:!0,paramSweeps:{},versions:{}},LPe={uiTypeId:"3fdaeb6a-e989-4888-b844-17a76f0b0192",nonPresetUITypeIds:[]},NPe={sectionId:null,paramInfoId:null,isArgsObj:!1,startPos:0,keyword:""},QPe={name:"",path:"",value:null,type:""},Ld={projectConfig:TPe,section:PPe,sectionVariant:APe,codeInfo:RPe,codeInfoCol:$Pe,uiType:MPe,evEntry:IPe,runGroupEntry:DPe,uiTypeColEntry:LPe,evRefEntry:NPe,artifact:QPe};function k5(){return ae.cloneDeep(Ld.codeInfoCol)}function p$({uiType:t,currValue:e}){switch(t.type){case Y.TEXT:case Y.PASSWORD:return jPe({currValue:e});case Y.SLIDER:return BPe({uiType:t,currValue:e});case Y.SWITCH:return zPe({currValue:e});case Y.COLOR_PICKER:return FPe({currValue:e});case Y.DROPDOWN:return WPe({currValue:e});default:return""}}function jPe({currValue:t}){return ae.isNil(t)?"":t}function BPe({uiType:t,currValue:e}){const n=ae.toNumber(e);return ae.isFinite(n)?ae.toString(Hc(n,t.config.min,t.config.max)):ae.toString(t.config.min)}function zPe({currValue:t}){return ae.isNil(t)||t==="0"?"false":"true"}function FPe({currValue:t}){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)?t:"#ff0000"}function WPe({currValue:t}){return ae.isNil(t)?"":t}function Wm(){return ae.cloneDeep(Ld.evEntry)}function El(t){t?Ra.setState({open:t}):Ra.getState().reset()}function au(t,e){Ra.setState({modalType:t,modalData:e,open:!0})}function _te(){au(br.LOAD_PROJECT_CONFIG)}function kte(){au(br.SAVE_PROJECT_CONFIG_AS)}function VPe(){au(br.SAVE_PROJECT_CONFIG_AS_WITH_REFS)}function UPe(){au(br.EXPORT_JSON)}function qPe(){au(br.IMPORT_JSON)}function XPe(t){au(br.DELETE_PROJECT_WARNING,t)}function HPe(...t){au(br.RENAME_REFERENCES,t)}function ZPe(t){au(br.DELETE_JSON_SOURCE_FILE,t)}function YPe(t){au(br.ADD_ARTIFACT_BY_FILEPATH,t)}function m$(t){return t.split(";base64,")[1]}function Cte(t){return m$(t.toDataURL("image/png"))}async function g$(t){const e=GPe(t),n=new Image;return n.src=e,await n.decode(),n}function GPe(t){return t.startsWith("data:image/")?t:`data:image/png;base64,${t}`}async function KPe(t){return await jt({body:{artifactIds:t},address:Y.ROUTE_LOAD_ARTIFACTS})}async function JPe(t){return await jt({body:{sectionType:t},address:Y.ROUTE_LOAD_AVAILABLE_ARTIFACTS})}async function eAe(t){return await jt({body:{filepath:t},address:Y.ROUTE_CHECK_IF_FILE_EXISTS})}async function tAe(t,e){return await jt({body:{filepath:t,type:e},address:Y.ROUTE_LOAD_ARTIFACT_FROM_DISK})}async function nAe(t){return await jt({body:{base64Str:t},address:Y.ROUTE_READ_CSV_BASE64})}async function rAe(t){return await jt({body:{namesPathsTypes:t},address:Y.ROUTE_GET_ARTIFACT_IDS_FROM_NAME_PATH_TYPE})}function iAe(t,e){let n;for(let r of t)r>=e&&(n===void 0||r-e<n-e)&&(n=r);return n}function sAe(t,e){const n=[],{fullNameToInfo:r}=Dd.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);if(s in r){const o=r[s];n.push({sectionId:o.sectionId,paramInfoId:o.paramInfoId,isArgsObj:o.isArgsObj,startPos:i.startPos,keyword:s})}}return n}function oAe(t,e){const n=[],{fullNameToSectionId:r}=O5.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);s in r&&n.push({sectionId:r[s],startPos:i.startPos,keyword:s})}return n}function Ete(){const t={};for(const[e,n]of Object.entries(Dd.getState().fullNameToInfo))t[Tte({sectionId:n.sectionId,paramInfoId:n.paramInfoId,isArgsObj:n.isArgsObj})]=e;return t}function Tte({sectionId:t,paramInfoId:e=null,isArgsObj:n=!1}){return JSON.stringify([t,e,n])}function aAe({fullNameToInfo:t,keyword:e,sectionId:n,paramInfoId:r}){return!(t[e].sectionId===n&&!t[e].paramInfoId||t[e].sectionId===n&&t[e].paramInfoId===r)}function v$({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r}){let i;const s=new Set,{[r]:o,fullNameToInfo:a}=Dd.getState();for(;i=o.exec(n);)aAe({fullNameToInfo:a,keyword:i[0],sectionId:t,paramInfoId:e})&&s.add([i[0],i.index]);return Array.from(s)}function O$(t,e){let n;const r=[],{pattern:i,fullNameToSectionId:s}=O5.getState();for(;n=i.exec(e);)s[n[0]]!==t&&r.push([n[0],n.index]);return r}function lAe(t){const e=t.indexOf(Y.TEMPLATE_PREFIX,t.indexOf(Y.TEMPLATE_PREFIX)+1);return t.substring(e)}async function cAe(){return await jt({body:{},address:Y.ROUTE_ALL_PROJECT_CONFIG_METADATA})}async function Jz(){return await jt({body:{},address:Y.ROUTE_LOAD_PROJECT_CONFIG_NAMES})}async function uAe(t){return await jt({body:{projectConfigName:t},address:Y.ROUTE_LOAD_PROJECT_CONFIG})}async function fAe({excludeProjectConfigName:t}){return await jt({body:{excludeProjectConfigName:t},address:Y.ROUTE_LOAD_FULL_PROJECT})}async function hAe({name:t,previewImgColor:e}){return await jt({address:Y.ROUTE_CREATE_PROJECT_CONFIG,body:{name:t,previewImgColor:e}})}async function dAe({project:t}){return await jt({address:Y.ROUTE_SAVE_PROJECT,body:{project:t}})}async function pAe({project:t,newConfigName:e,withRefs:n}){return await jt({address:Y.ROUTE_SAVE_AS_NEW_PROJECT_CONFIG,body:{project:t,newConfigName:e,withRefs:n}})}async function mAe({project:t,configName:e}){return await jt({address:Y.ROUTE_SAVE_AS_EXISTING_PROJECT_CONFIG,body:{project:t,configName:e}})}async function gAe(t){return await jt({address:Y.ROUTE_DELETE_PROJECT_CONFIGS,body:{ids:t}})}async function vAe(){return await jt({address:Y.ROUTE_GET_DEFAULT_CONFIG_NAME,body:{}})}async function OAe(t){return await jt({address:Y.ROUTE_SET_AS_DEFAULT_PROJECT,body:{projectId:t}})}async function yAe(t){return await jt({address:Y.ROUTE_FILTER_DATA_FOR_JSON_EXPORT,body:{project:t}})}async function bAe(t){return await jt({address:Y.ROUTE_ADD_DEFAULT_DATA_FOR_JSON_IMPORT,body:{project:t}})}async function eF(t){return await jt({address:Y.ROUTE_SAVE_SETTINGS,body:{settings:t}})}async function xAe(){return await jt({address:Y.ROUTE_LOAD_SETTINGS,body:{}})}async function wAe(t){return await jt({address:Y.ROUTE_SAVE_SETTINGS_PROJECT,body:{settingsProject:t}})}async function SAe(){return await jt({address:Y.ROUTE_LOAD_SETTINGS_PROJECT,body:{}})}function Pte({name:t,...e}){return ae.merge(ae.cloneDeep(Ld.artifact),{name:t??Fm()},e)}function Ate({name:t,...e}){return{name:t??Fm(),artifactTransforms:[],visible:!0,layerOpacity:.5,brushOpacity:1,...e}}function y$(t,e,n){return{artifactId:t,..._Ae(e,n)}}function _Ae(t,e){switch(t){case Y.DRAW:return{transform:[1,0,0,1,0,0],eraserStrokes:e==="img"?[]:{}};case Y.IMAGE:case Y.CHART:return{};default:return{}}}const b$=ae.throttle(()=>{if(c_.temporal.getState().pastStates.length<=1)return;const e=c_.getState().version;for(const n of Mm[Rd.PROJECT_STATE])n.temporal&&e===n.getState().version&&(n.temporal.getState().undo(2),kAe(n));w$(),Ut.setState({undoOrRedoWasTriggered:!0})},100);function kAe(t){t.temporal.setState(e=>({pastStates:[...e.pastStates,t.getState()],futureStates:Rte(e.futureStates)}))}function Rte(t){const e=[],n=new Set;for(const r of t)n.has(r.version)||(e.push(r),n.add(r.version));return e}const x$=ae.throttle(()=>{const t=c_.getState().version;for(const e of Mm[Rd.PROJECT_STATE])e.temporal&&t===e.getState().version&&(e.temporal.getState().redo(),CAe(e));w$(),Ut.setState({undoOrRedoWasTriggered:!0})},100);function CAe(t){t.temporal.setState(e=>({pastStates:Rte([...e.pastStates,t.getState()])}))}function EAe(t){let e=!1;for(const r of t)if(r.temporal&&!ae.isEqual(r.getState(),r.temporal.getState().pastStates.at(-1))){e=!0;break}if(!e)return;const n=c_.getState().version;for(const r of t)r.temporal&&(r.setState({version:n+1}),TAe(r,()=>r.setState({})))}function TAe(t,e){t.temporal.getState().resume(),e(),t.temporal.getState().pause()}const hn=ae.throttle((t,e=!0)=>{t&&(EAe(Mm[Rd.PROJECT_STATE]),e&&w$())},500),w$=ae.debounce(()=>{Nt.getState().backend.autosave&&j5()},1e3);async function PAe(t,e,n){const r=await KPe(e);if(r.status===200){const i=ae.cloneDeep(r.data);if(await AAe(i),n!=null&&n.aborted)return;fi.setState(s=>({x:{...s.x,...i}})),te.setState(s=>{Lte(e,t,s)}),hn(!0)}}async function AAe(t){for(const e of Object.values(t))e.value=await $te(e.type,e.value)}async function $te(t,e){switch(t){case"img":return await g$(e);case"list":case"brushStrokes":return e}}async function RAe(t,e){switch(t){case"img":return await g$(e);case"list":const n=await nAe(m$(e));if(n.status==200)return n.data;default:return null}}function $Ae(){const t={};for(const[e,n]of Object.entries(fi.getState().x))typeof n!="function"&&(n.type==="img"&&n.value instanceof Image?t[e]={...n,value:m$(n.value.src)}:t[e]=n);return t}function Mte(t,e){const n=Kn(),r="brushStrokes";fi.setState(s=>({x:{...s.x,[n]:Pte({type:r,value:[]})}}));const i=Kn();e.artifactGroups[i]=Ate({artifactTransforms:[y$(n,Y.DRAW,r)]}),e.x[t].artifactGroupIds.push(i),e.x[t].canvasSettings.activeLayerId=i}function Ite({sectionId:t,sectionTypeName:e,artifactId:n,artifactType:r,createNewArtifactGroup:i=!1,add:s,state:o}){let a=MAe(t,e,o),l;if(s){(!a||i)&&(a=Kn(),o.artifactGroups[a]=Ate({}),o.x[t].artifactGroupIds.unshift(a));const c=y$(n,e,r);l=o.artifactGroups[a],e===Y.DRAW||e===Y.CHART?l.artifactTransforms.push(c):l.artifactTransforms=[c]}else l=o.artifactGroups[a],l&&(l.artifactTransforms=l.artifactTransforms.filter(c=>c.artifactId!==n));l&&Lte(l.artifactTransforms.map(c=>c.artifactId),t,o)}async function Dte({sectionId:t,createNewArtifactGroup:e,value:n,artifactType:r,path:i=""}){const s=Kn();fi.setState(o=>({x:{...o.x,[s]:Pte({value:n,path:i,type:r})}})),te.setState(o=>{const a=dn(t,o);Ite({sectionId:t,sectionTypeName:a,artifactId:s,artifactType:r,createNewArtifactGroup:e,add:!0,state:o})})}function MAe(t,e,n){switch(e){case Y.DRAW:return n.x[t].canvasSettings.activeLayerId;case Y.IMAGE:case Y.CHART:return n.x[t].artifactGroupIds[0]}}function Lte(t,e,n){dn(e,n)===Y.CHART&&Nte(t,e,n)}function Nte(t,e,n){const{chartSettings:r}=n.x[e],i=S$(t.map(o=>fi.getState().x[o]),r.type),s=Object.keys(i);Ut.setState(o=>({chartDisplayedSeriesNames:{...o.chartDisplayedSeriesNames,[e]:s}})),s!==0&&(s.includes(r.xAxisColumn)||(r.xAxisColumn=s[0]))}function S$(t,e){switch(e){case"line":return IAe(t);case"scatter":return DAe(t);default:return{}}}function IAe(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value)){const s=t.length===1?r:`${n.name}/${r}`;e[s]=[...i]}return e}function DAe(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value))r in e||(e[r]=[]),e[r].push(...i);return e}function _$(t){return JSON.stringify([t.name,t.path,t.type])}function Qte(t,e,n,r,i,s=null,o=null){const a=[],l=n.filter(f=>i(t[f])).reverse(),c=new Set,u=s?{}:null;for(s&&l.forEach(f=>u[f]=s(t[f])?[f]:[]);l.length>0;){const f=l.pop();if(!f||c.has(f))continue;c.add(f);const h=t[f];if(r(h)&&a.push(h.id),i(h)){const d=e[h.id].slice().reverse();if(s){const p=u[f];d.forEach(g=>{u[g]=s(t[g])?[...p,g]:[...p]})}l.push(...d)}if(a.length>0&&(o!=null&&o(t[a[a.length-1]])))return{ids:a,pathMap:u,earlyReturnTriggered:!0}}return{ids:a,pathMap:u,earlyReturnTriggered:!1}}function k$({allCodeInfo:t,codeInfoChildren:e,startingId:n,additionalOutputCondition:r=null,paramPathCondition:i=null,earlyReturnCondition:s=null}){const o=n?[n]:e[n];return Qte(t,e,o??[],l=>(l==null?void 0:l.rcType)===Y.PARAMETER&&(!r||r(l)),n?()=>!0:l=>(l==null?void 0:l.rcType)===Y.PARAMETER,i,s)}function LAe(t,e){return Qte(t,e,e[null]??[],()=>!0,()=>!0)}function _y(t){return k$({...t,paramPathCondition:e=>e.rcType===Y.PARAMETER})}function rO(t,e,n,r){const{ids:i,pathMap:s}=_y({allCodeInfo:e,codeInfoChildren:n,startingId:r});i.reverse();let o=[];const a=new Set,l={};for(const c of i)if(Y8e(e[c].isPinned,t)&&(n[c].length===0||n[c].some(u=>u in l)))for(const u of s[c])l[u]=s[u],a.has(s[c][0])||(o.push(s[c][0]),a.add(s[c][0]));return o.reverse(),{requiredParamIdsToPaths:l,topLevelParamIds:o}}function C$(t,e,n){if(e[n].length===1)return t[e[n][0]].name;{let r="";for(const[i,s]of e[n].entries())i===0?r=t[s].name:r+=`["${t[s].name}"]`;return r}}function jte(t,e,n){const{selectedItem:r}=Yt(t,e),i=Jo(t,e).children,{earlyReturnTriggered:s}=k$({allCodeInfo:e.codeInfo,codeInfoChildren:i,startingId:r,earlyReturnCondition:n});return s}function NAe(t,e){return jte(t,e,n=>(n==null?void 0:n.rcType)===Y.PARAMETER)}function QAe(t,e){return jte(t,e,n=>n==null?void 0:n.isSelected)}function Bte(t,e){const{hideUnpinnedParams:n}=e.x[t],{codeInfoChildren:r,parentCodeInfoId:i}=Ry(t,e);let s=rO(!0,e.codeInfo,r,i);s=Object.keys(s.requiredParamIdsToPaths),s.reverse();let o=[];return n||(o=rO(!1,e.codeInfo,r,i),o=Object.keys(o.requiredParamIdsToPaths),o.reverse()),[...s,...o]}function jAe(t,e){return te(n=>{const r=Ll(t,n).values;return e in r?{value:r[e].value,evRefs:r[e].evRefs}:Wm()},ae.isEqual)}function zte(t){return te(e=>t?e.x[t].variantIds.map(n=>({id:n,name:e.variants[n].name})):[],ae.isEqual)}function BAe(t){return te(e=>{const n=e.x[t].parentId;return Ll(n).children.indexOf(t)})}function C5(t){return te(e=>Yt(t,e).isFrozen)}function Fte(t){return te(e=>({...Wte(t,e),variantIsFrozen:Yt(t,e).isFrozen}),ae.isEqual)}function Wte(t,e){return{renderMarkdown:e.x[t].renderMarkdown,description:Ll(t,e).description}}function zAe(t){return te(e=>{const n=z5(t,e),r=ky(t,e.x);return{forSectionId:r,variantId:n,paramSweep:e.variants[n].sweep,variantIsFrozen:Yt(t).isFrozen,showParamSweepSectionSearch:!e.x[r].hideSearch&&dn(r,e)!==Y.GLOBAL_VARIABLES}},ae.isEqual)}function FAe(t){const e=te(n=>n.x[t].paramSweepSectionId);return zte(e)}function ky(t,e){var n;return(n=Object.values(e).find(r=>r.paramSweepSectionId===t))==null?void 0:n.id}async function WAe(t,e){switch(dn(t)){case Y.PARAM_SWEEP:return await UAe(t,e);case Y.GLOBAL_PARAM_SWEEP:return await qAe(e);case Y.GLOBAL_VARIABLES:case Y.SECTION:return await VAe(e)}}async function VAe(t){const e=te.getState(),{codeInfoChildren:n,parentCodeInfoId:r}=Ry(null,e,t),i=e.codeInfo,s=rO(!0,i,n,r),o=rO(!1,i,n,r);s.requiredParamIds=Object.keys(s.requiredParamIdsToPaths),o.requiredParamIds=Object.keys(o.requiredParamIdsToPaths),delete s.requiredParamIdsToPaths,delete o.requiredParamIdsToPaths;const a=e.variants[t];return await jt({body:{codeInfo:i,codeInfoChildren:n,sectionVariant:a,pinnedIds:s,unpinnedIds:o},address:Y.ROUTE_SECTION_TO_YAML})}async function UAe(t,e){const n=te.getState(),r=ky(t,n.x),s=n.variants[e].sweep,o=n.codeInfo,l=(Nne(r,n)??k5()).children;return await jt({body:{sweep:s,codeInfo:o,codeInfoChildren:l},address:Y.ROUTE_PARAM_SWEEP_SECTION_TO_YAML})}async function qAe(t){const e=te.getState(),n=e.x,r=e.variants,i=r[t].runGroup;return await jt({body:{runGroup:i,sections:n,sectionVariants:r},address:Y.ROUTE_GLOBAL_PARAM_SWEEP_SECTION_TO_YAML})}function E5({id:t,...e}){return ae.merge(ae.cloneDeep(Ld.codeInfo),{id:xT(t)},e)}const E$=Symbol.for("yaml.alias"),wT=Symbol.for("yaml.document"),uf=Symbol.for("yaml.map"),Vte=Symbol.for("yaml.pair"),Zc=Symbol.for("yaml.scalar"),Vm=Symbol.for("yaml.seq"),Ko=Symbol.for("yaml.node.type"),Um=t=>!!t&&typeof t=="object"&&t[Ko]===E$,T5=t=>!!t&&typeof t=="object"&&t[Ko]===wT,Cy=t=>!!t&&typeof t=="object"&&t[Ko]===uf,Dr=t=>!!t&&typeof t=="object"&&t[Ko]===Vte,Jn=t=>!!t&&typeof t=="object"&&t[Ko]===Zc,Ey=t=>!!t&&typeof t=="object"&&t[Ko]===Vm;function Ar(t){if(t&&typeof t=="object")switch(t[Ko]){case uf:case Vm:return!0}return!1}function Vr(t){if(t&&typeof t=="object")switch(t[Ko]){case E$:case uf:case Zc:case Vm:return!0}return!1}const XAe=t=>(Jn(t)||Ar(t))&&!!t.anchor,Ch=Symbol("break visit"),HAe=Symbol("skip children"),ev=Symbol("remove node");function md(t,e){const n=ZAe(e);T5(t)?tp(null,t.contents,n,Object.freeze([t]))===ev&&(t.contents=null):tp(null,t,n,Object.freeze([]))}md.BREAK=Ch;md.SKIP=HAe;md.REMOVE=ev;function tp(t,e,n,r){const i=YAe(t,e,n,r);if(Vr(i)||Dr(i))return GAe(t,r,i),tp(t,i,n,r);if(typeof i!="symbol"){if(Ar(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=tp(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Ch)return Ch;o===ev&&(e.items.splice(s,1),s-=1)}}}else if(Dr(e)){r=Object.freeze(r.concat(e));const s=tp("key",e.key,n,r);if(s===Ch)return Ch;s===ev&&(e.key=null);const o=tp("value",e.value,n,r);if(o===Ch)return Ch;o===ev&&(e.value=null)}}return i}function ZAe(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function YAe(t,e,n,r){var i,s,o,a,l;if(typeof n=="function")return n(t,e,r);if(Cy(e))return(i=n.Map)==null?void 0:i.call(n,t,e,r);if(Ey(e))return(s=n.Seq)==null?void 0:s.call(n,t,e,r);if(Dr(e))return(o=n.Pair)==null?void 0:o.call(n,t,e,r);if(Jn(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,r);if(Um(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,r)}function GAe(t,e,n){const r=e[e.length-1];if(Ar(r))r.items[t]=n;else if(Dr(r))t==="key"?r.key=n:r.value=n;else if(T5(r))r.contents=n;else{const i=Um(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const KAe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},JAe=t=>t.replace(/[!,[\]{}]/g,e=>KAe[e]);class ts{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ts.defaultYaml,e),this.tags=Object.assign({},ts.defaultTags,n)}clone(){const e=new ts(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ts(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ts.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ts.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:ts.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ts.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+JAe(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&Vr(e.contents)){const s={};md(e.contents,(o,a)=>{Vr(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
91
+ Length provided: ${this.length}. Number of dictionaries provided: ${this.dictionaries.length}`);let e=this.seed;return this.dictionaries.slice(0,this.length).reduce((n,r)=>{let i;e?(i=(o=>{if(typeof o=="string"){const a=o.split("").map(c=>c.charCodeAt(0)).reduce((c,u)=>c+u,1),l=Math.floor(Number(a));return Yz(l)}return Yz(o)})(e),e=4294967296*i):i=Math.random();let s=r[Math.floor(i*r.length)]||"";if(this.style==="lowerCase")s=s.toLowerCase();else if(this.style==="capital"){const[o,...a]=s.split("");s=o.toUpperCase()+a.join("")}else this.style==="upperCase"&&(s=s.toUpperCase());return n?`${n}${this.separator}${s}`:`${s}`},"")}};const Gz={separator:"_",dictionaries:[]},bte=t=>{const e=[...t&&t.dictionaries||Gz.dictionaries],n={...Gz,...t,length:t&&t.length||e.length,dictionaries:e};if(!t||!t.dictionaries||!t.dictionaries.length)throw new Error('A "dictionaries" array must be provided. This is a breaking change introduced starting from Unique Name Generator v4. Read more about the breaking change here: https://github.com/andreasonny83/unique-names-generator#migration-guide');return new bPe(n).generate()};var xte=["able","above","absent","absolute","abstract","abundant","academic","acceptable","accepted","accessible","accurate","accused","active","actual","acute","added","additional","adequate","adjacent","administrative","adorable","advanced","adverse","advisory","aesthetic","afraid","aggregate","aggressive","agreeable","agreed","agricultural","alert","alive","alleged","allied","alone","alright","alternative","amateur","amazing","ambitious","amused","ancient","angry","annoyed","annual","anonymous","anxious","appalling","apparent","applicable","appropriate","arbitrary","architectural","armed","arrogant","artificial","artistic","ashamed","asleep","assistant","associated","atomic","attractive","automatic","autonomous","available","average","awake","aware","awful","awkward","back","bad","balanced","bare","basic","beautiful","beneficial","better","bewildered","big","binding","biological","bitter","bizarre","blank","blind","blonde","bloody","blushing","boiling","bold","bored","boring","bottom","brainy","brave","breakable","breezy","brief","bright","brilliant","broad","broken","bumpy","burning","busy","calm","capable","capitalist","careful","casual","causal","cautious","central","certain","changing","characteristic","charming","cheap","cheerful","chemical","chief","chilly","chosen","christian","chronic","chubby","circular","civic","civil","civilian","classic","classical","clean","clear","clever","clinical","close","closed","cloudy","clumsy","coastal","cognitive","coherent","cold","collective","colonial","colorful","colossal","coloured","colourful","combative","combined","comfortable","coming","commercial","common","communist","compact","comparable","comparative","compatible","competent","competitive","complete","complex","complicated","comprehensive","compulsory","conceptual","concerned","concrete","condemned","confident","confidential","confused","conscious","conservation","conservative","considerable","consistent","constant","constitutional","contemporary","content","continental","continued","continuing","continuous","controlled","controversial","convenient","conventional","convinced","convincing","cooing","cool","cooperative","corporate","correct","corresponding","costly","courageous","crazy","creative","creepy","criminal","critical","crooked","crowded","crucial","crude","cruel","cuddly","cultural","curious","curly","current","curved","cute","daily","damaged","damp","dangerous","dark","dead","deaf","deafening","dear","decent","decisive","deep","defeated","defensive","defiant","definite","deliberate","delicate","delicious","delighted","delightful","democratic","dependent","depressed","desirable","desperate","detailed","determined","developed","developing","devoted","different","difficult","digital","diplomatic","direct","dirty","disabled","disappointed","disastrous","disciplinary","disgusted","distant","distinct","distinctive","distinguished","disturbed","disturbing","diverse","divine","dizzy","domestic","dominant","double","doubtful","drab","dramatic","dreadful","driving","drunk","dry","dual","due","dull","dusty","dutch","dying","dynamic","eager","early","eastern","easy","economic","educational","eerie","effective","efficient","elaborate","elated","elderly","eldest","electoral","electric","electrical","electronic","elegant","eligible","embarrassed","embarrassing","emotional","empirical","empty","enchanting","encouraging","endless","energetic","enormous","enthusiastic","entire","entitled","envious","environmental","equal","equivalent","essential","established","estimated","ethical","ethnic","eventual","everyday","evident","evil","evolutionary","exact","excellent","exceptional","excess","excessive","excited","exciting","exclusive","existing","exotic","expected","expensive","experienced","experimental","explicit","extended","extensive","external","extra","extraordinary","extreme","exuberant","faint","fair","faithful","familiar","famous","fancy","fantastic","far","fascinating","fashionable","fast","fat","fatal","favourable","favourite","federal","fellow","female","feminist","few","fierce","filthy","final","financial","fine","firm","fiscal","fit","fixed","flaky","flat","flexible","fluffy","fluttering","flying","following","fond","foolish","foreign","formal","formidable","forthcoming","fortunate","forward","fragile","frail","frantic","free","frequent","fresh","friendly","frightened","front","frozen","full","fun","functional","fundamental","funny","furious","future","fuzzy","gastric","gay","general","generous","genetic","gentle","genuine","geographical","giant","gigantic","given","glad","glamorous","gleaming","global","glorious","golden","good","gorgeous","gothic","governing","graceful","gradual","grand","grateful","greasy","great","grieving","grim","gross","grotesque","growing","grubby","grumpy","guilty","handicapped","handsome","happy","hard","harsh","head","healthy","heavy","helpful","helpless","hidden","high","hilarious","hissing","historic","historical","hollow","holy","homeless","homely","hon","honest","horizontal","horrible","hostile","hot","huge","human","hungry","hurt","hushed","husky","icy","ideal","identical","ideological","ill","illegal","imaginative","immediate","immense","imperial","implicit","important","impossible","impressed","impressive","improved","inadequate","inappropriate","inc","inclined","increased","increasing","incredible","independent","indirect","individual","industrial","inevitable","influential","informal","inherent","initial","injured","inland","inner","innocent","innovative","inquisitive","instant","institutional","insufficient","intact","integral","integrated","intellectual","intelligent","intense","intensive","interested","interesting","interim","interior","intermediate","internal","international","intimate","invisible","involved","irrelevant","isolated","itchy","jealous","jittery","joint","jolly","joyous","judicial","juicy","junior","just","keen","key","kind","known","labour","large","late","latin","lazy","leading","left","legal","legislative","legitimate","lengthy","lesser","level","lexical","liable","liberal","light","like","likely","limited","linear","linguistic","liquid","literary","little","live","lively","living","local","logical","lonely","long","loose","lost","loud","lovely","low","loyal","ltd","lucky","mad","magic","magnetic","magnificent","main","major","male","mammoth","managerial","managing","manual","many","marginal","marine","marked","married","marvellous","marxist","mass","massive","mathematical","mature","maximum","mean","meaningful","mechanical","medical","medieval","melodic","melted","mental","mere","metropolitan","mid","middle","mighty","mild","military","miniature","minimal","minimum","ministerial","minor","miserable","misleading","missing","misty","mixed","moaning","mobile","moderate","modern","modest","molecular","monetary","monthly","moral","motionless","muddy","multiple","mushy","musical","mute","mutual","mysterious","naked","narrow","nasty","national","native","natural","naughty","naval","near","nearby","neat","necessary","negative","neighbouring","nervous","net","neutral","new","nice","noble","noisy","normal","northern","nosy","notable","novel","nuclear","numerous","nursing","nutritious","nutty","obedient","objective","obliged","obnoxious","obvious","occasional","occupational","odd","official","ok","okay","old","olympic","only","open","operational","opposite","optimistic","oral","ordinary","organic","organisational","original","orthodox","other","outdoor","outer","outrageous","outside","outstanding","overall","overseas","overwhelming","painful","pale","panicky","parallel","parental","parliamentary","partial","particular","passing","passive","past","patient","payable","peaceful","peculiar","perfect","permanent","persistent","personal","petite","philosophical","physical","plain","planned","plastic","pleasant","pleased","poised","polite","political","poor","popular","positive","possible","potential","powerful","practical","precious","precise","preferred","pregnant","preliminary","premier","prepared","present","presidential","pretty","previous","prickly","primary","prime","primitive","principal","printed","prior","private","probable","productive","professional","profitable","profound","progressive","prominent","promising","proper","proposed","prospective","protective","protestant","proud","provincial","psychiatric","psychological","public","puny","pure","purring","puzzled","quaint","qualified","quarrelsome","querulous","quick","quickest","quiet","quintessential","quixotic","racial","radical","rainy","random","rapid","rare","raspy","rational","ratty","raw","ready","real","realistic","rear","reasonable","recent","reduced","redundant","regional","registered","regular","regulatory","related","relative","relaxed","relevant","reliable","relieved","religious","reluctant","remaining","remarkable","remote","renewed","representative","repulsive","required","resident","residential","resonant","respectable","respective","responsible","resulting","retail","retired","revolutionary","rich","ridiculous","right","rigid","ripe","rising","rival","roasted","robust","rolling","romantic","rotten","rough","round","royal","rubber","rude","ruling","running","rural","sacred","sad","safe","salty","satisfactory","satisfied","scared","scary","scattered","scientific","scornful","scrawny","screeching","secondary","secret","secure","select","selected","selective","selfish","semantic","senior","sensible","sensitive","separate","serious","severe","sexual","shaggy","shaky","shallow","shared","sharp","sheer","shiny","shivering","shocked","short","shrill","shy","sick","significant","silent","silky","silly","similar","simple","single","skilled","skinny","sleepy","slight","slim","slimy","slippery","slow","small","smart","smiling","smoggy","smooth","social","socialist","soft","solar","sole","solid","sophisticated","sore","sorry","sound","sour","southern","soviet","spare","sparkling","spatial","special","specific","specified","spectacular","spicy","spiritual","splendid","spontaneous","sporting","spotless","spotty","square","squealing","stable","stale","standard","static","statistical","statutory","steady","steep","sticky","stiff","still","stingy","stormy","straight","straightforward","strange","strategic","strict","striking","striped","strong","structural","stuck","stupid","subjective","subsequent","substantial","subtle","successful","successive","sudden","sufficient","suitable","sunny","super","superb","superior","supporting","supposed","supreme","sure","surprised","surprising","surrounding","surviving","suspicious","sweet","swift","symbolic","sympathetic","systematic","tall","tame","tart","tasteless","tasty","technical","technological","teenage","temporary","tender","tense","terrible","territorial","testy","then","theoretical","thick","thin","thirsty","thorough","thoughtful","thoughtless","thundering","tight","tiny","tired","top","tory","total","tough","toxic","traditional","tragic","tremendous","tricky","tropical","troubled","typical","ugliest","ugly","ultimate","unable","unacceptable","unaware","uncertain","unchanged","uncomfortable","unconscious","underground","underlying","unemployed","uneven","unexpected","unfair","unfortunate","unhappy","uniform","uninterested","unique","united","universal","unknown","unlikely","unnecessary","unpleasant","unsightly","unusual","unwilling","upper","upset","uptight","urban","urgent","used","useful","useless","usual","vague","valid","valuable","variable","varied","various","varying","vast","verbal","vertical","very","vicarious","vicious","victorious","violent","visible","visiting","visual","vital","vitreous","vivacious","vivid","vocal","vocational","voiceless","voluminous","voluntary","vulnerable","wandering","warm","wasteful","watery","weak","wealthy","weary","wee","weekly","weird","welcome","well","western","wet","whispering","whole","wicked","wide","widespread","wild","wilful","willing","willowy","wily","wise","wispy","wittering","witty","wonderful","wooden","working","worldwide","worried","worrying","worthwhile","worthy","written","wrong","xenacious","xenial","xenogeneic","xenophobic","xeric","xerothermic","yabbering","yammering","yappiest","yappy","yawning","yearling","yearning","yeasty","yelling","yelping","yielding","yodelling","young","youngest","youthful","ytterbic","yucky","yummy","zany","zealous","zeroth","zestful","zesty","zippy","zonal","zoophagous","zygomorphic","zygotic"],wte=["amaranth","amber","amethyst","apricot","aqua","aquamarine","azure","beige","black","blue","blush","bronze","brown","chocolate","coffee","copper","coral","crimson","cyan","emerald","fuchsia","gold","gray","green","harlequin","indigo","ivory","jade","lavender","lime","magenta","maroon","moccasin","olive","orange","peach","pink","plum","purple","red","rose","salmon","sapphire","scarlet","silver","tan","teal","tomato","turquoise","violet","white","yellow"];let Rx;const xPe=new Uint8Array(16);function wPe(){if(!Rx&&(Rx=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Rx))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Rx(xPe)}const vi=[];for(let t=0;t<256;++t)vi.push((t+256).toString(16).slice(1));function SPe(t,e=0){return(vi[t[e+0]]+vi[t[e+1]]+vi[t[e+2]]+vi[t[e+3]]+"-"+vi[t[e+4]]+vi[t[e+5]]+"-"+vi[t[e+6]]+vi[t[e+7]]+"-"+vi[t[e+8]]+vi[t[e+9]]+"-"+vi[t[e+10]]+vi[t[e+11]]+vi[t[e+12]]+vi[t[e+13]]+vi[t[e+14]]+vi[t[e+15]]).toLowerCase()}const _Pe=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Kz={randomUUID:_Pe};function kPe(t,e,n){if(Kz.randomUUID&&!e&&!t)return Kz.randomUUID();t=t||{};const r=t.random||(t.rng||wPe)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,e){n=n||0;for(let i=0;i<16;++i)e[n+i]=r[i];return e}return SPe(r)}function Kn(){return kPe()}function xT(t){return t||Kn()}function CPe(t,e){const n=JSON.stringify({filenameGlob:e,key:t});return`${Y.JSON_SOURCE_PREFIX}${n}`}function Ste(t,e,n){return e?CPe([...n,...t],e):Kn()}function EPe(t){const e={dictionaries:[xte,wte],separator:"_",length:2};let n;for(;!n||t.includes(n);)n=bte(e);return n}function Fm(){return bte({dictionaries:[xte,wte],separator:"_",length:2})}const TPe={id:null,name:"",previewImgColor:"bg-blue-500/60 dark:bg-blue-600/30",viewport:null,children:{}},PPe={id:null,name:"",size:{width:"auto",height:"auto"},parentId:null,variantId:null,uiTypeId:null,uiTypeColId:null,social:"",artifactGroupIds:[],defaultVariantId:null,variantIds:[],paramSweepSectionId:null,nonPresetUITypeIds:[],codeLanguage:"python",configLanguage:"python",runInMemory:!1,isFrozen:!1,isHorizontalOrientation:!1,hideParams:!1,hideSearch:!1,hideUnpinnedParams:!1,displayMode:"GUI",pinnedAreaHeight:"auto",isMinimized:!1,canvasSettings:{activeLayerId:null,color:"#ff0000",brushSize:16,brushShape:"butt",eraserBrushSize:16,drawThrottleDelay:0,canvasTransferQueueLength:50,artifactIdUsedToSetCanvasSize:null,mode:"draw"},chartSettings:{type:"line",xAxisColumn:"",secondYAxisColumns:[],xAxisLog:!1,y1AxisLog:!1,y2AxisLog:!1},isTemporary:!1,isReadOnlyTerminal:!1,renderMarkdown:!1,positionAndSizeLocked:!1,jsonSource:"",jsonSourceKeys:[],selectedVariantIds:{},paramFilter:"",jsonSourceMissing:!1,isInOtherProjectConfigs:!1,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0,columnWidth:null,renderedValue:null,subprocessStartMethod:"fork"},APe={name:"",values:{},children:[],selectedItem:null,code:"",codeInfoColId:null,description:"",evRefs:[],templateVars:[],isFrozen:!1,sweep:[],runGroup:{}},RPe={id:null,name:"",editable:!1,rcType:"parameter",defaultVal:"",description:"",positionalOnly:!1,isPinned:!1,isFrozen:!1,isSelected:!1,evRefs:[],ignoreTypeErrors:!1},$Pe={children:{null:[]}},MPe={id:null,type:"TEXT",name:"",presetType:"BASE",config:{}},IPe={value:"",evRefs:[]},DPe={selected:!0,paramSweeps:{},versions:{}},LPe={uiTypeId:"3fdaeb6a-e989-4888-b844-17a76f0b0192",nonPresetUITypeIds:[]},NPe={sectionId:null,paramInfoId:null,isArgsObj:!1,startPos:0,keyword:""},QPe={name:"",path:"",value:null,type:""},Ld={projectConfig:TPe,section:PPe,sectionVariant:APe,codeInfo:RPe,codeInfoCol:$Pe,uiType:MPe,evEntry:IPe,runGroupEntry:DPe,uiTypeColEntry:LPe,evRefEntry:NPe,artifact:QPe};function k5(){return ae.cloneDeep(Ld.codeInfoCol)}function p$({uiType:t,currValue:e}){switch(t.type){case Y.TEXT:case Y.PASSWORD:return jPe({currValue:e});case Y.SLIDER:return BPe({uiType:t,currValue:e});case Y.SWITCH:return zPe({currValue:e});case Y.COLOR_PICKER:return FPe({currValue:e});case Y.DROPDOWN:return WPe({currValue:e});default:return""}}function jPe({currValue:t}){return ae.isNil(t)?"":t}function BPe({uiType:t,currValue:e}){const n=ae.toNumber(e);return ae.isFinite(n)?ae.toString(Hc(n,t.config.min,t.config.max)):ae.toString(t.config.min)}function zPe({currValue:t}){return ae.isNil(t)||t==="0"?"false":"true"}function FPe({currValue:t}){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/.test(t)?t:"#ff0000"}function WPe({currValue:t}){return ae.isNil(t)?"":t}function Wm(){return ae.cloneDeep(Ld.evEntry)}function El(t){t?Ra.setState({open:t}):Ra.getState().reset()}function au(t,e){Ra.setState({modalType:t,modalData:e,open:!0})}function _te(){au(br.LOAD_PROJECT_CONFIG)}function kte(){au(br.SAVE_PROJECT_CONFIG_AS)}function VPe(){au(br.SAVE_PROJECT_CONFIG_AS_WITH_REFS)}function UPe(){au(br.EXPORT_JSON)}function qPe(){au(br.IMPORT_JSON)}function XPe(t){au(br.DELETE_PROJECT_WARNING,t)}function HPe(...t){au(br.RENAME_REFERENCES,t)}function ZPe(t){au(br.DELETE_JSON_SOURCE_FILE,t)}function YPe(t){au(br.ADD_ARTIFACT_BY_FILEPATH,t)}function m$(t){return t.split(";base64,")[1]}function Cte(t){return m$(t.toDataURL("image/png"))}async function g$(t){const e=GPe(t),n=new Image;return n.src=e,await n.decode(),n}function GPe(t){return t.startsWith("data:image/")?t:`data:image/png;base64,${t}`}async function KPe(t){return await jt({body:{artifactIds:t},address:Y.ROUTE_LOAD_ARTIFACTS})}async function JPe(t){return await jt({body:{sectionType:t},address:Y.ROUTE_LOAD_AVAILABLE_ARTIFACTS})}async function eAe(t){return await jt({body:{filepath:t},address:Y.ROUTE_CHECK_IF_FILE_EXISTS})}async function tAe(t,e){return await jt({body:{filepath:t,type:e},address:Y.ROUTE_LOAD_ARTIFACT_FROM_DISK})}async function nAe(t){return await jt({body:{base64Str:t},address:Y.ROUTE_READ_CSV_BASE64})}async function rAe(t){return await jt({body:{namesPathsTypes:t},address:Y.ROUTE_GET_ARTIFACT_IDS_FROM_NAME_PATH_TYPE})}function iAe(t,e){let n;for(let r of t)r>=e&&(n===void 0||r-e<n-e)&&(n=r);return n}function sAe(t,e){const n=[],{fullNameToInfo:r}=Dd.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);if(s in r){const o=r[s];n.push({sectionId:o.sectionId,paramInfoId:o.paramInfoId,isArgsObj:o.isArgsObj,startPos:i.startPos,keyword:s})}}return n}function oAe(t,e){const n=[],{fullNameToSectionId:r}=O5.getState();for(const i of t){const s=e.substring(i.startPos,i.endPos);s in r&&n.push({sectionId:r[s],startPos:i.startPos,keyword:s})}return n}function Ete(){const t={};for(const[e,n]of Object.entries(Dd.getState().fullNameToInfo))t[Tte({sectionId:n.sectionId,paramInfoId:n.paramInfoId,isArgsObj:n.isArgsObj})]=e;return t}function Tte({sectionId:t,paramInfoId:e=null,isArgsObj:n=!1}){return JSON.stringify([t,e,n])}function aAe({fullNameToInfo:t,keyword:e,sectionId:n,paramInfoId:r}){return!(t[e].sectionId===n&&!t[e].paramInfoId||t[e].sectionId===n&&t[e].paramInfoId===r)}function v$({sectionId:t,paramInfoId:e,value:n,regexPatternKey:r}){let i;const s=new Set,{[r]:o,fullNameToInfo:a}=Dd.getState();for(;i=o.exec(n);)aAe({fullNameToInfo:a,keyword:i[0],sectionId:t,paramInfoId:e})&&s.add([i[0],i.index]);return Array.from(s)}function O$(t,e){let n;const r=[],{pattern:i,fullNameToSectionId:s}=O5.getState();for(;n=i.exec(e);)s[n[0]]!==t&&r.push([n[0],n.index]);return r}function lAe(t){const e=t.indexOf(Y.TEMPLATE_PREFIX,t.indexOf(Y.TEMPLATE_PREFIX)+1);return t.substring(e)}async function cAe(){return await jt({body:{},address:Y.ROUTE_ALL_PROJECT_CONFIG_METADATA})}async function Jz(){return await jt({body:{},address:Y.ROUTE_LOAD_PROJECT_CONFIG_NAMES})}async function uAe(t){return await jt({body:{projectConfigName:t},address:Y.ROUTE_LOAD_PROJECT_CONFIG})}async function fAe({excludeProjectConfigName:t}){return await jt({body:{excludeProjectConfigName:t},address:Y.ROUTE_LOAD_FULL_PROJECT})}async function hAe({name:t,previewImgColor:e}){return await jt({address:Y.ROUTE_CREATE_PROJECT_CONFIG,body:{name:t,previewImgColor:e}})}async function dAe({project:t}){return await jt({address:Y.ROUTE_SAVE_PROJECT,body:{project:t}})}async function pAe({project:t,newConfigName:e,withRefs:n}){return await jt({address:Y.ROUTE_SAVE_AS_NEW_PROJECT_CONFIG,body:{project:t,newConfigName:e,withRefs:n}})}async function mAe({project:t,configName:e}){return await jt({address:Y.ROUTE_SAVE_AS_EXISTING_PROJECT_CONFIG,body:{project:t,configName:e}})}async function gAe(t){return await jt({address:Y.ROUTE_DELETE_PROJECT_CONFIGS,body:{ids:t}})}async function vAe(){return await jt({address:Y.ROUTE_GET_DEFAULT_CONFIG_NAME,body:{}})}async function OAe(t){return await jt({address:Y.ROUTE_SET_AS_DEFAULT_PROJECT,body:{projectId:t}})}async function yAe(t){return await jt({address:Y.ROUTE_FILTER_DATA_FOR_JSON_EXPORT,body:{project:t}})}async function bAe(t){return await jt({address:Y.ROUTE_ADD_DEFAULT_DATA_FOR_JSON_IMPORT,body:{project:t}})}async function eF(t){return await jt({address:Y.ROUTE_SAVE_SETTINGS,body:{settings:t}})}async function xAe(){return await jt({address:Y.ROUTE_LOAD_SETTINGS,body:{}})}async function wAe(t){return await jt({address:Y.ROUTE_SAVE_SETTINGS_PROJECT,body:{settingsProject:t}})}async function SAe(){return await jt({address:Y.ROUTE_LOAD_SETTINGS_PROJECT,body:{}})}function Pte({name:t,...e}){return ae.merge(ae.cloneDeep(Ld.artifact),{name:t??Fm()},e)}function Ate({name:t,...e}){return{name:t??Fm(),artifactTransforms:[],visible:!0,layerOpacity:.5,brushOpacity:1,...e}}function y$(t,e,n){return{artifactId:t,..._Ae(e,n)}}function _Ae(t,e){switch(t){case Y.DRAW:return{transform:[1,0,0,1,0,0],eraserStrokes:e==="img"?[]:{}};case Y.IMAGE:case Y.CHART:return{};default:return{}}}const b$=ae.throttle(()=>{if(c_.temporal.getState().pastStates.length<=1)return;const e=c_.getState().version;for(const n of Mm[Rd.PROJECT_STATE])n.temporal&&e===n.getState().version&&(n.temporal.getState().undo(2),kAe(n));w$(),Ut.setState({undoOrRedoWasTriggered:!0})},100);function kAe(t){t.temporal.setState(e=>({pastStates:[...e.pastStates,t.getState()],futureStates:Rte(e.futureStates)}))}function Rte(t){const e=[],n=new Set;for(const r of t)n.has(r.version)||(e.push(r),n.add(r.version));return e}const x$=ae.throttle(()=>{const t=c_.getState().version;for(const e of Mm[Rd.PROJECT_STATE])e.temporal&&t===e.getState().version&&(e.temporal.getState().redo(),CAe(e));w$(),Ut.setState({undoOrRedoWasTriggered:!0})},100);function CAe(t){t.temporal.setState(e=>({pastStates:Rte([...e.pastStates,t.getState()])}))}function EAe(t){let e=!1;for(const r of t)if(r.temporal&&!ae.isEqual(r.getState(),r.temporal.getState().pastStates.at(-1))){e=!0;break}if(!e)return;const n=c_.getState().version;for(const r of t)r.temporal&&(r.setState({version:n+1}),TAe(r,()=>r.setState({})))}function TAe(t,e){t.temporal.getState().resume(),e(),t.temporal.getState().pause()}const hn=ae.throttle((t,e=!0)=>{t&&(EAe(Mm[Rd.PROJECT_STATE]),e&&w$())},500),w$=ae.debounce(()=>{Nt.getState().backend.autosave&&j5()},1e3);async function PAe(t,e,n){const r=await KPe(e);if(r.status===200){const i=ae.cloneDeep(r.data);if(await AAe(i),n!=null&&n.aborted)return;fi.setState(s=>({x:{...s.x,...i}})),te.setState(s=>{Lte(e,t,s)}),hn(!0)}}async function AAe(t){for(const e of Object.values(t))e.value=await $te(e.type,e.value)}async function $te(t,e){switch(t){case"img":return await g$(e);case"list":case"brushStrokes":return e}}async function RAe(t,e){switch(t){case"img":return await g$(e);case"list":const n=await nAe(m$(e));if(n.status==200)return n.data;default:return null}}function $Ae(){const t={};for(const[e,n]of Object.entries(fi.getState().x))typeof n!="function"&&(n.type==="img"&&n.value instanceof Image?t[e]={...n,value:m$(n.value.src)}:t[e]=n);return t}function Mte(t,e){const n=Kn(),r="brushStrokes";fi.setState(s=>({x:{...s.x,[n]:Pte({type:r,value:[]})}}));const i=Kn();e.artifactGroups[i]=Ate({artifactTransforms:[y$(n,Y.DRAW,r)]}),e.x[t].artifactGroupIds.push(i),e.x[t].canvasSettings.activeLayerId=i}function Ite({sectionId:t,sectionTypeName:e,artifactId:n,artifactType:r,createNewArtifactGroup:i=!1,add:s,state:o}){let a=MAe(t,e,o),l;if(s){(!a||i)&&(a=Kn(),o.artifactGroups[a]=Ate({}),o.x[t].artifactGroupIds.unshift(a));const c=y$(n,e,r);l=o.artifactGroups[a],e===Y.DRAW||e===Y.CHART?l.artifactTransforms.push(c):l.artifactTransforms=[c]}else l=o.artifactGroups[a],l&&(l.artifactTransforms=l.artifactTransforms.filter(c=>c.artifactId!==n));l&&Lte(l.artifactTransforms.map(c=>c.artifactId),t,o)}async function Dte({sectionId:t,createNewArtifactGroup:e,value:n,artifactType:r,path:i=""}){const s=Kn();fi.setState(o=>({x:{...o.x,[s]:Pte({value:n,path:i,type:r})}})),te.setState(o=>{const a=dn(t,o);Ite({sectionId:t,sectionTypeName:a,artifactId:s,artifactType:r,createNewArtifactGroup:e,add:!0,state:o})})}function MAe(t,e,n){switch(e){case Y.DRAW:return n.x[t].canvasSettings.activeLayerId;case Y.IMAGE:case Y.CHART:return n.x[t].artifactGroupIds[0]}}function Lte(t,e,n){dn(e,n)===Y.CHART&&Nte(t,e,n)}function Nte(t,e,n){const{chartSettings:r}=n.x[e],i=S$(t.map(o=>fi.getState().x[o]),r.type),s=Object.keys(i);Ut.setState(o=>({chartDisplayedSeriesNames:{...o.chartDisplayedSeriesNames,[e]:s}}))}function S$(t,e){switch(e){case"line":return IAe(t);case"scatter":return DAe(t);default:return{}}}function IAe(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value)){const s=t.length===1?r:`${n.name}/${r}`;e[s]=[...i]}return e}function DAe(t){const e={};for(const n of t)for(const[r,i]of Object.entries(n.value))r in e||(e[r]=[]),e[r].push(...i);return e}function _$(t){return JSON.stringify([t.name,t.path,t.type])}function Qte(t,e,n,r,i,s=null,o=null){const a=[],l=n.filter(f=>i(t[f])).reverse(),c=new Set,u=s?{}:null;for(s&&l.forEach(f=>u[f]=s(t[f])?[f]:[]);l.length>0;){const f=l.pop();if(!f||c.has(f))continue;c.add(f);const h=t[f];if(r(h)&&a.push(h.id),i(h)){const d=e[h.id].slice().reverse();if(s){const p=u[f];d.forEach(g=>{u[g]=s(t[g])?[...p,g]:[...p]})}l.push(...d)}if(a.length>0&&(o!=null&&o(t[a[a.length-1]])))return{ids:a,pathMap:u,earlyReturnTriggered:!0}}return{ids:a,pathMap:u,earlyReturnTriggered:!1}}function k$({allCodeInfo:t,codeInfoChildren:e,startingId:n,additionalOutputCondition:r=null,paramPathCondition:i=null,earlyReturnCondition:s=null}){const o=n?[n]:e[n];return Qte(t,e,o??[],l=>(l==null?void 0:l.rcType)===Y.PARAMETER&&(!r||r(l)),n?()=>!0:l=>(l==null?void 0:l.rcType)===Y.PARAMETER,i,s)}function LAe(t,e){return Qte(t,e,e[null]??[],()=>!0,()=>!0)}function _y(t){return k$({...t,paramPathCondition:e=>e.rcType===Y.PARAMETER})}function rO(t,e,n,r){const{ids:i,pathMap:s}=_y({allCodeInfo:e,codeInfoChildren:n,startingId:r});i.reverse();let o=[];const a=new Set,l={};for(const c of i)if(Y8e(e[c].isPinned,t)&&(n[c].length===0||n[c].some(u=>u in l)))for(const u of s[c])l[u]=s[u],a.has(s[c][0])||(o.push(s[c][0]),a.add(s[c][0]));return o.reverse(),{requiredParamIdsToPaths:l,topLevelParamIds:o}}function C$(t,e,n){if(e[n].length===1)return t[e[n][0]].name;{let r="";for(const[i,s]of e[n].entries())i===0?r=t[s].name:r+=`["${t[s].name}"]`;return r}}function jte(t,e,n){const{selectedItem:r}=Yt(t,e),i=Jo(t,e).children,{earlyReturnTriggered:s}=k$({allCodeInfo:e.codeInfo,codeInfoChildren:i,startingId:r,earlyReturnCondition:n});return s}function NAe(t,e){return jte(t,e,n=>(n==null?void 0:n.rcType)===Y.PARAMETER)}function QAe(t,e){return jte(t,e,n=>n==null?void 0:n.isSelected)}function Bte(t,e){const{hideUnpinnedParams:n}=e.x[t],{codeInfoChildren:r,parentCodeInfoId:i}=Ry(t,e);let s=rO(!0,e.codeInfo,r,i);s=Object.keys(s.requiredParamIdsToPaths),s.reverse();let o=[];return n||(o=rO(!1,e.codeInfo,r,i),o=Object.keys(o.requiredParamIdsToPaths),o.reverse()),[...s,...o]}function jAe(t,e){return te(n=>{const r=Ll(t,n).values;return e in r?{value:r[e].value,evRefs:r[e].evRefs}:Wm()},ae.isEqual)}function zte(t){return te(e=>t?e.x[t].variantIds.map(n=>({id:n,name:e.variants[n].name})):[],ae.isEqual)}function BAe(t){return te(e=>{const n=e.x[t].parentId;return Ll(n).children.indexOf(t)})}function C5(t){return te(e=>Yt(t,e).isFrozen)}function Fte(t){return te(e=>({...Wte(t,e),variantIsFrozen:Yt(t,e).isFrozen}),ae.isEqual)}function Wte(t,e){return{renderMarkdown:e.x[t].renderMarkdown,description:Ll(t,e).description}}function zAe(t){return te(e=>{const n=z5(t,e),r=ky(t,e.x);return{forSectionId:r,variantId:n,paramSweep:e.variants[n].sweep,variantIsFrozen:Yt(t).isFrozen,showParamSweepSectionSearch:!e.x[r].hideSearch&&dn(r,e)!==Y.GLOBAL_VARIABLES}},ae.isEqual)}function FAe(t){const e=te(n=>n.x[t].paramSweepSectionId);return zte(e)}function ky(t,e){var n;return(n=Object.values(e).find(r=>r.paramSweepSectionId===t))==null?void 0:n.id}async function WAe(t,e){switch(dn(t)){case Y.PARAM_SWEEP:return await UAe(t,e);case Y.GLOBAL_PARAM_SWEEP:return await qAe(e);case Y.GLOBAL_VARIABLES:case Y.SECTION:return await VAe(e)}}async function VAe(t){const e=te.getState(),{codeInfoChildren:n,parentCodeInfoId:r}=Ry(null,e,t),i=e.codeInfo,s=rO(!0,i,n,r),o=rO(!1,i,n,r);s.requiredParamIds=Object.keys(s.requiredParamIdsToPaths),o.requiredParamIds=Object.keys(o.requiredParamIdsToPaths),delete s.requiredParamIdsToPaths,delete o.requiredParamIdsToPaths;const a=e.variants[t];return await jt({body:{codeInfo:i,codeInfoChildren:n,sectionVariant:a,pinnedIds:s,unpinnedIds:o},address:Y.ROUTE_SECTION_TO_YAML})}async function UAe(t,e){const n=te.getState(),r=ky(t,n.x),s=n.variants[e].sweep,o=n.codeInfo,l=(Nne(r,n)??k5()).children;return await jt({body:{sweep:s,codeInfo:o,codeInfoChildren:l},address:Y.ROUTE_PARAM_SWEEP_SECTION_TO_YAML})}async function qAe(t){const e=te.getState(),n=e.x,r=e.variants,i=r[t].runGroup;return await jt({body:{runGroup:i,sections:n,sectionVariants:r},address:Y.ROUTE_GLOBAL_PARAM_SWEEP_SECTION_TO_YAML})}function E5({id:t,...e}){return ae.merge(ae.cloneDeep(Ld.codeInfo),{id:xT(t)},e)}const E$=Symbol.for("yaml.alias"),wT=Symbol.for("yaml.document"),uf=Symbol.for("yaml.map"),Vte=Symbol.for("yaml.pair"),Zc=Symbol.for("yaml.scalar"),Vm=Symbol.for("yaml.seq"),Ko=Symbol.for("yaml.node.type"),Um=t=>!!t&&typeof t=="object"&&t[Ko]===E$,T5=t=>!!t&&typeof t=="object"&&t[Ko]===wT,Cy=t=>!!t&&typeof t=="object"&&t[Ko]===uf,Dr=t=>!!t&&typeof t=="object"&&t[Ko]===Vte,Jn=t=>!!t&&typeof t=="object"&&t[Ko]===Zc,Ey=t=>!!t&&typeof t=="object"&&t[Ko]===Vm;function Ar(t){if(t&&typeof t=="object")switch(t[Ko]){case uf:case Vm:return!0}return!1}function Vr(t){if(t&&typeof t=="object")switch(t[Ko]){case E$:case uf:case Zc:case Vm:return!0}return!1}const XAe=t=>(Jn(t)||Ar(t))&&!!t.anchor,Ch=Symbol("break visit"),HAe=Symbol("skip children"),ev=Symbol("remove node");function md(t,e){const n=ZAe(e);T5(t)?tp(null,t.contents,n,Object.freeze([t]))===ev&&(t.contents=null):tp(null,t,n,Object.freeze([]))}md.BREAK=Ch;md.SKIP=HAe;md.REMOVE=ev;function tp(t,e,n,r){const i=YAe(t,e,n,r);if(Vr(i)||Dr(i))return GAe(t,r,i),tp(t,i,n,r);if(typeof i!="symbol"){if(Ar(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=tp(s,e.items[s],n,r);if(typeof o=="number")s=o-1;else{if(o===Ch)return Ch;o===ev&&(e.items.splice(s,1),s-=1)}}}else if(Dr(e)){r=Object.freeze(r.concat(e));const s=tp("key",e.key,n,r);if(s===Ch)return Ch;s===ev&&(e.key=null);const o=tp("value",e.value,n,r);if(o===Ch)return Ch;o===ev&&(e.value=null)}}return i}function ZAe(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function YAe(t,e,n,r){var i,s,o,a,l;if(typeof n=="function")return n(t,e,r);if(Cy(e))return(i=n.Map)==null?void 0:i.call(n,t,e,r);if(Ey(e))return(s=n.Seq)==null?void 0:s.call(n,t,e,r);if(Dr(e))return(o=n.Pair)==null?void 0:o.call(n,t,e,r);if(Jn(e))return(a=n.Scalar)==null?void 0:a.call(n,t,e,r);if(Um(e))return(l=n.Alias)==null?void 0:l.call(n,t,e,r)}function GAe(t,e,n){const r=e[e.length-1];if(Ar(r))r.items[t]=n;else if(Dr(r))t==="key"?r.key=n:r.value=n;else if(T5(r))r.contents=n;else{const i=Um(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const KAe={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},JAe=t=>t.replace(/[!,[\]{}]/g,e=>KAe[e]);class ts{constructor(e,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},ts.defaultYaml,e),this.tags=Object.assign({},ts.defaultTags,n)}clone(){const e=new ts(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new ts(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:ts.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},ts.defaultTags);break}return e}add(e,n){this.atNextDocument&&(this.yaml={explicit:ts.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},ts.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return n(6,`Unsupported YAML version ${s}`,o),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,n){if(e==="!")return"!";if(e[0]!=="!")return n(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(n(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&n("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||n(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return n(String(o)),null}return r==="!"?e:(n(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[n,r]of Object.entries(this.tags))if(e.startsWith(r))return n+JAe(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&Vr(e.contents)){const s={};md(e.contents,(o,a)=>{Vr(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&n.push(`%TAG ${s} ${o}`);return n.join(`
92
92
  `)}}ts.defaultYaml={explicit:!1,version:"1.2"};ts.defaultTags={"!!":"tag:yaml.org,2002:"};function Ute(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(n)}return!0}function qte(t){const e=new Set;return md(t,{Value(n,r){r.anchor&&e.add(r.anchor)}}),e}function Xte(t,e){for(let n=1;;++n){const r=`${t}${n}`;if(!e.has(r))return r}}function e9e(t,e){const n=[],r=new Map;let i=null;return{onAnchor:s=>{n.push(s),i||(i=qte(t));const o=Xte(e,i);return i.add(o),o},setAnchors:()=>{for(const s of n){const o=r.get(s);if(typeof o=="object"&&o.anchor&&(Jn(o.node)||Ar(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}function np(t,e,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const o=r[i],a=np(t,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),o=np(t,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const s=np(t,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const o=np(t,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return t.call(e,n,r)}function Vo(t,e,n){if(Array.isArray(t))return t.map((r,i)=>Vo(r,String(i),n));if(t&&typeof t.toJSON=="function"){if(!n||!XAe(t))return t.toJSON(e,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(t,r),n.onCreate=s=>{r.res=s,delete n.onCreate};const i=t.toJSON(e,n);return n.onCreate&&n.onCreate(i),i}return typeof t=="bigint"&&!(n!=null&&n.keep)?Number(t):t}class T${constructor(e){Object.defineProperty(this,Ko,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!T5(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=Vo(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s=="function"?np(s,{"":a},"",a):a}}let P$=class extends T${constructor(e){super(E$),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e){let n;return md(e,{Node:(r,i)=>{if(i===this)return md.BREAK;i.anchor===this.source&&(n=i)}}),n}toJSON(e,n){if(!n)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=n,o=this.resolve(i);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(Vo(o,null,n),a=r.get(o)),!a||a.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=IS(i,o,r)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,n,r){const i=`*${this.source}`;if(e){if(Ute(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}};function IS(t,e,n){if(Um(e)){const r=e.resolve(t),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}else if(Ar(e)){let r=0;for(const i of e.items){const s=IS(t,i,n);s>r&&(r=s)}return r}else if(Dr(e)){const r=IS(t,e.key,n),i=IS(t,e.value,n);return Math.max(r,i)}return 1}const Hte=t=>!t||typeof t!="function"&&typeof t!="object";class Lt extends T${constructor(e){super(Zc),this.value=e}toJSON(e,n){return n!=null&&n.keep?this.value:Vo(this.value,e,n)}toString(){return String(this.value)}}Lt.BLOCK_FOLDED="BLOCK_FOLDED";Lt.BLOCK_LITERAL="BLOCK_LITERAL";Lt.PLAIN="PLAIN";Lt.QUOTE_DOUBLE="QUOTE_DOUBLE";Lt.QUOTE_SINGLE="QUOTE_SINGLE";const t9e="tag:yaml.org,2002:";function n9e(t,e,n){if(e){const r=n.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return n.find(r=>{var i;return((i=r.identify)==null?void 0:i.call(r,t))&&!r.format})}function iO(t,e,n){var f,h,d;if(T5(t)&&(t=t.contents),Vr(t))return t;if(Dr(t)){const p=(h=(f=n.schema[uf]).createNode)==null?void 0:h.call(f,n.schema,null,n);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=n;let l;if(r&&t&&typeof t=="object"){if(l=a.get(t),l)return l.anchor||(l.anchor=i(t)),new P$(l.anchor);l={anchor:null,node:null},a.set(t,l)}e!=null&&e.startsWith("!!")&&(e=t9e+e.slice(2));let c=n9e(t,e,o.tags);if(!c){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new Lt(t);return l&&(l.node=p),p}c=t instanceof Map?o[uf]:Symbol.iterator in Object(t)?o[Vm]:o[uf]}s&&(s(c),delete n.onTagObj);const u=c!=null&&c.createNode?c.createNode(n.schema,t,n):typeof((d=c==null?void 0:c.nodeClass)==null?void 0:d.from)=="function"?c.nodeClass.from(n.schema,t,n):new Lt(t);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function h_(t,e,n){let r=n;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return iO(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const b1=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;let Zte=class extends T${constructor(e,n){super(e),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(e){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(n.schema=e),n.items=n.items.map(r=>Vr(r)||Dr(r)?r.clone(e):r),this.range&&(n.range=this.range.slice()),n}addIn(e,n){if(b1(e))this.add(n);else{const[r,...i]=e,s=this.get(r,!0);if(Ar(s))s.addIn(i,n);else if(s===void 0&&this.schema)this.set(r,h_(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[n,...r]=e;if(r.length===0)return this.delete(n);const i=this.get(n,!0);if(Ar(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(e,n){const[r,...i]=e,s=this.get(r,!0);return i.length===0?!n&&Jn(s)?s.value:s:Ar(s)?s.getIn(i,n):void 0}hasAllNullValues(e){return this.items.every(n=>{if(!Dr(n))return!1;const r=n.value;return r==null||e&&Jn(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[n,...r]=e;if(r.length===0)return this.has(n);const i=this.get(n,!0);return Ar(i)?i.hasIn(r):!1}setIn(e,n){const[r,...i]=e;if(i.length===0)this.set(r,n);else{const s=this.get(r,!0);if(Ar(s))s.setIn(i,n);else if(s===void 0&&this.schema)this.set(r,h_(this.schema,i,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}};const r9e=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function Tc(t,e){return/^\n+$/.test(t)?t.substring(1):e?t.replace(/^(?! *$)/gm,e):t}const Xh=(t,e,n)=>t.endsWith(`
93
93
  `)?Tc(n,e):n.includes(`
94
94
  `)?`
@@ -353,7 +353,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
353
353
  rounded-full border-2 border-setta-300 bg-white shadow-sm drop-shadow-md hover:!bg-setta-100 hover:dark:!bg-setta-700 focus-visible:!border-blue-500 focus-visible:bg-blue-500 focus-visible:dark:bg-blue-700 focus-visible:outline-none dark:border-setta-400 dark:bg-setta-600 data-[disabled]:pointer-events-none`,textInputClassName:"hidden my-auto mr-[1px] h-5/6 w-8 cursor-auto resize-none rounded-lg border border-solid border-setta-300/20 bg-white px-2 text-center font-mono text-xs focus-visible:border-blue-300 dark:border-setta-875 dark:bg-setta-875 dark:text-setta-300 @[132px]/slider:block"})}case Y.SWITCH:return x.jsx(WD,{value:n,defaultVal:c,onChange:r,onEscape:d,isDisabled:h,outerDivClassName:"section-value flex justify-self-start self-center",twRootClasses:"nodrag"});case Y.COLOR_PICKER:const{colorChoices:p}=a.config;return x.jsx(FD,{colorChoices:p,value:n,onChange:r,onEscape:d,wrapperClassName:"section-value single-cell-container min-w-0 w-[calc(100%_-_2px)] justify-self-start self-center h-[calc(100%_-_4px)] min-h-0",colorPickerChoicesClasses:"flex-1 cursor-pointer items-center overflow-hidden rounded-lg single-cell-container colorpicker h-full min-h-0 w-full min-w-0 items-center text-white",isDisabled:h});case Y.DROPDOWN:const{choices:g}=a.config;return x.jsx(Ode,{choices:g,value:n,onChange:r,outerDivClasses:"section-value flex justify-self-start self-center [&_search]:my-auto",isDisabled:h});case Y.PASSWORD:return x.jsxs(x.Fragment,{children:[x.jsx(yde,{className:`${h?"":"cursor-text select-text"} nodrag section-value peer/textinput flex min-w-0 max-w-[calc(100%_-_1.1rem)] self-center justify-self-start font-mono text-xs text-[rgb(3,_47,_98);] dark:text-[rgb(165,_214,_255)]`,value:n,onChange:r,onEscape:d,isDisabled:h}),x.jsx("span",{className:`section-value grid-row-start-1 border-box self-end border-b border-setta-200/50 dark:border-setta-600/30 ${o?"":"peer-focus-within/textinput:border-blue-400"}`})]})}}function xct({dataSectionId:t,visualSectionId:e,paramInfoId:n,value:r,defaultVal:i,onChange:s,evRefs:o,isDisabled:a}){const{uiType:l,configLanguage:c}=te(h=>({uiType:Hy(t,n,h),configLanguage:h.x[t].configLanguage}),ae.isEqual),u=VD({dataSectionId:t,paramInfoId:n}),f=Ut(h=>h.isSelectingParams);switch(l.type){default:return x.jsxs(x.Fragment,{children:[x.jsx(nk,{dataSectionId:t,visualSectionId:e,paramInfoId:n,value:r,defaultVal:i,onChange:s,dummyCodeClassName:"section-key-value peer/textinput self-end grid-row-start-1 mx-3 py-[.125rem] nodrag cursor-text select-text break-words px-0 font-mono text-xs [tab-size:4] [word-break:break-word]",realCodeClassName:"section-key-value peer/textinput self-end grid-row-start-1 py-[.125rem] mx-3 nodrag [&_*]:!outline-0 cursor-text select-text [&_.cm-activeLine]:!px-0 [&_.cm-activeLine]:!bg-setta-200/10 [&_.cm-content]:!py-0 [&_.cm-content]:!px-0 [&_.cm-line]:!px-0 [&_.cm-content]:text-xs first:[&_.cm-line>*]:mt-[3px]",language:c,evRefs:o,isDisabled:a}),u&&x.jsx("i",{className:"section-value gg-spinner self-center justify-self-end text-blue-500/70"}),x.jsx("span",{className:`section-key-value grid-row-start-1 border-box mx-3 self-end border-b border-setta-200/50 ${f?"":"peer-focus-within/textinput:border-blue-400"} dark:border-setta-600/30`})]});case Y.SLIDER:{const{min:p,max:g,step:m}=l.config;return x.jsx(wm,{value:r,defaultVal:i,onChange:s,min:p,max:g,step:m,isDisabled:a,wrapperDivClass:"section-key-value flex gap-1 ml-2",sliderRootClassName:"data[orientation='vertical']:flex-col data[orientation='vertical']:w-5 data[orientation='vertical']:h-24 SliderRoot relative flex w-full touch-none select-none items-center data-[orientation='horizontal']:h-5",sliderTrackClassName:"relative flex-grow rounded-full bg-setta-200 data-[orientation='horizontal']:h-[3px] data-[orientation='vertical']:w-[3px] dark:bg-setta-700",sliderRangeClassName:"absolute h-full rounded-full bg-blue-500",sliderThumbClassName:`${YR} block h-3 w-3 cursor-pointer
354
354
  rounded-full border-2 border-setta-300 bg-white shadow-sm drop-shadow-md hover:bg-setta-100 focus:border-blue-500 focus-visible:outline-none dark:border-setta-400 dark:bg-setta-600`,textInputClassName:"w-8 cursor-auto resize-none rounded-lg border border-solid border-setta-300/20 bg-white px-2 text-center font-mono text-xs focus-visible:border-blue-300 dark:border-setta-875 dark:bg-setta-875 dark:text-setta-300"})}case Y.SWITCH:return x.jsx(WD,{value:r,defaultVal:i,onChange:s,isDisabled:a,outerDivClassName:"section-key-value flex justify-self-start self-center ml-2",twRootClasses:"nodrag"});case Y.COLOR_PICKER:const{colorChoices:h}=l.config;return x.jsx(FD,{colorChoices:h,value:r,onChange:s,wrapperClassName:"section-key-value single-cell-container w-[calc(100%_-_1.25rem)] min-h-0 flex justify-self-start self-center ml-2",colorPickerChoicesClasses:"flex-1 cursor-pointer items-center overflow-hidden rounded-lg single-cell-container colorpicker h-full min-h-0 w-full min-w-0 items-center text-white",isDisabled:a});case Y.DROPDOWN:const{choices:d}=l.config;return x.jsx(Ode,{choices:d,value:r,onChange:s,outerDivClasses:"section-key-value w-[calc(100%_-_1.15rem)] ml-2 flex justify-self-start self-center [&_search]:my-auto",isDisabled:a});case Y.PASSWORD:return x.jsx(yde,{className:`${a?"":"cursor-text select-text"} nodrag section-value flex self-center justify-self-start`,value:r,onChange:s,isDisabled:a})}}function wct(t){const e=pFe[t.type];return rI(t)?`${t.name} - (${e})`:e}function Sct(t,e,n,r){const i=[],s=ae.filter(t,n);for(const o of Object.values(t))if(!(!e(o)||!iI(o)))if(Jse(o))if(o.id===r)i.push(o);else{const a=s.find(l=>l.type===o.type);i.push(a??o)}else i.push(o);return i.map(o=>({id:o.id,name:wct(o),presetType:o.presetType,displayType:o.presetType??Y.PRESET_UI_TYPE_BASE}))}function _ct(t,e,n){return te(r=>{const i=Sle(t,e,"nonPresetUITypeIds",r),s=a=>Y.NON_SECTION_TYPES.includes(a.type),o=a=>toe(a,i);return Sct(r.uiTypes,s,o,n)},ae.isEqual)}function kct({onDropdownSelect:t,selectedId:e,availableUITypes:n}){const r=ae.groupBy(n,"displayType"),i=Object.keys(r).map(s=>({group:s,items:r[s]}));return x.jsx(Yd,{allItems:i,value:e,onSelectedItemChange:t})}function Cct({sectionId:t,paramInfoId:e,selectedId:n,...r}){const i=_ct(t,e,n);return x.jsx(kct,{availableUITypes:i,selectedId:n,...r})}function Ect({onDropdownSelect:t,selectedId:e,selectedType:n,onConfigChange:r,sectionId:i,paramInfoId:s,config:o}){return x.jsxs(x.Fragment,{children:[x.jsx(Cct,{sectionId:i,paramInfoId:s,onDropdownSelect:t,selectedId:e}),x.jsx(yct,{name:n,config:o,onChange:r})]})}const Tct=ke.memo($ct,ae.isEqual),Pct=ke.forwardRef(({sectionId:t},e)=>{const n=mfe(t);return x.jsx(Rct,{sectionId:t,paramInfos:n})}),Act=ke.memo(Pct);function Rct({sectionId:t,paramInfos:e}){const[n,r]=MM(e,["name"],50),i="flex-grow outline-0 min-w-0 w-full cursor-auto bg-transparent [border-width:0_0_1px_0] border-solid border-setta-200 dark:border-setta-800 focus-visible:!border-blue-300 pl-5 py-1 truncate placeholder-setta-400 dark:placeholder-setta-700 text-sm";return x.jsxs("div",{className:"flex flex-1 flex-col gap-1 overflow-y-hidden",children:[x.jsx(Ud,{inputStyles:i,placeholder:"Filter",leftElement:x.jsx("i",{className:"gg-sort-az !scale-75 text-setta-600 dark:text-setta-400"}),onChange:s=>r(s.target.value)}),x.jsx("div",{className:"mt-4 flex flex-col gap-2 overflow-y-scroll [&>*]:mx-[2px]",children:t&&n.map((s,o)=>x.jsx(Tct,{sectionId:t,paramInfo:s},`${s.name}-${o}`))})]})}function $ct({sectionId:t,paramInfo:e}){const n=e.id,r=te(a=>Hy(t,n,a),ae.isEqual),i=e.name,s=a=>{te.setState(l=>{sI({uiTypeId:a,sectionId:t,paramInfoId:n,state:l})})},o=(a,l)=>{Tlt({sectionId:t,paramInfoId:n,configProps:{configName:a,newValueFn:l}})};return x.jsxs("div",{className:"flex flex-col self-stretch text-left last:mb-[400px] hover:opacity-100 hover:duration-500 [&:hover_.uicfg-title]:text-black dark:[&:hover_.uicfg-title]:text-setta-200",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("p",{className:"uicfg-title truncate text-xs font-semibold text-setta-500",children:i}),x.jsx("div",{className:"flex gap-[0.1rem] place-self-end",children:x.jsx(Mlt,{})})]}),x.jsx(Ect,{onDropdownSelect:s,selectedId:r.id,selectedType:r.type,onConfigChange:o,config:r.config,sectionId:t,paramInfoId:n})]})}const Mct=oT;function Ict(){const t=ir(u=>u.ids,ae.isEqual),{tab:e,requiredTabs:n,uiTypeName:r,renderMarkdown:i}=jXe(t[0]),[s]=Ot.uiEditorVis.hook(),[o]=Ot.uiEditorWidth.hook(),a=i?"Markdown Editor":"Text Editor",l=e===Gp?a:null,c={vis:s,tab:e,onTabClick:Cle(r),className:"flex h-10 w-10 cursor-pointer items-center justify-center text-2xl focus-visible:border-transparent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-light-blue-500",requiredTabs:n};return x.jsxs("div",{id:"UiEditorPane",className:"contents",onKeyDown:yNe,children:[x.jsxs("div",{className:"absolute right-0 z-[19] flex h-[calc(100%_-_48px)] w-[50px] flex-col items-center gap-1 border-l border-setta-200/75 bg-setta-50 py-3 dark:border-setta-850 dark:bg-setta-900",children:[x.jsx(Nh,{tabName:al,...c,...Rr({content:"Section Config"}),children:x.jsx(nHe,{})}),x.jsx(Nh,{tabName:Yp,...c,...Rr({content:"Parameter UI Config"}),children:x.jsx(KXe,{})}),x.jsx(Nh,{tabName:tO,...c,...Rr({content:"Parameter Info Editing"}),children:x.jsx(cHe,{})}),x.jsx(Nh,{tabName:Gp,...c,...Rr({content:a}),children:x.jsx(rHe,{})}),x.jsx(Nh,{tabName:Sc,...c,...Rr({content:"Section Variants"}),children:x.jsx(dHe,{})})]}),x.jsx(wle,{paneName:Mct,right:!0,minimumWidth:425,vis:s,width:o,children:t.length===1&&s?x.jsx(Dct,{sectionId:t[0],tab:e,inputTitle:l}):x.jsx(Nct,{})})]})}function Dct({sectionId:t,tab:e,inputTitle:n}){const r=n??K7e[e];return x.jsxs("div",{className:"flex h-full min-h-0 w-[calc(100%_-_3rem)] min-w-0 flex-1 flex-col overflow-hidden pr-1.5",children:[x.jsx("h2",{className:"mb-1 cursor-pointer select-none text-xs font-bold uppercase tracking-tight text-setta-300 dark:text-setta-500",children:r}),x.jsx(Lct,{sectionId:t,tab:e})]})}function Lct({sectionId:t,tab:e}){switch(e){case al:return x.jsx(dlt,{sectionId:t});case Yp:return x.jsx(Act,{sectionId:t});case tO:return x.jsx(Qnt,{sectionId:t});case Gp:return x.jsx(Rnt,{sectionId:t});case Sc:return x.jsx(_lt,{sectionId:t})}}function Nct(){return x.jsx("aside",{className:"grid h-full min-h-0 w-[calc(100%_-_2rem)]",children:x.jsxs("div",{className:"flex flex-col items-center gap-4 place-self-center",children:[x.jsx(Ple,{className:"h-20 w-20 text-setta-300 dark:text-setta-700 "}),x.jsx("h4",{className:"text-center text-lg font-bold tracking-widest text-setta-300 dark:text-setta-600",children:"Select A Section to Edit"})]})})}function Qct(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M2.99787498,0.999999992 L17.4999998,0.999999992 L20.9999998,4.50000005 L21,23 L3,23 L2.99787498,0.999999992 Z M16,1 L16,6 L21,6 M9,12 L15,18 M15,12 L9,18"},child:[]}]})(t)}function jct(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",strokeWidth:"2",d:"M12,17 C9.27272727,17 6,14.2222222 6,12 C6,9.77777778 9.27272727,7 12,7 C14.7272727,7 18,9.77777778 18,12 C18,14.2222222 14.7272727,17 12,17 Z M11,12 C11,12.55225 11.44775,13 12,13 C12.55225,13 13,12.55225 13,12 C13,11.44775 12.55225,11 12,11 C11.44775,11 11,11.44775 11,12 Z"},child:[]}]})(t)}function Bct(){return x.jsx("div",{className:"single-cell-container absolute inset-0 ",children:x.jsxs("div",{className:"single-cell-child my-auto flex flex-col items-center gap-6 text-setta-400 dark:text-setta-700",children:[x.jsx(Qct,{className:"h-24 w-24"}),x.jsx("h1",{className:"text-5xl font-black ",children:"Project Not Found"})]})})}function Yr({children:t,onClick:e,onMouseOver:n}){return x.jsx(ude,{className:"flex cursor-pointer flex-row items-center gap-2 rounded-md px-2 py-[0.15rem] font-sans text-xs font-semibold text-setta-700 outline-none hover:bg-setta-100 hover:ring-0 focus-visible:ring-1 dark:text-setta-100 dark:hover:bg-setta-700",onClick:e,onMouseOver:n,children:t})}function qD(t,e,n){t.preventDefault();const r={isOpen:!0,x:t.clientX,y:t.clientY,...n};xy.setState(i=>({[e]:{...i[e],...r}}))}function zct(t){qD(t,"pane")}function Fct(t,e){qD(t,"selection",{nodeIds:e})}function Wct(t,e){qD(t,"typeError",{paramInfoId:e})}function Sm(){xy.getState().reset()}function XD({children:t,x:e,y:n,isOpen:r,closeContextMenu:i}){const s=Vct(r,i),[o,a]=_.useState({top:-9999,left:-9999,opacity:0}),l=_.useRef(null);return _.useEffect(()=>{if(!r){a({top:-9999,left:-9999,opacity:0});return}requestAnimationFrame(()=>{if(l.current){const c=l.current.getBoundingClientRect(),u=window.innerHeight,f=window.innerWidth;let h=n,d=e;n+c.height>u&&(h=n-c.height),e+c.width>f&&(d=e-c.width),h<_z&&(n+c.height<=u?h=n:h=_z),d<0&&(d=0),a({top:h,left:d,opacity:1})}})},[e,n,r]),x.jsx(lde,{open:r,modal:!1,children:x.jsx(cde,{className:"absolute z-10 flex w-[clamp(5rem,_20vw,_10rem)] min-w-32 cursor-pointer flex-col rounded-md border border-solid border-setta-500/50 bg-white px-2 py-2 shadow-xl dark:bg-setta-900",style:{left:o.left,top:o.top,opacity:o.opacity},ref:c=>{s.current=c,l.current=c},children:t})})}function Vct(t,e){const n=_.useRef(null);return _.useEffect(()=>{function r(i){n.current&&!n.current.contains(i.target)&&t&&e()}return document.addEventListener("mousedown",r),()=>{document.removeEventListener("mousedown",r)}},[n,t]),n}function Uct(){const{isOpen:t,x:e,y:n}=xy(s=>s.pane,ae.isEqual),r=te(s=>s.singletonSections,ae.isEqual);function i(s){return()=>{te.setState(o=>{_M({position:Vf({x:e,y:n}),state:o,...s})}),hn(!0),Sm()}}return x.jsxs(XD,{x:e,y:n,closeContextMenu:Sm,isOpen:t,children:[x.jsx("p",{className:"mx-2 mb-2 min-w-[100px] border-b border-setta-100 py-1 text-xs font-bold uppercase text-setta-300 dark:border-setta-700 dark:text-setta-500",children:"Create New"}),x.jsx(Yr,{onClick:i({type:Y.SECTION}),children:"Section"}),x.jsx(Yr,{onClick:i({type:Y.LIST_ROOT}),children:"List"}),x.jsx(Yr,{onClick:i({type:Y.DICT_ROOT}),children:"Dict"}),x.jsx(Yr,{onClick:i({type:Y.GROUP}),children:"Group"}),x.jsx(Yr,{onClick:i({type:Y.INFO}),children:"Info"}),!r[Y.GLOBAL_VARIABLES]&&x.jsx(Yr,{onClick:i({type:Y.GLOBAL_VARIABLES}),children:"Global Variables"}),x.jsx(Yr,{onClick:i({type:Y.CODE,sectionProps:{codeLanguage:"python"}}),children:"Python Code"}),x.jsx(Yr,{onClick:i({type:Y.CODE,sectionProps:{codeLanguage:"bash"}}),children:"Bash Script"}),x.jsx(Yr,{onClick:i({type:Y.TERMINAL}),children:"Terminal"}),!r[Y.GLOBAL_PARAM_SWEEP]&&x.jsx(Yr,{onClick:i({type:Y.GLOBAL_PARAM_SWEEP}),children:"Global Param Sweep"}),x.jsx(Yr,{onClick:i({type:Y.DRAW}),children:"Drawing Area"}),x.jsx(Yr,{onClick:i({type:Y.IMAGE}),children:"Image"}),x.jsx(Yr,{onClick:i({type:Y.CHART}),children:"Chart"}),x.jsx(Yr,{onClick:i({type:Y.SOCIAL}),children:"Social"}),x.jsx(Yr,{onClick:i({type:Y.IFRAME}),children:"IFrame"})]})}function _m(t,e){const n=[...new Set(jne(t,e))],r=n.filter(i=>e.uiTypes[e.x[i].uiTypeId].type===Y.TERMINAL);Hct(n,e),r&&mNe(r),HT(n),Une(n)}function qct(t,e,n=1){te.setState(r=>{if(t){const i=Yt(e,r).children;_m(i.slice(0,n),r)}else{const i=r.x[e].parentId,s=Yt(i,r).children,o=s.indexOf(e)+1;_m(s.slice(o,o+n),r)}}),hn(!0)}function Xct(){const t=ir.getState().ids;te.setState(e=>{_m(t,e)}),hn(!0)}function Hct(t,e){var r,i;const n=new Set(t);for(const s of n){const o=(r=e.x[s])==null?void 0:r.parentId;o&&((i=e.x[o])!=null&&i.variantId)&&am(o,l=>l.filter(c=>c!==s),e);let a=!1;for(const l of Object.values(e.variants))if(l.children.includes(s)){a=!0;break}if(!a){for(const l of e.x[s].variantIds)delete e.variants[l];delete e.x[s]}}for(const[s,o]of Object.entries(e.x))n.has(o.paramSweepSectionId)&&(e.x[s].paramSweepSectionId=null)}async function Tde(t){return await jt({body:{sectionsAndOtherInfo:t},address:Y.ROUTE_COPY_SECTIONS})}async function Zct(){const t=ir.getState().ids;if(t.length>0&&window.getSelection().toString()===""){const e=Pde(t);await navigator.clipboard.writeText(JSON.stringify({data:e,copyType:"sections"}))}}function Pde(t){const e=te.getState(),n=Yct(t,e),r=Gct(n,e),i=Kct(n,e),s=Jct(n,i,e),o=eut(r,e),a=tut(o,e),l=nut(n);return{sections:n,sectionVariants:r,uiTypeCols:i,uiTypes:s,codeInfoCols:o,codeInfo:a,relativePositions:l}}function Yct(t,e){const n=jne(t,e),r=ae.pick(e.x,n),i=ae.pickBy(r,s=>dn(s.id)!==Y.PARAM_SWEEP?!0:!!ky(s.id,r));return ae.size(r)!==ae.size(i)&&Vi("Lone param sweeps won't be included in copy"),i}function Gct(t,e){const n={};for(const r of Object.values(t))Object.assign(n,ae.pick(e.variants,r.variantIds));return n}function Kct(t,e){return ae.pick(e.uiTypeCols,ae.map(t,n=>n.uiTypeColId))}function Jct(t,e,n){const r=[];for(const i of Object.values(t))r.push(i.uiTypeId),r.push(...i.nonPresetUITypeIds);for(const i of Object.values(e))for(const s of Object.values(i))r.push(s.uiTypeId),r.push(...s.nonPresetUITypeIds);return ae.pick(n.uiTypes,r)}function eut(t,e){return ae.pick(e.codeInfoCols,ae.map(t,n=>n.codeInfoColId))}function tut(t,e){let n=[];for(const r of Object.values(t)){const{ids:i}=LAe(e.codeInfo,r.children);for(const s of i)n.push(e.codeInfo[s])}return n=ae.keyBy(ae.cloneDeep(n),r=>r.id),n}function nut(t){const e={};for(const i of Object.keys(t)){const s=Uf(i);s&&(e[i]={x:s.x,y:s.y,zIndex:0})}let n=1/0,r=1/0;for(const i of Object.values(e))i.x<n&&(n=i.x),i.y<r&&(r=i.y);return ae.mapValues(e,i=>({x:i.x-n,y:i.y-r,zIndex:i.zIndex}))}function wX(t,e,n){BO(t,e,n),ae.isNil(e.width)||rut(t,e.width,n)}function rut(t,e,n){const i=B5(t,s=>{const{parentId:o}=n.x[s];return o&&!n.x[o].isHorizontalOrientation?o:null});MA({sectionId:i,exclude:t,width:e,state:n})}function MA({sectionId:t,exclude:e,width:n,state:r}){const i=RRe(t,r);for(const s of i)s!==e&&BO(s,{width:n},r)}function Ade(t,e,n,r){const i=e/t;return t<n||e<r?(t<n&&(t=n,e=t*i),e<r&&(e=r,t=e/i),{height:Math.round(t),width:Math.round(e)}):{height:t,width:e}}function iut(t,e,n,r){if(t==="auto"&&e==="auto")return{height:n,width:r};const i=r/n;if(t==="auto")return{height:e/i,width:e};if(e==="auto"){const o=t*i;return{height:t,width:o}}const s=e/t;if(s>i){const o=t*i;return{height:t,width:o}}else return s<i?{height:e/i,width:e}:{height:t,width:e}}function BO(t,e,n){n.x[t].size={...n.x[t].size,...e}}function Rde({sectionIds:t,oldParentIds:e,newParentIds:n,positions:r,oldParentId:i,newParentId:s,state:o}){for(const[a,l]of t.entries())$de({oldParentId:e?e[l]:i,newParentId:n?n[l]:s,oldSectionId:l,newSectionId:l,newIndex:a,position:r?r[l]:null,state:o})}function $de({oldParentId:t,newParentId:e,oldSectionId:n,newSectionId:r,newIndex:i,position:s,state:o}){sut({oldParentId:t,newParentId:e,oldSectionId:n,newSectionId:r,newIndex:i,position:s,state:o}),out(e,r,o)}function sut({oldParentId:t,newParentId:e,oldSectionId:n,newSectionId:r,newIndex:i,position:s,state:o}){t?am(t,a=>a.filter(l=>l!==n),o):Une([n]),e?am(e,a=>Zee(a,i,r),o):eM([{id:r,position:s,zIndex:0,tempZIndex:0}]),o.x[r].parentId=e}function out(t,e,n){if(!t)return;if(n.uiTypes[n.x[t].uiTypeId].type===Y.GROUP){const{isHorizontalOrientation:i}=n.x[t];if(!i){const s=n.variants[n.x[t].variantId].children;if(s.length>0){const o=n.x[s[0]].size.width;MA({sectionId:e,width:o,state:n})}}}else{const i=n.x[t].size.width;MA({sectionId:e,width:i,state:n})}}async function aut({sectionId:t,oldParentId:e,newParentId:n}){if(!e||e===n)return t;const{variantIds:r}=Pi(e);if(r.length<=1)return t;const{variantId:i}=Pi(t),s=te.getState().variants;let o=!1;for(const a of r){if(a===i)continue;if(s[a].children.findIndex(u=>u===t)!==-1){o=!0;break}}if(o){const a=await Tde(Pde([t]));if(a.status===200)return a.data}return t}function Mde({nodeIds:t,x:e,y:n}){let r;te.setState(i=>{r=_M({type:Y.GROUP,position:{x:e,y:n},state:i}),Rde({oldParentId:null,newParentId:r,sectionIds:t,state:i}),i.shouldRenameReferences=!0}),Vd([r]),hn(!0)}async function lut(){const t=ir.getState().ids,e=[...mr.getState().x].filter(r=>t.includes(r[0]));if(e.length>0){const r=e.map(o=>o[1].id),i=Math.min(...e.map(o=>o[1].position.x)),s=Math.min(...e.map(o=>o[1].position.y));Mde({nodeIds:r,x:i,y:s}),qe.setState({nodesSelectionDims:null})}}function Ide(t,e){if(dn(t,e)!==Y.GROUP)return;const n=Yt(t,e).children,r={};n.forEach(i=>{const{x:s,y:o}=Uf(i);r[i]={x:s,y:o}}),Rde({oldParentId:t,newParentId:null,sectionIds:n,positions:r,state:e}),_m([t],e),e.shouldRenameReferences=!0}function cut(){te.setState(t=>{const e=ir.getState().ids;e.length===1&&Ide(e[0],t)}),hn(!0)}function uut(){const{isOpen:t,x:e,y:n,nodeIds:r}=xy(u=>u.selection,ae.isEqual),i=te(u=>r.map(f=>u.x[f].positionAndSizeLocked).every(f=>f)),s=()=>{Sm(),qe.setState({nodesSelectionDims:null})};function o(){Mde({nodeIds:r,...Vf({x:e,y:n})}),s()}function a(){te.setState(u=>{_m(r,u)}),s(),E_(),hn(!0)}function l(){te.setState(u=>{for(const f of r)u.x[f].positionAndSizeLocked=!i}),s()}const c=i?"Unlock Position & Size":"Lock Position & Size";return x.jsxs(XD,{x:e,y:n,isOpen:t,closeContextMenu:s,children:[x.jsx(Yr,{onClick:o,children:"Create Group"}),x.jsx(Yr,{onClick:a,children:"Delete"}),x.jsx(Yr,{onClick:l,children:c})]})}function fut(){const{isOpen:t,x:e,y:n,paramInfoId:r}=xy(a=>a.typeError,ae.isEqual),i=te(a=>{var l;return!!((l=a.codeInfo[r])!=null&&l.ignoreTypeErrors)});function s(){let a;te.setState(l=>{a=!i,l.codeInfo[r].ignoreTypeErrors=a}),a&&vp.setState(l=>{_Re(r,l)}),Sm()}const o=i?"Enable Type Errors":"Ignore Type Errors";return x.jsx(XD,{x:e,y:n,isOpen:t,closeContextMenu:Sm,children:x.jsx(Yr,{onClick:s,children:o})})}const hut=ke.forwardRef(({},t)=>{const{width:e,height:n}=cn(r=>({width:r.width,height:r.height}),ae.isEqual);return x.jsxs(x.Fragment,{children:[x.jsx("div",{style:{width:`${e}px`,height:`${n}px`},className:"flex items-center justify-center rounded-xl bg-setta-100/70 shadow-inner dark:bg-setta-500/60",ref:t,children:x.jsx(lHe,{className:"scale-150 text-xl font-black text-setta-50 dark:text-setta-400/70"})}),x.jsx("div",{className:"flex-auto bg-transparent"})]})}),dut=ke.forwardRef(({},t)=>{const e=qe(o=>o.transform[2]),{width:n,height:r}=cn(o=>({width:o.width,height:o.height}),ae.isEqual),i=n*e,s=r*e;return x.jsx("div",{style:{width:`${i}px`,height:`${s}px`},className:"rounded-xl bg-blue-500/90 shadow-lg dark:bg-blue-700/90",ref:t})}),put=ke.forwardRef((t,e)=>cn(r=>r.activeId)&&x.jsx(T8e,{dropAnimation:null,children:x.jsx(dut,{ref:e})}));function mut(){return n8e(Lz(i$),Lz(r$,{coordinateGetter:X8e}))}const sb={INVALID:"INVALID"},gut={INVALID:"Invalid"};function vut({active:t}){const{width:e,height:n}=vEe(t.id),r=cn.getState();r.setActive({id:t.id,isTopLevel:t.data.current.isTopLevel,width:e,height:n}),r.isMovingFree&&qf.getState().replaceWithTemp(t.id)}function Out(){return cn(e=>e.isMovingFree)?yut:()=>{}}function yut({active:t,collisions:e}){var i;const n=(i=e[0])==null?void 0:i.triggerDistCondition,r=cn.getState();if(n!==r.triggerDistCondition){cn.setState({triggerDistCondition:n});const s=e[0];s&&s.id===r.overId&&Dde({active:t,over:s,collisions:e,calledFromOnDragMove:!0})}}function but(){return cn(e=>e.isMovingFree)?Dde:()=>{}}function Dde({active:t,over:e,collisions:n,calledFromOnDragMove:r}){const i=HD(e),s=cn.getState(),o=qf.getState(),a=$y(t.id),l=IA(a);if(n.length===0){o.removeChild(a),R1(null);return}if(r&&s.triggerDistCondition){SX({active:t,over:e,dndChildrenState:o,oldParentId:l,dndSectionId:a,collisions:n});return}if(!r&&i&&xut(s,i)<100){R1(i);return}if(s.setTime(i),!i){o.removeChild(a),R1(i);return}if(s.triggerDistCondition){SX({active:t,over:e,dndChildrenState:o,oldParentId:l,dndSectionId:a,collisions:n});return}if(a===i){R1(i);return}const c=IA(i)??i;Lde({active:t,over:e,dndSectionId:a,oldParentId:l,newParentId:c,dndChildrenState:o,collisions:n})}function Lde({active:t,over:e,dndSectionId:n,oldParentId:r,newParentId:i,dndChildrenState:s,collisions:o}){const a=HD(e),l=wut(t.id,i);if(l===sb.INVALID){s.removeChild(n),cn.setState({behaviorDropType:l,overId:a});return}const c=Yt(i).children.length;if(c===1&&om(t.id)===i){s.addChild({oldParentId:r,newParentId:i,childId:n,index:0});return}if(a===i&&c>0){s.removeChild(n);return}if(i!==r){const f=s.x[i].indexOf(a);let h=f;f>=0?o[0].pastHalfway&&(h=f+1):h=0,s.addChild({oldParentId:r,newParentId:i,childId:n,index:h})}R1(a)}function SX({active:t,over:e,dndChildrenState:n,oldParentId:r,dndSectionId:i,collisions:s}){const o=HD(e);o!==i&&Lde({active:t,over:e,dndSectionId:i,oldParentId:r,newParentId:o,dndChildrenState:n,collisions:s})}function R1(t){cn.setState({behaviorDropType:null,overId:t})}function xut(t,e){return Date.now()-(t.times[e]??0)}function IA(t){return qf.getState().y[t]}function wut(t,e){return!Cut(e)||Sut(t)&&!_ut(e)||Yt(e).isFrozen||kut(t)?sb.INVALID:null}function HD(t){return t?t.id:null}function Sut(t){return![Y.SECTION,Y.LIST_ROOT,Y.DICT_ROOT].includes(dn(t))}function _ut(t){return dn(t)===Y.GROUP}function kut(t){return te.getState().singletonSections[Y.GLOBAL_VARIABLES]===t}function Cut(t){return Gse(dn(t))}function Eut(){return{droppable:{frequency:cn(n=>n.isMovingFree&&!!n.activeId)?200:t$.Optimized}}}const Tut=({transform:t})=>({...t,y:0}),Put=({transform:t})=>({...t,x:0});function Aut(t,e){var o,a;if(!t)return e;if(!e)return t;const n=(o=t.data.droppableContainer.data.current.sortable)==null?void 0:o.containerId,r=(a=e.data.droppableContainer.data.current.sortable)==null?void 0:a.containerId;if(n&&!r)return t;if(!n&&r)return e;const i=t.data.intersectionRatio,s=e.data.intersectionRatio;if(n&&r){const l=t.data.absTriggerDist,c=e.data.absTriggerDist,u=t.data.triggerDist,f=e.data.triggerDist;if(l-c===0)return s-i>0?e:t;if(u>0&&f>0)return l-c>0?e:t;if(l-c>0)return f<0?e:t;if(c-l>0)return u<0?t:e}return s-i>0?e:t}function Rut(t,e){const n=Math.max(e.top,t.top),r=Math.max(e.left,t.left),i=Math.min(e.left+e.width,t.left+t.width),s=Math.min(e.top+e.height,t.top+t.height),o=i-r,a=s-n;if(r<i&&n<s){const l=o*a;return Number(l.toFixed(4))}return 0}function $ut(t,e,n){return!(e!=null&&e.data.droppableContainer.data.current.isTopLevel)&&(!(e!=null&&e.data.droppableContainer.data.current.hasNested)||(e==null?void 0:e.data.droppableContainer.data.current.onlyChildId)===t)&&(e==null?void 0:e.data.triggerDist)>(n?20:100)*qe.getState().transform[2]}let Aw=null,H7=null;function Mut({active:t,collisionRect:e,droppableRects:n,droppableContainers:r}){var h,d,p,g;let i=null;const{left:s,top:o}=e;let a,l,c,u,f;for(const m of r)c=m.id,l=n.get(c),l&&t.id!==c&&(a=Rut(l,e),a&&(Aw===c&&(a*=1.1),f=(d=Pi((h=m.data.current.sortable)==null?void 0:h.containerId))==null?void 0:d.isHorizontalOrientation,u=f?o-l.top:s-l.left,i=Aut(i,{id:c,data:{droppableContainer:m,absTriggerDist:Math.abs(u),triggerDist:u,intersectionRatio:a}})));if(i){let m=0;Aw===i.id&&(H7===!0?m=10:H7===!1&&(m=-10));const v=(g=Pi((p=i.data.droppableContainer.data.current.sortable)==null?void 0:p.containerId))==null?void 0:g.isHorizontalOrientation;return v?i.pastHalfway=(e.left+e.right)/2+m>(n.get(i.id).left+n.get(i.id).right)/2:i.pastHalfway=(e.top+e.bottom)/2+m>(n.get(i.id).top+n.get(i.id).bottom)/2,i.triggerDistCondition=$ut(t.id,i,v),Aw=i.id,H7=i.pastHalfway,[i]}return Aw=null,[]}function Iut(t,e){return t?e?t.data.distance<e.data.distance?t:e:t:e}function _X(t,e){return e?[t.left,t.left+t.width]:[t.top,t.top+t.height]}const Dut=({active:t,collisionRect:e,droppableRects:n,droppableContainers:r})=>{var a;if(!t.data.current.sortable)return[];let i=null;const s=Pi(t.data.current.sortable.containerId).isHorizontalOrientation,o=_X(e,s);for(const l of r){const{id:c}=l,u=n.get(c);if(u&&t.data.current.sortable.containerId===((a=l.data.current.sortable)==null?void 0:a.containerId)){const f=_X(u,s),h=Math.abs(o[0]-f[0])+Math.abs(o[1]-f[1]);i=Iut(i,{id:c,data:{droppableContainer:l,distance:h}})}}return i?[i]:[]};function Lut(){const{isSorting:t,activeId:e}=cn(i=>({isSorting:i.isSorting,activeId:i.activeId}),ae.isEqual);return{modifiers:Nut(t,e),collisionDetection:t?Dut:Mut}}function Nut(t,e){if(t&&e){const n=om(e);if(n)return Pi(n).isHorizontalOrientation?[Tut]:[Put]}return null}function Qut({active:t,over:e}){e&&t.id!==e.id&&(te.setState(n=>{var r;am((r=t.data.current.sortable)==null?void 0:r.containerId,Z8e(t,e),n)}),hn(!0))}async function jut({active:t,over:e,collisions:n,dummyRef:r}){const i=qf.getState(),s=t.id,o=$y(s),a=e==null?void 0:e.id,l=om(s);let c=i.y[o]??null,u=null,f=null,h=null;const d=cn.getState().behaviorDropType;if(c){const m=i.x[c];u=m.indexOf(o);const v=m.indexOf(a),y=n[0].pastHalfway,b=m.length;f=s$(u,v,y,b)}else if(!a){f=0;const{x:m,y:v}=r.current.getBoundingClientRect();if(h=Vf({x:m,y:v}),!l){VRe(s,h);return}}if(d===sb.INVALID){m_();return}if(l===c&&Ll(l).children.indexOf(s)===f){m_();return}const p=await aut({sectionId:s,oldParentId:l,newParentId:c});let g;te.setState(m=>{p.sections?(Z$({...p,state:m}),g=Object.keys(p.sections)[0]):g=p,$de({oldParentId:l,newParentId:c,oldSectionId:s,newSectionId:g,newIndex:f,position:h,state:m}),m.shouldRenameReferences=!0})}function But(){const t=_.useRef(null);function e({active:n,over:r,collisions:i}){cn.getState().isSorting?Qut({active:n,over:r}):cn.getState().isMovingFree?jut({active:n,over:r,collisions:i,dummyRef:t}):m_();const s=o=>({isMovingFree:o.getState().isMovingFree,isSorting:o.getState().isSorting,disabled:o.getState().disabled});cn.getState().reset(s)}return{dummyRef:t,onDragEnd:e}}function zut({children:t}){const{dummyRef:e,onDragEnd:n}=But(),r=Out(),i=but(),{modifiers:s,collisionDetection:o}=Lut(),a=mut(),l=Eut();return x.jsxs(f8e,{sensors:a,collisionDetection:o,onDragStart:vut,onDragMove:r,onDragEnd:n,onDragOver:i,modifiers:s,measuring:l,autoScroll:!1,children:[t,x.jsx(put,{ref:e})]})}const Ah=({children:t,className:e,...n})=>x.jsx("button",{type:"button",className:qd(["react-flow__controls-button",e]),...n,children:t});Ah.displayName="ControlButton";function Fut(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:x.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Wut(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:x.jsx("path",{d:"M0 0h32v4.2H0z"})})}function Vut(){return x.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:x.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Uut(){const{minZoom:t,maxZoom:e}=Nt(n=>({minZoom:n.gui.minZoom,maxZoom:n.gui.maxZoom}),Ma);return qe(n=>({minZoomReached:n.transform[2]<=t,maxZoomReached:n.transform[2]>=e}),Ma)}const Nde=({position:t="bottom-left"})=>{const[e,n]=_.useState(!1),{minZoomReached:r,maxZoomReached:i}=Uut();qe(h=>h.nodesDraggable||h.elementsSelectable,Ma);const s=qe(h=>h.fitViewOnInit),[o]=Ot.snapToGrid.hook(),[a]=Ot.overviewTrueWidth.hook(),[l]=Ot.showMinimap.hook(),c="!bg-blue-500 dark:!bg-blue-700 !text-white";if(_.useEffect(()=>{n(!0)},[]),!e)return null;const u=()=>{mee()},f=()=>{gee()};return x.jsxs(ooe,{className:"react-flow__controls overflow-hidden rounded-md border border-solid border-setta-800/10 shadow-lg transition-transform dark:border-setta-300/30",position:t,style:{transform:`translateX(${a}px)`},"data-testid":"rf__controls",children:[x.jsx(Ah,{onClick:u,className:"react-flow__controls-zoomin bg-setta-50 hover:bg-setta-200 dark:border-setta-800 dark:bg-setta-700 dark:text-setta-300 dark:hover:bg-setta-800 dark:[&_svg]:fill-setta-300",title:"zoom in","aria-label":"zoom in",disabled:i,children:x.jsx(Vut,{})}),x.jsx(Ah,{onClick:f,className:"react-flow__controls-zoomout bg-setta-50 hover:bg-setta-200 dark:border-setta-800 dark:bg-setta-700 dark:text-setta-300 dark:hover:bg-setta-800 dark:[&_svg]:fill-setta-300",title:"zoom out","aria-label":"zoom out",disabled:r,children:x.jsx(Wut,{})}),x.jsx(Ah,{className:`react-flow__controls-fitview hover:bg-setta-200 dark:border-setta-800 dark:text-setta-300 dark:hover:bg-setta-800 dark:[&_svg]:fill-setta-300 ${s?c:"bg-setta-50 dark:bg-setta-700"}`,onClick:Vne,title:"fit view","aria-label":"fit view",children:x.jsx(Fut,{})}),x.jsx(Ah,{onClick:q$e,className:`hover:bg-setta-200 dark:border-setta-800 dark:text-setta-300 dark:hover:bg-setta-800 dark:[&_svg]:fill-setta-300 ${o?c:"bg-setta-50 dark:bg-setta-700"}`,children:x.jsx(uHe,{})}),x.jsx(Ah,{className:"react-flow__controls-button dark: bg-setta-50 hover:bg-setta-200 dark:border-setta-800 dark:bg-setta-700 dark:text-setta-300 dark:hover:bg-setta-800",onClick:vee,children:x.jsx(pHe,{})}),x.jsx(Ah,{onClick:V$e,className:`hover:bg-setta-200 dark:border-setta-800 dark:text-setta-300 dark:hover:bg-setta-800 dark:[&_svg]:fill-setta-300 ${l?c:"bg-setta-50 dark:bg-setta-700"}`,children:x.jsx(UFe,{})})]})};Nde.displayName="Controls";const qut=_.memo(Nde);function Xut({color:t,dimensions:e,lineWidth:n}){return x.jsx("path",{stroke:t,strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`})}function Hut({color:t,radius:e}){return x.jsx("circle",{cx:e,cy:e,r:e,fill:t})}var i2=(t=>(t.Lines="lines",t.Dots="dots",t.Cross="cross",t))(i2||{});function Qde(){const[e]=Ot.darkMode.hook(),n=Nt(c=>e?c.gui.gridColorDarkMode:c.gui.gridColor),r=Nt(c=>c.gui.gridPatternSize),i=Nt(c=>c.gui.snapGrid),s=Nt(c=>i2[c.gui.gridPattern]),o=_.useRef(null),a=s===i2.Dots,l=s===i2.Cross;return x.jsxs("svg",{className:"react-flow__background",style:{position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:o,"data-testid":"rf__background",children:[x.jsx(Yut,{offset:2,gapXY:i,patternColor:n,patternSize:r,isCross:l,isDots:a}),x.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"url(#ReactFlowBackground)"})]})}Qde.displayName="Background";const Zut=_.memo(Qde),Yut=_.memo(({offset:t,gapXY:e,patternColor:n,patternSize:r,isCross:i,isDots:s})=>{const o=qe(f=>f.transform,Ma),a=[e[0]*o[2]||1,e[1]*o[2]||1],l=r*o[2],c=i?[l,l]:a,u=s?[l/t,l/t]:[c[0]/t,c[1]/t];return x.jsx("pattern",{id:"ReactFlowBackground",x:o[0]%a[0],y:o[1]%a[1],width:a[0],height:a[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${u[0]},-${u[1]})`,children:s?x.jsx(Hut,{color:n,radius:l/t}):x.jsx(Xut,{dimensions:c,color:n,lineWidth:r*o[2]})})});function Gut(){return _.useCallback(({sourceEvent:e})=>{const{transform:n}=qe.getState(),r=e.touches?e.touches[0].clientX:e.clientX,i=e.touches?e.touches[0].clientY:e.clientY,s={x:(r-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:s.x,ySnapped:s.y,...s}},[])}function Kut(t,e,n){let r=t;do{if(r!=null&&r.matches(e))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function Jut(t,e,n,r){const{ids:i}=ir.getState(),s=i.includes(r);return Array.from(t.values()).filter(o=>(!r&&i.includes(o.id)||s&&i.includes(o.id)||!s&&o.id===r)&&(o.draggable||e&&typeof o.draggable>"u")).map(o=>{var a,l;return{id:o.id,position:o.position||{x:0,y:0},distance:{x:n.x-(((a=o.position)==null?void 0:a.x)??0),y:n.y-(((l=o.position)==null?void 0:l.y)??0)},delta:{x:0,y:0},width:o.width,height:o.height}})}function jde({nodeRef:t,disabled:e=!1,nodeId:n,isSelectable:r}){const[i,s]=_.useState(!1),o=_.useRef([]),a=_.useRef({x:null,y:null}),l=_.useRef(0),c=_.useRef(null),u=_.useRef({x:0,y:0}),f=_.useRef(null),h=_.useRef(!1),d=_.useRef(!1),p=Gut();return _.useEffect(()=>{if(t!=null&&t.current){const g=Mo(t.current),m=({x:b,y:S},k=!1)=>{const{nodesSelectionDims:E,shiftNodesSelection:T,setNodesSelection:C}=qe.getState(),{snapGrid:A}=Nt.getState().gui,[R]=Ot.snapToGrid.state(),Q={x:b-a.current.x,y:S-a.current.y};a.current={x:b,y:S};let L=!1;o.current=o.current.map(z=>{const B={x:b-z.distance.x,y:S-z.distance.y};return k&&R&&(B.x=A[0]*Math.round(B.x/A[0]),B.y=A[1]*Math.round(B.y/A[1])),L=L||z.position.x!==B.x||z.position.y!==B.y,z.position=B,z}),L&&(Xne(o.current),!n&&E&&(k&&R?C(o.current.length):T(Q)),s(!0))},v=()=>{if(!c.current)return;const[b,S]=cEe(u.current,c.current);if(b!==0||S!==0){const{transform:k,panBy:E}=qe.getState(),T=(a.current.x??0)-b/k[2],C=(a.current.y??0)-S/k[2];E({x:b,y:S})&&m({x:T,y:C})}l.current=requestAnimationFrame(v)},y=b=>{const{multiSelectionActive:S,nodesDraggable:k}=qe.getState(),E=mr.getState().x;d.current=!0,!r&&!S&&n&&ir.getState().ids.includes(n);const T=p(b);a.current=T,o.current=Jut(E,k,T,n),o.current&&(WRe(o.current),Ut.setState({mouseDownDraggingSection:!0}))};if(e)g.on(".drag",null);else{const b=t6e().on("start",S=>{const{domNode:k,nodeDragThreshold:E}=qe.getState();E===0&&y(S);const T=p(S);a.current=T,c.current=(k==null?void 0:k.getBoundingClientRect())||null,u.current=i_(S.sourceEvent,c.current)}).on("drag",S=>{var C,A;const k=p(S),{autoPanOnNodeDrag:E,nodeDragThreshold:T}=qe.getState();if(!h.current&&d.current&&E&&(h.current=!0,v()),!d.current){const R=k.xSnapped-(((C=a==null?void 0:a.current)==null?void 0:C.x)??0),Q=k.ySnapped-(((A=a==null?void 0:a.current)==null?void 0:A.y)??0);Math.sqrt(R*R+Q*Q)>T&&y(S)}(a.current.x!==k.xSnapped||a.current.y!==k.ySnapped)&&o.current&&d.current&&(f.current=S.sourceEvent,u.current=i_(S.sourceEvent,c.current),m(k))}).on("end",S=>{Ut.setState({mouseDownDraggingSection:!1}),d.current&&(Ot.snapToGrid.state()[0]&&m(a.current,!0),s(!1),h.current=!1,d.current=!1,cancelAnimationFrame(l.current),o.current&&o3(o.current.map(k=>k.id),!0))}).filter(S=>{const k=S.target;return!S.button&&!Kut(k,`.${eEe}`,t)});return g.call(b),()=>{g.on(".drag",null)}}}},[t,e,r,n,p]),i}const Bde=t=>{const{nodesSelectionDims:e,nodesDraggable:n,shiftNodesSelection:r}=qe.getState(),{snapGrid:i}=Nt.getState().gui,[s]=Ot.snapToGrid.state(),o=ir.getState().ids,a=Hm().filter(p=>o.includes(p.id)&&(p.draggable||n&&typeof p.draggable>"u")),l=s?i[0]:5,c=s?i[1]:5,u=t.isShiftPressed?4:1,f=t.x*l*u,h=t.y*c*u,d=a.map(p=>{if(p.position){const g={x:p.position.x+f,y:p.position.y+h};s&&(g.x=i[0]*Math.round(g.x/i[0]),g.y=i[1]*Math.round(g.y/i[1])),p.position=g}return p});Xne(d),e&&r({x:f,y:h})};var zde={},Fde={},ZD={exports:{}},Vn=String,Wde=function(){return{isColorSupported:!1,reset:Vn,bold:Vn,dim:Vn,italic:Vn,underline:Vn,inverse:Vn,hidden:Vn,strikethrough:Vn,black:Vn,red:Vn,green:Vn,yellow:Vn,blue:Vn,magenta:Vn,cyan:Vn,white:Vn,gray:Vn,bgBlack:Vn,bgRed:Vn,bgGreen:Vn,bgYellow:Vn,bgBlue:Vn,bgMagenta:Vn,bgCyan:Vn,bgWhite:Vn}};ZD.exports=Wde();ZD.exports.createColors=Wde;var eft=ZD.exports;(function(t){Object.defineProperty(t,"__esModule",{value:!0});function e(l,c){for(var u in c)Object.defineProperty(l,u,{enumerable:!0,get:c[u]})}e(t,{dim:function(){return o},default:function(){return a}});const n=r(eft);function r(l){return l&&l.__esModule?l:{default:l}}let i=new Set;function s(l,c,u){typeof process<"u"&&{}.JEST_WORKER_ID||u&&i.has(u)||(u&&i.add(u),console.warn(""),c.forEach(f=>console.warn(l,"-",f)))}function o(l){return n.default.dim(l)}const a={info(l,c){s(n.default.bold(n.default.cyan("info")),...Array.isArray(l)?[l]:[c,l])},warn(l,c){s(n.default.bold(n.default.yellow("warn")),...Array.isArray(l)?[l]:[c,l])},risk(l,c){s(n.default.bold(n.default.magenta("risk")),...Array.isArray(l)?[l]:[c,l])}}})(Fde);(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});const e=n(Fde);function n(s){return s&&s.__esModule?s:{default:s}}function r({version:s,from:o,to:a}){e.default.warn(`${o}-color-renamed`,[`As of Tailwind CSS ${s}, \`${o}\` has been renamed to \`${a}\`.`,"Update your configuration file to silence this warning."])}const i={inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000",white:"#fff",slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"},get lightBlue(){return r({version:"v2.2",from:"lightBlue",to:"sky"}),this.sky},get warmGray(){return r({version:"v3.0",from:"warmGray",to:"stone"}),this.stone},get trueGray(){return r({version:"v3.0",from:"trueGray",to:"neutral"}),this.neutral},get coolGray(){return r({version:"v3.0",from:"coolGray",to:"gray"}),this.gray},get blueGray(){return r({version:"v3.0",from:"blueGray",to:"slate"}),this.slate}}})(zde);let Z7=zde;var tft=(Z7.__esModule?Z7:{default:Z7}).default;const nft=ra(tft);function rft({sectionId:t,isGroup:e}){const n=e?"":"0.75rem",r=e?"":"-0.75rem";return cn(i=>{const s=i.overId===t?i.behaviorDropType:null;return{behaviorDropType:s,style:s===sb.INVALID?{borderRadius:"1.5rem",padding:n,margin:r,backgroundColor:nft.red[600]}:{}}},ae.isEqual)}function ift(t){const{isSorting:e,isMovingFree:n}=zne(),r=cn(c=>c.disabled[t]),i=cn(c=>c.setDisabled),s=C5(t);_.useEffect(()=>{i(t,{draggable:s,droppable:!0})},[s]);function o(c){let u=om(t);for(;u;){if(c===u)return!0;u=om(u)}return!1}function a({active:c}){var u;s||(n&&c.id!==t&&!o(c.id)?i(t,{draggable:!1,droppable:!1}):e&&((u=c.data.current.sortable)==null?void 0:u.containerId)===t&&i(t,{draggable:!1,droppable:!1}))}function l(){i(t,{draggable:s,droppable:!0})}return jJ({onDragStart:a,onDragEnd:l,onDragCancel:l}),r??{draggable:s,droppable:!0}}function Vde({sectionId:t,isTopLevel:e}){const{hasNested:n,disabled:r,onlyChildId:i}=te(s=>{var l,c,u;const o=(l=s.x[t])==null?void 0:l.variantId,a=o?s.variants[o].children:[];return{hasNested:a.length>0,onlyChildId:a.length===1?a[0]:null,disabled:(c=s.x[t])!=null&&c.positionAndSizeLocked?(u=s.x[t])==null?void 0:u.positionAndSizeLocked:null}},ae.isEqual);return{id:t,data:{isTopLevel:e,hasNested:n,onlyChildId:i},disabled:r}}function Ude(){const t=cn(n=>n.isSorting||n.isMovingFree),e=qe(n=>n.moveSectionActivationKeyPressed||n.selectionKeyPressed||n.multiSelectionActive||n.zoomActivationKeyPressed);return t||e}function sft({sectionId:t,withNested:e,selfOnly:n}){ka.setState(r=>{e?r.withNested[t]=e:r.selfOnly[t]=n})}function oft({sectionId:t}){ka.setState(e=>{delete e.withNested[t],delete e.selfOnly[t]})}function qde(t,e){const n=_.useRef(null);return _.useEffect(()=>(sft({sectionId:t,[e]:n.current}),()=>oft({sectionId:t})),[]),n}function aft({sectionId:t}){const e=te(r=>r.x[t].isHorizontalOrientation);function n(){$Re(t)}return x.jsx(Fa,{icon:e?x.jsx(oHe,{}):x.jsx(sHe,{}),color:"text-setta-400 dark:text-setta-600 hover:text-setta-500 dark:hover:text-setta-400",bg:"bg-transparent justify-content-center mr-1",size:"w-4 h-4",padding:"p-0",onClick:n})}function Xde({sectionId:t}){const{isGroup:e,positionAndSizeLocked:n}=te(o=>({isGroup:dn(t,o)===Y.GROUP,positionAndSizeLocked:o.x[t].positionAndSizeLocked}),ae.isEqual),r=n?"gg-lock":"gg-lock-unlock",i=e?n?"[&>i]:!-mt-[6px]":"[&>i]:!scale-50 [&>i]:!-mt-[9px]":"[&>i]:!scale-[.4]";function s(){MRe(t)}return x.jsx(Fa,{icon:x.jsx("i",{className:r}),color:`${n?"dark:text-orange-500 text-orange-600 hover:!text-orange-100 dark:hover:!text-orange-100":e?"text-setta-400 dark:text-setta-600":"text-setta-600"} hover:text-orange-500 dark:hover:text-orange-700`,bg:`${n?"shadow-[inset_0_1px_1px_0_rgb(0_0_0_/_0.1)] dark:shadow-none dark:border-transparent dark:bg-transparent hover:bg-orange-500 dark:hover:bg-orange-500":"bg-transparent"} ${i}`,size:e?"w-5 h-5":"w-4 h-4",padding:"p-0 mr-1",onClick:s})}function lft(t){return ft({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12 18a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"},child:[]}]})(t)}function cft(t){return ft({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M21.038,4.9l-7.577-4.498C13.009,0.134,12.505,0,12,0c-0.505,0-1.009,0.134-1.462,0.403L2.961,4.9 C2.057,5.437,1.5,6.429,1.5,7.503v8.995c0,1.073,0.557,2.066,1.462,2.603l7.577,4.497C10.991,23.866,11.495,24,12,24 c0.505,0,1.009-0.134,1.461-0.402l7.577-4.497c0.904-0.537,1.462-1.529,1.462-2.603V7.503C22.5,6.429,21.943,5.437,21.038,4.9z M15.17,18.946l0.013,0.646c0.001,0.078-0.05,0.167-0.111,0.198l-0.383,0.22c-0.061,0.031-0.111-0.007-0.112-0.085L14.57,19.29 c-0.328,0.136-0.66,0.169-0.872,0.084c-0.04-0.016-0.057-0.075-0.041-0.142l0.139-0.584c0.011-0.046,0.036-0.092,0.069-0.121 c0.012-0.011,0.024-0.02,0.036-0.026c0.022-0.011,0.043-0.014,0.062-0.006c0.229,0.077,0.521,0.041,0.802-0.101 c0.357-0.181,0.596-0.545,0.592-0.907c-0.003-0.328-0.181-0.465-0.613-0.468c-0.55,0.001-1.064-0.107-1.072-0.917 c-0.007-0.667,0.34-1.361,0.889-1.8l-0.007-0.652c-0.001-0.08,0.048-0.168,0.111-0.2l0.37-0.236 c0.061-0.031,0.111,0.007,0.112,0.087l0.006,0.653c0.273-0.109,0.511-0.138,0.726-0.088c0.047,0.012,0.067,0.076,0.048,0.151 l-0.144,0.578c-0.011,0.044-0.036,0.088-0.065,0.116c-0.012,0.012-0.025,0.021-0.038,0.028c-0.019,0.01-0.038,0.013-0.057,0.009 c-0.098-0.022-0.332-0.073-0.699,0.113c-0.385,0.195-0.52,0.53-0.517,0.778c0.003,0.297,0.155,0.387,0.681,0.396 c0.7,0.012,1.003,0.318,1.01,1.023C16.105,17.747,15.736,18.491,15.17,18.946z M19.143,17.859c0,0.06-0.008,0.116-0.058,0.145 l-1.916,1.164c-0.05,0.029-0.09,0.004-0.09-0.056v-0.494c0-0.06,0.037-0.093,0.087-0.122l1.887-1.129 c0.05-0.029,0.09-0.004,0.09,0.056V17.859z M20.459,6.797l-7.168,4.427c-0.894,0.523-1.553,1.109-1.553,2.187v8.833 c0,0.645,0.26,1.063,0.66,1.184c-0.131,0.023-0.264,0.039-0.398,0.039c-0.42,0-0.833-0.114-1.197-0.33L3.226,18.64 c-0.741-0.44-1.201-1.261-1.201-2.142V7.503c0-0.881,0.46-1.702,1.201-2.142l7.577-4.498c0.363-0.216,0.777-0.33,1.197-0.33 c0.419,0,0.833,0.114,1.197,0.33l7.577,4.498c0.624,0.371,1.046,1.013,1.164,1.732C21.686,6.557,21.12,6.411,20.459,6.797z"},child:[]}]})(t)}function uft(t){return ft({tag:"svg",attr:{role:"img",viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M14.25.18l.9.2.73.26.59.3.45.32.34.34.25.34.16.33.1.3.04.26.02.2-.01.13V8.5l-.05.63-.13.55-.21.46-.26.38-.3.31-.33.25-.35.19-.35.14-.33.1-.3.07-.26.04-.21.02H8.77l-.69.05-.59.14-.5.22-.41.27-.33.32-.27.35-.2.36-.15.37-.1.35-.07.32-.04.27-.02.21v3.06H3.17l-.21-.03-.28-.07-.32-.12-.35-.18-.36-.26-.36-.36-.35-.46-.32-.59-.28-.73-.21-.88-.14-1.05-.05-1.23.06-1.22.16-1.04.24-.87.32-.71.36-.57.4-.44.42-.33.42-.24.4-.16.36-.1.32-.05.24-.01h.16l.06.01h8.16v-.83H6.18l-.01-2.75-.02-.37.05-.34.11-.31.17-.28.25-.26.31-.23.38-.2.44-.18.51-.15.58-.12.64-.1.71-.06.77-.04.84-.02 1.27.05zm-6.3 1.98l-.23.33-.08.41.08.41.23.34.33.22.41.09.41-.09.33-.22.23-.34.08-.41-.08-.41-.23-.33-.33-.22-.41-.09-.41.09zm13.09 3.95l.28.06.32.12.35.18.36.27.36.35.35.47.32.59.28.73.21.88.14 1.04.05 1.23-.06 1.23-.16 1.04-.24.86-.32.71-.36.57-.4.45-.42.33-.42.24-.4.16-.36.09-.32.05-.24.02-.16-.01h-8.22v.82h5.84l.01 2.76.02.36-.05.34-.11.31-.17.29-.25.25-.31.24-.38.2-.44.17-.51.15-.58.13-.64.09-.71.07-.77.04-.84.01-1.27-.04-1.07-.14-.9-.2-.73-.25-.59-.3-.45-.33-.34-.34-.25-.34-.16-.33-.1-.3-.04-.25-.02-.2.01-.13v-5.34l.05-.64.13-.54.21-.46.26-.38.3-.32.33-.24.35-.2.35-.14.33-.1.3-.06.26-.04.21-.02.13-.01h5.84l.69-.05.59-.14.5-.21.41-.28.33-.32.27-.35.2-.36.15-.36.1-.35.07-.32.04-.28.02-.21V6.07h2.09l.14.01zm-6.47 14.25l-.23.33-.08.41.08.41.23.33.33.23.41.08.41-.08.33-.23.23-.33.08-.41-.08-.41-.23-.33-.33-.23-.41-.08-.41.08z"},child:[]}]})(t)}function fft(t,e){return dn(t)===Y.SOCIAL&&GD(e.x[t].social)}function hft(t,e){return dn(t)===Y.SOCIAL&&YD(e.x[t].social)}function YD(t){return t&&(t.includes("youtube")||t.includes("youtu.be"))}function GD(t){return t&&(t.includes("twitter")||t.includes("x.com"))}function kX({sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n,isListElement:r}){if(r)return x.jsx(gft,{sectionId:t});if(n)return x.jsx(dft,{sectionId:t});switch(e){case Y.CODE:return x.jsx(mft,{sectionId:t,classes:"text-setta-300 group-hover/card-section:text-blue-500 dark:group-hover/card-section:text-[#0084ff] dark:text-setta-500 transition-colors"});case Y.TERMINAL:return x.jsx(Oft,{sectionId:t});case Y.GLOBAL_PARAM_SWEEP:case Y.GLOBAL_VARIABLES:return x.jsx(B$e,{className:"text-setta-300 transition-colors group-hover/card-section:text-green-500 dark:text-setta-500 "});case Y.PARAM_SWEEP:return x.jsx(aHe,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "});case Y.INFO:return x.jsx(vft,{sectionId:t});case Y.IMAGE:return x.jsx("div",{className:"relative",children:x.jsx("i",{className:"gg-image absolute inset-0 !scale-50 text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff]"})});case Y.DRAW:return x.jsx(tI,{className:"p-0 text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "});case Y.IFRAME:return x.jsx("div",{className:"relative flex w-2 justify-center",children:x.jsx("i",{className:"gg-code-slash !rotate-[14deg] !scale-50 text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff]"})});case Y.SOCIAL:return x.jsx(pft,{sectionId:t});case Y.GROUP:return x.jsx(lit,{className:`[&_*]:!scale-120 text-setta-400 transition-colors group-hover/group-section:text-blue-600 dark:text-setta-500 dark:group-hover/group-section:text-[#0084ff]
355
355
  `});case Y.CHART:return x.jsx(ait,{className:`text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff]
356
- `});default:return x.jsx("i",{className:"gg-menu group/card-section:hover:bg !scale-110 text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "})}}function dft({sectionId:t}){const e=te(n=>dn(t,n)===Y.GROUP);return x.jsx("i",{className:`gg-link group/card-section:hover:bg transition-colors group-hover/card-section:text-pink-500 dark:group-hover/card-section:text-[#ff00ff] ${e?"-rotate-45 !scale-75 text-purple-600 dark:text-purple-700":"text-purple-500 dark:text-purple-500"}`})}function pft({sectionId:t}){const{isYouTube:e,isTwitter:n}=te(r=>({isYouTube:YD(r.x[t].social),isTwitter:GD(r.x[t].social)}),ae.isEqual);return e?x.jsx(vlt,{className:"fill-setta-300 transition-colors group-hover/card-section:fill-blue-500 dark:fill-setta-500 dark:group-hover/card-section:fill-[#0084ff] "}):n?x.jsx(oit,{className:"fill-setta-300 transition-colors group-hover/card-section:fill-blue-500 dark:fill-setta-500 dark:group-hover/card-section:fill-[#0084ff] "}):x.jsx(lft,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "})}function mft({sectionId:t,classes:e}){switch(te(r=>r.x[t].codeLanguage)){case"python":return x.jsx(uft,{className:e});case"javascript":return x.jsx(FFe,{className:e});case"bash":return x.jsx(cft,{className:e});default:return null}}function gft({sectionId:t}){const e=BAe(t);return x.jsxs("p",{className:"group/card-section:hover:bg font-mono text-[9px] tracking-tighter text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",children:["[",e,"]"]})}function vft({sectionId:t}){return te(n=>n.x[t].renderMarkdown)?x.jsx(glt,{className:"text-transparent transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:text-transparent dark:group-hover/card-section:text-[#0084ff]"}):x.jsx(iHe,{className:"text-transparent transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:text-transparent dark:group-hover/card-section:text-[#0084ff]"})}function Oft({sectionId:t}){return te(n=>n.x[t].isReadOnlyTerminal)?x.jsx(jct,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",...Rr({title:"Read-only terminal"})}):x.jsx(ylt,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",...Rr({title:"Read/write terminal"})})}function yft({sectionId:t}){async function e(){YPe(t)}return x.jsx(mn,{onClick:e,children:"Add artifact by filepath"})}function bft({sectionId:t}){function e(n){const r=te.getState().singletonSections.inMemoryFnStdoutTerminal;r?rg(r):te.setState(i=>{_ie(t,{isReadOnlyTerminal:!0,uiTypeId:Nm.TERMINAL},i)})}return x.jsx(mn,{onClick:e,children:"Add Stdout Terminal"})}function CX({sectionId:t}){function e(){const{variantId:n}=Pi(t);te.setState(r=>{for(const i of Object.keys(r.variants[n].values))r.variants[n].values[i]=Wm()}),hn(!0),Nd(t,n)}return x.jsx(mn,{onClick:e,children:"Clear Values"})}function n1({sectionId:t}){async function e(){dde(t)}return x.jsx(mn,{onClick:e,children:"New Version"})}function xft({sectionId:t}){const{hasParams:e,hideSearch:n,hideParams:r}=te(s=>({hasParams:NAe(t,s),hideSearch:s.x[t].hideSearch,hideParams:s.x[t].hideParams}),ae.isEqual);function i(){te.setState(s=>{s.x[t].hideParams=!r})}return!e&&!n&&x.jsx(mn,{onClick:i,children:r?"Show Params":"Hide Params"})}function wft({sectionId:t}){const{selectedItem:e,hideSearch:n,hideParams:r}=te(s=>({selectedItem:Yt(t,s).selectedItem,hideSearch:s.x[t].hideSearch,hideParams:s.x[t].hideParams}),ae.isEqual);function i(){te.setState(s=>{s.x[t].hideSearch=!n})}return!e&&!r&&x.jsx(mn,{onClick:i,children:n?"Show Search":"Hide Search"})}function EX({sectionId:t}){const e=te(r=>r.x[t].hideUnpinnedParams);function n(){te.setState(r=>{r.x[t].hideUnpinnedParams=!e})}return x.jsx(mn,{onClick:n,children:e?"Show Unpinned Params":"Hide Unpinned Params"})}function TX({sectionId:t}){function e(n){const{paramSweepSectionId:r}=te.getState().x[t];r?rg(r):Sft(t)}return x.jsx(mn,{onClick:e,children:"Add Param Sweep"})}function Sft(t){const e=Kn();te.setState(n=>{n.x[t].paramSweepSectionId=e,_ie(t,{id:e,name:Kse(n.x[t].name),uiTypeId:Nm.PARAM_SWEEP},n)})}function r1({sectionId:t}){function e(){Bne([t]);const{variantId:n}=Pi(t);Nd(t,n)}return x.jsx(mn,{onClick:e,children:"Reset To Default Version"})}function _ft({sectionId:t}){const{displayMode:e,renderMarkdown:n,variantIsFrozen:r}=te(o=>({displayMode:o.x[t].displayMode,renderMarkdown:o.x[t].renderMarkdown,variantIsFrozen:Yt(t,o).isFrozen}),ae.isEqual);function i(){te.setState(o=>{o.x[t].displayMode=e===so.RENDER?so.EDIT:so.RENDER})}const s=n?"Markdown":"Plaintext";return x.jsx(mn,{onClick:i,disabled:r,children:e===so.EDIT?`Render ${s}`:`Edit ${s}`})}function kft({sectionId:t}){const e=te(i=>i.x[t].renderMarkdown);function n(){te.setState(i=>{i.x[t].renderMarkdown=!e})}const r=e?"Plaintext":"Markdown";return x.jsx(mn,{onClick:n,children:`Convert to ${r}`})}function Rw({sectionId:t}){const e=te(r=>r.x[t].displayMode);function n(){te.setState(r=>{const i=e===so.YAML?so.GUI:so.YAML;r.x[t].displayMode=i;const{height:s,width:o}=r.x[t].size;if(i===so.YAML&&(s==="auto"||o==="auto")){r.x[t].tempSavedSize=r.x[t].size;const{width:a,height:l}=Uf(t);r.x[t].size={width:a,height:l}}})}return x.jsx(mn,{onClick:n,children:e===so.YAML?"Show GUI":"Show Yaml"})}function Cft({sectionId:t}){function e(){te.setState(n=>{Ide(t,n)}),hn(!0)}return x.jsx(mn,{onClick:e,children:"Ungroup"})}function Hde({sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n}){const r=Tft(e),i=QXe(t),s=`nodrag w-[14px] h-[14px] flex cursor-pointer select-none items-center justify-center rounded-full ${i?"ml-1 p-0.5":"p-1"} mr-1 -ml-0.5 aspect-square font-semibold leading-none text-setta-700 outline-none transition-colors duration-150 hover:bg-setta-100 focus-visible:ring-2 dark:text-setta-200 dark:hover:bg-setta-800 [&_*]:data-[state=open]:!text-setta-300 dark:[&_*]:data-[state=open]:!text-setta-500`,o=`nodrag flex select-none items-center justify-center rounded-full ${i?"ml-1 p-0.5":"p-0.5"} mr-1 aspect-square font-semibold leading-none text-setta-700 outline-none transition-colors duration-150 dark:text-setta-200`;return r.length===0?x.jsx("div",{className:o,children:x.jsx(kX,{sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n,isListElement:i})}):x.jsx(tie,{className:Cl,children:x.jsx(Eft,{triggerClassName:s,trigger:x.jsx(kX,{sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n,isListElement:i}),children:r.map((a,l)=>x.jsx(a,{sectionId:t},l))})})}function Eft({children:t,trigger:e,triggerClassName:n}){return x.jsx(gie,{triggerClassName:n,contentClassName:"z-20 min-w-[200px] rounded-md border border-solid border-setta-100 bg-white p-1 shadow-xl transition-all will-change-[transform,opacity] dark:border-setta-700/50 dark:bg-setta-850",contentAlign:"start",contentSideOffset:5,contentAlignOffset:-3,trigger:e,children:t})}function Tft(t){switch(t){case Y.INFO:return[_ft,kft,n1,r1];case Y.SECTION:return[n1,TX,wft,xft,EX,Rw,CX,r1];case Y.GLOBAL_VARIABLES:return[n1,TX,EX,Rw,CX,r1];case Y.PARAM_SWEEP:return[n1,Rw,r1];case Y.GLOBAL_PARAM_SWEEP:return[Rw];case Y.LIST_ROOT:case Y.DICT_ROOT:case Y.CODE:return[n1,r1,bft];case Y.GROUP:return[Cft];case Y.DRAW:case Y.IMAGE:case Y.CHART:return[yft];default:return[]}}function Zde({sectionId:t,titleProps:e}){const{sectionName:n,titleIsEditable:r}=$ft(t);return r?x.jsx(Aft,{sectionId:t,sectionName:n,titleProps:e,...Rr({title:n})}):x.jsx(Pft,{sectionName:n,className:e.fixed,...Rr({title:n})})}function Pft({sectionName:t,className:e,onMouseEnter:n,onMouseLeave:r}){return x.jsx("h2",{className:e,onMouseEnter:n,onMouseLeave:r,children:t})}function Aft({sectionId:t,sectionName:e,titleProps:n,onMouseEnter:r,onMouseLeave:i}){function s(h){Rft(t,h)}function o(h){return!Mft(t,h)}const[a,l,c,u,f]=IM(e,s,o);return x.jsx(Kie,{value:a,onChange:l,onBlur:c,onKeyDown:u,titleProps:n,doubleClickToEdit:!0,onMouseEnter:r,onMouseLeave:i,blurTriggeredByEscapeKey:f})}function Rft(t,e){te.setState(n=>{const r=n.x[t];r.name=e,r.paramSweepSectionId&&(n.x[paramSweepSectionId].name=Kse(e)),n.shouldRenameReferences=!0}),hn(!0)}function $ft(t){return te(e=>{const n=[Y.GLOBAL_VARIABLES,Y.PARAM_SWEEP,Y.GLOBAL_PARAM_SWEEP].includes(dn(t,e)),r=II(t,[Y.LIST_ROOT],e);return{sectionName:e.x[t].name,titleIsEditable:!r&&!n}})}function Mft(t,e){const n=te.getState(),{parentId:r}=n.x[t],i=r?Yt(r).children:mr.getState().x.keys();for(const s of i)if(n.x[s].name===e)return!0;return!1}function Ift(t){switch(t){case Y.CODE:return"bg-white dark:bg-setta-900";case Y.TERMINAL:return"bg-setta-950 overflow-clip";case Y.GLOBAL_PARAM_SWEEP:return"@container/multipane";case Y.GLOBAL_VARIABLES:return"bg-white dark:bg-black";default:return"bg-setta-50 dark:bg-setta-860"}}function Yde({jsonSourceMissing:t,isActiveSection:e,isGlobalVariables:n,isInOtherProjectConfigs:r}){return t?"outline-red-600 dark:outline-red-400":e&&n?"outline-green-600 dark:outline-turquoise-400":r?e?"outline-purple-600 dark:outline-purple-700":"outline-transparent [&:active:not(:has(button:active,:active.setta-prevent-section-active-css))]:outline-fuchsia-400":e?"outline-blue-600 dark:outline-blue-700":"outline-transparent [&:active:not(:has(button:active,:active.setta-prevent-section-active-css))]:outline-cyan-300"}function Gde(t,e){return n=>{if(n.target.closest(`button, [role="menuitem"], .${lT}`)||Dft())return;if(n.stopPropagation(),Ut.getState().mouseDownDrawArea){Ut.setState({mouseDownDrawArea:!1});return}if(Ut.getState().isSelectingParams){const i=QAe(t,te.getState());!e&&i?yW([t]):e&&!i&&HT([t])}else qe.getState().multiSelectionActive?e?HT([t]):yW([t]):Vd([t]);const r=B5(t);o3([r],!1)}}function Kde(t){return qf(e=>{var n;return((n=e.x[t])==null?void 0:n.length)>0})}function Dft(t=5){const{lastMouseDownLocation:e,lastMouseUpLocation:n}=Ut.getState();if(!e||!n)return!1;const r=n.x-e.x,i=n.y-e.y;return Math.sqrt(r*r+i*i)>t}function Lft({isGroup:t,sectionId:e,droppableRef:n,draggableRef:r,className:i,style:s,trueDragListeners:o,children:a}){const l=qde(e,"withNested");function c(f){l.current=f,n&&n(f),r&&r(f)}const u={ref:c,...o};return t?x.jsx(Qft,{sectionId:e,commonProps:u,refForPosition:l,className:i,style:s,children:a}):x.jsx("div",{className:`${i} focus-visible:outline-none`,style:s,...u,onKeyDown:f=>Oie(f,l,e),tabIndex:"-1",children:a})}const Nft=ke.memo(Lft,ae.isEqual);function Qft({sectionId:t,commonProps:e,refForPosition:n,className:r,style:i,children:s}){const o=Kde(t),a=ir(d=>d.ids.includes(t)),{positionAndSizeLocked:l,isInOtherProjectConfigs:c}=te(d=>({positionAndSizeLocked:d.x[t].positionAndSizeLocked,isInOtherProjectConfigs:d.x[t].isInOtherProjectConfigs}),ae.isEqual),f=Ude()?"pointer-events-none select-none":"",h=Yde({isActiveSection:a,isInOtherProjectConfigs:c});return x.jsxs("div",{className:`group/group-section flex min-w-[250px] flex-col items-stretch px-6 pb-6 pt-2 focus-visible:outline-none ${r}`,...e,onClick:Gde(t,a),onKeyDown:d=>Oie(d,n,t),tabIndex:"-1",style:i,children:[x.jsx("div",{className:`outline outline-4 ${h} transition-radius absolute left-0 right-0 top-0 z-0 h-full w-full ${l?"rounded-sm border-setta-400/90 dark:border-setta-975/35":"rounded-3xl border-setta-50/50 dark:border-setta-700"} border border-solid bg-setta-100/40 outline outline-2 outline-transparent backdrop-blur-[1px] dark:bg-setta-950/20`}),x.jsxs("div",{className:"z-10 flex min-h-10 w-full items-center",children:[x.jsx(Hde,{sectionId:t,sectionTypeName:Y.GROUP,isInOtherProjectConfigs:c}),x.jsx("div",{className:`${f} relative my-auto mr-2 flex min-h-10 w-full items-center overflow-hidden`,children:x.jsx(jft,{sectionId:t})}),x.jsxs("div",{className:"z-10 ml-auto flex items-center",children:[x.jsx(aft,{sectionId:t}),x.jsx(Xde,{sectionId:t})]})]}),!o&&x.jsx("div",{className:"z-10 -mx-4 mt-4 flex flex-row items-center justify-center rounded-xl border-4 border-dashed border-setta-300 px-4 py-3 text-sm text-setta-500/80 dark:border-setta-700 dark:text-setta-500",children:"Drop A Section Here."}),s]})}function jft({sectionId:t}){const e={editing:"absolute nodrag cursor-text box-border px-1 focus-visible:ring-0 focus-visible:outline-none focus-visible:border-blue-500 rounded-lg border border-solid border-transparent w-full tracking-tighter text-setta-500 dark:text-setta-500 cursor-pointer flex-shrink",notEditing:"absolute cursor-pointer box-border px-1 focus-visible:ring-0 focus-visible:outline-none focus-visible:border-blue-500 rounded-lg border border-solid border-transparent w-full truncate tracking-tighter text-setta-500 dark:text-setta-500 flex-shrink"};return x.jsx(Zde,{sectionId:t,titleProps:e})}function Bft({behaviorDropType:t,children:e,isGroup:n}){const r=gut[t];return x.jsxs(x.Fragment,{children:[t&&x.jsx(zft,{text:r,behaviorDropType:t,isGroup:n}),e]})}function zft({text:t,behaviorDropType:e,isGroup:n}){return x.jsx("div",{className:`absolute z-20 grid h-full w-full justify-center ${n?"[place-content:end_center]":"place-content-center"}`,children:x.jsx(Fft,{text:t,behaviorDropType:e,isGroup:n})})}function Fft({text:t,behaviorDropType:e,isGroup:n}){const r=e===sb.INVALID;return x.jsx("div",{className:`grid h-8 min-w-60 select-none place-items-center rounded-full text-sm font-bold uppercase tracking-widest text-white shadow-md backdrop-blur-sm transition-opacity ${r?"[background-color:rgba(220,_38,_38,_0.8)]":"[background-color:rgba(37,_99,_235,_0.8)]"} ${n&&"mb-8"}`,children:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(z$e,{}),t]})})}function Wft({isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,children:o}){const{style:a,behaviorDropType:l}=rft({sectionId:e,isGroup:t});return x.jsx(Bft,{behaviorDropType:l,isGroup:t,children:x.jsx(Uft,{isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,style:a,children:o})})}const Jde=ke.memo(Wft,(t,e)=>t.isGroup===e.isGroup&&t.children===e.children&&ae.isEqual(t.dragListeners,e.dragListeners));function Vft({isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,style:o,children:a}){const l=cn(p=>p.activeId===e),{isSorting:c,isMovingFree:u}=zne(),f=u||!n&&c?s:{},h=c||u?"nodrag":"",d=l?{...o,opacity:.5}:o;return x.jsx(Nft,{isGroup:t,sectionId:e,droppableRef:r,draggableRef:i,trueDragListeners:f,className:h,style:d,children:a})}const Uft=ke.memo(Vft,ae.isEqual);function qft({isGroup:t,sectionId:e,children:n}){const r=cn(l=>l.activeId===e),i=Vde({sectionId:e,isTopLevel:!0}),{setNodeRef:s}=Wee({...i,disabled:r}),{listeners:o,setNodeRef:a}=Fee(i);return x.jsx(Jde,{isGroup:t,sectionId:e,isTopLevel:!0,droppableRef:s,draggableRef:a,dragListeners:o,children:n})}function Xft({isGroup:t,sectionId:e,dragListeners:n,children:r,isTopLevel:i}){return i?x.jsx(qft,{isGroup:t,sectionId:e,children:r}):x.jsx(Jde,{isGroup:t,sectionId:e,isTopLevel:i,dragListeners:n,children:r})}function Hft({sectionId:t,items:e,children:n}){const r=ift(t),i=cn(s=>s.isSorting?s.activeId:s.overId);return x.jsx(L8e,{id:t,items:e,strategy:Zft(r,i),disabled:r,children:n})}function PX(){return[{x:0,y:0,scaleX:1,scaleY:1},-1]}function Zft(t,e){if(t.draggable||t.droppable)return PX;if(e){const n=IA(e);if(n)return Pi(n).isHorizontalOrientation?P8e:I8e}return PX}function Yft({sectionId:t}){return F5(t)?x.jsx(Jft,{sectionId:t}):x.jsx(e0e,{sectionId:t,forceApplyTransform:!1})}const Gft=ke.memo(Yft);function Kft({sectionId:t}){const[e,n]=_.useState(!0);return _.useEffect(()=>{n(!1)},[]),x.jsx(e0e,{sectionId:t,forceApplyTransform:e})}const Jft=ke.memo(Kft);function eht({sectionId:t,forceApplyTransform:e}){const n=sht(),r=Vde({sectionId:t,isTopLevel:!1}),{attributes:{role:i,...s},listeners:o,setNodeRef:a,transform:l,transition:c,overIndex:u,items:f}=V8e({...r,animateLayoutChanges:n});return x.jsx(rht,{sectionId:t,attributes:s,listeners:o,setNodeRef:a,transform:l,transition:c,applyTransform:e||u!==null&&u!==-1||f.length===1&&f[0]===t&&F5(t)})}const e0e=ke.memo(eht);function tht({sectionId:t,attributes:e,listeners:n,setNodeRef:r,transform:i,transition:s,applyTransform:o}){const a=cn(f=>f.overId===t),l=iht(o?i:null),u={style:{transform:wf.Translate.toString(l),transition:s,zIndex:a?500:void 0},ref:r,...e};return x.jsx("div",{className:"relative flex w-full outline-none",...u,tabIndex:"-1",children:x.jsx(nht,{sectionId:t,applyTransform:o,listeners:n})})}function nht({sectionId:t,applyTransform:e,listeners:n}){return F5(t)?e?x.jsx(hut,{}):null:x.jsx(e1e,{sectionId:t,dragListeners:n})}const rht=ke.memo(tht,(t,e)=>t.sectionId===e.sectionId&&t.transform===e.transform&&t.transition===e.transition&&ae.isEqual(t.listeners,e.listeners));function iht(t){if(t){const e=qe.getState().transform[2];return{...t,x:t.x/e,y:t.y/e}}return t}function sht(){const t=cn(e=>e.isSorting);return()=>t}function oht({sectionId:t,isGroup:e}){return Kde(t)&&x.jsx("div",{className:"flex flex-col",children:x.jsx(aht,{sectionId:t,isGroup:e})})}function aht({sectionId:t,isGroup:e}){const n=qf(r=>r.x[t]);return x.jsx(Hft,{sectionId:t,items:n,children:x.jsx(lht,{childIds:n,sectionId:t,isGroup:e})})}function lht({childIds:t,sectionId:e,isGroup:n}){const r=()=>{rg(e)},i=te(s=>s.x[e].isHorizontalOrientation);return x.jsxs("div",{className:"flex items-stretch",children:[!n&&x.jsx("div",{className:"mr-2 mt-2 min-h-full w-2 rounded-full bg-white/30 transition-all duration-75 hover:cursor-pointer hover:bg-white/50 dark:bg-setta-700 hover:dark:bg-setta-600",onClick:r}),x.jsx("div",{className:`mt-2 flex ${i?"flex-row":"flex-col "} items-start gap-2`,children:t.map(s=>x.jsx(Gft,{sectionId:s},`Nested-Sec-${s}`))})]})}const ks={any:"any",auto_only:"auto_only",manual_only:"manual_only"};function y4(t){return t==="auto"?t:parseInt(t)}function AX(t,e,n){return n!==ks.manual_only?t:e}function cht({direction:t,ref:e,sizeMode:n,aspectRatio:r}){const i=y4(e.style.width),s=y4(e.style.height),o=AX("auto",i,n.width),a=AX("auto",s,n.height);return t==="bottomRight"?{width:o,height:a}:t==="right"&&n.width?r?{width:o,height:a}:{width:o}:t==="bottom"&&n.height?r?{width:o,height:a}:{height:a}:{}}function uht({direction:t,ref:e,sizeMode:n,aspectRatio:r}){const i=y4(e.style.width),s=y4(e.style.height);return t==="bottomRight"?{width:i,height:s}:t==="right"&&n.width?r?{width:i,height:s}:{width:i}:t==="bottom"&&n.height?r?{width:i,height:s}:{height:s}:{}}function t0e({props:t,sizeMode:e,aspectRatio:n}){const[r,i,s,o]=t;return o.width===0&&o.height===0&&r.detail===2?cht({direction:i,ref:s,sizeMode:e,aspectRatio:n}):uht({direction:i,ref:s,sizeMode:e,aspectRatio:n})}const DA=1e5,fht=1e5,hht=64,n0e=50,r0e=32;function KD({sectionType:t,hideSearch:e,hideParams:n,isMinimized:r}){if(r)return r0e;if(t===Y.SECTION)return e?78:n?58:104;if(t===Y.LIST_ROOT||t===Y.DICT_ROOT)return n0e;if(t===Y.GLOBAL_VARIABLES)return 78;if(t===Y.CODE)return 58.2;if(t===Y.INFO)return 98;if(t===Y.PARAM_SWEEP)return 50;if(t===Y.TERMINAL)return 100;if(t===Y.GLOBAL_PARAM_SWEEP)return 112;if(t===Y.DRAW||t===Y.IMAGE)return 100;if(t===Y.CHART)return 300;if(t===Y.SOCIAL)return 50}function dht({sectionType:t,isMinimized:e}){return e?r0e:t===Y.LIST_ROOT||t===Y.DICT_ROOT?n0e:DA}function JD({sectionType:t,isTwitter:e}){return e?370:t===Y.DRAW?402:t===Y.CHART?300:200}function pht({isTwitter:t}){return t?574:fht}function mht({sectionType:t,hideParams:e,isTwitter:n}){if(t===Y.SECTION){if(e)return{height:ks.auto_only,width:ks.any}}else if(t===Y.TERMINAL||t===Y.CHART)return{height:ks.manual_only,width:ks.manual_only};return n?{height:ks.auto_only,width:ks.any}:{height:ks.any,width:ks.any}}function ght(t){return te(e=>{const n=fft(t,e),r=dn(t,e),i=e.x[t].hideSearch,s=e.x[t].hideParams,o=e.x[t].isMinimized,a=KD({sectionType:r,hideSearch:i,hideParams:s,isMinimized:o}),l=dht({sectionType:r,isMinimized:o}),c=JD({sectionType:r,isTwitter:n}),u=pht({isTwitter:n}),f=mht({sectionType:r,hideParams:s,isTwitter:n});return{minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f}},ae.isEqual)}function dg(){const[t,e]=_.useState(!1),n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;function r(){n.current&&e(n.current.scrollHeight>n.current.clientHeight)}const i=new ResizeObserver(()=>{r()}),s=new MutationObserver(()=>{r()});return i.observe(n.current),s.observe(n.current,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),r(),()=>{i.disconnect(),s.disconnect()}},[]),{ref:n,isScrollable:t}}async function LA(t,e){const n=dn(t),r=KD({sectionType:n}),i=JD({sectionType:n}),s=te.getState().x[t].size;let o=iut(s.height,s.width,e.height,e.width);o=Ade(o.height,o.width,r,i);const a=24;o.height+=a,te.setState(l=>{ik({sectionId:t,aspectRatio:e.width/e.height,aspectRatioExtraHeight:a,size:o,state:l})})}function vht(t,e){const[n,r]=_.useState(null),i=te(s=>{const{width:o,height:a}=s.x[t].size;return o==="auto"||a==="auto"});return _.useEffect(()=>{const s={width:e.width,height:e.height};ae.isEqual(s,n)||LA(t,s),r(s)},[e.src]),_.useEffect(()=>{n&&LA(t,n)},[i]),n!==null}function Oht({sectionId:t,imgSize:e,isNewImg:n,sectionWidth:r,sectionHeight:i,state:s}){let o={};if(e){if(r==="auto"||i==="auto"||n){const c=Y.DRAW,u=KD({sectionType:c}),f=JD({sectionType:c});o=Ade(e.height,e.width,u-120,f-24),BO(t,{width:o.width+24,height:o.height+120},s)}else o.width=r-24,o.height=i-120;n&&ik({sectionId:t,aspectRatio:e.width/e.height,aspectRatioExtraHeight:120,aspectRatioExtraWidth:24,state:s})}else{const[c,u]=[500,500];o.width=r==="auto"?c:r-24,o.height=i==="auto"?u:i-120,(r==="auto"||i==="auto")&&BO(t,{width:o.width+24,height:o.height+120},s)}return o}function yht(t){const n={width:640,height:360},{width:r,height:i}=te(a=>a.x[t].size,ae.isEqual);function s(){n.height+=22,te.setState(a=>{ik({sectionId:t,aspectRatio:16/9,aspectRatioExtraHeight:22,size:n,state:a})})}return _.useEffect(()=>{(r==="auto"||i==="auto")&&s()},[r,i]),_.useEffect(()=>{LA(t,n)},[]),r==="auto"||i==="auto"?{}:{width:r,height:i-22}}function bht(t){_.useEffect(()=>{te.setState(e=>{ik({sectionId:t,aspectRatio:null,aspectRatioExtraHeight:null,aspectRatioExtraWidth:null,size:{height:"auto"},state:e})})},[])}function ik({sectionId:t,size:e,aspectRatio:n,aspectRatioExtraHeight:r,aspectRatioExtraWidth:i,state:s}){const o=s.x[t];o.aspectRatio=n,o.aspectRatioExtraHeight=r,o.aspectRatioExtraWidth=i,e&&BO(t,e,s)}function eL({children:t,onResizeStart:e,as:n,...r}){const{scale:i,onResizeStart:s}=xht();function o(...a){e&&e(...a),s(...a)}return x.jsx(xle,{...r,scale:i,as:n,onResizeStart:o,children:t})}function xht(){const[t,e]=_.useState(1);function n(){e(qe.getState().transform[2])}return{scale:t,onResizeStart:n}}function wht({sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,children:s,as:o}){const{minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f}=ght(t);return x.jsx(Sht,{sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f,as:o,children:s})}function Sht({sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,minHeight:s,maxHeight:o,minWidth:a,maxWidth:l,sizeMode:c,children:u,as:f}){_.useEffect(()=>{const E={};c.height===ks.auto_only&&(E.height="auto"),c.width===ks.auto_only&&(E.width="auto"),ae.size(E)>0&&te.setState(T=>{wX(t,E,T)})},[c.height,c.width]);const{size:h,aspectRatio:d,aspectRatioExtraHeight:p,aspectRatioExtraWidth:g}=kht(t);function m(){te.setState(E=>{RX(t,"start",E)})}function v(...E){const T=t0e({props:E,sizeMode:c,aspectRatio:d});te.setState(C=>{wX(t,T,C),RX(t,"end",C)}),hn(!0)}const y=s!==o&&c.height!==ks.auto_only,b=c.width!==ks.auto_only,S=Nt(E=>E.gui.snapGrid),k=Ot.snapToGrid.hook()[0];return x.jsx(_ht,{sectionId:t,as:f,bgColor:e,isYouTube:n,isActiveSection:r,size:h,minHeight:s,maxHeight:o,minWidth:a,maxWidth:l,heightResizable:y,widthResizable:b,positionAndSizeLocked:i,onResizeStart:m,onResizeStop:v,aspectRatio:d,aspectRatioExtraHeight:p,aspectRatioExtraWidth:g,snapGrid:S,snapToGrid:k,children:u})}function _ht({sectionId:t,as:e,bgColor:n,isYouTube:r,isActiveSection:i,size:s,minHeight:o,maxHeight:a,minWidth:l,maxWidth:c,heightResizable:u,widthResizable:f,positionAndSizeLocked:h,onResizeStart:d,onResizeStop:p,aspectRatio:g,aspectRatioExtraHeight:m,aspectRatioExtraWidth:v,snapGrid:y,snapToGrid:b,children:S}){const k=Ude(),E=k||h?!1:{top:!1,left:!1,bottom:u,right:f,topRight:!1,bottomRight:u&&f,topLeft:!1,bottomLeft:!1},T=`${k?"pointer-events-none select-none":""} ${n} section-grid-cols section-grid-rows section-grid-areas grid h-full transition-radius ${h?"rounded-sm":"rounded-xl shadow-md"} before:content-none before:block before:absolute before:top-0 before:right-0 before:bottom-0 before:left-0 before:border before:border-white dark:before:border-setta-700 ${r?"overflow-clip":""} ${i?"z-[150]":"z-10"}`;return x.jsx(eL,{id:`${t}-CustomResizable`,as:e,size:s,minHeight:o,maxHeight:a,minWidth:l,maxWidth:c,onResizeStart:d,onResizeStop:p,lockAspectRatio:g,lockAspectRatioExtraHeight:m,lockAspectRatioExtraWidth:v,handleWrapperClass:"absolute pointer-events-none [&>*]:pointer-events-auto h-full bottom-0 w-full nodrag [&>div]:z-20",enable:E,className:T,handleStyles:{right:{right:"-8px"},bottom:{bottom:"-8px"}},handleClasses:{right:`${lT} ${Cl} ${Jp}`,bottom:`${lT} ${Cl} ${Jp}`},grid:b?y:null,children:S})}function kht(t){return te(e=>{const n=e.x[t];return n.isMinimized?{size:n.size,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0}:{size:n.size,aspectRatio:n.aspectRatio??!1,aspectRatioExtraHeight:n.aspectRatioExtraHeight??0,aspectRatioExtraWidth:n.aspectRatioExtraWidth??0}},ae.isEqual)}function RX(t,e,n){n.x[t].resizeEvent=e}const i0e="Popover",[s0e,_Et]=Oo(i0e,[Z5]),sk=Z5(),[Cht,Jd]=s0e(i0e),Eht=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=sk(e),l=_.useRef(null),[c,u]=_.useState(!1),[f=!1,h]=Nl({prop:r,defaultProp:i,onChange:s});return _.createElement(Ere,a,_.createElement(Cht,{scope:e,contentId:ff(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:_.useCallback(()=>h(d=>!d),[h]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o},n))},Tht="PopoverTrigger",Pht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Jd(Tht,n),s=sk(n),o=In(e,i.triggerRef),a=_.createElement(gn.button,Ee({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":l0e(i.open)},r,{ref:o,onClick:gt(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:_.createElement(Tre,Ee({asChild:!0},s),a)}),o0e="PopoverPortal",[Aht,Rht]=s0e(o0e,{forceMount:void 0}),$ht=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Jd(o0e,e);return _.createElement(Aht,{scope:e,forceMount:n},_.createElement(zd,{present:n||s.open},_.createElement(Are,{asChild:!0,container:i},r)))},zO="PopoverContent",Mht=_.forwardRef((t,e)=>{const n=Rht(zO,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Jd(zO,t.__scopePopover);return _.createElement(zd,{present:r||s.open},s.modal?_.createElement(Iht,Ee({},i,{ref:e})):_.createElement(Dht,Ee({},i,{ref:e})))}),Iht=_.forwardRef((t,e)=>{const n=Jd(zO,t.__scopePopover),r=_.useRef(null),i=In(e,r),s=_.useRef(!1);return _.useEffect(()=>{const o=r.current;if(o)return G5(o)},[]),_.createElement(dM,{as:lm,allowPinchZoom:!0},_.createElement(a0e,Ee({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:gt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:gt(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),Dht=_.forwardRef((t,e)=>{const n=Jd(zO,t.__scopePopover),r=_.useRef(!1);return _.createElement(a0e,Ee({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var o;r.current||(o=n.triggerRef.current)===null||o===void 0||o.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var s,o;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0);const a=i.target;((o=n.triggerRef.current)===null||o===void 0?void 0:o.contains(a))&&i.preventDefault()}}))}),a0e=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=t,h=Jd(zO,n),d=sk(n);return hre(),_.createElement(dre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(ure,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},_.createElement(Pre,Ee({"data-state":l0e(h.open),role:"dialog",id:h.contentId},d,f,{ref:e,style:{...f.style,["--radix-popover-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))))}),Lht="PopoverClose",Nht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Jd(Lht,n);return _.createElement(gn.button,Ee({type:"button"},r,{ref:e,onClick:gt(t.onClick,()=>i.onOpenChange(!1))}))}),Qht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=sk(n);return _.createElement(GMe,Ee({},i,r,{ref:e}))});function l0e(t){return t?"open":"closed"}const jht=Eht,Bht=Pht,zht=$ht,Fht=Mht,Wht=Nht,Vht=Qht;function $1({trigger:t,contentClasses:e,children:n,open:r,close:i=!1,closeClasses:s,onOpenChange:o,arrowClasses:a}){return x.jsxs(jht,{open:r,onOpenChange:o,children:[x.jsx(Bht,{asChild:!0,children:t}),x.jsx(zht,{children:x.jsxs(Fht,{className:e,children:[i&&x.jsx(Wht,{className:s,children:i}),x.jsx(Vht,{className:a||"[fill:rgb(229,_231,_235)] dark:[fill:rgb(51,_65,_85)]"}),n]})})]})}function c0e({sectionId:t,isRoot:e,popover:n=!1}){const r=C5(t),i=c=>{$Ne(e,t,c)},s=c=>{qct(e,t,c)},o=c=>{c&&!isNaN(c)?l(parseInt(c)):l("")},[a,l]=_.useState(1);return x.jsxs("div",{className:`section-key-value section-row-main -mx-2 flex items-center gap-1 rounded-lg bg-setta-100 pl-2 pr-1 dark:bg-setta-950 ${n?"border border-solid border-white py-1 shadow-lg dark:border-setta-800":""}`,children:[e?x.jsxs(x.Fragment,{children:[x.jsx(hHe,{className:"text-setta-300 dark:text-setta-600"}),x.jsx("p",{className:"text-[10px] font-bold text-setta-500",children:"Children: "})]}):x.jsx("p",{className:"text-[10px] text-setta-500",children:"Siblings"}),x.jsx("input",{className:"nodrag max-w-[3ch] cursor-auto rounded-md bg-white px-2 text-xs focus-visible:ring-2 dark:bg-setta-800 dark:text-setta-300",value:a,onChange:c=>o(c.target.value),disabled:r}),x.jsx("button",{className:"nodrag gg-math-minus rounded-full focus-visible:ring-2 dark:text-setta-300",onClick:()=>s(a),role:"button",disabled:r}),x.jsx("button",{className:"nodrag gg-math-plus rounded-full focus-visible:ring-2 dark:text-setta-300",onClick:()=>i(a),role:"button",disabled:r})]})}function Uht({onClick:t,...e}){return x.jsx(Fa,{...e,icon:x.jsx("i",{className:"gg-close"}),color:"text-setta-600 hover:text-white",bg:"bg-transparent hover:bg-red-500",size:"min-w-4 h-4",padding:"p-0",onClick:t})}function qht({sectionId:t,twClasses:e,...n}){const r=te(s=>s.x[t].isMinimized);function i(){te.setState(s=>{s.x[t].isMinimized=!r})}return x.jsx(Fa,{...n,icon:r?x.jsx("i",{className:"gg-maximize !scale-[.4]"}):x.jsx("i",{className:"gg-math-minus"}),color:"text-setta-600 hover:text-white",bg:"bg-transparent hover:bg-blue-500 justify-content-center mr-1",size:"w-4 h-4",padding:"p-0",twClasses:e,onClick:i})}function Xht({sectionId:t}){function e(){const{runInMemory:n}=Pi(t);n?RM([t]):$M([t])}return x.jsx(Fa,{icon:x.jsx(lre,{}),color:"text-setta-600 hover:text-green-500 active:!text-blue-700",bg:"bg-transparent",size:"w-4 h-4",padding:"p-0 mr-1",onClick:e,...Rr({title:"Run this code block"})})}function Hht({sectionId:t}){const e=te(r=>r.x[t].runInMemory);function n(){te.setState(r=>{r.x[t].runInMemory=!e})}return x.jsx(Fa,{icon:x.jsx(tHe,{}),color:`${e?"text-blue-500 hover:!text-cyan-200":"text-setta-600 hover:!text-blue-500"} active:!text-blue-500`,bg:`${e?"hover:bg-blue-500":"bg-transparent"}`,size:"w-4 h-4",padding:"p-0 mr-1",onClick:n,...Rr({title:"Toggle In-Memory Code"})})}function Zht({sectionId:t,isActiveSection:e,sectionTypeName:n,isInOtherProjectConfigs:r,isRoot:i}){const s=()=>{te.setState(a=>{_m([t],a)}),hn(!0)},o=NXe(t)&&!i;return x.jsxs("header",{className:"section-title mx-2 flex flex-row items-center",children:[x.jsx(Hde,{sectionId:t,sectionTypeName:n,isInOtherProjectConfigs:r}),n!==Y.INFO&&x.jsx(x.Fragment,{children:x.jsx(Yht,{sectionId:t,isActiveSection:e,isInOtherProjectConfigs:r,sectionTypeName:n})}),x.jsxs("div",{className:"z-10 ml-auto flex items-center",children:[o&&x.jsx($1,{arrowClasses:"fill-white dark:fill-setta-800",contentClasses:"z-20",trigger:x.jsx(Fa,{twClasses:"[&_*]:hover:text-setta-500 [&_*]:dark:hover:text-setta-400",bg:"bg-transparent",children:x.jsx(fHe,{className:"text-setta-300 dark:text-setta-700"})}),children:x.jsx(c0e,{sectionId:t,isRoot:i,popover:!0})}),n===Y.CODE&&x.jsxs(x.Fragment,{children:[x.jsx(Xht,{sectionId:t})," ",x.jsx(Hht,{sectionId:t})," "]}),x.jsx(Xde,{sectionId:t}),!i&&x.jsx(qht,{sectionId:t}),x.jsx(Uht,{onClick:s})]})]})}function Yht({sectionId:t,isActiveSection:e,isInOtherProjectConfigs:n,sectionTypeName:r}){return x.jsx(Zde,{sectionId:t,titleProps:Kht({isActiveSection:e,isInOtherProjectConfigs:n,sectionTypeName:r})})}const Ght=ke.memo(Zht);function Kht({isActiveSection:t,isInOtherProjectConfigs:e,sectionTypeName:n}){const r="cursor-text nodrag px-1 py-0 leading-5 -ml-1 bg-setta-100 focus-visible:ring-0 focus-visible:outline-none rounded-md box-border border border-solid border-transparent focus-visible:border-blue-500 dark:bg-setta-800 w-3/5 dark:text-white font-bold text-[.7rem] tracking-tight",i=n===Y.GLOBAL_VARIABLES,s=Jht({isActiveSection:t,isInOtherProjectConfigs:e,isGlobalVariables:i,sectionTypeName:n});return i?{fixed:s}:{editing:r,notEditing:s,fixed:"select-none italic focus-visible:ring-0 focus-visible:outline-none box-border border border-solid border-transparent focus-visible:border-blue-500 tracking-tighter text-xs text-setta-400 max-w-full truncate pr-0.5"}}function Jht({isActiveSection:t,isInOtherProjectConfigs:e,isGlobalVariables:n,sectionTypeName:r}){let i="",s="font-bold";return t?e?i="text-purple-800 dark:text-purple-200":n?i="text-green-800 dark:text-green-200":r===Y.TERMINAL?i="text-blue-400":i="text-blue-600 dark:text-blue-400":r===Y.TERMINAL?i="text-setta-300":i="text-setta-700 dark:text-setta-300",n&&(s="uppercase font-bold"),`px-1 py-0 -ml-1 w-3/5 focus-visible:ring-0 focus-visible:outline-none box-border rounded-md border border-solid border-transparent focus-visible:border-blue-500 leading-5 font-bold tracking-tight cursor-pointer max-w-full text-[.7rem] truncate ${i} ${s}`}/*!
356
+ `});default:return x.jsx("i",{className:"gg-menu group/card-section:hover:bg !scale-110 text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "})}}function dft({sectionId:t}){const e=te(n=>dn(t,n)===Y.GROUP);return x.jsx("i",{className:`gg-link group/card-section:hover:bg transition-colors group-hover/card-section:text-pink-500 dark:group-hover/card-section:text-[#ff00ff] ${e?"-rotate-45 !scale-75 text-purple-600 dark:text-purple-700":"text-purple-500 dark:text-purple-500"}`})}function pft({sectionId:t}){const{isYouTube:e,isTwitter:n}=te(r=>({isYouTube:YD(r.x[t].social),isTwitter:GD(r.x[t].social)}),ae.isEqual);return e?x.jsx(vlt,{className:"fill-setta-300 transition-colors group-hover/card-section:fill-blue-500 dark:fill-setta-500 dark:group-hover/card-section:fill-[#0084ff] "}):n?x.jsx(oit,{className:"fill-setta-300 transition-colors group-hover/card-section:fill-blue-500 dark:fill-setta-500 dark:group-hover/card-section:fill-[#0084ff] "}):x.jsx(lft,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] "})}function mft({sectionId:t,classes:e}){switch(te(r=>r.x[t].codeLanguage)){case"python":return x.jsx(uft,{className:e});case"javascript":return x.jsx(FFe,{className:e});case"bash":return x.jsx(cft,{className:e});default:return null}}function gft({sectionId:t}){const e=BAe(t);return x.jsxs("p",{className:"group/card-section:hover:bg font-mono text-[9px] tracking-tighter text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",children:["[",e,"]"]})}function vft({sectionId:t}){return te(n=>n.x[t].renderMarkdown)?x.jsx(glt,{className:"text-transparent transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:text-transparent dark:group-hover/card-section:text-[#0084ff]"}):x.jsx(iHe,{className:"text-transparent transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:text-transparent dark:group-hover/card-section:text-[#0084ff]"})}function Oft({sectionId:t}){return te(n=>n.x[t].isReadOnlyTerminal)?x.jsx(jct,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",...Rr({title:"Read-only terminal"})}):x.jsx(ylt,{className:"text-setta-300 transition-colors group-hover/card-section:text-blue-500 dark:text-setta-500 dark:group-hover/card-section:text-[#0084ff] ",...Rr({title:"Read/write terminal"})})}function yft({sectionId:t}){async function e(){YPe(t)}return x.jsx(mn,{onClick:e,children:"Add artifact by filepath"})}function bft({sectionId:t}){function e(n){const r=te.getState().singletonSections.inMemoryFnStdoutTerminal;r?rg(r):te.setState(i=>{_ie(t,{isReadOnlyTerminal:!0,uiTypeId:Nm.TERMINAL},i)})}return x.jsx(mn,{onClick:e,children:"Add Stdout Terminal"})}function CX({sectionId:t}){function e(){const{variantId:n}=Pi(t);te.setState(r=>{for(const i of Object.keys(r.variants[n].values))r.variants[n].values[i]=Wm()}),hn(!0),Nd(t,n)}return x.jsx(mn,{onClick:e,children:"Clear Values"})}function n1({sectionId:t}){async function e(){dde(t)}return x.jsx(mn,{onClick:e,children:"New Version"})}function xft({sectionId:t}){const{hasParams:e,hideSearch:n,hideParams:r}=te(s=>({hasParams:NAe(t,s),hideSearch:s.x[t].hideSearch,hideParams:s.x[t].hideParams}),ae.isEqual);function i(){te.setState(s=>{s.x[t].hideParams=!r})}return!e&&!n&&x.jsx(mn,{onClick:i,children:r?"Show Params":"Hide Params"})}function wft({sectionId:t}){const{selectedItem:e,hideSearch:n,hideParams:r}=te(s=>({selectedItem:Yt(t,s).selectedItem,hideSearch:s.x[t].hideSearch,hideParams:s.x[t].hideParams}),ae.isEqual);function i(){te.setState(s=>{s.x[t].hideSearch=!n})}return!e&&!r&&x.jsx(mn,{onClick:i,children:n?"Show Search":"Hide Search"})}function EX({sectionId:t}){const e=te(r=>r.x[t].hideUnpinnedParams);function n(){te.setState(r=>{r.x[t].hideUnpinnedParams=!e})}return x.jsx(mn,{onClick:n,children:e?"Show Unpinned Params":"Hide Unpinned Params"})}function TX({sectionId:t}){function e(n){const{paramSweepSectionId:r}=te.getState().x[t];r?rg(r):Sft(t)}return x.jsx(mn,{onClick:e,children:"Add Param Sweep"})}function Sft(t){const e=Kn();te.setState(n=>{n.x[t].paramSweepSectionId=e,_ie(t,{id:e,name:Kse(n.x[t].name),uiTypeId:Nm.PARAM_SWEEP},n)})}function r1({sectionId:t}){function e(){Bne([t]);const{variantId:n}=Pi(t);Nd(t,n)}return x.jsx(mn,{onClick:e,children:"Reset To Default Version"})}function _ft({sectionId:t}){const{displayMode:e,renderMarkdown:n,variantIsFrozen:r}=te(o=>({displayMode:o.x[t].displayMode,renderMarkdown:o.x[t].renderMarkdown,variantIsFrozen:Yt(t,o).isFrozen}),ae.isEqual);function i(){te.setState(o=>{o.x[t].displayMode=e===so.RENDER?so.EDIT:so.RENDER})}const s=n?"Markdown":"Plaintext";return x.jsx(mn,{onClick:i,disabled:r,children:e===so.EDIT?`Render ${s}`:`Edit ${s}`})}function kft({sectionId:t}){const e=te(i=>i.x[t].renderMarkdown);function n(){te.setState(i=>{i.x[t].renderMarkdown=!e})}const r=e?"Plaintext":"Markdown";return x.jsx(mn,{onClick:n,children:`Convert to ${r}`})}function Rw({sectionId:t}){const e=te(r=>r.x[t].displayMode);function n(){te.setState(r=>{const i=e===so.YAML?so.GUI:so.YAML;r.x[t].displayMode=i;const{height:s,width:o}=r.x[t].size;if(i===so.YAML&&(s==="auto"||o==="auto")){r.x[t].tempSavedSize=r.x[t].size;const{width:a,height:l}=Uf(t);r.x[t].size={width:a,height:l}}})}return x.jsx(mn,{onClick:n,children:e===so.YAML?"Show GUI":"Show Yaml"})}function Cft({sectionId:t}){function e(){te.setState(n=>{Ide(t,n)}),hn(!0)}return x.jsx(mn,{onClick:e,children:"Ungroup"})}function Hde({sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n}){const r=Tft(e),i=QXe(t),s=`nodrag w-[14px] h-[14px] flex cursor-pointer select-none items-center justify-center rounded-full ${i?"ml-1 p-0.5":"p-1"} mr-1 -ml-0.5 aspect-square font-semibold leading-none text-setta-700 outline-none transition-colors duration-150 hover:bg-setta-100 focus-visible:ring-2 dark:text-setta-200 dark:hover:bg-setta-800 [&_*]:data-[state=open]:!text-setta-300 dark:[&_*]:data-[state=open]:!text-setta-500`,o=`nodrag flex select-none items-center justify-center rounded-full ${i?"ml-1 p-0.5":"p-0.5"} mr-1 aspect-square font-semibold leading-none text-setta-700 outline-none transition-colors duration-150 dark:text-setta-200`;return r.length===0?x.jsx("div",{className:o,children:x.jsx(kX,{sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n,isListElement:i})}):x.jsx(tie,{className:Cl,children:x.jsx(Eft,{triggerClassName:s,trigger:x.jsx(kX,{sectionId:t,sectionTypeName:e,isInOtherProjectConfigs:n,isListElement:i}),children:r.map((a,l)=>x.jsx(a,{sectionId:t},l))})})}function Eft({children:t,trigger:e,triggerClassName:n}){return x.jsx(gie,{triggerClassName:n,contentClassName:"z-20 min-w-[200px] rounded-md border border-solid border-setta-100 bg-white p-1 shadow-xl transition-all will-change-[transform,opacity] dark:border-setta-700/50 dark:bg-setta-850",contentAlign:"start",contentSideOffset:5,contentAlignOffset:-3,trigger:e,children:t})}function Tft(t){switch(t){case Y.INFO:return[_ft,kft,n1,r1];case Y.SECTION:return[n1,TX,wft,xft,EX,Rw,CX,r1];case Y.GLOBAL_VARIABLES:return[n1,TX,EX,Rw,CX,r1];case Y.PARAM_SWEEP:return[n1,Rw,r1];case Y.GLOBAL_PARAM_SWEEP:return[Rw];case Y.LIST_ROOT:case Y.DICT_ROOT:case Y.CODE:return[n1,r1,bft];case Y.GROUP:return[Cft];case Y.DRAW:case Y.IMAGE:case Y.CHART:return[yft];default:return[]}}function Zde({sectionId:t,titleProps:e}){const{sectionName:n,titleIsEditable:r}=$ft(t);return r?x.jsx(Aft,{sectionId:t,sectionName:n,titleProps:e,...Rr({title:n})}):x.jsx(Pft,{sectionName:n,className:e.fixed,...Rr({title:n})})}function Pft({sectionName:t,className:e,onMouseEnter:n,onMouseLeave:r}){return x.jsx("h2",{className:e,onMouseEnter:n,onMouseLeave:r,children:t})}function Aft({sectionId:t,sectionName:e,titleProps:n,onMouseEnter:r,onMouseLeave:i}){function s(h){Rft(t,h)}function o(h){return!Mft(t,h)}const[a,l,c,u,f]=IM(e,s,o);return x.jsx(Kie,{value:a,onChange:l,onBlur:c,onKeyDown:u,titleProps:n,doubleClickToEdit:!0,onMouseEnter:r,onMouseLeave:i,blurTriggeredByEscapeKey:f})}function Rft(t,e){te.setState(n=>{const r=n.x[t];r.name=e,r.paramSweepSectionId&&(n.x[paramSweepSectionId].name=Kse(e)),n.shouldRenameReferences=!0}),hn(!0)}function $ft(t){return te(e=>{const n=[Y.GLOBAL_VARIABLES,Y.PARAM_SWEEP,Y.GLOBAL_PARAM_SWEEP].includes(dn(t,e)),r=II(t,[Y.LIST_ROOT],e);return{sectionName:e.x[t].name,titleIsEditable:!r&&!n}})}function Mft(t,e){const n=te.getState(),{parentId:r}=n.x[t],i=r?Yt(r).children:mr.getState().x.keys();for(const s of i)if(n.x[s].name===e)return!0;return!1}function Ift(t){switch(t){case Y.CODE:return"bg-white dark:bg-setta-900";case Y.TERMINAL:return"bg-setta-950 overflow-clip";case Y.GLOBAL_PARAM_SWEEP:return"@container/multipane";case Y.GLOBAL_VARIABLES:return"bg-white dark:bg-black";default:return"bg-setta-50 dark:bg-setta-860"}}function Yde({jsonSourceMissing:t,isActiveSection:e,isGlobalVariables:n,isInOtherProjectConfigs:r}){return t?"outline-red-600 dark:outline-red-400":e&&n?"outline-green-600 dark:outline-turquoise-400":r?e?"outline-purple-600 dark:outline-purple-700":"outline-transparent [&:active:not(:has(button:active,:active.setta-prevent-section-active-css))]:outline-fuchsia-400":e?"outline-blue-600 dark:outline-blue-700":"outline-transparent [&:active:not(:has(button:active,:active.setta-prevent-section-active-css))]:outline-cyan-300"}function Gde(t,e){return n=>{if(n.target.closest(`button, [role="menuitem"], .${lT}`)||Dft())return;if(n.stopPropagation(),Ut.getState().mouseDownDrawArea){Ut.setState({mouseDownDrawArea:!1});return}if(Ut.getState().isSelectingParams){const i=QAe(t,te.getState());!e&&i?yW([t]):e&&!i&&HT([t])}else qe.getState().multiSelectionActive?e?HT([t]):yW([t]):Vd([t]);const r=B5(t);o3([r],!1)}}function Kde(t){return qf(e=>{var n;return((n=e.x[t])==null?void 0:n.length)>0})}function Dft(t=5){const{lastMouseDownLocation:e,lastMouseUpLocation:n}=Ut.getState();if(!e||!n)return!1;const r=n.x-e.x,i=n.y-e.y;return Math.sqrt(r*r+i*i)>t}function Lft({isGroup:t,sectionId:e,droppableRef:n,draggableRef:r,className:i,style:s,trueDragListeners:o,children:a}){const l=qde(e,"withNested");function c(f){l.current=f,n&&n(f),r&&r(f)}const u={ref:c,...o};return t?x.jsx(Qft,{sectionId:e,commonProps:u,refForPosition:l,className:i,style:s,children:a}):x.jsx("div",{className:`${i} focus-visible:outline-none`,style:s,...u,onKeyDown:f=>Oie(f,l,e),tabIndex:"-1",children:a})}const Nft=ke.memo(Lft,ae.isEqual);function Qft({sectionId:t,commonProps:e,refForPosition:n,className:r,style:i,children:s}){const o=Kde(t),a=ir(d=>d.ids.includes(t)),{positionAndSizeLocked:l,isInOtherProjectConfigs:c}=te(d=>({positionAndSizeLocked:d.x[t].positionAndSizeLocked,isInOtherProjectConfigs:d.x[t].isInOtherProjectConfigs}),ae.isEqual),f=Ude()?"pointer-events-none select-none":"",h=Yde({isActiveSection:a,isInOtherProjectConfigs:c});return x.jsxs("div",{className:`group/group-section flex min-w-[250px] flex-col items-stretch px-6 pb-6 pt-2 focus-visible:outline-none ${r}`,...e,onClick:Gde(t,a),onKeyDown:d=>Oie(d,n,t),tabIndex:"-1",style:i,children:[x.jsx("div",{className:`outline outline-4 ${h} transition-radius absolute left-0 right-0 top-0 z-0 h-full w-full ${l?"rounded-sm border-setta-400/90 dark:border-setta-975/35":"rounded-3xl border-setta-50/50 dark:border-setta-700"} border border-solid bg-setta-100/40 outline outline-2 outline-transparent dark:bg-setta-860/50`}),x.jsxs("div",{className:"z-10 flex min-h-10 w-full items-center",children:[x.jsx(Hde,{sectionId:t,sectionTypeName:Y.GROUP,isInOtherProjectConfigs:c}),x.jsx("div",{className:`${f} relative my-auto mr-2 flex min-h-10 w-full items-center overflow-hidden`,children:x.jsx(jft,{sectionId:t})}),x.jsxs("div",{className:"z-10 ml-auto flex items-center",children:[x.jsx(aft,{sectionId:t}),x.jsx(Xde,{sectionId:t})]})]}),!o&&x.jsx("div",{className:"z-10 -mx-4 mt-4 flex flex-row items-center justify-center rounded-xl border-4 border-dashed border-setta-300 px-4 py-3 text-sm text-setta-500/80 dark:border-setta-700 dark:text-setta-500",children:"Drop A Section Here."}),s]})}function jft({sectionId:t}){const e={editing:"absolute nodrag cursor-text box-border px-1 focus-visible:ring-0 focus-visible:outline-none focus-visible:border-blue-500 rounded-lg border border-solid border-transparent w-full tracking-tighter text-setta-500 dark:text-setta-500 cursor-pointer flex-shrink",notEditing:"absolute cursor-pointer box-border px-1 focus-visible:ring-0 focus-visible:outline-none focus-visible:border-blue-500 rounded-lg border border-solid border-transparent w-full truncate tracking-tighter text-setta-500 dark:text-setta-500 flex-shrink"};return x.jsx(Zde,{sectionId:t,titleProps:e})}function Bft({behaviorDropType:t,children:e,isGroup:n}){const r=gut[t];return x.jsxs(x.Fragment,{children:[t&&x.jsx(zft,{text:r,behaviorDropType:t,isGroup:n}),e]})}function zft({text:t,behaviorDropType:e,isGroup:n}){return x.jsx("div",{className:`absolute z-20 grid h-full w-full justify-center ${n?"[place-content:end_center]":"place-content-center"}`,children:x.jsx(Fft,{text:t,behaviorDropType:e,isGroup:n})})}function Fft({text:t,behaviorDropType:e,isGroup:n}){const r=e===sb.INVALID;return x.jsx("div",{className:`grid h-8 min-w-60 select-none place-items-center rounded-full text-sm font-bold uppercase tracking-widest text-white shadow-md backdrop-blur-sm transition-opacity ${r?"[background-color:rgba(220,_38,_38,_0.8)]":"[background-color:rgba(37,_99,_235,_0.8)]"} ${n&&"mb-8"}`,children:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(z$e,{}),t]})})}function Wft({isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,children:o}){const{style:a,behaviorDropType:l}=rft({sectionId:e,isGroup:t});return x.jsx(Bft,{behaviorDropType:l,isGroup:t,children:x.jsx(Uft,{isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,style:a,children:o})})}const Jde=ke.memo(Wft,(t,e)=>t.isGroup===e.isGroup&&t.children===e.children&&ae.isEqual(t.dragListeners,e.dragListeners));function Vft({isGroup:t,sectionId:e,isTopLevel:n,droppableRef:r,draggableRef:i,dragListeners:s,style:o,children:a}){const l=cn(p=>p.activeId===e),{isSorting:c,isMovingFree:u}=zne(),f=u||!n&&c?s:{},h=c||u?"nodrag":"",d=l?{...o,opacity:.5}:o;return x.jsx(Nft,{isGroup:t,sectionId:e,droppableRef:r,draggableRef:i,trueDragListeners:f,className:h,style:d,children:a})}const Uft=ke.memo(Vft,ae.isEqual);function qft({isGroup:t,sectionId:e,children:n}){const r=cn(l=>l.activeId===e),i=Vde({sectionId:e,isTopLevel:!0}),{setNodeRef:s}=Wee({...i,disabled:r}),{listeners:o,setNodeRef:a}=Fee(i);return x.jsx(Jde,{isGroup:t,sectionId:e,isTopLevel:!0,droppableRef:s,draggableRef:a,dragListeners:o,children:n})}function Xft({isGroup:t,sectionId:e,dragListeners:n,children:r,isTopLevel:i}){return i?x.jsx(qft,{isGroup:t,sectionId:e,children:r}):x.jsx(Jde,{isGroup:t,sectionId:e,isTopLevel:i,dragListeners:n,children:r})}function Hft({sectionId:t,items:e,children:n}){const r=ift(t),i=cn(s=>s.isSorting?s.activeId:s.overId);return x.jsx(L8e,{id:t,items:e,strategy:Zft(r,i),disabled:r,children:n})}function PX(){return[{x:0,y:0,scaleX:1,scaleY:1},-1]}function Zft(t,e){if(t.draggable||t.droppable)return PX;if(e){const n=IA(e);if(n)return Pi(n).isHorizontalOrientation?P8e:I8e}return PX}function Yft({sectionId:t}){return F5(t)?x.jsx(Jft,{sectionId:t}):x.jsx(e0e,{sectionId:t,forceApplyTransform:!1})}const Gft=ke.memo(Yft);function Kft({sectionId:t}){const[e,n]=_.useState(!0);return _.useEffect(()=>{n(!1)},[]),x.jsx(e0e,{sectionId:t,forceApplyTransform:e})}const Jft=ke.memo(Kft);function eht({sectionId:t,forceApplyTransform:e}){const n=sht(),r=Vde({sectionId:t,isTopLevel:!1}),{attributes:{role:i,...s},listeners:o,setNodeRef:a,transform:l,transition:c,overIndex:u,items:f}=V8e({...r,animateLayoutChanges:n});return x.jsx(rht,{sectionId:t,attributes:s,listeners:o,setNodeRef:a,transform:l,transition:c,applyTransform:e||u!==null&&u!==-1||f.length===1&&f[0]===t&&F5(t)})}const e0e=ke.memo(eht);function tht({sectionId:t,attributes:e,listeners:n,setNodeRef:r,transform:i,transition:s,applyTransform:o}){const a=cn(f=>f.overId===t),l=iht(o?i:null),u={style:{transform:wf.Translate.toString(l),transition:s,zIndex:a?500:void 0},ref:r,...e};return x.jsx("div",{className:"relative flex w-full outline-none",...u,tabIndex:"-1",children:x.jsx(nht,{sectionId:t,applyTransform:o,listeners:n})})}function nht({sectionId:t,applyTransform:e,listeners:n}){return F5(t)?e?x.jsx(hut,{}):null:x.jsx(e1e,{sectionId:t,dragListeners:n})}const rht=ke.memo(tht,(t,e)=>t.sectionId===e.sectionId&&t.transform===e.transform&&t.transition===e.transition&&ae.isEqual(t.listeners,e.listeners));function iht(t){if(t){const e=qe.getState().transform[2];return{...t,x:t.x/e,y:t.y/e}}return t}function sht(){const t=cn(e=>e.isSorting);return()=>t}function oht({sectionId:t,isGroup:e}){return Kde(t)&&x.jsx("div",{className:"flex flex-col",children:x.jsx(aht,{sectionId:t,isGroup:e})})}function aht({sectionId:t,isGroup:e}){const n=qf(r=>r.x[t]);return x.jsx(Hft,{sectionId:t,items:n,children:x.jsx(lht,{childIds:n,sectionId:t,isGroup:e})})}function lht({childIds:t,sectionId:e,isGroup:n}){const r=()=>{rg(e)},i=te(s=>s.x[e].isHorizontalOrientation);return x.jsxs("div",{className:"flex items-stretch",children:[!n&&x.jsx("div",{className:"mr-2 mt-2 min-h-full w-2 rounded-full bg-white/30 transition-all duration-75 hover:cursor-pointer hover:bg-white/50 dark:bg-setta-700 hover:dark:bg-setta-600",onClick:r}),x.jsx("div",{className:`mt-2 flex ${i?"flex-row":"flex-col "} items-start gap-2`,children:t.map(s=>x.jsx(Gft,{sectionId:s},`Nested-Sec-${s}`))})]})}const ks={any:"any",auto_only:"auto_only",manual_only:"manual_only"};function y4(t){return t==="auto"?t:parseInt(t)}function AX(t,e,n){return n!==ks.manual_only?t:e}function cht({direction:t,ref:e,sizeMode:n,aspectRatio:r}){const i=y4(e.style.width),s=y4(e.style.height),o=AX("auto",i,n.width),a=AX("auto",s,n.height);return t==="bottomRight"?{width:o,height:a}:t==="right"&&n.width?r?{width:o,height:a}:{width:o}:t==="bottom"&&n.height?r?{width:o,height:a}:{height:a}:{}}function uht({direction:t,ref:e,sizeMode:n,aspectRatio:r}){const i=y4(e.style.width),s=y4(e.style.height);return t==="bottomRight"?{width:i,height:s}:t==="right"&&n.width?r?{width:i,height:s}:{width:i}:t==="bottom"&&n.height?r?{width:i,height:s}:{height:s}:{}}function t0e({props:t,sizeMode:e,aspectRatio:n}){const[r,i,s,o]=t;return o.width===0&&o.height===0&&r.detail===2?cht({direction:i,ref:s,sizeMode:e,aspectRatio:n}):uht({direction:i,ref:s,sizeMode:e,aspectRatio:n})}const DA=1e5,fht=1e5,hht=64,n0e=50,r0e=32;function KD({sectionType:t,hideSearch:e,hideParams:n,isMinimized:r}){if(r)return r0e;if(t===Y.SECTION)return e?78:n?58:104;if(t===Y.LIST_ROOT||t===Y.DICT_ROOT)return n0e;if(t===Y.GLOBAL_VARIABLES)return 78;if(t===Y.CODE)return 58.2;if(t===Y.INFO)return 98;if(t===Y.PARAM_SWEEP)return 50;if(t===Y.TERMINAL)return 100;if(t===Y.GLOBAL_PARAM_SWEEP)return 112;if(t===Y.DRAW||t===Y.IMAGE)return 100;if(t===Y.CHART)return 300;if(t===Y.SOCIAL)return 50}function dht({sectionType:t,isMinimized:e}){return e?r0e:t===Y.LIST_ROOT||t===Y.DICT_ROOT?n0e:DA}function JD({sectionType:t,isTwitter:e}){return e?370:t===Y.DRAW?402:t===Y.CHART?300:200}function pht({isTwitter:t}){return t?574:fht}function mht({sectionType:t,hideParams:e,isTwitter:n}){if(t===Y.SECTION){if(e)return{height:ks.auto_only,width:ks.any}}else if(t===Y.TERMINAL||t===Y.CHART)return{height:ks.manual_only,width:ks.manual_only};return n?{height:ks.auto_only,width:ks.any}:{height:ks.any,width:ks.any}}function ght(t){return te(e=>{const n=fft(t,e),r=dn(t,e),i=e.x[t].hideSearch,s=e.x[t].hideParams,o=e.x[t].isMinimized,a=KD({sectionType:r,hideSearch:i,hideParams:s,isMinimized:o}),l=dht({sectionType:r,isMinimized:o}),c=JD({sectionType:r,isTwitter:n}),u=pht({isTwitter:n}),f=mht({sectionType:r,hideParams:s,isTwitter:n});return{minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f}},ae.isEqual)}function dg(){const[t,e]=_.useState(!1),n=_.useRef(null);return _.useEffect(()=>{if(!n.current)return;function r(){n.current&&e(n.current.scrollHeight>n.current.clientHeight)}const i=new ResizeObserver(()=>{r()}),s=new MutationObserver(()=>{r()});return i.observe(n.current),s.observe(n.current,{childList:!0,subtree:!0,characterData:!0,attributes:!0}),r(),()=>{i.disconnect(),s.disconnect()}},[]),{ref:n,isScrollable:t}}async function LA(t,e){const n=dn(t),r=KD({sectionType:n}),i=JD({sectionType:n}),s=te.getState().x[t].size;let o=iut(s.height,s.width,e.height,e.width);o=Ade(o.height,o.width,r,i);const a=24;o.height+=a,te.setState(l=>{ik({sectionId:t,aspectRatio:e.width/e.height,aspectRatioExtraHeight:a,size:o,state:l})})}function vht(t,e){const[n,r]=_.useState(null),i=te(s=>{const{width:o,height:a}=s.x[t].size;return o==="auto"||a==="auto"});return _.useEffect(()=>{const s={width:e.width,height:e.height};ae.isEqual(s,n)||LA(t,s),r(s)},[e.src]),_.useEffect(()=>{n&&LA(t,n)},[i]),n!==null}function Oht({sectionId:t,imgSize:e,isNewImg:n,sectionWidth:r,sectionHeight:i,state:s}){let o={};if(e){if(r==="auto"||i==="auto"||n){const c=Y.DRAW,u=KD({sectionType:c}),f=JD({sectionType:c});o=Ade(e.height,e.width,u-120,f-24),BO(t,{width:o.width+24,height:o.height+120},s)}else o.width=r-24,o.height=i-120;n&&ik({sectionId:t,aspectRatio:e.width/e.height,aspectRatioExtraHeight:120,aspectRatioExtraWidth:24,state:s})}else{const[c,u]=[500,500];o.width=r==="auto"?c:r-24,o.height=i==="auto"?u:i-120,(r==="auto"||i==="auto")&&BO(t,{width:o.width+24,height:o.height+120},s)}return o}function yht(t){const n={width:640,height:360},{width:r,height:i}=te(a=>a.x[t].size,ae.isEqual);function s(){n.height+=22,te.setState(a=>{ik({sectionId:t,aspectRatio:16/9,aspectRatioExtraHeight:22,size:n,state:a})})}return _.useEffect(()=>{(r==="auto"||i==="auto")&&s()},[r,i]),_.useEffect(()=>{LA(t,n)},[]),r==="auto"||i==="auto"?{}:{width:r,height:i-22}}function bht(t){_.useEffect(()=>{te.setState(e=>{ik({sectionId:t,aspectRatio:null,aspectRatioExtraHeight:null,aspectRatioExtraWidth:null,size:{height:"auto"},state:e})})},[])}function ik({sectionId:t,size:e,aspectRatio:n,aspectRatioExtraHeight:r,aspectRatioExtraWidth:i,state:s}){const o=s.x[t];o.aspectRatio=n,o.aspectRatioExtraHeight=r,o.aspectRatioExtraWidth=i,e&&BO(t,e,s)}function eL({children:t,onResizeStart:e,as:n,...r}){const{scale:i,onResizeStart:s}=xht();function o(...a){e&&e(...a),s(...a)}return x.jsx(xle,{...r,scale:i,as:n,onResizeStart:o,children:t})}function xht(){const[t,e]=_.useState(1);function n(){e(qe.getState().transform[2])}return{scale:t,onResizeStart:n}}function wht({sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,children:s,as:o}){const{minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f}=ght(t);return x.jsx(Sht,{sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,minHeight:a,maxHeight:l,minWidth:c,maxWidth:u,sizeMode:f,as:o,children:s})}function Sht({sectionId:t,bgColor:e,isYouTube:n,isActiveSection:r,positionAndSizeLocked:i,minHeight:s,maxHeight:o,minWidth:a,maxWidth:l,sizeMode:c,children:u,as:f}){_.useEffect(()=>{const E={};c.height===ks.auto_only&&(E.height="auto"),c.width===ks.auto_only&&(E.width="auto"),ae.size(E)>0&&te.setState(T=>{wX(t,E,T)})},[c.height,c.width]);const{size:h,aspectRatio:d,aspectRatioExtraHeight:p,aspectRatioExtraWidth:g}=kht(t);function m(){te.setState(E=>{RX(t,"start",E)})}function v(...E){const T=t0e({props:E,sizeMode:c,aspectRatio:d});te.setState(C=>{wX(t,T,C),RX(t,"end",C)}),hn(!0)}const y=s!==o&&c.height!==ks.auto_only,b=c.width!==ks.auto_only,S=Nt(E=>E.gui.snapGrid),k=Ot.snapToGrid.hook()[0];return x.jsx(_ht,{sectionId:t,as:f,bgColor:e,isYouTube:n,isActiveSection:r,size:h,minHeight:s,maxHeight:o,minWidth:a,maxWidth:l,heightResizable:y,widthResizable:b,positionAndSizeLocked:i,onResizeStart:m,onResizeStop:v,aspectRatio:d,aspectRatioExtraHeight:p,aspectRatioExtraWidth:g,snapGrid:S,snapToGrid:k,children:u})}function _ht({sectionId:t,as:e,bgColor:n,isYouTube:r,isActiveSection:i,size:s,minHeight:o,maxHeight:a,minWidth:l,maxWidth:c,heightResizable:u,widthResizable:f,positionAndSizeLocked:h,onResizeStart:d,onResizeStop:p,aspectRatio:g,aspectRatioExtraHeight:m,aspectRatioExtraWidth:v,snapGrid:y,snapToGrid:b,children:S}){const k=Ude(),E=k||h?!1:{top:!1,left:!1,bottom:u,right:f,topRight:!1,bottomRight:u&&f,topLeft:!1,bottomLeft:!1},T=`${k?"pointer-events-none select-none":""} ${n} section-grid-cols section-grid-rows section-grid-areas grid h-full transition-radius ${h?"rounded-sm":"rounded-xl shadow-md"} before:content-none before:block before:absolute before:top-0 before:right-0 before:bottom-0 before:left-0 before:border before:border-white dark:before:border-setta-700 ${r?"overflow-clip":""} ${i?"z-[150]":"z-10"}`;return x.jsx(eL,{id:`${t}-CustomResizable`,as:e,size:s,minHeight:o,maxHeight:a,minWidth:l,maxWidth:c,onResizeStart:d,onResizeStop:p,lockAspectRatio:g,lockAspectRatioExtraHeight:m,lockAspectRatioExtraWidth:v,handleWrapperClass:"absolute pointer-events-none [&>*]:pointer-events-auto h-full bottom-0 w-full nodrag [&>div]:z-20",enable:E,className:T,handleStyles:{right:{right:"-8px"},bottom:{bottom:"-8px"}},handleClasses:{right:`${lT} ${Cl} ${Jp}`,bottom:`${lT} ${Cl} ${Jp}`},grid:b?y:null,children:S})}function kht(t){return te(e=>{const n=e.x[t];return n.isMinimized?{size:n.size,aspectRatio:!1,aspectRatioExtraHeight:0,aspectRatioExtraWidth:0}:{size:n.size,aspectRatio:n.aspectRatio??!1,aspectRatioExtraHeight:n.aspectRatioExtraHeight??0,aspectRatioExtraWidth:n.aspectRatioExtraWidth??0}},ae.isEqual)}function RX(t,e,n){n.x[t].resizeEvent=e}const i0e="Popover",[s0e,_Et]=Oo(i0e,[Z5]),sk=Z5(),[Cht,Jd]=s0e(i0e),Eht=t=>{const{__scopePopover:e,children:n,open:r,defaultOpen:i,onOpenChange:s,modal:o=!1}=t,a=sk(e),l=_.useRef(null),[c,u]=_.useState(!1),[f=!1,h]=Nl({prop:r,defaultProp:i,onChange:s});return _.createElement(Ere,a,_.createElement(Cht,{scope:e,contentId:ff(),triggerRef:l,open:f,onOpenChange:h,onOpenToggle:_.useCallback(()=>h(d=>!d),[h]),hasCustomAnchor:c,onCustomAnchorAdd:_.useCallback(()=>u(!0),[]),onCustomAnchorRemove:_.useCallback(()=>u(!1),[]),modal:o},n))},Tht="PopoverTrigger",Pht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Jd(Tht,n),s=sk(n),o=In(e,i.triggerRef),a=_.createElement(gn.button,Ee({type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":l0e(i.open)},r,{ref:o,onClick:gt(t.onClick,i.onOpenToggle)}));return i.hasCustomAnchor?a:_.createElement(Tre,Ee({asChild:!0},s),a)}),o0e="PopoverPortal",[Aht,Rht]=s0e(o0e,{forceMount:void 0}),$ht=t=>{const{__scopePopover:e,forceMount:n,children:r,container:i}=t,s=Jd(o0e,e);return _.createElement(Aht,{scope:e,forceMount:n},_.createElement(zd,{present:n||s.open},_.createElement(Are,{asChild:!0,container:i},r)))},zO="PopoverContent",Mht=_.forwardRef((t,e)=>{const n=Rht(zO,t.__scopePopover),{forceMount:r=n.forceMount,...i}=t,s=Jd(zO,t.__scopePopover);return _.createElement(zd,{present:r||s.open},s.modal?_.createElement(Iht,Ee({},i,{ref:e})):_.createElement(Dht,Ee({},i,{ref:e})))}),Iht=_.forwardRef((t,e)=>{const n=Jd(zO,t.__scopePopover),r=_.useRef(null),i=In(e,r),s=_.useRef(!1);return _.useEffect(()=>{const o=r.current;if(o)return G5(o)},[]),_.createElement(dM,{as:lm,allowPinchZoom:!0},_.createElement(a0e,Ee({},t,{ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:gt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),s.current||(a=n.triggerRef.current)===null||a===void 0||a.focus()}),onPointerDownOutside:gt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0,c=a.button===2||l;s.current=c},{checkForDefaultPrevented:!1}),onFocusOutside:gt(t.onFocusOutside,o=>o.preventDefault(),{checkForDefaultPrevented:!1})})))}),Dht=_.forwardRef((t,e)=>{const n=Jd(zO,t.__scopePopover),r=_.useRef(!1);return _.createElement(a0e,Ee({},t,{ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s;if((s=t.onCloseAutoFocus)===null||s===void 0||s.call(t,i),!i.defaultPrevented){var o;r.current||(o=n.triggerRef.current)===null||o===void 0||o.focus(),i.preventDefault()}r.current=!1},onInteractOutside:i=>{var s,o;(s=t.onInteractOutside)===null||s===void 0||s.call(t,i),i.defaultPrevented||(r.current=!0);const a=i.target;((o=n.triggerRef.current)===null||o===void 0?void 0:o.contains(a))&&i.preventDefault()}}))}),a0e=_.forwardRef((t,e)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:o,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onInteractOutside:u,...f}=t,h=Jd(zO,n),d=sk(n);return hre(),_.createElement(dre,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:s},_.createElement(ure,{asChild:!0,disableOutsidePointerEvents:o,onInteractOutside:u,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:c,onDismiss:()=>h.onOpenChange(!1)},_.createElement(Pre,Ee({"data-state":l0e(h.open),role:"dialog",id:h.contentId},d,f,{ref:e,style:{...f.style,["--radix-popover-content-transform-origin"]:"var(--radix-popper-transform-origin)"}}))))}),Lht="PopoverClose",Nht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=Jd(Lht,n);return _.createElement(gn.button,Ee({type:"button"},r,{ref:e,onClick:gt(t.onClick,()=>i.onOpenChange(!1))}))}),Qht=_.forwardRef((t,e)=>{const{__scopePopover:n,...r}=t,i=sk(n);return _.createElement(GMe,Ee({},i,r,{ref:e}))});function l0e(t){return t?"open":"closed"}const jht=Eht,Bht=Pht,zht=$ht,Fht=Mht,Wht=Nht,Vht=Qht;function $1({trigger:t,contentClasses:e,children:n,open:r,close:i=!1,closeClasses:s,onOpenChange:o,arrowClasses:a}){return x.jsxs(jht,{open:r,onOpenChange:o,children:[x.jsx(Bht,{asChild:!0,children:t}),x.jsx(zht,{children:x.jsxs(Fht,{className:e,children:[i&&x.jsx(Wht,{className:s,children:i}),x.jsx(Vht,{className:a||"[fill:rgb(229,_231,_235)] dark:[fill:rgb(51,_65,_85)]"}),n]})})]})}function c0e({sectionId:t,isRoot:e,popover:n=!1}){const r=C5(t),i=c=>{$Ne(e,t,c)},s=c=>{qct(e,t,c)},o=c=>{c&&!isNaN(c)?l(parseInt(c)):l("")},[a,l]=_.useState(1);return x.jsxs("div",{className:`section-key-value section-row-main -mx-2 flex items-center gap-1 rounded-lg bg-setta-100 pl-2 pr-1 dark:bg-setta-950 ${n?"border border-solid border-white py-1 shadow-lg dark:border-setta-800":""}`,children:[e?x.jsxs(x.Fragment,{children:[x.jsx(hHe,{className:"text-setta-300 dark:text-setta-600"}),x.jsx("p",{className:"text-[10px] font-bold text-setta-500",children:"Children: "})]}):x.jsx("p",{className:"text-[10px] text-setta-500",children:"Siblings"}),x.jsx("input",{className:"nodrag max-w-[3ch] cursor-auto rounded-md bg-white px-2 text-xs focus-visible:ring-2 dark:bg-setta-800 dark:text-setta-300",value:a,onChange:c=>o(c.target.value),disabled:r}),x.jsx("button",{className:"nodrag gg-math-minus rounded-full focus-visible:ring-2 dark:text-setta-300",onClick:()=>s(a),role:"button",disabled:r}),x.jsx("button",{className:"nodrag gg-math-plus rounded-full focus-visible:ring-2 dark:text-setta-300",onClick:()=>i(a),role:"button",disabled:r})]})}function Uht({onClick:t,...e}){return x.jsx(Fa,{...e,icon:x.jsx("i",{className:"gg-close"}),color:"text-setta-600 hover:text-white",bg:"bg-transparent hover:bg-red-500",size:"min-w-4 h-4",padding:"p-0",onClick:t})}function qht({sectionId:t,twClasses:e,...n}){const r=te(s=>s.x[t].isMinimized);function i(){te.setState(s=>{s.x[t].isMinimized=!r})}return x.jsx(Fa,{...n,icon:r?x.jsx("i",{className:"gg-maximize !scale-[.4]"}):x.jsx("i",{className:"gg-math-minus"}),color:"text-setta-600 hover:text-white",bg:"bg-transparent hover:bg-blue-500 justify-content-center mr-1",size:"w-4 h-4",padding:"p-0",twClasses:e,onClick:i})}function Xht({sectionId:t}){function e(){const{runInMemory:n}=Pi(t);n?RM([t]):$M([t])}return x.jsx(Fa,{icon:x.jsx(lre,{}),color:"text-setta-600 hover:text-green-500 active:!text-blue-700",bg:"bg-transparent",size:"w-4 h-4",padding:"p-0 mr-1",onClick:e,...Rr({title:"Run this code block"})})}function Hht({sectionId:t}){const e=te(r=>r.x[t].runInMemory);function n(){te.setState(r=>{r.x[t].runInMemory=!e})}return x.jsx(Fa,{icon:x.jsx(tHe,{}),color:`${e?"text-blue-500 hover:!text-cyan-200":"text-setta-600 hover:!text-blue-500"} active:!text-blue-500`,bg:`${e?"hover:bg-blue-500":"bg-transparent"}`,size:"w-4 h-4",padding:"p-0 mr-1",onClick:n,...Rr({title:"Toggle In-Memory Code"})})}function Zht({sectionId:t,isActiveSection:e,sectionTypeName:n,isInOtherProjectConfigs:r,isRoot:i}){const s=()=>{te.setState(a=>{_m([t],a)}),hn(!0)},o=NXe(t)&&!i;return x.jsxs("header",{className:"section-title mx-2 flex flex-row items-center",children:[x.jsx(Hde,{sectionId:t,sectionTypeName:n,isInOtherProjectConfigs:r}),n!==Y.INFO&&x.jsx(x.Fragment,{children:x.jsx(Yht,{sectionId:t,isActiveSection:e,isInOtherProjectConfigs:r,sectionTypeName:n})}),x.jsxs("div",{className:"z-10 ml-auto flex items-center",children:[o&&x.jsx($1,{arrowClasses:"fill-white dark:fill-setta-800",contentClasses:"z-20",trigger:x.jsx(Fa,{twClasses:"[&_*]:hover:text-setta-500 [&_*]:dark:hover:text-setta-400",bg:"bg-transparent",children:x.jsx(fHe,{className:"text-setta-300 dark:text-setta-700"})}),children:x.jsx(c0e,{sectionId:t,isRoot:i,popover:!0})}),n===Y.CODE&&x.jsxs(x.Fragment,{children:[x.jsx(Xht,{sectionId:t})," ",x.jsx(Hht,{sectionId:t})," "]}),x.jsx(Xde,{sectionId:t}),!i&&x.jsx(qht,{sectionId:t}),x.jsx(Uht,{onClick:s})]})]})}function Yht({sectionId:t,isActiveSection:e,isInOtherProjectConfigs:n,sectionTypeName:r}){return x.jsx(Zde,{sectionId:t,titleProps:Kht({isActiveSection:e,isInOtherProjectConfigs:n,sectionTypeName:r})})}const Ght=ke.memo(Zht);function Kht({isActiveSection:t,isInOtherProjectConfigs:e,sectionTypeName:n}){const r="cursor-text nodrag px-1 py-0 leading-5 -ml-1 bg-setta-100 focus-visible:ring-0 focus-visible:outline-none rounded-md box-border border border-solid border-transparent focus-visible:border-blue-500 dark:bg-setta-800 w-3/5 dark:text-white font-bold text-[.7rem] tracking-tight",i=n===Y.GLOBAL_VARIABLES,s=Jht({isActiveSection:t,isInOtherProjectConfigs:e,isGlobalVariables:i,sectionTypeName:n});return i?{fixed:s}:{editing:r,notEditing:s,fixed:"select-none italic focus-visible:ring-0 focus-visible:outline-none box-border border border-solid border-transparent focus-visible:border-blue-500 tracking-tighter text-xs text-setta-400 max-w-full truncate pr-0.5"}}function Jht({isActiveSection:t,isInOtherProjectConfigs:e,isGlobalVariables:n,sectionTypeName:r}){let i="",s="font-bold";return t?e?i="text-purple-800 dark:text-purple-200":n?i="text-green-800 dark:text-green-200":r===Y.TERMINAL?i="text-blue-400":i="text-blue-600 dark:text-blue-400":r===Y.TERMINAL?i="text-setta-300":i="text-setta-700 dark:text-setta-300",n&&(s="uppercase font-bold"),`px-1 py-0 -ml-1 w-3/5 focus-visible:ring-0 focus-visible:outline-none box-border rounded-md border border-solid border-transparent focus-visible:border-blue-500 leading-5 font-bold tracking-tight cursor-pointer max-w-full text-[.7rem] truncate ${i} ${s}`}/*!
357
357
  * @kurkle/color v0.3.4
358
358
  * https://github.com/kurkle/color#readme
359
359
  * (c) 2024 Jukka Kurkela