diff --git a/mitosheet/mitosheet/mito_frontend.js b/mitosheet/mitosheet/mito_frontend.js index 64023e8d8..62142c50f 100644 --- a/mitosheet/mitosheet/mito_frontend.js +++ b/mitosheet/mitosheet/mito_frontend.js @@ -1,12 +1,12 @@ -"use strict";(()=>{var dC=Object.create;var gc=Object.defineProperty,uC=Object.defineProperties,mC=Object.getOwnPropertyDescriptor,cC=Object.getOwnPropertyDescriptors,fC=Object.getOwnPropertyNames,yh=Object.getOwnPropertySymbols,pC=Object.getPrototypeOf,Ch=Object.prototype.hasOwnProperty,hC=Object.prototype.propertyIsEnumerable;var Sh=(e,t,n)=>t in e?gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||={})Ch.call(t,n)&&Sh(e,n,t[n]);if(yh)for(var n of yh(t))hC.call(t,n)&&Sh(e,n,t[n]);return e},f=(e,t)=>uC(e,cC(t));var Ii=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var gC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fC(t))!Ch.call(e,o)&&o!==n&&gc(e,o,{get:()=>t[o],enumerable:!(r=mC(t,o))||r.enumerable});return e};var T=(e,t,n)=>(n=e!=null?dC(pC(e)):{},gC(t||!e||!e.__esModule?gc(n,"default",{value:e,enumerable:!0}):n,e));var yc=Ii((WT,xh)=>{"use strict";var Ih=Object.getOwnPropertySymbols,yC=Object.prototype.hasOwnProperty,SC=Object.prototype.propertyIsEnumerable;function CC(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function IC(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}xh.exports=IC()?Object.assign:function(e,t){for(var n,r=CC(e),o,i=1;i{"use strict";var Cc=yc(),ia=60103,_h=60106;_e.Fragment=60107;_e.StrictMode=60108;_e.Profiler=60114;var Dh=60109,vh=60110,Ph=60112;_e.Suspense=60113;var bh=60115,Eh=60116;typeof Symbol=="function"&&Symbol.for&&(jn=Symbol.for,ia=jn("react.element"),_h=jn("react.portal"),_e.Fragment=jn("react.fragment"),_e.StrictMode=jn("react.strict_mode"),_e.Profiler=jn("react.profiler"),Dh=jn("react.provider"),vh=jn("react.context"),Ph=jn("react.forward_ref"),_e.Suspense=jn("react.suspense"),bh=jn("react.memo"),Eh=jn("react.lazy"));var jn,wh=typeof Symbol=="function"&&Symbol.iterator;function xC(e){return e===null||typeof e!="object"?null:(e=wh&&e[wh]||e["@@iterator"],typeof e=="function"?e:null)}function _s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n{"use strict";Bh.exports=Uh()});var Wh=Ii(Ne=>{"use strict";var la,Ps,Pd,Ac;typeof performance=="object"&&typeof performance.now=="function"?(Hh=performance,Ne.unstable_now=function(){return Hh.now()}):(_c=Date,Gh=_c.now(),Ne.unstable_now=function(){return _c.now()-Gh});var Hh,_c,Gh;typeof window>"u"||typeof MessageChannel!="function"?(sa=null,Dc=null,vc=function(){if(sa!==null)try{var e=Ne.unstable_now();sa(!0,e),sa=null}catch(t){throw setTimeout(vc,0),t}},la=function(e){sa!==null?setTimeout(la,0,e):(sa=e,setTimeout(vc,0))},Ps=function(e,t){Dc=setTimeout(e,t)},Pd=function(){clearTimeout(Dc)},Ne.unstable_shouldYield=function(){return!1},Ac=Ne.unstable_forceFrameRate=function(){}):(Vh=window.setTimeout,jh=window.clearTimeout,typeof console<"u"&&(Rh=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof Rh!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),Ds=!1,vs=null,_d=-1,Pc=5,bc=0,Ne.unstable_shouldYield=function(){return Ne.unstable_now()>=bc},Ac=function(){},Ne.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(o!==void 0&&0vd(a,n))l!==void 0&&0>vd(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else if(l!==void 0&&0>vd(l,n))e[r]=l,e[s]=n,r=s;else break e}}return t}return null}function vd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var xr=[],Do=[],vC=1,Rn=null,qt=3,Ed=!1,xi=!1,bs=!1;function Nc(e){for(var t=ar(Do);t!==null;){if(t.callback===null)bd(Do);else if(t.startTime<=e)bd(Do),t.sortIndex=t.expirationTime,kc(xr,t);else break;t=ar(Do)}}function Mc(e){if(bs=!1,Nc(e),!xi)if(ar(xr)!==null)xi=!0,la(Oc);else{var t=ar(Do);t!==null&&Ps(Mc,t.startTime-e)}}function Oc(e,t){xi=!1,bs&&(bs=!1,Pd()),Ed=!0;var n=qt;try{for(Nc(t),Rn=ar(xr);Rn!==null&&(!(Rn.expirationTime>t)||e&&!Ne.unstable_shouldYield());){var r=Rn.callback;if(typeof r=="function"){Rn.callback=null,qt=Rn.priorityLevel;var o=r(Rn.expirationTime<=t);t=Ne.unstable_now(),typeof o=="function"?Rn.callback=o:Rn===ar(xr)&&bd(xr),Nc(t)}else bd(xr);Rn=ar(xr)}if(Rn!==null)var i=!0;else{var a=ar(Do);a!==null&&Ps(Mc,a.startTime-t),i=!1}return i}finally{Rn=null,qt=n,Ed=!1}}var PC=Ac;Ne.unstable_IdlePriority=5;Ne.unstable_ImmediatePriority=1;Ne.unstable_LowPriority=4;Ne.unstable_NormalPriority=3;Ne.unstable_Profiling=null;Ne.unstable_UserBlockingPriority=2;Ne.unstable_cancelCallback=function(e){e.callback=null};Ne.unstable_continueExecution=function(){xi||Ed||(xi=!0,la(Oc))};Ne.unstable_getCurrentPriorityLevel=function(){return qt};Ne.unstable_getFirstCallbackNode=function(){return ar(xr)};Ne.unstable_next=function(e){switch(qt){case 1:case 2:case 3:var t=3;break;default:t=qt}var n=qt;qt=t;try{return e()}finally{qt=n}};Ne.unstable_pauseExecution=function(){};Ne.unstable_requestPaint=PC;Ne.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=qt;qt=e;try{return t()}finally{qt=n}};Ne.unstable_scheduleCallback=function(e,t,n){var r=Ne.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0r?(e.sortIndex=n,kc(Do,e),ar(xr)===null&&e===ar(Do)&&(bs?Pd():bs=!0,Ps(Mc,n-r))):(e.sortIndex=o,kc(xr,e),xi||Ed||(xi=!0,la(Oc))),e};Ne.unstable_wrapCallback=function(e){var t=qt;return function(){var n=qt;qt=t;try{return e.apply(this,arguments)}finally{qt=n}}}});var Jh=Ii((KT,Xh)=>{"use strict";Xh.exports=Wh()});var N2=Ii($n=>{"use strict";var wu=_(),qe=yc(),Ot=Jh();function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zh=Object.prototype.hasOwnProperty,Kh={},$h={};function EC(e){return zh.call($h,e)?!0:zh.call(Kh,e)?!1:bC.test(e)?$h[e]=!0:(Kh[e]=!0,!1)}function AC(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function kC(e,t,n,r){if(t===null||typeof t>"u"||AC(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function hn(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vt[e]=new hn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vt[t]=new hn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vt[e]=new hn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vt[e]=new hn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Vt[e]=new hn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vt[e]=new hn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vt[e]=new hn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vt[e]=new hn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vt[e]=new hn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wf=/[\-:]([a-z])/g;function Xf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vt[e]=new hn(e,1,!1,e.toLowerCase(),null,!1,!1)});Vt.xlinkHref=new hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vt[e]=new hn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jf(e,t,n,r){var o=Vt.hasOwnProperty(t)?Vt[t]:null,i=o!==null?o.type===0:r?!1:!(!(2{var dC=Object.create;var gc=Object.defineProperty,uC=Object.defineProperties,mC=Object.getOwnPropertyDescriptor,cC=Object.getOwnPropertyDescriptors,fC=Object.getOwnPropertyNames,yh=Object.getOwnPropertySymbols,pC=Object.getPrototypeOf,Ch=Object.prototype.hasOwnProperty,hC=Object.prototype.propertyIsEnumerable;var Sh=(e,t,n)=>t in e?gc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,m=(e,t)=>{for(var n in t||={})Ch.call(t,n)&&Sh(e,n,t[n]);if(yh)for(var n of yh(t))hC.call(t,n)&&Sh(e,n,t[n]);return e},f=(e,t)=>uC(e,cC(t));var Ii=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var gC=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of fC(t))!Ch.call(e,o)&&o!==n&&gc(e,o,{get:()=>t[o],enumerable:!(r=mC(t,o))||r.enumerable});return e};var T=(e,t,n)=>(n=e!=null?dC(pC(e)):{},gC(t||!e||!e.__esModule?gc(n,"default",{value:e,enumerable:!0}):n,e));var yc=Ii((XT,xh)=>{"use strict";var Ih=Object.getOwnPropertySymbols,yC=Object.prototype.hasOwnProperty,SC=Object.prototype.propertyIsEnumerable;function CC(e){if(e==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}function IC(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de",Object.getOwnPropertyNames(e)[0]==="5")return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(i){return t[i]});if(r.join("")!=="0123456789")return!1;var o={};return"abcdefghijklmnopqrst".split("").forEach(function(i){o[i]=i}),Object.keys(Object.assign({},o)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}xh.exports=IC()?Object.assign:function(e,t){for(var n,r=CC(e),o,i=1;i{"use strict";var Cc=yc(),ia=60103,_h=60106;_e.Fragment=60107;_e.StrictMode=60108;_e.Profiler=60114;var Dh=60109,vh=60110,Ph=60112;_e.Suspense=60113;var bh=60115,Eh=60116;typeof Symbol=="function"&&Symbol.for&&(jn=Symbol.for,ia=jn("react.element"),_h=jn("react.portal"),_e.Fragment=jn("react.fragment"),_e.StrictMode=jn("react.strict_mode"),_e.Profiler=jn("react.profiler"),Dh=jn("react.provider"),vh=jn("react.context"),Ph=jn("react.forward_ref"),_e.Suspense=jn("react.suspense"),bh=jn("react.memo"),Eh=jn("react.lazy"));var jn,wh=typeof Symbol=="function"&&Symbol.iterator;function xC(e){return e===null||typeof e!="object"?null:(e=wh&&e[wh]||e["@@iterator"],typeof e=="function"?e:null)}function _s(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n{"use strict";Bh.exports=Uh()});var Wh=Ii(Ne=>{"use strict";var la,Ps,Pd,Ac;typeof performance=="object"&&typeof performance.now=="function"?(Hh=performance,Ne.unstable_now=function(){return Hh.now()}):(_c=Date,Gh=_c.now(),Ne.unstable_now=function(){return _c.now()-Gh});var Hh,_c,Gh;typeof window>"u"||typeof MessageChannel!="function"?(sa=null,Dc=null,vc=function(){if(sa!==null)try{var e=Ne.unstable_now();sa(!0,e),sa=null}catch(t){throw setTimeout(vc,0),t}},la=function(e){sa!==null?setTimeout(la,0,e):(sa=e,setTimeout(vc,0))},Ps=function(e,t){Dc=setTimeout(e,t)},Pd=function(){clearTimeout(Dc)},Ne.unstable_shouldYield=function(){return!1},Ac=Ne.unstable_forceFrameRate=function(){}):(Vh=window.setTimeout,jh=window.clearTimeout,typeof console<"u"&&(Rh=window.cancelAnimationFrame,typeof window.requestAnimationFrame!="function"&&console.error("This browser doesn't support requestAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),typeof Rh!="function"&&console.error("This browser doesn't support cancelAnimationFrame. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills")),Ds=!1,vs=null,_d=-1,Pc=5,bc=0,Ne.unstable_shouldYield=function(){return Ne.unstable_now()>=bc},Ac=function(){},Ne.unstable_forceFrameRate=function(e){0>e||125>>1,o=e[r];if(o!==void 0&&0vd(a,n))l!==void 0&&0>vd(l,a)?(e[r]=l,e[s]=n,r=s):(e[r]=a,e[i]=n,r=i);else if(l!==void 0&&0>vd(l,n))e[r]=l,e[s]=n,r=s;else break e}}return t}return null}function vd(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}var xr=[],Do=[],vC=1,Rn=null,qt=3,Ed=!1,xi=!1,bs=!1;function Nc(e){for(var t=ar(Do);t!==null;){if(t.callback===null)bd(Do);else if(t.startTime<=e)bd(Do),t.sortIndex=t.expirationTime,kc(xr,t);else break;t=ar(Do)}}function Mc(e){if(bs=!1,Nc(e),!xi)if(ar(xr)!==null)xi=!0,la(Oc);else{var t=ar(Do);t!==null&&Ps(Mc,t.startTime-e)}}function Oc(e,t){xi=!1,bs&&(bs=!1,Pd()),Ed=!0;var n=qt;try{for(Nc(t),Rn=ar(xr);Rn!==null&&(!(Rn.expirationTime>t)||e&&!Ne.unstable_shouldYield());){var r=Rn.callback;if(typeof r=="function"){Rn.callback=null,qt=Rn.priorityLevel;var o=r(Rn.expirationTime<=t);t=Ne.unstable_now(),typeof o=="function"?Rn.callback=o:Rn===ar(xr)&&bd(xr),Nc(t)}else bd(xr);Rn=ar(xr)}if(Rn!==null)var i=!0;else{var a=ar(Do);a!==null&&Ps(Mc,a.startTime-t),i=!1}return i}finally{Rn=null,qt=n,Ed=!1}}var PC=Ac;Ne.unstable_IdlePriority=5;Ne.unstable_ImmediatePriority=1;Ne.unstable_LowPriority=4;Ne.unstable_NormalPriority=3;Ne.unstable_Profiling=null;Ne.unstable_UserBlockingPriority=2;Ne.unstable_cancelCallback=function(e){e.callback=null};Ne.unstable_continueExecution=function(){xi||Ed||(xi=!0,la(Oc))};Ne.unstable_getCurrentPriorityLevel=function(){return qt};Ne.unstable_getFirstCallbackNode=function(){return ar(xr)};Ne.unstable_next=function(e){switch(qt){case 1:case 2:case 3:var t=3;break;default:t=qt}var n=qt;qt=t;try{return e()}finally{qt=n}};Ne.unstable_pauseExecution=function(){};Ne.unstable_requestPaint=PC;Ne.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=qt;qt=e;try{return t()}finally{qt=n}};Ne.unstable_scheduleCallback=function(e,t,n){var r=Ne.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0r?(e.sortIndex=n,kc(Do,e),ar(xr)===null&&e===ar(Do)&&(bs?Pd():bs=!0,Ps(Mc,n-r))):(e.sortIndex=o,kc(xr,e),xi||Ed||(xi=!0,la(Oc))),e};Ne.unstable_wrapCallback=function(e){var t=qt;return function(){var n=qt;qt=t;try{return e.apply(this,arguments)}finally{qt=n}}}});var Jh=Ii(($T,Xh)=>{"use strict";Xh.exports=Wh()});var N2=Ii($n=>{"use strict";var wu=_(),Qe=yc(),Ot=Jh();function X(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),bC=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,zh=Object.prototype.hasOwnProperty,Kh={},$h={};function EC(e){return zh.call($h,e)?!0:zh.call(Kh,e)?!1:bC.test(e)?$h[e]=!0:(Kh[e]=!0,!1)}function AC(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function kC(e,t,n,r){if(t===null||typeof t>"u"||AC(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function hn(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var Vt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Vt[e]=new hn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Vt[t]=new hn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Vt[e]=new hn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Vt[e]=new hn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Vt[e]=new hn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Vt[e]=new hn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Vt[e]=new hn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Vt[e]=new hn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Vt[e]=new hn(e,5,!1,e.toLowerCase(),null,!1,!1)});var Wf=/[\-:]([a-z])/g;function Xf(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Wf,Xf);Vt[t]=new hn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Vt[e]=new hn(e,1,!1,e.toLowerCase(),null,!1,!1)});Vt.xlinkHref=new hn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Vt[e]=new hn(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jf(e,t,n,r){var o=Vt.hasOwnProperty(t)?Vt[t]:null,i=o!==null?o.type===0:r?!1:!(!(2s||o[a]!==i[s])return` -`+o[a].replace(" at new "," at ");while(1<=a&&0<=s);break}}}finally{Lc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?js(e):""}function NC(e){switch(e.tag){case 5:return js(e.type);case 16:return js("Lazy");case 13:return js("Suspense");case 19:return js("SuspenseList");case 0:case 2:case 15:return e=Ad(e.type,!1),e;case 11:return e=Ad(e.type.render,!1),e;case 22:return e=Ad(e.type._render,!1),e;case 1:return e=Ad(e.type,!0),e;default:return""}}function Ca(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Po:return"Fragment";case Ti:return"Portal";case Js:return"Profiler";case zf:return"StrictMode";case zs:return"Suspense";case Qd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $f:return(e.displayName||"Context")+".Consumer";case Kf:return(e._context.displayName||"Context")+".Provider";case Tu:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case _u:return Ca(e.type);case Yf:return Ca(e._render);case Zf:t=e._payload,e=e._init;try{return Ca(e(t))}catch{}}return null}function Ho(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function s0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function MC(e){var t=s0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kd(e){e._valueTracker||(e._valueTracker=MC(e))}function l0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=s0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function eu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function of(e,t){var n=t.checked;return qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ho(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function d0(e,t){t=t.checked,t!=null&&Jf(e,"checked",t,!1)}function af(e,t){d0(e,t);var n=Ho(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?sf(e,t.type,n):t.hasOwnProperty("defaultValue")&&sf(e,t.type,Ho(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function sf(e,t,n){(t!=="number"||eu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function OC(e){var t="";return wu.Children.forEach(e,function(n){n!=null&&(t+=n)}),t}function lf(e,t){return e=qe({children:void 0},t),(t=OC(t.children))&&(e.children=t),e}function Ia(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o=n.length))throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ho(n)}}function u0(e,t){var n=Ho(t.value),r=Ho(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function eg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var uf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function m0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?m0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Nd,c0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!==uf.svg||"innerHTML"in e)e.innerHTML=t;else{for(Nd=Nd||document.createElement("div"),Nd.innerHTML=""+t.valueOf().toString()+"",t=Nd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function il(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ks={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},FC=["Webkit","ms","Moz","O"];Object.keys(Ks).forEach(function(e){FC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ks[t]=Ks[e]})});function f0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ks.hasOwnProperty(e)&&Ks[e]?(""+t).trim():t+"px"}function p0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=f0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var LC=qe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cf(e,t){if(t){if(LC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function ff(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function ep(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pf=null,xa=null,wa=null;function tg(e){if(e=Cl(e)){if(typeof pf!="function")throw Error(X(280));var t=e.stateNode;t&&(t=Au(t),pf(e.stateNode,e.type,t))}}function h0(e){xa?wa?wa.push(e):wa=[e]:xa=e}function g0(){if(xa){var e=xa,t=wa;if(wa=xa=null,tg(e),t)for(e=0;er?0:1<n;n++)t.push(e);return t}function vu(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,e=e.eventTimes,t=31-Go(t),e[t]=n}var Go=Math.clz32?Math.clz32:qC,ZC=Math.log,YC=Math.LN2;function qC(e){return e===0?32:31-(ZC(e)/YC|0)|0}var QC=Ot.unstable_UserBlockingPriority,eI=Ot.unstable_runWithPriority,Wd=!0;function tI(e,t,n,r){_i||np();var o=sp,i=_i;_i=!0;try{y0(o,e,t,n,r)}finally{(_i=i)||rp()}}function nI(e,t,n,r){eI(QC,sp.bind(null,e,t,n,r))}function sp(e,t,n,r){if(Wd){var o;if((o=(t&4)===0)&&0=Zs),mg=String.fromCharCode(32),cg=!1;function O0(e,t){switch(e){case"keyup":return DI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pa=!1;function PI(e,t){switch(e){case"compositionend":return F0(t);case"keypress":return t.which!==32?null:(cg=!0,mg);case"textInput":return e=t.data,e===mg&&cg?null:e;default:return null}}function bI(e,t){if(pa)return e==="compositionend"||!cp&&O0(e,t)?(e=N0(),Xd=dp=bo=null,pa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hg(n)}}function H0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(){for(var e=window,t=eu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=eu(e.document)}return t}function Cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var BI=ro&&"documentMode"in document&&11>=document.documentMode,ha=null,If=null,qs=null,xf=!1;function Sg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xf||ha==null||ha!==eu(r)||(r=ha,"selectionStart"in r&&Cf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qs&&ml(qs,r)||(qs=r,r=ou(If,"onSelect"),0ya||(e.current=Tf[ya],Tf[ya]=null,ya--)}function ot(e,t){ya++,Tf[ya]=e.current,e.current=t}var Vo={},nn=Wo(Vo),xn=Wo(!1),Ei=Vo;function Aa(e,t){var n=e.type.contextTypes;if(!n)return Vo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function wn(e){return e=e.childContextTypes,e!=null}function su(){ze(xn),ze(nn)}function vg(e,t,n){if(nn.current!==Vo)throw Error(X(168));ot(nn,t),ot(xn,n)}function z0(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in e))throw Error(X(108,Ca(t)||"Unknown",o));return qe({},n,r)}function zd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vo,Ei=nn.current,ot(nn,e),ot(xn,xn.current),!0}function Pg(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=z0(e,t,Ei),r.__reactInternalMemoizedMergedChildContext=e,ze(xn),ze(nn),ot(nn,e)):ze(xn),ot(xn,n)}var pp=null,bi=null,VI=Ot.unstable_runWithPriority,hp=Ot.unstable_scheduleCallback,_f=Ot.unstable_cancelCallback,jI=Ot.unstable_shouldYield,bg=Ot.unstable_requestPaint,Df=Ot.unstable_now,RI=Ot.unstable_getCurrentPriorityLevel,ku=Ot.unstable_ImmediatePriority,K0=Ot.unstable_UserBlockingPriority,$0=Ot.unstable_NormalPriority,Z0=Ot.unstable_LowPriority,Y0=Ot.unstable_IdlePriority,Kc={},WI=bg!==void 0?bg:function(){},qr=null,Kd=null,$c=!1,Eg=Df(),en=1e4>Eg?Df:function(){return Df()-Eg};function ka(){switch(RI()){case ku:return 99;case K0:return 98;case $0:return 97;case Z0:return 96;case Y0:return 95;default:throw Error(X(332))}}function q0(e){switch(e){case 99:return ku;case 98:return K0;case 97:return $0;case 96:return Z0;case 95:return Y0;default:throw Error(X(332))}}function Ai(e,t){return e=q0(e),VI(e,t)}function fl(e,t,n){return e=q0(e),hp(e,t,n)}function Pr(){if(Kd!==null){var e=Kd;Kd=null,_f(e)}Q0()}function Q0(){if(!$c&&qr!==null){$c=!0;var e=0;try{var t=qr;Ai(99,function(){for(;ek?(L=A,A=null):L=A.sibling;var E=p(S,A,y[k],w);if(E===null){A===null&&(A=L);break}e&&A&&E.alternate===null&&t(S,A),g=i(E,g,k),N===null?P=E:N.sibling=E,N=E,A=L}if(k===y.length)return n(S,A),P;if(A===null){for(;kk?(L=A,A=null):L=A.sibling;var b=p(S,A,E.value,w);if(b===null){A===null&&(A=L);break}e&&A&&b.alternate===null&&t(S,A),g=i(b,g,k),N===null?P=b:N.sibling=b,N=b,A=L}if(E.done)return n(S,A),P;if(A===null){for(;!E.done;k++,E=y.next())E=c(S,E.value,w),E!==null&&(g=i(E,g,k),N===null?P=E:N.sibling=E,N=E);return P}for(A=r(S,A);!E.done;k++,E=y.next())E=h(A,S,k,E.value,w),E!==null&&(e&&E.alternate!==null&&A.delete(E.key===null?k:E.key),g=i(E,g,k),N===null?P=E:N.sibling=E,N=E);return e&&A.forEach(function(F){return t(S,F)}),P}return function(S,g,y,w){var P=typeof y=="object"&&y!==null&&y.type===Po&&y.key===null;P&&(y=y.props.children);var N=typeof y=="object"&&y!==null;if(N)switch(y.$$typeof){case Vs:e:{for(N=y.key,P=g;P!==null;){if(P.key===N){switch(P.tag){case 7:if(y.type===Po){n(S,P.sibling),g=o(P,y.props.children),g.return=S,S=g;break e}break;default:if(P.elementType===y.type){n(S,P.sibling),g=o(P,y.props),g.ref=Os(S,P,y),g.return=S,S=g;break e}}n(S,P);break}else t(S,P);P=P.sibling}y.type===Po?(g=ba(y.props.children,S.mode,w,y.key),g.return=S,S=g):(w=qd(y.type,y.key,y.props,null,S.mode,w),w.ref=Os(S,g,y),w.return=S,S=w)}return a(S);case Ti:e:{for(P=y.key;g!==null;){if(g.key===P)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(S,g.sibling),g=o(g,y.children||[]),g.return=S,S=g;break e}else{n(S,g);break}else t(S,g);g=g.sibling}g=tf(y,S.mode,w),g.return=S,S=g}return a(S)}if(typeof y=="string"||typeof y=="number")return y=""+y,g!==null&&g.tag===6?(n(S,g.sibling),g=o(g,y),g.return=S,S=g):(n(S,g),g=ef(y,S.mode,w),g.return=S,S=g),a(S);if(Bd(y))return x(S,g,y,w);if(Es(y))return D(S,g,y,w);if(N&&Hd(S,y),typeof y>"u"&&!P)switch(S.tag){case 1:case 22:case 0:case 11:case 15:throw Error(X(152,Ca(S.type)||"Component"))}return n(S,g)}}var cu=o2(!0),i2=o2(!1),Il={},Dr=Wo(Il),hl=Wo(Il),gl=Wo(Il);function vi(e){if(e===Il)throw Error(X(174));return e}function Pf(e,t){switch(ot(gl,t),ot(hl,e),ot(Dr,Il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mf(t,e)}ze(Dr),ot(Dr,t)}function Na(){ze(Dr),ze(hl),ze(gl)}function Og(e){vi(gl.current);var t=vi(Dr.current),n=mf(t,e.type);t!==n&&(ot(hl,e),ot(Dr,n))}function Cp(e){hl.current===e&&(ze(Dr),ze(hl))}var rt=Wo(0);function fu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eo=null,Ao=null,vr=!1;function a2(e,t){var n=Xn(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Fg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function bf(e){if(vr){var t=Ao;if(t){var n=t;if(!Fg(e,t)){if(t=Ta(n.nextSibling),!t||!Fg(e,t)){e.flags=e.flags&-1025|2,vr=!1,eo=e;return}a2(eo,n)}eo=e,Ao=Ta(t.firstChild)}else e.flags=e.flags&-1025|2,vr=!1,eo=e}}function Lg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;eo=e}function Gd(e){if(e!==eo)return!1;if(!vr)return Lg(e),vr=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!wf(t,e.memoizedProps))for(t=Ao;t;)a2(e,t),t=Ta(t.nextSibling);if(Lg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ao=Ta(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ao=null}}else Ao=eo?Ta(e.stateNode.nextSibling):null;return!0}function Zc(){Ao=eo=null,vr=!1}var Da=[];function Ip(){for(var e=0;ei))throw Error(X(301));i+=1,Ht=Qt=null,t.updateQueue=null,Qs.current=$I,e=n(r,o)}while(el)}if(Qs.current=Su,t=Qt!==null&&Qt.next!==null,yl=0,Ht=Qt=ht=null,pu=!1,t)throw Error(X(300));return e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?ht.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Fi(){if(Qt===null){var e=ht.alternate;e=e!==null?e.memoizedState:null}else e=Qt.next;var t=Ht===null?ht.memoizedState:Ht.next;if(t!==null)Ht=t,Qt=e;else{if(e===null)throw Error(X(310));Qt=e,e={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},Ht===null?ht.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Tr(e,t){return typeof t=="function"?t(e):t}function Fs(e){var t=Fi(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=Qt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){o=o.next,r=r.baseState;var s=a=i=null,l=o;do{var d=l.lane;if((yl&d)===d)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var u={lane:d,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(a=s=u,i=r):s=s.next=u,ht.lanes|=d,xl|=d}l=l.next}while(l!==null&&l!==o);s===null?i=r:s.next=a,Wn(r,t.memoizedState)||(lr=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ls(e){var t=Fi(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);Wn(i,t.memoizedState)||(lr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ug(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(o!==null?e=o===r:(e=e.mutableReadLanes,(e=(yl&e)===e)&&(t._workInProgressVersionPrimary=r,Da.push(t))),e)return n(t._source);throw Da.push(t),Error(X(350))}function s2(e,t,n,r){var o=pn;if(o===null)throw Error(X(349));var i=t._getVersion,a=i(t._source),s=Qs.current,l=s.useState(function(){return Ug(o,t,n)}),d=l[1],u=l[0];l=Ht;var c=e.memoizedState,p=c.refs,h=p.getSnapshot,x=c.source;c=c.subscribe;var D=ht;return e.memoizedState={refs:p,source:t,subscribe:r},s.useEffect(function(){p.getSnapshot=n,p.setSnapshot=d;var S=i(t._source);if(!Wn(a,S)){S=n(t._source),Wn(u,S)||(d(S),S=Lo(D),o.mutableReadLanes|=S&o.pendingLanes),S=o.mutableReadLanes,o.entangledLanes|=S;for(var g=o.entanglements,y=S;0n?98:n,function(){e(!0)}),Ai(97<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Eo]=t,e[au]=r,g2(e,t,!1,!1),t.stateNode=e,a=ff(n,r),n){case"dialog":Je("cancel",e),Je("close",e),o=r;break;case"iframe":case"object":case"embed":Je("load",e),o=r;break;case"video":case"audio":for(o=0;oBf&&(t.flags|=64,i=!0,Bs(r,!1),t.lanes=33554432)}else{if(!i)if(e=fu(a),e!==null){if(t.flags|=64,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!vr)return t=t.lastEffect=r.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*en()-r.renderingStartTime>Bf&&n!==1073741824&&(t.flags|=64,i=!0,Bs(r,!1),t.lanes=33554432);r.isBackwards?(a.sibling=t.child,t.child=a):(n=r.last,n!==null?n.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=en(),n.sibling=null,t=rt.current,ot(rt,i?t&1|2:t&1),n):null;case 23:case 24:return Ap(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(X(156,t.tag))}function qI(e){switch(e.tag){case 1:wn(e.type)&&su();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(Na(),ze(xn),ze(nn),Ip(),t=e.flags,(t&64)!==0)throw Error(X(285));return e.flags=t&-4097|64,e;case 5:return Cp(e),null;case 13:return ze(rt),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return ze(rt),null;case 4:return Na(),null;case 10:return yp(e),null;case 23:case 24:return Ap(),null;default:return null}}function vp(e,t){try{var n="",r=t;do n+=NC(r),r=r.return;while(r);var o=n}catch(i){o=` +`+o[a].replace(" at new "," at ");while(1<=a&&0<=s);break}}}finally{Lc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?js(e):""}function NC(e){switch(e.tag){case 5:return js(e.type);case 16:return js("Lazy");case 13:return js("Suspense");case 19:return js("SuspenseList");case 0:case 2:case 15:return e=Ad(e.type,!1),e;case 11:return e=Ad(e.type.render,!1),e;case 22:return e=Ad(e.type._render,!1),e;case 1:return e=Ad(e.type,!0),e;default:return""}}function Ca(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Po:return"Fragment";case Ti:return"Portal";case Js:return"Profiler";case zf:return"StrictMode";case zs:return"Suspense";case Qd:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case $f:return(e.displayName||"Context")+".Consumer";case Kf:return(e._context.displayName||"Context")+".Provider";case Tu:var t=e.render;return t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case _u:return Ca(e.type);case Yf:return Ca(e._render);case Zf:t=e._payload,e=e._init;try{return Ca(e(t))}catch{}}return null}function Ho(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}function s0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function MC(e){var t=s0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function kd(e){e._valueTracker||(e._valueTracker=MC(e))}function l0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=s0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function eu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function of(e,t){var n=t.checked;return Qe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Yh(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ho(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function d0(e,t){t=t.checked,t!=null&&Jf(e,"checked",t,!1)}function af(e,t){d0(e,t);var n=Ho(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?sf(e,t.type,n):t.hasOwnProperty("defaultValue")&&sf(e,t.type,Ho(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function qh(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function sf(e,t,n){(t!=="number"||eu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function OC(e){var t="";return wu.Children.forEach(e,function(n){n!=null&&(t+=n)}),t}function lf(e,t){return e=Qe({children:void 0},t),(t=OC(t.children))&&(e.children=t),e}function Ia(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o=n.length))throw Error(X(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ho(n)}}function u0(e,t){var n=Ho(t.value),r=Ho(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function eg(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}var uf={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function m0(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function mf(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?m0(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Nd,c0=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!==uf.svg||"innerHTML"in e)e.innerHTML=t;else{for(Nd=Nd||document.createElement("div"),Nd.innerHTML=""+t.valueOf().toString()+"",t=Nd.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function il(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ks={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},FC=["Webkit","ms","Moz","O"];Object.keys(Ks).forEach(function(e){FC.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ks[t]=Ks[e]})});function f0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ks.hasOwnProperty(e)&&Ks[e]?(""+t).trim():t+"px"}function p0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=f0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var LC=Qe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function cf(e,t){if(t){if(LC[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(X(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(X(60));if(!(typeof t.dangerouslySetInnerHTML=="object"&&"__html"in t.dangerouslySetInnerHTML))throw Error(X(61))}if(t.style!=null&&typeof t.style!="object")throw Error(X(62))}}function ff(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function ep(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pf=null,xa=null,wa=null;function tg(e){if(e=Cl(e)){if(typeof pf!="function")throw Error(X(280));var t=e.stateNode;t&&(t=Au(t),pf(e.stateNode,e.type,t))}}function h0(e){xa?wa?wa.push(e):wa=[e]:xa=e}function g0(){if(xa){var e=xa,t=wa;if(wa=xa=null,tg(e),t)for(e=0;er?0:1<n;n++)t.push(e);return t}function vu(e,t,n){e.pendingLanes|=t;var r=t-1;e.suspendedLanes&=r,e.pingedLanes&=r,e=e.eventTimes,t=31-Go(t),e[t]=n}var Go=Math.clz32?Math.clz32:qC,ZC=Math.log,YC=Math.LN2;function qC(e){return e===0?32:31-(ZC(e)/YC|0)|0}var QC=Ot.unstable_UserBlockingPriority,eI=Ot.unstable_runWithPriority,Wd=!0;function tI(e,t,n,r){_i||np();var o=sp,i=_i;_i=!0;try{y0(o,e,t,n,r)}finally{(_i=i)||rp()}}function nI(e,t,n,r){eI(QC,sp.bind(null,e,t,n,r))}function sp(e,t,n,r){if(Wd){var o;if((o=(t&4)===0)&&0=Zs),mg=String.fromCharCode(32),cg=!1;function O0(e,t){switch(e){case"keyup":return DI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function F0(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pa=!1;function PI(e,t){switch(e){case"compositionend":return F0(t);case"keypress":return t.which!==32?null:(cg=!0,mg);case"textInput":return e=t.data,e===mg&&cg?null:e;default:return null}}function bI(e,t){if(pa)return e==="compositionend"||!cp&&O0(e,t)?(e=N0(),Xd=dp=bo=null,pa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=hg(n)}}function H0(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?H0(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function yg(){for(var e=window,t=eu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=eu(e.document)}return t}function Cf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var BI=ro&&"documentMode"in document&&11>=document.documentMode,ha=null,If=null,qs=null,xf=!1;function Sg(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xf||ha==null||ha!==eu(r)||(r=ha,"selectionStart"in r&&Cf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),qs&&ml(qs,r)||(qs=r,r=ou(If,"onSelect"),0ya||(e.current=Tf[ya],Tf[ya]=null,ya--)}function ot(e,t){ya++,Tf[ya]=e.current,e.current=t}var Vo={},nn=Wo(Vo),xn=Wo(!1),Ei=Vo;function Aa(e,t){var n=e.type.contextTypes;if(!n)return Vo;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function wn(e){return e=e.childContextTypes,e!=null}function su(){Ke(xn),Ke(nn)}function vg(e,t,n){if(nn.current!==Vo)throw Error(X(168));ot(nn,t),ot(xn,n)}function z0(e,t,n){var r=e.stateNode;if(e=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in e))throw Error(X(108,Ca(t)||"Unknown",o));return Qe({},n,r)}function zd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Vo,Ei=nn.current,ot(nn,e),ot(xn,xn.current),!0}function Pg(e,t,n){var r=e.stateNode;if(!r)throw Error(X(169));n?(e=z0(e,t,Ei),r.__reactInternalMemoizedMergedChildContext=e,Ke(xn),Ke(nn),ot(nn,e)):Ke(xn),ot(xn,n)}var pp=null,bi=null,VI=Ot.unstable_runWithPriority,hp=Ot.unstable_scheduleCallback,_f=Ot.unstable_cancelCallback,jI=Ot.unstable_shouldYield,bg=Ot.unstable_requestPaint,Df=Ot.unstable_now,RI=Ot.unstable_getCurrentPriorityLevel,ku=Ot.unstable_ImmediatePriority,K0=Ot.unstable_UserBlockingPriority,$0=Ot.unstable_NormalPriority,Z0=Ot.unstable_LowPriority,Y0=Ot.unstable_IdlePriority,Kc={},WI=bg!==void 0?bg:function(){},qr=null,Kd=null,$c=!1,Eg=Df(),en=1e4>Eg?Df:function(){return Df()-Eg};function ka(){switch(RI()){case ku:return 99;case K0:return 98;case $0:return 97;case Z0:return 96;case Y0:return 95;default:throw Error(X(332))}}function q0(e){switch(e){case 99:return ku;case 98:return K0;case 97:return $0;case 96:return Z0;case 95:return Y0;default:throw Error(X(332))}}function Ai(e,t){return e=q0(e),VI(e,t)}function fl(e,t,n){return e=q0(e),hp(e,t,n)}function Pr(){if(Kd!==null){var e=Kd;Kd=null,_f(e)}Q0()}function Q0(){if(!$c&&qr!==null){$c=!0;var e=0;try{var t=qr;Ai(99,function(){for(;ek?(L=A,A=null):L=A.sibling;var E=p(S,A,y[k],w);if(E===null){A===null&&(A=L);break}e&&A&&E.alternate===null&&t(S,A),g=i(E,g,k),N===null?P=E:N.sibling=E,N=E,A=L}if(k===y.length)return n(S,A),P;if(A===null){for(;kk?(L=A,A=null):L=A.sibling;var b=p(S,A,E.value,w);if(b===null){A===null&&(A=L);break}e&&A&&b.alternate===null&&t(S,A),g=i(b,g,k),N===null?P=b:N.sibling=b,N=b,A=L}if(E.done)return n(S,A),P;if(A===null){for(;!E.done;k++,E=y.next())E=c(S,E.value,w),E!==null&&(g=i(E,g,k),N===null?P=E:N.sibling=E,N=E);return P}for(A=r(S,A);!E.done;k++,E=y.next())E=h(A,S,k,E.value,w),E!==null&&(e&&E.alternate!==null&&A.delete(E.key===null?k:E.key),g=i(E,g,k),N===null?P=E:N.sibling=E,N=E);return e&&A.forEach(function(F){return t(S,F)}),P}return function(S,g,y,w){var P=typeof y=="object"&&y!==null&&y.type===Po&&y.key===null;P&&(y=y.props.children);var N=typeof y=="object"&&y!==null;if(N)switch(y.$$typeof){case Vs:e:{for(N=y.key,P=g;P!==null;){if(P.key===N){switch(P.tag){case 7:if(y.type===Po){n(S,P.sibling),g=o(P,y.props.children),g.return=S,S=g;break e}break;default:if(P.elementType===y.type){n(S,P.sibling),g=o(P,y.props),g.ref=Os(S,P,y),g.return=S,S=g;break e}}n(S,P);break}else t(S,P);P=P.sibling}y.type===Po?(g=ba(y.props.children,S.mode,w,y.key),g.return=S,S=g):(w=qd(y.type,y.key,y.props,null,S.mode,w),w.ref=Os(S,g,y),w.return=S,S=w)}return a(S);case Ti:e:{for(P=y.key;g!==null;){if(g.key===P)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(S,g.sibling),g=o(g,y.children||[]),g.return=S,S=g;break e}else{n(S,g);break}else t(S,g);g=g.sibling}g=tf(y,S.mode,w),g.return=S,S=g}return a(S)}if(typeof y=="string"||typeof y=="number")return y=""+y,g!==null&&g.tag===6?(n(S,g.sibling),g=o(g,y),g.return=S,S=g):(n(S,g),g=ef(y,S.mode,w),g.return=S,S=g),a(S);if(Bd(y))return x(S,g,y,w);if(Es(y))return D(S,g,y,w);if(N&&Hd(S,y),typeof y>"u"&&!P)switch(S.tag){case 1:case 22:case 0:case 11:case 15:throw Error(X(152,Ca(S.type)||"Component"))}return n(S,g)}}var cu=o2(!0),i2=o2(!1),Il={},Dr=Wo(Il),hl=Wo(Il),gl=Wo(Il);function vi(e){if(e===Il)throw Error(X(174));return e}function Pf(e,t){switch(ot(gl,t),ot(hl,e),ot(Dr,Il),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:mf(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=mf(t,e)}Ke(Dr),ot(Dr,t)}function Na(){Ke(Dr),Ke(hl),Ke(gl)}function Og(e){vi(gl.current);var t=vi(Dr.current),n=mf(t,e.type);t!==n&&(ot(hl,e),ot(Dr,n))}function Cp(e){hl.current===e&&(Ke(Dr),Ke(hl))}var rt=Wo(0);function fu(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if((t.flags&64)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var eo=null,Ao=null,vr=!1;function a2(e,t){var n=Xn(5,null,null,0);n.elementType="DELETED",n.type="DELETED",n.stateNode=t,n.return=e,n.flags=8,e.lastEffect!==null?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function Fg(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,!0):!1;case 13:return!1;default:return!1}}function bf(e){if(vr){var t=Ao;if(t){var n=t;if(!Fg(e,t)){if(t=Ta(n.nextSibling),!t||!Fg(e,t)){e.flags=e.flags&-1025|2,vr=!1,eo=e;return}a2(eo,n)}eo=e,Ao=Ta(t.firstChild)}else e.flags=e.flags&-1025|2,vr=!1,eo=e}}function Lg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;eo=e}function Gd(e){if(e!==eo)return!1;if(!vr)return Lg(e),vr=!0,!1;var t=e.type;if(e.tag!==5||t!=="head"&&t!=="body"&&!wf(t,e.memoizedProps))for(t=Ao;t;)a2(e,t),t=Ta(t.nextSibling);if(Lg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(X(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ao=Ta(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ao=null}}else Ao=eo?Ta(e.stateNode.nextSibling):null;return!0}function Zc(){Ao=eo=null,vr=!1}var Da=[];function Ip(){for(var e=0;ei))throw Error(X(301));i+=1,Ht=Qt=null,t.updateQueue=null,Qs.current=$I,e=n(r,o)}while(el)}if(Qs.current=Su,t=Qt!==null&&Qt.next!==null,yl=0,Ht=Qt=ht=null,pu=!1,t)throw Error(X(300));return e}function Pi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ht===null?ht.memoizedState=Ht=e:Ht=Ht.next=e,Ht}function Fi(){if(Qt===null){var e=ht.alternate;e=e!==null?e.memoizedState:null}else e=Qt.next;var t=Ht===null?ht.memoizedState:Ht.next;if(t!==null)Ht=t,Qt=e;else{if(e===null)throw Error(X(310));Qt=e,e={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},Ht===null?ht.memoizedState=Ht=e:Ht=Ht.next=e}return Ht}function Tr(e,t){return typeof t=="function"?t(e):t}function Fs(e){var t=Fi(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=Qt,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){o=o.next,r=r.baseState;var s=a=i=null,l=o;do{var d=l.lane;if((yl&d)===d)s!==null&&(s=s.next={lane:0,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null}),r=l.eagerReducer===e?l.eagerState:e(r,l.action);else{var u={lane:d,action:l.action,eagerReducer:l.eagerReducer,eagerState:l.eagerState,next:null};s===null?(a=s=u,i=r):s=s.next=u,ht.lanes|=d,xl|=d}l=l.next}while(l!==null&&l!==o);s===null?i=r:s.next=a,Wn(r,t.memoizedState)||(lr=!0),t.memoizedState=r,t.baseState=i,t.baseQueue=s,n.lastRenderedState=r}return[t.memoizedState,n.dispatch]}function Ls(e){var t=Fi(),n=t.queue;if(n===null)throw Error(X(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);Wn(i,t.memoizedState)||(lr=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Ug(e,t,n){var r=t._getVersion;r=r(t._source);var o=t._workInProgressVersionPrimary;if(o!==null?e=o===r:(e=e.mutableReadLanes,(e=(yl&e)===e)&&(t._workInProgressVersionPrimary=r,Da.push(t))),e)return n(t._source);throw Da.push(t),Error(X(350))}function s2(e,t,n,r){var o=pn;if(o===null)throw Error(X(349));var i=t._getVersion,a=i(t._source),s=Qs.current,l=s.useState(function(){return Ug(o,t,n)}),d=l[1],u=l[0];l=Ht;var c=e.memoizedState,p=c.refs,h=p.getSnapshot,x=c.source;c=c.subscribe;var D=ht;return e.memoizedState={refs:p,source:t,subscribe:r},s.useEffect(function(){p.getSnapshot=n,p.setSnapshot=d;var S=i(t._source);if(!Wn(a,S)){S=n(t._source),Wn(u,S)||(d(S),S=Lo(D),o.mutableReadLanes|=S&o.pendingLanes),S=o.mutableReadLanes,o.entangledLanes|=S;for(var g=o.entanglements,y=S;0n?98:n,function(){e(!0)}),Ai(97<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[Eo]=t,e[au]=r,g2(e,t,!1,!1),t.stateNode=e,a=ff(n,r),n){case"dialog":ze("cancel",e),ze("close",e),o=r;break;case"iframe":case"object":case"embed":ze("load",e),o=r;break;case"video":case"audio":for(o=0;oBf&&(t.flags|=64,i=!0,Bs(r,!1),t.lanes=33554432)}else{if(!i)if(e=fu(a),e!==null){if(t.flags|=64,i=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Bs(r,!0),r.tail===null&&r.tailMode==="hidden"&&!a.alternate&&!vr)return t=t.lastEffect=r.lastEffect,t!==null&&(t.nextEffect=null),null}else 2*en()-r.renderingStartTime>Bf&&n!==1073741824&&(t.flags|=64,i=!0,Bs(r,!1),t.lanes=33554432);r.isBackwards?(a.sibling=t.child,t.child=a):(n=r.last,n!==null?n.sibling=a:t.child=a,r.last=a)}return r.tail!==null?(n=r.tail,r.rendering=n,r.tail=n.sibling,r.lastEffect=t.lastEffect,r.renderingStartTime=en(),n.sibling=null,t=rt.current,ot(rt,i?t&1|2:t&1),n):null;case 23:case 24:return Ap(),e!==null&&e.memoizedState!==null!=(t.memoizedState!==null)&&r.mode!=="unstable-defer-without-hiding"&&(t.flags|=4),null}throw Error(X(156,t.tag))}function qI(e){switch(e.tag){case 1:wn(e.type)&&su();var t=e.flags;return t&4096?(e.flags=t&-4097|64,e):null;case 3:if(Na(),Ke(xn),Ke(nn),Ip(),t=e.flags,(t&64)!==0)throw Error(X(285));return e.flags=t&-4097|64,e;case 5:return Cp(e),null;case 13:return Ke(rt),t=e.flags,t&4096?(e.flags=t&-4097|64,e):null;case 19:return Ke(rt),null;case 4:return Na(),null;case 10:return yp(e),null;case 23:case 24:return Ap(),null;default:return null}}function vp(e,t){try{var n="",r=t;do n+=NC(r),r=r.return;while(r);var o=n}catch(i){o=` Error generating stack: `+i.message+` -`+i.stack}return{value:e,source:t,stack:o}}function Mf(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var QI=typeof WeakMap=="function"?WeakMap:Map;function C2(e,t,n){n=Oo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Iu||(Iu=!0,Hf=r),Mf(e,t)},n}function I2(e,t,n){n=Oo(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return Mf(e,t),r(o)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){typeof r!="function"&&(_r===null?_r=new Set([this]):_r.add(this),Mf(e,t));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}var e6=typeof WeakSet=="function"?WeakSet:Set;function Zg(e){var t=e.ref;if(t!==null)if(typeof t=="function")try{t(null)}catch(n){Bo(e,n)}else t.current=null}function t6(e,t){switch(t.tag){case 0:case 11:case 15:case 22:return;case 1:if(t.flags&256&&e!==null){var n=e.memoizedProps,r=e.memoizedState;e=t.stateNode,t=e.getSnapshotBeforeUpdate(t.elementType===t.type?n:sr(t.type,n),r),e.__reactInternalSnapshotBeforeUpdate=t}return;case 3:t.flags&256&&fp(t.stateNode.containerInfo);return;case 5:case 6:case 4:case 17:return}throw Error(X(163))}function n6(e,t,n){switch(n.tag){case 0:case 11:case 15:case 22:if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{if((e.tag&3)===3){var r=e.create;e.destroy=r()}e=e.next}while(e!==t)}if(t=n.updateQueue,t=t!==null?t.lastEffect:null,t!==null){e=t=t.next;do{var o=e;r=o.next,o=o.tag,(o&4)!==0&&(o&1)!==0&&(E2(n,e),u6(n,e)),e=r}while(e!==t)}return;case 1:e=n.stateNode,n.flags&4&&(t===null?e.componentDidMount():(r=n.elementType===n.type?t.memoizedProps:sr(n.type,t.memoizedProps),e.componentDidUpdate(r,t.memoizedState,e.__reactInternalSnapshotBeforeUpdate))),t=n.updateQueue,t!==null&&kg(n,t,e);return;case 3:if(t=n.updateQueue,t!==null){if(e=null,n.child!==null)switch(n.child.tag){case 5:e=n.child.stateNode;break;case 1:e=n.child.stateNode}kg(n,t,e)}return;case 5:e=n.stateNode,t===null&&n.flags&4&&X0(n.type,n.memoizedProps)&&e.focus();return;case 6:return;case 4:return;case 12:return;case 13:n.memoizedState===null&&(n=n.alternate,n!==null&&(n=n.memoizedState,n!==null&&(n=n.dehydrated,n!==null&&_0(n))));return;case 19:case 17:case 20:case 21:case 23:case 24:return}throw Error(X(163))}function Yg(e,t){for(var n=e;;){if(n.tag===5){var r=n.stateNode;if(t)r=r.style,typeof r.setProperty=="function"?r.setProperty("display","none","important"):r.display="none";else{r=n.stateNode;var o=n.memoizedProps.style;o=o!=null&&o.hasOwnProperty("display")?o.display:null,r.style.display=f0("display",o)}}else if(n.tag===6)n.stateNode.nodeValue=t?"":n.memoizedProps;else if((n.tag!==23&&n.tag!==24||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return;n=n.return}n.sibling.return=n.return,n=n.sibling}}function qg(e,t){if(bi&&typeof bi.onCommitFiberUnmount=="function")try{bi.onCommitFiberUnmount(pp,t)}catch{}switch(t.tag){case 0:case 11:case 14:case 15:case 22:if(e=t.updateQueue,e!==null&&(e=e.lastEffect,e!==null)){var n=e=e.next;do{var r=n,o=r.destroy;if(r=r.tag,o!==void 0)if((r&4)!==0)E2(t,n);else{r=t;try{o()}catch(i){Bo(r,i)}}n=n.next}while(n!==e)}break;case 1:if(Zg(t),e=t.stateNode,typeof e.componentWillUnmount=="function")try{e.props=t.memoizedProps,e.state=t.memoizedState,e.componentWillUnmount()}catch(i){Bo(t,i)}break;case 5:Zg(t);break;case 4:x2(e,t)}}function Qg(e){e.alternate=null,e.child=null,e.dependencies=null,e.firstEffect=null,e.lastEffect=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.return=null,e.updateQueue=null}function e0(e){return e.tag===5||e.tag===3||e.tag===4}function t0(e){e:{for(var t=e.return;t!==null;){if(e0(t))break e;t=t.return}throw Error(X(160))}var n=t;switch(t=n.stateNode,n.tag){case 5:var r=!1;break;case 3:t=t.containerInfo,r=!0;break;case 4:t=t.containerInfo,r=!0;break;default:throw Error(X(161))}n.flags&16&&(il(t,""),n.flags&=-17);e:t:for(n=e;;){for(;n.sibling===null;){if(n.return===null||e0(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;n.tag!==5&&n.tag!==6&&n.tag!==18;){if(n.flags&2||n.child===null||n.tag===4)continue t;n.child.return=n,n=n.child}if(!(n.flags&2)){n=n.stateNode;break e}}r?Of(e,n,t):Ff(e,n,t)}function Of(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=iu));else if(r!==4&&(e=e.child,e!==null))for(Of(e,t,n),e=e.sibling;e!==null;)Of(e,t,n),e=e.sibling}function Ff(e,t,n){var r=e.tag,o=r===5||r===6;if(o)e=o?e.stateNode:e.stateNode.instance,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Ff(e,t,n),e=e.sibling;e!==null;)Ff(e,t,n),e=e.sibling}function x2(e,t){for(var n=t,r=!1,o,i;;){if(!r){r=n.return;e:for(;;){if(r===null)throw Error(X(160));switch(o=r.stateNode,r.tag){case 5:i=!1;break e;case 3:o=o.containerInfo,i=!0;break e;case 4:o=o.containerInfo,i=!0;break e}r=r.return}r=!0}if(n.tag===5||n.tag===6){e:for(var a=e,s=n,l=s;;)if(qg(a,l),l.child!==null&&l.tag!==4)l.child.return=l,l=l.child;else{if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}i?(a=o,s=n.stateNode,a.nodeType===8?a.parentNode.removeChild(s):a.removeChild(s)):o.removeChild(n.stateNode)}else if(n.tag===4){if(n.child!==null){o=n.stateNode.containerInfo,i=!0,n.child.return=n,n=n.child;continue}}else if(qg(e,n),n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return,n.tag===4&&(r=!1)}n.sibling.return=n.return,n=n.sibling}}function Qc(e,t){switch(t.tag){case 0:case 11:case 14:case 15:case 22:var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var r=n=n.next;do(r.tag&3)===3&&(e=r.destroy,r.destroy=void 0,e!==void 0&&e()),r=r.next;while(r!==n)}return;case 1:return;case 5:if(n=t.stateNode,n!=null){r=t.memoizedProps;var o=e!==null?e.memoizedProps:r;e=t.type;var i=t.updateQueue;if(t.updateQueue=null,i!==null){for(n[au]=r,e==="input"&&r.type==="radio"&&r.name!=null&&d0(n,r),ff(e,o),t=ff(e,r),o=0;oo&&(o=a),n&=~i}if(n=o,n=en()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*o6(n/1960))-n,10o&&(o=a),n&=~i}if(n=o,n=en()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*o6(n/1960))-n,10 component higher in the tree to provide a loading indicator or placeholder to display.`)}Gt!==5&&(Gt=2),l=vp(l,s),p=a;do{switch(p.tag){case 3:i=l,p.flags|=4096,t&=-t,p.lanes|=t;var N=C2(p,i,t);Ag(p,N);break e;case 1:i=l;var A=p.type,k=p.stateNode;if((p.flags&64)===0&&(typeof A.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(_r===null||!_r.has(k)))){p.flags|=4096,t&=-t,p.lanes|=t;var L=I2(p,i,t);Ag(p,L);break e}}p=p.return}while(p!==null)}b2(n)}catch(E){t=E,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(1)}function v2(){var e=Cu.current;return Cu.current=Su,e===null?Su:e}function Xs(e,t){var n=ue;ue|=16;var r=v2();pn===e&&tn===t||Pa(e,t);do try{a6();break}catch(o){D2(e,o)}while(1);if(gp(),ue=n,Cu.current=r,Pt!==null)throw Error(X(261));return pn=null,tn=0,Gt}function a6(){for(;Pt!==null;)P2(Pt)}function s6(){for(;Pt!==null&&!jI();)P2(Pt)}function P2(e){var t=A2(e.alternate,e,ki);e.memoizedProps=e.pendingProps,t===null?b2(e):Pt=t,Pp.current=null}function b2(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&2048)===0){if(n=YI(n,t,ki),n!==null){Pt=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||(ki&1073741824)!==0||(n.mode&4)===0){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&(e.flags&2048)===0&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1a&&(s=a,a=N,N=s),s=gg(y,N),i=gg(y,a),s&&i&&(P.rangeCount!==1||P.anchorNode!==s.node||P.anchorOffset!==s.offset||P.focusNode!==i.node||P.focusOffset!==i.offset)&&(w=w.createRange(),w.setStart(s.node,s.offset),P.removeAllRanges(),N>a?(P.addRange(w),P.extend(i.node,i.offset)):(w.setEnd(i.node,i.offset),P.addRange(w)))))),w=[],P=y;P=P.parentNode;)P.nodeType===1&&w.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yen()-Ep?Pa(e,0):bp|=n),Kn(e,t)}function f6(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,(t&2)===0?t=1:(t&4)===0?t=ka()===99?1:2:(Qr===0&&(Qr=Fa),t=ca(62914560&~Qr),t===0&&(t=4194304))),n=Nn(),e=Ou(e,t),e!==null&&(vu(e,t,n),Kn(e,n))}var A2;A2=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)lr=!0;else if((n&r)!==0)lr=(e.flags&16384)!==0;else{switch(lr=!1,t.tag){case 3:Rg(t),Zc();break;case 5:Og(t);break;case 1:wn(t.type)&&zd(t);break;case 4:Pf(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;ot(lu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return(n&t.child.childLanes)!==0?Wg(e,t,n):(ot(rt,rt.current&1),t=to(e,t,n),t!==null?t.sibling:null);ot(rt,rt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&64)!==0){if(r)return $g(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ot(rt,rt.current),r)break;return null;case 23:case 24:return t.lanes=0,Yc(e,t,n)}return to(e,t,n)}else lr=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Aa(t,nn.current),_a(t,n),o=wp(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,wn(r)){var i=!0;zd(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Sp(t);var a=r.getDerivedStateFromProps;typeof a=="function"&&mu(t,r,a,e),o.updater=Nu,t.stateNode=o,o._reactInternals=t,vf(t,r,e,n),t=kf(null,t,r,!0,i,n)}else t.tag=0,In(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=h6(o),e=sr(o,e),i){case 0:t=Af(null,t,o,e,n);break e;case 1:t=jg(null,t,o,e,n);break e;case 11:t=Gg(null,t,o,e,n);break e;case 14:t=Vg(null,t,o,sr(o.type,e),r,n);break e}throw Error(X(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),Af(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),jg(e,t,r,o,n);case 3:if(Rg(t),r=t.updateQueue,e===null||r===null)throw Error(X(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,t2(e,t),pl(t,r,null,n),r=t.memoizedState.element,r===o)Zc(),t=to(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(Ao=Ta(t.stateNode.containerInfo.firstChild),eo=t,i=vr=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o{"use strict";function M2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(M2)}catch(e){console.error(e)}}M2(),O2.exports=N2()});var iC=T(_()),aC=T(Fp());var R=T(_());var Xp=T(_());function Tl(e,t){let n=[];return e.forEach(r=>{t.indexOf(r)>=0&&n.push(r)}),n}function br(e,t){let n=e.indexOf(t);return n===-1?e.push(t):e.splice(n,1),e}var oo=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean",G=e=>oo(e)?e.toString():e.map(t=>t.toString()).filter(t=>t!=="").join(", "),Lu=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,G(n)])),F2=e=>{if(oo(e))return!0;for(let t=1;t{if(oo(e))return{lowerLevelColumnHeaders:[],finalColumnHeader:e};{if(F2(e))return{lowerLevelColumnHeaders:e.slice(1),finalColumnHeader:e[0]};let t=e.slice(0,e.length-1),n=e[e.length-1];return{lowerLevelColumnHeaders:t,finalColumnHeader:n}}},Uu=(e,t)=>F2(e)?0:e.length-t*-1,Jo=(e,t)=>{let n=[...e],r=t,o=[];for(;n.length>0&&r>0;){let i=G(n.shift()||""),a="";for(let s=0;s0&&(a+=i[s],r--);o.push(a)}return[o.join(", "),n.length]},_l=()=>{let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let r=0;r<4;r++)e+=t.charAt(Math.floor(Math.random()*n));return e},L2=(e,t)=>Object.keys(e.columnIDsMap)[t];function Li(e){return e=="bool"}function Dl(e){return e.includes("int")}function Ui(e){return e.includes("float")}function Zn(e){return e=="object"||e=="str"||e=="string"}function it(e){return e.includes("datetime")}function Er(e){return e.includes("timedelta")}function et(e){return Dl(e)||Ui(e)}var U2=e=>/^\d+\.?\d*$/.test(e),w6=e=>!isNaN(Number(e)),io=e=>e!==void 0&&w6(e)?parseFloat(e):void 0;var dr=(e,t)=>{if(e=e.toLowerCase(),t=t.toLowerCase(),e.includes(t))return 1;let n=[t,t.replace(" ","-"),t.replace(" ","_"),t.replace(" ","."),t.replace(" ",""),t.replace("_"," "),t.replace("-"," "),t.replace("."," ")],r=[e,e.replace(",","")];for(let o=0;oe!==void 0?e.toString():void 0;function B2(e){return e.charAt(0).toUpperCase()+e.slice(1)}var so=T(_());var M=(...e)=>{let t="";for(let n=0;n{i&&(t+=o+" ")}))}return t};var H2=T(_());var T6=e=>{let t=e.suppressTopBottomMargin?"spacing-row-no-top-bottom-margin":"spacing-row-top-bottom-margin";return H2.default.createElement("div",{className:M(e.className,"spacing-row",t),title:e.title,onClick:e.onClick,style:f(m({},e.style),{justifyContent:e.justify,alignItems:e.align})},e.children)},I=T6;var On={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},G2=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],V2=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],j2=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Tn=typeof window<"u"&&typeof window.document<"u"?window.document:{},Yn="fullscreenEnabled"in Tn&&Object.keys(On)||G2[0]in Tn&&G2||V2[0]in Tn&&V2||j2[0]in Tn&&j2||[],_6={requestFullscreen:function(e){return e[Yn[On.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[Yn[On.requestFullscreen]]},get exitFullscreen(){return Tn[Yn[On.exitFullscreen]].bind(Tn)},get fullscreenPseudoClass(){return":"+Yn[On.fullscreen]},addEventListener:function(e,t,n){return Tn.addEventListener(Yn[On[e]],t,n)},removeEventListener:function(e,t,n){return Tn.removeEventListener(Yn[On[e]],t,n)},get fullscreenEnabled(){return Boolean(Tn[Yn[On.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return Tn[Yn[On.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return Tn[("on"+Yn[On.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return Tn[("on"+Yn[On.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return Tn[("on"+Yn[On.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return Tn[("on"+Yn[On.fullscreenerror]).toLowerCase()]=e}},Ft=_6;var Ve=T(_()),K2=T(Fp());var R2=T(_()),Lp=(e,t)=>{if(e!==null&&e instanceof Node&&e.nodeType===Node.ELEMENT_NODE&&t!==void 0){let n=e;for(;n;){if(n.classList.contains(t))return!0;n=n.parentElement}}return!1};function W2(e,t){let n=r=>{let o=r.target;Lp(o,t)||setTimeout(()=>{e(o)},100)};(0,R2.useEffect)(()=>(document.addEventListener("click",n,!0),()=>{document.removeEventListener("click",n,!0)}))}var Ar=T(_());var D6=e=>{let t=(0,Ar.useRef)(null),[n,r]=(0,Ar.useState)(e.width),o=n||"block",i=e.autoFocus||!1,a=`element-width-${o}`,s=e.rightText!==void 0?e.rightText.length*6+10:void 0;return(0,Ar.useEffect)(()=>{var l;i&&((l=t.current)==null||l.focus())},[]),Ar.default.createElement("div",{className:"mito-input-container"},Ar.default.createElement("input",{id:e.id,className:M("mito-input","text-body-2",a,e.className),style:m({paddingRight:s},e.style),value:e.value,placeholder:e.placeholder,onKeyDown:l=>{e.onKeyDown&&e.onKeyDown(l),e.onEscape&&l.key=="Escape"&&e.onEscape()},onKeyPress:e.onKeyPress,onChange:e.onChange,onClick:e.onClick,onDoubleClick:e.onDoubleClick,autoFocus:e.autoFocus,required:e.required,disabled:e.disabled,type:e.type,ref:t,onFocus:l=>{e.onFocus!==void 0&&e.onFocus(l),e.widthOnFocus!==void 0&&r(e.widthOnFocus),e.selectTextOnFocus&&setTimeout(()=>{l.target.select()},50)},onBlur:l=>{e.onBlur!==void 0&&e.onBlur(l),r(e.width)}}),e.rightText&&Ar.default.createElement("div",{className:"mito-input-right-text"},e.rightText))},ne=D6;var X2={small:100,medium:170,"medium-large":250,large:345};var $2=250,J2=e=>{let t=window.innerHeight;return e+$2{let n=window.innerWidth;return e+te-$2>0,P6=(e,t)=>e-t>0,Ha="mito-dropdown-ignore-click",Up="mito-dropdown-suppress-focus-on-close",vl=(e,t,n)=>{let r=e.scrollTop,o=r+e.clientHeight,i=t.offsetTop,a=i+t.clientHeight;io&&(e.scrollTop+=a-o)},b6=(e,t,n,r)=>{let o=e.key==="Up"||e.key==="ArrowUp",i=e.key==="Down"||e.key==="ArrowDown",a=e.key==="Enter",s=e.key==="Escape",l=e.metaKey;o||i?(e.preventDefault(),n(o?d=>l?d>0?0:-1:Math.max(-1,d-1):d=>l?t-1:Math.min(d+1,t-1)),setTimeout(()=>{let d=document.querySelector(".mito-dropdown-items-container"),u=document.querySelector(".mito-dropdown-item-selected");d!==null&&u!==null&&vl(d,u,50)})):a?setTimeout(()=>{let d=document.querySelector(".mito-dropdown-item-selected");d&&d.click()},200):s&&r()},E6=e=>{let[t,n]=(0,Ve.useState)(""),[r,o]=(0,Ve.useState)(-1);W2(w=>{var P;!e.display||(e.closeDropdown(),Lp(w,Up)||(P=s.current)==null||P.focus())},Ha);let[i,a]=(0,Ve.useState)({top:void 0,bottom:void 0,right:void 0,left:void 0}),s=(0,Ve.useRef)(null),[l]=(0,Ve.useState)(()=>document.createElement("div")),[d,u]=(0,Ve.useState)(Ft.fullscreenElement===void 0||Ft.fullscreenElement===null),c=(0,Ve.useRef)(null),p=e.width||"large",h=X2[p];(0,Ve.useEffect)(()=>()=>{try{d?document.body.removeChild(l):c.current&&c.current.removeChild(l)}catch(w){}},[]);let x=(0,Ve.useCallback)(w=>{if(w!==null){if(s.current=w,d)document.body.append(l);else{let P=w.closest(".mito-container");P&&(P.appendChild(l),c.current=P)}D(w)}},[]);(0,Ve.useEffect)(()=>{s.current!==null&&D(s.current);let w=setInterval(()=>{s.current!==null&&D(s.current)},25);return()=>clearInterval(w)},[e.display]),(0,Ve.useEffect)(()=>{let w=()=>{var P;if(u(!Ft.fullscreenElement),!Ft.fullscreenElement)document.body.append(l);else{let N=(P=s.current)==null?void 0:P.closest(".mito-container");N&&(N.appendChild(l),c.current=N)}s.current&&D(s.current)};return Ft.addEventListener("fullscreenchange",w),()=>Ft.removeEventListener("fullscreenchange",w)},[]);let D=w=>{let N=(w.parentElement||w).getBoundingClientRect(),A=N.top,k=N.bottom,L=N.left,E=N.right,b={top:void 0,bottom:void 0,right:void 0,left:void 0};J2(k)&&z2(L,h)?b={top:k,bottom:void 0,right:void 0,left:L}:J2(k)&&P6(E,h)?b={top:k,bottom:void 0,right:window.innerWidth-E,left:void 0}:v6(A)&&z2(L,h)?b={top:void 0,bottom:window.innerHeight-A,right:void 0,left:L}:b={top:void 0,bottom:window.innerHeight-A,right:window.innerWidth-E,left:void 0},a(F=>b.top!==F.top||b.left!==F.left||b.bottom!==F.bottom||b.right!==F.right?b:F)},S=M("mito-dropdown",`element-width-${p}`,{"mito-dropdown-compressed":Ve.default.Children.count(e.children)>4,"mito-dropdown-search":e.searchable===!0}),g=0,y=Ve.default.Children.map(e.children,w=>{if(w.props.isDropdownSectionSeperator)return w;let P=w.props.title;if(P!==void 0&&dr(P,t.toLowerCase())>.8){let A=g===r,k=Ve.default.cloneElement(w,{className:M(w.props.className,{"mito-dropdown-item-selected":A})});return g+=1,k}else return null});return Ve.default.createElement("div",{ref:x,tabIndex:0},e.display&&K2.default.createPortal(Ve.default.createElement("div",{className:S,style:{position:"absolute",top:i.top,bottom:i.bottom,right:i.right,left:i.left}},e.searchable&&Ve.default.createElement("div",{className:M("mito-dropdown-search-input",Ha)},Ve.default.createElement(ne,{value:t,placeholder:"Search",onKeyDown:w=>{w.stopPropagation(),b6(w,g,o,e.closeDropdown)},onChange:w=>{o(-1),n(w.target.value)},autoFocus:!0})),y.length>0&&Ve.default.createElement("div",{className:"mito-dropdown-items-container"},y),g===0&&Ve.default.createElement(I,{justify:"center",style:{paddingTop:"50px"}},Ve.default.createElement("p",{className:"text-body-2"},"No options to display"))),l))},pe=E6;var A6=e=>{let t=e.disabled===!0,n=e.hideSubtext===!0,r=e.displaySubtextOnHover===!0;return so.default.createElement("div",{className:M("mito-dropdown-item",{[Ha]:t,[Up]:e.supressFocusSettingOnClose},e.className),onClick:t?void 0:e.onClick,title:e.tooltip},so.default.createElement("div",{className:M("mito-dropdown-item-icon-and-title-container")},so.default.createElement("div",{className:M("mito-dropdown-item-icon-container")},e.icon),so.default.createElement(I,{justify:"space-between",align:"center"},so.default.createElement("span",{title:e.tooltip||e.title},so.default.createElement("p",{className:M("text-body-2","text-overflow-hide","cursor-default",{"mito-dropdown-item-title-disabled":t})},e.title)),e.rightText&&so.default.createElement("span",{className:M("mito-dropdown-item-right-text","text-body-2")},e.rightText))),e.subtext&&so.default.createElement("div",{className:M("mito-dropdown-item-subtext-container","text-subtext-1",{"mito-dropdown-item-subtext-disabled":t},{"mito-dropdown-item-display-subtext-on-hover":n&&r})},e.subtext))},v=A6;var U=T(_());function Z2(e,t){return Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],o=e[n];typeof r=="object"&&typeof o=="object"?Z2(o,r):e[n]=r}),e}function jt(e,t){let n=window.structuredClone(e);return Z2(n,t),n}var lo=T(_());var Y2=T(_());var k6=e=>{let t=e.span?`${e.span/24*100}%`:void 0,n=e.offset?`${e.offset/24*100}%`:void 0,r=e.offsetRight?`${e.offsetRight/24*100}%`:void 0;return Y2.default.createElement("div",{className:M("spacing-col",e.className),style:m({width:t,marginLeft:n,marginRight:r,flex:e.flex},e.style),onClick:e.onClick,title:e.title},e.children)},C=k6;var kr=T(_());var Bi=T(_()),N6=e=>e.purpleOrDarkOrWhite==="purple"?Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"#9D6CFF"})):e.purpleOrDarkOrWhite==="white"?Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"white"})):Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"#343434"})),Bu=N6;var M6=e=>{let[t,n]=(0,kr.useState)(!1),o=`element-width-${e.width||"block"}`,i=t?"select-dropdown-active":"",a=e.className||"",s=e.value,l=kr.default.Children.map(e.children,d=>{let{id:u,title:c}=d.props;u===e.value&&(s=c);let p=u!==void 0?u:c,h=e.onChange;return h===void 0?d:kr.default.cloneElement(d,{onClick:()=>{h(p)}})});return kr.default.createElement("div",{className:M("select-container","text-body-2",o,i,a,{"select-disabled":e.disabled}),onClick:()=>{e.disabled||n(d=>d||!0)}},kr.default.createElement("p",{className:"select-text"},s),kr.default.createElement("div",{className:"select-dropdown-icon-container"},kr.default.createElement(Bu,{purpleOrDarkOrWhite:"white"})),kr.default.createElement(pe,{display:t,closeDropdown:()=>n(!1),searchable:e.searchable,width:e.dropdownWidth},l))},$=M6;var O6=e=>{let[t]=(0,lo.useState)(()=>e.sheetDataArray.map(n=>n.dfName).filter((n,r)=>r!==e.sheetIndexToIgnore));return lo.default.createElement(I,{justify:"space-between",align:"center",title:e.title},lo.default.createElement(C,null,lo.default.createElement("p",{className:"text-header-3"},"Dataframe")),lo.default.createElement(C,null,lo.default.createElement($,{width:"medium",value:t[e.sheetIndex],onChange:n=>{let r=t.findIndex(o=>o===n);r!==-1&&r!==e.sheetIndex&&e.onChange(r)}},t.map(n=>lo.default.createElement(v,{key:n,title:n})))))},Lt=O6;var Ga=T(_());var Bp=T(_());var Pl=T(_()),F6=()=>Pl.default.createElement("svg",{width:"20",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pl.default.createElement("path",{d:"M7.50018 11.5909C7.87674 11.5909 8.182 11.2856 8.182 10.9091C8.182 10.5325 7.87674 10.2273 7.50018 10.2273C7.12362 10.2273 6.81836 10.5325 6.81836 10.9091C6.81836 11.2856 7.12362 11.5909 7.50018 11.5909Z",fill:"#494650"}),Pl.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.74299 5.15462C7.41191 5.16915 7.23537 5.30235 7.17425 5.4322C7.0139 5.77291 6.60771 5.91912 6.267 5.75877C5.92629 5.59841 5.78008 5.19222 5.94044 4.85151C6.29647 4.09503 7.06347 3.81949 7.6832 3.79229C8.27933 3.76613 9.02119 3.95601 9.43162 4.49121C9.74745 4.90306 9.92489 5.42514 9.85323 5.97406C9.78058 6.53067 9.46309 7.02995 8.94794 7.40893C8.26004 7.91501 8.26125 8.17321 8.26143 8.21081C8.26143 8.21136 8.26144 8.21186 8.26144 8.21232C8.26144 8.58887 7.95618 8.89413 7.57962 8.89413C7.20306 8.89413 6.8978 8.58887 6.8978 8.21232C6.8978 7.56001 7.27722 6.94514 8.13987 6.31051C8.40503 6.11545 8.48394 5.92881 8.50107 5.79756C8.5192 5.65864 8.47982 5.49093 8.34953 5.32102C8.34036 5.30907 8.29056 5.25933 8.16587 5.21452C8.04681 5.17174 7.8971 5.14785 7.74299 5.15462Z",fill:"#494650"}),Pl.default.createElement("path",{d:"M7.5 15C3.34091 15 0 11.6591 0 7.5C0 3.34091 3.34091 0 7.5 0C11.6591 0 15 3.34091 15 7.5C15 11.6591 11.6591 15 7.5 15ZM7.5 1.36364C4.09091 1.36364 1.36364 4.09091 1.36364 7.5C1.36364 10.9091 4.09091 13.6364 7.5 13.6364C10.9091 13.6364 13.6364 10.9091 13.6364 7.5C13.6364 4.09091 10.9091 1.36364 7.5 1.36364Z",fill:"#494650"})),q2=F6;var L6=e=>Bp.default.createElement(I,{justify:"center",align:"center",title:e.title},Bp.default.createElement(q2,null)),Hu=L6;var U6=e=>Ga.default.createElement(I,{justify:"start",align:"center",title:e.tooltip,suppressTopBottomMargin:!0},Ga.default.createElement(C,null,Ga.default.createElement("p",{className:e.textBody?"text-body-1":"text-header-3"},e.children)),Ga.default.createElement(C,null,Ga.default.createElement(Hu,{title:e.tooltip}))),de=U6;var Gu=T(_());var B6=e=>{let t=e.disabled===!0,n=e.className!==void 0?e.className:"";return Gu.default.createElement("label",{className:M("toggle-label",n),style:e.height?{"--toggle-height":e.height}:{}},Gu.default.createElement("input",{type:"checkbox",checked:e.value,onClick:()=>{t||e.onChange()},onChange:()=>{}}),Gu.default.createElement("div",{className:M("toggle",{"toggle-disabled":t})}))},Ut=B6;var gt=T(_());var Hp=T(_()),H6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Hp.default.createElement("svg",{width:"19",height:"11",viewBox:"0 0 19 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hp.default.createElement("path",{d:"M18 1.94141L9.49199 8.94141L1 1.94141",stroke:t,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}))},Vu=H6;var Gp=T(_()),G6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Gp.default.createElement("svg",{width:"19",height:"10",viewBox:"0 0 19 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gp.default.createElement("path",{d:"M1 8.94141L9.50801 1.94141L18 8.94141",stroke:t,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}))},ju=G6;var Ru=T(_()),V6=()=>Ru.default.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ru.default.createElement("path",{d:"M4.70455 13V7.18182H6.67045C7.12689 7.18182 7.5 7.2642 7.78977 7.42898C8.08144 7.59186 8.29735 7.8125 8.4375 8.09091C8.57765 8.36932 8.64773 8.67992 8.64773 9.02273C8.64773 9.36553 8.57765 9.67708 8.4375 9.95739C8.29924 10.2377 8.08523 10.4612 7.79545 10.6278C7.50568 10.7926 7.13447 10.875 6.68182 10.875H5.27273V10.25H6.65909C6.97159 10.25 7.22254 10.196 7.41193 10.0881C7.60133 9.98011 7.73864 9.83428 7.82386 9.65057C7.91098 9.46496 7.95455 9.25568 7.95455 9.02273C7.95455 8.78977 7.91098 8.58144 7.82386 8.39773C7.73864 8.21402 7.60038 8.07008 7.40909 7.96591C7.2178 7.85985 6.96402 7.80682 6.64773 7.80682H5.40909V13H4.70455ZM9.69176 13V8.63636H10.3395V9.29545H10.3849C10.4645 9.07955 10.6084 8.90436 10.8168 8.76989C11.0251 8.63542 11.2599 8.56818 11.5213 8.56818C11.5705 8.56818 11.6321 8.56913 11.706 8.57102C11.7798 8.57292 11.8357 8.57576 11.8736 8.57955V9.26136C11.8509 9.25568 11.7988 9.24716 11.7173 9.2358C11.6378 9.22254 11.5535 9.21591 11.4645 9.21591C11.2524 9.21591 11.063 9.26042 10.8963 9.34943C10.7315 9.43655 10.6009 9.55777 10.5043 9.71307C10.4096 9.86648 10.3622 10.0417 10.3622 10.2386V13H9.69176ZM14.3082 13.0909C13.9143 13.0909 13.5687 12.9972 13.2713 12.8097C12.9759 12.6222 12.7448 12.3598 12.5781 12.0227C12.4134 11.6856 12.331 11.2917 12.331 10.8409C12.331 10.3864 12.4134 9.98958 12.5781 9.65057C12.7448 9.31155 12.9759 9.0483 13.2713 8.8608C13.5687 8.6733 13.9143 8.57955 14.3082 8.57955C14.7022 8.57955 15.0469 8.6733 15.3423 8.8608C15.6397 9.0483 15.8707 9.31155 16.0355 9.65057C16.2022 9.98958 16.2855 10.3864 16.2855 10.8409C16.2855 11.2917 16.2022 11.6856 16.0355 12.0227C15.8707 12.3598 15.6397 12.6222 15.3423 12.8097C15.0469 12.9972 14.7022 13.0909 14.3082 13.0909ZM14.3082 12.4886C14.6075 12.4886 14.8537 12.4119 15.0469 12.2585C15.2401 12.1051 15.383 11.9034 15.4759 11.6534C15.5687 11.4034 15.6151 11.1326 15.6151 10.8409C15.6151 10.5492 15.5687 10.2775 15.4759 10.0256C15.383 9.77367 15.2401 9.57008 15.0469 9.41477C14.8537 9.25947 14.6075 9.18182 14.3082 9.18182C14.009 9.18182 13.7628 9.25947 13.5696 9.41477C13.3764 9.57008 13.2334 9.77367 13.1406 10.0256C13.0478 10.2775 13.0014 10.5492 13.0014 10.8409C13.0014 11.1326 13.0478 11.4034 13.1406 11.6534C13.2334 11.9034 13.3764 12.1051 13.5696 12.2585C13.7628 12.4119 14.009 12.4886 14.3082 12.4886Z",fill:"#9D6CFF"}),Ru.default.createElement("path",{d:"M19.25 10C19.25 15.1086 15.1086 19.25 10 19.25C4.89137 19.25 0.75 15.1086 0.75 10C0.75 4.89137 4.89137 0.75 10 0.75C15.1086 0.75 19.25 4.89137 19.25 10Z",stroke:"#9D6CFF",strokeWidth:"1.5"})),Vp=V6;var j6=e=>{let[t,n]=(0,gt.useState)(e.open||!1);return(0,gt.useEffect)(()=>{e.open!==void 0&&n(e.open)},[e.open]),t&&e.disabled!==!0?gt.default.createElement("div",{className:"mito-blue-container"},gt.default.createElement(I,{justify:"space-between",align:"center",onClick:()=>{n(!1)}},gt.default.createElement(C,null,gt.default.createElement(I,{suppressTopBottomMargin:!0},typeof e.title=="string"&>.default.createElement("div",{className:"text-header-3"},e.title),typeof e.title!="string"&&e.title,"\xA0 ",e.proSection&&!e.isPro&>.default.createElement(Vp,null))),gt.default.createElement(C,null,gt.default.createElement(ju,null))),e.children):gt.default.createElement("div",{className:M("mito-blue-container",{"mito-blue-container-disabled":e.disabled}),onClick:()=>{n(!0)}},gt.default.createElement(I,{justify:"space-between",align:"center"},gt.default.createElement(C,null,gt.default.createElement(I,{suppressTopBottomMargin:!0},typeof e.title=="string"&>.default.createElement("div",{className:"text-header-3"},e.title),typeof e.title!="string"&&e.title,"\xA0 ",e.proSection&&!e.isPro&>.default.createElement(Vp,null))),gt.default.createElement(C,null,gt.default.createElement(Vu,null))))},je=j6;var Mr=T(_());var zo=T(_());var R6=e=>{let[t,n]=(0,zo.useState)(!1),o=`element-width-${e.width||"block"}`,i=e.disabled?"mito-dropdown-button-disabled":"mito-dropdown-button-enabled";return zo.default.createElement("div",{className:M("mito-dropdown-button","text-header-4",o,i),onClick:()=>{n(a=>!e.disabled&&!a?!0:a)}},zo.default.createElement("p",{className:"mito-dropdown-button-text",title:e.title},e.text),zo.default.createElement("div",{className:"mito-dropdown-button-icon-container"},zo.default.createElement(Bu,{purpleOrDarkOrWhite:e.disabled?"dark":"purple"})),zo.default.createElement(pe,{display:t,closeDropdown:()=>n(!1),searchable:e.searchable,width:e.dropdownWidth},e.children))},rn=R6;var Hi=T(_());var Wu=T(_()),W6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Wu.default.createElement("svg",{width:e.width||"18",onClick:e.onClick,height:e.height||"18",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wu.default.createElement("line",{x1:"0.707107",y1:"1.29289",x2:"11.3136",y2:"11.8994",stroke:t,strokeWidth:"2"}),Wu.default.createElement("line",{x1:"0.7072",y1:"11.8995",x2:"11.3137",y2:"1.29297",stroke:t,strokeWidth:"2"}))},at=W6;var X6=e=>Hi.default.createElement(I,{key:e.value,justify:"space-between",align:"center"},Hi.default.createElement(C,{flex:"1"},Hi.default.createElement($,{value:e.value+"",onChange:t=>{e.onChange(t)},searchable:!0},e.selectableValues.map(t=>{let n=e.titleMap?e.titleMap[t]:t;return Hi.default.createElement(v,{key:t,id:t,title:n})}))),Hi.default.createElement(C,{offset:1,offsetRight:1},Hi.default.createElement(at,{onClick:e.onDelete}))),Nr=X6;var J6=e=>{let t=Object.keys(e.columnIDsMap||{}),n=e.selectedColumnIDs.map((a,s)=>Mr.default.createElement(Nr,{key:s,value:a,titleMap:Lu(e.columnIDsMap),onChange:l=>{e.updateAxisData(e.graphAxis,s,l)},onDelete:()=>e.updateAxisData(e.graphAxis,s),selectableValues:t})),r=e.selectedColumnIDs.length,o=e.otherAxisSelectedColumnIDs.length,i=r+o>=10;return Mr.default.createElement("div",null,Mr.default.createElement(I,{justify:"space-between",align:"center",title:`Select columns to graph on the ${e.graphAxis}.`},Mr.default.createElement(C,null,Mr.default.createElement("div",{className:"text-header-3"},e.graphAxis)),Mr.default.createElement(C,null,Mr.default.createElement(rn,{text:"+ Add",width:"small",disabled:i,searchable:!0},t.map(a=>{let s=e.columnIDsMap[a];return Mr.default.createElement(v,{key:a,title:G(s),onClick:()=>{e.updateAxisData(e.graphAxis,e.selectedColumnIDs.length,a)}})})))),i&&Mr.default.createElement("div",{className:"text-subtext-1 text-align-left"},"You can only graph ten series at once."),n)},jp=J6;var Va=1e3,Q2=`Because you\u2019re graphing less than ${Va} rows of data, you can safely graph your data without applying a filter first.`,ey=`Turning on Limit ${Va} rows only graphs the first ${Va} rows of your dataframe, ensuring that your browser tab won\u2019t crash. Turning it off graphs the entire dataframe and may slow or crash your browser tab.`,Rp=["density heatmap"],ty=["histogram"],bl=["bar","histogram"],ny=["bar","histogram"],ry=["histogram"],El=["histogram"],Al=["box","violin"],kl=["line"],z6=[...new Set([...ty,...bl,...ny,...ry,...El,...Al,...kl])];function K6(e){var d;let t=e.graphParams.graphCreation.sheet_index,n=e.graphParams.graphPreprocessing,r=(u,c,p)=>{let h=[];u==="X axis"?h=e.graphParams.graphCreation.x_axis_column_ids:h=e.graphParams.graphCreation.y_axis_column_ids;let x=[...h];p===void 0?x.splice(c,1):x[c]=p,u==="X axis"?e.setGraphParams(D=>{let S=window.structuredClone(D);return f(m({},S),{graphCreation:f(m({},S.graphCreation),{x_axis_column_ids:x})})}):e.setGraphParams(D=>{let S=window.structuredClone(D);return f(m({},S),{graphCreation:f(m({},S.graphCreation),{y_axis_column_ids:x})})}),e.setGraphUpdatedNumber(D=>D+1)},o=u=>{let c=[...e.graphParams.graphCreation.x_axis_column_ids],p=[...e.graphParams.graphCreation.y_axis_column_ids];e.setGraphParams(h=>{let x=window.structuredClone(h);return f(m({},x),{graphCreation:f(m({},x.graphCreation),{graph_type:u,x_axis_column_ids:c,y_axis_column_ids:p,color:Rp.includes(u)?void 0:x.graphCreation.color,points:Al.includes(u)?"outliers":void 0,line_shape:kl.includes(u)?"linear":void 0,nbins:void 0,histnorm:void 0,histfunc:El.includes(u)?"count":void 0}),graphStyling:f(m({},x.graphStyling),{barmode:bl.includes(u)?"group":void 0,barnorm:void 0})})}),e.setGraphUpdatedNumber(h=>h+1)},i=u=>{e.setGraphParams(c=>{let p=window.structuredClone(c);return f(m({},p),{graphCreation:f(m({},p.graphCreation),{color:u})})}),e.setGraphUpdatedNumber(c=>c+1)};function a(u){e.setGraphParams(c=>jt(c,u)),e.setGraphUpdatedNumber(c=>c+1)}let s=Rp.includes(e.graphParams.graphCreation.graph_type)?`${e.graphParams.graphCreation.graph_type} does not support further breaking down data using color.`:"Use an additional column to further breakdown the data by color.",l=e.columnIDsMapArray[t]||{};return U.default.createElement(U.Fragment,null,U.default.createElement("div",{className:"graph-sidebar-toolbar-content"},U.default.createElement(Lt,{title:"Select the data sheet to graph.",sheetDataArray:e.sheetDataArray,sheetIndex:t,onChange:u=>{let c=Gi(e.sheetDataArray,u,e.graphParams.graphCreation.graph_type);e.setGraphParams(c),e.setGraphUpdatedNumber(p=>p+1)}}),U.default.createElement(I,{justify:"space-between",align:"center",title:"Select one of many Plotly graphs to create."},U.default.createElement(C,null,U.default.createElement("p",{className:"text-header-3"},"Chart Type")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.graph_type,onChange:u=>{o(u)},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"bar"}),U.default.createElement(v,{title:"line"}),U.default.createElement(v,{title:"scatter"}),U.default.createElement(v,{title:"histogram"}),U.default.createElement(v,{title:"density heatmap"}),U.default.createElement(v,{title:"density contour"}),U.default.createElement(v,{title:"box"}),U.default.createElement(v,{title:"violin"}),U.default.createElement(v,{title:"strip"}),U.default.createElement(v,{title:"ecdf"})))),U.default.createElement(jp,{columnIDsMap:l,graphType:e.graphParams.graphCreation.graph_type,graphAxis:"X axis",selectedColumnIDs:e.graphParams.graphCreation.x_axis_column_ids,otherAxisSelectedColumnIDs:e.graphParams.graphCreation.y_axis_column_ids,updateAxisData:r,mitoAPI:e.mitoAPI}),U.default.createElement(jp,{columnIDsMap:l,graphType:e.graphParams.graphCreation.graph_type,graphAxis:"Y axis",selectedColumnIDs:e.graphParams.graphCreation.y_axis_column_ids,otherAxisSelectedColumnIDs:e.graphParams.graphCreation.x_axis_column_ids,updateAxisData:r,mitoAPI:e.mitoAPI}),U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:s,suppressTopBottomMargin:!0},U.default.createElement(C,null,U.default.createElement(de,{tooltip:s},"Color By Column")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.color?G(l[e.graphParams.graphCreation.color]):"None",disabled:Rp.includes(e.graphParams.graphCreation.graph_type),width:"small",searchable:!0},iy(t,e.columnIDsMapArray,e.columnDtypesMap,i))))),U.default.createElement(I,{justify:"space-between",align:"center",title:Xu(e.sheetDataArray,t)?ey:Q2},U.default.createElement(C,null,U.default.createElement(de,{tooltip:Xu(e.sheetDataArray,t)?ey:Q2},`Limit ${Va} rows`)),U.default.createElement(C,null,U.default.createElement(Ut,{value:e.graphParams.graphPreprocessing.safety_filter_turned_on_by_user,onChange:()=>{a({graphPreprocessing:{safety_filter_turned_on_by_user:!n.safety_filter_turned_on_by_user}})},disabled:!Xu(e.sheetDataArray,t)}))),z6.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(je,{title:ay(e.graphParams.graphCreation.graph_type)+" configuration"},ty.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Number of bins in histogram"},U.default.createElement(C,null,U.default.createElement("p",null,"Number of bins (int)")),U.default.createElement(ne,{value:((d=e.graphParams.graphCreation.nbins)==null?void 0:d.toString())||"",type:"number",placeholder:"5",onChange:u=>{let c=u.target.value===""?void 0:u.target.value;a({graphCreation:{nbins:c}})},width:"small"})),bl.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"How bars are grouped together when there are multiple"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"How bars are grouped together when there are multiple",textBody:!0},"Bar mode")),U.default.createElement($,{value:e.graphParams.graphStyling.barmode||"group",onChange:u=>{a({graphStyling:{barmode:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"stack"}),U.default.createElement(v,{title:"group"}),U.default.createElement(v,{title:"overlay"}),U.default.createElement(v,{title:"relative"}))),ny.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Normalize strategy used for each group of bars at a specific location on the graph's domain"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Normalize strategy used for each group of bars at a specific location on the graph's domain",textBody:!0},"Bar normalization")),U.default.createElement($,{value:e.graphParams.graphStyling.barnorm||"none",onChange:u=>{if(u==="none"){a({graphStyling:{barnorm:void 0}});return}a({graphStyling:{barnorm:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"none"}),U.default.createElement(v,{title:"fraction",subtext:"value of each bar divided by the sum of all values at that location"}),U.default.createElement(v,{title:"percent",subtext:"fraction multiplied by 100"}))),ry.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Normalization strategy used for each graphed series in the histogram"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Normalization strategy used for each graphed series in the histogram",textBody:!0},"Hist normalization")),U.default.createElement($,{value:e.graphParams.graphCreation.histnorm||"none",onChange:u=>{if(u==="none"){a({graphCreation:{histnorm:void 0}});return}a({graphCreation:{histnorm:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"none"}),U.default.createElement(v,{title:"probability",subtext:"occurrences in bin divided by total number of sample points"}),U.default.createElement(v,{title:"percent",subtext:"probabilty multiplied by 100"}),U.default.createElement(v,{title:"density",subtext:"occurences in bin divided by bin interval"}),U.default.createElement(v,{title:"probability density",subtext:"probability that a point falls into bin"}))),El.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"The metric displayed for each bin of data"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"The metric displayed for each bin of data",textBody:!0},"Hist Function")),U.default.createElement($,{value:e.graphParams.graphCreation.histfunc||"count",onChange:u=>{a({graphCreation:{histfunc:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"count",subtext:"number of values in each bin"}),U.default.createElement(v,{title:"sum",subtext:"sum of values in each bin"}),U.default.createElement(v,{title:"avg",subtext:"average value in each bin"}),U.default.createElement(v,{title:"min",subtext:"min value in each bin"}),U.default.createElement(v,{title:"max",subtext:"max value in each bin"}))),Al.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Display outlier points"},U.default.createElement(C,null,U.default.createElement("p",null,"Points")),U.default.createElement($,{value:e.graphParams.graphCreation.points===!1?"none":e.graphParams.graphCreation.points!==void 0?e.graphParams.graphCreation.points:"",onChange:u=>{a({graphCreation:{points:u==="false"?!1:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"outliers",subtext:"only display sample points outside the whiskers"}),U.default.createElement(v,{title:"supsected outliers",id:"suspectedoutliers",subtext:"display outlier and suspected outlier points"}),U.default.createElement(v,{title:"all",subtext:"display all sample points"}),U.default.createElement(v,{title:"none",id:"false",subtext:"display no individual sample points"}))),kl.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"The shape of the line"},U.default.createElement(C,null,U.default.createElement("p",null,"Line shape")),U.default.createElement($,{value:e.graphParams.graphCreation.line_shape||"linear",onChange:u=>{a({graphCreation:{line_shape:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"linear",subtext:"straight line between points"}),U.default.createElement(v,{title:"spline",subtext:"spline interpolation between points"}),U.default.createElement(v,{title:"hv",subtext:"horizontal vertical"}),U.default.createElement(v,{title:"vh",subtext:"veritical horizontal"}),U.default.createElement(v,{title:"hvh",subtext:"horizontal vertical horizontal"}),U.default.createElement(v,{title:"vhv",subtext:"vertical horizontal vertical"})))),U.default.createElement(je,{title:"Facet plots"},U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:"Create subplots based on this attribute"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Create subplots based on this attribute",textBody:!0},"Facet Column")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.facet_col_column_id?G(l[e.graphParams.graphCreation.facet_col_column_id]):"None",width:"small",searchable:!0},[U.default.createElement(v,{key:"None",title:"None",onClick:()=>{a({graphCreation:{facet_col_column_id:void 0}})}})].concat((Object.keys(l)||[]).map(u=>{let c=l[u];return U.default.createElement(v,{key:u,title:G(c),onClick:()=>{a({graphCreation:{facet_col_column_id:u}})}})})))))),U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:"Create subplots based on this attribute"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Create subplots based on this attribute",textBody:!0},"Facet row")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.facet_row_column_id?G(l[e.graphParams.graphCreation.facet_row_column_id]):"None",width:"small",searchable:!0},[U.default.createElement(v,{key:"None",title:"None",onClick:()=>{a({graphCreation:{facet_row_column_id:void 0}})}})].concat((Object.keys(l)||[]).map(u=>{let c=l[u];return U.default.createElement(v,{key:u,title:G(c),onClick:()=>{a({graphCreation:{facet_row_column_id:u}})}})})))))))))}var oy=K6;var $6="#FFFFFF",Z6="#E6EBF5",Wp="#2F3E5D",Gi=(e,t,n)=>(n=n||"bar",{graphPreprocessing:{safety_filter_turned_on_by_user:!0},graphCreation:{graph_type:n,sheet_index:t,x_axis_column_ids:[],y_axis_column_ids:[],color:void 0,facet_col_column_id:void 0,facet_row_column_id:void 0,facet_col_wrap:void 0,facet_col_spacing:void 0,facet_row_spacing:void 0,points:Al.includes(n)?"outliers":void 0,line_shape:kl.includes(n)?"linear":void 0,nbins:void 0,histnorm:void 0,histfunc:El.includes(n)?"count":void 0},graphStyling:{title:{title:void 0,visible:!0,title_font_color:Wp},xaxis:{title:void 0,visible:!0,title_font_color:Wp,type:void 0,showgrid:!0,gridwidth:void 0,rangeslider:{visible:!0}},yaxis:{title:void 0,visible:!0,title_font_color:Wp,type:void 0,showgrid:!0,gridwidth:void 0},showlegend:!0,legend:{title:{text:void 0},orientation:"v",x:void 0,y:void 0},paper_bgcolor:$6,plot_bgcolor:Z6,barmode:bl.includes(n)?"group":void 0,barnorm:void 0}}),Xu=(e,t)=>e[t]===void 0||e[t].numRows>Va,Ju=(e,t,n,r)=>{var a;let o=window.structuredClone((a=e[t])==null?void 0:a.graphParams),i=o!==void 0?o.graphCreation.sheet_index:n;if(o!==void 0){let s=r[i]!==void 0?r[i].data.map(c=>c.columnID):[],l=Tl(s,o.graphCreation.x_axis_column_ids),d=Tl(s,o.graphCreation.y_axis_column_ids),u=o.graphCreation.color!==void 0&&s.includes(o.graphCreation.color)?o.graphCreation.color:void 0;return f(m({},o),{graphCreation:f(m({},o.graphCreation),{x_axis_column_ids:l,y_axis_column_ids:d,color:u})})}return Gi(r,i)},iy=(e,t,n,r)=>{let o=[Xp.default.createElement(v,{key:"None",title:"None",onClick:()=>r(void 0)})],i=Object.keys(t[e]||{}).map(a=>{let s=t[e][a],l=it(n[a]);return Xp.default.createElement(v,{key:a,title:G(s),onClick:()=>r(a),disabled:l,subtext:l?"Dates cannot be used as the color breakdown property":"",hideSubtext:!0,displaySubtextOnHover:!0})});return o.concat(i)},ay=e=>{switch(e){case"bar":return"Bar chart";case"box":return"Box plot";case"density contour":return"Density contour";case"density heatmap":return"Density heatmap";case"ecdf":return"ECDF";case"histogram":return"Histogram";case"line":return"Line chart";case"scatter":return"Scatter plot";case"strip":return"Strip plot";case"violin":return"Violin plot"}},sy=e=>{let t=e.graphCreation,n=e.graphStyling;return f(m({},e),{graphCreation:f(m({},e.graphCreation),{facet_col_wrap:io(t.facet_col_wrap),facet_col_spacing:io(t.facet_col_spacing),facet_row_spacing:io(t.facet_row_spacing),nbins:io(t.nbins)}),graphStyling:f(m({},e.graphStyling),{xaxis:f(m({},e.graphStyling.xaxis),{gridwidth:io(n.xaxis.gridwidth)}),yaxis:f(m({},e.graphStyling.yaxis),{gridwidth:io(n.yaxis.gridwidth)}),legend:f(m({},e.graphStyling.legend),{x:io(n.legend.x),y:io(n.legend.y)})})})},ly=e=>{let t=e.graphCreation,n=e.graphStyling;return f(m({},e),{graphCreation:f(m({},e.graphCreation),{facet_col_wrap:ao(t.facet_col_wrap),facet_col_spacing:ao(t.facet_col_spacing),facet_row_spacing:ao(t.facet_row_spacing),nbins:ao(t.nbins)}),graphStyling:f(m({},e.graphStyling),{xaxis:f(m({},e.graphStyling.xaxis),{gridwidth:ao(n.xaxis.gridwidth)}),yaxis:f(m({},e.graphStyling.yaxis),{gridwidth:ao(n.yaxis.gridwidth)}),legend:f(m({},e.graphStyling.legend),{x:ao(n.legend.x),y:ao(n.legend.y)})})})};var dy={1:"from mitosheet.public.v1 import *",2:"from mitosheet.public.v2 import *",3:"from mitosheet.public.v3 import *"};function uy(e,t,n,r){if(t.length==0)return"";let o=t.join(` +Add a component higher in the tree to provide a loading indicator or placeholder to display.`)}Gt!==5&&(Gt=2),l=vp(l,s),p=a;do{switch(p.tag){case 3:i=l,p.flags|=4096,t&=-t,p.lanes|=t;var N=C2(p,i,t);Ag(p,N);break e;case 1:i=l;var A=p.type,k=p.stateNode;if((p.flags&64)===0&&(typeof A.getDerivedStateFromError=="function"||k!==null&&typeof k.componentDidCatch=="function"&&(_r===null||!_r.has(k)))){p.flags|=4096,t&=-t,p.lanes|=t;var L=I2(p,i,t);Ag(p,L);break e}}p=p.return}while(p!==null)}b2(n)}catch(E){t=E,Pt===n&&n!==null&&(Pt=n=n.return);continue}break}while(1)}function v2(){var e=Cu.current;return Cu.current=Su,e===null?Su:e}function Xs(e,t){var n=ue;ue|=16;var r=v2();pn===e&&tn===t||Pa(e,t);do try{a6();break}catch(o){D2(e,o)}while(1);if(gp(),ue=n,Cu.current=r,Pt!==null)throw Error(X(261));return pn=null,tn=0,Gt}function a6(){for(;Pt!==null;)P2(Pt)}function s6(){for(;Pt!==null&&!jI();)P2(Pt)}function P2(e){var t=A2(e.alternate,e,ki);e.memoizedProps=e.pendingProps,t===null?b2(e):Pt=t,Pp.current=null}function b2(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&2048)===0){if(n=YI(n,t,ki),n!==null){Pt=n;return}if(n=t,n.tag!==24&&n.tag!==23||n.memoizedState===null||(ki&1073741824)!==0||(n.mode&4)===0){for(var r=0,o=n.child;o!==null;)r|=o.lanes|o.childLanes,o=o.sibling;n.childLanes=r}e!==null&&(e.flags&2048)===0&&(e.firstEffect===null&&(e.firstEffect=t.firstEffect),t.lastEffect!==null&&(e.lastEffect!==null&&(e.lastEffect.nextEffect=t.firstEffect),e.lastEffect=t.lastEffect),1a&&(s=a,a=N,N=s),s=gg(y,N),i=gg(y,a),s&&i&&(P.rangeCount!==1||P.anchorNode!==s.node||P.anchorOffset!==s.offset||P.focusNode!==i.node||P.focusOffset!==i.offset)&&(w=w.createRange(),w.setStart(s.node,s.offset),P.removeAllRanges(),N>a?(P.addRange(w),P.extend(i.node,i.offset)):(w.setEnd(i.node,i.offset),P.addRange(w)))))),w=[],P=y;P=P.parentNode;)P.nodeType===1&&w.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;yen()-Ep?Pa(e,0):bp|=n),Kn(e,t)}function f6(e,t){var n=e.stateNode;n!==null&&n.delete(t),t=0,t===0&&(t=e.mode,(t&2)===0?t=1:(t&4)===0?t=ka()===99?1:2:(Qr===0&&(Qr=Fa),t=ca(62914560&~Qr),t===0&&(t=4194304))),n=Nn(),e=Ou(e,t),e!==null&&(vu(e,t,n),Kn(e,n))}var A2;A2=function(e,t,n){var r=t.lanes;if(e!==null)if(e.memoizedProps!==t.pendingProps||xn.current)lr=!0;else if((n&r)!==0)lr=(e.flags&16384)!==0;else{switch(lr=!1,t.tag){case 3:Rg(t),Zc();break;case 5:Og(t);break;case 1:wn(t.type)&&zd(t);break;case 4:Pf(t,t.stateNode.containerInfo);break;case 10:r=t.memoizedProps.value;var o=t.type._context;ot(lu,o._currentValue),o._currentValue=r;break;case 13:if(t.memoizedState!==null)return(n&t.child.childLanes)!==0?Wg(e,t,n):(ot(rt,rt.current&1),t=to(e,t,n),t!==null?t.sibling:null);ot(rt,rt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,(e.flags&64)!==0){if(r)return $g(e,t,n);t.flags|=64}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ot(rt,rt.current),r)break;return null;case 23:case 24:return t.lanes=0,Yc(e,t,n)}return to(e,t,n)}else lr=!1;switch(t.lanes=0,t.tag){case 2:if(r=t.type,e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,o=Aa(t,nn.current),_a(t,n),o=wp(null,t,r,e,o,n),t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0){if(t.tag=1,t.memoizedState=null,t.updateQueue=null,wn(r)){var i=!0;zd(t)}else i=!1;t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Sp(t);var a=r.getDerivedStateFromProps;typeof a=="function"&&mu(t,r,a,e),o.updater=Nu,t.stateNode=o,o._reactInternals=t,vf(t,r,e,n),t=kf(null,t,r,!0,i,n)}else t.tag=0,In(null,t,o,n),t=t.child;return t;case 16:o=t.elementType;e:{switch(e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2),e=t.pendingProps,i=o._init,o=i(o._payload),t.type=o,i=t.tag=h6(o),e=sr(o,e),i){case 0:t=Af(null,t,o,e,n);break e;case 1:t=jg(null,t,o,e,n);break e;case 11:t=Gg(null,t,o,e,n);break e;case 14:t=Vg(null,t,o,sr(o.type,e),r,n);break e}throw Error(X(306,o,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),Af(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:sr(r,o),jg(e,t,r,o,n);case 3:if(Rg(t),r=t.updateQueue,e===null||r===null)throw Error(X(282));if(r=t.pendingProps,o=t.memoizedState,o=o!==null?o.element:null,t2(e,t),pl(t,r,null,n),r=t.memoizedState.element,r===o)Zc(),t=to(e,t,n);else{if(o=t.stateNode,(i=o.hydrate)&&(Ao=Ta(t.stateNode.containerInfo.firstChild),eo=t,i=vr=!0),i){if(e=o.mutableSourceEagerHydrationData,e!=null)for(o=0;o{"use strict";function M2(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(M2)}catch(e){console.error(e)}}M2(),O2.exports=N2()});var iC=T(_()),aC=T(Fp());var R=T(_());var Xp=T(_());function Tl(e,t){let n=[];return e.forEach(r=>{t.indexOf(r)>=0&&n.push(r)}),n}function br(e,t){let n=e.indexOf(t);return n===-1?e.push(t):e.splice(n,1),e}var oo=e=>typeof e=="string"||typeof e=="number"||typeof e=="boolean",G=e=>oo(e)?e.toString():e.map(t=>t.toString()).filter(t=>t!=="").join(", "),Lu=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t,G(n)])),F2=e=>{if(oo(e))return!0;for(let t=1;t{if(oo(e))return{lowerLevelColumnHeaders:[],finalColumnHeader:e};{if(F2(e))return{lowerLevelColumnHeaders:e.slice(1),finalColumnHeader:e[0]};let t=e.slice(0,e.length-1),n=e[e.length-1];return{lowerLevelColumnHeaders:t,finalColumnHeader:n}}},Uu=(e,t)=>F2(e)?0:e.length-t*-1,Jo=(e,t)=>{let n=[...e],r=t,o=[];for(;n.length>0&&r>0;){let i=G(n.shift()||""),a="";for(let s=0;s0&&(a+=i[s],r--);o.push(a)}return[o.join(", "),n.length]},_l=()=>{let e="",t="abcdefghijklmnopqrstuvwxyz0123456789",n=t.length;for(let r=0;r<4;r++)e+=t.charAt(Math.floor(Math.random()*n));return e},L2=(e,t)=>Object.keys(e.columnIDsMap)[t];function Li(e){return e=="bool"}function Dl(e){return e.includes("int")}function Ui(e){return e.includes("float")}function Zn(e){return e=="object"||e=="str"||e=="string"}function it(e){return e.includes("datetime")}function Er(e){return e.includes("timedelta")}function et(e){return Dl(e)||Ui(e)}var U2=e=>/^\d+\.?\d*$/.test(e),w6=e=>!isNaN(Number(e)),io=e=>e!==void 0&&w6(e)?parseFloat(e):void 0;var dr=(e,t)=>{if(e=e.toLowerCase(),t=t.toLowerCase(),e.includes(t))return 1;let n=[t,t.replace(" ","-"),t.replace(" ","_"),t.replace(" ","."),t.replace(" ",""),t.replace("_"," "),t.replace("-"," "),t.replace("."," ")],r=[e,e.replace(",","")];for(let o=0;oe!==void 0?e.toString():void 0;function B2(e){return e.charAt(0).toUpperCase()+e.slice(1)}var so=T(_());var M=(...e)=>{let t="";for(let n=0;n{i&&(t+=o+" ")}))}return t};var H2=T(_());var T6=e=>{let t=e.suppressTopBottomMargin?"spacing-row-no-top-bottom-margin":"spacing-row-top-bottom-margin";return H2.default.createElement("div",{className:M(e.className,"spacing-row",t),title:e.title,onClick:e.onClick,style:f(m({},e.style),{justifyContent:e.justify,alignItems:e.align})},e.children)},I=T6;var On={fullscreenEnabled:0,fullscreenElement:1,requestFullscreen:2,exitFullscreen:3,fullscreenchange:4,fullscreenerror:5,fullscreen:6},G2=["webkitFullscreenEnabled","webkitFullscreenElement","webkitRequestFullscreen","webkitExitFullscreen","webkitfullscreenchange","webkitfullscreenerror","-webkit-full-screen"],V2=["mozFullScreenEnabled","mozFullScreenElement","mozRequestFullScreen","mozCancelFullScreen","mozfullscreenchange","mozfullscreenerror","-moz-full-screen"],j2=["msFullscreenEnabled","msFullscreenElement","msRequestFullscreen","msExitFullscreen","MSFullscreenChange","MSFullscreenError","-ms-fullscreen"],Tn=typeof window<"u"&&typeof window.document<"u"?window.document:{},Yn="fullscreenEnabled"in Tn&&Object.keys(On)||G2[0]in Tn&&G2||V2[0]in Tn&&V2||j2[0]in Tn&&j2||[],_6={requestFullscreen:function(e){return e[Yn[On.requestFullscreen]]()},requestFullscreenFunction:function(e){return e[Yn[On.requestFullscreen]]},get exitFullscreen(){return Tn[Yn[On.exitFullscreen]].bind(Tn)},get fullscreenPseudoClass(){return":"+Yn[On.fullscreen]},addEventListener:function(e,t,n){return Tn.addEventListener(Yn[On[e]],t,n)},removeEventListener:function(e,t,n){return Tn.removeEventListener(Yn[On[e]],t,n)},get fullscreenEnabled(){return Boolean(Tn[Yn[On.fullscreenEnabled]])},set fullscreenEnabled(e){},get fullscreenElement(){return Tn[Yn[On.fullscreenElement]]},set fullscreenElement(e){},get onfullscreenchange(){return Tn[("on"+Yn[On.fullscreenchange]).toLowerCase()]},set onfullscreenchange(e){return Tn[("on"+Yn[On.fullscreenchange]).toLowerCase()]=e},get onfullscreenerror(){return Tn[("on"+Yn[On.fullscreenerror]).toLowerCase()]},set onfullscreenerror(e){return Tn[("on"+Yn[On.fullscreenerror]).toLowerCase()]=e}},Ft=_6;var Ve=T(_()),K2=T(Fp());var R2=T(_()),Lp=(e,t)=>{if(e!==null&&e instanceof Node&&e.nodeType===Node.ELEMENT_NODE&&t!==void 0){let n=e;for(;n;){if(n.classList.contains(t))return!0;n=n.parentElement}}return!1};function W2(e,t){let n=r=>{let o=r.target;Lp(o,t)||setTimeout(()=>{e(o)},100)};(0,R2.useEffect)(()=>(document.addEventListener("click",n,!0),()=>{document.removeEventListener("click",n,!0)}))}var Ar=T(_());var D6=e=>{let t=(0,Ar.useRef)(null),[n,r]=(0,Ar.useState)(e.width),o=n||"block",i=e.autoFocus||!1,a=`element-width-${o}`,s=e.rightText!==void 0?e.rightText.length*6+10:void 0;return(0,Ar.useEffect)(()=>{var l;i&&((l=t.current)==null||l.focus())},[]),Ar.default.createElement("div",{className:"mito-input-container"},Ar.default.createElement("input",{id:e.id,className:M("mito-input","text-body-2",a,e.className),style:m({paddingRight:s},e.style),value:e.value,placeholder:e.placeholder,onKeyDown:l=>{e.onKeyDown&&e.onKeyDown(l),e.onEscape&&l.key=="Escape"&&e.onEscape()},onKeyPress:e.onKeyPress,onChange:e.onChange,onClick:e.onClick,onDoubleClick:e.onDoubleClick,autoFocus:e.autoFocus,required:e.required,disabled:e.disabled,type:e.type,ref:t,onFocus:l=>{e.onFocus!==void 0&&e.onFocus(l),e.widthOnFocus!==void 0&&r(e.widthOnFocus),e.selectTextOnFocus&&setTimeout(()=>{l.target.select()},50)},onBlur:l=>{e.onBlur!==void 0&&e.onBlur(l),r(e.width)}}),e.rightText&&Ar.default.createElement("div",{className:"mito-input-right-text"},e.rightText))},ne=D6;var X2={small:100,medium:170,"medium-large":250,large:345};var $2=250,J2=e=>{let t=window.innerHeight;return e+$2{let n=window.innerWidth;return e+te-$2>0,P6=(e,t)=>e-t>0,Ha="mito-dropdown-ignore-click",Up="mito-dropdown-suppress-focus-on-close",vl=(e,t,n)=>{let r=e.scrollTop,o=r+e.clientHeight,i=t.offsetTop,a=i+t.clientHeight;io&&(e.scrollTop+=a-o)},b6=(e,t,n,r)=>{let o=e.key==="Up"||e.key==="ArrowUp",i=e.key==="Down"||e.key==="ArrowDown",a=e.key==="Enter",s=e.key==="Escape",l=e.metaKey;o||i?(e.preventDefault(),n(o?d=>l?d>0?0:-1:Math.max(-1,d-1):d=>l?t-1:Math.min(d+1,t-1)),setTimeout(()=>{let d=document.querySelector(".mito-dropdown-items-container"),u=document.querySelector(".mito-dropdown-item-selected");d!==null&&u!==null&&vl(d,u,50)})):a?setTimeout(()=>{let d=document.querySelector(".mito-dropdown-item-selected");d&&d.click()},200):s&&r()},E6=e=>{let[t,n]=(0,Ve.useState)(""),[r,o]=(0,Ve.useState)(-1);W2(w=>{var P;!e.display||(e.closeDropdown(),Lp(w,Up)||(P=s.current)==null||P.focus())},Ha);let[i,a]=(0,Ve.useState)({top:void 0,bottom:void 0,right:void 0,left:void 0}),s=(0,Ve.useRef)(null),[l]=(0,Ve.useState)(()=>document.createElement("div")),[d,u]=(0,Ve.useState)(Ft.fullscreenElement===void 0||Ft.fullscreenElement===null),c=(0,Ve.useRef)(null),p=e.width||"large",h=X2[p];(0,Ve.useEffect)(()=>()=>{try{d?document.body.removeChild(l):c.current&&c.current.removeChild(l)}catch(w){}},[]);let x=(0,Ve.useCallback)(w=>{if(w!==null){if(s.current=w,d)document.body.append(l);else{let P=w.closest(".mito-container");P&&(P.appendChild(l),c.current=P)}D(w)}},[]);(0,Ve.useEffect)(()=>{s.current!==null&&D(s.current);let w=setInterval(()=>{s.current!==null&&D(s.current)},25);return()=>clearInterval(w)},[e.display]),(0,Ve.useEffect)(()=>{let w=()=>{var P;if(u(!Ft.fullscreenElement),!Ft.fullscreenElement)document.body.append(l);else{let N=(P=s.current)==null?void 0:P.closest(".mito-container");N&&(N.appendChild(l),c.current=N)}s.current&&D(s.current)};return Ft.addEventListener("fullscreenchange",w),()=>Ft.removeEventListener("fullscreenchange",w)},[]);let D=w=>{let N=(w.parentElement||w).getBoundingClientRect(),A=N.top,k=N.bottom,L=N.left,E=N.right,b={top:void 0,bottom:void 0,right:void 0,left:void 0};J2(k)&&z2(L,h)?b={top:k,bottom:void 0,right:void 0,left:L}:J2(k)&&P6(E,h)?b={top:k,bottom:void 0,right:window.innerWidth-E,left:void 0}:v6(A)&&z2(L,h)?b={top:void 0,bottom:window.innerHeight-A,right:void 0,left:L}:b={top:void 0,bottom:window.innerHeight-A,right:window.innerWidth-E,left:void 0},a(F=>b.top!==F.top||b.left!==F.left||b.bottom!==F.bottom||b.right!==F.right?b:F)},S=M("mito-dropdown",`element-width-${p}`,{"mito-dropdown-compressed":Ve.default.Children.count(e.children)>4,"mito-dropdown-search":e.searchable===!0}),g=0,y=Ve.default.Children.map(e.children,w=>{if(w.props.isDropdownSectionSeperator)return w;let P=w.props.title;if(P!==void 0&&dr(P,t.toLowerCase())>.8){let A=g===r,k=Ve.default.cloneElement(w,{className:M(w.props.className,{"mito-dropdown-item-selected":A})});return g+=1,k}else return null});return Ve.default.createElement("div",{ref:x,tabIndex:0},e.display&&K2.default.createPortal(Ve.default.createElement("div",{className:S,style:{position:"absolute",top:i.top,bottom:i.bottom,right:i.right,left:i.left}},e.searchable&&Ve.default.createElement("div",{className:M("mito-dropdown-search-input",Ha)},Ve.default.createElement(ne,{value:t,placeholder:"Search",onKeyDown:w=>{w.stopPropagation(),b6(w,g,o,e.closeDropdown)},onChange:w=>{o(-1),n(w.target.value)},autoFocus:!0})),y.length>0&&Ve.default.createElement("div",{className:"mito-dropdown-items-container"},y),g===0&&Ve.default.createElement(I,{justify:"center",style:{paddingTop:"50px"}},Ve.default.createElement("p",{className:"text-body-2"},"No options to display"))),l))},pe=E6;var A6=e=>{let t=e.disabled===!0,n=e.hideSubtext===!0,r=e.displaySubtextOnHover===!0;return so.default.createElement("div",{className:M("mito-dropdown-item",{[Ha]:t,[Up]:e.supressFocusSettingOnClose},e.className),onClick:t?void 0:e.onClick,title:e.tooltip},so.default.createElement("div",{className:M("mito-dropdown-item-icon-and-title-container")},so.default.createElement("div",{className:M("mito-dropdown-item-icon-container")},e.icon),so.default.createElement(I,{justify:"space-between",align:"center"},so.default.createElement("span",{title:e.tooltip||e.title},so.default.createElement("p",{className:M("text-body-2","text-overflow-hide","cursor-default",{"mito-dropdown-item-title-disabled":t})},e.title)),e.rightText&&so.default.createElement("span",{className:M("mito-dropdown-item-right-text","text-body-2")},e.rightText))),e.subtext&&so.default.createElement("div",{className:M("mito-dropdown-item-subtext-container","text-subtext-1",{"mito-dropdown-item-subtext-disabled":t},{"mito-dropdown-item-display-subtext-on-hover":n&&r})},e.subtext))},v=A6;var U=T(_());function Z2(e,t){return Object.getOwnPropertyNames(t).forEach(n=>{let r=t[n],o=e[n];typeof r=="object"&&typeof o=="object"?Z2(o,r):e[n]=r}),e}function jt(e,t){let n=window.structuredClone(e);return Z2(n,t),n}var lo=T(_());var Y2=T(_());var k6=e=>{let t=e.span?`${e.span/24*100}%`:void 0,n=e.offset?`${e.offset/24*100}%`:void 0,r=e.offsetRight?`${e.offsetRight/24*100}%`:void 0;return Y2.default.createElement("div",{className:M("spacing-col",e.className),style:m({width:t,marginLeft:n,marginRight:r,flex:e.flex},e.style),onClick:e.onClick,title:e.title},e.children)},C=k6;var kr=T(_());var Bi=T(_()),N6=e=>e.purpleOrDarkOrWhite==="purple"?Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"#9D6CFF"})):e.purpleOrDarkOrWhite==="white"?Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"white"})):Bi.default.createElement("svg",{width:"6",height:"4",viewBox:"0 0 6 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Bi.default.createElement("path",{d:"M0 0L3.00283 4L6 0",fill:"#343434"})),Bu=N6;var M6=e=>{let[t,n]=(0,kr.useState)(!1),o=`element-width-${e.width||"block"}`,i=t?"select-dropdown-active":"",a=e.className||"",s=e.value,l=kr.default.Children.map(e.children,d=>{let{id:u,title:c}=d.props;u===e.value&&(s=c);let p=u!==void 0?u:c,h=e.onChange;return h===void 0?d:kr.default.cloneElement(d,{onClick:()=>{h(p)}})});return kr.default.createElement("div",{className:M("select-container","text-body-2",o,i,a,{"select-disabled":e.disabled}),onClick:()=>{e.disabled||n(d=>d||!0)}},kr.default.createElement("p",{className:"select-text"},s),kr.default.createElement("div",{className:"select-dropdown-icon-container"},kr.default.createElement(Bu,{purpleOrDarkOrWhite:"white"})),kr.default.createElement(pe,{display:t,closeDropdown:()=>n(!1),searchable:e.searchable,width:e.dropdownWidth},l))},$=M6;var O6=e=>{let[t]=(0,lo.useState)(()=>e.sheetDataArray.map(n=>n.dfName).filter((n,r)=>r!==e.sheetIndexToIgnore));return lo.default.createElement(I,{justify:"space-between",align:"center",title:e.title},lo.default.createElement(C,null,lo.default.createElement("p",{className:"text-header-3"},"Dataframe")),lo.default.createElement(C,null,lo.default.createElement($,{width:"medium",value:t[e.sheetIndex],onChange:n=>{let r=t.findIndex(o=>o===n);r!==-1&&r!==e.sheetIndex&&e.onChange(r)}},t.map(n=>lo.default.createElement(v,{key:n,title:n})))))},Lt=O6;var Ga=T(_());var Bp=T(_());var Pl=T(_()),F6=()=>Pl.default.createElement("svg",{width:"20",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pl.default.createElement("path",{d:"M7.50018 11.5909C7.87674 11.5909 8.182 11.2856 8.182 10.9091C8.182 10.5325 7.87674 10.2273 7.50018 10.2273C7.12362 10.2273 6.81836 10.5325 6.81836 10.9091C6.81836 11.2856 7.12362 11.5909 7.50018 11.5909Z",fill:"#494650"}),Pl.default.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M7.74299 5.15462C7.41191 5.16915 7.23537 5.30235 7.17425 5.4322C7.0139 5.77291 6.60771 5.91912 6.267 5.75877C5.92629 5.59841 5.78008 5.19222 5.94044 4.85151C6.29647 4.09503 7.06347 3.81949 7.6832 3.79229C8.27933 3.76613 9.02119 3.95601 9.43162 4.49121C9.74745 4.90306 9.92489 5.42514 9.85323 5.97406C9.78058 6.53067 9.46309 7.02995 8.94794 7.40893C8.26004 7.91501 8.26125 8.17321 8.26143 8.21081C8.26143 8.21136 8.26144 8.21186 8.26144 8.21232C8.26144 8.58887 7.95618 8.89413 7.57962 8.89413C7.20306 8.89413 6.8978 8.58887 6.8978 8.21232C6.8978 7.56001 7.27722 6.94514 8.13987 6.31051C8.40503 6.11545 8.48394 5.92881 8.50107 5.79756C8.5192 5.65864 8.47982 5.49093 8.34953 5.32102C8.34036 5.30907 8.29056 5.25933 8.16587 5.21452C8.04681 5.17174 7.8971 5.14785 7.74299 5.15462Z",fill:"#494650"}),Pl.default.createElement("path",{d:"M7.5 15C3.34091 15 0 11.6591 0 7.5C0 3.34091 3.34091 0 7.5 0C11.6591 0 15 3.34091 15 7.5C15 11.6591 11.6591 15 7.5 15ZM7.5 1.36364C4.09091 1.36364 1.36364 4.09091 1.36364 7.5C1.36364 10.9091 4.09091 13.6364 7.5 13.6364C10.9091 13.6364 13.6364 10.9091 13.6364 7.5C13.6364 4.09091 10.9091 1.36364 7.5 1.36364Z",fill:"#494650"})),q2=F6;var L6=e=>Bp.default.createElement(I,{justify:"center",align:"center",title:e.title},Bp.default.createElement(q2,null)),Hu=L6;var U6=e=>Ga.default.createElement(I,{justify:"start",align:"center",title:e.tooltip,suppressTopBottomMargin:!0},Ga.default.createElement(C,null,Ga.default.createElement("p",{className:e.textBody?"text-body-1":"text-header-3"},e.children)),Ga.default.createElement(C,null,Ga.default.createElement(Hu,{title:e.tooltip}))),de=U6;var Gu=T(_());var B6=e=>{let t=e.disabled===!0,n=e.className!==void 0?e.className:"";return Gu.default.createElement("label",{className:M("toggle-label",n),style:e.height?{"--toggle-height":e.height}:{}},Gu.default.createElement("input",{type:"checkbox",checked:e.value,onClick:()=>{t||e.onChange()},onChange:()=>{}}),Gu.default.createElement("div",{className:M("toggle",{"toggle-disabled":t})}))},Ut=B6;var gt=T(_());var Hp=T(_()),H6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Hp.default.createElement("svg",{width:"19",height:"11",viewBox:"0 0 19 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Hp.default.createElement("path",{d:"M18 1.94141L9.49199 8.94141L1 1.94141",stroke:t,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}))},Vu=H6;var Gp=T(_()),G6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Gp.default.createElement("svg",{width:"19",height:"10",viewBox:"0 0 19 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Gp.default.createElement("path",{d:"M1 8.94141L9.50801 1.94141L18 8.94141",stroke:t,strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}))},ju=G6;var Ru=T(_()),V6=()=>Ru.default.createElement("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ru.default.createElement("path",{d:"M4.70455 13V7.18182H6.67045C7.12689 7.18182 7.5 7.2642 7.78977 7.42898C8.08144 7.59186 8.29735 7.8125 8.4375 8.09091C8.57765 8.36932 8.64773 8.67992 8.64773 9.02273C8.64773 9.36553 8.57765 9.67708 8.4375 9.95739C8.29924 10.2377 8.08523 10.4612 7.79545 10.6278C7.50568 10.7926 7.13447 10.875 6.68182 10.875H5.27273V10.25H6.65909C6.97159 10.25 7.22254 10.196 7.41193 10.0881C7.60133 9.98011 7.73864 9.83428 7.82386 9.65057C7.91098 9.46496 7.95455 9.25568 7.95455 9.02273C7.95455 8.78977 7.91098 8.58144 7.82386 8.39773C7.73864 8.21402 7.60038 8.07008 7.40909 7.96591C7.2178 7.85985 6.96402 7.80682 6.64773 7.80682H5.40909V13H4.70455ZM9.69176 13V8.63636H10.3395V9.29545H10.3849C10.4645 9.07955 10.6084 8.90436 10.8168 8.76989C11.0251 8.63542 11.2599 8.56818 11.5213 8.56818C11.5705 8.56818 11.6321 8.56913 11.706 8.57102C11.7798 8.57292 11.8357 8.57576 11.8736 8.57955V9.26136C11.8509 9.25568 11.7988 9.24716 11.7173 9.2358C11.6378 9.22254 11.5535 9.21591 11.4645 9.21591C11.2524 9.21591 11.063 9.26042 10.8963 9.34943C10.7315 9.43655 10.6009 9.55777 10.5043 9.71307C10.4096 9.86648 10.3622 10.0417 10.3622 10.2386V13H9.69176ZM14.3082 13.0909C13.9143 13.0909 13.5687 12.9972 13.2713 12.8097C12.9759 12.6222 12.7448 12.3598 12.5781 12.0227C12.4134 11.6856 12.331 11.2917 12.331 10.8409C12.331 10.3864 12.4134 9.98958 12.5781 9.65057C12.7448 9.31155 12.9759 9.0483 13.2713 8.8608C13.5687 8.6733 13.9143 8.57955 14.3082 8.57955C14.7022 8.57955 15.0469 8.6733 15.3423 8.8608C15.6397 9.0483 15.8707 9.31155 16.0355 9.65057C16.2022 9.98958 16.2855 10.3864 16.2855 10.8409C16.2855 11.2917 16.2022 11.6856 16.0355 12.0227C15.8707 12.3598 15.6397 12.6222 15.3423 12.8097C15.0469 12.9972 14.7022 13.0909 14.3082 13.0909ZM14.3082 12.4886C14.6075 12.4886 14.8537 12.4119 15.0469 12.2585C15.2401 12.1051 15.383 11.9034 15.4759 11.6534C15.5687 11.4034 15.6151 11.1326 15.6151 10.8409C15.6151 10.5492 15.5687 10.2775 15.4759 10.0256C15.383 9.77367 15.2401 9.57008 15.0469 9.41477C14.8537 9.25947 14.6075 9.18182 14.3082 9.18182C14.009 9.18182 13.7628 9.25947 13.5696 9.41477C13.3764 9.57008 13.2334 9.77367 13.1406 10.0256C13.0478 10.2775 13.0014 10.5492 13.0014 10.8409C13.0014 11.1326 13.0478 11.4034 13.1406 11.6534C13.2334 11.9034 13.3764 12.1051 13.5696 12.2585C13.7628 12.4119 14.009 12.4886 14.3082 12.4886Z",fill:"#9D6CFF"}),Ru.default.createElement("path",{d:"M19.25 10C19.25 15.1086 15.1086 19.25 10 19.25C4.89137 19.25 0.75 15.1086 0.75 10C0.75 4.89137 4.89137 0.75 10 0.75C15.1086 0.75 19.25 4.89137 19.25 10Z",stroke:"#9D6CFF",strokeWidth:"1.5"})),Vp=V6;var j6=e=>{let[t,n]=(0,gt.useState)(e.open||!1);return(0,gt.useEffect)(()=>{e.open!==void 0&&n(e.open)},[e.open]),t&&e.disabled!==!0?gt.default.createElement("div",{className:"mito-blue-container"},gt.default.createElement(I,{justify:"space-between",align:"center",onClick:()=>{n(!1)}},gt.default.createElement(C,null,gt.default.createElement(I,{suppressTopBottomMargin:!0},typeof e.title=="string"&>.default.createElement("div",{className:"text-header-3"},e.title),typeof e.title!="string"&&e.title,"\xA0 ",e.proSection&&!e.isPro&>.default.createElement(Vp,null))),gt.default.createElement(C,null,gt.default.createElement(ju,null))),e.children):gt.default.createElement("div",{className:M("mito-blue-container",{"mito-blue-container-disabled":e.disabled}),onClick:()=>{n(!0)}},gt.default.createElement(I,{justify:"space-between",align:"center"},gt.default.createElement(C,null,gt.default.createElement(I,{suppressTopBottomMargin:!0},typeof e.title=="string"&>.default.createElement("div",{className:"text-header-3"},e.title),typeof e.title!="string"&&e.title,"\xA0 ",e.proSection&&!e.isPro&>.default.createElement(Vp,null))),gt.default.createElement(C,null,gt.default.createElement(Vu,null))))},je=j6;var Mr=T(_());var zo=T(_());var R6=e=>{let[t,n]=(0,zo.useState)(!1),o=`element-width-${e.width||"block"}`,i=e.disabled?"mito-dropdown-button-disabled":"mito-dropdown-button-enabled";return zo.default.createElement("div",{className:M("mito-dropdown-button","text-header-4",o,i),onClick:()=>{n(a=>!e.disabled&&!a?!0:a)}},zo.default.createElement("p",{className:"mito-dropdown-button-text",title:e.title},e.text),zo.default.createElement("div",{className:"mito-dropdown-button-icon-container"},zo.default.createElement(Bu,{purpleOrDarkOrWhite:e.disabled?"dark":"purple"})),zo.default.createElement(pe,{display:t,closeDropdown:()=>n(!1),searchable:e.searchable,width:e.dropdownWidth},e.children))},rn=R6;var Hi=T(_());var Wu=T(_()),W6=e=>{let t=e.variant==="light"?"var(--mito-white)":"var(--mito-legacy-gray)";return Wu.default.createElement("svg",{width:e.width||"18",onClick:e.onClick,height:e.height||"18",viewBox:"0 0 13 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Wu.default.createElement("line",{x1:"0.707107",y1:"1.29289",x2:"11.3136",y2:"11.8994",stroke:t,strokeWidth:"2"}),Wu.default.createElement("line",{x1:"0.7072",y1:"11.8995",x2:"11.3137",y2:"1.29297",stroke:t,strokeWidth:"2"}))},at=W6;var X6=e=>Hi.default.createElement(I,{key:e.value,justify:"space-between",align:"center"},Hi.default.createElement(C,{flex:"1"},Hi.default.createElement($,{value:e.value+"",onChange:t=>{e.onChange(t)},searchable:!0},e.selectableValues.map(t=>{let n=e.titleMap?e.titleMap[t]:t;return Hi.default.createElement(v,{key:t,id:t,title:n})}))),Hi.default.createElement(C,{offset:1,offsetRight:1},Hi.default.createElement(at,{onClick:e.onDelete}))),Nr=X6;var J6=e=>{let t=Object.keys(e.columnIDsMap||{}),n=e.selectedColumnIDs.map((a,s)=>Mr.default.createElement(Nr,{key:s,value:a,titleMap:Lu(e.columnIDsMap),onChange:l=>{e.updateAxisData(e.graphAxis,s,l)},onDelete:()=>e.updateAxisData(e.graphAxis,s),selectableValues:t})),r=e.selectedColumnIDs.length,o=e.otherAxisSelectedColumnIDs.length,i=r+o>=10;return Mr.default.createElement("div",null,Mr.default.createElement(I,{justify:"space-between",align:"center",title:`Select columns to graph on the ${e.graphAxis}.`},Mr.default.createElement(C,null,Mr.default.createElement("div",{className:"text-header-3"},e.graphAxis)),Mr.default.createElement(C,null,Mr.default.createElement(rn,{text:"+ Add",width:"small",disabled:i,searchable:!0},t.map(a=>{let s=e.columnIDsMap[a];return Mr.default.createElement(v,{key:a,title:G(s),onClick:()=>{e.updateAxisData(e.graphAxis,e.selectedColumnIDs.length,a)}})})))),i&&Mr.default.createElement("div",{className:"text-subtext-1 text-align-left"},"You can only graph ten series at once."),n)},jp=J6;var Va=1e3,Q2=`Because you\u2019re graphing less than ${Va} rows of data, you can safely graph your data without applying a filter first.`,ey=`Turning on Limit ${Va} rows only graphs the first ${Va} rows of your dataframe, ensuring that your browser tab won\u2019t crash. Turning it off graphs the entire dataframe and may slow or crash your browser tab.`,Rp=["density heatmap"],ty=["histogram"],bl=["bar","histogram"],ny=["bar","histogram"],ry=["histogram"],El=["histogram"],Al=["box","violin"],kl=["line"],z6=[...new Set([...ty,...bl,...ny,...ry,...El,...Al,...kl])];function K6(e){var d;let t=e.graphParams.graphCreation.sheet_index,n=e.graphParams.graphPreprocessing,r=(u,c,p)=>{let h=[];u==="X axis"?h=e.graphParams.graphCreation.x_axis_column_ids:h=e.graphParams.graphCreation.y_axis_column_ids;let x=[...h];p===void 0?x.splice(c,1):x[c]=p,u==="X axis"?e.setGraphParams(D=>{let S=window.structuredClone(D);return f(m({},S),{graphCreation:f(m({},S.graphCreation),{x_axis_column_ids:x})})}):e.setGraphParams(D=>{let S=window.structuredClone(D);return f(m({},S),{graphCreation:f(m({},S.graphCreation),{y_axis_column_ids:x})})}),e.setGraphUpdatedNumber(D=>D+1)},o=u=>{let c=[...e.graphParams.graphCreation.x_axis_column_ids],p=[...e.graphParams.graphCreation.y_axis_column_ids];e.setGraphParams(h=>{let x=window.structuredClone(h);return f(m({},x),{graphCreation:f(m({},x.graphCreation),{graph_type:u,x_axis_column_ids:c,y_axis_column_ids:p,color:Rp.includes(u)?void 0:x.graphCreation.color,points:Al.includes(u)?"outliers":void 0,line_shape:kl.includes(u)?"linear":void 0,nbins:void 0,histnorm:void 0,histfunc:El.includes(u)?"count":void 0}),graphStyling:f(m({},x.graphStyling),{barmode:bl.includes(u)?"group":void 0,barnorm:void 0})})}),e.setGraphUpdatedNumber(h=>h+1)},i=u=>{e.setGraphParams(c=>{let p=window.structuredClone(c);return f(m({},p),{graphCreation:f(m({},p.graphCreation),{color:u})})}),e.setGraphUpdatedNumber(c=>c+1)};function a(u){e.setGraphParams(c=>jt(c,u)),e.setGraphUpdatedNumber(c=>c+1)}let s=Rp.includes(e.graphParams.graphCreation.graph_type)?`${e.graphParams.graphCreation.graph_type} does not support further breaking down data using color.`:"Use an additional column to further breakdown the data by color.",l=e.columnIDsMapArray[t]||{};return U.default.createElement(U.Fragment,null,U.default.createElement("div",{className:"graph-sidebar-toolbar-content"},U.default.createElement(Lt,{title:"Select the data sheet to graph.",sheetDataArray:e.sheetDataArray,sheetIndex:t,onChange:u=>{let c=Gi(e.sheetDataArray,u,e.graphParams.graphCreation.graph_type);e.setGraphParams(c),e.setGraphUpdatedNumber(p=>p+1)}}),U.default.createElement(I,{justify:"space-between",align:"center",title:"Select one of many Plotly graphs to create."},U.default.createElement(C,null,U.default.createElement("p",{className:"text-header-3"},"Chart Type")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.graph_type,onChange:u=>{o(u)},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"bar"}),U.default.createElement(v,{title:"line"}),U.default.createElement(v,{title:"scatter"}),U.default.createElement(v,{title:"histogram"}),U.default.createElement(v,{title:"density heatmap"}),U.default.createElement(v,{title:"density contour"}),U.default.createElement(v,{title:"box"}),U.default.createElement(v,{title:"violin"}),U.default.createElement(v,{title:"strip"}),U.default.createElement(v,{title:"ecdf"})))),U.default.createElement(jp,{columnIDsMap:l,graphType:e.graphParams.graphCreation.graph_type,graphAxis:"X axis",selectedColumnIDs:e.graphParams.graphCreation.x_axis_column_ids,otherAxisSelectedColumnIDs:e.graphParams.graphCreation.y_axis_column_ids,updateAxisData:r,mitoAPI:e.mitoAPI}),U.default.createElement(jp,{columnIDsMap:l,graphType:e.graphParams.graphCreation.graph_type,graphAxis:"Y axis",selectedColumnIDs:e.graphParams.graphCreation.y_axis_column_ids,otherAxisSelectedColumnIDs:e.graphParams.graphCreation.x_axis_column_ids,updateAxisData:r,mitoAPI:e.mitoAPI}),U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:s,suppressTopBottomMargin:!0},U.default.createElement(C,null,U.default.createElement(de,{tooltip:s},"Color By Column")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.color?G(l[e.graphParams.graphCreation.color]):"None",disabled:Rp.includes(e.graphParams.graphCreation.graph_type),width:"small",searchable:!0},iy(t,e.columnIDsMapArray,e.columnDtypesMap,i))))),U.default.createElement(I,{justify:"space-between",align:"center",title:Xu(e.sheetDataArray,t)?ey:Q2},U.default.createElement(C,null,U.default.createElement(de,{tooltip:Xu(e.sheetDataArray,t)?ey:Q2},`Limit ${Va} rows`)),U.default.createElement(C,null,U.default.createElement(Ut,{value:e.graphParams.graphPreprocessing.safety_filter_turned_on_by_user,onChange:()=>{a({graphPreprocessing:{safety_filter_turned_on_by_user:!n.safety_filter_turned_on_by_user}})},disabled:!Xu(e.sheetDataArray,t)}))),z6.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(je,{title:ay(e.graphParams.graphCreation.graph_type)+" configuration"},ty.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Number of bins in histogram"},U.default.createElement(C,null,U.default.createElement("p",null,"Number of bins (int)")),U.default.createElement(ne,{value:((d=e.graphParams.graphCreation.nbins)==null?void 0:d.toString())||"",type:"number",placeholder:"5",onChange:u=>{let c=u.target.value===""?void 0:u.target.value;a({graphCreation:{nbins:c}})},width:"small"})),bl.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"How bars are grouped together when there are multiple"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"How bars are grouped together when there are multiple",textBody:!0},"Bar mode")),U.default.createElement($,{value:e.graphParams.graphStyling.barmode||"group",onChange:u=>{a({graphStyling:{barmode:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"stack"}),U.default.createElement(v,{title:"group"}),U.default.createElement(v,{title:"overlay"}),U.default.createElement(v,{title:"relative"}))),ny.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Normalize strategy used for each group of bars at a specific location on the graph's domain"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Normalize strategy used for each group of bars at a specific location on the graph's domain",textBody:!0},"Bar normalization")),U.default.createElement($,{value:e.graphParams.graphStyling.barnorm||"none",onChange:u=>{if(u==="none"){a({graphStyling:{barnorm:void 0}});return}a({graphStyling:{barnorm:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"none"}),U.default.createElement(v,{title:"fraction",subtext:"value of each bar divided by the sum of all values at that location"}),U.default.createElement(v,{title:"percent",subtext:"fraction multiplied by 100"}))),ry.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Normalization strategy used for each graphed series in the histogram"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Normalization strategy used for each graphed series in the histogram",textBody:!0},"Hist normalization")),U.default.createElement($,{value:e.graphParams.graphCreation.histnorm||"none",onChange:u=>{if(u==="none"){a({graphCreation:{histnorm:void 0}});return}a({graphCreation:{histnorm:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"none"}),U.default.createElement(v,{title:"probability",subtext:"occurrences in bin divided by total number of sample points"}),U.default.createElement(v,{title:"percent",subtext:"probabilty multiplied by 100"}),U.default.createElement(v,{title:"density",subtext:"occurences in bin divided by bin interval"}),U.default.createElement(v,{title:"probability density",subtext:"probability that a point falls into bin"}))),El.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"The metric displayed for each bin of data"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"The metric displayed for each bin of data",textBody:!0},"Hist Function")),U.default.createElement($,{value:e.graphParams.graphCreation.histfunc||"count",onChange:u=>{a({graphCreation:{histfunc:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"count",subtext:"number of values in each bin"}),U.default.createElement(v,{title:"sum",subtext:"sum of values in each bin"}),U.default.createElement(v,{title:"avg",subtext:"average value in each bin"}),U.default.createElement(v,{title:"min",subtext:"min value in each bin"}),U.default.createElement(v,{title:"max",subtext:"max value in each bin"}))),Al.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"Display outlier points"},U.default.createElement(C,null,U.default.createElement("p",null,"Points")),U.default.createElement($,{value:e.graphParams.graphCreation.points===!1?"none":e.graphParams.graphCreation.points!==void 0?e.graphParams.graphCreation.points:"",onChange:u=>{a({graphCreation:{points:u==="false"?!1:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"outliers",subtext:"only display sample points outside the whiskers"}),U.default.createElement(v,{title:"supsected outliers",id:"suspectedoutliers",subtext:"display outlier and suspected outlier points"}),U.default.createElement(v,{title:"all",subtext:"display all sample points"}),U.default.createElement(v,{title:"none",id:"false",subtext:"display no individual sample points"}))),kl.includes(e.graphParams.graphCreation.graph_type)&&U.default.createElement(I,{justify:"space-between",align:"center",title:"The shape of the line"},U.default.createElement(C,null,U.default.createElement("p",null,"Line shape")),U.default.createElement($,{value:e.graphParams.graphCreation.line_shape||"linear",onChange:u=>{a({graphCreation:{line_shape:u}})},width:"small",dropdownWidth:"medium"},U.default.createElement(v,{title:"linear",subtext:"straight line between points"}),U.default.createElement(v,{title:"spline",subtext:"spline interpolation between points"}),U.default.createElement(v,{title:"hv",subtext:"horizontal vertical"}),U.default.createElement(v,{title:"vh",subtext:"veritical horizontal"}),U.default.createElement(v,{title:"hvh",subtext:"horizontal vertical horizontal"}),U.default.createElement(v,{title:"vhv",subtext:"vertical horizontal vertical"})))),U.default.createElement(je,{title:"Facet plots"},U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:"Create subplots based on this attribute"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Create subplots based on this attribute",textBody:!0},"Facet Column")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.facet_col_column_id?G(l[e.graphParams.graphCreation.facet_col_column_id]):"None",width:"small",searchable:!0},[U.default.createElement(v,{key:"None",title:"None",onClick:()=>{a({graphCreation:{facet_col_column_id:void 0}})}})].concat((Object.keys(l)||[]).map(u=>{let c=l[u];return U.default.createElement(v,{key:u,title:G(c),onClick:()=>{a({graphCreation:{facet_col_column_id:u}})}})})))))),U.default.createElement("div",null,U.default.createElement(I,{justify:"space-between",align:"center",title:"Create subplots based on this attribute"},U.default.createElement(C,null,U.default.createElement(de,{tooltip:"Create subplots based on this attribute",textBody:!0},"Facet row")),U.default.createElement(C,null,U.default.createElement($,{value:e.graphParams.graphCreation.facet_row_column_id?G(l[e.graphParams.graphCreation.facet_row_column_id]):"None",width:"small",searchable:!0},[U.default.createElement(v,{key:"None",title:"None",onClick:()=>{a({graphCreation:{facet_row_column_id:void 0}})}})].concat((Object.keys(l)||[]).map(u=>{let c=l[u];return U.default.createElement(v,{key:u,title:G(c),onClick:()=>{a({graphCreation:{facet_row_column_id:u}})}})})))))))))}var oy=K6;var $6="#FFFFFF",Z6="#E6EBF5",Wp="#2F3E5D",Gi=(e,t,n)=>(n=n||"bar",{graphPreprocessing:{safety_filter_turned_on_by_user:!0},graphCreation:{graph_type:n,sheet_index:t,x_axis_column_ids:[],y_axis_column_ids:[],color:void 0,facet_col_column_id:void 0,facet_row_column_id:void 0,facet_col_wrap:void 0,facet_col_spacing:void 0,facet_row_spacing:void 0,points:Al.includes(n)?"outliers":void 0,line_shape:kl.includes(n)?"linear":void 0,nbins:void 0,histnorm:void 0,histfunc:El.includes(n)?"count":void 0},graphStyling:{title:{title:void 0,visible:!0,title_font_color:Wp},xaxis:{title:void 0,visible:!0,title_font_color:Wp,type:void 0,showgrid:!0,gridwidth:void 0,rangeslider:{visible:!0}},yaxis:{title:void 0,visible:!0,title_font_color:Wp,type:void 0,showgrid:!0,gridwidth:void 0},showlegend:!0,legend:{title:{text:void 0},orientation:"v",x:void 0,y:void 0},paper_bgcolor:$6,plot_bgcolor:Z6,barmode:bl.includes(n)?"group":void 0,barnorm:void 0}}),Xu=(e,t)=>e[t]===void 0||e[t].numRows>Va,Ju=(e,t,n,r)=>{var a;let o=window.structuredClone((a=e[t])==null?void 0:a.graphParams),i=o!==void 0?o.graphCreation.sheet_index:n;if(o!==void 0){let s=r[i]!==void 0?r[i].data.map(c=>c.columnID):[],l=Tl(s,o.graphCreation.x_axis_column_ids),d=Tl(s,o.graphCreation.y_axis_column_ids),u=o.graphCreation.color!==void 0&&s.includes(o.graphCreation.color)?o.graphCreation.color:void 0;return f(m({},o),{graphCreation:f(m({},o.graphCreation),{x_axis_column_ids:l,y_axis_column_ids:d,color:u})})}return Gi(r,i)},iy=(e,t,n,r)=>{let o=[Xp.default.createElement(v,{key:"None",title:"None",onClick:()=>r(void 0)})],i=Object.keys(t[e]||{}).map(a=>{let s=t[e][a],l=it(n[a]);return Xp.default.createElement(v,{key:a,title:G(s),onClick:()=>r(a),disabled:l,subtext:l?"Dates cannot be used as the color breakdown property":"",hideSubtext:!0,displaySubtextOnHover:!0})});return o.concat(i)},ay=e=>{switch(e){case"bar":return"Bar chart";case"box":return"Box plot";case"density contour":return"Density contour";case"density heatmap":return"Density heatmap";case"ecdf":return"ECDF";case"histogram":return"Histogram";case"line":return"Line chart";case"scatter":return"Scatter plot";case"strip":return"Strip plot";case"violin":return"Violin plot"}},sy=e=>{let t=e.graphCreation,n=e.graphStyling;return f(m({},e),{graphCreation:f(m({},e.graphCreation),{facet_col_wrap:io(t.facet_col_wrap),facet_col_spacing:io(t.facet_col_spacing),facet_row_spacing:io(t.facet_row_spacing),nbins:io(t.nbins)}),graphStyling:f(m({},e.graphStyling),{xaxis:f(m({},e.graphStyling.xaxis),{gridwidth:io(n.xaxis.gridwidth)}),yaxis:f(m({},e.graphStyling.yaxis),{gridwidth:io(n.yaxis.gridwidth)}),legend:f(m({},e.graphStyling.legend),{x:io(n.legend.x),y:io(n.legend.y)})})})},ly=e=>{let t=e.graphCreation,n=e.graphStyling;return f(m({},e),{graphCreation:f(m({},e.graphCreation),{facet_col_wrap:ao(t.facet_col_wrap),facet_col_spacing:ao(t.facet_col_spacing),facet_row_spacing:ao(t.facet_row_spacing),nbins:ao(t.nbins)}),graphStyling:f(m({},e.graphStyling),{xaxis:f(m({},e.graphStyling.xaxis),{gridwidth:ao(n.xaxis.gridwidth)}),yaxis:f(m({},e.graphStyling.yaxis),{gridwidth:ao(n.yaxis.gridwidth)}),legend:f(m({},e.graphStyling.legend),{x:ao(n.legend.x),y:ao(n.legend.y)})})})};var dy={1:"from mitosheet.public.v1 import *",2:"from mitosheet.public.v2 import *",3:"from mitosheet.public.v3 import *"};function uy(e,t,n,r){if(t.length==0)return"";let o=t.join(` `),i=dy[r];return n?`${i}; register_analysis("${e}"); ${o}`:`${i}; # Analysis Name:${e}; ${o}`}function Y6(e){let t=e.split(/\r?\n/).filter(n=>n.trim().length>0);return t.length>0?t.pop():void 0}var my=e=>{let n=ja(e).split("sheet(")[1].split(")")[0];n.includes("analysis_to_replay")&&(n=n.split("analysis_to_replay")[0].trim()),n.includes("view_df")&&(n=n.split("view_df")[0].trim()),n.includes("sheet_functions")&&(n=n.split("sheet_functions")[0].trim());let r=n.split(",").map(o=>o.trim());return r=r.filter(o=>o.length>0),r};function Vi(e){let t=Y6(e);return t===void 0?!1:ja(t).indexOf("sheet(")!==-1}function q6(e){let t=!1;return Object.values(dy).forEach(n=>{(e.startsWith(n+"; register_analysis(")||e.startsWith(n+"; # Analysis Name:"))&&(t=!0)}),e.startsWith("# MITO CODE START")||e.startsWith("from mitosheet import *; register_analysis(")||e.startsWith("from mitosheet import *; # Analysis:")||e.startsWith("from mitosheet import *; # Analysis Name:")||t}function Jp(e,t){let n=ja(e);return n.includes("sheet(")&&n.includes(`analysis_to_replay="${t}"`)}function Nl(e){let t=ja(e);return Vi(e)&&t.includes("analysis_to_replay=")}function cy(e,t){return q6(e)&&e.includes(t)}function ja(e){let t=/('[^']*'|"[^"]*")/;return e.split(t).map(i=>t.test(i)?i:i.replace(/\s+/g,"")).join("")}function zu(e){var t,n;return(n=(t=window.Jupyter)==null?void 0:t.notebook)==null?void 0:n.get_cell(e)}function _n(e){return(e==null?void 0:e.get_text())||""}function fy(e){return e===void 0?!1:_n(e).trim()===""}function Ku(e){var r,o;let t=(o=(r=window.Jupyter)==null?void 0:r.notebook)==null?void 0:o.get_cells();if(t===void 0)return;let n=0;for(let i of t){if(Jp(_n(i),e))return[i,n];n++}}function py(e){var a,s,l,d,u,c,p,h;if(e){let x=Ku(e);if(x!==void 0)return x}if(((s=(a=window.Jupyter)==null?void 0:a.notebook)==null?void 0:s.get_cells())==null)return;let n=(c=(l=window.Jupyter)==null?void 0:l.notebook)==null?void 0:c.get_cell((u=(d=window.Jupyter)==null?void 0:d.notebook)==null?void 0:u.get_anchor_index()),r=((h=(p=window.Jupyter)==null?void 0:p.notebook)==null?void 0:h.get_anchor_index())||0,o=zu(r-1);if(o&&Vi(_n(o))&&!Nl(_n(o)))return[o,r-1];if(n&&Vi(_n(n))&&!Nl(_n(n)))return[n,r];let i=r;for(;i>=0;){let x=zu(i);if(x&&Vi(_n(x))&&!Nl(_n(x)))return[x,i];i--}}function Ra(e,t){e!=null&&e.set_text(t)}function Q6(e,t,n){if(Vi(_n(e))&&Jp(_n(e),t)){let o=_n(e).replace(RegExp(`analysis_to_replay\\s*=\\s*"${t}"`),`analysis_to_replay="${n}"`);return Ra(e,o),!0}return!1}function e7(e,t){let n=_n(e);if(Vi(n)&&!Nl(n)){let r=ja(n),o=n.lastIndexOf(")"),i="";r.includes("sheet()")?i=`analysis_to_replay="${t}")`:i=`, analysis_to_replay="${t}")`;let a=n.substring(0,o)+i+n.substring(o+1);return Ra(e,a),!0}return!1}var hy=e=>{let t=py(e);if(t){let[n]=t;return my(_n(n))}else return[]},gy=(e,t)=>{let n=py(e);if(n){let[r]=n;if(e7(r,e))return}t.log("write_analysis_to_replay_to_mitosheet_call_failed")},yy=(e,t,n)=>{let r=Ku(e);if(r===void 0)return;let[o]=r;Q6(o,e,t)||n.log("overwrite_analysis_to_replay_to_mitosheet_call_failed")},Sy=(e,t,n,r)=>{var u,c,p,h,x,D,S,g,y,w,P,N,A,k,L,E;let o=uy(e,t,n,r),i=Ku(e);if(i===void 0)return;let[,a]=i;if(((c=(u=window.Jupyter)==null?void 0:u.notebook)==null?void 0:c.get_cells())===void 0)return;let l=((h=(p=window.Jupyter)==null?void 0:p.notebook)==null?void 0:h.get_anchor_index())||0,d=zu(a+1);if(fy(d)||cy(_n(d),e))Ra(d,o);else{if(a!==l){if(al)for(let F=0;F{var a,s,l,d,u,c,p,h,x,D,S,g;let n=Ku(e);if(n===void 0)return;let[,r]=n;if(((s=(a=window.Jupyter)==null?void 0:a.notebook)==null?void 0:s.get_cells())===void 0)return;let i=zu(r+1);if(fy(i))Ra(i,t);else{(d=(l=window.Jupyter)==null?void 0:l.notebook)==null||d.select_next(),(c=(u=window.Jupyter)==null?void 0:u.notebook)==null||c.insert_cell_below(),(h=(p=window.Jupyter)==null?void 0:p.notebook)==null||h.select_next();let y=(g=(x=window.Jupyter)==null?void 0:x.notebook)==null?void 0:g.get_cell((S=(D=window.Jupyter)==null?void 0:D.notebook)==null?void 0:S.get_anchor_index());Ra(y,t)}};var uo=()=>window.location.pathname.startsWith("/lab")||window.commands!==void 0||window._JUPYTERLAB!==void 0,ji=()=>window.location.pathname.startsWith("/notebooks")||window.Jupyter!==void 0,Iy=(e,t)=>{var n;uo()?(n=window.commands)==null||n.execute("mitosheet:write-analysis-to-replay-to-mitosheet-call",{analysisName:e,mitoAPI:t}):ji()?gy(e,t):console.error("Not detected as in Jupyter Notebook or JupyterLab")},$u=(e,t,n)=>{var r;uo()?(r=window.commands)==null||r.execute("mitosheet:overwrite-analysis-to-replay-to-mitosheet-call",{oldAnalysisName:e,newAnalysisName:t,mitoAPI:n}):ji()?yy(e,t,n):console.error("Not detected as in Jupyter Notebook or JupyterLab")},xy=(e,t,n,r)=>{var o;uo()?(o=window.commands)==null||o.execute("mitosheet:write-generated-code-cell",{analysisName:e,code:t,telemetryEnabled:n,publicInterfaceVersion:r}):ji()?Sy(e,t,n,r):console.error("Not detected as in Jupyter Notebook or JupyterLab")},wy=(e,t)=>{var n;uo()?(n=window.commands)==null||n.execute("mitosheet:write-code-snippet-cell",{analysisName:e,code:t}):ji()?Cy(e,t):console.error("Not detected as in Jupyter Notebook or JupyterLab")},Ty=e=>new Promise(t=>{var n;if(uo()){(n=window.commands)==null||n.execute("mitosheet:get-args",{analysisToReplayName:e}).then(async r=>t(r));return}else{if(ji())return t(hy(e));console.error("Not detected as in Jupyter Notebook or JupyterLab")}return t([])}),Zu=e=>e.length===0?[]:JSON.parse(e),Yu=e=>{let t=JSON.parse(e);return t.usageTriggeredFeedbackID==""&&(t.usageTriggeredFeedbackID=void 0),t},qu=e=>{let t=JSON.parse(e),n={};return Object.entries(t.graphDataDict).map(([r,o])=>{let i=o,a=i.graphParams,s=ly(a);n[r]=f(m({},i),{graphParams:s})}),t.graphDataDict=n,t};var Qu=(S=>(S.Undo="undo",S.Redo="redo",S.Clear="clear",S.ArgsUpdate="args_update",S.SaveAnalysisUpdate="save_analysis_update",S.ReplayAnalysisUpdate="replay_analysis_update",S.CheckoutStepByIdxUpdate="checkout_step_by_idx_update",S.AppendUserFieldUpdate="append_user_field_update",S.SetUserFieldUpdate="set_user_field_update",S.UpdateFeedbackv2ObjObject="update_feedback_v2_obj_update",S.GoPro="go_pro",S.RenderCountUpdate="render_count_update",S.ChecklistUpdate="checklist_update",S.UpdateExistingImportUpdate="update_existing_import_update",S.CodeOptionsUpdate="code_options_update",S.UndoToStepIndex="undo_to_step_index_update",S))(Qu||{});var Ml=(l=>(l.COUNT="count",l.COUNT_UNIQUE="count unique",l.SUM="sum",l.MEAN="mean",l.MEDIAN="median",l.STD="std",l.MIN="min",l.MAX="max",l))(Ml||{});var _y=T(_()),on=(e,t,n)=>{(0,_y.useEffect)(()=>{let r=()=>{},o=setTimeout(()=>{let i=e();i instanceof Object&&(r=i)},n);return()=>{clearTimeout(o),r()}},[...t||[],n])};var Dy={c:"copy",z:"undo",y:"redo"},t7=["z","y"],vy=(e,t,n)=>{on(()=>{let r=o=>{var a,s,l,d;if(!Object.keys(Dy).includes(o.key)||!o.ctrlKey&&!o.metaKey||(o.key==="c"&&n(u=>f(m({},u),{copiedSelections:[]})),!((a=e.current)!=null&&a.contains(document.activeElement)))||t7.includes(o.key)&&uo()||((s=document.activeElement)==null?void 0:s.tagName.toLowerCase())==="input"||((l=document.activeElement)==null?void 0:l.tagName.toLowerCase())==="textarea")return;let i=(d=window.getSelection())==null?void 0:d.toString();o.key==="c"&&i!==void 0&&i!==""||(o.stopImmediatePropagation(),o.stopPropagation(),o.preventDefault(),t[Dy[o.key]].actionFunction())};return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[t],50)};var gn=T(_());var Ko=T(_());var me=()=>"_"+Math.random().toString(36).substr(2,9);var Ol=class{constructor(t,n,r,o,i){this.getSendFunction=t,this.setSheetDataArray=n,this.setAnalysisData=r,this.setUserProfile=o,this.setUIState=i}_updateSharedStateVariables(t){t.sheetDataArray&&this.setSheetDataArray(t.sheetDataArray),t.analysisData&&this.setAnalysisData(t.analysisData),t.userProfile&&this.setUserProfile(t.userProfile)}_handleErrorResponse(t){return t.showErrorModal&&this.setUIState(n=>f(m({},n),{currOpenModal:{type:"Error",error:t}})),t}_startLoading(t){return setTimeout(()=>{this.setUIState(n=>{let r=[...n.loading];return r.push([t.id,t.step_id,t.type]),f(m({},n),{loading:r})})},500)}_stopLoading(t,n){clearTimeout(n),this.setUIState(r=>{let o=[...r.loading],i=o.findIndex(a=>a[0]===t);return i>=0&&o.splice(i,1),f(m({},r),{loading:o})})}async send(t){let n=me();if(t.id=n,this._send===void 0){let i=await this.getSendFunction();this._send=this._send||i}if(this._send===void 0)return console.error(`Unable to establish comm. Quitting before sending message with id ${n}`),{error:"Connection error. Unable to establish comm.",errorShort:"Connection error",showErrorModal:!0};let r=this._startLoading(t),o=await this._send(t);return this._stopLoading(n,r),"error"in o?this._handleErrorResponse(o):(this._updateSharedStateVariables(o),{result:o.result})}async getPathContents(t){return await this.send({event:"api_call",type:"get_path_contents",params:{path_parts:t}})}async getPathJoined(t){return await this.send({event:"api_call",type:"get_path_join",params:{path_parts:t}})}async getDataframeAsCSV(t){return await this.send({event:"api_call",type:"get_dataframe_as_csv",params:{sheet_index:t}})}async getDataframesAsExcel(t){return await this.send({event:"api_call",type:"get_dataframe_as_excel",params:{sheet_indexes:t}})}async getColumnSummaryGraph(t,n,r,o){return await this.send({event:"api_call",type:"get_column_summary_graph",params:{sheet_index:t,column_id:n,height:r,width:o,include_plotlyjs:window.Plotly===void 0}})}async getColumnDescribe(t,n){return await this.send({event:"api_call",type:"get_column_describe",params:{sheet_index:t,column_id:n}})}async getParams(t,n,r){let o=await this.send({event:"api_call",type:"get_params",params:{step_type:t,step_id_to_match:n||"",execution_data_to_match:r}});if("error"in o)return o;{let i=o.result;return i===null?{result:void 0}:{result:i}}}async getPivotParams(t){return await this.getParams("pivot",void 0,{destination_sheet_index:t})}async getExcelFileMetadata(t){return await this.send({event:"api_call",type:"get_excel_file_metadata",params:{file_path:t}})}async getCSVFilesMetadata(t){return await this.send({event:"api_call",type:"get_csv_files_metadata",params:{file_names:t}})}async getUniqueValueCounts(t,n,r,o){return await this.send({event:"api_call",type:"get_unique_value_counts",params:{sheet_index:t,column_id:n,search_string:r,sort:o}})}async getSplitTextToColumnsPreview(t){return await this.send({event:"api_call",type:"get_split_text_to_columns_preview",params:t})}async getDefinedDfNames(){return await this.send({event:"api_call",type:"get_defined_df_names",params:{}})}async getImportedFilesAndDataframesFromCurrentSteps(){return await this.send({event:"api_call",type:"get_imported_files_and_dataframes_from_current_steps",params:{}})}async getImportedFilesAndDataframesFromAnalysisName(t,n){return await this.send({event:"api_call",type:"get_imported_files_and_dataframes_from_analysis_name",params:{analysis_name:t,args:n}})}async getTestImports(t){return await this.send({event:"api_call",type:"get_test_imports",params:{updated_step_import_data_list:t}})}async getRenderCount(){return await this.send({event:"api_call",type:"get_render_count",params:{}})}async getCodeSnippets(){return await this.send({event:"api_call",type:"get_code_snippets",params:{}})}async getAvailableSnowflakeOptionsAndDefaults(t){return await this.send({event:"api_call",type:"get_available_snowflake_options_and_defaults",params:{table_loc_and_warehouse:t}})}async validateSnowflakeCredentials(t){return await this.send({event:"api_call",type:"get_validate_snowflake_credentials",params:t})}async getAICompletion(t,n,r){return await this.send({event:"api_call",type:"get_ai_completion",params:{user_input:t,selection:n,previous_failed_completions:r}})}async getParameterizableParams(){return await this.send({event:"api_call",type:"get_parameterizable_params",params:{}})}async _edit(t,n,r){return await this.send({event:"edit_event",type:t,step_id:r,params:n})}async editGraph(t,n,r,o,i){let a=sy(n);return await this.send({event:"edit_event",type:"graph_edit",step_id:i,params:{graph_id:t,graph_preprocessing:a.graphPreprocessing,graph_creation:a.graphCreation,graph_styling:a.graphStyling,graph_rendering:{height:r,width:o},include_plotlyjs:window.Plotly===void 0}})}async editGraphDelete(t){await this.send({event:"edit_event",type:"graph_delete_edit",step_id:me(),params:{graph_id:t}})}async editGraphDuplicate(t,n){await this.send({event:"edit_event",type:"graph_duplicate_edit",step_id:me(),params:{old_graph_id:t,new_graph_id:n}})}async editGraphRename(t,n){await this.send({event:"edit_event",type:"graph_rename_edit",step_id:me(),params:{graph_id:t,new_graph_tab_name:n}})}async editAddColumn(t,n,r){return await this.send({event:"edit_event",type:"add_column_edit",step_id:me(),params:{sheet_index:t,column_header:n,column_header_index:r}})}async editDeleteColumn(t,n){n=n.filter(r=>r!==void 0),await this.send({event:"edit_event",type:"delete_column_edit",step_id:me(),params:{sheet_index:t,column_ids:n}})}async editDeleteRow(t,n){await this.send({event:"edit_event",type:"delete_row_edit",step_id:me(),params:{sheet_index:t,labels:n}})}async editTranspose(t){await this.send({event:"edit_event",type:"transpose_edit",step_id:me(),params:{sheet_index:t}})}async editOneHotEncoding(t,n){await this.send({event:"edit_event",type:"one_hot_encoding_edit",step_id:me(),params:{sheet_index:t,column_id:n}})}async editResetIndex(t,n){await this.send({event:"edit_event",type:"reset_index_edit",step_id:me(),params:{sheet_index:t,drop:n}})}async editPromoteRowToHeader(t,n){await this.send({event:"edit_event",type:"promote_row_to_header_edit",step_id:me(),params:{sheet_index:t,index:n}})}async editReorderColumn(t,n,r){await this.send({event:"edit_event",type:"reorder_column_edit",step_id:me(),params:{sheet_index:t,column_id:n,new_column_index:r}})}async editDataframeRename(t,n){return await this.send({event:"edit_event",type:"dataframe_rename_edit",step_id:me(),params:{sheet_index:t,new_dataframe_name:n}})}async editFilter(t,n,r,o,i,a){return await this.send({event:"edit_event",type:"filter_column_edit",step_id:a,params:{sheet_index:t,column_id:n,operator:o,filters:r,filter_location:i}})}async editRenameColumn(t,n,r,o){return await this.send({event:"edit_event",type:"rename_column_edit",step_id:me(),params:{sheet_index:t,column_id:n,new_column_header:r,level:o}})}async editColumnHeadersTransform(t){await this.send({event:"edit_event",type:"column_headers_transform_edit",step_id:me(),params:t})}async editDataframeDuplicate(t){await this.send({event:"edit_event",type:"dataframe_duplicate_edit",step_id:me(),params:{sheet_index:t}})}async editDataframeDelete(t){await this.send({event:"edit_event",type:"dataframe_delete_edit",step_id:me(),params:{sheet_index:t}})}async editSetDataframeFormat(t,n){return await this.send({event:"edit_event",type:"set_dataframe_format_edit",step_id:me(),params:{sheet_index:t,df_format:n}})}async editSetColumnFormula(t,n,r,o,i,a){return await this.send({event:"edit_event",type:"set_column_formula_edit",step_id:me(),params:{sheet_index:t,column_id:n,formula_label:r,new_formula:o,index_labels_formula_is_applied_to:i,cell_editor_location:a}})}async editChangeColumnDtype(t,n,r,o){return await this.send({event:"edit_event",type:"change_column_dtype_edit",step_id:o,params:{sheet_index:t,column_ids:n,new_dtype:r}})}async editSimpleImport(t){return await this.send({event:"edit_event",type:"simple_import_edit",step_id:me(),params:{file_names:t}})}async updateUndo(){await this.send({event:"update_event",type:"undo",params:{}})}async updateGoPro(){await this.send({event:"update_event",type:"go_pro",params:{}})}async updateRedo(){await this.send({event:"update_event",type:"redo",params:{}})}async updateClear(){await this.send({event:"update_event",type:"clear",params:{}})}async updateRenderCount(){await this.send({event:"update_event",type:"render_count_update",params:{number_rendered_sheets:document.querySelectorAll(".mito-container").length,jupyterlab_theme:document.body.getAttribute("data-jp-theme-name")||"undefined"}})}async updateReplayAnalysis(t,n,r){return await this.send({event:"update_event",type:"replay_analysis_update",params:{analysis_name:t,args:n,step_import_data_list_to_overwrite:r===void 0?[]:r}})}async updateArgs(t){await this.send({event:"update_event",type:"args_update",params:{args:t}})}async updateCodeOptions(t){await this.send({event:"update_event",type:"code_options_update",params:{code_options:t}})}async updateSignUp(t){await this.send({event:"update_event",type:"set_user_field_update",params:{field:"user_email",value:t}})}async updateExistingImports(t){return await this.send({event:"update_event",type:"update_existing_import_update",params:{updated_step_import_data_list:t}})}async updateManuallyMarkUpgraded(){let t=new Date().getDate()-10,n=new Date;n.setDate(t),await this.send({event:"update_event",type:"set_user_field_update",params:{field:"mitosheet_last_upgraded_date",value:n.toISOString().split("T")[0]}})}async updateAcceptAITransformationPrivacyPolicy(){await this.send({event:"update_event",type:"set_user_field_update",params:{field:"ai_privacy_policy",value:!0}})}async updateCheckoutStepByIndex(t){await this.send({event:"update_event",type:"checkout_step_by_idx_update",params:{step_idx:t}})}async updateUndoToStepIndex(t){await this.send({event:"update_event",type:"undo_to_step_index_update",params:{step_idx:t}})}async updateCloseTour(t){await this.send({event:"update_event",type:"append_user_field_update",params:{field:"received_tours",value:t}})}async updateFeedback(t,n,r){let o={event:"update_event",type:"update_feedback_v2_obj_update",params:{feedback_id:t,num_usages:n,questions_and_answers:r}};r.forEach(i=>{o[i.question]=i.answer}),await this.send(o)}async log(t,n){let r={},o={user_agent:window.navigator.userAgent};n!==void 0?r.params=Object.assign(o,n):r.params=o,r.event="log_event",r.type=t,this.send(r)}};var em=T(_()),Wa=(e,t)=>{let[n,r]=(0,em.useState)(!0);(0,em.useEffect)(()=>{if(n){r(!1);return}e()},[t.updateEventCount])};function n7(e,t,n,r,o,i,a,s){let[l,d]=(0,Ko.useState)(e),[u,c]=(0,Ko.useState)(0),[p,h]=(0,Ko.useState)(void 0),[x,D]=(0,Ko.useState)(void 0),[S,g]=(0,Ko.useState)(!1),y=i||{getBackendFromFrontend:k=>k,getFrontendFromBackend:k=>k};on(()=>{N()},[u],o),Wa(()=>{A()},r);let w=t+"_edit",P=(0,Ko.useCallback)(k=>{d(k),c(L=>L+1)},[]),N=async()=>{if(l===void 0||(a==null?void 0:a.doNotSendDefaultParams)===!0&&u===0)return;let k=y.getBackendFromFrontend(l,s);g(!0);let L=p||me(),E=await n._edit(w,k,L);g(!1),"error"in E?D(E.error):(h(L),D(void 0))},A=async()=>{if(p===void 0){d(e);return}let k=await n.getParams(t,p,{}),L="error"in k?void 0:k.result;d(L!==void 0?y.getFrontendFromBackend(L,s):e),D(void 0)};return{params:l,setParams:P,error:x,loading:S,startNewStep:()=>{h(void 0)}}}var Dn=n7;var tm=T(_());var r7=e=>{let t=e.disabled===!0,n=e.width||"block",r=e.className||"",o=t?"text-button-disabled":"",i=`element-width-${n}`,a=`text-button-variant-${e.variant}`,s=e.disabled&&e.disabledTooltip!==void 0?e.disabledTooltip:void 0,l=s!==void 0?s:e.tooltip;return e.href!==void 0?tm.default.createElement("a",{className:M("text-button",i,a,o,r),href:t?void 0:e.href,download:t?void 0:e.download,onClick:t?()=>{}:e.onClick,target:e.target,title:l},tm.default.createElement("span",{className:M({"text-color-white-important":e.variant==="dark"},"text-overflow-wrap")},e.children)):tm.default.createElement("button",{className:M("text-button",i,a,o),onClick:e.onClick,type:e.type,disabled:e.disabled,autoFocus:e.autoFocus,title:l},e.children)},j=r7;var Ja=T(_());var Py=T(_());var o7=e=>(e.isDropdownSectionSeperator,Py.default.createElement("div",{style:{width:"100%",borderTop:"1px solid #dadce0",paddingBottom:"3px",marginTop:"3px"}})),ve=o7;var zp={boolean_is_true:{long_name:"is true",short_name:"is true"},boolean_is_false:{long_name:"is false",short_name:"is false"}},Xa={number_exactly:{long_name:"=",short_name:"="},number_not_exactly:{long_name:"\u2260",short_name:"\u2260"},greater:{long_name:">",short_name:">"},greater_than_or_equal:{long_name:"\u2265",short_name:"\u2265"},less:{long_name:"<",short_name:"<"},less_than_or_equal:{long_name:"\u2264",short_name:"\u2264"},number_lowest:{long_name:"lowest N values",short_name:"lowest N"},number_highest:{long_name:"highest N values",short_name:"highest N"}},Kp={contains:{long_name:"string contains",short_name:"contains"},string_does_not_contain:{long_name:"string does not contain",short_name:"does not contain"},string_exactly:{long_name:"string is exactly",short_name:"is exactly"},string_not_exactly:{long_name:"string is not exactly",short_name:"is not exactly"},string_starts_with:{long_name:"string starts with",short_name:"starts with"},string_ends_with:{long_name:"string ends with",short_name:"ends with"}},Fl={datetime_exactly:{long_name:"date is exactly",short_name:"="},datetime_not_exactly:{long_name:"date is not exactly",short_name:"!="},datetime_greater:{long_name:"date is after",short_name:">"},datetime_greater_than_or_equal:{long_name:"date is exactly or after",short_name:"\u2265"},datetime_less:{long_name:"date is before",short_name:"<"},datetime_less_than_or_equal:{long_name:"date is exactly or before",short_name:"\u2264"}},$p={empty:{long_name:"is empty",short_name:"is empty"},not_empty:{long_name:"is not empty",short_name:"is not empty"},most_frequent:{long_name:"most frequent N values",short_name:"most frequent N"},least_frequent:{long_name:"least frequent N values",short_name:"least frequent N"}},by=m(m(m(m(m({},zp),Xa),Kp),Fl),$p),nm=["boolean_is_true","boolean_is_false","empty","not_empty"];function Fn(e){return e.filters!==void 0}function ky(e){if(Er(e))return"Sorry, Mito does not support filtering on timedeltas columns currently. Try changing the column dtype to a string and filtering on that instead."}function rm(e){return Li(e)?{condition:"boolean_is_true",value:""}:Zn(e)?{condition:"contains",value:""}:et(e)?{condition:"greater",value:""}:it(e)?{condition:"datetime_exactly",value:""}:{condition:"not_empty",value:""}}function Ny(e,t){let n=Ul(t);return Li(e)?{condition:n?"not_empty":t?"boolean_is_false":"boolean_is_true",value:""}:Zn(e)?{condition:n?"not_empty":"string_not_exactly",value:t}:et(e)?{condition:n?"not_empty":"number_not_exactly",value:t}:it(e)?{condition:n?"not_empty":"datetime_not_exactly",value:t.split(" ")[0]}:{condition:"contains",value:""}}var Zp=e=>(Object.keys(Xa).includes(e.condition)||e.condition==="most_frequent"||e.condition==="least_frequent")&&typeof e.value=="string",Ey=(e,t)=>nm.includes(e.condition)?!0:et(t)?typeof e.value!="string"&&!isNaN(e.value):Zn(t)||it(t)?e.value!=="":!0,Ay=e=>Zp(e)?{condition:e.condition,value:parseFloat(e.value)}:e,om=(e,t)=>e.map(o=>Fn(o)?{filters:o.filters.map(i=>Ay(i)),operator:o.operator}:Ay(o)).map(o=>Fn(o)?{filters:o.filters.filter(i=>Ey(i,t)),operator:o.operator}:o).filter(o=>Fn(o)?o.filters.length>0:Ey(o,t)),My=(e,t)=>{let n=[];return e.forEach(r=>{Fn(r)||(Li(t)?r.condition==="boolean_is_false"?n.push(!0):r.condition==="boolean_is_true"&&n.push(!1):r.condition===i7(t)?n.push(r.value):r.condition==="not_empty"&&n.push("NaN"))}),n},i7=e=>et(e)?"number_not_exactly":Zn(e)?"string_not_exactly":it(e)?"datetime_not_exactly":"",Oy=(e,t)=>{let n=Ul(e.value)||e.value,r=Ul(e.value)||t.value;return n==r&&e.condition===t.condition},Ul=e=>e==="NaN"||e==="nan"||e==="NaT"||e==="nat"||e===null||e===void 0,Ll=(e,t,n)=>{let r=[...e];return Object.entries(t).forEach(([o,i])=>{r.push(Ja.default.createElement(v,{key:o,id:o,title:i[n]}))}),r},Fy=(e,t)=>{let n=[];return(!e||et(e))&&(n=Ll(n,Xa,t),n.push(Ja.default.createElement(ve,{isDropdownSectionSeperator:!0}))),(!e||Zn(e))&&(n=Ll(n,Kp,t),n.push(Ja.default.createElement(ve,{isDropdownSectionSeperator:!0}))),(!e||Li(e))&&(n=Ll(n,zp,t),n.push(Ja.default.createElement(ve,{isDropdownSectionSeperator:!0}))),(!e||it(e))&&(n=Ll(n,Fl,t),n.push(Ja.default.createElement(ve,{isDropdownSectionSeperator:!0}))),n=Ll(n,$p,t),n};var Zo=T(_());var Ly=["pivot","merge","concat","drop_duplicates","import files","download","split_text_to_columns","fill_na","melt","set_dataframe_format","SnowflakeImport","Excel Range Import","Export To File","Column Headers Transform","UserDefinedImport"],Yp=["pivot","merge","concat","drop_duplicates","import files","split_text_to_columns","fill_na","melt","set_dataframe_format","ConditionalFormatting","UpdateImports","SnowflakeImport","Excel Range Import","AITransformation","Column Headers Transform","UserDefinedImport"];var Uy=T(_());var a7=e=>Uy.default.createElement("div",{className:"default-taskpane-div"},e.children),Y=a7;var za=T(_());var $o=T(_());var s7=e=>{let t=()=>{var n;(n=e.mitoAPI)==null||n.log("clicked_upgrade",{feature:e.featureName})};return(0,$o.useEffect)(()=>{let n=e.proOrEnterprise==="Pro"?"prompted_pro_upgrade":"prompted_enterprise_upgrade";e.mitoAPI.log(n,{feature:e.featureName})},[]),$o.default.createElement("div",null,$o.default.createElement(I,{justify:"space-between",align:"center"},$o.default.createElement("p",{className:"text-body-1"},e.message||`This is a Mito ${e.proOrEnterprise} feature. To access all Mito ${e.proOrEnterprise} functionality, please upgrade.`)),$o.default.createElement(I,{justify:"center"},$o.default.createElement(j,{href:"https://trymito.io/plans",target:"_blank",variant:"dark",width:"large",onClick:t},"Upgrade to Mito ",e.proOrEnterprise)))},qp=s7;var l7=e=>{var r,o,i,a;let t=!((r=e.userProfile)!=null&&r.isPro)&&e.requiresPro!==void 0,n=!((o=e.userProfile)!=null&&o.isEnterprise)&&e.requiresEnterprise!==void 0;return za.default.createElement(za.default.Fragment,null,!((i=e.userProfile)!=null&&i.isPro)&&e.requiresPro!==void 0&&za.default.createElement(qp,{message:e.requiresPro.message,proOrEnterprise:"Pro",mitoAPI:e.requiresPro.mitoAPI,featureName:e.requiresPro.featureName}),!((a=e.userProfile)!=null&&a.isEnterprise)&&e.requiresEnterprise!==void 0&&za.default.createElement(qp,{message:e.requiresEnterprise.message,proOrEnterprise:"Enterprise",mitoAPI:e.requiresEnterprise.mitoAPI,featureName:e.requiresEnterprise.featureName}),za.default.createElement("div",{className:M("default-taskpane-body-div",{"default-taskpane-body-div-no-scroll":e.noScroll,"default-taskpane-body-disabled":t||n}),ref:e.setRef},e.children))},q=l7;var mr=T(_());var Qp=T(_()),d7=e=>Qp.default.createElement("svg",{width:e.width||"24",height:"16",viewBox:"0 0 24 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Qp.default.createElement("path",{d:"M0.292892 7.29289C-0.0976315 7.68342 -0.0976315 8.31658 0.292892 8.70711L6.65685 15.0711C7.04738 15.4616 7.68054 15.4616 8.07107 15.0711C8.46159 14.6805 8.46159 14.0474 8.07107 13.6569L2.41421 8L8.07107 2.34315C8.46159 1.95262 8.46159 1.31946 8.07107 0.928932C7.68054 0.538408 7.04738 0.538408 6.65685 0.928932L0.292892 7.29289ZM24 7L1 7V9L24 9V7Z",fill:"#494650"})),im=d7;var u7=e=>mr.default.createElement("div",{className:"default-taskpane-header-div"},mr.default.createElement(I,{suppressTopBottomMargin:!0},mr.default.createElement(C,{span:23},typeof e.header!="string"&&e.header,typeof e.header=="string"&&mr.default.createElement("div",{className:"default-taskpane-header-and-back-button"},e.backCallback!==void 0&&mr.default.createElement("div",{onClick:e.backCallback,className:"mt-5px mr-10px"},mr.default.createElement(im,null)),mr.default.createElement("p",{className:"text-header-2 text-overflow-hide"},e.header))),mr.default.createElement(C,{span:1},!e.notCloseable&&mr.default.createElement("div",{className:"default-taskpane-header-exit-button-div",onClick:()=>{e.callbackOnClose&&e.callbackOnClose(),e.setUIState(t=>f(m({},t),{currOpenTaskpane:{type:"none"}}))}},mr.default.createElement(at,null))))),Q=u7;var m7=e=>{let t=()=>{e.setUIState(n=>f(m({},n),{currOpenTaskpane:{type:"import files"}}))};return Zo.default.createElement(Y,null,Zo.default.createElement(Q,{header:e.header!==void 0?e.header:"Import data first",setUIState:e.setUIState}),Zo.default.createElement(q,null,Zo.default.createElement("p",{className:M("text-body-1","text-overflow-wrap",{"text-color-error":e.errorMessage}),style:{whiteSpace:"pre-wrap"}},e.message?e.message:"Before performing that action, you need to import data into Mito.",e.suppressImportLink!==!0&&Zo.default.createElement(Zo.default.Fragment,null," ",Zo.default.createElement("span",{className:"text-body-1-link",onClick:t},"Click here to import data.")))))},ge=m7;var He=T(_());var Ee=T(_());var Ri=T(_()),Ka=e=>e.nonEmpty?Ri.default.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ri.default.createElement("path",{d:"M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z",fill:"#9D6CFF",stroke:"#9D6CFF",strokeMiterlimit:"10",strokeLinecap:"round"})):e.purpleOrDark==="dark"?Ri.default.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ri.default.createElement("path",{d:"M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z",stroke:"#343434",strokeWidth:"0.9909",strokeMiterlimit:"10",strokeLinecap:"round"})):Ri.default.createElement("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ri.default.createElement("path",{d:"M12.681 1H1.31902C1.0608 1 0.90821 1.31983 1.0608 1.55011L5.72061 8.58635V13L8.27939 11.8614V8.6887L12.9392 1.55011C13.0918 1.30704 12.9392 1 12.681 1Z",stroke:"var(--mito-purple)",strokeWidth:"0.9909",strokeMiterlimit:"10",strokeLinecap:"round"}));var be=T(_());var co=T(_());var lt=T(_());var By=T(_()),am=(e,t,n)=>{(0,By.useEffect)(()=>{let r=new ResizeObserver(()=>{e()}),o=document.getElementById(n);return o&&r.observe(o),()=>{r.disconnect()}},[...t,n])};var Bl=(e,t,n,r,o,i,a)=>{let s=(o==null?void 0:o.formula)||G(t),l=G(t);if(s!==l){let d=oo(e)?void 0:Uu(e,-1);a.editRenameColumn(r,n,s,d),i(u=>u.currOpenTaskpane.type!=="control_panel"?f(m({},u),{currOpenTaskpane:{type:"none"}}):u)}};var cr=e=>{e&&e.focus()};var Ky=T(_());var sm=[{function:"ABS",description:"Returns the absolute value of the passed number or series.",search_terms:["abs","absolute value"],examples:["ABS(-1.3)","ABS(A)"],syntax:"ABS(value)",syntax_elements:[{element:"value",description:"The value or series to take the absolute value of."}]},{function:"AND",description:"Returns True if all of the provided arguments are True, and False if any of the provided arguments are False.",search_terms:["and","&","if","conditional"],examples:["AND(True, False)","AND(Nums > 100, Nums < 200)","AND(Pay > 10, Pay < 20, Status == 'active')"],syntax:"AND(boolean_condition1, [boolean_condition2, ...])",syntax_elements:[{element:"boolean_condition1",description:"An expression or series that returns True or False values. See IF documentation for a list of conditons."},{element:"boolean_condition2 ... [OPTIONAL]",description:"An expression or series that returns True or False values. See IF documentation for a list of conditons."}]},{function:"AVG",description:"Returns the numerical mean value of the passed numbers and series.",search_terms:["avg","average","mean"],examples:["AVG(1, 2)","AVG(A, B)","AVG(A, 2)"],syntax:"AVG(value1, [value2, ...])",syntax_elements:[{element:"value1",description:"The first number or series to consider when calculating the average."},{element:"value2, ... [OPTIONAL]",description:"Additional numbers or series to consider when calculating the average."}]},{function:"BOOL",description:"Converts the passed arguments to boolean values, either True or False. For numberic values, 0 converts to False while all other values convert to True.",search_terms:["bool","boolean","true","false","dtype","convert"],examples:["BOOL(Amount_Payed)","AND(BOOL(Amount_Payed), Is_Paying)"],syntax:"BOOL(series)",syntax_elements:[{element:"series",description:"An series to convert to boolean values, either True or False."}]},{function:"CLEAN",description:"Returns the text with the non-printable ASCII characters removed.",search_terms:["clean","trim","remove"],examples:["CLEAN(A)"],syntax:"CLEAN(string)",syntax_elements:[{element:"string",description:"The string or series whose non-printable characters are to be removed."}]},{function:"CONCAT",description:"Returns the passed strings and series appended together.",search_terms:["&","concatenate","append","combine"],examples:["CONCAT('Bite', 'the bullet')","CONCAT(A, B)"],syntax:"CONCAT(string1, [string2, ...])",syntax_elements:[{element:"string1",description:"The first string or series."},{element:"string2, ... [OPTIONAL]",description:"Additional strings or series to append in sequence."}]},{function:"CORR",description:"Computes the correlation between two series, excluding missing values.",search_terms:["corr","correlation","r^2"],examples:["=CORR(A, B)","=CORR(B, A)"],syntax:"CORR(series_one, series_two)",syntax_elements:[{element:"series_one",description:"The number series to convert to calculate the correlation."},{element:"series_two",description:"The number series to convert to calculate the correlation."}]},{function:"DATEVALUE",description:"Converts a given string to a date series.",search_terms:["datevalue","date value","date","string to date","datetime","dtype","convert"],examples:["DATEVALUE(date_column)","DATEVALUE('2012-12-22')"],syntax:"DATEVALUE(date_string)",syntax_elements:[{element:"date_string",description:"The date string to turn into a date object."}]},{function:"DAY",description:"Returns the day of the month that a specific date falls on, as a number.",search_terms:["day","date"],examples:["DAY(date_column)","DAY('2012-12-22')"],syntax:"DAY(date)",syntax_elements:[{element:"date",description:"The date or date series to get the day of."}]},{function:"ENDOFBUSINESSMONTH",description:"Given a date, returns the end of the buisness month. E.g. the last weekday.",search_terms:["business","month","eom","eobm","date","workday","end"],examples:["ENDOFBUSINESSMONTH(date_column)","ENDOFBUSINESSMONTH('2012-12-22')"],syntax:"ENDOFBUSINESSMONTH(date)",syntax_elements:[{element:"date",description:"The date or date series to get the end of the business month of."}]},{function:"ENDOFMONTH",description:"Given a date, returns the end of the month, as a date. E.g. input of 12-22-1997 will return 12-31-1997.",search_terms:["month","eom","date","workday","end","eomonth"],examples:["ENDOFMONTH(date_column)","ENDOFMONTH('2012-12-22')"],syntax:"ENDOFMONTH(date)",syntax_elements:[{element:"date",description:"The date or date series to get the last day of the month of."}]},{function:"EXP",description:"Returns e, the base of the natural logarithm, raised to the power of passed series.",search_terms:["exp","exponent","log","natural log"],examples:["=EXP(data)","=EXP(A)"],syntax:"EXP(series)",syntax_elements:[{element:"series",description:"The series to raise e to."}]},{function:"FILLNAN",description:"Replaces the NaN values in the series with the replacement value.",search_terms:["fillnan","nan","fill nan","missing values","null","null value","fill null"],examples:["FILLNAN(A, 10)","FILLNAN(A, 'replacement')"],syntax:"FILLNAN(series, replacement)",syntax_elements:[{element:"series",description:"The series to replace the NaN values in."},{element:"replacement",description:"A string, number, or date to replace the NaNs with."}]},{function:"FIND",description:"Returns the position at which a string is first found within text, case-sensitive. Returns 0 if not found.",search_terms:["find","search"],examples:["FIND(A, 'Jack')","FIND('Ben has a friend Jack', 'Jack')"],syntax:"FIND(text_to_search, search_for)",syntax_elements:[{element:"text_to_search",description:"The text or series to search for the first occurrence of search_for."},{element:"search_for",description:"The string to look for within text_to_search."}]},{function:"FLOAT",description:"Converts a string series to a float series. Any values that fail to convert will return NaN.",search_terms:["number","to number"],examples:["=FLOAT(Prices_string)","=FLOAT('123.123')"],syntax:"FLOAT(string_series)",syntax_elements:[{element:"string_series",description:"The series or string to convert to a float."}]},{function:"GETNEXTVALUE",description:"Returns the next value from series that meets the condition.",search_terms:["ffill"],examples:["GETNEXTVALUE(Max_Balances, Max_Balances > 0)"],syntax:"GETNEXTVALUE(series, condition)",syntax_elements:[{element:"series",description:"The series to get the next value from."},{element:"condition",description:"When condition is True, a new previous value is set, and carried backwards until the condition is True again."}]},{function:"GETPREVIOUSVALUE",description:"Returns the value from series that meets the condition.",search_terms:["ffill"],examples:["GETPREVIOUSVALUE(Max_Balances, Max_Balances > 0)"],syntax:"GETPREVIOUSVALUE(series, condition)",syntax_elements:[{element:"series",description:"The series to get the previous value from."},{element:"condition",description:"When condition is True, a new previous value is set, and carried forward until the condition is True again."}]},{function:"HOUR",description:"Returns the hour component of a specific date, as a number.",search_terms:["hour","hr"],examples:["HOUR(date_column)","HOUR('2012-12-22 09:45:00')"],syntax:"HOUR(date)",syntax_elements:[{element:"date",description:"The date or date series to get the hour of."}]},{function:"IF",description:"Returns one value if the condition is True. Returns the other value if the conditon is False.",search_terms:["if","conditional","and","or"],examples:["IF(Status == 'success', 1, 0)","IF(Nums > 100, 100, Nums)","IF(AND(Grade >= .6, Status == 'active'), 'pass', 'fail')"],syntax:"IF(boolean_condition, value_if_true, value_if_false)",syntax_elements:[{element:"boolean_condition",description:"An expression or series that returns True or False values. Valid conditions for comparison include ==, !=, >, <, >=, <=."},{element:"value_if_true",description:"The value the function returns if condition is True."},{element:"value_if_false",description:"The value the function returns if condition is False."}]},{function:"INT",description:"Converts a string series to a int series. Any values that fail to convert will return 0.",search_terms:["number","to integer"],examples:["=INT(Prices_string)","=INT('123')"],syntax:"INT(string_series)",syntax_elements:[{element:"string_series",description:"The series or string to convert to a int."}]},{function:"KURT",description:"Computes the unbiased kurtosis, a measure of tailedness, of a series, excluding missing values.",search_terms:["kurtosis"],examples:["=KURT(A)","=KURT(A * B)"],syntax:"KURT(series)",syntax_elements:[{element:"series",description:"The series to calculate the unbiased kurtosis of."}]},{function:"LEFT",description:"Returns a substring from the beginning of a specified string.",search_terms:["left"],examples:["LEFT(A, 2)","LEFT('The first character!')"],syntax:"LEFT(string, [number_of_characters])",syntax_elements:[{element:"string",description:"The string or series from which the left portion will be returned."},{element:"number_of_characters [OPTIONAL, 1 by default]",description:"The number of characters to return from the start of string."}]},{function:"LEN",description:"Returns the length of a string.",search_terms:["length","size"],examples:["LEN(A)","LEN('This is 21 characters')"],syntax:"LEN(string)",syntax_elements:[{element:"string",description:"The string or series whose length will be returned."}]},{function:"LOG",description:"Calculates the logarithm of the passed series with an optional base.",search_terms:["log","logarithm","natural log"],examples:["LOG(10) = 1","LOG(100, 10) = 2"],syntax:"LOG(series, [base])",syntax_elements:[{element:"series",description:"The series to take the logarithm of."},{element:"base [OPTIONAL]",description:"The base of the logarithm to use. Defaults to 10 if no base is passed."}]},{function:"LOWER",description:"Converts a given string to lowercase.",search_terms:["lowercase","uppercase"],examples:["=LOWER('ABC')","=LOWER(A)","=LOWER('Nate Rush')"],syntax:"LOWER(string)",syntax_elements:[{element:"string",description:"The string or series to convert to lowercase."}]},{function:"MAX",description:"Returns the maximum value among the passed arguments.",search_terms:["max","maximum","minimum"],examples:["MAX(10, 11)","MAX(Old_Data, New_Data)"],syntax:"MAX(value1, [value2, ...])",syntax_elements:[{element:"value1",description:"The first number or column to consider for the maximum value."},{element:"value2, ... [OPTIONAL]",description:"Additional numbers or columns to compute the maximum value from."}]},{function:"MID",description:"Returns a segment of a string.",search_terms:["middle"],examples:["MID(A, 2, 2)","MID('Some middle characters!', 3, 4)"],syntax:"MID(string, starting_at, extract_length)",syntax_elements:[{element:"string",description:"The string or series to extract the segment from."},{element:"starting_at",description:"The index from the left of string from which to begin extracting."},{element:"extract_length",description:"The length of the segment to extract."}]},{function:"MIN",description:"Returns the minimum value among the passed arguments.",search_terms:["min","minimum","maximum"],examples:["MIN(10, 11)","MIN(Old_Data, New_Data)"],syntax:"MIN(value1, [value2, ...])",syntax_elements:[{element:"value1",description:"The first number or column to consider for the minumum value."},{element:"value2, ... [OPTIONAL]",description:"Additional numbers or columns to compute the minumum value from."}]},{function:"MINUTE",description:"Returns the minute component of a specific date, as a number.",search_terms:["minute","min"],examples:["MINUTE(date_column)","MINUTE('2012-12-22 09:45:00')"],syntax:"MINUTE(date)",syntax_elements:[{element:"date",description:"The date or date series to get the minute of."}]},{function:"MONTH",description:"Returns the month that a specific date falls in, as a number.",search_terms:["month","date"],examples:["MONTH(date_column)","MONTH('2012-12-22')"],syntax:"MONTH(date)",syntax_elements:[{element:"date",description:"The date or date series to get the month of."}]},{function:"MULTIPLY",description:"Returns the product of two numbers.",search_terms:["mulitply","product"],examples:["MULTIPLY(2,3)","MULTIPLY(A,3)"],syntax:"MULTIPLY(factor1, [factor2, ...])",syntax_elements:[{element:"factor1",description:"The first number to multiply."},{element:"factor2, ... [OPTIONAL]",description:"Additional numbers or series to multiply."}]},{function:"OR",description:"Returns True if any of the provided arguments are True, and False if all of the provided arguments are False.",search_terms:["or","if","conditional"],examples:["OR(True, False)","OR(Status == 'success', Status == 'pass', Status == 'passed')"],syntax:"OR(boolean_condition1, [boolean_condition2, ...])",syntax_elements:[{element:"boolean_condition1",description:"An expression or series that returns True or False values. See IF documentation for a list of conditons."},{element:"boolean_condition2 ... [OPTIONAL]",description:"An expression or series that returns True or False values. See IF documentation for a list of conditons."}]},{function:"POWER",description:"The POWER function can be used to raise a number to a given power.",search_terms:["power","raise","exponent","square","cube"],examples:["POWER(4, 1/2)","POWER(Dose, 2)"],syntax:"POWER(value, exponent)",syntax_elements:[{element:"value",description:"Number to raise to a power."},{element:"exponent",description:"The number to raise value to."}]},{function:"PROPER",description:"Capitalizes the first letter of each word in a specified string.",search_terms:["proper","capitalize"],examples:["=PROPER('nate nush')","=PROPER(A)"],syntax:"PROPER(string)",syntax_elements:[{element:"string",description:"The value or series to convert to convert to proper case."}]},{function:"QUARTER",description:"Returns the quarter (1-4) that a specific date falls in, as a number.",search_terms:["quarter"],examples:["QUARTER(date_column)","QUARTER('2012-12-22')"],syntax:"QUARTER(date)",syntax_elements:[{element:"date",description:"The date or date series to get the quarter of."}]},{function:"RIGHT",description:"Returns a substring from the beginning of a specified string.",search_terms:[],examples:["RIGHT(A, 2)","RIGHT('The last character!')"],syntax:"RIGHT(string, [number_of_characters])",syntax_elements:[{element:"string",description:"The string or series from which the right portion will be returned."},{element:"number_of_characters [OPTIONAL, 1 by default]",description:"The number of characters to return from the end of string."}]},{function:"ROUND",description:"Rounds a number to a given number of decimals.",search_terms:["round","decimal","integer"],examples:["ROUND(1.3)","ROUND(A, 2)"],syntax:"ROUND(value, [decimals])",syntax_elements:[{element:"value",description:"The value or series to round."},{element:"decimals",description:" The number of decimals to round to. Default is 0."}]},{function:"SECOND",description:"Returns the seconds component of a specific date, as a number.",search_terms:["second","sec"],examples:["SECOND(date_column)","SECOND('2012-12-22 09:23:05')"],syntax:"SECOND(date)",syntax_elements:[{element:"date",description:"The date or date series to get the seconds of."}]},{function:"SKEW",description:"Computes the skew of a series, excluding missing values.",search_terms:[],examples:["=SKEW(A)","=SKEW(A * B)"],syntax:"SKEW(series)",syntax_elements:[{element:"series",description:"The series to calculate the skew of."}]},{function:"STARTOFBUSINESSMONTH",description:"Given a date, returns the most recent start of the business month, as a state. E.g. the first weekday.",search_terms:["business","month","SOM","SOBM","date","start"],examples:["STARTOFBUSINESSMONTH(date_column)","STARTOFBUSINESSMONTH('2012-12-22 09:23:05')"],syntax:"STARTOFBUSINESSMONTH(date)",syntax_elements:[{element:"date",description:"The date or date series to get the most recent beginning of month business day of."}]},{function:"STARTOFMONTH",description:"Given a date, returns the start of the month, as a date. E.g. input of 12-22-1997 will return 12-1-1997.",search_terms:["month","SOM","date","start"],examples:["STARTOFMONTH(date_column)","STARTOFMONTH('2012-12-22 09:23:05')"],syntax:"STARTOFMONTH(date)",syntax_elements:[{element:"date",description:"The date or date series to get the first day of the month of."}]},{function:"STDEV",description:"Computes the standard deviation of a series, excluding missing values.",search_terms:["standard","deviation","standard","distribution"],examples:["=STDEV(A)","=STDEV(A * B)"],syntax:"STDEV(series)",syntax_elements:[{element:"series",description:"The series to calculate the standard deviation of."}]},{function:"STRIPTIMETODAYS",description:"Returns the date with a seconds, minutes, and hours component of 00:00:00.",search_terms:["time","date","days","strip"],examples:["STRIPTIMETODAYS(date_column)","STRIPTIMETODAYS('2012-12-22 09:23:05')"],syntax:"STRIPTIMETODAYS(date)",syntax_elements:[{element:"date",description:"The date or date series to reset the seconds, minutes, and hours component of."}]},{function:"STRIPTIMETOHOURS",description:"Returns the date with a seconds and minutes component of 00:00.",search_terms:["time","date","hours","strip"],examples:["STRIPTIMETOHOURS(date_column)","STRIPTIMETOHOURS('2012-12-22 09:23:05')"],syntax:"STRIPTIMETOHOURS(date)",syntax_elements:[{element:"date",description:"The date or date series to reset the seconds and minutes component of."}]},{function:"STRIPTIMETOMINUTES",description:"Returns the date with a seconds component of 00.",search_terms:["time","date","minutes","strip"],examples:["STRIPTIMETOMINUTES(date_column)","STRIPTIMETOMINUTES('2012-12-22 09:23:05')"],syntax:"STRIPTIMETOMINUTES(date)",syntax_elements:[{element:"date",description:"The date or date series to reset the seconds component of."}]},{function:"STRIPTIMETOMONTHS",description:"Returns the date adjusted to the start of the month.",search_terms:["time","date","months","strip"],examples:["STRIPTIMETOMONTHS(date_column)","STRIPTIMETOMONTHS('2012-12-22 09:23:05')"],syntax:"STRIPTIMETOMONTHS(date)",syntax_elements:[{element:"date",description:"The date or date series to reset the seconds, minutes, hours, and days of."}]},{function:"STRIPTIMETOYEARS",description:"Returns the date adjusted to the start of the year.",search_terms:["time","date","years","strip"],examples:["STRIPTIMETOYEARS(date_column)","STRIPTIMETOYEARS('2012-12-22 09:23:05')"],syntax:"STRIPTIMETOYEARS(date)",syntax_elements:[{element:"date",description:"The date or date series to reset the seconds, minutes, hours, days, and month components of."}]},{function:"SUBSTITUTE",description:"Replaces existing text with new text in a string.",search_terms:["replace","find and replace"],examples:["SUBSTITUTE('Better great than never', 'great', 'late')","SUBSTITUTE(A, 'dog', 'cat')"],syntax:"SUBSTITUTE(text_to_search, search_for, replace_with, [count])",syntax_elements:[{element:"text_to_search",description:"The text within which to search and replace."},{element:"search_for",description:" The string to search for within text_to_search."},{element:"replace_with",description:"The string that will replace search_for."},{element:"count",description:"The number of times to perform the substitute. Default is all."}]},{function:"SUM",description:"Returns the sum of the given numbers and series.",search_terms:["add"],examples:["SUM(10, 11)","SUM(A, B, D, F)","SUM(A, B, D, F)"],syntax:"SUM(value1, [value2, ...])",syntax_elements:[{element:"value1",description:"The first number or column to add together."},{element:"value2, ... [OPTIONAL]",description:"Additional numbers or columns to sum."}]},{function:"SUMPRODUCT",description:"Returns the sum of the product of the passed arguments.",search_terms:["sum product","sumproduct","sum","product","weighted average"],examples:["SUMPRODUCT(A:A, B:B)","SUMPRODUCT(A:B)"],syntax:"SUMPRODUCT(array1, [array2, ...])",syntax_elements:[{element:"array1",description:"The first array argument whose components you want to multiply and then add."},{element:"value2, ... [OPTIONAL]",description:"Additional series to multiply then add."}]},{function:"TEXT",description:"Turns the passed series into a string.",search_terms:["string","dtype"],examples:["=TEXT(Product_Number)","=TEXT(Start_Date)"],syntax:"TEXT(series)",syntax_elements:[{element:"series",description:"The series to convert to a string."}]},{function:"TRIM",description:"Returns a string with the leading and trailing whitespace removed.",search_terms:["trim","whitespace","spaces"],examples:["=TRIM(' ABC')","=TRIM(' ABC ')","=TRIM(A)"],syntax:"TRIM(string)",syntax_elements:[{element:"string",description:"The value or series to remove the leading and trailing whitespace from."}]},{function:"TYPE",description:"Returns the type of each element of the passed series. Return values are 'number', 'str', 'bool', 'datetime', 'object', or 'NaN'.",search_terms:["type","dtype"],examples:["TYPE(Nums_and_Strings)","IF(TYPE(Account_Numbers) != 'NaN', Account_Numbers, 0)"],syntax:"TYPE(series)",syntax_elements:[{element:"series",description:"The series to get the type of each element of."}]},{function:"UPPER",description:"Converts a given string to uppercase.",search_terms:["uppercase","capitalize"],examples:["=UPPER('abc')","=UPPER(A)","=UPPER('Nate Rush')"],syntax:"UPPER(string)",syntax_elements:[{element:"string",description:"The string or series to convert to uppercase."}]},{function:"VALUE",description:"Converts a string series to a number series. Any values that fail to convert will return an NaN.",search_terms:["number","to number","dtype","convert","parse"],examples:["=VALUE(A)","=VALUE('123')"],syntax:"VALUE(string)",syntax_elements:[{element:"string",description:"The string or series to convert to a number."}]},{function:"VAR",description:"Computes the variance of a series, excluding missing values.",search_terms:["variance"],examples:["=VAR(A)","=VAR(A - B)"],syntax:"VAR(series)",syntax_elements:[{element:"series",description:"The series to calculate the variance of."}]},{function:"WEEK",description:"Returns the week (1-52) of a specific date, as a number.",search_terms:["week","1","52"],examples:["WEEK(date_column)","WEEK('2012-12-22 09:23:05')"],syntax:"WEEK(date)",syntax_elements:[{element:"date",description:"The date or date series to get the week of."}]},{function:"WEEKDAY",description:"Returns the day of the week that a specific date falls on. 1-7 corresponds to Monday-Sunday.",search_terms:["weekday","monday","tuesday","wednesday","thursday","friday","saturday","sunday"],examples:["WEEKDAY(date_column)","WEEKDAY('2012-12-22')"],syntax:"WEEKDAY(date)",syntax_elements:[{element:"date",description:"The date or date series to get the weekday of."}]},{function:"YEAR",description:"Returns the day of the year that a specific date falls in, as a number.",search_terms:["year","date"],examples:["YEAR(date_column)","YEAR('2012-12-22')"],syntax:"YEAR(date)",syntax_elements:[{element:"date",description:"The date or date series to get the month of."}]}];function lm(e,t){let r=(lm.canvas||(lm.canvas=document.createElement("canvas"))).getContext("2d");if(!r)throw new Error("Could not get context from canvas");return r.font=t,r.measureText(e).width}var e1=(e,t)=>{let n=[];return e.forEach(r=>{let[[o,i],[a,s]]=Xy(r,t);o===void 0&&i===void 0&&a===void 0&&s===void 0||(i===void 0&&s===void 0&&o!==void 0&&a!==void 0?n.push(G(o)+":"+G(a)):o==a&&i==s&&o!==void 0&&i!==void 0?n.push(G(o)+G(i)):o!==void 0&&i!==void 0&&a!==void 0&&s!==void 0&&n.push(G(o)+G(i)+":"+G(a)+G(s)))}),n.join(", ")},fr=(e,t,n)=>{if(t===void 0||t.selections.length===0)return e;let r=e1(t.selections,n),o=e.substring(0,t.inputSelectionStart),i=e.substring(t.inputSelectionEnd);return o+r+i},Hy=e=>{let t=e==null?void 0:e.querySelector(".cell-editor-input");if(t===null)return{selectionStart:0,selectionEnd:0};let n=t;return{selectionStart:n.selectionStart||0,selectionEnd:n.selectionEnd||0}},c7=["Enter","F2"],mo=(e,t,n,r,o)=>{if(t!==void 0&&t.columnIndex===r)return{startingColumnFormula:t.formula,arrowKeysScrollInFormula:!0,editingMode:t.editingMode};let{columnFormula:i,columnHeader:a,columnFormulaLocation:s}=st(e,n,r);if(a===void 0)return{startingColumnFormula:"",arrowKeysScrollInFormula:!1,editingMode:"entire_column"};let l="";n<=-1?a===void 0?l="":oo(a)?l=G(a):l=G(a[Uu(a,n)]):i===void 0||i===""?l="="+G(a):l=i,o!==void 0&&!c7.includes(o.key)&&(o.key==="Backspace"?l=l.substr(0,l.length-1):l=o.key);let d=`=${G(a)}`;return l===d?{startingColumnFormula:"",arrowKeysScrollInFormula:!1,editingMode:"entire_column"}:{startingColumnFormula:l,arrowKeysScrollInFormula:!0,editingMode:s||"entire_column"}},Gy=(e,t)=>{let n=e.toLowerCase(),r=t.data.map(i=>G(i.columnHeader).toLowerCase()),o=!1;return r.forEach(i=>{let a=n.lastIndexOf(i);if(a!==-1){let s=n.substring(a);t.index.forEach(l=>{s===G(l).toLowerCase()&&(o=!0)})}}),o},Vy=(e,t)=>{let n=t.data.map(o=>[o.columnID,G(o.columnHeader)]),r=Math.min(Math.max(...n.map(([,o])=>o.length),e.length),50);for(let o=r;o>0;o--){let i=e.substring(e.length-o).toLowerCase(),a=e[e.length-o-1];if(i===""||a&&a.match(/^[0-9a-z]+$/i))continue;let l=n.filter(([,d])=>d.toLowerCase().startsWith(i)).map(([d,u])=>{let c=t.columnDtypeMap[d],p=c===void 0?"series":c+" series";return[u,`A ${p} in your dataset`]});if(l.length>0)return[i.length,l]}return[0,[]]},jy=(e,t,n)=>{if(e.length===0){let i=sm.filter(s=>s.function==="LEFT"||s.function==="DAY"||s.function==="VALUE"),a=i[0];return i[0]=i[1],i[1]=a,[0,i.map(s=>[s.function,s.description])]}let r=sm.map(i=>({function:i.function,description:i.description,search_terms:i.search_terms})).concat(n.userDefinedFunctions.map(i=>({function:i,description:"User-defined function",search_terms:[i]}))),o=Math.max(...r.map(i=>i.function.length));for(let i=o;i>t-1;i--){let a=e.substring(e.length-i).toLowerCase(),s=e[e.length-i-1];if(a===""||s&&s.match(/^[0-9a-z]+$/i))continue;let d=r.filter(u=>{if(u.function.toLowerCase().startsWith(a))return!0;for(let c=0;c[u.function,u.description]);if(d.length>0)return[a.length,d]}return[0,[]]},Ry=(e,t)=>{let n=e.substring(0,t||void 0).lastIndexOf("(");if(n===-1)return;let r="";for(let i=n-1;i>=0;i--){let a=e[i].toLowerCase();if(a.match(/^[a-z]+$/i))r+=a;else break}r=r.split("").reverse().join("").toLowerCase();let o=sm.filter(i=>i.function.toLowerCase()===r);if(o.length===1)return o[0]},f7=(e,t,n)=>{if(t===void 0)return;let r=e.indexOf(t);if(r===-1)return;let o=r-n;return e[o]},t1=(e,t,n)=>{let r="";return!e||!n||e.frontend_formula.forEach(o=>{if(o.type==="string part")r+=o.string;else if(o.type==="{HEADER}")r+=o.display_column_header;else{let i=f7(e.index,t,o.row_offset);i!==void 0?(r+=o.display_column_header,r+=G(i)):r+="0"}}),r},um=(e,t)=>{let n=dm,r=lm(e,"11px system-ui")+10;return t==="cell"?Math.min(Math.max(dm,r),Wy):(n=dm,n)};var Hl=(e,t=void 0)=>{if(e===void 0)return{widthArray:[],widthSumArray:[],totalWidth:0};let n=new Array(e.numColumns),r=new Array(e.numColumns);for(let o=0;oo+i,0)}},r1=(e,t,n,r)=>{let o=[...t[e].widthArray];o[n]=r;let i=[...t[e].widthSumArray];for(let s=n;ss+l,0);return t[e]={widthArray:o,widthSumArray:i,totalWidth:a},t},Jy=(e,t,n)=>{if(n.length===0)return[Hl(void 0)];let r=[];for(let o=0;o{let r={};if(e!==void 0&&t!==void 0)for(let o=0;o{let r=n.length*10+15,o=Math.max(...e.data[t].columnData.map(i=>String(i).length))*8;return Math.max(r,o)},zy=(e,t,n)=>{let r=t.widthDataArray;return e.forEach(o=>{let i=st(n,-1,o).columnHeader;if(i===void 0)return;let a=G(i),s=h7(n,o,a);r=r1(t.sheetIndex,r,o,s)}),r};var o1=(e,t,n)=>t<=e&&e<=n;function $a(...e){for(let t=0;t({sheetIndex:t,viewport:{width:0,height:0},scrollPosition:{scrollLeft:0,scrollTop:0},selections:[{startingColumnIndex:0,endingColumnIndex:0,startingRowIndex:-1,endingRowIndex:-1}],copiedSelections:[],widthDataArray:e.length===0?[Hl(void 0)]:e.map(n=>Hl(n)),columnIDsArray:Gl(e)}),i1=(e,t)=>{let n="str";return Ui(e)?n="float":Dl(e)?n="int":it(e)?n="date":Er(e)?n="time":Li(e)&&(n="bool"),Ky.default.createElement("p",{className:M("text-subtext-1",{"text-color-mito-purple-important":t==="purple"},{"text-color-gray-important":t==="dark"})},n)},st=(e,t,n)=>{var D,S;let r=(D=e==null?void 0:e.data[n])==null?void 0:D.columnID,o=(S=e==null?void 0:e.data[n])==null?void 0:S.columnHeader,i=r!==void 0?e==null?void 0:e.index[t]:void 0,a=r!==void 0?e==null?void 0:e.data[n].columnDtype:void 0,s=r!==void 0?e!==void 0?e==null?void 0:e.columnFormulasMap[r]:[]:[],l,d;s.length!==0&&s.forEach(g=>{g.location.type==="entire_column"?(l=t1(g,i,e),d="entire_column"):i!==void 0&&g.location.index_labels.includes(i)&&(l=t1(g,i,e),d="specific_index_labels")});let u=r!==void 0?e==null?void 0:e.columnFiltersMap[r]:void 0,c=r!==void 0?e==null?void 0:e.data[n].columnData[t]:void 0,p=r!==void 0?e==null?void 0:e.dfFormat.columns[r]:void 0,h=r!==void 0?e==null?void 0:e.dfFormat.headers.backgroundColor:void 0,x=r!==void 0?e==null?void 0:e.dfFormat.headers.color:void 0;return{columnID:r,columnHeader:o,columnFormula:l,columnFormulaLocation:d,columnDtype:a,columnFilters:u,cellValue:c,columnFormat:p,headerBackgroundColor:h,headerTextColor:x,indexLabel:i}},Gl=e=>e.map(t=>t.data.map(n=>n.columnID))||[];var yt=e=>e.length!==0,pr=(e,t,n)=>{var r;return e!==void 0&&((r=n[t])==null?void 0:r.columnDtypeMap[e])!==void 0},a1=(e,t)=>{let n=t[e];return n!==void 0&&n.numRows>0&&n.numColumns>0},mm=e=>e.selectedTabType==="graph"&&e.selectedGraphID!==void 0,Vl=(e,t)=>e.selectedTabType==="data"&&t.length!==0,Zy=(e,t)=>{if(e===null)return;let n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),o=parseInt(e.slice(5,7),16);return t?"rgba("+n+", "+r+", "+o+", "+t+")":"rgb("+n+", "+r+", "+o+")"};var g7=e=>{if(e===void 0)return!1;let t=e.getBoundingClientRect(),n=t.left+2,r=t.right-2,o=t.top+2,i=t.bottom-2,a=document.elementFromPoint(n,o)===e,s=document.elementFromPoint(r,o)===e,l=document.elementFromPoint(n,i)===e,d=document.elementFromPoint(r,i)===e;return!!(a&&s&&l&&d)},s1=(e,t)=>{if(e===null)return[];let n=e.querySelectorAll(t);if(n===void 0)return[];let r=[];return n.forEach(o=>{r.push(o)}),r},l1=(e,t)=>{let n=s1(e,t);for(let r=0;r{if(e.sheetIndex>=e.widthDataArray.length)return{startingRowIndex:-1,numRowsRendered:0,startingColumnIndex:0,numColumnsRendered:0};let t=!1,n=0,r=0;for(let o=0;oe.scrollPosition.scrollLeft&&(n=o,t=!0),t&&i>e.scrollPosition.scrollLeft+e.viewport.width){r=o-n+1;break}else o===e.widthDataArray[e.sheetIndex].widthArray.length-1&&(r=o-n+1)}return{startingRowIndex:Math.max(Math.floor(e.scrollPosition.scrollTop/Or),0),numRowsRendered:Math.ceil(e.viewport.height/Or)+3,startingColumnIndex:n,numColumnsRendered:r}},Za=e=>{let t=Ln(e);return{x:e.scrollPosition.scrollLeft-(t.startingColumnIndex===0?0:e.widthDataArray[e.sheetIndex].widthSumArray[t.startingColumnIndex-1]),y:e.scrollPosition.scrollTop%Or}},Yy=(e,t,n,r)=>{let o=t.width-n.width,i=t.height-n.height,a=t.width<((r==null?void 0:r.clientWidth)||0),s=t.height<((r==null?void 0:r.clientHeight)||0),l=e.target;if(l===null)return;let{scrollLeft:d,scrollTop:u}=l,c=d,p=u;return d>=o&&!a?c=o-1:a&&(c=0),u>=i&&!s?p=i:s&&(p=0),{scrollLeft:c||0,scrollTop:p||0}},d1=(e,t)=>e===null?!1:l1(e,`[mito-row-index="${t}"]`),u1=(e,t)=>e===null?!1:l1(e,`[mito-col-index="${t}"][mito-row-index]`),qy=(e,t)=>{if(e===null)return;let n=e.querySelectorAll(`[mito-row-index="${t}"]`);if(!(n===void 0||n.length===0))return n[0]},Qy=(e,t)=>{if(e===null)return;let n=e.querySelectorAll(`[mito-col-index="${t}"]`);if(!(n===void 0||n.length===0))return n[0]};var e3=(e,t,n,r)=>{if(r===-1||t===null)return;let o=t.scrollTop;d1(e,r)||(r<=n.startingRowIndex?o=r*Or:o=(r+1)*Or-t.clientHeight),t.scrollTop=o},t3=(e,t,n,r,o)=>{var s,l;if(o===-1||t===null)return;let i=t.scrollLeft;u1(e,o)||(o<=n.startingColumnIndex?i=((s=r.widthDataArray[r.sheetIndex])==null?void 0:s.widthSumArray[o-1])||0:i=((l=r.widthDataArray[r.sheetIndex])==null?void 0:l.widthSumArray[o])-t.clientWidth||0),t.scrollLeft=i},Ya=(e,t,n,r,o,i)=>{let a=!o1(o,n.startingRowIndex-2,n.startingRowIndex+n.numRowsRendered+1),s=!o1(i,n.startingColumnIndex-2,n.startingColumnIndex+n.numColumnsRendered+1),l=a||s,d=d1(e,o),u=u1(e,i);d||(l?setTimeout(()=>e3(e,t,n,o),25):e3(e,t,n,o)),u||(l?setTimeout(()=>t3(e,t,n,r,i),50):t3(e,t,n,r,i))};var Be=T(_());var Wi=T(_()),y7=()=>{let[e,t]=(0,Wi.useState)(1);(0,Wi.useEffect)(()=>{let r=setInterval(()=>{t(o=>o+1)},500);return()=>clearInterval(r)},[]);let n=".".repeat(e%4);return Wi.default.createElement(Wi.default.Fragment,null,n)},Yo=y7;var m1=4,n3=(e,t,n,r,o,i)=>{let a=fr(t.formula,t.pendingSelections,e),s=Gy(a,e),[l,d]=Vy(t.formula,e),[u,c]=jy(t.formula,l,i),p=Ry(a,n);if(r!==void 0)return{type:"error",error:r};if(o)return{type:"loading"};if(!s&&(d.length>0||c.length>0))return{type:"suggestions",suggestedColumnHeaders:d,suggestedColumnHeadersReplacementLength:l,suggestedFunctions:c,suggestedFunctionsReplacementLength:u};if(p!==void 0&&t.pendingSelections===void 0)return{type:"documentation",documentationFunction:p}},S7=e=>{var s;let{columnID:t,columnHeader:n,indexLabel:r}=st(e.sheetData,e.editorState.rowIndex,e.editorState.columnIndex);if(t===void 0||n===void 0||r===void 0)return Be.default.createElement(Be.default.Fragment,null);let o=e.displayedDropdownType,i=fr(e.editorState.formula,e.editorState.pendingSelections,e.sheetData),a=um(i,e.editorState.editorLocation);return Be.default.createElement("div",{className:"cell-editor-dropdown-box",style:{width:`${a}px`}},(o==null?void 0:o.type)!=="error"&&e.editorState.rowIndex!=-1&&Be.default.createElement(I,{justify:"space-between",align:"center",className:"cell-editor-label"},Be.default.createElement("p",{className:M("text-subtext-1","pl-5px","mt-2px"),title:e.editorState.editingMode==="entire_column"?"You are currently editing the entire column. Setting a formula will change all values in the column.":"You are currently editing a specific cell. Changing this value will only effect this cell."},"Edit entire column"),Be.default.createElement(Ut,{className:"mr-5px",value:e.editorState.editingMode==="entire_column",onChange:()=>{e.setEditorState(l=>{if(l===void 0)return;let d=m({},l).editingMode;return f(m({},l),{editingMode:d==="entire_column"?"specific_index_labels":"entire_column"})})},height:"20px"})),(o==null?void 0:o.type)!=="error"&&e.editorState.rowIndex==-1&&Be.default.createElement("p",{className:M("text-subtext-1","pl-5px","mt-2px"),title:"You are currently editing the column header."},"Edit column header"),(o==null?void 0:o.type)==="error"&&Be.default.createElement("div",{className:"cell-editor-error-container pl-10px pr-5px pt-5px pb-5px"},Be.default.createElement("p",{className:"text-body-1 text-color-error"},o.error),Be.default.createElement("p",{className:"text-subtext-1"},"Press Escape to close the cell editor.")),(o==null?void 0:o.type)==="loading"&&Be.default.createElement("p",{className:"text-body-2 pl-5px"},"Processing",Be.default.createElement(Yo,null)),(o==null?void 0:o.type)==="suggestions"&&Be.default.createElement(Be.default.Fragment,null,o.suggestedColumnHeaders.concat(o.suggestedFunctions).map(([l,d],u)=>{if(u>m1)return Be.default.createElement(Be.default.Fragment,null);let c=u===e.selectedSuggestionIndex,p=M("cell-editor-suggestion","text-body-2",{"cell-editor-suggestion-selected":c});return Be.default.createElement("div",{onMouseEnter:()=>e.setSavedSelectedSuggestionIndex(u),onClick:()=>{e.takeSuggestion(u)},className:p,key:l},Be.default.createElement("span",{className:"text-overflow-hide",title:l},l),c&&Be.default.createElement("div",{className:M("cell-editor-suggestion-subtext","text-subtext-1")},d))})),(o==null?void 0:o.type)==="documentation"&&Be.default.createElement("div",null,Be.default.createElement("div",{className:"cell-editor-function-documentation-header pt-5px pb-10px pl-10px pr-10px"},Be.default.createElement("p",{className:"text-body-2"},o.documentationFunction.syntax),Be.default.createElement("p",{className:"text-subtext-1"},o.documentationFunction.description)),Be.default.createElement("div",{className:"pt-5px pb-10px pr-10px pl-10px"},Be.default.createElement("p",{className:"text-subtext-1"},"Examples"),(s=o.documentationFunction.examples)==null?void 0:s.map((l,d)=>Be.default.createElement("p",{key:d,className:"cell-editor-function-documentation-example"},l)))))},r3=S7;var dm=250,Wy=500;var C7=e=>{let t=e.split(` @@ -14,17 +14,17 @@ ${o}`}function Y6(e){let t=e.split(/\r?\n/).filter(n=>n.trim().length>0);return `&&p(W=>W+=11)},L=async b=>{if(b.preventDefault(),r!==-1){w(r),o(-1);return}let F=e.sheetData.data[e.editorState.columnIndex].columnID,J=e.sheetData.data[e.editorState.columnIndex].columnHeader,K=fr(e.editorState.formula,e.editorState.pendingSelections,e.sheetData),W=e.sheetData.index[e.editorState.rowIndex];a(!0);let z;if(e.editorState.rowIndex==-1){let Se=Ba(J).finalColumnHeader;Bl(J,Se,F,e.sheetIndex,e.editorState,e.setUIState,e.mitoAPI)}else{let Se=e.editorState.editingMode==="specific_index_labels"&&D!=null?{type:"specific_index_labels",index_labels:[D]}:{type:"entire_column"};z=await e.mitoAPI.editSetColumnFormula(e.sheetIndex,F,W,K,Se,e.editorState.editorLocation)}a(!1),z!==void 0&&"error"in z?l(z.error):(y(),e.closeOpenEditingPopups())};return lt.default.createElement("div",{className:"cell-editor"},lt.default.createElement("form",{className:"cell-editor-form",onSubmit:L,autoComplete:"off"},e.editorState.editorLocation==="cell"&<.default.createElement("input",{ref:S,id:"cell-editor-input",className:"cell-editor-input",onClick:A,value:t.replace(/\t/g,""),onKeyDown:P,onChange:N,autoComplete:"off"}),e.editorState.editorLocation==="formula bar"&<.default.createElement("textarea",{ref:S,id:"cell-editor-input",className:"cell-editor-input",style:{resize:"vertical",maxHeight:`${c}px`,height:`${c}px`,marginTop:0},onClick:A,value:t,autoComplete:"off",spellCheck:"false",onKeyUp:b=>{if(b.key=="Enter"&&b.shiftKey){k(` `);return}},onKeyDown:b=>{if(b.key==="Enter")if(b.metaKey){k(` `);return}else{b.preventDefault(),L(b);return}if(b.key==="Tab")if(b.preventDefault(),r!==-1)w(r),o(-1);else{k(" ");return}(g==null?void 0:g.type)==="suggestions"&&(b.key==="ArrowUp"||b.key==="ArrowDown")&&b.preventDefault(),P(b)},onChange:N})),lt.default.createElement(r3,{sheetData:e.sheetData,sheetIndex:e.sheetIndex,editorState:e.editorState,setEditorState:e.setEditorState,cellEditorInputRef:n,selectedSuggestionIndex:r,setSavedSelectedSuggestionIndex:o,takeSuggestion:w,displayedDropdownType:g}))},cm=I7;var x7=e=>{var p,h;let t=e.selection.startingRowIndex,n=e.selection.startingColumnIndex,{columnHeader:r,columnFormula:o,cellValue:i,columnFormulaLocation:a}=st(e.sheetData,t,n),s=""+(o!==void 0&&o!==""?o:i!==void 0?i:""),l=e.editorState===void 0?void 0:st(e.sheetData,e.editorState.rowIndex,e.editorState.columnIndex),d=e.editorState===void 0?r:l==null?void 0:l.columnHeader,u="";e.editorState===void 0?t==-1&&r!==void 0?u=G(r):u=s:u=fr(e.editorState.formula,e.editorState.pendingSelections,e.sheetData);let c=Ln(e.gridState);return co.default.createElement(I,{align:"center",suppressTopBottomMargin:!0,className:"formula-bar"},co.default.createElement(C,{offset:.5},co.default.createElement("p",{className:"formula-bar-column-header text-header-3 text-overflow-hide"},d)),co.default.createElement(C,null,co.default.createElement("div",{className:"formula-bar-vertical-line"})),co.default.createElement(C,{flex:"1"},((p=e.editorState)==null?void 0:p.editorLocation)==="formula bar"&&co.default.createElement(cm,{sheetData:e.sheetData,sheetIndex:e.sheetIndex,gridState:e.gridState,editorState:e.editorState,setEditorState:e.setEditorState,setGridState:e.setGridState,setUIState:e.setUIState,scrollAndRenderedContainerRef:e.scrollAndRenderedContainerRef,containerRef:e.containerRef,mitoAPI:e.mitoAPI,currentSheetView:c,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData}),((h=e.editorState)==null?void 0:h.editorLocation)!=="formula bar"&&co.default.createElement("div",{className:"formula-bar-formula text-header-3 text-overflow-hide element-width-block",onClick:()=>{e.setEditorState({rowIndex:t,columnIndex:n,formula:u,arrowKeysScrollInFormula:!0,editorLocation:"formula bar",editingMode:a||"entire_column"})}},u)))},o3=x7;var vn=T(_());var w7=e=>{let t=(0,vn.useRef)(null),[n,r]=(0,vn.useState)(void 0),[o,i]=(0,vn.useState)(void 0);(0,vn.useEffect)(()=>{if(o!==void 0){let d=setInterval(()=>{var u;(u=e.scrollAndRenderedContainerRef.current)==null||u.scrollBy({left:o})},10);return()=>{clearInterval(d)}}},[e.scrollAndRenderedContainerRef,o]);let a=Ln(e.gridState),l={transform:`translateX(${-Za(e.gridState).x}px)`};return vn.default.createElement(vn.default.Fragment,null,e.sheetData.numColumns>0&&vn.default.createElement("div",{className:M("endo-column-headers-container",{"endo-column-headers-no-operation":n===void 0,"endo-column-headers-resizing":n==="resize"}),ref:t,onDragOver:d=>{var c,p,h;d.preventDefault(),d.persist();let u=d.clientX-(((c=t.current)==null?void 0:c.getBoundingClientRect().left)||0);if(u<100){let x=1-u/100;i(-25*x)}else if(u>(((p=t.current)==null?void 0:p.getBoundingClientRect().width)||0)-100){let x=1-((((h=t.current)==null?void 0:h.getBoundingClientRect().width)||0)-u)/100;i(25*x)}else i(void 0)},onDrop:d=>{d.preventDefault(),i(void 0);let u=d.clientX,c=d.clientY,p=d.dataTransfer.getData("operation"),h=d.dataTransfer.getData("mito-col-index");if(p===""||h==="")return;let x=parseInt(h);if(p==="resize"){let D=s1(e.containerRef.current,`.endo-column-header-container[mito-col-index="${x}"]`);if(D.length===0)return;let S=D[0],g=Math.max(d.clientX-S.getBoundingClientRect().left,a3);e.setGridState(y=>f(m({},y),{widthDataArray:r1(e.sheetIndex,e.gridState.widthDataArray,x,g)}))}else if(p==="reorder"){let D=x,{columnIndex:S}=f1(u,c),g=e.sheetData.data[D].columnID;if(x===S||S===void 0||g===void 0)return;e.mitoAPI.editReorderColumn(e.sheetIndex,g,S),e.setUIState(y=>f(m({},y),{currOpenTaskpane:{type:"none"}})),e.setGridState(y=>f(m({},y),{selection:f(m({},y.selections),{startingColumnIndex:S,endingColumnIndex:S})}))}},onMouseLeave:()=>{i(void 0)},onMouseUp:()=>{i(void 0)}},vn.default.createElement("div",{style:l},Array(a.numColumnsRendered).fill(0).map((d,u)=>{let c=a.startingColumnIndex+u;return vn.default.createElement(s3,{key:c,columnIndex:c,sheetData:e.sheetData,gridState:e.gridState,setGridState:e.setGridState,editorState:e.editorState,setEditorState:e.setEditorState,containerRef:e.containerRef,columnHeaderOperation:n,setColumnHeaderOperation:r,uiState:e.uiState,setUIState:e.setUIState,mitoAPI:e.mitoAPI,closeOpenEditingPopups:e.closeOpenEditingPopups})}))))},i3=vn.default.memo(w7);var an=T(_());var pm=e=>an.default.createElement("div",{className:"endo-grid-empty-container"},an.default.createElement("div",{className:"endo-grid-empty-text-container"},e.children)),T7=e=>an.default.createElement(an.default.Fragment,null,e.sheetData===void 0&&an.default.createElement(pm,null,an.default.createElement("div",null,an.default.createElement(j,{variant:"dark",width:"medium",onClick:()=>{e.setUIState(t=>f(m({},t),{currOpenTaskpane:{type:"import files"}})),e.mitoAPI.log("clicked_empty_grid_import_button")},disabled:e.uiState.currOpenTaskpane.type==="import files"||e.uiState.currOpenTaskpane.type==="Excel Range Import"||e.uiState.currOpenTaskpane.type==="UpdateImports"&&e.uiState.currOpenTaskpane.failedReplayData!==void 0||e.sendFunctionStatus!=="finished"},"Import Files")),an.default.createElement("p",{className:"mt-5px text-body-1",style:{textAlign:"center"}},"Or import dfs using the syntax ",an.default.createElement("code",null,"mitosheet.sheet(df1, df2)")," in the code above.")),e.sheetData!==void 0&&e.sheetData.numRows===0&&e.sheetData.numColumns===0&&an.default.createElement(pm,null,an.default.createElement("p",{className:"text-body-1",style:{textAlign:"center"}},"No data in dataframe.")),e.sheetData!==void 0&&e.sheetData.numRows>0&&e.sheetData.numColumns===0&&an.default.createElement(pm,null,an.default.createElement("p",{className:"text-body-1",style:{textAlign:"center"}},"No columns in dataframe.")),e.sheetData!==void 0&&e.sheetData.numRows===0&&e.sheetData.numColumns>0&&an.default.createElement(pm,null,an.default.createElement("p",{className:"text-body-1",style:{textAlign:"center"}},"No rows in dataframe."))),l3=T7;var qa=T(_());var Pn=T(_());var p1=T(_()),_7=()=>p1.default.createElement("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},p1.default.createElement("path",{d:"M10.0608 0.805159C10.2802 0.402958 10.8246 0.324565 11.1485 0.64852V0.64852C11.3582 0.858224 11.4095 1.17891 11.2756 1.44354L5.57867 12.705C5.26247 13.3301 4.41824 13.4447 3.94677 12.9267L0.628074 9.28008C0.18803 8.79655 0.522012 8.01982 1.17566 8.00657V8.00657C1.38287 8.00237 1.58284 8.08284 1.72939 8.22939L3.55497 10.055C4.02704 10.527 4.82029 10.4128 5.13997 9.82672L10.0608 0.805159Z",fill:"#494650"})),Xi=_7;var hm="You must have at least one number column selected to adjust the formatting.",d3=(e,t)=>e.toLocaleString("en-US",{minimumFractionDigits:t,maximumFractionDigits:t}),qo=(e,t,n)=>{if(typeof e!="number")return""+e;let r=n==null?void 0:n.type,o=n==null?void 0:n.precision;switch(o===void 0&&(Ui(t)&&(o=2),Dl(t)&&(o=0)),(o||0)>20&&(o=20),r){case void 0:return d3(e,o);case"plain text":return d3(e,o).replace(/,/g,"");case"percentage":return e.toLocaleString("en-US",{style:"percent",minimumFractionDigits:o,maximumFractionDigits:o});case"currency":return e.toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:o,maximumFractionDigits:o});case"accounting":return e.toLocaleString("en-US",{style:"currency",currency:"USD",currencySign:"accounting",minimumFractionDigits:o,maximumFractionDigits:o});case"scientific notation":return e.toExponential(o)}},u3=(e,t)=>t&&Ui(t)&&e.precision===void 0?f(m({},e),{precision:3}):f(m({},e),{precision:(e.precision||0)+1}),m3=(e,t)=>t&&Ui(t)&&e.precision===void 0?f(m({},e),{precision:1}):f(m({},e),{precision:Math.max((e.precision||0)-1,0)}),D7=async(e,t,n,r,o)=>{let i=m({},(t==null?void 0:t.dfFormat)||Ji());n.forEach(a=>{if(r===void 0)i.columns[a]=r;else{let s=i.columns[a]||{};i.columns[a]=m(m({},s),r)}}),await o.editSetDataframeFormat(e,i)},gm=(e,t,n,r,o)=>{let i=h1(t,n),a=t==null?void 0:t.dfFormat.columns[i[0]];return v7(l=>{o(),D7(e,t,n,l,r)},i.length===0,a)},v7=(e,t,n)=>[Pn.default.createElement(v,{key:"Default",title:"Default",icon:(n==null?void 0:n.type)===void 0?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:void 0}),rightText:"1,234.6",disabled:t}),Pn.default.createElement(v,{key:Qn({type:"plain text"}),title:Qn({type:"plain text"}),icon:(n==null?void 0:n.type)==="plain text"?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:"plain text"}),rightText:"1234.6",disabled:t}),Pn.default.createElement(ve,{isDropdownSectionSeperator:!0,key:"sep"}),Pn.default.createElement(v,{key:Qn({type:"currency"}),title:Qn({type:"currency"}),icon:(n==null?void 0:n.type)==="currency"?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:"currency"}),rightText:"$-1,234.57",disabled:t}),Pn.default.createElement(v,{key:Qn({type:"accounting"}),title:Qn({type:"accounting"}),icon:(n==null?void 0:n.type)==="accounting"?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:"accounting"}),rightText:"($1,234.57)",disabled:t}),Pn.default.createElement(v,{key:Qn({type:"percentage"}),title:Qn({type:"percentage"}),icon:(n==null?void 0:n.type)==="percentage"?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:"percentage"}),rightText:"123,457.00%",disabled:t}),Pn.default.createElement(v,{key:Qn({type:"scientific notation"}),title:Qn({type:"scientific notation"}),icon:(n==null?void 0:n.type)==="scientific notation"?Pn.default.createElement(Xi,null):void 0,onClick:()=>e({type:"scientific notation"}),rightText:"1.23e+3",disabled:t})],Qn=e=>{if(e===void 0)return"Default";switch(e.type){case void 0:return"Default";case"plain text":return"Plain Text";case"percentage":return"Percentage";case"currency":return"Currency";case"accounting":return"Accounting";case"scientific notation":return"Scientific Notation"}};var f3=(e,t,n)=>{let r=e.selectedSheetIndex,o=n[r];if(o===void 0)return;let i=o.dfName,a=y3(t.selections,o),s=S3(t.selections,o);return{selected_df_name:i,selected_column_headers:a,selected_index_labels:s}},g1=30,c3=100,p3=(e,t)=>{var i;let n=g1+(e.split(` -`).length-1)*14,r=((i=t.current)==null?void 0:i.scrollHeight)||0,o=Math.max(n,r);return e===""||oc3?c3:o},ym=(e,t,n)=>{var i;let r=((i=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:i.column_recon.created_columns)||[],o=(t==null?void 0:t.created_dataframe_names)||[];return r.includes(e)||o.includes(n.dfName)},h3=(e,t,n)=>{var o;return Object.values(((o=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:o.column_recon.modified_columns)||{}).includes(G(e))},g3=(e,t,n)=>{var o;return Object.values(((o=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:o.column_recon.renamed_columns)||{}).includes(G(e))};var y1="#F5F5F5",Rl="#FFFFFF",Qo="#494650",Fr="#494650",P7=e=>{var s,l,d,u,c,p,h,x,D,S,g,y;let t=Ln(e.gridState),n=e.sheetData,r=((d=(l=(s=n==null?void 0:n.dfFormat)==null?void 0:s.rows)==null?void 0:l.even)==null?void 0:d.backgroundColor)||y1,o=((p=(c=(u=n==null?void 0:n.dfFormat)==null?void 0:u.rows)==null?void 0:c.odd)==null?void 0:p.backgroundColor)||Rl,i=((D=(x=(h=n==null?void 0:n.dfFormat)==null?void 0:h.rows)==null?void 0:x.even)==null?void 0:D.color)||Qo,a=((y=(g=(S=n==null?void 0:n.dfFormat)==null?void 0:S.rows)==null?void 0:g.odd)==null?void 0:y.color)||Fr;return qa.default.createElement(qa.default.Fragment,null,n&&n.numRows>0&&Array(t.numRowsRendered).fill(0).map((w,P)=>{let N=t.startingRowIndex+P,A=Gl([n])[0],k=M("mito-grid-row",{"mito-grid-row-even":N%2===0,"mito-grid-row-odd":N%2!==0}),L=N%2===0?{backgroundColor:r,color:i}:{backgroundColor:o,color:a};return qa.default.createElement("div",{className:k,key:N,style:L},Array(t.numColumnsRendered).fill(0).map((E,b)=>{var Id,xd,Te,Dt,xt,pt,Zr,Ci;let F=t.startingColumnIndex+b,J=A[F],K=(xd=(Id=e.sheetData)==null?void 0:Id.data[F])==null?void 0:xd.columnDtype,W=((Te=e.sheetData)==null?void 0:Te.index[N])!==void 0?(Dt=e.sheetData)==null?void 0:Dt.index[N]:0,z=n.dfFormat.columns[J],Se=(pt=(xt=e.sheetData)==null?void 0:xt.data[F])==null?void 0:pt.columnData[N],nt=Un(e.gridState.selections,N,F),Kr=(Ci=(Zr=e.sheetData)==null?void 0:Zr.data[F])==null?void 0:Ci.columnHeader,$r=n==null?void 0:n.conditionalFormattingResult.results[J],It=$r?m({},$r[W]):void 0;if(nt&&(It==null?void 0:It.backgroundColor)!==void 0&&(It==null?void 0:It.backgroundColor)!==null&&(It.backgroundColor=Zy(It.backgroundColor,.4)),Se===void 0||K===void 0||Kr===void 0)return null;let ir=ym(Kr,e.uiState.dataRecon,n),Si=h3(Kr,e.uiState.dataRecon,n),Cd=M("mito-grid-cell","text-unselectable",{"mito-grid-cell-selected":nt,"mito-grid-cell-conditional-format-background-color":(It==null?void 0:It.backgroundColor)!==void 0,"mito-grid-cell-hidden":e.editorState!==void 0&&e.editorState.rowIndex===N&&e.editorState.columnIndex===F,"right-align-number-series":et(K),"recon created-recon-background-color":ir&&N%2!==0,"recon created-recon-background-color-dark":ir&&N%2===0,"recon modified-recon-background-color":Si&&N%2!==0,"recon modified-recon-background-color-dark":Si&&N%2===0}),ws=e.gridState.widthDataArray[e.gridState.sheetIndex].widthArray[F],Ts=qo(Se,K,z);return qa.default.createElement("div",{className:Cd,key:F,style:m(m({width:`${ws}px`},Qa(e.gridState.selections,e.gridState.copiedSelections,N,F,n.numRows)),It||{}),tabIndex:-1,"mito-col-index":F,"mito-row-index":N,title:Ts},Ts)}))}))},C3=qa.default.memo(P7);var Lr=T(_());var fo=T(_());function S1(e){return(0,fo.useEffect)(()=>{e.display&&e.mitoAPI.log("opened_index_header_dropdown")},[e.display]),fo.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setOpenIndexHeaderDropdown(void 0),width:"medium"},fo.default.createElement(v,{title:"Delete Rows",onClick:()=>{e.mitoAPI.editDeleteRow(e.sheetIndex,po(e.selections,e.sheetData))}}),fo.default.createElement(v,{title:"Promote Row to Header",onClick:()=>{e.mitoAPI.editPromoteRowToHeader(e.sheetIndex,e.index)}}),fo.default.createElement(ve,{isDropdownSectionSeperator:!0}),fo.default.createElement(v,{title:"Reset and Drop Index",onClick:()=>{e.mitoAPI.editResetIndex(e.sheetIndex,!0)}}),fo.default.createElement(v,{title:"Reset Index",onClick:()=>{e.mitoAPI.editResetIndex(e.sheetIndex,!1)}}))}var b7=e=>{let[t,n]=(0,Lr.useState)(void 0),r=Ln(e.gridState),i={transform:`translateY(${-Za(e.gridState).y}px)`};return Lr.default.createElement(Lr.default.Fragment,null,Lr.default.createElement("div",{className:"endo-index-headers-container"},e.sheetData.numRows>0&&Lr.default.createElement("div",{style:i},Array(r.numRowsRendered).fill(0).map((a,s)=>{let l=r.startingRowIndex+s,d=Un(e.gridState.selections,l,-1),u=M("index-header-container","text-overflow-hide","text-unselectable",{"index-header-selected":d}),c=l>=e.sheetData.numRows?"":e.sheetData.index[l];return Lr.default.createElement("div",{className:u,key:l,title:c+"",tabIndex:-1,"mito-row-index":l,"mito-col-index":-1,style:m({},Qa(e.gridState.selections,e.gridState.copiedSelections,l,-1,e.sheetData.numRows)),onContextMenu:p=>{p.preventDefault(),p.stopPropagation(),n(l)}},c,Lr.default.createElement(S1,{sheetData:e.sheetData,setOpenIndexHeaderDropdown:n,display:t===l,index:c,mitoAPI:e.mitoAPI,sheetIndex:e.sheetIndex,selections:e.gridState.selections,closeOpenEditingPopups:e.closeOpenEditingPopups}))}))))},I3=Lr.default.memo(b7);var ho=T(_());var E7=e=>{let[t,n]=(0,ho.useState)({top:0,left:0,display:"none"}),r=Ln(e.gridState),{columnID:o,columnHeader:i}=st(e.sheetData,e.editorState.rowIndex,e.editorState.columnIndex),a=fr(e.editorState.formula,e.editorState.pendingSelections,e.sheetData),s=um(a,e.editorState.editorLocation);return(0,ho.useEffect)(()=>{let l=()=>{var N;let d=(N=e.scrollAndRenderedContainerRef.current)==null?void 0:N.getBoundingClientRect();if(d===void 0)return;let u=qy(e.scrollAndRenderedContainerRef.current,e.editorState.rowIndex),c=u==null?void 0:u.getBoundingClientRect(),p=Qy(e.scrollAndRenderedContainerRef.current,e.editorState.columnIndex),h=p==null?void 0:p.getBoundingClientRect(),x,D,S,g,y=i===void 0||oo(i)?45:45+(i.length-1)*25,w=c?c.y:e.editorState.rowIndex=d.height-50&&(x=void 0,S=0);let P=h?h.x:e.editorState.columnIndex=d.width&&(D=void 0,g=0),!(x===t.top&&D===t.left&&S===t.bottom&&g===t.right)&&n({top:x,left:D,bottom:S,right:g,display:void 0})};return setTimeout(l),Ft.addEventListener("fullscreenchange",l),()=>Ft.removeEventListener("fullscreenchange",l)},[s]),o===void 0||i===void 0?ho.default.createElement(ho.default.Fragment,null):ho.default.createElement("div",{className:"floating-cell-editor",style:f(m({},t),{width:`${s}px`})},ho.default.createElement(cm,{sheetData:e.sheetData,sheetIndex:e.sheetIndex,gridState:e.gridState,editorState:e.editorState,setEditorState:e.setEditorState,setGridState:e.setGridState,setUIState:e.setUIState,scrollAndRenderedContainerRef:e.scrollAndRenderedContainerRef,containerRef:e.containerRef,mitoAPI:e.mitoAPI,currentSheetView:r,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData}))},x3=E7;var n1=123,Or=25,a3=50,Wl=1500,c1=["Shift","Meta","Alt","Control","CapsLock","NumLock","PageUp","PageDown","Unidentified"],A7=["c","z","y"];function k7(e){var E;let t=(0,be.useRef)(null),n=(0,be.useRef)(null),[r,o]=(0,be.useState)(!1),[i]=(0,be.useState)(()=>new ResizeObserver(()=>{w()})),{sheetDataArray:a,sheetIndex:s,gridState:l,setGridState:d,editorState:u,setEditorState:c,uiState:p,setUIState:h,mitoAPI:x}=e,D=a[s],S={width:((E=l.widthDataArray[l.sheetIndex])==null?void 0:E.totalWidth)||0,height:Or*Math.min((D==null?void 0:D.numRows)||0,Wl)},g=(0,be.useMemo)(()=>Ln(l),[l]),y=(0,be.useMemo)(()=>Za(l),[l]);(0,be.useEffect)(()=>{d(b=>f(m({},b),{selections:v3(b.sheetIndex,s,b.selections,b.columnIDsArray[b.sheetIndex],D),widthDataArray:Jy(b.widthDataArray,b.columnIDsArray,a),columnIDsArray:Gl(a),sheetIndex:s,copiedSelections:[]}))},[D,d,s]);let w=()=>{d(b=>{let F=n==null?void 0:n.current;if(F){let J={width:F.clientWidth,height:F.clientHeight};return f(m({},b),{viewport:J})}return b})},P=(0,be.useCallback)(b=>{b!==null&&(n.current=b,i.observe(b))},[]);(0,be.useEffect)(()=>()=>{i.disconnect()},[]);let N=b=>{let F=Yy(b,S,l.viewport,n.current);F!==void 0&&d(J=>f(m({},J),{scrollPosition:F}))},A=b=>{var F,J;if(u!==void 0){let{rowIndex:K,columnIndex:W}=es(b);if(u.rowIndex===-1&&(K!==u.rowIndex||W!==u.columnIndex))return;if(W!==void 0&&(D==null?void 0:D.data[W])!==void 0){let z=u.editorLocation==="cell"?t.current:e.mitoContainerRef.current,{selectionStart:Se,selectionEnd:nt}=Hy(z),Kr=$a((F=u.pendingSelections)==null?void 0:F.inputSelectionStart,Se),$r=$a((J=u.pendingSelections)==null?void 0:J.inputSelectionEnd,nt),It=[{startingRowIndex:K!==void 0?K:-1,endingRowIndex:K!==void 0?K:-1,startingColumnIndex:W,endingColumnIndex:W}];return d(ir=>f(m({},ir),{selections:It})),c(f(m({},u),{pendingSelections:{selections:It,inputSelectionStart:Kr,inputSelectionEnd:$r},arrowKeysScrollInFormula:!1}))}return}else{cr(t.current),o(!0);let{rowIndex:K,columnIndex:W}=es(b);if(K===void 0||W===void 0||b.button===2&&Un(l.selections,K,W))return;if(b.metaKey||b.ctrlKey){if(b.shiftKey)d(z=>{let Se=[...z.selections];return Se.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),f(m({},z),{selections:Se})});else if(K===-1)Un(l.selections,-1,W)?d(z=>f(m({},z),{selections:P3(z.selections,W)})):d(z=>{let Se=[...z.selections];return Se.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),f(m({},z),{selections:Se})});else if(Un(e.gridState.selections,K,W))d(z=>f(m({},z),{selections:[{startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}]}));else{let z=[...l.selections];z.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),d(Se=>f(m({},Se),{selections:z}))}return}else if(b.shiftKey){let z=[...l.selections];z[z.length-1]=Sm(z[z.length-1],K,W),d(Se=>f(m({},Se),{selections:z}))}else d(z=>f(m({},z),{selections:[{startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}]}));W===-1&&h(z=>z.currOpenTaskpane.type==="control_panel"?f(m({},z),{currOpenTaskpane:{type:"none"}}):z)}},k=b=>{if(u!==void 0)return;cr(t.current),o(!1);let{rowIndex:F,columnIndex:J}=es(b);if(b.shiftKey||b.metaKey||b.button===2&&F&&J&&Un(l.selections,F,J))return;let K=Sm(l.selections[l.selections.length-1],F,J),W=[...l.selections];W[W.length-1]=K,D3(K,l.selections[l.selections.length-1])||d(z=>f(m({},z),{selections:W}))};(0,be.useEffect)(()=>{if(r){let b=J=>{let{rowIndex:K,columnIndex:W}=es(J);d(z=>{let Se=Sm(z.selections[z.selections.length-1],K,W),nt=[...z.selections];return nt[nt.length-1]=Se,f(m({},z),{selections:nt})})},F=t.current;return l.selections[l.selections.length-1].startingRowIndex===-1?void 0:(F==null||F.addEventListener("mousemove",b),()=>{F==null||F.removeEventListener("mousemove",b)})}},[r,l,d]);let L=b=>{let{rowIndex:F,columnIndex:J}=es(b);if(F===void 0||J===void 0||T3(F,J))return;let{startingColumnFormula:K,arrowKeysScrollInFormula:W,editingMode:z}=mo(D,e.editorState,F,J);c({rowIndex:F,columnIndex:J,formula:K,arrowKeysScrollInFormula:W,editorLocation:"cell",editingMode:z})};return(0,be.useEffect)(()=>{let b=J=>{if(u===void 0&&!c1.includes(J.key)&&!(A7.includes(J.key)||J.ctrlKey))if(jl(J.key))J.preventDefault(),d(K=>{let W=fm(K.selections[K.selections.length-1],J,D);return Ya(t.current,n.current,g,K,W.endingRowIndex,W.endingColumnIndex),f(m({},K),{selections:[W]})});else{if(J.metaKey||J.key==="Escape")return;if(J.key==="Backspace"||J.key==="Delete"){if(ts(l.selections)){let W=Ur(l.selections).map(z=>{var Se;return(Se=D==null?void 0:D.data[z])==null?void 0:Se.columnID});W!==void 0&&(e.closeOpenEditingPopups(),x.editDeleteColumn(s,W));return}else if(_3(l.selections)){e.mitoAPI.editDeleteRow(e.sheetIndex,po(l.selections,D));return}}d(K=>{let W=K.selections[K.selections.length-1],{startingColumnFormula:z,arrowKeysScrollInFormula:Se,editingMode:nt}=mo(D,void 0,W.startingRowIndex,W.startingColumnIndex,J);return c({rowIndex:W.startingRowIndex,columnIndex:W.startingColumnIndex,formula:z,arrowKeysScrollInFormula:Se,editorLocation:"cell",editingMode:nt}),J.preventDefault(),f(m({},K),{selections:[{startingRowIndex:W.startingRowIndex,endingRowIndex:W.startingRowIndex,startingColumnIndex:W.startingColumnIndex,endingColumnIndex:W.startingColumnIndex}]})});return}},F=t.current;return F==null||F.addEventListener("keydown",b),()=>F==null?void 0:F.removeEventListener("keydown",b)},[u,c,D,g,x,l.selections,s,d]),be.default.createElement(be.default.Fragment,null,be.default.createElement(o3,{sheetData:D,selection:l.selections[l.selections.length-1],sheetIndex:e.sheetIndex,editorState:u,setEditorState:e.setEditorState,gridState:e.gridState,setGridState:e.setGridState,setUIState:e.setUIState,scrollAndRenderedContainerRef:n,containerRef:t,mitoAPI:e.mitoAPI,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData}),be.default.createElement("div",{className:"endo-grid-container",ref:t,tabIndex:-1,onMouseDown:A,onMouseUp:k,onMouseLeave:()=>o(!1),onDoubleClick:L},D!==void 0&&be.default.createElement(be.default.Fragment,null,be.default.createElement(i3,{sheetData:D,uiState:p,setUIState:h,sheetIndex:s,containerRef:t,editorState:u,setEditorState:c,scrollAndRenderedContainerRef:n,gridState:l,setGridState:d,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups}),be.default.createElement(I3,{sheetData:D,gridState:l,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups,sheetIndex:s})),be.default.createElement("div",{className:"endo-scroller-and-renderer-container",ref:P,onScroll:N},be.default.createElement(l3,{setUIState:e.setUIState,sheetData:D,mitoAPI:x,uiState:e.uiState,sendFunctionStatus:e.sendFunctionStatus}),be.default.createElement("div",{id:"scroller",style:{height:`${S.height}px`,width:`${S.width}px`}}),be.default.createElement("div",{className:"endo-renderer-container",style:{transform:`translate(${l.scrollPosition.scrollLeft-y.x}px, ${l.scrollPosition.scrollTop-y.y}px)`},onContextMenu:()=>{e.mitoAPI.log("right_clicked_on_sheet_data")}},be.default.createElement(C3,{sheetData:D,gridState:l,uiState:p,editorState:u}))),D!==void 0&&u!==void 0&&u.editorLocation==="cell"&&u.rowIndex>-1&&be.default.createElement(x3,{sheetData:D,sheetIndex:s,gridState:l,editorState:u,setGridState:d,setEditorState:c,setUIState:h,scrollAndRenderedContainerRef:n,containerRef:t,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData})))}var w3=k7;var Un=(e,t,n)=>{let r=!1;return e.forEach(o=>{r=r||A3(o,t,n)}),r},A3=(e,t,n)=>{let r=e.startingRowIndexe.endingRowIndex?e.startingRowIndex:e.endingRowIndex,i=r<=t&&t<=o,a=e.startingColumnIndexe.endingColumnIndex?e.startingColumnIndex:e.endingColumnIndex,l=a<=n&&n<=s;return i&&l?!0:r<=-1&&o<=-1?l:a<=-1&&s<=-1?i:!1},T3=(e,t)=>e<=-1||t<=-1;var f1=(e,t)=>{let n=document.elementFromPoint(e,t),r,o;for(;n;){let i=n==null?void 0:n.getAttribute("mito-row-index");r=r!==void 0?r:typeof i=="string"?parseInt(i):void 0;let a=n==null?void 0:n.getAttribute("mito-col-index");if(o=o!==void 0?o:typeof a=="string"?parseInt(a):void 0,r!==void 0&&o!==void 0)return{rowIndex:r,columnIndex:o};n=n.parentElement}return{rowIndex:r,columnIndex:o}},es=e=>f1(e.clientX,e.clientY),Sm=(e,t,n)=>t===void 0||n===void 0?e:{startingRowIndex:e.startingRowIndex,endingRowIndex:t,startingColumnIndex:e.startingColumnIndex,endingColumnIndex:n},jl=e=>e==="Up"||e==="ArrowUp"||(e==="Down"||e==="ArrowDown")||(e==="Left"||e==="ArrowLeft")||(e==="Right"||e==="ArrowRight")||e==="Tab",fm=(e,t,n)=>{if(!jl(t.key))return e;let r=t.key==="Up"||t.key==="ArrowUp",o=t.key==="Down"||t.key==="ArrowDown",i=t.key==="Left"||t.key==="ArrowLeft",a=t.key==="Right"||t.key==="ArrowRight",s=t.key==="Tab",l=t.shiftKey,d=t.metaKey,u=e.startingRowIndex,c=e.endingRowIndex,p=e.startingColumnIndex,h=e.endingColumnIndex,x=Math.min((n==null?void 0:n.numRows)||0,Wl),D=(n==null?void 0:n.numColumns)||0;return r?l?d?e.endingRowIndex===0||e.endingRowIndex<=-1?c=-1:c=0:c=Math.max(e.endingRowIndex-1,-1):(d?e.startingRowIndex===0||e.startingRowIndex<=-1?u=-1:u=0:u=Math.max(e.startingRowIndex-1,-1),c=u,h=p):o?l?d?c=x-1:c=Math.min(e.endingRowIndex+1,x-1):(d?u=x-1:u=Math.min(e.startingRowIndex+1,x-1),c=u,h=p):i?l?d?e.endingColumnIndex===0||e.endingColumnIndex<=-1?h=-1:h=0:h=Math.max(e.endingColumnIndex-1,-1):(d?e.startingColumnIndex===0||e.startingColumnIndex<=-1?p=-1:p=0:p=Math.max(e.startingColumnIndex-1,-1),h=p,c=u):a?l?d?h=D-1:h=Math.min(e.endingColumnIndex+1,D-1):(d?p=D-1:p=Math.min(e.startingColumnIndex+1,D-1),h=p,c=u):s&&(l?p-1<-1?u>-1&&(p=D-1,u-=1):(p-=1,p<=-1&&u<=-1&&(p=0)):p+1>D-1?u{let t=[];return e.forEach(n=>{t=t.concat(k3(n))}),t=[...new Set(t)],t},k3=e=>{let t=Math.min(e.startingColumnIndex,e.endingColumnIndex),n=Math.max(e.startingColumnIndex,e.endingColumnIndex),r=[];for(let o=t;o<=n;o++)r.push(o);return r},N7=(e,t)=>{let n=Math.min(e.startingColumnIndex,e.endingColumnIndex),r=Math.max(e.startingColumnIndex,e.endingColumnIndex),o=[];for(let i=n;i{let n=[];return e.forEach(r=>{n=n.concat(N7(r,t))}),n},M7=(e,t)=>{let n=Math.min(e.startingRowIndex,e.endingRowIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=[];for(let i=n;i{let n=[];return e.forEach(r=>{n=n.concat(M7(r,t))}),n},ts=e=>{let t=!0;return e.forEach(n=>{(n.startingRowIndex!==-1||n.endingRowIndex!==-1)&&(t=!1)}),t},_3=e=>{let t=!0;return e.forEach(n=>{(n.startingColumnIndex!==-1||n.endingColumnIndex!==-1)&&(t=!1)}),t},O7=(e,t)=>{var a;let n=Math.min(e.startingColumnIndex,e.endingColumnIndex),r=Math.min(e.startingRowIndex,e.endingRowIndex),o=(a=t.data[n])==null?void 0:a.columnHeader,i=t.index[r];return[o,i]},F7=(e,t)=>{var a;let n=Math.max(e.startingColumnIndex,e.endingColumnIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=(a=t.data[n])==null?void 0:a.columnHeader,i=t.index[r];return[o,i]},Xy=(e,t)=>{let n=O7(e,t),r=F7(e,t);return[n,r]},Cm="1px dashed black",Im="1px solid var(--mito-purple)",Rt=".5px solid var(--mito-light-gray)",Qa=(e,t,n,r,o)=>{let i={};return e.forEach(a=>{let s=b3(a,n,r,o,Im);i.borderRight=ei(i.borderRight,s.borderRight),i.borderLeft=ei(i.borderLeft,s.borderLeft),i.borderTop=ei(i.borderTop,s.borderTop),i.borderBottom=ei(i.borderBottom,s.borderBottom)}),t.forEach(a=>{let s=b3(a,n,r,o,Cm);i.borderRight=ei(i.borderRight,s.borderRight),i.borderLeft=ei(i.borderLeft,s.borderLeft),i.borderTop=ei(i.borderTop,s.borderTop),i.borderBottom=ei(i.borderBottom,s.borderBottom)}),i},b3=(e,t,n,r,o)=>{if(!Un([e],t,n))return{borderRight:Rt,borderLeft:n!==-1?Rt:void 0};let i=e.startingRowIndexe.endingRowIndex?e.startingRowIndex:e.endingRowIndex,s=e.startingColumnIndexe.endingColumnIndex?e.startingColumnIndex:e.endingColumnIndex,d=i===t?o:void 0,u=a===t||a<=-1&&t===r-1?o:void 0,c=s===n?o:void 0,p=l===n?o:void 0;return i<=-1&&a<=-1?t<=-1?{borderTop:o,borderLeft:c||Rt,borderRight:p||Rt}:{borderLeft:c||Rt,borderRight:p||Rt,borderBottom:u}:s<=-1&&l<=-1?n<=-1?{borderTop:d,borderBottom:u,borderLeft:o,borderRight:Rt}:{borderTop:d,borderBottom:u,borderLeft:Rt,borderRight:Rt}:{borderTop:d,borderBottom:u,borderLeft:c||Rt,borderRight:p||Rt}},ei=(e,t)=>e===Cm||t===Cm?Cm:e===Im||t===Im?Im:e===Rt||t===Rt?Rt:e,D3=(e,t)=>e.startingRowIndex===t.startingRowIndex&&e.endingRowIndex===t.endingRowIndex&&e.startingColumnIndex===t.startingColumnIndex&&e.endingColumnIndex===t.endingColumnIndex,E3=(e,t)=>{if(t.lengthn.map(i=>L7(e,t,i,r,o)),L7=(e,t,n,r,o)=>{if(r===void 0||e!==t||o===void 0)return{startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:0,endingColumnIndex:0};let i=o.data.map(a=>a.columnID);if(r.length>i.length){let a=E3(r,i),s=n.startingColumnIndexn.endingColumnIndex?n.startingColumnIndex:n.endingColumnIndex,d=0,u=0;for(let D=0;Ds&&S<=l&&(u+=1)}let c=s-d,p=l-d-u;n.startingColumnIndex>-1&&n.endingColumnIndex>-1&&(c=Math.max(c,0),p=Math.max(p,0)),c>o.numColumns-1&&(c=o.numColumns-1),p>o.numColumns-1&&(p=o.numColumns-1);let h=n.startingColumnIndexn.endingColumnIndex?c:p;return{startingRowIndex:n.startingRowIndex,endingRowIndex:n.endingRowIndex,startingColumnIndex:h,endingColumnIndex:x}}else if(r.lengthn.endingColumnIndex?n.startingColumnIndex:n.endingColumnIndex,d=0,u=0;for(let D=0;Ds&&S<=l&&(u+=1)}let c=s+d,p=l+d+u,h=n.startingColumnIndexn.endingColumnIndex?c:p;return{startingRowIndex:n.startingRowIndex,endingRowIndex:n.endingRowIndex,startingColumnIndex:h,endingColumnIndex:x}}return n},P3=(e,t)=>{let n=[];return e.forEach(r=>{if(!ts([r])||!A3(r,-1,t))n.push(r);else{let o=r.startingColumnIndexr.endingColumnIndex?r.startingColumnIndex:r.endingColumnIndex;ot&&n.push({startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:t+1,endingColumnIndex:i})}}),n.length===0&&n.push({startingColumnIndex:0,endingColumnIndex:0,startingRowIndex:0,endingRowIndex:0}),n},U7=e=>e.startingRowIndex===-1&&e.endingRowIndex===-1,xm=(e,t)=>{if(t===void 0)return[];let n=[];return e.forEach(r=>{U7(r)&&(n=n.concat(k3(r)))}),n=[...new Set(n)],n.filter(r=>t.data.length>r).map(r=>{var o;return(o=t.data[r])==null?void 0:o.columnID})},B7=(e,t)=>{let n=Math.min(e.startingRowIndex,e.endingRowIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=[];for(let i=n;i<=r;i++)o.push(t.index[i]);return o},po=(e,t)=>{if(t===void 0)return[];let n=[];return e.forEach(r=>{r.startingColumnIndex===-1&&(r.endingColumnIndex===-1||r.endingColumnIndex===t.numColumns)&&(n=n.concat(B7(r,t)))}),n},h1=(e,t)=>t.filter(r=>r!==void 0).map(r=>[r,(e==null?void 0:e.columnDtypeMap[r])||""]).filter(([,r])=>r!==void 0&&et(r)).filter(([r])=>r!==void 0).map(([r])=>r),ti=(e,t)=>{if(t===void 0)return[];let r=Ur(e).filter(o=>t.data.length>o).map(o=>{var i;return(i=t.data[o])==null?void 0:i.columnID});return h1(t,r)};var De=T(_());var ni=T(_());function H7(e){let t=n=>{e.setUIState(r=>f(m({},r),{selectedColumnControlPanelTab:n})),e.mitoAPI.log("clicked_"+n+"_tab")};return ni.default.createElement("div",{className:"control-panel-taskpane-tab-container"},ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="filter_sort"?"selected":"unselected"),onClick:()=>t("filter_sort")},ni.default.createElement("p",null,"Filter/Sort")),ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="unique_values"?"selected":"unselected"),onClick:()=>t("unique_values")},ni.default.createElement("p",null,"Values")),ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="summary_stats"?"selected":"unselected"),onClick:()=>t("summary_stats")},ni.default.createElement("p",null,"Summary Stats")))}var N3=H7;var sn=T(_());var G7="Changes the dtype of the selected column in the underlying dataframe.";function C1(e){return e===void 0?"str":e.includes("bool")?"bool":e.includes("int")?"int":e.includes("float")?"float":e.includes("str")||e.includes("object")?"str":e.includes("datetime")?"datetime":e.includes("timedelta")?"timedelta":"str"}function I1(e){return[sn.default.createElement(v,{title:"bool",key:"bool",onClick:e?()=>{e("bool")}:void 0}),sn.default.createElement(v,{title:"int",key:"int",hideSubtext:!0,displaySubtextOnHover:!0,onClick:e?()=>{e("int")}:void 0}),sn.default.createElement(v,{title:"float",key:"float",onClick:e?()=>{e("float")}:void 0}),sn.default.createElement(v,{title:"str",key:"str",onClick:e?()=>{e("str")}:void 0}),sn.default.createElement(v,{title:"datetime",key:"datetime",onClick:e?()=>{e("datetime")}:void 0}),sn.default.createElement(v,{title:"timedelta",key:"timedelta",onClick:e?()=>{e("timedelta")}:void 0})]}function V7(e){let[t]=(0,sn.useState)(()=>me());async function n(r){await e.mitoAPI.editChangeColumnDtype(e.selectedSheetIndex,[e.columnID],r,t)}return sn.default.createElement(sn.default.Fragment,null,sn.default.createElement(I,{justify:"space-between",align:"center"},sn.default.createElement(C,{span:4,title:G7},sn.default.createElement("p",{className:"text-header-3"},"Dtype")),sn.default.createElement(C,{offset:2,flex:"1"},sn.default.createElement($,{value:C1(e.columnDtype),onChange:r=>{n(r)},dropdownWidth:"medium"},I1()))))}var M3=V7;var Wt=T(_());var Bn=T(_());function ri(e){let t=nm.includes(e.filter.condition)?{visibility:"hidden"}:{visibility:"visible"},n=Fy(e.columnDtype,e.nameLength),r=e.setOperator,o=e.columnDtype&&it(e.columnDtype)||e.columnDtype===void 0&&Fl[e.filter.condition]!==void 0;return Bn.default.createElement(I,{justify:"space-between",align:"center",suppressTopBottomMargin:e.suppressTopBottomMargin},Bn.default.createElement(C,{span:e.inGroup?5:4},r===void 0&&Bn.default.createElement("p",{className:"text-body-1"},"Where"),r!==void 0&&Bn.default.createElement($,{value:e.operator,onChange:i=>r(i),dropdownWidth:"small"},Bn.default.createElement(v,{title:"And"}),Bn.default.createElement(v,{title:"Or"}))),Bn.default.createElement(C,{span:7},Bn.default.createElement($,{value:e.filter.condition,onChange:i=>{e.setFilter({condition:i,value:e.filter.value})},width:"block",dropdownWidth:"medium"},n)),Bn.default.createElement(C,{span:9},Bn.default.createElement("input",{className:"mito-input element-width-block",style:t,type:o?"date":"text",value:e.filter.value,onChange:i=>{e.setFilter({condition:e.filter.condition,value:i.target.value})}})),e.deleteFilter&&Bn.default.createElement(C,null,Bn.default.createElement(at,{onClick:e.deleteFilter})))}var Tm=T(_());function x1(e){return Tm.default.createElement("div",{className:"filter-group"},e.filters.map((t,n)=>Tm.default.createElement(ri,{key:n,filter:t,operator:e.groupOperator,displayOperator:!0,setFilter:r=>{e.setFilter(n,r)},setOperator:n===0?void 0:e.setOperator,deleteFilter:()=>{e.deleteFilter(n)},inGroup:!0,columnDtype:e.columnDtype,nameLength:"short_name"})),Tm.default.createElement(j,{variant:"light",onClick:e.addFilter,width:"medium"},"+ Add a Filter"))}var j7="+ Add Filter";function R7(e){let t=()=>{e.setFilters(d=>{let u=[...d];return u.push(rm(e.columnDtype)),u})},n=()=>{e.setFilters(d=>{let u=[...d];return u.push({filters:[rm(e.columnDtype)],operator:"And"}),u})},r=d=>{e.setFilters(u=>{let c=[...u],p=c[d];return Fn(p)?(p.filters.push(rm(e.columnDtype)),c):u})},o=d=>{e.setFilters(u=>{let c=[...u];return c.splice(d,1),c})},i=(d,u)=>{e.setFilters(c=>{let p=[...c],h=p[d];return Fn(h)?(h.filters.splice(u,1),h.filters.length===0&&p.splice(d,1),p):c})},a=(d,u)=>{e.setFilters(c=>{let p=[...c];return p[d]=u,p})},s=(d,u,c)=>{e.setFilters(p=>{let h=[...p],x=h[d];return Fn(x)?(x.filters[u]=c,h):p})},l=(d,u)=>{e.setFilters(c=>{let p=[...c],h=p[d];return Fn(h)?(h.operator=u,p):c})};return Wt.default.createElement("div",null,Wt.default.createElement("div",{className:"text-header-3 mt-15px"},Wt.default.createElement("p",null," Filter ")),e.filters.map((d,u)=>Fn(d)?Wt.default.createElement(I,{justify:"space-between",align:"top"},Wt.default.createElement(C,{span:4},u===0&&Wt.default.createElement("p",{className:"text-body-1"},"Where"),u!==0&&Wt.default.createElement($,{value:e.operator,onChange:c=>e.setOperator(c),dropdownWidth:"small"},Wt.default.createElement(v,{title:"And"}),Wt.default.createElement(v,{title:"Or"}))),Wt.default.createElement(C,{span:19},Wt.default.createElement(x1,{key:u,mainOperator:e.operator,filters:d.filters,groupOperator:d.operator,setFilter:(c,p)=>{s(u,c,p)},setOperator:c=>{l(u,c)},deleteFilter:c=>{i(u,c)},addFilter:()=>r(u),columnDtype:e.columnDtype}))):Wt.default.createElement(ri,{key:u,filter:d,operator:e.operator,displayOperator:!0,setFilter:c=>{a(u,c)},setOperator:u===0?void 0:e.setOperator,deleteFilter:()=>{o(u)},columnDtype:e.columnDtype,nameLength:"short_name"})),Wt.default.createElement(rn,{text:j7,width:"medium",dropdownWidth:"medium"},Wt.default.createElement(v,{title:"Add a Filter",onClick:t}),Wt.default.createElement(v,{title:"Add a Group of Filters",onClick:n})),e.editedFilter&&Wt.default.createElement(I,{className:"text-subtext-1"},e.rowDifference>=0?`Removed an additional ${Math.abs(e.rowDifference)} rows`:`Added back ${Math.abs(e.rowDifference)} rows`))}var O3=R7;var Br=T(_());var W7=e=>{let{params:t,setParams:n}=Dn(void 0,"sort",e.mitoAPI,e.analysisData,0),r=a=>{n(s=>{let l=a;return s&&a==s.sort_direction&&(l="none"),{sheet_index:e.selectedSheetIndex,column_id:e.columnID,sort_direction:l}})},o=t&&t.sort_direction=="ascending"?"sort-button-selected":"",i=t&&t.sort_direction=="descending"?"sort-button-selected":"";return Br.default.createElement(I,{justify:"space-between",align:"center"},Br.default.createElement(C,{span:4},Br.default.createElement("p",{className:"text-header-3"},"Sort")),Br.default.createElement(C,{offset:2,flex:"1"},Br.default.createElement(I,{suppressTopBottomMargin:!0},Br.default.createElement(C,{flex:"1"},Br.default.createElement("button",{className:M("sort-button",o),onClick:()=>r("ascending")},"Ascending")),Br.default.createElement(C,{offset:1,flex:"1"},Br.default.createElement("button",{className:M("sort-button",i),onClick:()=>r("descending")},"Descending")))))},F3=W7;var Hr=T(_());function X7(e){let[t,n]=(0,Hr.useState)(void 0);async function r(){let o=await e.mitoAPI.getColumnSummaryGraph(e.selectedSheetIndex,e.columnID,"350px","100%"),i="error"in o?void 0:o.result;n(i)}return(0,Hr.useEffect)(()=>{r()},[]),(0,Hr.useEffect)(()=>{if(t!==void 0)try{new Function(t.script)()}catch(o){console.error("Failed to execute graph function",o)}},[t]),Hr.default.createElement(Hr.default.Fragment,null,t!==void 0&&Hr.default.createElement("div",{dangerouslySetInnerHTML:{__html:t.html}}),t===void 0&&Hr.default.createElement("div",null,"Loading the summary graph..."))}var L3=X7;var er=T(_());var Xl=T(_());function ln(e,t,n,r){let[o,i]=(0,Xl.useState)(!0),[a,s]=(0,Xl.useState)(e);return(0,Xl.useEffect)(()=>{(async()=>{i(!0);let d=await t(...r);if(d!==void 0&&(s(d),n!==void 0)){let u=window.structuredClone(d);n(u)}i(!1)})()},r),[a,o]}var _m=T(_());var J7=e=>_m.default.createElement(_m.default.Fragment,null,"\xA0",_m.default.createElement("span",{className:"text-color-medium-gray-important text-underline-on-hover",onClick:()=>{e.setUIState(t=>f(m({},t),{currOpenTaskpane:{type:"fill_na",startingColumnIDs:[e.columnID]}}))}},"(or Fill NaN Values)")),Dm=J7;var z7=["mean","std","min","25%","50%","75%","max","median","sum"];function K7(e){let[t,n]=ln({},async()=>{let r=await e.mitoAPI.getColumnDescribe(e.selectedSheetIndex,e.columnID);return"error"in r?void 0:r.result},void 0,[]);return er.default.createElement(er.default.Fragment,null,er.default.createElement("div",{className:"text-header-3"},er.default.createElement("p",null," Column Summary Statistics ")),er.default.createElement("div",{key:n.toString()},!n&&er.default.createElement("table",{className:"column-describe-table-container"},Object.keys(t).map(r=>{let o=t[r],i=o;return z7.includes(r)&&(i=qo(o,e.columnDtype,e.columnFormat)),i=i.substring(0,15)+(i.length>15?"...":""),er.default.createElement("tr",{className:"column-describe-table-row",key:r},er.default.createElement("th",null,r,r==="count: NaN"&&i!=="0"&&er.default.createElement(Dm,{setUIState:e.setUIState,columnID:e.columnID})),er.default.createElement("th",{title:o},i))})),n&&er.default.createElement("p",null,"Column Summary statistics are loading...")))}var U3=K7;var Ke=T(_());var Fe=T(_());var $7=1e4,Z7=e=>{let t=e.emptyMessage!==void 0?e.emptyMessage:"No items to display.";return e.loading?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},"Loading items",Fe.default.createElement(Yo,null))):e.maxDisplayed||e.isSubset?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},"There are too many items to display. Search to filter down to the items you care about.")):e.numDisplayed===0?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},t)):e.message!==void 0?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},e.message)):Fe.default.createElement(Fe.default.Fragment,null)},Y7=e=>{let t=`${e.numToggled} selected`;return e.numToggled>0&&e.numToggled===e.numToggledButNotDisplayed?t=`${e.numToggled} selected and not displayed`:e.numToggledButNotDisplayed>0&&(t=`${e.numToggled} selected, of which ${e.numToggledButNotDisplayed} not displayed`),Fe.default.createElement(Fe.default.Fragment,null,"Toggle ",e.searchString!==""?"Displayed":"All",Fe.default.createElement("span",{className:"text-color-medium-gray-important"},"\xA0(",t,")"))},q7=e=>{let[t,n]=(0,Fe.useState)(""),r=e.searchState!==void 0?e.searchState.searchString:t,o=e.searchState!==void 0?e.searchState.setSearchString:n,i=(0,Fe.useCallback)(y=>{if(y!==null){let w=y.querySelector(".multi-toggle-box-row-selected");w!==null&&vl(y,w,0)}},[]),a=e.height||"block",s=e.width||"block",l=`element-height-${a}`,d=`element-width-${s}`,u=!0,c=[],p=0,h=0,x=0,D=!1,S=Fe.default.Children.map(e.children,y=>{let w=y.props.title,P=y.props.rightText,N=y.props.toggled;N&&p++;let A=w==null||dr(w+"",r)<.8,k=w==null||dr(P+"",r)<.8;if(A&&k)return N&&h++,null;if(x>$7)return D=!0,null;x++;let L=y.props.disabled||e.disabled;return L||(c.push(y.props.index),u=u&&y.props.toggled),Fe.default.cloneElement(y,{disabled:L})}),{onToggleAll:g}=e;return Fe.default.createElement("div",{className:M("multi-toggle-box-container",l,d,e.className)},e.searchable&&Fe.default.createElement(ne,{value:r,onChange:y=>{o(y.target.value)},placeholder:"Search",width:"block",className:"mb-2px"}),Fe.default.createElement("div",{className:M("multi-toggle-box"),style:{height:e.searchable?"calc(100% - 30px)":"100%"},ref:i},Fe.default.createElement(Z7,{loading:e.loading,isSubset:e.isSubset,message:e.message,emptyMessage:e.emptyMessage,maxDisplayed:D,numDisplayed:x}),g!==void 0&&x>0&&Fe.default.createElement("div",{key:"Toggle All",className:M("multi-toggle-box-row",{"multi-toggle-box-row-selected":u}),onClick:()=>{e.disabled||g(u?[]:c)}},Fe.default.createElement("input",{key:"Toggle All",type:"checkbox",name:"Toggle All",checked:u}),Fe.default.createElement(Y7,{searchString:r,numToggled:p,numToggledButNotDisplayed:h})),S))},Gr=q7;var oi=T(_());var Q7=e=>{var t;return oi.default.createElement("div",{className:M("multi-toggle-box-row","text-overflow-hide",{"multi-toggle-box-row-selected":e.toggled,"multi-toggle-box-row-disabled":e.disabled}),onClick:()=>{e.disabled||e.onToggle()}},oi.default.createElement(I,{justify:e.rightText!==void 0?"space-between":"start",align:"center",suppressTopBottomMargin:!0},oi.default.createElement(C,{offset:1},oi.default.createElement("input",{name:"input",type:"checkbox",checked:e.toggled})),oi.default.createElement(C,{span:14},oi.default.createElement("span",{title:(t=e.title)==null?void 0:t.toString()},e.title)),e.rightText&&oi.default.createElement(C,{span:7,offset:1},e.rightText)))},hr=Q7;var B3=(o=>(o.ASCENDING_ALPHABETICAL="Ascending Value",o.DESCENDING_ALPHABETICAL="Descending Value",o.ASCENDING_PERCENT_OCCURENCE="Ascending Occurence",o.DESCENDING_PERCENT_OCCURENCE="Descending Occurence",o))(B3||{}),e8=(e,t)=>t==="Ascending Value"?e.sort(function(n,r){return n.valuer.value?1:0}):t==="Descending Value"?e.sort(function(n,r){return n.value>r.value?-1:n.value{(!r||r&&(!s.startsWith(c.current)||s.length{P.push({value:A,percentOccurence:0,countOccurence:0,isNotFiltered:!1})}),a(P),o(w.isAllData),n(!1)}let x=y=>{let w=S[y].value;return i.findIndex(P=>P.value===w)},D=y=>{e.setFilters(w=>{let P=[...w];return y.forEach(N=>{let A=Ny(e.columnDtype,N),k=P.length;P=P.filter(L=>Fn(L)||!Oy(L,A)),P.length===k&&P.push(A)}),P})},S=e8(i,d),g=ky(e.columnDtype);return Ke.default.createElement(Ke.Fragment,null,Ke.default.createElement(I,{justify:"space-between"},Ke.default.createElement(C,{flex:"1",offsetRight:1},Ke.default.createElement("p",{className:"text-header-2"},"Unique Values")),Ke.default.createElement(C,null,Ke.default.createElement($,{value:d,onChange:y=>{u(y)},width:"medium",dropdownWidth:"medium"},Object.values(B3).map(y=>Ke.default.createElement(v,{key:y,title:y}))))),Ke.default.createElement("div",{style:{height:"calc(100% - 40px)"}},Ke.default.createElement(Gr,{loading:t,searchable:!0,searchState:{searchString:s,setSearchString:l},isSubset:!r,message:g,disabled:g!==void 0},S.map((y,w)=>{let P=qo(y.value,e.columnDtype,e.columnFormat);return P==="NaN"?Ke.default.createElement(hr,{key:w,title:Ke.default.createElement("span",null,P," ",Ke.default.createElement(Dm,{setUIState:e.setUIState,columnID:e.columnID})),rightText:y.countOccurence+" ("+y.percentOccurence.toFixed(2).toString()+"%)",toggled:y.isNotFiltered,index:w,onToggle:()=>{let N=x(w);a(A=>{let k=A.slice();return k[N].isNotFiltered=!i[N].isNotFiltered,k}),D([y.value])}}):Ke.default.createElement(hr,{key:w,title:P,rightText:y.countOccurence+" ("+y.percentOccurence.toFixed(2).toString()+"%)",toggled:y.isNotFiltered,index:w,onToggle:()=>{let N=x(w);a(A=>{let k=A.slice();return k[N].isNotFiltered=!i[N].isNotFiltered,k}),D([y.value])}})}))))}var gr=T(_());var t8="Format the selected column as a percent, choose the number of decimals, etc. This only changes the display of the column, and does not effect the underlying dataframe.";function n8(e){var n;let t=Qn((n=e.sheetData)==null?void 0:n.dfFormat.columns[e.columnID]);return et(e.columnDtype)?gr.default.createElement(gr.default.Fragment,null,gr.default.createElement(I,{justify:"space-between",align:"center"},gr.default.createElement(C,{span:4,title:t8},gr.default.createElement("p",{className:"text-header-3",title:""},"Num Type")),gr.default.createElement(C,{offset:2,flex:"1"},et(e.columnDtype)&&gr.default.createElement($,{value:t},gm(e.gridState.sheetIndex,e.sheetData,[e.columnID],e.mitoAPI,e.closeOpenEditingPopups)),!et(e.columnDtype)&&gr.default.createElement("p",{className:"text-header-3 text-align-right"},t)))):gr.default.createElement(gr.default.Fragment,null)}var G3=n8;var V3=T(_());var r8=e=>V3.default.createElement("div",{style:e.ignoreTaskpanePadding?{margin:" 0px -10px -7px -10px"}:void 0}," ",e.children),Me=r8;var o8=500;var i8=e=>{var w,P;let{columnHeader:t,columnID:n,columnFilters:r,columnDtype:o,columnFormat:i}=st(e.sheetData,e.selection.startingRowIndex,e.selection.startingColumnIndex),[a,s]=(0,De.useState)(r!==void 0?r.filters:[]),[l,d]=(0,De.useState)(r!==void 0?r.operator:"And"),[u,c]=(0,De.useState)(0),[p]=(0,De.useState)(()=>me()),h=(0,De.useCallback)(N=>{s(N),c(A=>A+1)},[]),x=(0,De.useCallback)(N=>{d(N),c(A=>A+1)},[]),[D]=(0,De.useState)(((w=e.sheetData)==null?void 0:w.numRows)||0),[S,g]=(0,De.useState)(!1);if(on(()=>{u!=0&&y()},[u],o8),Wa(()=>{s(N=>(r==null?void 0:r.filters)||N)},e.analysisData),t===void 0||n===void 0||o==null)return e.setUIState(N=>f(m({},N),{currOpenTaskpane:{type:"none"}})),De.default.createElement(De.default.Fragment,null);let y=async()=>{let N=om(a,o);N.length===0&&r!==void 0&&r.filters.length===0||(await e.mitoAPI.editFilter(e.selectedSheetIndex,n,N,l,e.tab,p),g(!0))};return De.default.createElement(De.default.Fragment,null,De.default.createElement(Y,null,De.default.createElement(Q,{header:G(t),setUIState:e.setUIState}),De.default.createElement(q,null,e.tab==="filter_sort"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(M3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,columnDtype:o,mitoAPI:e.mitoAPI,lastStepIndex:e.lastStepIndex,lastStepType:e.lastStepType}),De.default.createElement(G3,{columnID:n,mitoAPI:e.mitoAPI,gridState:e.gridState,columnDtype:o,sheetData:e.sheetData,closeOpenEditingPopups:e.closeOpenEditingPopups}),De.default.createElement(F3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI,analysisData:e.analysisData}),De.default.createElement(O3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,filters:a,setFilters:h,setOperator:x,columnDtype:o,operator:l,mitoAPI:e.mitoAPI,rowDifference:D-(((P=e.sheetData)==null?void 0:P.numRows)||0),editedFilter:S})),e.tab==="unique_values"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(H3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,filters:a,setFilters:h,mitoAPI:e.mitoAPI,columnDtype:o,columnFormat:i,setUIState:e.setUIState})),e.tab==="summary_stats"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(L3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI}),De.default.createElement(U3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI,columnDtype:o,columnFormat:i,setUIState:e.setUIState}))),De.default.createElement(Me,{ignoreTaskpanePadding:!0},De.default.createElement(N3,{selectedTab:e.tab,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))))},j3=i8;var bt=T(_());function w1(e){(0,bt.useEffect)(()=>{e.display&&e.mitoAPI.log("opened_column_header_dropdown")},[e.display]);let t=0,n=Object.keys(e.sheetData.columnIDsMap).indexOf(e.columnID);return bt.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setOpenColumnHeaderDropdown(!1),width:"medium"},bt.default.createElement(v,{title:"Delete Column",onClick:()=>{e.closeOpenEditingPopups();let o=Ur(e.gridState.selections).map(i=>{var a,s;return((s=(a=e.sheetData)==null?void 0:a.data[i])==null?void 0:s.columnID)||""}).filter(i=>i!=="");e.mitoAPI.editDeleteColumn(e.sheetIndex,o)}}),bt.default.createElement(v,{title:"Rename Column",onClick:()=>{e.openColumnHeaderEditor()},supressFocusSettingOnClose:!0}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Filter",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Sort",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Change Dtype",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Fill NaN Values",onClick:()=>{let o=Ur(e.gridState.selections).map(i=>{var a,s;return((s=(a=e.sheetData)==null?void 0:a.data[i])==null?void 0:s.columnID)||""}).filter(i=>i!=="");e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"fill_na",startingColumnIDs:o}}))}}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Format",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))},disabled:!et(e.columnDtype),tooltip:et(e.columnDtype)?void 0:"Only number columns can be formatted currently"}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Set Column Formula",onClick:()=>{let{startingColumnFormula:r,arrowKeysScrollInFormula:o,editingMode:i}=mo(e.sheetData,void 0,t,n);e.setEditorState({rowIndex:0,columnIndex:n,formula:r,arrowKeysScrollInFormula:o,editorLocation:"cell",editingMode:i})},supressFocusSettingOnClose:!0}),bt.default.createElement(v,{title:"Split Text to Columns",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"split_text_to_columns",startingColumnID:e.columnID}}))}}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"View Unique Values",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"unique_values"}))}}),bt.default.createElement(v,{title:"View Summary Stats",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"summary_stats"}))}}))}var Jl="#494650",T1="#E8EBF8",a8="#E4EFDC",s8="#FDF3D0",l8=e=>{var k;let[t,n]=(0,Ee.useState)(!1),r=Un(e.gridState.selections,-1,e.columnIndex),o=e.gridState.widthDataArray[e.gridState.sheetIndex].widthArray[e.columnIndex],{columnID:i,columnFilters:a,columnHeader:s,columnDtype:l,headerBackgroundColor:d,headerTextColor:u}=st(e.sheetData,-1,e.columnIndex);if(i===void 0||a===void 0||l==null||s===void 0)return Ee.default.createElement(Ee.default.Fragment,null);let c=a.filters.length>0,p=e.editorState!==void 0&&e.editorState.editorLocation==="cell"&&e.editorState.rowIndex<=-1&&e.editorState.columnIndex===e.columnIndex,h=e.editorState!==void 0&&e.editorState.editorLocation==="cell"&&e.editorState.rowIndex===-1&&e.editorState.columnIndex===e.columnIndex,{lowerLevelColumnHeaders:x,finalColumnHeader:D}=Ba(s),S=Qa(e.gridState.selections,e.gridState.copiedSelections,-1,e.columnIndex,e.sheetData.numRows),g=()=>{e.setEditorState({rowIndex:-1,columnIndex:e.columnIndex,formula:G(D),editorLocation:"cell",editingMode:"specific_index_labels"})},y=()=>{e.setEditorState(void 0),setTimeout(()=>cr(e.containerRef.current),100)},w=Ee.default.createElement("div",{className:"endo-column-header-resizer",onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("operation","resize"),L.dataTransfer.setData("mito-col-index",e.columnIndex+""),e.setColumnHeaderOperation("resize")},onDragEnd:()=>{e.setColumnHeaderOperation(void 0)},onMouseDown:L=>{L.stopPropagation()},onMouseUp:L=>{L.stopPropagation()},onClick:L=>{L.stopPropagation()},draggable:"true",onDoubleClick:()=>{let L=[...e.gridState.selections];Un(L,-1,e.columnIndex)||L.push({startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:e.columnIndex,endingColumnIndex:e.columnIndex});let b=Ur(L),F=zy(b,e.gridState,e.sheetData);e.setGridState(J=>f(m({},J),{selections:L,widthDataArray:F}))}}),P=ym(s,e.uiState.dataRecon,e.sheetData),N=g3(s,e.uiState.dataRecon,e.sheetData),A=P?a8:N?s8:d||T1;return Ee.default.createElement("div",{className:M("endo-column-header-container","endo-column-header-text",{"endo-column-header-container-selected":r,recon:P||N}),style:{color:u||Jl,backgroundColor:A},key:e.columnIndex,"mito-col-index":e.columnIndex+"",onDragStart:L=>{L.dataTransfer.setData("operation","reorder"),L.dataTransfer.setData("mito-col-index",e.columnIndex+""),e.setColumnHeaderOperation("reorder")},onDragEnd:()=>{e.setColumnHeaderOperation(void 0)},title:G(s),draggable:p?"false":"true",onContextMenu:L=>{L.preventDefault(),n(!0)}},x.map((L,E)=>{var J;let b=-1-(x.length-E),F=e.editorState!==void 0&&e.editorState.rowIndex===b&&e.editorState.columnIndex===e.columnIndex;return Ee.default.createElement("div",{className:"endo-column-header-lower-level-container",key:E,"mito-row-index":b+"","mito-col-index":e.columnIndex,style:{minHeight:Or,borderLeft:S.borderLeft,borderRight:S.borderRight,borderTop:E===0?S.borderTop:void 0,borderBottom:E{K.stopPropagation(),e.setEditorState({rowIndex:b,columnIndex:e.columnIndex,formula:G(L),editorLocation:"cell",editingMode:"specific_index_labels"})}},G(L)),F&&Ee.default.createElement("form",{style:{width:`${o-25}px`},onSubmit:async K=>{var Se;K.preventDefault();let W=((Se=e.editorState)==null?void 0:Se.formula)||G(D),z=G(L);W!==z&&(e.mitoAPI.editRenameColumn(e.gridState.sheetIndex,i,W,E),e.setUIState(nt=>nt.currOpenTaskpane.type!=="control_panel"?f(m({},nt),{currOpenTaskpane:{type:"none"}}):nt)),y()}},Ee.default.createElement(ne,{value:((J=e.editorState)==null?void 0:J.formula)||"",onChange:K=>{let W=K.target.value;e.setEditorState(z=>{if(z!==void 0)return f(m({},z),{formula:W})})},onKeyDown:K=>{K.key==="Escape"&&y()},autoFocus:!0,width:"block"})),w)}),Ee.default.createElement("div",{className:M("endo-column-header-final-container",{"endo-grabbable":e.columnHeaderOperation==="reorder"}),"mito-row-index":"-1","mito-col-index":e.columnIndex,onClick:()=>{h||e.setUIState(L=>f(m({},L),{selectedColumnControlPanelTab:"filter_sort",currOpenTaskpane:{type:"control_panel"}}))},style:{height:"100%",minHeight:"45px",width:`${o}px`,borderTop:x.length>0?Rt:S.borderTop,borderBottom:S.borderBottom,borderLeft:S.borderLeft,borderRight:S.borderRight}},!h&&Ee.default.createElement(Ee.default.Fragment,null,Ee.default.createElement("div",{className:"endo-column-header-final-text",onClick:L=>{L.stopPropagation()},onDoubleClick:L=>{L.stopPropagation(),e.setEditorState({rowIndex:-1,columnIndex:e.columnIndex,formula:G(D),editorLocation:"cell",editingMode:"specific_index_labels"})},key:e.columnIndex,tabIndex:-1},D+""),Ee.default.createElement("div",{className:"endo-column-header-final-right-side"},Ee.default.createElement("div",{className:"endo-column-header-final-icons",title:"Open the column control panel"},Ee.default.createElement("span",{title:"Edit filters"},!c&&Ee.default.createElement("div",{className:"icon-color-changer-container"},Ee.default.createElement("div",{className:"icon-hide-on-hover"},Ee.default.createElement(Ka,{purpleOrDark:"dark"})),Ee.default.createElement("div",{className:"icon-show-on-hover"},Ee.default.createElement(Ka,{purpleOrDark:"purple"}))),c&&Ee.default.createElement(Ka,{nonEmpty:!0})),Ee.default.createElement("div",{className:"icon-color-changer-container"},Ee.default.createElement("div",{className:"icon-hide-on-hover"},i1(l,"dark")),Ee.default.createElement("div",{className:"icon-show-on-hover"},i1(l,"purple")))),w)),h&&Ee.default.createElement("form",{className:"element-width-block",onSubmit:()=>{Bl(s,D,i,e.gridState.sheetIndex,e.editorState,e.setUIState,e.mitoAPI),y()}},Ee.default.createElement(ne,{value:((k=e.editorState)==null?void 0:k.formula)||"",onChange:L=>{let E=L.target.value;e.setEditorState(b=>{if(b!==void 0)return f(m({},b),{formula:E})})},onKeyDown:L=>{L.key==="Escape"&&y()},onBlur:()=>{Bl(s,D,i,e.gridState.sheetIndex,e.editorState,e.setUIState,e.mitoAPI),y()},autoFocus:!0,width:"block"}))),Ee.default.createElement(w1,{mitoAPI:e.mitoAPI,setOpenColumnHeaderDropdown:n,setUIState:e.setUIState,openColumnHeaderEditor:g,sheetIndex:e.gridState.sheetIndex,columnID:i,columnDtype:l,display:t,closeOpenEditingPopups:e.closeOpenEditingPopups,setEditorState:e.setEditorState,sheetData:e.sheetData,gridState:e.gridState}))},s3=Ee.default.memo(l8);var R3=T(_()),d8=e=>{let t=e.seperatingLine?e.px/2:e.px,n=`${t}px`,r=e.seperatingLine?".5px solid var(--mito-light-gray)":"none",o=e.seperatingLine?`${t}px`:"none";return R3.default.createElement("div",{style:{marginTop:n,border:r,marginBottom:o}})},se=d8;var zl=T(_());var W3=T(_());var u8=e=>W3.default.createElement("input",{className:"color-input",type:"color",value:e.value,onChange:t=>{e.onChange(t.target.value)}}),X3=u8;var m8=e=>zl.default.createElement(I,{justify:"space-between",align:"center"},zl.default.createElement(C,null,zl.default.createElement("p",null,e.label)),zl.default.createElement(X3,{value:e.color,onChange:e.onChange})),Xt=m8;var Jt=T(_());var go=T(_()),c8=()=>go.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#E8EBF8"}),go.default.createElement("g",{opacity:"0.05"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#494650"})),go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),go.default.createElement("g",{opacity:"0.05"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#494650"})),go.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),J3=c8;var zi=T(_()),f8=()=>zi.default.createElement("svg",{width:"59",height:"46",viewBox:"0 0 59 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 1)",fill:"#ACACAD"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 12)",fill:"#F5F5F5"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 23)",fill:"white"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 34)",fill:"#F5F5F5"}),zi.default.createElement("rect",{x:"1",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),z3=f8;var Ki=T(_()),p8=()=>Ki.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#549D3A"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#D0E3C9"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#D0E3C9"}),Ki.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),K3=p8;var $i=T(_()),h8=()=>$i.default.createElement("svg",{width:"59",height:"46",viewBox:"0 0 59 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 1)",fill:"#4D73BE"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 12)",fill:"#DAE1F0"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 23)",fill:"white"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 34)",fill:"#DAE1F0"}),$i.default.createElement("rect",{x:"1",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),$3=h8;var Zi=T(_()),g8=()=>Zi.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#BE4D4D"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#F0DADA"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#F0DADA"}),Zi.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),Z3=g8;var y8=e=>Jt.default.createElement(Jt.default.Fragment,null,Jt.default.createElement(I,null,Jt.default.createElement(C,null,Jt.default.createElement("p",{className:"text-header-3"},"Suggested Styles"))),Jt.default.createElement(I,{justify:"space-between",align:"center"},Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:void 0,backgroundColor:void 0},rows:{even:{color:void 0,backgroundColor:void 0},odd:{color:void 0,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(J3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:Jl,backgroundColor:"#9B9B9D"},rows:{even:{color:Qo,backgroundColor:void 0},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(z3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#549D3A"},rows:{even:{color:Qo,backgroundColor:"#D0E3C9"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(K3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#4D73BE"},rows:{even:{color:Qo,backgroundColor:"#DAE1F0"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement($3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#8F1B15"},rows:{even:{color:Qo,backgroundColor:"#F0DADA"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(Z3,null)))),Y3=y8;var S8="#FFFFFF",Ji=()=>({columns:{},headers:{},rows:{even:{},odd:{}},border:{},conditional_formats:[]}),q3=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,df_format:e[t].dfFormat||Ji()}},C8=e=>{let{params:t,setParams:n,startNewStep:r}=Dn(()=>q3(e.sheetDataArray,e.selectedSheetIndex),"set_dataframe_format",e.mitoAPI,e.analysisData,50),o=(e.sheetDataArray[(t==null?void 0:t.sheet_index)||0]||{}).dfFormat;if(t===void 0||o===void 0)return He.default.createElement(ge,{setUIState:e.setUIState});let i=a=>{n(s=>jt(s,{df_format:a}))};return He.default.createElement(Y,null,He.default.createElement(Q,{header:"Color Dataframe",setUIState:e.setUIState}),He.default.createElement(q,{userProfile:e.userProfile,requiresPro:{message:"Setting the dataframe format is a Mito Pro feature. Please upgrade to use this feature.",mitoAPI:e.mitoAPI,featureName:"Set dataframe colors"}},He.default.createElement(Lt,{sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:a=>{r(),n(s=>{let l=q3(e.sheetDataArray,a);return l||f(m({},s),{sheet_index:a})}),e.setUIState(s=>f(m({},s),{selectedSheetIndex:a}))}}),He.default.createElement(Y3,{updateDataframeFormatParams:i}),He.default.createElement(je,{title:"Column Headers"},He.default.createElement(Xt,{label:"Background Color",color:t.df_format.headers.backgroundColor||T1,onChange:a=>i({headers:{backgroundColor:a}})}),He.default.createElement(Xt,{label:"Text Color",color:t.df_format.headers.color||Jl,onChange:a=>i({headers:{color:a}})})),He.default.createElement(se,{px:10}),He.default.createElement(je,{title:"Rows"},He.default.createElement(Xt,{label:"Even Row: Background Color",color:t.df_format.rows.even.backgroundColor||y1,onChange:a=>i({rows:{even:{backgroundColor:a}}})}),He.default.createElement(Xt,{label:"Even Row: Text Color",color:t.df_format.rows.even.color||Qo,onChange:a=>i({rows:{even:{color:a}}})}),He.default.createElement(Xt,{label:"Odd Row: Background Color",color:t.df_format.rows.odd.backgroundColor||Rl,onChange:a=>i({rows:{odd:{backgroundColor:a}}})}),He.default.createElement(Xt,{label:"Odd Row: Text Color",color:t.df_format.rows.odd.color||Fr,onChange:a=>i({rows:{odd:{color:a}}})})),He.default.createElement(se,{px:10}),He.default.createElement(je,{title:"Dataframe Border"},He.default.createElement(I,{justify:"space-between",align:"center"},He.default.createElement(C,null,He.default.createElement(de,{tooltip:"The border line will be displayed when the dataframe styling object is printed out.",textBody:!0},"Border Style")),He.default.createElement(C,null),He.default.createElement($,{value:t.df_format.border.borderStyle||"none",width:"medium",onChange:a=>i(a==="none"?{border:{borderStyle:void 0}}:{border:{borderStyle:a}})},He.default.createElement(v,{title:"none"}),He.default.createElement(v,{title:"solid"}),He.default.createElement(v,{title:"dashed"}))),He.default.createElement(Xt,{label:"Border Color",color:t.df_format.border.borderColor||S8,onChange:a=>i({border:{borderColor:a}})}))))},Q3=C8;var $e=T(_());var dt=T(_());var I8=e=>{let t=dt.default.createElement(C,{title:"Delete conditional formatting rule"},dt.default.createElement(at,{onClick:n=>{n.stopPropagation(),e.onDelete()}}));return e.isExpanded?dt.default.createElement("div",{className:"expandable-content-card"},dt.default.createElement(I,{justify:"space-between",onClick:()=>e.setExpanded(!1)},dt.default.createElement(C,{span:12},dt.default.createElement("p",{className:"text-header-3"},e.expandedTitle)),dt.default.createElement(I,{justify:"end"},dt.default.createElement("div",{className:"mr-5px",title:"Minimize"},dt.default.createElement(Vu,null)),t)),e.children):dt.default.createElement("div",{className:"expandable-content-card",onClick:()=>e.setExpanded(!0)},dt.default.createElement(I,{suppressTopBottomMargin:!0,align:"center",justify:"start"},e.icon!==void 0&&dt.default.createElement(C,{offsetRight:1,title:e.iconTitle},e.icon),dt.default.createElement(C,{span:17.5},dt.default.createElement("div",{className:"flex flex-column"},dt.default.createElement("p",{className:"text-body-1"},e.title),dt.default.createElement("p",{className:"text-body-2"},e.subtitle))),e.icon===void 0&&dt.default.createElement(C,{offsetRight:4}),dt.default.createElement(C,null,dt.default.createElement(I,{align:"top",justify:"end",suppressTopBottomMargin:!0},dt.default.createElement("div",{className:"mr-5px",title:"Expand"},dt.default.createElement(ju,null)),t))))},vm=I8;var _1=T(_());var x8=e=>{var o,i;let t=((o=e.sheetData)==null?void 0:o.columnIDsMap)||{},n=Object.entries(((i=e.sheetData)==null?void 0:i.columnDtypeMap)||{}),r=n.map(([a])=>a);return _1.default.createElement(Gr,{searchable:!0,onToggleAll:a=>{let s=a.map(l=>r[l]);e.onChange(s)},height:"medium"},n.map(([a,s],l)=>{let d=t[a],u=e.selectedColumnIDs.includes(a),c=e.disabledColumnIDs!==void 0&&e.disabledColumnIDs.includes(a)||e.getIsDisabledColumnID!==void 0&&e.getIsDisabledColumnID(a,d,s),p=e.getDisplayColumnHeaderOverride!==void 0?e.getDisplayColumnHeaderOverride(a,d):G(d);return _1.default.createElement(hr,{key:l,index:l,title:p,rightText:C1(s),toggled:u,onToggle:()=>{let h=[...e.selectedColumnIDs];br(h,a),e.onChange(h)},disabled:c})}))},tr=x8;var Pm=T(_()),w8=e=>Pm.default.createElement("svg",{width:"47",height:"41",viewBox:"0 0 47 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pm.default.createElement("rect",{width:"47",height:"41",rx:"3",fill:e.backgroundColor}),Pm.default.createElement("path",{d:"M15.1855 16.2808L11.6553 26H10.2124L14.2773 15.3359H15.2075L15.1855 16.2808ZM18.1445 26L14.6069 16.2808L14.585 15.3359H15.5151L19.5947 26H18.1445ZM17.9614 22.0522V23.2095H11.9702V22.0522H17.9614ZM20.8105 14.75H22.1729V24.4619L22.0557 26H20.8105V14.75ZM27.5269 21.9717V22.1255C27.5269 22.7017 27.4585 23.2363 27.3218 23.7295C27.1851 24.2178 26.9849 24.6426 26.7212 25.0039C26.4575 25.3652 26.1353 25.646 25.7544 25.8462C25.3735 26.0464 24.9365 26.1465 24.4434 26.1465C23.9404 26.1465 23.4985 26.061 23.1177 25.8901C22.7417 25.7144 22.4243 25.4629 22.1655 25.1357C21.9067 24.8086 21.6992 24.4131 21.543 23.9492C21.3916 23.4854 21.2866 22.9629 21.228 22.3818V21.708C21.2866 21.1221 21.3916 20.5972 21.543 20.1333C21.6992 19.6694 21.9067 19.2739 22.1655 18.9468C22.4243 18.6147 22.7417 18.3633 23.1177 18.1924C23.4937 18.0166 23.9307 17.9287 24.4287 17.9287C24.9268 17.9287 25.3687 18.0264 25.7544 18.2217C26.1401 18.4121 26.4624 18.6855 26.7212 19.042C26.9849 19.3984 27.1851 19.8257 27.3218 20.3237C27.4585 20.8169 27.5269 21.3662 27.5269 21.9717ZM26.1646 22.1255V21.9717C26.1646 21.5762 26.1279 21.2051 26.0547 20.8584C25.9814 20.5068 25.8643 20.1992 25.7031 19.9355C25.542 19.667 25.3296 19.457 25.0659 19.3057C24.8022 19.1494 24.4775 19.0713 24.0918 19.0713C23.75 19.0713 23.4521 19.1299 23.1982 19.2471C22.9492 19.3643 22.7368 19.5229 22.561 19.7231C22.3853 19.9185 22.2412 20.1431 22.1289 20.397C22.0215 20.646 21.9409 20.9048 21.8872 21.1733V22.9385C21.9653 23.2803 22.0923 23.6099 22.2681 23.9272C22.4487 24.2397 22.688 24.4961 22.9858 24.6963C23.2886 24.8965 23.6621 24.9966 24.1064 24.9966C24.4727 24.9966 24.7852 24.9233 25.0439 24.7769C25.3076 24.6255 25.52 24.418 25.6812 24.1543C25.8472 23.8906 25.9692 23.5854 26.0474 23.2388C26.1255 22.8921 26.1646 22.521 26.1646 22.1255ZM32.4121 25.0332C32.7344 25.0332 33.0322 24.9673 33.3057 24.8354C33.5791 24.7036 33.8037 24.5229 33.9795 24.2935C34.1553 24.0591 34.2554 23.793 34.2798 23.4951H35.5688C35.5444 23.9639 35.3857 24.4009 35.0928 24.8062C34.8047 25.2065 34.4263 25.5312 33.9575 25.7803C33.4888 26.0244 32.9736 26.1465 32.4121 26.1465C31.8164 26.1465 31.2964 26.0415 30.8521 25.8315C30.4126 25.6216 30.0464 25.3335 29.7534 24.9673C29.4653 24.6011 29.248 24.1812 29.1016 23.7075C28.96 23.229 28.8892 22.7236 28.8892 22.1914V21.8838C28.8892 21.3516 28.96 20.8486 29.1016 20.375C29.248 19.8965 29.4653 19.4741 29.7534 19.1079C30.0464 18.7417 30.4126 18.4536 30.8521 18.2437C31.2964 18.0337 31.8164 17.9287 32.4121 17.9287C33.0322 17.9287 33.5742 18.0557 34.0381 18.3096C34.502 18.5586 34.8657 18.9004 35.1294 19.335C35.3979 19.7646 35.5444 20.2529 35.5688 20.7998H34.2798C34.2554 20.4727 34.1626 20.1772 34.0015 19.9136C33.8452 19.6499 33.6304 19.4399 33.3569 19.2837C33.0884 19.1226 32.7734 19.042 32.4121 19.042C31.9971 19.042 31.6479 19.125 31.3647 19.291C31.0864 19.4521 30.8643 19.6719 30.6982 19.9502C30.5371 20.2236 30.4199 20.5288 30.3467 20.8657C30.2783 21.1978 30.2441 21.5371 30.2441 21.8838V22.1914C30.2441 22.5381 30.2783 22.8799 30.3467 23.2168C30.415 23.5537 30.5298 23.8589 30.6909 24.1323C30.8569 24.4058 31.0791 24.6255 31.3574 24.7915C31.6406 24.9526 31.9922 25.0332 32.4121 25.0332Z",fill:e.color})),e5=w8;var ns=T(_()),T8=e=>ns.default.createElement("svg",{width:"47",height:"43",viewBox:"0 0 47 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ns.default.createElement("rect",{y:"2",width:"47",height:"41",rx:"3",fill:e.backgroundColor}),ns.default.createElement("path",{d:"M15.1855 18.2808L11.6553 28H10.2124L14.2773 17.3359H15.2075L15.1855 18.2808ZM18.1445 28L14.6069 18.2808L14.585 17.3359H15.5151L19.5947 28H18.1445ZM17.9614 24.0522V25.2095H11.9702V24.0522H17.9614ZM20.8105 16.75H22.1729V26.4619L22.0557 28H20.8105V16.75ZM27.5269 23.9717V24.1255C27.5269 24.7017 27.4585 25.2363 27.3218 25.7295C27.1851 26.2178 26.9849 26.6426 26.7212 27.0039C26.4575 27.3652 26.1353 27.646 25.7544 27.8462C25.3735 28.0464 24.9365 28.1465 24.4434 28.1465C23.9404 28.1465 23.4985 28.061 23.1177 27.8901C22.7417 27.7144 22.4243 27.4629 22.1655 27.1357C21.9067 26.8086 21.6992 26.4131 21.543 25.9492C21.3916 25.4854 21.2866 24.9629 21.228 24.3818V23.708C21.2866 23.1221 21.3916 22.5972 21.543 22.1333C21.6992 21.6694 21.9067 21.2739 22.1655 20.9468C22.4243 20.6147 22.7417 20.3633 23.1177 20.1924C23.4937 20.0166 23.9307 19.9287 24.4287 19.9287C24.9268 19.9287 25.3687 20.0264 25.7544 20.2217C26.1401 20.4121 26.4624 20.6855 26.7212 21.042C26.9849 21.3984 27.1851 21.8257 27.3218 22.3237C27.4585 22.8169 27.5269 23.3662 27.5269 23.9717ZM26.1646 24.1255V23.9717C26.1646 23.5762 26.1279 23.2051 26.0547 22.8584C25.9814 22.5068 25.8643 22.1992 25.7031 21.9355C25.542 21.667 25.3296 21.457 25.0659 21.3057C24.8022 21.1494 24.4775 21.0713 24.0918 21.0713C23.75 21.0713 23.4521 21.1299 23.1982 21.2471C22.9492 21.3643 22.7368 21.5229 22.561 21.7231C22.3853 21.9185 22.2412 22.1431 22.1289 22.397C22.0215 22.646 21.9409 22.9048 21.8872 23.1733V24.9385C21.9653 25.2803 22.0923 25.6099 22.2681 25.9272C22.4487 26.2397 22.688 26.4961 22.9858 26.6963C23.2886 26.8965 23.6621 26.9966 24.1064 26.9966C24.4727 26.9966 24.7852 26.9233 25.0439 26.7769C25.3076 26.6255 25.52 26.418 25.6812 26.1543C25.8472 25.8906 25.9692 25.5854 26.0474 25.2388C26.1255 24.8921 26.1646 24.521 26.1646 24.1255ZM32.4121 27.0332C32.7344 27.0332 33.0322 26.9673 33.3057 26.8354C33.5791 26.7036 33.8037 26.5229 33.9795 26.2935C34.1553 26.0591 34.2554 25.793 34.2798 25.4951H35.5688C35.5444 25.9639 35.3857 26.4009 35.0928 26.8062C34.8047 27.2065 34.4263 27.5312 33.9575 27.7803C33.4888 28.0244 32.9736 28.1465 32.4121 28.1465C31.8164 28.1465 31.2964 28.0415 30.8521 27.8315C30.4126 27.6216 30.0464 27.3335 29.7534 26.9673C29.4653 26.6011 29.248 26.1812 29.1016 25.7075C28.96 25.229 28.8892 24.7236 28.8892 24.1914V23.8838C28.8892 23.3516 28.96 22.8486 29.1016 22.375C29.248 21.8965 29.4653 21.4741 29.7534 21.1079C30.0464 20.7417 30.4126 20.4536 30.8521 20.2437C31.2964 20.0337 31.8164 19.9287 32.4121 19.9287C33.0322 19.9287 33.5742 20.0557 34.0381 20.3096C34.502 20.5586 34.8657 20.9004 35.1294 21.335C35.3979 21.7646 35.5444 22.2529 35.5688 22.7998H34.2798C34.2554 22.4727 34.1626 22.1772 34.0015 21.9136C33.8452 21.6499 33.6304 21.4399 33.3569 21.2837C33.0884 21.1226 32.7734 21.042 32.4121 21.042C31.9971 21.042 31.6479 21.125 31.3647 21.291C31.0864 21.4521 30.8643 21.6719 30.6982 21.9502C30.5371 22.2236 30.4199 22.5288 30.3467 22.8657C30.2783 23.1978 30.2441 23.5371 30.2441 23.8838V24.1914C30.2441 24.5381 30.2783 24.8799 30.3467 25.2168C30.415 25.5537 30.5298 25.8589 30.6909 26.1323C30.8569 26.4058 31.0791 26.6255 31.3574 26.7915C31.6406 26.9526 31.9922 27.0332 32.4121 27.0332Z",fill:e.color}),ns.default.createElement("rect",{x:"33",y:"2",width:"14",height:"13",rx:"2",fill:"#CF0000"}),ns.default.createElement("path",{d:"M41.0518 3.75781L40.8994 10.2769H39.5918L39.4331 3.75781H41.0518ZM39.3887 12.2764C39.3887 12.0436 39.4648 11.849 39.6172 11.6924C39.7738 11.5316 39.9896 11.4512 40.2646 11.4512C40.5355 11.4512 40.7492 11.5316 40.9058 11.6924C41.0623 11.849 41.1406 12.0436 41.1406 12.2764C41.1406 12.5007 41.0623 12.6932 40.9058 12.854C40.7492 13.0106 40.5355 13.0889 40.2646 13.0889C39.9896 13.0889 39.7738 13.0106 39.6172 12.854C39.4648 12.6932 39.3887 12.5007 39.3887 12.2764Z",fill:"white"})),t5=T8;var _8=(e,t)=>{if(t.length===0)return $e.default.createElement("p",null,"Applied to 0 columns.");let n=t.map(i=>e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,15);return o===0?$e.default.createElement("p",null,"Applied to ",$e.default.createElement("span",{className:"text-color-gray-important"},r),"."):$e.default.createElement("p",null,"Applied to ",$e.default.createElement("span",{className:"text-color-gray-important"},r)," and ",$e.default.createElement("span",{className:"text-color-gray-important"},o)," others.")},D8=(e,t,n)=>{if(t.length===0)return null;let r=Object.keys(e.columnIDsMap),i=t.sort((d,u)=>r.indexOf(d)-r.indexOf(u)).map(d=>e.columnIDsMap[d]).filter(d=>d!==void 0),[a,s]=Jo(i,20),l="This is likely due to incompatible dtypes.";return n.length===1&&(Object.keys(Xa).includes(n[0].condition)||n[0].condition==="most_frequent"||n[0].condition==="least_frequent")&&n[0].value===""&&(l="Please enter a number in the condition input."),s===0?$e.default.createElement("p",null,"This condition cannot be applied to ",$e.default.createElement("span",{className:"text-color-error-important"},a),". ",l):$e.default.createElement("p",null,"This condition cannot be applied to ",$e.default.createElement("span",{className:"text-color-error-important"},a)," and ",$e.default.createElement("span",{className:"text-color-error-important"},s)," others. ",l)},v8=e=>{var s,l,d;let t=e.df_format.conditional_formats.findIndex(u=>u.format_uuid===e.conditionalFormat.format_uuid),n=((s=e.sheetData.conditionalFormattingResult)==null?void 0:s.invalid_conditional_formats[e.conditionalFormat.format_uuid])||[],r=D8(e.sheetData,n,e.conditionalFormat.filters),o=B2(by[(l=e.conditionalFormat.filters[0])==null?void 0:l.condition].long_name||"contains"),i=e.conditionalFormat.color||Fr,a=e.conditionalFormat.backgroundColor||Rl;return $e.default.createElement(vm,{title:$e.default.createElement($e.default.Fragment,null,o," ",(d=e.conditionalFormat.filters[0])==null?void 0:d.value),subtitle:$e.default.createElement($e.default.Fragment,null,_8(e.sheetData,e.conditionalFormat.columnIDs)),expandedTitle:"Columns to format",isExpanded:e.openFormattingCardIndex===t,setExpanded:u=>{u?e.setOpenFormattingCardIndex(t):e.setOpenFormattingCardIndex(-1)},icon:$e.default.createElement($e.default.Fragment,null,n.length===0&&$e.default.createElement(e5,{color:i,backgroundColor:a}),n.length!==0&&$e.default.createElement(t5,{color:i,backgroundColor:a})),iconTitle:n.length!==0?`This conditional format cannot be applied to ${n.length} column${n.length===1?"":"s"} that ${n.length===1?"is":"are"} selected. Please update the filters or selected columns to fix.`:"",onDelete:()=>{let u=[...e.df_format.conditional_formats];u.splice(t,1),e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:u}))}},$e.default.createElement(tr,{sheetData:e.sheetData,selectedColumnIDs:e.conditionalFormat.columnIDs,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].columnIDs=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))},getDisplayColumnHeaderOverride:(u,c)=>{let p=n.includes(u);return G(c)+(p?" (invalid)":"")},height:"medium"}),r,$e.default.createElement(ri,{filter:e.conditionalFormat.filters[0],columnDtype:void 0,operator:"And",displayOperator:!1,setFilter:u=>{let c=[...e.df_format.conditional_formats];c[t].filters=[u],e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))},nameLength:"long_name"}),$e.default.createElement(Xt,{label:"Text Color",color:i,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].color=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))}}),$e.default.createElement(Xt,{label:"Background Color",color:a,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].backgroundColor=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))}}))},n5=v8;var r5=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,df_format:e[t].dfFormat||Ji()}},P8=()=>({format_uuid:me(),columnIDs:[],filters:[{condition:"not_empty",value:""}],color:void 0,backgroundColor:void 0}),b8=e=>{let{params:t,setParams:n}=Dn(()=>r5(e.sheetDataArray,e.selectedSheetIndex),"set_dataframe_format",e.mitoAPI,e.analysisData,50,{getBackendFromFrontend:l=>{let d=l.df_format.conditional_formats.map(u=>{let c=m({},u),p=c.filters.map(h=>{let x=m({},h),D=x.value;if(Zp(x)){let S=parseFloat(x.value);isNaN(S)||(D=S)}return x.value=D,x});return f(m({},c),{filters:p})});return f(m({},l),{df_format:f(m({},l.df_format),{conditional_formats:d})})},getFrontendFromBackend:l=>l}),[r,o]=(0,gn.useState)(-1);if(t===void 0)return gn.default.createElement(ge,{setUIState:e.setUIState});let i=e.sheetDataArray[t.sheet_index],a=t.df_format.conditional_formats,s=l=>{n(d=>jt(d,{df_format:l}))};return gn.default.createElement(Y,null,gn.default.createElement(Q,{header:"Conditional Formatting",setUIState:e.setUIState}),gn.default.createElement(q,{userProfile:e.userProfile,requiresPro:{message:"Conditional formatting is a Mito Pro feature. Please upgrade to use this feature.",mitoAPI:e.mitoAPI,featureName:"Conditional Formatting"}},gn.default.createElement(Lt,{sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:l=>{n(d=>{let u=r5(e.sheetDataArray,l);return u||f(m({},d),{sheet_index:l})}),e.setUIState(d=>f(m({},d),{selectedSheetIndex:l}))}}),gn.default.createElement(I,null,gn.default.createElement(C,null,gn.default.createElement("p",{className:"text-header-3"},"Conditional Formats"),gn.default.createElement("p",{className:"text-subtext-1 mb-10px"},"Rules applied in order. Later formatting rules overwrite earlier rules."))),a.map((l,d)=>gn.default.createElement(n5,{key:l.format_uuid+d,df_format:t.df_format,conditionalFormat:l,updateDataframeFormatParams:s,sheetData:i,openFormattingCardIndex:r,setOpenFormattingCardIndex:o})),gn.default.createElement(I,null,gn.default.createElement(j,{variant:"dark",onClick:()=>{let l=[...t.df_format.conditional_formats];return l.push(P8()),s({conditional_formats:l})}},"Add Conditional Formatting Rule"))))},o5=b8;var l5=T(_());var D1="https://docs.trymito.io/getting-started/installing-mito",i5="https://docs.trymito.io/getting-started/tutorial";var a5="https://docs.trymito.io/how-to/interacting-with-your-data",s5="https://docs.trymito.io/how-to/ai-transformations",ii="https://discord.gg/XdJSZyejJU";var v1="founders@sagacollab.com",E8=e=>l5.default.createElement(j,{className:M(e.className,"cursor-pointer"),variant:"dark",width:e.width||"medium",href:e.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL===v1?ii:`mailto:${e.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`,target:"_blank",onClick:()=>{var t;return e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}})),(t=e.mitoAPI)==null||t.log("clicked_get_support_button"),!0}},"Get Support"),ai=E8;var A8=(e,t,n)=>Ul(e)?"":qo(e,t,n),k8=(e,t,n,r)=>{let o="";for(let i=n;i<=r;i++){if(t===-1)i===-1||(o+=G(e.data[i].columnHeader));else if(i===-1)o+=e.index[t];else{let a=L2(e,i);o+=A8(e.data[i].columnData[t],e.data[i].columnDtype,e.dfFormat.columns[a])}i!==r&&(o+=" ")}return o},N8=e=>{let t=Math.min(e[0].startingRowIndex,e[0].endingRowIndex),n=Math.max(e[0].startingRowIndex,e[0].endingRowIndex),r=[e[0]];for(let o=1;oo.startingColumnIndex-i.startingColumnIndex),r},M8=(e,t)=>{let n=Math.min(t[0].startingRowIndex,t[0].endingRowIndex),r=Math.max(t[0].startingRowIndex,t[0].endingRowIndex);n===-1&&r===-1&&(r=Math.min(e.numRows-1,Wl-1));let o="";for(let i=n;i<=r;i++)t.forEach((a,s)=>{let l=Math.min(a.startingColumnIndex,a.endingColumnIndex),d=Math.max(a.startingColumnIndex,a.endingColumnIndex);l===-1&&d===-1&&(d=e.numColumns-1),o+=k8(e,i,l,d),s!==t.length-1&&(o+=" ")}),i!==r&&(o+=` +`).length-1)*14,r=((i=t.current)==null?void 0:i.scrollHeight)||0,o=Math.max(n,r);return e===""||oc3?c3:o},ym=(e,t,n)=>{var i;let r=((i=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:i.column_recon.created_columns)||[],o=(t==null?void 0:t.created_dataframe_names)||[];return r.includes(e)||o.includes(n.dfName)},h3=(e,t,n)=>{var o;return Object.values(((o=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:o.column_recon.modified_columns)||{}).includes(G(e))},g3=(e,t,n)=>{var o;return Object.values(((o=t==null?void 0:t.modified_dataframes_recons[n.dfName])==null?void 0:o.column_recon.renamed_columns)||{}).includes(G(e))};var y1="#F5F5F5",Rl="#FFFFFF",Qo="#494650",Fr="#494650",P7=e=>{var s,l,d,u,c,p,h,x,D,S,g,y;let t=Ln(e.gridState),n=e.sheetData,r=((d=(l=(s=n==null?void 0:n.dfFormat)==null?void 0:s.rows)==null?void 0:l.even)==null?void 0:d.backgroundColor)||y1,o=((p=(c=(u=n==null?void 0:n.dfFormat)==null?void 0:u.rows)==null?void 0:c.odd)==null?void 0:p.backgroundColor)||Rl,i=((D=(x=(h=n==null?void 0:n.dfFormat)==null?void 0:h.rows)==null?void 0:x.even)==null?void 0:D.color)||Qo,a=((y=(g=(S=n==null?void 0:n.dfFormat)==null?void 0:S.rows)==null?void 0:g.odd)==null?void 0:y.color)||Fr;return qa.default.createElement(qa.default.Fragment,null,n&&n.numRows>0&&Array(t.numRowsRendered).fill(0).map((w,P)=>{let N=t.startingRowIndex+P,A=Gl([n])[0],k=M("mito-grid-row",{"mito-grid-row-even":N%2===0,"mito-grid-row-odd":N%2!==0}),L=N%2===0?{backgroundColor:r,color:i}:{backgroundColor:o,color:a};return qa.default.createElement("div",{className:k,key:N,style:L},Array(t.numColumnsRendered).fill(0).map((E,b)=>{var Id,xd,Te,Dt,xt,pt,Zr,Ci;let F=t.startingColumnIndex+b,J=A[F],K=(xd=(Id=e.sheetData)==null?void 0:Id.data[F])==null?void 0:xd.columnDtype,W=((Te=e.sheetData)==null?void 0:Te.index[N])!==void 0?(Dt=e.sheetData)==null?void 0:Dt.index[N]:0,z=n.dfFormat.columns[J],Se=(pt=(xt=e.sheetData)==null?void 0:xt.data[F])==null?void 0:pt.columnData[N],nt=Un(e.gridState.selections,N,F),Kr=(Ci=(Zr=e.sheetData)==null?void 0:Zr.data[F])==null?void 0:Ci.columnHeader,$r=n==null?void 0:n.conditionalFormattingResult.results[J],It=$r?m({},$r[W]):void 0;if(nt&&(It==null?void 0:It.backgroundColor)!==void 0&&(It==null?void 0:It.backgroundColor)!==null&&(It.backgroundColor=Zy(It.backgroundColor,.4)),Se===void 0||K===void 0||Kr===void 0)return null;let ir=ym(Kr,e.uiState.dataRecon,n),Si=h3(Kr,e.uiState.dataRecon,n),Cd=M("mito-grid-cell","text-unselectable",{"mito-grid-cell-selected":nt,"mito-grid-cell-conditional-format-background-color":(It==null?void 0:It.backgroundColor)!==void 0,"mito-grid-cell-hidden":e.editorState!==void 0&&e.editorState.rowIndex===N&&e.editorState.columnIndex===F,"right-align-number-series":et(K),"recon created-recon-background-color":ir&&N%2!==0,"recon created-recon-background-color-dark":ir&&N%2===0,"recon modified-recon-background-color":Si&&N%2!==0,"recon modified-recon-background-color-dark":Si&&N%2===0}),ws=e.gridState.widthDataArray[e.gridState.sheetIndex].widthArray[F],Ts=qo(Se,K,z);return qa.default.createElement("div",{className:Cd,key:F,style:m(m({width:`${ws}px`},Qa(e.gridState.selections,e.gridState.copiedSelections,N,F,n.numRows)),It||{}),tabIndex:-1,"mito-col-index":F,"mito-row-index":N,title:Ts},Ts)}))}))},C3=qa.default.memo(P7);var Lr=T(_());var fo=T(_());function S1(e){return(0,fo.useEffect)(()=>{e.display&&e.mitoAPI.log("opened_index_header_dropdown")},[e.display]),fo.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setOpenIndexHeaderDropdown(void 0),width:"medium"},fo.default.createElement(v,{title:"Delete Rows",onClick:()=>{e.mitoAPI.editDeleteRow(e.sheetIndex,po(e.selections,e.sheetData))}}),fo.default.createElement(v,{title:"Promote Row to Header",onClick:()=>{e.mitoAPI.editPromoteRowToHeader(e.sheetIndex,e.index)}}),fo.default.createElement(ve,{isDropdownSectionSeperator:!0}),fo.default.createElement(v,{title:"Reset and Drop Index",onClick:()=>{e.mitoAPI.editResetIndex(e.sheetIndex,!0)}}),fo.default.createElement(v,{title:"Reset Index",onClick:()=>{e.mitoAPI.editResetIndex(e.sheetIndex,!1)}}))}var b7=e=>{let[t,n]=(0,Lr.useState)(void 0),r=Ln(e.gridState),i={transform:`translateY(${-Za(e.gridState).y}px)`};return Lr.default.createElement(Lr.default.Fragment,null,Lr.default.createElement("div",{className:"endo-index-headers-container"},e.sheetData.numRows>0&&Lr.default.createElement("div",{style:i},Array(r.numRowsRendered).fill(0).map((a,s)=>{let l=r.startingRowIndex+s,d=Un(e.gridState.selections,l,-1),u=M("index-header-container","text-overflow-hide","text-unselectable",{"index-header-selected":d}),c=l>=e.sheetData.numRows?"":e.sheetData.index[l];return Lr.default.createElement("div",{className:u,key:l,title:c+"",tabIndex:-1,"mito-row-index":l,"mito-col-index":-1,style:m({},Qa(e.gridState.selections,e.gridState.copiedSelections,l,-1,e.sheetData.numRows)),onContextMenu:p=>{p.preventDefault(),p.stopPropagation(),n(l)}},c,Lr.default.createElement(S1,{sheetData:e.sheetData,setOpenIndexHeaderDropdown:n,display:t===l,index:c,mitoAPI:e.mitoAPI,sheetIndex:e.sheetIndex,selections:e.gridState.selections,closeOpenEditingPopups:e.closeOpenEditingPopups}))}))))},I3=Lr.default.memo(b7);var ho=T(_());var E7=e=>{let[t,n]=(0,ho.useState)({top:0,left:0,display:"none"}),r=Ln(e.gridState),{columnID:o,columnHeader:i}=st(e.sheetData,e.editorState.rowIndex,e.editorState.columnIndex),a=fr(e.editorState.formula,e.editorState.pendingSelections,e.sheetData),s=um(a,e.editorState.editorLocation);return(0,ho.useEffect)(()=>{let l=()=>{var N;let d=(N=e.scrollAndRenderedContainerRef.current)==null?void 0:N.getBoundingClientRect();if(d===void 0)return;let u=qy(e.scrollAndRenderedContainerRef.current,e.editorState.rowIndex),c=u==null?void 0:u.getBoundingClientRect(),p=Qy(e.scrollAndRenderedContainerRef.current,e.editorState.columnIndex),h=p==null?void 0:p.getBoundingClientRect(),x,D,S,g,y=i===void 0||oo(i)?45:45+(i.length-1)*25,w=c?c.y:e.editorState.rowIndex=d.height-50&&(x=void 0,S=0);let P=h?h.x:e.editorState.columnIndex=d.width&&(D=void 0,g=0),!(x===t.top&&D===t.left&&S===t.bottom&&g===t.right)&&n({top:x,left:D,bottom:S,right:g,display:void 0})};return setTimeout(l),Ft.addEventListener("fullscreenchange",l),()=>Ft.removeEventListener("fullscreenchange",l)},[s]),o===void 0||i===void 0?ho.default.createElement(ho.default.Fragment,null):ho.default.createElement("div",{className:"floating-cell-editor",style:f(m({},t),{width:`${s}px`})},ho.default.createElement(cm,{sheetData:e.sheetData,sheetIndex:e.sheetIndex,gridState:e.gridState,editorState:e.editorState,setEditorState:e.setEditorState,setGridState:e.setGridState,setUIState:e.setUIState,scrollAndRenderedContainerRef:e.scrollAndRenderedContainerRef,containerRef:e.containerRef,mitoAPI:e.mitoAPI,currentSheetView:r,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData}))},x3=E7;var n1=123,Or=25,a3=50,Wl=1500,c1=["Shift","Meta","Alt","Control","CapsLock","NumLock","PageUp","PageDown","Unidentified"],A7=["c","z","y"];function k7(e){var E;let t=(0,be.useRef)(null),n=(0,be.useRef)(null),[r,o]=(0,be.useState)(!1),[i]=(0,be.useState)(()=>new ResizeObserver(()=>{w()})),{sheetDataArray:a,sheetIndex:s,gridState:l,setGridState:d,editorState:u,setEditorState:c,uiState:p,setUIState:h,mitoAPI:x}=e,D=a[s],S={width:((E=l.widthDataArray[l.sheetIndex])==null?void 0:E.totalWidth)||0,height:Or*Math.min((D==null?void 0:D.numRows)||0,Wl)},g=(0,be.useMemo)(()=>Ln(l),[l]),y=(0,be.useMemo)(()=>Za(l),[l]);(0,be.useEffect)(()=>{d(b=>f(m({},b),{selections:v3(b.sheetIndex,s,b.selections,b.columnIDsArray[b.sheetIndex],D),widthDataArray:Jy(b.widthDataArray,b.columnIDsArray,a),columnIDsArray:Gl(a),sheetIndex:s,copiedSelections:[]}))},[D,d,s]);let w=()=>{d(b=>{let F=n==null?void 0:n.current;if(F){let J={width:F.clientWidth,height:F.clientHeight};return f(m({},b),{viewport:J})}return b})},P=(0,be.useCallback)(b=>{b!==null&&(n.current=b,i.observe(b))},[]);(0,be.useEffect)(()=>()=>{i.disconnect()},[]);let N=b=>{let F=Yy(b,S,l.viewport,n.current);F!==void 0&&d(J=>f(m({},J),{scrollPosition:F}))},A=b=>{var F,J;if(u!==void 0){let{rowIndex:K,columnIndex:W}=es(b);if(u.rowIndex===-1&&(K!==u.rowIndex||W!==u.columnIndex))return;if(W!==void 0&&(D==null?void 0:D.data[W])!==void 0){let z=u.editorLocation==="cell"?t.current:e.mitoContainerRef.current,{selectionStart:Se,selectionEnd:nt}=Hy(z),Kr=$a((F=u.pendingSelections)==null?void 0:F.inputSelectionStart,Se),$r=$a((J=u.pendingSelections)==null?void 0:J.inputSelectionEnd,nt),It=[{startingRowIndex:K!==void 0?K:-1,endingRowIndex:K!==void 0?K:-1,startingColumnIndex:W,endingColumnIndex:W}];return d(ir=>f(m({},ir),{selections:It})),c(f(m({},u),{pendingSelections:{selections:It,inputSelectionStart:Kr,inputSelectionEnd:$r},arrowKeysScrollInFormula:!1}))}return}else{cr(t.current),o(!0);let{rowIndex:K,columnIndex:W}=es(b);if(K===void 0||W===void 0||b.button===2&&Un(l.selections,K,W))return;if(b.metaKey||b.ctrlKey){if(b.shiftKey)d(z=>{let Se=[...z.selections];return Se.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),f(m({},z),{selections:Se})});else if(K===-1)Un(l.selections,-1,W)?d(z=>f(m({},z),{selections:P3(z.selections,W)})):d(z=>{let Se=[...z.selections];return Se.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),f(m({},z),{selections:Se})});else if(Un(e.gridState.selections,K,W))d(z=>f(m({},z),{selections:[{startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}]}));else{let z=[...l.selections];z.push({startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}),d(Se=>f(m({},Se),{selections:z}))}return}else if(b.shiftKey){let z=[...l.selections];z[z.length-1]=Sm(z[z.length-1],K,W),d(Se=>f(m({},Se),{selections:z}))}else d(z=>f(m({},z),{selections:[{startingRowIndex:K,endingRowIndex:K,startingColumnIndex:W,endingColumnIndex:W}]}));W===-1&&h(z=>z.currOpenTaskpane.type==="control_panel"?f(m({},z),{currOpenTaskpane:{type:"none"}}):z)}},k=b=>{if(u!==void 0)return;cr(t.current),o(!1);let{rowIndex:F,columnIndex:J}=es(b);if(b.shiftKey||b.metaKey||b.button===2&&F&&J&&Un(l.selections,F,J))return;let K=Sm(l.selections[l.selections.length-1],F,J),W=[...l.selections];W[W.length-1]=K,D3(K,l.selections[l.selections.length-1])||d(z=>f(m({},z),{selections:W}))};(0,be.useEffect)(()=>{if(r){let b=J=>{let{rowIndex:K,columnIndex:W}=es(J);d(z=>{let Se=Sm(z.selections[z.selections.length-1],K,W),nt=[...z.selections];return nt[nt.length-1]=Se,f(m({},z),{selections:nt})})},F=t.current;return l.selections[l.selections.length-1].startingRowIndex===-1?void 0:(F==null||F.addEventListener("mousemove",b),()=>{F==null||F.removeEventListener("mousemove",b)})}},[r,l,d]);let L=b=>{let{rowIndex:F,columnIndex:J}=es(b);if(F===void 0||J===void 0||T3(F,J))return;let{startingColumnFormula:K,arrowKeysScrollInFormula:W,editingMode:z}=mo(D,e.editorState,F,J);c({rowIndex:F,columnIndex:J,formula:K,arrowKeysScrollInFormula:W,editorLocation:"cell",editingMode:z})};return(0,be.useEffect)(()=>{let b=J=>{if(u===void 0&&!c1.includes(J.key)&&!(A7.includes(J.key)||J.ctrlKey))if(jl(J.key))J.preventDefault(),d(K=>{let W=fm(K.selections[K.selections.length-1],J,D);return Ya(t.current,n.current,g,K,W.endingRowIndex,W.endingColumnIndex),f(m({},K),{selections:[W]})});else{if(J.metaKey||J.key==="Escape")return;if(J.key==="Backspace"||J.key==="Delete"){if(ts(l.selections)){let W=Ur(l.selections).map(z=>{var Se;return(Se=D==null?void 0:D.data[z])==null?void 0:Se.columnID});W!==void 0&&(e.closeOpenEditingPopups(),x.editDeleteColumn(s,W));return}else if(_3(l.selections)){e.mitoAPI.editDeleteRow(e.sheetIndex,po(l.selections,D));return}}d(K=>{let W=K.selections[K.selections.length-1],{startingColumnFormula:z,arrowKeysScrollInFormula:Se,editingMode:nt}=mo(D,void 0,W.startingRowIndex,W.startingColumnIndex,J);return c({rowIndex:W.startingRowIndex,columnIndex:W.startingColumnIndex,formula:z,arrowKeysScrollInFormula:Se,editorLocation:"cell",editingMode:nt}),J.preventDefault(),f(m({},K),{selections:[{startingRowIndex:W.startingRowIndex,endingRowIndex:W.startingRowIndex,startingColumnIndex:W.startingColumnIndex,endingColumnIndex:W.startingColumnIndex}]})});return}},F=t.current;return F==null||F.addEventListener("keydown",b),()=>F==null?void 0:F.removeEventListener("keydown",b)},[u,c,D,g,x,l.selections,s,d]),be.default.createElement(be.default.Fragment,null,be.default.createElement(o3,{sheetData:D,selection:l.selections[l.selections.length-1],sheetIndex:e.sheetIndex,editorState:u,setEditorState:e.setEditorState,gridState:e.gridState,setGridState:e.setGridState,setUIState:e.setUIState,scrollAndRenderedContainerRef:n,containerRef:t,mitoAPI:e.mitoAPI,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData}),be.default.createElement("div",{className:"endo-grid-container",ref:t,tabIndex:-1,onMouseDown:A,onMouseUp:k,onMouseLeave:()=>o(!1),onDoubleClick:L},D!==void 0&&be.default.createElement(be.default.Fragment,null,be.default.createElement(i3,{sheetData:D,uiState:p,setUIState:h,sheetIndex:s,containerRef:t,editorState:u,setEditorState:c,scrollAndRenderedContainerRef:n,gridState:l,setGridState:d,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups}),be.default.createElement(I3,{sheetData:D,gridState:l,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups,sheetIndex:s})),be.default.createElement("div",{className:"endo-scroller-and-renderer-container",ref:P,onScroll:N},be.default.createElement(l3,{setUIState:e.setUIState,sheetData:D,mitoAPI:x,uiState:e.uiState,sendFunctionStatus:e.sendFunctionStatus}),be.default.createElement("div",{id:"scroller",style:{height:`${S.height}px`,width:`${S.width}px`}}),be.default.createElement("div",{className:"endo-renderer-container",style:{transform:`translate(${l.scrollPosition.scrollLeft-y.x}px, ${l.scrollPosition.scrollTop-y.y}px)`},onContextMenu:()=>{e.mitoAPI.log("right_clicked_on_sheet_data")}},be.default.createElement(C3,{sheetData:D,gridState:l,uiState:p,editorState:u}))),D!==void 0&&u!==void 0&&u.editorLocation==="cell"&&u.rowIndex>-1&&be.default.createElement(x3,{sheetData:D,sheetIndex:s,gridState:l,editorState:u,setGridState:d,setEditorState:c,setUIState:h,scrollAndRenderedContainerRef:n,containerRef:t,mitoAPI:x,closeOpenEditingPopups:e.closeOpenEditingPopups,analysisData:e.analysisData})))}var w3=k7;var Un=(e,t,n)=>{let r=!1;return e.forEach(o=>{r=r||A3(o,t,n)}),r},A3=(e,t,n)=>{let r=e.startingRowIndexe.endingRowIndex?e.startingRowIndex:e.endingRowIndex,i=r<=t&&t<=o,a=e.startingColumnIndexe.endingColumnIndex?e.startingColumnIndex:e.endingColumnIndex,l=a<=n&&n<=s;return i&&l?!0:r<=-1&&o<=-1?l:a<=-1&&s<=-1?i:!1},T3=(e,t)=>e<=-1||t<=-1;var f1=(e,t)=>{let n=document.elementFromPoint(e,t),r,o;for(;n;){let i=n==null?void 0:n.getAttribute("mito-row-index");r=r!==void 0?r:typeof i=="string"?parseInt(i):void 0;let a=n==null?void 0:n.getAttribute("mito-col-index");if(o=o!==void 0?o:typeof a=="string"?parseInt(a):void 0,r!==void 0&&o!==void 0)return{rowIndex:r,columnIndex:o};n=n.parentElement}return{rowIndex:r,columnIndex:o}},es=e=>f1(e.clientX,e.clientY),Sm=(e,t,n)=>t===void 0||n===void 0?e:{startingRowIndex:e.startingRowIndex,endingRowIndex:t,startingColumnIndex:e.startingColumnIndex,endingColumnIndex:n},jl=e=>e==="Up"||e==="ArrowUp"||(e==="Down"||e==="ArrowDown")||(e==="Left"||e==="ArrowLeft")||(e==="Right"||e==="ArrowRight")||e==="Tab",fm=(e,t,n)=>{if(!jl(t.key))return e;let r=t.key==="Up"||t.key==="ArrowUp",o=t.key==="Down"||t.key==="ArrowDown",i=t.key==="Left"||t.key==="ArrowLeft",a=t.key==="Right"||t.key==="ArrowRight",s=t.key==="Tab",l=t.shiftKey,d=t.metaKey,u=e.startingRowIndex,c=e.endingRowIndex,p=e.startingColumnIndex,h=e.endingColumnIndex,x=Math.min((n==null?void 0:n.numRows)||0,Wl),D=(n==null?void 0:n.numColumns)||0;return r?l?d?e.endingRowIndex===0||e.endingRowIndex<=-1?c=-1:c=0:c=Math.max(e.endingRowIndex-1,-1):(d?e.startingRowIndex===0||e.startingRowIndex<=-1?u=-1:u=0:u=Math.max(e.startingRowIndex-1,-1),c=u,h=p):o?l?d?c=x-1:c=Math.min(e.endingRowIndex+1,x-1):(d?u=x-1:u=Math.min(e.startingRowIndex+1,x-1),c=u,h=p):i?l?d?e.endingColumnIndex===0||e.endingColumnIndex<=-1?h=-1:h=0:h=Math.max(e.endingColumnIndex-1,-1):(d?e.startingColumnIndex===0||e.startingColumnIndex<=-1?p=-1:p=0:p=Math.max(e.startingColumnIndex-1,-1),h=p,c=u):a?l?d?h=D-1:h=Math.min(e.endingColumnIndex+1,D-1):(d?p=D-1:p=Math.min(e.startingColumnIndex+1,D-1),h=p,c=u):s&&(l?p-1<-1?u>-1&&(p=D-1,u-=1):(p-=1,p<=-1&&u<=-1&&(p=0)):p+1>D-1?u{let t=[];return e.forEach(n=>{t=t.concat(k3(n))}),t=[...new Set(t)],t},k3=e=>{let t=Math.min(e.startingColumnIndex,e.endingColumnIndex),n=Math.max(e.startingColumnIndex,e.endingColumnIndex),r=[];for(let o=t;o<=n;o++)r.push(o);return r},N7=(e,t)=>{let n=Math.min(e.startingColumnIndex,e.endingColumnIndex),r=Math.max(e.startingColumnIndex,e.endingColumnIndex),o=[];for(let i=n;i{let n=[];return e.forEach(r=>{n=n.concat(N7(r,t))}),n},M7=(e,t)=>{let n=Math.min(e.startingRowIndex,e.endingRowIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=[];for(let i=n;i{let n=[];return e.forEach(r=>{n=n.concat(M7(r,t))}),n},ts=e=>{let t=!0;return e.forEach(n=>{(n.startingRowIndex!==-1||n.endingRowIndex!==-1)&&(t=!1)}),t},_3=e=>{let t=!0;return e.forEach(n=>{(n.startingColumnIndex!==-1||n.endingColumnIndex!==-1)&&(t=!1)}),t},O7=(e,t)=>{var a;let n=Math.min(e.startingColumnIndex,e.endingColumnIndex),r=Math.min(e.startingRowIndex,e.endingRowIndex),o=(a=t.data[n])==null?void 0:a.columnHeader,i=t.index[r];return[o,i]},F7=(e,t)=>{var a;let n=Math.max(e.startingColumnIndex,e.endingColumnIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=(a=t.data[n])==null?void 0:a.columnHeader,i=t.index[r];return[o,i]},Xy=(e,t)=>{let n=O7(e,t),r=F7(e,t);return[n,r]},Cm="1px dashed black",Im="1px solid var(--mito-purple)",Rt=".5px solid var(--mito-light-gray)",Qa=(e,t,n,r,o)=>{let i={};return e.forEach(a=>{let s=b3(a,n,r,o,Im);i.borderRight=ei(i.borderRight,s.borderRight),i.borderLeft=ei(i.borderLeft,s.borderLeft),i.borderTop=ei(i.borderTop,s.borderTop),i.borderBottom=ei(i.borderBottom,s.borderBottom)}),t.forEach(a=>{let s=b3(a,n,r,o,Cm);i.borderRight=ei(i.borderRight,s.borderRight),i.borderLeft=ei(i.borderLeft,s.borderLeft),i.borderTop=ei(i.borderTop,s.borderTop),i.borderBottom=ei(i.borderBottom,s.borderBottom)}),i},b3=(e,t,n,r,o)=>{if(!Un([e],t,n))return{borderRight:Rt,borderLeft:n!==-1?Rt:void 0};let i=e.startingRowIndexe.endingRowIndex?e.startingRowIndex:e.endingRowIndex,s=e.startingColumnIndexe.endingColumnIndex?e.startingColumnIndex:e.endingColumnIndex,d=i===t?o:void 0,u=a===t||a<=-1&&t===r-1?o:void 0,c=s===n?o:void 0,p=l===n?o:void 0;return i<=-1&&a<=-1?t<=-1?{borderTop:o,borderLeft:c||Rt,borderRight:p||Rt}:{borderLeft:c||Rt,borderRight:p||Rt,borderBottom:u}:s<=-1&&l<=-1?n<=-1?{borderTop:d,borderBottom:u,borderLeft:o,borderRight:Rt}:{borderTop:d,borderBottom:u,borderLeft:Rt,borderRight:Rt}:{borderTop:d,borderBottom:u,borderLeft:c||Rt,borderRight:p||Rt}},ei=(e,t)=>e===Cm||t===Cm?Cm:e===Im||t===Im?Im:e===Rt||t===Rt?Rt:e,D3=(e,t)=>e.startingRowIndex===t.startingRowIndex&&e.endingRowIndex===t.endingRowIndex&&e.startingColumnIndex===t.startingColumnIndex&&e.endingColumnIndex===t.endingColumnIndex,E3=(e,t)=>{if(t.lengthn.map(i=>L7(e,t,i,r,o)),L7=(e,t,n,r,o)=>{if(r===void 0||e!==t||o===void 0)return{startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:0,endingColumnIndex:0};let i=o.data.map(a=>a.columnID);if(r.length>i.length){let a=E3(r,i),s=n.startingColumnIndexn.endingColumnIndex?n.startingColumnIndex:n.endingColumnIndex,d=0,u=0;for(let D=0;Ds&&S<=l&&(u+=1)}let c=s-d,p=l-d-u;n.startingColumnIndex>-1&&n.endingColumnIndex>-1&&(c=Math.max(c,0),p=Math.max(p,0)),c>o.numColumns-1&&(c=o.numColumns-1),p>o.numColumns-1&&(p=o.numColumns-1);let h=n.startingColumnIndexn.endingColumnIndex?c:p;return{startingRowIndex:n.startingRowIndex,endingRowIndex:n.endingRowIndex,startingColumnIndex:h,endingColumnIndex:x}}else if(r.lengthn.endingColumnIndex?n.startingColumnIndex:n.endingColumnIndex,d=0,u=0;for(let D=0;Ds&&S<=l&&(u+=1)}let c=s+d,p=l+d+u,h=n.startingColumnIndexn.endingColumnIndex?c:p;return{startingRowIndex:n.startingRowIndex,endingRowIndex:n.endingRowIndex,startingColumnIndex:h,endingColumnIndex:x}}return n},P3=(e,t)=>{let n=[];return e.forEach(r=>{if(!ts([r])||!A3(r,-1,t))n.push(r);else{let o=r.startingColumnIndexr.endingColumnIndex?r.startingColumnIndex:r.endingColumnIndex;ot&&n.push({startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:t+1,endingColumnIndex:i})}}),n.length===0&&n.push({startingColumnIndex:0,endingColumnIndex:0,startingRowIndex:0,endingRowIndex:0}),n},U7=e=>e.startingRowIndex===-1&&e.endingRowIndex===-1,xm=(e,t)=>{if(t===void 0)return[];let n=[];return e.forEach(r=>{U7(r)&&(n=n.concat(k3(r)))}),n=[...new Set(n)],n.filter(r=>t.data.length>r).map(r=>{var o;return(o=t.data[r])==null?void 0:o.columnID})},B7=(e,t)=>{let n=Math.min(e.startingRowIndex,e.endingRowIndex),r=Math.max(e.startingRowIndex,e.endingRowIndex),o=[];for(let i=n;i<=r;i++)o.push(t.index[i]);return o},po=(e,t)=>{if(t===void 0)return[];let n=[];return e.forEach(r=>{r.startingColumnIndex===-1&&(r.endingColumnIndex===-1||r.endingColumnIndex===t.numColumns)&&(n=n.concat(B7(r,t)))}),n},h1=(e,t)=>t.filter(r=>r!==void 0).map(r=>[r,(e==null?void 0:e.columnDtypeMap[r])||""]).filter(([,r])=>r!==void 0&&et(r)).filter(([r])=>r!==void 0).map(([r])=>r),ti=(e,t)=>{if(t===void 0)return[];let r=Ur(e).filter(o=>t.data.length>o).map(o=>{var i;return(i=t.data[o])==null?void 0:i.columnID});return h1(t,r)};var De=T(_());var ni=T(_());function H7(e){let t=n=>{e.setUIState(r=>f(m({},r),{selectedColumnControlPanelTab:n})),e.mitoAPI.log("clicked_"+n+"_tab")};return ni.default.createElement("div",{className:"control-panel-taskpane-tab-container"},ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="filter_sort"?"selected":"unselected"),onClick:()=>t("filter_sort")},ni.default.createElement("p",null,"Filter/Sort")),ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="unique_values"?"selected":"unselected"),onClick:()=>t("unique_values")},ni.default.createElement("p",null,"Values")),ni.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="summary_stats"?"selected":"unselected"),onClick:()=>t("summary_stats")},ni.default.createElement("p",null,"Summary Stats")))}var N3=H7;var sn=T(_());var G7="Changes the dtype of the selected column in the underlying dataframe.";function C1(e){return e===void 0?"str":e.includes("bool")?"bool":e.includes("int")?"int":e.includes("float")?"float":e.includes("str")||e.includes("object")?"str":e.includes("datetime")?"datetime":e.includes("timedelta")?"timedelta":"str"}function I1(e){return[sn.default.createElement(v,{title:"bool",key:"bool",onClick:e?()=>{e("bool")}:void 0}),sn.default.createElement(v,{title:"int",key:"int",hideSubtext:!0,displaySubtextOnHover:!0,onClick:e?()=>{e("int")}:void 0}),sn.default.createElement(v,{title:"float",key:"float",onClick:e?()=>{e("float")}:void 0}),sn.default.createElement(v,{title:"str",key:"str",onClick:e?()=>{e("str")}:void 0}),sn.default.createElement(v,{title:"datetime",key:"datetime",onClick:e?()=>{e("datetime")}:void 0}),sn.default.createElement(v,{title:"timedelta",key:"timedelta",onClick:e?()=>{e("timedelta")}:void 0})]}function V7(e){let[t]=(0,sn.useState)(()=>me());async function n(r){await e.mitoAPI.editChangeColumnDtype(e.selectedSheetIndex,[e.columnID],r,t)}return sn.default.createElement(sn.default.Fragment,null,sn.default.createElement(I,{justify:"space-between",align:"center"},sn.default.createElement(C,{span:4,title:G7},sn.default.createElement("p",{className:"text-header-3"},"Dtype")),sn.default.createElement(C,{offset:2,flex:"1"},sn.default.createElement($,{value:C1(e.columnDtype),onChange:r=>{n(r)},dropdownWidth:"medium"},I1()))))}var M3=V7;var Wt=T(_());var Bn=T(_());function ri(e){let t=nm.includes(e.filter.condition)?{visibility:"hidden"}:{visibility:"visible"},n=Fy(e.columnDtype,e.nameLength),r=e.setOperator,o=e.columnDtype&&it(e.columnDtype)||e.columnDtype===void 0&&Fl[e.filter.condition]!==void 0;return Bn.default.createElement(I,{justify:"space-between",align:"center",suppressTopBottomMargin:e.suppressTopBottomMargin},Bn.default.createElement(C,{span:e.inGroup?5:4},r===void 0&&Bn.default.createElement("p",{className:"text-body-1"},"Where"),r!==void 0&&Bn.default.createElement($,{value:e.operator,onChange:i=>r(i),dropdownWidth:"small"},Bn.default.createElement(v,{title:"And"}),Bn.default.createElement(v,{title:"Or"}))),Bn.default.createElement(C,{span:7},Bn.default.createElement($,{value:e.filter.condition,onChange:i=>{e.setFilter({condition:i,value:e.filter.value})},width:"block",dropdownWidth:"medium"},n)),Bn.default.createElement(C,{span:9},Bn.default.createElement("input",{className:"mito-input element-width-block",style:t,type:o?"date":"text",value:e.filter.value,onChange:i=>{e.setFilter({condition:e.filter.condition,value:i.target.value})}})),e.deleteFilter&&Bn.default.createElement(C,null,Bn.default.createElement(at,{onClick:e.deleteFilter})))}var Tm=T(_());function x1(e){return Tm.default.createElement("div",{className:"filter-group"},e.filters.map((t,n)=>Tm.default.createElement(ri,{key:n,filter:t,operator:e.groupOperator,displayOperator:!0,setFilter:r=>{e.setFilter(n,r)},setOperator:n===0?void 0:e.setOperator,deleteFilter:()=>{e.deleteFilter(n)},inGroup:!0,columnDtype:e.columnDtype,nameLength:"short_name"})),Tm.default.createElement(j,{variant:"light",onClick:e.addFilter,width:"medium"},"+ Add a Filter"))}var j7="+ Add Filter";function R7(e){let t=()=>{e.setFilters(d=>{let u=[...d];return u.push(rm(e.columnDtype)),u})},n=()=>{e.setFilters(d=>{let u=[...d];return u.push({filters:[rm(e.columnDtype)],operator:"And"}),u})},r=d=>{e.setFilters(u=>{let c=[...u],p=c[d];return Fn(p)?(p.filters.push(rm(e.columnDtype)),c):u})},o=d=>{e.setFilters(u=>{let c=[...u];return c.splice(d,1),c})},i=(d,u)=>{e.setFilters(c=>{let p=[...c],h=p[d];return Fn(h)?(h.filters.splice(u,1),h.filters.length===0&&p.splice(d,1),p):c})},a=(d,u)=>{e.setFilters(c=>{let p=[...c];return p[d]=u,p})},s=(d,u,c)=>{e.setFilters(p=>{let h=[...p],x=h[d];return Fn(x)?(x.filters[u]=c,h):p})},l=(d,u)=>{e.setFilters(c=>{let p=[...c],h=p[d];return Fn(h)?(h.operator=u,p):c})};return Wt.default.createElement("div",null,Wt.default.createElement("div",{className:"text-header-3 mt-15px"},Wt.default.createElement("p",null," Filter ")),e.filters.map((d,u)=>Fn(d)?Wt.default.createElement(I,{justify:"space-between",align:"top"},Wt.default.createElement(C,{span:4},u===0&&Wt.default.createElement("p",{className:"text-body-1"},"Where"),u!==0&&Wt.default.createElement($,{value:e.operator,onChange:c=>e.setOperator(c),dropdownWidth:"small"},Wt.default.createElement(v,{title:"And"}),Wt.default.createElement(v,{title:"Or"}))),Wt.default.createElement(C,{span:19},Wt.default.createElement(x1,{key:u,mainOperator:e.operator,filters:d.filters,groupOperator:d.operator,setFilter:(c,p)=>{s(u,c,p)},setOperator:c=>{l(u,c)},deleteFilter:c=>{i(u,c)},addFilter:()=>r(u),columnDtype:e.columnDtype}))):Wt.default.createElement(ri,{key:u,filter:d,operator:e.operator,displayOperator:!0,setFilter:c=>{a(u,c)},setOperator:u===0?void 0:e.setOperator,deleteFilter:()=>{o(u)},columnDtype:e.columnDtype,nameLength:"short_name"})),Wt.default.createElement(rn,{text:j7,width:"medium",dropdownWidth:"medium"},Wt.default.createElement(v,{title:"Add a Filter",onClick:t}),Wt.default.createElement(v,{title:"Add a Group of Filters",onClick:n})),e.editedFilter&&Wt.default.createElement(I,{className:"text-subtext-1"},e.rowDifference>=0?`Removed an additional ${Math.abs(e.rowDifference)} rows`:`Added back ${Math.abs(e.rowDifference)} rows`))}var O3=R7;var Br=T(_());var W7=e=>{let{params:t,setParams:n}=Dn(void 0,"sort",e.mitoAPI,e.analysisData,0),r=a=>{n(s=>{let l=a;return s&&a==s.sort_direction&&(l="none"),{sheet_index:e.selectedSheetIndex,column_id:e.columnID,sort_direction:l}})},o=t&&t.sort_direction=="ascending"?"sort-button-selected":"",i=t&&t.sort_direction=="descending"?"sort-button-selected":"";return Br.default.createElement(I,{justify:"space-between",align:"center"},Br.default.createElement(C,{span:4},Br.default.createElement("p",{className:"text-header-3"},"Sort")),Br.default.createElement(C,{offset:2,flex:"1"},Br.default.createElement(I,{suppressTopBottomMargin:!0},Br.default.createElement(C,{flex:"1"},Br.default.createElement("button",{className:M("sort-button",o),onClick:()=>r("ascending")},"Ascending")),Br.default.createElement(C,{offset:1,flex:"1"},Br.default.createElement("button",{className:M("sort-button",i),onClick:()=>r("descending")},"Descending")))))},F3=W7;var Hr=T(_());function X7(e){let[t,n]=(0,Hr.useState)(void 0);async function r(){let o=await e.mitoAPI.getColumnSummaryGraph(e.selectedSheetIndex,e.columnID,"350px","100%"),i="error"in o?void 0:o.result;n(i)}return(0,Hr.useEffect)(()=>{r()},[]),(0,Hr.useEffect)(()=>{if(t!==void 0)try{new Function(t.script)()}catch(o){console.error("Failed to execute graph function",o)}},[t]),Hr.default.createElement(Hr.default.Fragment,null,t!==void 0&&Hr.default.createElement("div",{dangerouslySetInnerHTML:{__html:t.html}}),t===void 0&&Hr.default.createElement("div",null,"Loading the summary graph..."))}var L3=X7;var er=T(_());var Xl=T(_());function ln(e,t,n,r){let[o,i]=(0,Xl.useState)(!0),[a,s]=(0,Xl.useState)(e);return(0,Xl.useEffect)(()=>{(async()=>{i(!0);let d=await t(...r);if(d!==void 0&&(s(d),n!==void 0)){let u=window.structuredClone(d);n(u)}i(!1)})()},r),[a,o]}var _m=T(_());var J7=e=>_m.default.createElement(_m.default.Fragment,null,"\xA0",_m.default.createElement("span",{className:"text-color-medium-gray-important text-underline-on-hover",onClick:()=>{e.setUIState(t=>f(m({},t),{currOpenTaskpane:{type:"fill_na",startingColumnIDs:[e.columnID]}}))}},"(or Fill NaN Values)")),Dm=J7;var z7=["mean","std","min","25%","50%","75%","max","median","sum"];function K7(e){let[t,n]=ln({},async()=>{let r=await e.mitoAPI.getColumnDescribe(e.selectedSheetIndex,e.columnID);return"error"in r?void 0:r.result},void 0,[]);return er.default.createElement(er.default.Fragment,null,er.default.createElement("div",{className:"text-header-3"},er.default.createElement("p",null," Column Summary Statistics ")),er.default.createElement("div",{key:n.toString()},!n&&er.default.createElement("table",{className:"column-describe-table-container"},Object.keys(t).map(r=>{let o=t[r],i=o;return z7.includes(r)&&(i=qo(o,e.columnDtype,e.columnFormat)),i=i.substring(0,15)+(i.length>15?"...":""),er.default.createElement("tr",{className:"column-describe-table-row",key:r},er.default.createElement("th",null,r,r==="count: NaN"&&i!=="0"&&er.default.createElement(Dm,{setUIState:e.setUIState,columnID:e.columnID})),er.default.createElement("th",{title:o},i))})),n&&er.default.createElement("p",null,"Column Summary statistics are loading...")))}var U3=K7;var $e=T(_());var Fe=T(_());var $7=1e4,Z7=e=>{let t=e.emptyMessage!==void 0?e.emptyMessage:"No items to display.";return e.loading?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},"Loading items",Fe.default.createElement(Yo,null))):e.maxDisplayed||e.isSubset?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},"There are too many items to display. Search to filter down to the items you care about.")):e.numDisplayed===0?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},t)):e.message!==void 0?Fe.default.createElement(I,{justify:"center"},Fe.default.createElement("p",{className:"text-body-1 text-align-center-important"},e.message)):Fe.default.createElement(Fe.default.Fragment,null)},Y7=e=>{let t=`${e.numToggled} selected`;return e.numToggled>0&&e.numToggled===e.numToggledButNotDisplayed?t=`${e.numToggled} selected and not displayed`:e.numToggledButNotDisplayed>0&&(t=`${e.numToggled} selected, of which ${e.numToggledButNotDisplayed} not displayed`),Fe.default.createElement(Fe.default.Fragment,null,"Toggle ",e.searchString!==""?"Displayed":"All",Fe.default.createElement("span",{className:"text-color-medium-gray-important"},"\xA0(",t,")"))},q7=e=>{let[t,n]=(0,Fe.useState)(""),r=e.searchState!==void 0?e.searchState.searchString:t,o=e.searchState!==void 0?e.searchState.setSearchString:n,i=(0,Fe.useCallback)(y=>{if(y!==null){let w=y.querySelector(".multi-toggle-box-row-selected");w!==null&&vl(y,w,0)}},[]),a=e.height||"block",s=e.width||"block",l=`element-height-${a}`,d=`element-width-${s}`,u=!0,c=[],p=0,h=0,x=0,D=!1,S=Fe.default.Children.map(e.children,y=>{let w=y.props.title,P=y.props.rightText,N=y.props.toggled;N&&p++;let A=w==null||dr(w+"",r)<.8,k=w==null||dr(P+"",r)<.8;if(A&&k)return N&&h++,null;if(x>$7)return D=!0,null;x++;let L=y.props.disabled||e.disabled;return L||(c.push(y.props.index),u=u&&y.props.toggled),Fe.default.cloneElement(y,{disabled:L})}),{onToggleAll:g}=e;return Fe.default.createElement("div",{className:M("multi-toggle-box-container",l,d,e.className)},e.searchable&&Fe.default.createElement(ne,{value:r,onChange:y=>{o(y.target.value)},placeholder:"Search",width:"block",className:"mb-2px"}),Fe.default.createElement("div",{className:M("multi-toggle-box"),style:{height:e.searchable?"calc(100% - 30px)":"100%"},ref:i},Fe.default.createElement(Z7,{loading:e.loading,isSubset:e.isSubset,message:e.message,emptyMessage:e.emptyMessage,maxDisplayed:D,numDisplayed:x}),g!==void 0&&x>0&&Fe.default.createElement("div",{key:"Toggle All",className:M("multi-toggle-box-row",{"multi-toggle-box-row-selected":u}),onClick:()=>{e.disabled||g(u?[]:c)}},Fe.default.createElement("input",{key:"Toggle All",type:"checkbox",name:"Toggle All",checked:u}),Fe.default.createElement(Y7,{searchString:r,numToggled:p,numToggledButNotDisplayed:h})),S))},Gr=q7;var oi=T(_());var Q7=e=>{var t;return oi.default.createElement("div",{className:M("multi-toggle-box-row","text-overflow-hide",{"multi-toggle-box-row-selected":e.toggled,"multi-toggle-box-row-disabled":e.disabled}),onClick:()=>{e.disabled||e.onToggle()}},oi.default.createElement(I,{justify:e.rightText!==void 0?"space-between":"start",align:"center",suppressTopBottomMargin:!0},oi.default.createElement(C,{offset:1},oi.default.createElement("input",{name:"input",type:"checkbox",checked:e.toggled})),oi.default.createElement(C,{span:14},oi.default.createElement("span",{title:(t=e.title)==null?void 0:t.toString()},e.title)),e.rightText&&oi.default.createElement(C,{span:7,offset:1},e.rightText)))},hr=Q7;var B3=(o=>(o.ASCENDING_ALPHABETICAL="Ascending Value",o.DESCENDING_ALPHABETICAL="Descending Value",o.ASCENDING_PERCENT_OCCURENCE="Ascending Occurence",o.DESCENDING_PERCENT_OCCURENCE="Descending Occurence",o))(B3||{}),e8=(e,t)=>t==="Ascending Value"?e.sort(function(n,r){return n.valuer.value?1:0}):t==="Descending Value"?e.sort(function(n,r){return n.value>r.value?-1:n.value{(!r||r&&(!s.startsWith(c.current)||s.length{P.push({value:A,percentOccurence:0,countOccurence:0,isNotFiltered:!1})}),a(P),o(w.isAllData),n(!1)}let x=y=>{let w=S[y].value;return i.findIndex(P=>P.value===w)},D=y=>{e.setFilters(w=>{let P=[...w];return y.forEach(N=>{let A=Ny(e.columnDtype,N),k=P.length;P=P.filter(L=>Fn(L)||!Oy(L,A)),P.length===k&&P.push(A)}),P})},S=e8(i,d),g=ky(e.columnDtype);return $e.default.createElement($e.Fragment,null,$e.default.createElement(I,{justify:"space-between"},$e.default.createElement(C,{flex:"1",offsetRight:1},$e.default.createElement("p",{className:"text-header-2"},"Unique Values")),$e.default.createElement(C,null,$e.default.createElement($,{value:d,onChange:y=>{u(y)},width:"medium",dropdownWidth:"medium"},Object.values(B3).map(y=>$e.default.createElement(v,{key:y,title:y}))))),$e.default.createElement("div",{style:{height:"calc(100% - 40px)"}},$e.default.createElement(Gr,{loading:t,searchable:!0,searchState:{searchString:s,setSearchString:l},isSubset:!r,message:g,disabled:g!==void 0},S.map((y,w)=>{let P=qo(y.value,e.columnDtype,e.columnFormat);return P==="NaN"?$e.default.createElement(hr,{key:w,title:$e.default.createElement("span",null,P," ",$e.default.createElement(Dm,{setUIState:e.setUIState,columnID:e.columnID})),rightText:y.countOccurence+" ("+y.percentOccurence.toFixed(2).toString()+"%)",toggled:y.isNotFiltered,index:w,onToggle:()=>{let N=x(w);a(A=>{let k=A.slice();return k[N].isNotFiltered=!i[N].isNotFiltered,k}),D([y.value])}}):$e.default.createElement(hr,{key:w,title:P,rightText:y.countOccurence+" ("+y.percentOccurence.toFixed(2).toString()+"%)",toggled:y.isNotFiltered,index:w,onToggle:()=>{let N=x(w);a(A=>{let k=A.slice();return k[N].isNotFiltered=!i[N].isNotFiltered,k}),D([y.value])}})}))))}var gr=T(_());var t8="Format the selected column as a percent, choose the number of decimals, etc. This only changes the display of the column, and does not effect the underlying dataframe.";function n8(e){var n;let t=Qn((n=e.sheetData)==null?void 0:n.dfFormat.columns[e.columnID]);return et(e.columnDtype)?gr.default.createElement(gr.default.Fragment,null,gr.default.createElement(I,{justify:"space-between",align:"center"},gr.default.createElement(C,{span:4,title:t8},gr.default.createElement("p",{className:"text-header-3",title:""},"Num Type")),gr.default.createElement(C,{offset:2,flex:"1"},et(e.columnDtype)&&gr.default.createElement($,{value:t},gm(e.gridState.sheetIndex,e.sheetData,[e.columnID],e.mitoAPI,e.closeOpenEditingPopups)),!et(e.columnDtype)&&gr.default.createElement("p",{className:"text-header-3 text-align-right"},t)))):gr.default.createElement(gr.default.Fragment,null)}var G3=n8;var V3=T(_());var r8=e=>V3.default.createElement("div",{style:e.ignoreTaskpanePadding?{margin:" 0px -10px -7px -10px"}:void 0}," ",e.children),Me=r8;var o8=500;var i8=e=>{var w,P;let{columnHeader:t,columnID:n,columnFilters:r,columnDtype:o,columnFormat:i}=st(e.sheetData,e.selection.startingRowIndex,e.selection.startingColumnIndex),[a,s]=(0,De.useState)(r!==void 0?r.filters:[]),[l,d]=(0,De.useState)(r!==void 0?r.operator:"And"),[u,c]=(0,De.useState)(0),[p]=(0,De.useState)(()=>me()),h=(0,De.useCallback)(N=>{s(N),c(A=>A+1)},[]),x=(0,De.useCallback)(N=>{d(N),c(A=>A+1)},[]),[D]=(0,De.useState)(((w=e.sheetData)==null?void 0:w.numRows)||0),[S,g]=(0,De.useState)(!1);if(on(()=>{u!=0&&y()},[u],o8),Wa(()=>{s(N=>(r==null?void 0:r.filters)||N)},e.analysisData),t===void 0||n===void 0||o==null)return e.setUIState(N=>f(m({},N),{currOpenTaskpane:{type:"none"}})),De.default.createElement(De.default.Fragment,null);let y=async()=>{let N=om(a,o);N.length===0&&r!==void 0&&r.filters.length===0||(await e.mitoAPI.editFilter(e.selectedSheetIndex,n,N,l,e.tab,p),g(!0))};return De.default.createElement(De.default.Fragment,null,De.default.createElement(Y,null,De.default.createElement(Q,{header:G(t),setUIState:e.setUIState}),De.default.createElement(q,null,e.tab==="filter_sort"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(M3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,columnDtype:o,mitoAPI:e.mitoAPI,lastStepIndex:e.lastStepIndex,lastStepType:e.lastStepType}),De.default.createElement(G3,{columnID:n,mitoAPI:e.mitoAPI,gridState:e.gridState,columnDtype:o,sheetData:e.sheetData,closeOpenEditingPopups:e.closeOpenEditingPopups}),De.default.createElement(F3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI,analysisData:e.analysisData}),De.default.createElement(O3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,filters:a,setFilters:h,setOperator:x,columnDtype:o,operator:l,mitoAPI:e.mitoAPI,rowDifference:D-(((P=e.sheetData)==null?void 0:P.numRows)||0),editedFilter:S})),e.tab==="unique_values"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(H3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,filters:a,setFilters:h,mitoAPI:e.mitoAPI,columnDtype:o,columnFormat:i,setUIState:e.setUIState})),e.tab==="summary_stats"&&De.default.createElement(De.default.Fragment,null,De.default.createElement(L3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI}),De.default.createElement(U3,{selectedSheetIndex:e.selectedSheetIndex,columnID:n,mitoAPI:e.mitoAPI,columnDtype:o,columnFormat:i,setUIState:e.setUIState}))),De.default.createElement(Me,{ignoreTaskpanePadding:!0},De.default.createElement(N3,{selectedTab:e.tab,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))))},j3=i8;var bt=T(_());function w1(e){(0,bt.useEffect)(()=>{e.display&&e.mitoAPI.log("opened_column_header_dropdown")},[e.display]);let t=0,n=Object.keys(e.sheetData.columnIDsMap).indexOf(e.columnID);return bt.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setOpenColumnHeaderDropdown(!1),width:"medium"},bt.default.createElement(v,{title:"Delete Column",onClick:()=>{e.closeOpenEditingPopups();let o=Ur(e.gridState.selections).map(i=>{var a,s;return((s=(a=e.sheetData)==null?void 0:a.data[i])==null?void 0:s.columnID)||""}).filter(i=>i!=="");e.mitoAPI.editDeleteColumn(e.sheetIndex,o)}}),bt.default.createElement(v,{title:"Rename Column",onClick:()=>{e.openColumnHeaderEditor()},supressFocusSettingOnClose:!0}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Filter",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Sort",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Change Dtype",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))}}),bt.default.createElement(v,{title:"Fill NaN Values",onClick:()=>{let o=Ur(e.gridState.selections).map(i=>{var a,s;return((s=(a=e.sheetData)==null?void 0:a.data[i])==null?void 0:s.columnID)||""}).filter(i=>i!=="");e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"fill_na",startingColumnIDs:o}}))}}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Format",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort"}))},disabled:!et(e.columnDtype),tooltip:et(e.columnDtype)?void 0:"Only number columns can be formatted currently"}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"Set Column Formula",onClick:()=>{let{startingColumnFormula:r,arrowKeysScrollInFormula:o,editingMode:i}=mo(e.sheetData,void 0,t,n);e.setEditorState({rowIndex:0,columnIndex:n,formula:r,arrowKeysScrollInFormula:o,editorLocation:"cell",editingMode:i})},supressFocusSettingOnClose:!0}),bt.default.createElement(v,{title:"Split Text to Columns",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"split_text_to_columns",startingColumnID:e.columnID}}))}}),bt.default.createElement(ve,{isDropdownSectionSeperator:!0}),bt.default.createElement(v,{title:"View Unique Values",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"unique_values"}))}}),bt.default.createElement(v,{title:"View Summary Stats",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"summary_stats"}))}}))}var Jl="#494650",T1="#E8EBF8",a8="#E4EFDC",s8="#FDF3D0",l8=e=>{var k;let[t,n]=(0,Ee.useState)(!1),r=Un(e.gridState.selections,-1,e.columnIndex),o=e.gridState.widthDataArray[e.gridState.sheetIndex].widthArray[e.columnIndex],{columnID:i,columnFilters:a,columnHeader:s,columnDtype:l,headerBackgroundColor:d,headerTextColor:u}=st(e.sheetData,-1,e.columnIndex);if(i===void 0||a===void 0||l==null||s===void 0)return Ee.default.createElement(Ee.default.Fragment,null);let c=a.filters.length>0,p=e.editorState!==void 0&&e.editorState.editorLocation==="cell"&&e.editorState.rowIndex<=-1&&e.editorState.columnIndex===e.columnIndex,h=e.editorState!==void 0&&e.editorState.editorLocation==="cell"&&e.editorState.rowIndex===-1&&e.editorState.columnIndex===e.columnIndex,{lowerLevelColumnHeaders:x,finalColumnHeader:D}=Ba(s),S=Qa(e.gridState.selections,e.gridState.copiedSelections,-1,e.columnIndex,e.sheetData.numRows),g=()=>{e.setEditorState({rowIndex:-1,columnIndex:e.columnIndex,formula:G(D),editorLocation:"cell",editingMode:"specific_index_labels"})},y=()=>{e.setEditorState(void 0),setTimeout(()=>cr(e.containerRef.current),100)},w=Ee.default.createElement("div",{className:"endo-column-header-resizer",onDragStart:L=>{L.stopPropagation(),L.dataTransfer.setData("operation","resize"),L.dataTransfer.setData("mito-col-index",e.columnIndex+""),e.setColumnHeaderOperation("resize")},onDragEnd:()=>{e.setColumnHeaderOperation(void 0)},onMouseDown:L=>{L.stopPropagation()},onMouseUp:L=>{L.stopPropagation()},onClick:L=>{L.stopPropagation()},draggable:"true",onDoubleClick:()=>{let L=[...e.gridState.selections];Un(L,-1,e.columnIndex)||L.push({startingRowIndex:-1,endingRowIndex:-1,startingColumnIndex:e.columnIndex,endingColumnIndex:e.columnIndex});let b=Ur(L),F=zy(b,e.gridState,e.sheetData);e.setGridState(J=>f(m({},J),{selections:L,widthDataArray:F}))}}),P=ym(s,e.uiState.dataRecon,e.sheetData),N=g3(s,e.uiState.dataRecon,e.sheetData),A=P?a8:N?s8:d||T1;return Ee.default.createElement("div",{className:M("endo-column-header-container","endo-column-header-text",{"endo-column-header-container-selected":r,recon:P||N}),style:{color:u||Jl,backgroundColor:A},key:e.columnIndex,"mito-col-index":e.columnIndex+"",onDragStart:L=>{L.dataTransfer.setData("operation","reorder"),L.dataTransfer.setData("mito-col-index",e.columnIndex+""),e.setColumnHeaderOperation("reorder")},onDragEnd:()=>{e.setColumnHeaderOperation(void 0)},title:G(s),draggable:p?"false":"true",onContextMenu:L=>{L.preventDefault(),n(!0)}},x.map((L,E)=>{var J;let b=-1-(x.length-E),F=e.editorState!==void 0&&e.editorState.rowIndex===b&&e.editorState.columnIndex===e.columnIndex;return Ee.default.createElement("div",{className:"endo-column-header-lower-level-container",key:E,"mito-row-index":b+"","mito-col-index":e.columnIndex,style:{minHeight:Or,borderLeft:S.borderLeft,borderRight:S.borderRight,borderTop:E===0?S.borderTop:void 0,borderBottom:E{K.stopPropagation(),e.setEditorState({rowIndex:b,columnIndex:e.columnIndex,formula:G(L),editorLocation:"cell",editingMode:"specific_index_labels"})}},G(L)),F&&Ee.default.createElement("form",{style:{width:`${o-25}px`},onSubmit:async K=>{var Se;K.preventDefault();let W=((Se=e.editorState)==null?void 0:Se.formula)||G(D),z=G(L);W!==z&&(e.mitoAPI.editRenameColumn(e.gridState.sheetIndex,i,W,E),e.setUIState(nt=>nt.currOpenTaskpane.type!=="control_panel"?f(m({},nt),{currOpenTaskpane:{type:"none"}}):nt)),y()}},Ee.default.createElement(ne,{value:((J=e.editorState)==null?void 0:J.formula)||"",onChange:K=>{let W=K.target.value;e.setEditorState(z=>{if(z!==void 0)return f(m({},z),{formula:W})})},onKeyDown:K=>{K.key==="Escape"&&y()},autoFocus:!0,width:"block"})),w)}),Ee.default.createElement("div",{className:M("endo-column-header-final-container",{"endo-grabbable":e.columnHeaderOperation==="reorder"}),"mito-row-index":"-1","mito-col-index":e.columnIndex,onClick:()=>{h||e.setUIState(L=>f(m({},L),{selectedColumnControlPanelTab:"filter_sort",currOpenTaskpane:{type:"control_panel"}}))},style:{height:"100%",minHeight:"45px",width:`${o}px`,borderTop:x.length>0?Rt:S.borderTop,borderBottom:S.borderBottom,borderLeft:S.borderLeft,borderRight:S.borderRight}},!h&&Ee.default.createElement(Ee.default.Fragment,null,Ee.default.createElement("div",{className:"endo-column-header-final-text",onClick:L=>{L.stopPropagation()},onDoubleClick:L=>{L.stopPropagation(),e.setEditorState({rowIndex:-1,columnIndex:e.columnIndex,formula:G(D),editorLocation:"cell",editingMode:"specific_index_labels"})},key:e.columnIndex,tabIndex:-1},D+""),Ee.default.createElement("div",{className:"endo-column-header-final-right-side"},Ee.default.createElement("div",{className:"endo-column-header-final-icons",title:"Open the column control panel"},Ee.default.createElement("span",{title:"Edit filters"},!c&&Ee.default.createElement("div",{className:"icon-color-changer-container"},Ee.default.createElement("div",{className:"icon-hide-on-hover"},Ee.default.createElement(Ka,{purpleOrDark:"dark"})),Ee.default.createElement("div",{className:"icon-show-on-hover"},Ee.default.createElement(Ka,{purpleOrDark:"purple"}))),c&&Ee.default.createElement(Ka,{nonEmpty:!0})),Ee.default.createElement("div",{className:"icon-color-changer-container"},Ee.default.createElement("div",{className:"icon-hide-on-hover"},i1(l,"dark")),Ee.default.createElement("div",{className:"icon-show-on-hover"},i1(l,"purple")))),w)),h&&Ee.default.createElement("form",{className:"element-width-block",onSubmit:()=>{Bl(s,D,i,e.gridState.sheetIndex,e.editorState,e.setUIState,e.mitoAPI),y()}},Ee.default.createElement(ne,{value:((k=e.editorState)==null?void 0:k.formula)||"",onChange:L=>{let E=L.target.value;e.setEditorState(b=>{if(b!==void 0)return f(m({},b),{formula:E})})},onKeyDown:L=>{L.key==="Escape"&&y()},onBlur:()=>{Bl(s,D,i,e.gridState.sheetIndex,e.editorState,e.setUIState,e.mitoAPI),y()},autoFocus:!0,width:"block"}))),Ee.default.createElement(w1,{mitoAPI:e.mitoAPI,setOpenColumnHeaderDropdown:n,setUIState:e.setUIState,openColumnHeaderEditor:g,sheetIndex:e.gridState.sheetIndex,columnID:i,columnDtype:l,display:t,closeOpenEditingPopups:e.closeOpenEditingPopups,setEditorState:e.setEditorState,sheetData:e.sheetData,gridState:e.gridState}))},s3=Ee.default.memo(l8);var R3=T(_()),d8=e=>{let t=e.seperatingLine?e.px/2:e.px,n=`${t}px`,r=e.seperatingLine?".5px solid var(--mito-light-gray)":"none",o=e.seperatingLine?`${t}px`:"none";return R3.default.createElement("div",{style:{marginTop:n,border:r,marginBottom:o}})},se=d8;var zl=T(_());var W3=T(_());var u8=e=>W3.default.createElement("input",{className:"color-input",type:"color",value:e.value,onChange:t=>{e.onChange(t.target.value)}}),X3=u8;var m8=e=>zl.default.createElement(I,{justify:"space-between",align:"center"},zl.default.createElement(C,null,zl.default.createElement("p",null,e.label)),zl.default.createElement(X3,{value:e.color,onChange:e.onChange})),Xt=m8;var Jt=T(_());var go=T(_()),c8=()=>go.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#E8EBF8"}),go.default.createElement("g",{opacity:"0.05"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#494650"})),go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),go.default.createElement("g",{opacity:"0.05"},go.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#494650"})),go.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),J3=c8;var zi=T(_()),f8=()=>zi.default.createElement("svg",{width:"59",height:"46",viewBox:"0 0 59 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 1)",fill:"#ACACAD"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 12)",fill:"#F5F5F5"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 23)",fill:"white"}),zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 34)",fill:"#F5F5F5"}),zi.default.createElement("rect",{x:"1",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),z3=f8;var Ki=T(_()),p8=()=>Ki.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#549D3A"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#D0E3C9"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),Ki.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#D0E3C9"}),Ki.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),K3=p8;var $i=T(_()),h8=()=>$i.default.createElement("svg",{width:"59",height:"46",viewBox:"0 0 59 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 1)",fill:"#4D73BE"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 12)",fill:"#DAE1F0"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 23)",fill:"white"}),$i.default.createElement("rect",{width:"56",height:"11",transform:"translate(1.5 34)",fill:"#DAE1F0"}),$i.default.createElement("rect",{x:"1",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),$3=h8;var Zi=T(_()),g8=()=>Zi.default.createElement("svg",{width:"58",height:"46",viewBox:"0 0 58 46",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 1)",fill:"#BE4D4D"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 12)",fill:"#F0DADA"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 23)",fill:"white"}),Zi.default.createElement("rect",{width:"56",height:"11",transform:"translate(1 34)",fill:"#F0DADA"}),Zi.default.createElement("rect",{x:"0.5",y:"0.5",width:"57",height:"45",stroke:"#ACACAD"})),Z3=g8;var y8=e=>Jt.default.createElement(Jt.default.Fragment,null,Jt.default.createElement(I,null,Jt.default.createElement(C,null,Jt.default.createElement("p",{className:"text-header-3"},"Suggested Styles"))),Jt.default.createElement(I,{justify:"space-between",align:"center"},Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:void 0,backgroundColor:void 0},rows:{even:{color:void 0,backgroundColor:void 0},odd:{color:void 0,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(J3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:Jl,backgroundColor:"#9B9B9D"},rows:{even:{color:Qo,backgroundColor:void 0},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(z3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#549D3A"},rows:{even:{color:Qo,backgroundColor:"#D0E3C9"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(K3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#4D73BE"},rows:{even:{color:Qo,backgroundColor:"#DAE1F0"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement($3,null)),Jt.default.createElement("div",{onClick:()=>{e.updateDataframeFormatParams({headers:{color:"#FFFFFF",backgroundColor:"#8F1B15"},rows:{even:{color:Qo,backgroundColor:"#F0DADA"},odd:{color:Fr,backgroundColor:void 0}},border:{borderStyle:void 0,borderColor:void 0}})}},Jt.default.createElement(Z3,null)))),Y3=y8;var S8="#FFFFFF",Ji=()=>({columns:{},headers:{},rows:{even:{},odd:{}},border:{},conditional_formats:[]}),q3=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,df_format:e[t].dfFormat||Ji()}},C8=e=>{let{params:t,setParams:n,startNewStep:r}=Dn(()=>q3(e.sheetDataArray,e.selectedSheetIndex),"set_dataframe_format",e.mitoAPI,e.analysisData,50),o=(e.sheetDataArray[(t==null?void 0:t.sheet_index)||0]||{}).dfFormat;if(t===void 0||o===void 0)return He.default.createElement(ge,{setUIState:e.setUIState});let i=a=>{n(s=>jt(s,{df_format:a}))};return He.default.createElement(Y,null,He.default.createElement(Q,{header:"Color Dataframe",setUIState:e.setUIState}),He.default.createElement(q,{userProfile:e.userProfile,requiresPro:{message:"Setting the dataframe format is a Mito Pro feature. Please upgrade to use this feature.",mitoAPI:e.mitoAPI,featureName:"Set dataframe colors"}},He.default.createElement(Lt,{sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:a=>{r(),n(s=>{let l=q3(e.sheetDataArray,a);return l||f(m({},s),{sheet_index:a})}),e.setUIState(s=>f(m({},s),{selectedSheetIndex:a}))}}),He.default.createElement(Y3,{updateDataframeFormatParams:i}),He.default.createElement(je,{title:"Column Headers"},He.default.createElement(Xt,{label:"Background Color",color:t.df_format.headers.backgroundColor||T1,onChange:a=>i({headers:{backgroundColor:a}})}),He.default.createElement(Xt,{label:"Text Color",color:t.df_format.headers.color||Jl,onChange:a=>i({headers:{color:a}})})),He.default.createElement(se,{px:10}),He.default.createElement(je,{title:"Rows"},He.default.createElement(Xt,{label:"Even Row: Background Color",color:t.df_format.rows.even.backgroundColor||y1,onChange:a=>i({rows:{even:{backgroundColor:a}}})}),He.default.createElement(Xt,{label:"Even Row: Text Color",color:t.df_format.rows.even.color||Qo,onChange:a=>i({rows:{even:{color:a}}})}),He.default.createElement(Xt,{label:"Odd Row: Background Color",color:t.df_format.rows.odd.backgroundColor||Rl,onChange:a=>i({rows:{odd:{backgroundColor:a}}})}),He.default.createElement(Xt,{label:"Odd Row: Text Color",color:t.df_format.rows.odd.color||Fr,onChange:a=>i({rows:{odd:{color:a}}})})),He.default.createElement(se,{px:10}),He.default.createElement(je,{title:"Dataframe Border"},He.default.createElement(I,{justify:"space-between",align:"center"},He.default.createElement(C,null,He.default.createElement(de,{tooltip:"The border line will be displayed when the dataframe styling object is printed out.",textBody:!0},"Border Style")),He.default.createElement(C,null),He.default.createElement($,{value:t.df_format.border.borderStyle||"none",width:"medium",onChange:a=>i(a==="none"?{border:{borderStyle:void 0}}:{border:{borderStyle:a}})},He.default.createElement(v,{title:"none"}),He.default.createElement(v,{title:"solid"}),He.default.createElement(v,{title:"dashed"}))),He.default.createElement(Xt,{label:"Border Color",color:t.df_format.border.borderColor||S8,onChange:a=>i({border:{borderColor:a}})}))))},Q3=C8;var Ze=T(_());var dt=T(_());var I8=e=>{let t=dt.default.createElement(C,{title:"Delete conditional formatting rule"},dt.default.createElement(at,{onClick:n=>{n.stopPropagation(),e.onDelete()}}));return e.isExpanded?dt.default.createElement("div",{className:"expandable-content-card"},dt.default.createElement(I,{justify:"space-between",onClick:()=>e.setExpanded(!1)},dt.default.createElement(C,{span:12},dt.default.createElement("p",{className:"text-header-3"},e.expandedTitle)),dt.default.createElement(I,{justify:"end"},dt.default.createElement("div",{className:"mr-5px",title:"Minimize"},dt.default.createElement(Vu,null)),t)),e.children):dt.default.createElement("div",{className:"expandable-content-card",onClick:()=>e.setExpanded(!0)},dt.default.createElement(I,{suppressTopBottomMargin:!0,align:"center",justify:"start"},e.icon!==void 0&&dt.default.createElement(C,{offsetRight:1,title:e.iconTitle},e.icon),dt.default.createElement(C,{span:17.5},dt.default.createElement("div",{className:"flex flex-column"},dt.default.createElement("p",{className:"text-body-1"},e.title),dt.default.createElement("p",{className:"text-body-2"},e.subtitle))),e.icon===void 0&&dt.default.createElement(C,{offsetRight:4}),dt.default.createElement(C,null,dt.default.createElement(I,{align:"top",justify:"end",suppressTopBottomMargin:!0},dt.default.createElement("div",{className:"mr-5px",title:"Expand"},dt.default.createElement(ju,null)),t))))},vm=I8;var _1=T(_());var x8=e=>{var o,i;let t=((o=e.sheetData)==null?void 0:o.columnIDsMap)||{},n=Object.entries(((i=e.sheetData)==null?void 0:i.columnDtypeMap)||{}),r=n.map(([a])=>a);return _1.default.createElement(Gr,{searchable:!0,onToggleAll:a=>{let s=a.map(l=>r[l]);e.onChange(s)},height:"medium"},n.map(([a,s],l)=>{let d=t[a],u=e.selectedColumnIDs.includes(a),c=e.disabledColumnIDs!==void 0&&e.disabledColumnIDs.includes(a)||e.getIsDisabledColumnID!==void 0&&e.getIsDisabledColumnID(a,d,s),p=e.getDisplayColumnHeaderOverride!==void 0?e.getDisplayColumnHeaderOverride(a,d):G(d);return _1.default.createElement(hr,{key:l,index:l,title:p,rightText:C1(s),toggled:u,onToggle:()=>{let h=[...e.selectedColumnIDs];br(h,a),e.onChange(h)},disabled:c})}))},tr=x8;var Pm=T(_()),w8=e=>Pm.default.createElement("svg",{width:"47",height:"41",viewBox:"0 0 47 41",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Pm.default.createElement("rect",{width:"47",height:"41",rx:"3",fill:e.backgroundColor}),Pm.default.createElement("path",{d:"M15.1855 16.2808L11.6553 26H10.2124L14.2773 15.3359H15.2075L15.1855 16.2808ZM18.1445 26L14.6069 16.2808L14.585 15.3359H15.5151L19.5947 26H18.1445ZM17.9614 22.0522V23.2095H11.9702V22.0522H17.9614ZM20.8105 14.75H22.1729V24.4619L22.0557 26H20.8105V14.75ZM27.5269 21.9717V22.1255C27.5269 22.7017 27.4585 23.2363 27.3218 23.7295C27.1851 24.2178 26.9849 24.6426 26.7212 25.0039C26.4575 25.3652 26.1353 25.646 25.7544 25.8462C25.3735 26.0464 24.9365 26.1465 24.4434 26.1465C23.9404 26.1465 23.4985 26.061 23.1177 25.8901C22.7417 25.7144 22.4243 25.4629 22.1655 25.1357C21.9067 24.8086 21.6992 24.4131 21.543 23.9492C21.3916 23.4854 21.2866 22.9629 21.228 22.3818V21.708C21.2866 21.1221 21.3916 20.5972 21.543 20.1333C21.6992 19.6694 21.9067 19.2739 22.1655 18.9468C22.4243 18.6147 22.7417 18.3633 23.1177 18.1924C23.4937 18.0166 23.9307 17.9287 24.4287 17.9287C24.9268 17.9287 25.3687 18.0264 25.7544 18.2217C26.1401 18.4121 26.4624 18.6855 26.7212 19.042C26.9849 19.3984 27.1851 19.8257 27.3218 20.3237C27.4585 20.8169 27.5269 21.3662 27.5269 21.9717ZM26.1646 22.1255V21.9717C26.1646 21.5762 26.1279 21.2051 26.0547 20.8584C25.9814 20.5068 25.8643 20.1992 25.7031 19.9355C25.542 19.667 25.3296 19.457 25.0659 19.3057C24.8022 19.1494 24.4775 19.0713 24.0918 19.0713C23.75 19.0713 23.4521 19.1299 23.1982 19.2471C22.9492 19.3643 22.7368 19.5229 22.561 19.7231C22.3853 19.9185 22.2412 20.1431 22.1289 20.397C22.0215 20.646 21.9409 20.9048 21.8872 21.1733V22.9385C21.9653 23.2803 22.0923 23.6099 22.2681 23.9272C22.4487 24.2397 22.688 24.4961 22.9858 24.6963C23.2886 24.8965 23.6621 24.9966 24.1064 24.9966C24.4727 24.9966 24.7852 24.9233 25.0439 24.7769C25.3076 24.6255 25.52 24.418 25.6812 24.1543C25.8472 23.8906 25.9692 23.5854 26.0474 23.2388C26.1255 22.8921 26.1646 22.521 26.1646 22.1255ZM32.4121 25.0332C32.7344 25.0332 33.0322 24.9673 33.3057 24.8354C33.5791 24.7036 33.8037 24.5229 33.9795 24.2935C34.1553 24.0591 34.2554 23.793 34.2798 23.4951H35.5688C35.5444 23.9639 35.3857 24.4009 35.0928 24.8062C34.8047 25.2065 34.4263 25.5312 33.9575 25.7803C33.4888 26.0244 32.9736 26.1465 32.4121 26.1465C31.8164 26.1465 31.2964 26.0415 30.8521 25.8315C30.4126 25.6216 30.0464 25.3335 29.7534 24.9673C29.4653 24.6011 29.248 24.1812 29.1016 23.7075C28.96 23.229 28.8892 22.7236 28.8892 22.1914V21.8838C28.8892 21.3516 28.96 20.8486 29.1016 20.375C29.248 19.8965 29.4653 19.4741 29.7534 19.1079C30.0464 18.7417 30.4126 18.4536 30.8521 18.2437C31.2964 18.0337 31.8164 17.9287 32.4121 17.9287C33.0322 17.9287 33.5742 18.0557 34.0381 18.3096C34.502 18.5586 34.8657 18.9004 35.1294 19.335C35.3979 19.7646 35.5444 20.2529 35.5688 20.7998H34.2798C34.2554 20.4727 34.1626 20.1772 34.0015 19.9136C33.8452 19.6499 33.6304 19.4399 33.3569 19.2837C33.0884 19.1226 32.7734 19.042 32.4121 19.042C31.9971 19.042 31.6479 19.125 31.3647 19.291C31.0864 19.4521 30.8643 19.6719 30.6982 19.9502C30.5371 20.2236 30.4199 20.5288 30.3467 20.8657C30.2783 21.1978 30.2441 21.5371 30.2441 21.8838V22.1914C30.2441 22.5381 30.2783 22.8799 30.3467 23.2168C30.415 23.5537 30.5298 23.8589 30.6909 24.1323C30.8569 24.4058 31.0791 24.6255 31.3574 24.7915C31.6406 24.9526 31.9922 25.0332 32.4121 25.0332Z",fill:e.color})),e5=w8;var ns=T(_()),T8=e=>ns.default.createElement("svg",{width:"47",height:"43",viewBox:"0 0 47 43",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ns.default.createElement("rect",{y:"2",width:"47",height:"41",rx:"3",fill:e.backgroundColor}),ns.default.createElement("path",{d:"M15.1855 18.2808L11.6553 28H10.2124L14.2773 17.3359H15.2075L15.1855 18.2808ZM18.1445 28L14.6069 18.2808L14.585 17.3359H15.5151L19.5947 28H18.1445ZM17.9614 24.0522V25.2095H11.9702V24.0522H17.9614ZM20.8105 16.75H22.1729V26.4619L22.0557 28H20.8105V16.75ZM27.5269 23.9717V24.1255C27.5269 24.7017 27.4585 25.2363 27.3218 25.7295C27.1851 26.2178 26.9849 26.6426 26.7212 27.0039C26.4575 27.3652 26.1353 27.646 25.7544 27.8462C25.3735 28.0464 24.9365 28.1465 24.4434 28.1465C23.9404 28.1465 23.4985 28.061 23.1177 27.8901C22.7417 27.7144 22.4243 27.4629 22.1655 27.1357C21.9067 26.8086 21.6992 26.4131 21.543 25.9492C21.3916 25.4854 21.2866 24.9629 21.228 24.3818V23.708C21.2866 23.1221 21.3916 22.5972 21.543 22.1333C21.6992 21.6694 21.9067 21.2739 22.1655 20.9468C22.4243 20.6147 22.7417 20.3633 23.1177 20.1924C23.4937 20.0166 23.9307 19.9287 24.4287 19.9287C24.9268 19.9287 25.3687 20.0264 25.7544 20.2217C26.1401 20.4121 26.4624 20.6855 26.7212 21.042C26.9849 21.3984 27.1851 21.8257 27.3218 22.3237C27.4585 22.8169 27.5269 23.3662 27.5269 23.9717ZM26.1646 24.1255V23.9717C26.1646 23.5762 26.1279 23.2051 26.0547 22.8584C25.9814 22.5068 25.8643 22.1992 25.7031 21.9355C25.542 21.667 25.3296 21.457 25.0659 21.3057C24.8022 21.1494 24.4775 21.0713 24.0918 21.0713C23.75 21.0713 23.4521 21.1299 23.1982 21.2471C22.9492 21.3643 22.7368 21.5229 22.561 21.7231C22.3853 21.9185 22.2412 22.1431 22.1289 22.397C22.0215 22.646 21.9409 22.9048 21.8872 23.1733V24.9385C21.9653 25.2803 22.0923 25.6099 22.2681 25.9272C22.4487 26.2397 22.688 26.4961 22.9858 26.6963C23.2886 26.8965 23.6621 26.9966 24.1064 26.9966C24.4727 26.9966 24.7852 26.9233 25.0439 26.7769C25.3076 26.6255 25.52 26.418 25.6812 26.1543C25.8472 25.8906 25.9692 25.5854 26.0474 25.2388C26.1255 24.8921 26.1646 24.521 26.1646 24.1255ZM32.4121 27.0332C32.7344 27.0332 33.0322 26.9673 33.3057 26.8354C33.5791 26.7036 33.8037 26.5229 33.9795 26.2935C34.1553 26.0591 34.2554 25.793 34.2798 25.4951H35.5688C35.5444 25.9639 35.3857 26.4009 35.0928 26.8062C34.8047 27.2065 34.4263 27.5312 33.9575 27.7803C33.4888 28.0244 32.9736 28.1465 32.4121 28.1465C31.8164 28.1465 31.2964 28.0415 30.8521 27.8315C30.4126 27.6216 30.0464 27.3335 29.7534 26.9673C29.4653 26.6011 29.248 26.1812 29.1016 25.7075C28.96 25.229 28.8892 24.7236 28.8892 24.1914V23.8838C28.8892 23.3516 28.96 22.8486 29.1016 22.375C29.248 21.8965 29.4653 21.4741 29.7534 21.1079C30.0464 20.7417 30.4126 20.4536 30.8521 20.2437C31.2964 20.0337 31.8164 19.9287 32.4121 19.9287C33.0322 19.9287 33.5742 20.0557 34.0381 20.3096C34.502 20.5586 34.8657 20.9004 35.1294 21.335C35.3979 21.7646 35.5444 22.2529 35.5688 22.7998H34.2798C34.2554 22.4727 34.1626 22.1772 34.0015 21.9136C33.8452 21.6499 33.6304 21.4399 33.3569 21.2837C33.0884 21.1226 32.7734 21.042 32.4121 21.042C31.9971 21.042 31.6479 21.125 31.3647 21.291C31.0864 21.4521 30.8643 21.6719 30.6982 21.9502C30.5371 22.2236 30.4199 22.5288 30.3467 22.8657C30.2783 23.1978 30.2441 23.5371 30.2441 23.8838V24.1914C30.2441 24.5381 30.2783 24.8799 30.3467 25.2168C30.415 25.5537 30.5298 25.8589 30.6909 26.1323C30.8569 26.4058 31.0791 26.6255 31.3574 26.7915C31.6406 26.9526 31.9922 27.0332 32.4121 27.0332Z",fill:e.color}),ns.default.createElement("rect",{x:"33",y:"2",width:"14",height:"13",rx:"2",fill:"#CF0000"}),ns.default.createElement("path",{d:"M41.0518 3.75781L40.8994 10.2769H39.5918L39.4331 3.75781H41.0518ZM39.3887 12.2764C39.3887 12.0436 39.4648 11.849 39.6172 11.6924C39.7738 11.5316 39.9896 11.4512 40.2646 11.4512C40.5355 11.4512 40.7492 11.5316 40.9058 11.6924C41.0623 11.849 41.1406 12.0436 41.1406 12.2764C41.1406 12.5007 41.0623 12.6932 40.9058 12.854C40.7492 13.0106 40.5355 13.0889 40.2646 13.0889C39.9896 13.0889 39.7738 13.0106 39.6172 12.854C39.4648 12.6932 39.3887 12.5007 39.3887 12.2764Z",fill:"white"})),t5=T8;var _8=(e,t)=>{if(t.length===0)return Ze.default.createElement("p",null,"Applied to 0 columns.");let n=t.map(i=>e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,15);return o===0?Ze.default.createElement("p",null,"Applied to ",Ze.default.createElement("span",{className:"text-color-gray-important"},r),"."):Ze.default.createElement("p",null,"Applied to ",Ze.default.createElement("span",{className:"text-color-gray-important"},r)," and ",Ze.default.createElement("span",{className:"text-color-gray-important"},o)," others.")},D8=(e,t,n)=>{if(t.length===0)return null;let r=Object.keys(e.columnIDsMap),i=t.sort((d,u)=>r.indexOf(d)-r.indexOf(u)).map(d=>e.columnIDsMap[d]).filter(d=>d!==void 0),[a,s]=Jo(i,20),l="This is likely due to incompatible dtypes.";return n.length===1&&(Object.keys(Xa).includes(n[0].condition)||n[0].condition==="most_frequent"||n[0].condition==="least_frequent")&&n[0].value===""&&(l="Please enter a number in the condition input."),s===0?Ze.default.createElement("p",null,"This condition cannot be applied to ",Ze.default.createElement("span",{className:"text-color-error-important"},a),". ",l):Ze.default.createElement("p",null,"This condition cannot be applied to ",Ze.default.createElement("span",{className:"text-color-error-important"},a)," and ",Ze.default.createElement("span",{className:"text-color-error-important"},s)," others. ",l)},v8=e=>{var s,l,d;let t=e.df_format.conditional_formats.findIndex(u=>u.format_uuid===e.conditionalFormat.format_uuid),n=((s=e.sheetData.conditionalFormattingResult)==null?void 0:s.invalid_conditional_formats[e.conditionalFormat.format_uuid])||[],r=D8(e.sheetData,n,e.conditionalFormat.filters),o=B2(by[(l=e.conditionalFormat.filters[0])==null?void 0:l.condition].long_name||"contains"),i=e.conditionalFormat.color||Fr,a=e.conditionalFormat.backgroundColor||Rl;return Ze.default.createElement(vm,{title:Ze.default.createElement(Ze.default.Fragment,null,o," ",(d=e.conditionalFormat.filters[0])==null?void 0:d.value),subtitle:Ze.default.createElement(Ze.default.Fragment,null,_8(e.sheetData,e.conditionalFormat.columnIDs)),expandedTitle:"Columns to format",isExpanded:e.openFormattingCardIndex===t,setExpanded:u=>{u?e.setOpenFormattingCardIndex(t):e.setOpenFormattingCardIndex(-1)},icon:Ze.default.createElement(Ze.default.Fragment,null,n.length===0&&Ze.default.createElement(e5,{color:i,backgroundColor:a}),n.length!==0&&Ze.default.createElement(t5,{color:i,backgroundColor:a})),iconTitle:n.length!==0?`This conditional format cannot be applied to ${n.length} column${n.length===1?"":"s"} that ${n.length===1?"is":"are"} selected. Please update the filters or selected columns to fix.`:"",onDelete:()=>{let u=[...e.df_format.conditional_formats];u.splice(t,1),e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:u}))}},Ze.default.createElement(tr,{sheetData:e.sheetData,selectedColumnIDs:e.conditionalFormat.columnIDs,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].columnIDs=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))},getDisplayColumnHeaderOverride:(u,c)=>{let p=n.includes(u);return G(c)+(p?" (invalid)":"")},height:"medium"}),r,Ze.default.createElement(ri,{filter:e.conditionalFormat.filters[0],columnDtype:void 0,operator:"And",displayOperator:!1,setFilter:u=>{let c=[...e.df_format.conditional_formats];c[t].filters=[u],e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))},nameLength:"long_name"}),Ze.default.createElement(Xt,{label:"Text Color",color:i,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].color=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))}}),Ze.default.createElement(Xt,{label:"Background Color",color:a,onChange:u=>{let c=[...e.df_format.conditional_formats];c[t].backgroundColor=u,e.updateDataframeFormatParams(f(m({},e.df_format),{conditional_formats:c}))}}))},n5=v8;var r5=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,df_format:e[t].dfFormat||Ji()}},P8=()=>({format_uuid:me(),columnIDs:[],filters:[{condition:"not_empty",value:""}],color:void 0,backgroundColor:void 0}),b8=e=>{let{params:t,setParams:n}=Dn(()=>r5(e.sheetDataArray,e.selectedSheetIndex),"set_dataframe_format",e.mitoAPI,e.analysisData,50,{getBackendFromFrontend:l=>{let d=l.df_format.conditional_formats.map(u=>{let c=m({},u),p=c.filters.map(h=>{let x=m({},h),D=x.value;if(Zp(x)){let S=parseFloat(x.value);isNaN(S)||(D=S)}return x.value=D,x});return f(m({},c),{filters:p})});return f(m({},l),{df_format:f(m({},l.df_format),{conditional_formats:d})})},getFrontendFromBackend:l=>l}),[r,o]=(0,gn.useState)(-1);if(t===void 0)return gn.default.createElement(ge,{setUIState:e.setUIState});let i=e.sheetDataArray[t.sheet_index],a=t.df_format.conditional_formats,s=l=>{n(d=>jt(d,{df_format:l}))};return gn.default.createElement(Y,null,gn.default.createElement(Q,{header:"Conditional Formatting",setUIState:e.setUIState}),gn.default.createElement(q,{userProfile:e.userProfile,requiresPro:{message:"Conditional formatting is a Mito Pro feature. Please upgrade to use this feature.",mitoAPI:e.mitoAPI,featureName:"Conditional Formatting"}},gn.default.createElement(Lt,{sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:l=>{n(d=>{let u=r5(e.sheetDataArray,l);return u||f(m({},d),{sheet_index:l})}),e.setUIState(d=>f(m({},d),{selectedSheetIndex:l}))}}),gn.default.createElement(I,null,gn.default.createElement(C,null,gn.default.createElement("p",{className:"text-header-3"},"Conditional Formats"),gn.default.createElement("p",{className:"text-subtext-1 mb-10px"},"Rules applied in order. Later formatting rules overwrite earlier rules."))),a.map((l,d)=>gn.default.createElement(n5,{key:l.format_uuid+d,df_format:t.df_format,conditionalFormat:l,updateDataframeFormatParams:s,sheetData:i,openFormattingCardIndex:r,setOpenFormattingCardIndex:o})),gn.default.createElement(I,null,gn.default.createElement(j,{variant:"dark",onClick:()=>{let l=[...t.df_format.conditional_formats];return l.push(P8()),s({conditional_formats:l})}},"Add Conditional Formatting Rule"))))},o5=b8;var l5=T(_());var D1="https://docs.trymito.io/getting-started/installing-mito",i5="https://docs.trymito.io/getting-started/tutorial";var a5="https://docs.trymito.io/how-to/interacting-with-your-data",s5="https://docs.trymito.io/how-to/ai-transformations",ii="https://discord.gg/XdJSZyejJU";var v1="founders@sagacollab.com",E8=e=>l5.default.createElement(j,{className:M(e.className,"cursor-pointer"),variant:"dark",width:e.width||"medium",href:e.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL===v1?ii:`mailto:${e.userProfile.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`,target:"_blank",onClick:()=>{var t;return e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}})),(t=e.mitoAPI)==null||t.log("clicked_get_support_button"),!0}},"Get Support"),ai=E8;var A8=(e,t,n)=>Ul(e)?"":qo(e,t,n),k8=(e,t,n,r)=>{let o="";for(let i=n;i<=r;i++){if(t===-1)i===-1||(o+=G(e.data[i].columnHeader));else if(i===-1)o+=e.index[t];else{let a=L2(e,i);o+=A8(e.data[i].columnData[t],e.data[i].columnDtype,e.dfFormat.columns[a])}i!==r&&(o+=" ")}return o},N8=e=>{let t=Math.min(e[0].startingRowIndex,e[0].endingRowIndex),n=Math.max(e[0].startingRowIndex,e[0].endingRowIndex),r=[e[0]];for(let o=1;oo.startingColumnIndex-i.startingColumnIndex),r},M8=(e,t)=>{let n=Math.min(t[0].startingRowIndex,t[0].endingRowIndex),r=Math.max(t[0].startingRowIndex,t[0].endingRowIndex);n===-1&&r===-1&&(r=Math.min(e.numRows-1,Wl-1));let o="";for(let i=n;i<=r;i++)t.forEach((a,s)=>{let l=Math.min(a.startingColumnIndex,a.endingColumnIndex),d=Math.max(a.startingColumnIndex,a.endingColumnIndex);l===-1&&d===-1&&(d=e.numColumns-1),o+=k8(e,i,l,d),s!==t.length-1&&(o+=" ")}),i!==r&&(o+=` `);return o},d5=(e,t)=>{if(e===void 0||t.length===0)return;let n=N8(t);return[M8(e,n),n]},rs=e=>{if(navigator.clipboard&&window.isSecureContext)return navigator.clipboard.writeText(e);{let t=document.createElement("textarea");t.value=e,t.style.position="absolute",t.style.opacity="0",document.body.appendChild(t);let n=document.activeElement;return t.select(),new Promise((r,o)=>{document.execCommand("copy")?r():o(),t.remove();try{n==null||n.focus()}catch(i){console.log("Error refocusing on element",i)}})}};var O8=(e,t)=>{let n;return e.currOpenTaskpane.type==="UpdateImports"&&e.currOpenTaskpane.failedReplayData!==void 0?n="Please resolve issues with the failed replay analysis before making further edits.":t==="loading"?n="Mito is still trying to connect to the backend. Please wait a moment.":t==="non_working_extension_error"?n="Mito is installed incorrectly. Please fix your installation and try again.":t==="non_valid_location_error"?n="Mito does not currently support this location. Please use Mito in JupyerLab or Jupter Notebooks.":t==="no_backend_comm_registered_error"&&(n="Kernel has been restarted. Please rerun the cell that created this mitosheet."),n},m5=(e,t,n,r,o,i,a,s,l,d,u,c,p)=>{let h=t.sheetIndex,x=e[h],D=(x==null?void 0:x.dfFormat)||Ji(),S=t.selections[t.selections.length-1].startingRowIndex,g=t.selections[t.selections.length-1].startingColumnIndex,{columnID:y}=st(x,S,g),{startingColumnFormula:w,arrowKeysScrollInFormula:P}=mo(x,void 0,S,g),N=y,A=u.stepSummaryList[u.stepSummaryList.length-1],k=O8(i,p);return{["add column"]:{type:"add column",shortTitle:"Add Col",longTitle:"Add column",actionFunction:()=>{if(e.length===0)return;o(void 0),r();let E="new-column-"+_l(),b=t.selections[t.selections.length-1].endingColumnIndex+1;l.editAddColumn(h,E,b)},isDisabled:()=>yt(e)?k:"There are no dataframes to add columns to. Import data.",searchTerms:["add column","add col","new column","new col","insert column","insert col"],tooltip:"Add a new formula column to the right of your selection."},["catch up"]:{type:"catch up",shortTitle:"Catch Up",longTitle:"Catch up",actionFunction:()=>{l.log("click_catch_up"),l.updateCheckoutStepByIndex(-1)},isDisabled:()=>u.currStepIdx===A.step_idx?"You are on the most recent step, so there is nothing to catch up on.":void 0,searchTerms:["fast forward","catch up"],tooltip:"Go to the current state of the analysis."},["change dtype"]:{type:"change dtype",shortTitle:"Dtype",longTitle:"Change column dtype",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{toolbarDropdown:"dtype"}))},isDisabled:()=>yt(e)?k:"There are no columns to change the dtype of. Import data.",searchTerms:["change dtype","dtype","cast","boolean","string","number","float","int","datetime","date","timedelta"],tooltip:"Cast the dtype of your data column to a string, int, float, boolean, datetime, or timedelta."},["clear"]:{type:"clear",shortTitle:"Clear",longTitle:"Clear all edits",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{currOpenModal:{type:"ClearAnalysis"},currOpenTaskpane:{type:"none"},selectedTabType:"data"}))},isDisabled:()=>k,searchTerms:["clear","reset","undo","redo"],tooltip:"Removes all of the transformations you've made to imported dataframes."},["column summary"]:{type:"column summary",shortTitle:"Column Summary",longTitle:"View column summary statistics ",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"summary_stats",selectedTabType:"data"}))},isDisabled:()=>pr(N,h,e)?k:"There are no columns to summarize in the selected sheet. Add data to the sheet.",searchTerms:["column summary","describe","stats"],tooltip:"Learn about the distribution of the data in the selected column."},["copy"]:{type:"copy",shortTitle:"Copy",longTitle:"Copy",actionFunction:()=>{r();let E=d5(x,t.selections);if(E===void 0)return;let[b,F]=E;rs(b),s(J=>f(m({},J),{copiedSelections:F})),l.log("copied_data",{num_selections:t.selections.length})},isDisabled:()=>Vl(i,e)?k:"There is no selected data to copy.",searchTerms:["copy","paste","export"],tooltip:"Copy the current selection to the clipboard.",displayKeyboardShortcuts:{mac:"Cmd+C",windows:"Ctrl+C"}},["delete column"]:{type:"delete column",shortTitle:"Del Col",longTitle:"Delete columns",actionFunction:async()=>{if(o(void 0),r(),ts(t.selections)){let b=Ur(t.selections).map(F=>{var J;return((J=x==null?void 0:x.data[F])==null?void 0:J.columnID)||""}).filter(F=>F!=="");b!==void 0&&await l.editDeleteColumn(h,b)}},isDisabled:()=>yt(e)?pr(N,h,e)?ts(t.selections)?k:"The selection contains individual cells. Click on column headers to select entire columns only.":"There are no columns in the dataframe to delete. Add data to the sheet.":"There are no columns to delete. Import data.",searchTerms:["delete column","delete col","del col","del column","remove column","remove col"],tooltip:"Delete all of the selected columns from the sheet."},["delete dataframe"]:{type:"delete dataframe",shortTitle:"Delete dataframe",longTitle:"Delete dataframe",actionFunction:async()=>{h!==0&&a(E=>f(m({},E),{selectedSheetIndex:h-1})),r(),await l.editDataframeDelete(h)},isDisabled:()=>Vl(i,e)?k:"There is no selected dataframe to delete.",searchTerms:["delete","delete dataframe","delete sheet","del","del dataframe","del sheet","remove","remove dataframe","remove sheet"],tooltip:"Delete the selected sheet."},["delete graph"]:{type:"delete graph",shortTitle:"Delete Graph",longTitle:"Delete graph",actionFunction:async()=>{i.selectedGraphID&&await l.editGraphDelete(i.selectedGraphID)},isDisabled:()=>mm(i)?k:"There is no selected graph to delete.",searchTerms:["delete","delete graph","delete chart","del","del chart","del chart","remove","remove chart","remove graph"],tooltip:"Delete the selected graph."},["delete row"]:{type:"delete row",shortTitle:"Delete Row",longTitle:"Delete row",actionFunction:async()=>{let E=po(t.selections,x);E.length>0&&l.editDeleteRow(h,E)},isDisabled:()=>po(t.selections,x).length>0?k:"There are no selected rows to delete.",searchTerms:["delete","delete row","filter rows","rows","remove rows","hide rows"],tooltip:"Delete the selected rows."},["docs"]:{type:"docs",shortTitle:"Docs",longTitle:"Documentation",actionFunction:()=>{o(void 0),l.log("clicked_documentation"),window.open("https://docs.trymito.io/how-to/importing-data-to-mito","_blank")},isDisabled:()=>{},searchTerms:["docs","documentation","help","support"],tooltip:"Documentation, tutorials, and how-tos on all functionality in Mito."},["drop duplicates"]:{type:"drop duplicates",shortTitle:"Dedup",longTitle:"Deduplicate dataframe",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"drop_duplicates"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There are no dataframes to operate on. Import data.",searchTerms:["dedup","deduplicate","same","remove","drop duplicates","duplicates"],tooltip:"Remove duplicated rows from your dataframe."},["duplicate dataframe"]:{type:"duplicate dataframe",shortTitle:"Duplicate Dataframe",longTitle:"Duplicate dataframe",actionFunction:async()=>{o(void 0),await l.editDataframeDuplicate(h)},isDisabled:()=>Vl(i,e)?k:"There is no selected dataframe to duplicate.",searchTerms:["duplicate","copy"],tooltip:"Make a copy of the selected sheet."},["duplicate graph"]:{type:"duplicate graph",shortTitle:"Duplicate Graph",longTitle:"Duplicate selected graph",actionFunction:async()=>{if(o(void 0),i.selectedGraphID){let E=me();await l.editGraphDuplicate(i.selectedGraphID,E)}},isDisabled:()=>mm(i)?k:"There is no selected graph to duplicate.",searchTerms:["duplicate","copy","graph"],tooltip:"Make a copy of the selected graph."},["export"]:{type:"export",shortTitle:"Download",longTitle:"Download File Now",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"download"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There are no dataframes to export. Import data.",searchTerms:["export","download","excel","csv"],tooltip:"Download dataframes as a .csv or .xlsx file."},["export dropdown"]:{type:"export dropdown",shortTitle:"Export",longTitle:"Open Export Dropdown",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{toolbarDropdown:"export"}))},isDisabled:()=>yt(e)?k:"There are no dataframes to export. Import data.",searchTerms:["export","download","excel","csv"],tooltip:"Export dataframes as a .csv or .xlsx file."},["fill na"]:{type:"fill na",shortTitle:"Fill NaN",longTitle:"Fill NaN Values",actionFunction:()=>{o(void 0);let E=xm(t.selections,x);a(b=>f(m({},b),{currOpenTaskpane:{type:"fill_na",startingColumnIDs:E},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There is no dataframe to fill nan values within.",searchTerms:["fill nan","nan","find","replace","null","undefined","fill null","fill undefined","empty","none","blank"],tooltip:"Fill all NaN values within a dataframe or list of columns."},["filter"]:{type:"filter",shortTitle:"Filter",longTitle:"Filter column",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort",selectedTabType:"data"}))},isDisabled:()=>pr(N,h,e)?k:"There are no columns to filter in the selected sheet. Add data to the sheet.",searchTerms:["filter","remove","delete"],tooltip:"Filter this dataframe based on the data in a column."},["format number columns"]:{type:"format number columns",shortTitle:"Number",longTitle:"Format number columns",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{toolbarDropdown:"format"}))},isDisabled:()=>yt(e)?ti(t.selections,x).length>0?k:hm:"There are no columns to format. Import data.",searchTerms:["format","decimals","percent","%","scientific","Mill","Bill","round"],tooltip:"Format all of the selected columns as percents, choose the number of decimals, etc. This only changes the display of the data, and does not effect the underlying dataframe."},["fullscreen"]:{type:"fullscreen",shortTitle:"Fullscreen",longTitle:"Toggle fullscreen",actionFunction:()=>{(Ft.fullscreenElement===void 0||Ft.fullscreenElement===null)&&d.current?Ft.requestFullscreen(d.current):Ft.exitFullscreen(),l.log("button_toggle_fullscreen",{fullscreen:!!Ft.fullscreenElement})},isDisabled:()=>{},searchTerms:["fullscreen","zoom"],tooltip:"Enter fullscreen mode to see more of your data."},["graph"]:{type:"graph",shortTitle:"Graph",longTitle:"Create new graph",actionFunction:async()=>{if(o(void 0),e.length===0){a(F=>f(m({},F),{currOpenTaskpane:{type:"import_first",message:"Before graphing data, you need to import some!"}}));return}let E=me(),b=Gi(e,h);await l.editGraph(E,b,"100%","100%",me())},isDisabled:()=>yt(e)?k:"There are no dataframes to graph. Import data.",searchTerms:["graph","chart","visualize","bar chart","box plot","scatter plot","histogram"],tooltip:"Create an interactive graph. Pick from bar charts, histograms, scatter plots, etc."},["help"]:{type:"help",shortTitle:"Help",longTitle:"Help",actionFunction:()=>{o(void 0),c.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL===v1?window.open(ii,"_blank"):window.open(`mailto:${c.mitoConfig.MITO_CONFIG_SUPPORT_EMAIL}?subject=Mito support request`)},isDisabled:()=>{},searchTerms:["help","contact","support","slack","discord"],tooltip:"Join our Discord for more help."},["import dropdown"]:{type:"import dropdown",shortTitle:"Import",longTitle:"Open import dropdown",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{toolbarDropdown:"import"}))},isDisabled:()=>k,searchTerms:["import","upload","new","excel","csv","add"],tooltip:"Import any .csv or well-formatted .xlsx file as a new sheet."},["import files"]:{type:"import files",shortTitle:"Import",longTitle:"Import files",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"import files"},selectedTabType:"data"}))},isDisabled:()=>k,searchTerms:["import","upload","new","excel","csv","add"],tooltip:"Import any .csv or well-formatted .xlsx file as a new sheet."},["merge"]:{type:"merge",shortTitle:"Merge",longTitle:"Merge dataframes",actionFunction:async()=>{o(void 0),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"merge"},selectedTabType:"data"}))},isDisabled:()=>e.length>=2?k:"You need to import at least two dataframes before you can merge them.",searchTerms:["merge","join","vlookup","lookup","anti","diff","difference","unique"],tooltip:"Merge two dataframes together using a lookup, left, right, inner, or outer join. Or find the differences between two dataframes."},["concat_dataframes"]:{type:"concat_dataframes",shortTitle:"Concat",longTitle:"Concatenate dataframes",actionFunction:async()=>{o(void 0),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"concat"},selectedTabType:"data"}))},isDisabled:()=>e.length>=2?k:"You need to import at least two dataframes before you can concatenate them.",searchTerms:["stack","merge","join","concat","concatenate","append"],tooltip:"Concatenate two or more dataframes by stacking them vertically on top of eachother."},["pivot"]:{type:"pivot",shortTitle:"Pivot",longTitle:"Pivot table",actionFunction:async()=>{if(o(void 0),n[h]==="pivoted"){let E=await l.getPivotParams(h),b="error"in E?void 0:E.result;if(b!==void 0){a(F=>f(m({},F),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"pivot",sourceSheetIndex:b.sheet_index,destinationSheetIndex:h,existingPivotParams:b},selectedTabType:"data"}));return}}a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"pivot",sourceSheetIndex:h,destinationSheetIndex:void 0,existingPivotParams:void 0},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There are no sheets to pivot. Import data.",searchTerms:["pivot","group","group by","summarize","aggregate"],tooltip:"Create a Pivot Table to summarise data by breaking the data into groups and calculating statistics about each group."},["precision decrease"]:{type:"precision decrease",shortTitle:"Less",longTitle:"Decrease decimal places displayed",actionFunction:async()=>{r();let E=ti(t.selections,x),b=window.structuredClone(D);E.forEach(F=>{let J=x.columnDtypeMap[F],K=m3(m({},b.columns[F]),J);b.columns[F]=K}),l.editSetDataframeFormat(h,b)},isDisabled:()=>yt(e)?ti(t.selections,x).length>0?k:hm:"There are no columns to format. Import data.",searchTerms:["format","round","decimal","decimal places","fraction"],tooltip:"Decrease the number of decimal places that are displayed in the selected number columns."},["precision increase"]:{type:"precision increase",shortTitle:"More",longTitle:"Increase decimal places displayed",actionFunction:async()=>{r();let E=ti(t.selections,x),b=window.structuredClone(D);E.forEach(F=>{let J=x.columnDtypeMap[F],K=u3(m({},b.columns[F]),J);b.columns[F]=K}),l.editSetDataframeFormat(h,b)},isDisabled:()=>yt(e)?ti(t.selections,x).length>0?k:hm:"There are no columns to format. Import data.",searchTerms:["format","round","decimal","decimal places","fraction"],tooltip:"Increase the number of decimal places that are displayed in the selected number columns."},["promote row to header"]:{type:"promote row to header",shortTitle:"Promote to Header",longTitle:"Promote Row to header",actionFunction:async()=>{let E=po(t.selections,x);E.length>0&&l.editPromoteRowToHeader(h,E[0])},isDisabled:()=>po(t.selections,x).length>0?k:"There is no selected row to promote to header.",searchTerms:["make header","row to header","rename headers","column headers","promote row"],tooltip:"Promote the selected row to be the header of the dataframe, and delete it."},["redo"]:{type:"redo",shortTitle:"Redo",longTitle:"Redo",actionFunction:()=>{o(void 0),r(Yp),l.updateRedo()},isDisabled:()=>k,searchTerms:["redo","undo"],tooltip:"Reapplies the last step that you undid, as long as you haven't made any edits since the undo.",displayKeyboardShortcuts:{mac:"Cmd+Y",windows:"Ctrl+Y"}},["rename column"]:{type:"rename column",shortTitle:"Rename Column",longTitle:"Rename column",actionFunction:()=>{let E=st(x,-1,g).columnHeader,F=Ba(E!==void 0?E:"").finalColumnHeader;o({rowIndex:-1,columnIndex:g,formula:G(F),editorLocation:"cell",editingMode:"specific_index_labels"})},isDisabled:()=>pr(N,h,e)?k:"There are no columns in the dataframe to rename. Add data to the dataframe.",searchTerms:["rename","name","header"],tooltip:"Rename the selected column."},["rename dataframe"]:{type:"rename dataframe",shortTitle:"Rename dataframe",longTitle:"Rename dataframe",actionFunction:()=>{let E=document.querySelector(".tab-selected");if(E){let b=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});E.dispatchEvent(b)}},isDisabled:()=>Vl(i,e)?k:"There is no selected dataframe to rename.",searchTerms:["rename","name"],tooltip:"Rename the selected sheet."},["rename graph"]:{type:"rename graph",shortTitle:"Rename Graph",longTitle:"Rename graph",actionFunction:()=>{let E=document.querySelector(".tab-selected");if(E){let b=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});E.dispatchEvent(b)}},isDisabled:()=>mm(i)?k:"There is not selected graph to rename.",searchTerms:["rename","name","graph"],tooltip:"Rename the selected graph."},["see all functionality"]:{type:"see all functionality",shortTitle:"See All Functionality",longTitle:"See all functionality",actionFunction:()=>{o(void 0),l.log("clicked_documentation"),window.open("https://docs.trymito.io/how-to/importing-data-to-mito","_blank")},isDisabled:()=>{},searchTerms:["docs","documentation","help","support"],tooltip:"Documentation, tutorials, and how-tos on all functionality in Mito."},["set cell value"]:{type:"set cell value",shortTitle:"Set Cell Value",longTitle:"Set cell value",actionFunction:async()=>{N!==void 0&&(r(),o({rowIndex:S,columnIndex:g,formula:w,arrowKeysScrollInFormula:!0,editorLocation:"cell",editingMode:"specific_index_labels"}))},isDisabled:()=>!pr(N,h,e)||!a1(h,e)?"There are no cells in the dataframe to set the value of. Add data to the sheet.":S===-1?"An entire column is selected. Select a single cell to edit.":k,searchTerms:["formula","function","edit","set","set formula","set column formula"],tooltip:"Update the value of a specific cell in a data column."},["set column formula"]:{type:"set column formula",shortTitle:"Set Column Formula",longTitle:"Set column formula",actionFunction:async()=>{r(),o({rowIndex:S!==-1?S:0,columnIndex:g,formula:w,arrowKeysScrollInFormula:P,editorLocation:"cell",editingMode:"entire_column"})},isDisabled:()=>!pr(N,h,e)||!a1(h,e)?"There are no cells in the dataframe to set the formula of. Add data to the sheet.":k,searchTerms:["formula","function","edit","set","set formula","set column formula"],tooltip:"Use one of Mito's spreadsheet formulas or basic math operators to set the column's values."},["sort"]:{type:"sort",shortTitle:"Sort",longTitle:"Sort column",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"filter_sort",selectedTabType:"data"}))},isDisabled:()=>pr(N,h,e)?k:"There are no columns to sort in the selected sheet. Add data to the sheet.",searchTerms:["sort","ascending","descending","arrange"],tooltip:"Sort a column in ascending or descending order."},["split text to column"]:{type:"split text to column",shortTitle:"Split",longTitle:"Split text to columns",actionFunction:()=>{r(),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"split_text_to_columns",startingColumnID:N}}))},isDisabled:()=>pr(N,h,e)?k:"There are no columns in the selected sheet. Add data to the sheet.",searchTerms:["split","extract","parse","column","splice","text","delimiter","comma","space","tab","dash"],tooltip:"Split a column on a delimiter to break it into multiple columns."},["steps"]:{type:"steps",shortTitle:"Steps",longTitle:"Step history",actionFunction:()=>{l.log("click_open_steps"),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"steps"},selectedTabType:"data"}))},isDisabled:()=>k,searchTerms:["steps","history"],tooltip:"View a list of all the edits you've made to your data."},["undo"]:{type:"undo",shortTitle:"Undo",longTitle:"Undo",actionFunction:()=>{o(void 0),r(Yp),l.updateUndo()},isDisabled:()=>k,searchTerms:["undo","go back","redo"],tooltip:"Undo the most recent edit.",displayKeyboardShortcuts:{mac:"Cmd+Z",windows:"Ctrl+Z"}},["unique values"]:{type:"unique values",shortTitle:"Unique Vals",longTitle:"View unique values",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"control_panel"},selectedColumnControlPanelTab:"unique_values",selectedTabType:"data"}))},isDisabled:()=>pr(N,h,e)?k:"There are no columns in the selected sheet. Add data to the sheet.",searchTerms:["unique values","values","toggle","filter"],tooltip:"See a list of unique values in the column, and toggle to filter them."},["upgrade to pro"]:{type:"upgrade to pro",shortTitle:"Upgrade to Pro",longTitle:"Upgrade to Mito Pro",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"upgrade_to_pro",proOrEnterprise:"Pro"},selectedTabType:"data"}))},isDisabled:()=>k,searchTerms:["pro","upgrade","mito pro","open source"],tooltip:"Upgrade to a Mito Pro account and get access to all of Mito Pro's functionality."},["transpose"]:{type:"transpose",shortTitle:"Transpose Dataframe",longTitle:"Transpose dataframe",actionFunction:()=>{l.editTranspose(h)},isDisabled:()=>yt(e)?k:"Import data before transposing it",searchTerms:["transpose","diagonal","rows and columns","flip","rotate"],tooltip:"Switches rows and columns in a dataframe"},["melt"]:{type:"melt",shortTitle:"Unpivot",longTitle:"Unpivot dataframe",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"melt"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"Import data before trying to unpivot it",searchTerms:["Melt","Unpivot"],tooltip:"Unpivot a DataFrame from wide to long format."},["one_hot_encoding"]:{type:"one_hot_encoding",shortTitle:"One-hot Encoding",longTitle:"One-hot Encoding",actionFunction:()=>{y&&(r(),l.editOneHotEncoding(h,y))},isDisabled:()=>pr(N,h,e)?k:"There are no columns in the selected sheet. Add data to the sheet.",searchTerms:["one-hot encoding","dummies","get dummies","categorical"],tooltip:"One Hot Encoding"},["set_dataframe_format"]:{type:"set_dataframe_format",shortTitle:"Set Dataframe Colors",longTitle:"Set dataframe colors",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"set_dataframe_format"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There are no data to format. Import data before formatting.",searchTerms:["Set dataframe format","dataframe","format","color","color palette","border","highlight"],tooltip:"Change the styling of the header, rows, and border of the dataframe."},["ConditionalFormatting"]:{type:"ConditionalFormatting",shortTitle:"Conditional Formatting",longTitle:"Conditional formatting",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"ConditionalFormatting"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?k:"There is no data to format. Import data.",searchTerms:["formatting","conditional","color","background","highlight"],tooltip:"Set the background color and text color of the cell based on a condition."},["Dataframe_Import"]:{type:"Dataframe_Import",shortTitle:"Import Dataframes",longTitle:"Import dataframes",actionFunction:()=>{o(void 0),r(),a(E=>f(m({},E),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"DataframeImport"},selectedTabType:"data"}))},isDisabled:()=>k,searchTerms:["Dataframe Import"],tooltip:"Dataframe Import"},["updateImports"]:{type:"updateImports",shortTitle:"Change imports",longTitle:"Change imported data",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"UpdateImports"},selectedTabType:"data"}))},isDisabled:()=>p!=="finished"?k:void 0,searchTerms:["update","imports","replay","refresh","change"],tooltip:"Change imported data to rerun the same edits on new data."},["CodeSnippets"]:{type:"CodeSnippets",shortTitle:"Snippets",longTitle:"Code Snippets",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"CodeSnippets"},selectedTabType:"data"}))},isDisabled:()=>{},searchTerms:["CodeSnippets"],tooltip:"CodeSnippets"},["CodeOptions"]:{type:"CodeOptions",shortTitle:"Configure",longTitle:"Configure Code",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"CodeOptions"},selectedTabType:"data"}))},isDisabled:()=>{},searchTerms:["Code Options","function","parameterize"],tooltip:"Configure how the code is generated."},["Export_To_File"]:{type:"Export_To_File",shortTitle:"Download File when Executing Code",longTitle:"Download File when Executing Code",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"Export To File"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?void 0:"Import data before exporting it",searchTerms:["export","download","file"],tooltip:"Generate code that exports dataframes to files."},["reset and keep index"]:{type:"reset and keep index",shortTitle:"Reset and Keep Index",longTitle:"Reset and Keep Index",actionFunction:()=>{l.editResetIndex(h,!1)},isDisabled:()=>yt(e)?void 0:"Import data before resetting an index.",searchTerms:["reset","index"],tooltip:"Resets a dataframe's index to 0,1,2,3... Keeps the current index as a column in the dataframe."},["reset and drop index"]:{type:"reset and drop index",shortTitle:"Reset and Drop Index",longTitle:"Reset and Drop Index",actionFunction:()=>{l.editResetIndex(h,!0)},isDisabled:()=>yt(e)?void 0:"Import data before resetting an index.",searchTerms:["reset","index"],tooltip:"Resets a dataframe's index to 0,1,2,3... Removes current index entirely."},["SnowflakeImport"]:{type:"SnowflakeImport",shortTitle:"Snowflake Import",longTitle:"Snowflake Import",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"SnowflakeImport"},selectedTabType:"data"}))},isDisabled:()=>c.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT?void 0:"Snowflake Import is deactivated for this version of Mito. Please contact your admin with any questions.",searchTerms:["SQL","database","snowflake","import"],tooltip:"Import dataframe from a Snowflake data warehouse",requiredPlan:"enterprise"},["AI_Transformation"]:{type:"AI_Transformation",shortTitle:"AI",longTitle:"AI Transformation",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"AITransformation"},selectedTabType:"data"}))},isDisabled:()=>c.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION?void 0:"AI Transformation is deactivated for this version of Mito. Please contact your admin with any questions.",searchTerms:["AI Transformation"],tooltip:"AI Transformation"},["Column_Headers_Transform"]:{type:"Column_Headers_Transform",shortTitle:"Bulk column header transform",longTitle:"Bulk column headers transform",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"Column Headers Transform"},selectedTabType:"data"}))},isDisabled:()=>yt(e)?void 0:"Import data before transforming column headers",searchTerms:["Column Headers Transform","replace","uppercase","lowercase","headers"],tooltip:"Allows you to capitalize, lowercase, or replace column headers in bulk."},["UserDefinedImport"]:{type:"UserDefinedImport",shortTitle:"Custom Import",longTitle:"Custom Import",actionFunction:()=>{o(void 0),a(E=>f(m({},E),{currOpenTaskpane:{type:"UserDefinedImport"},selectedTabType:"data"}))},isDisabled:()=>{},searchTerms:["import","custom import","user defined import"],tooltip:"Import data using the custom defined imports function "}}};var c5=e=>{let t=Object.values(e);return t.sort(function(r,o){let i=r.longTitle?r.longTitle:r.shortTitle,a=o.longTitle?o.longTitle:o.shortTitle;return ia?1:0}),["see all functionality"].forEach(r=>{let o=t.findIndex(i=>i.type===r);o!==-1&&t.splice(o,1),t.push(e[r])}),t};var F8=()=>{let e=document.createElement("script");e.async=!0,e.src="https://cdn.plot.ly/plotly-latest.min.js",document.head.appendChild(e)},L8=()=>{let e=window.requirejs;e&&e(["https://cdn.plot.ly/plotly-latest.min.js"],function(t){window.Plotly=t})},U8=()=>{"Plotly"in window||(window.requirejs?L8():F8())},f5=U8;var zt=T(_());var Yi=T(_()),B8=e=>e.variant==="light"?Yi.default.createElement("svg",{width:"16",height:"15",viewBox:"0 0 16 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Yi.default.createElement("path",{d:"M1 14L7.5 7.96429L1 1V14Z",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),Yi.default.createElement("path",{d:"M8.42578 14L14.9258 7.96429L8.42578 1V14Z",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})):Yi.default.createElement("svg",{width:"14",height:"13",viewBox:"0 0 14 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Yi.default.createElement("path",{d:"M1 12.2L6.6 7L1 1V12.2Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"}),Yi.default.createElement("path",{d:"M7.39844 12.2L12.9984 7L7.39844 1V12.2Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round",strokeLinejoin:"round"})),Kl=B8;var H8=e=>zt.default.createElement("div",{className:"catch-up-popup-container"},zt.default.createElement(I,null,zt.default.createElement(C,null,zt.default.createElement("p",{className:"text-overflow-wrap"},"You are viewing a previous step, and cannot make any edits."))),zt.default.createElement(I,{onClick:e.fastForward},zt.default.createElement(C,null,zt.default.createElement(Kl,{variant:"light"})),zt.default.createElement(C,{offset:1},zt.default.createElement("p",null,zt.default.createElement("span",{className:"text-underline"}," Catch up")," to continue analysis."))),zt.default.createElement(I,{onClick:e.isPro?e.deleteStepsAfterIdx:void 0},zt.default.createElement(C,null,zt.default.createElement(Kl,{variant:"light"})),zt.default.createElement(C,{offset:1},zt.default.createElement("p",{className:M({"text-color-mito-light-purple":!e.isPro}),title:e.isPro?void 0:"Bulk step undo requires Mito Pro or Enterprise"},zt.default.createElement("span",{className:"text-underline"},"Undo hidden steps")," to work from here.")))),p5=H8;var $l=T(_());var P1=class extends $l.Component{constructor(){super(...arguments);this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(n){var r;console.error("Sheet crashing error",n),console.error("userProfile",this.props.userProfile),console.error("analysisData",this.props.analyisData),console.error("sheetDataArray",this.props.sheetDataArray),this.props.mitoAPI.log("frontend_render_failed",{error_name:n.name,error_message:n.message,error_stack:(r=n.stack)==null?void 0:r.split(` -`)})}render(){return this.state.hasError?$l.default.createElement("p",{className:"text-body-1 text-color-red p-10px"},"Looks like Mito had an error! Sorry about that. Rerun the Jupyter Cell above, and join our ",$l.default.createElement("a",{className:"text-body-1-link",href:ii,target:"_blank",rel:"noreferrer"},"Discord")," for support if this error occurs again."):this.props.children}},h5=P1;var So=T(_());var St=T(_());var b1=T(_()),G8=()=>b1.default.createElement("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b1.default.createElement("path",{d:"M1 1L4.00283 4L7 1",stroke:"#F2F2F2",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),g5=G8;var E1=T(_()),V8=()=>E1.default.createElement("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E1.default.createElement("path",{d:"M1 1L4.00283 4L7 1",stroke:"#343434",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),y5=V8;var yr=T(_()),j8=e=>e.variant==="light"?yr.default.createElement("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yr.default.createElement("path",{d:"M1 5.5874V14.3589",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M4.64453 9.67969V14.3588",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M8.28906 1V14.3588",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M11.9336 5.5874V14.3589",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"})):yr.default.createElement("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yr.default.createElement("path",{d:"M1 5.61938V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M4.64453 9.71167V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M8.28906 1.03198V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M11.9336 5.61938V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),os=j8;var Sr=T(_());var R8=(e,t)=>{let n=Object.fromEntries(Object.entries(t||{}).filter(([,r])=>r.graphParams.graphCreation.sheet_index===e));return Object.entries(n).map(([r,o])=>({graphTabName:o.graphTabName,graphID:r}))};function A1(e){var l;let t=((l=e.sheetDataArray[e.sheetIndex])==null?void 0:l.dfSource)==="imported";(0,Sr.useEffect)(()=>{e.display&&e.mitoAPI.log("clicked_data_sheet_tab_actions",{sheet_index:e.sheetIndex})},[e.display]);let n=async()=>{let d=R8(e.sheetIndex,e.graphDataDict);d.length>0?e.setUIState(u=>f(m({},u),{currOpenModal:{type:"DeleteGraphs",dependantGraphTabNamesAndIDs:d,sheetIndex:e.sheetIndex}})):(e.setUIState(u=>f(m({},u),{selectedTabType:"data",selectedSheetIndex:u.selectedSheetIndex>0?u.selectedSheetIndex-1:0})),e.closeOpenEditingPopups(),await e.mitoAPI.editDataframeDelete(e.sheetIndex))},r=async()=>{e.closeOpenEditingPopups(),await e.mitoAPI.editDataframeDuplicate(e.sheetIndex)},o=()=>{e.setIsRename(!0)},i=async()=>{let d=me(),u=Gi(e.sheetDataArray,e.sheetIndex);await e.mitoAPI.editGraph(d,u,"100%","100%",me())},s=[Sr.default.createElement(v,{key:"Create graph",title:"Create graph",onClick:d=>{d==null||d.stopPropagation(),i()}}),Sr.default.createElement(v,{key:"Export",title:"Export",onClick:async()=>{e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"download"},currOpenModal:{type:"None"}}))}}),t?Sr.default.createElement(v,{key:"Change Import",title:"Change Import",onClick:()=>{e.closeOpenEditingPopups(),e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"UpdateImports"}}))}}):void 0,Sr.default.createElement(ve,{key:"sep",isDropdownSectionSeperator:!0}),Sr.default.createElement(v,{key:"Duplicate",title:"Duplicate",onClick:r}),Sr.default.createElement(v,{key:"Rename",title:"Rename",onClick:o,supressFocusSettingOnClose:!0}),Sr.default.createElement(v,{key:"Delete",title:"Delete",onClick:d=>{d==null||d.stopPropagation(),n()}})].filter(d=>d!=null);return Sr.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setDisplayActions(!1),width:"medium"},s)}var yo=T(_());function k1(e){(0,yo.useEffect)(()=>{e.display&&e.mitoAPI.log("clicked_graph_sheet_tab_actions",{graph_id:e.graphID})},[e.display]);let t=async()=>{e.closeOpenEditingPopups(),await e.mitoAPI.editGraphDelete(e.graphID)},n=async()=>{e.closeOpenEditingPopups();let i=me();await e.mitoAPI.editGraphDuplicate(e.graphID,i)},r=()=>{e.setIsRename(!0)},o=async()=>{e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"graph",graphID:e.graphID,graphSidebarTab:"export"}}))};return yo.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setDisplayActions(!1),width:"small"},yo.default.createElement(v,{title:"Export",onClick:i=>{i==null||i.stopPropagation(),o()}}),yo.default.createElement(ve,{isDropdownSectionSeperator:!0}),yo.default.createElement(v,{title:"Duplicate",onClick:n}),yo.default.createElement(v,{title:"Rename",onClick:r,supressFocusSettingOnClose:!0}),yo.default.createElement(v,{title:"Delete",onClick:i=>{i==null||i.stopPropagation(),t()}}))}var C5=(e,t,n)=>{let r=Object.keys(e||{}),o;if(r.length>t?o=r[t]:r.length>0&&(o=r[t-1]),o!==void 0){let i=o;return n(a=>f(m({},a),{selectedGraphID:i,selectedTabType:"graph",currOpenTaskpane:{type:"graph",graphID:i}})),i}else{n(i=>f(m({},i),{selectedGraphID:void 0,selectedTabType:"data",currOpenTaskpane:{type:"none"}}));return}};function bm(e){var c,p;let t=(0,St.useRef)(null),[n,r]=(0,St.useState)(!1),[o,i]=(0,St.useState)(!1),[a,s]=(0,St.useState)(e.tabName);(0,St.useEffect)(()=>{s(e.tabName)},[e.tabName]);let l=async()=>{var x;e.closeOpenEditingPopups(),e.tabIDObj.tabType==="data"?await e.mitoAPI.editDataframeRename(e.tabIDObj.sheetIndex,a):await e.mitoAPI.editGraphRename(e.tabIDObj.graphID,a),r(!1),i(!1);let h=(x=e.mitoContainerRef.current)==null?void 0:x.querySelector(".endo-grid-container");cr(h)},d=(c=e.uiState.dataRecon)==null?void 0:c.created_dataframe_names.includes(e.tabName),u=Object.keys(((p=e.uiState.dataRecon)==null?void 0:p.modified_dataframes_recons)||{}).includes(e.tabName);return St.default.createElement("div",{className:M("tab",{"tab-graph":e.tabIDObj.tabType==="graph"},{"tab-selected":e.isSelectedTab},"cursor-pointer",{"tab-created-recon":d},{"tab-modified-recon":u}),onClick:()=>{e.tabIDObj.tabType==="graph"&&e.setEditorState(void 0),e.setUIState(h=>{if(e.tabIDObj.tabType==="data"){let x=h.currOpenTaskpane.type==="graph"?{type:"none"}:h.currOpenTaskpane;return f(m({},h),{selectedTabType:"data",selectedSheetIndex:e.tabIDObj.sheetIndex,currOpenTaskpane:x})}else return f(m({},h),{selectedTabType:"graph",selectedGraphID:e.tabIDObj.graphID,currOpenModal:{type:"None"},currOpenTaskpane:{type:"graph",graphID:e.tabIDObj.graphID}})})},onDoubleClick:()=>{i(!0)},onContextMenu:h=>{var x;h.preventDefault(),(x=t.current)==null||x.click()}},St.default.createElement("div",{className:"tab-content"},e.tabIDObj.tabType==="graph"&&St.default.createElement("div",{className:"mr-3px"},St.default.createElement(os,{variant:e.isSelectedTab?"light":void 0})),o&&St.default.createElement("form",{onSubmit:async h=>{h.preventDefault(),await l()},onBlur:l},St.default.createElement(ne,{value:a,onChange:h=>{s(h.target.value)},autoFocus:!0,onEscape:()=>{i(!1),s(e.tabName)}})),!o&&St.default.createElement("p",null,e.tabName),St.default.createElement("div",{ref:t,className:"sheet-tab-dropdown-button-div",onClick:()=>{r(!0)}},e.isSelectedTab?St.default.createElement(g5,null):St.default.createElement(y5,null))),e.tabIDObj.tabType==="data"&&St.default.createElement(A1,{setDisplayActions:r,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,setIsRename:i,sheetIndex:e.tabIDObj.sheetIndex,mitoAPI:e.mitoAPI,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,display:n&&e.tabIDObj.tabType==="data"}),e.tabIDObj.tabType==="graph"&&St.default.createElement(k1,{setDisplayActions:r,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,setIsRename:i,graphID:e.tabIDObj.graphID,mitoAPI:e.mitoAPI,graphDataDict:e.graphDataDict,display:n&&e.tabIDObj.tabType==="graph"}))}var Em=T(_()),W8=()=>Em.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Em.default.createElement("path",{d:"M7.0498 1.66016V13.7602",stroke:"#494650",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}),Em.default.createElement("path",{d:"M13.1 7.71008H1",stroke:"#494650",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),I5=W8;function X8(e){let t=e.uiState.selectedSheetIndex,n=e.uiState.selectedGraphID,r=e.uiState.selectedTabType,o=r==="graph"&&n!==void 0&&e.graphDataDict[n]!==void 0?e.graphDataDict[n].graphParams.graphCreation.sheet_index:t,i=e.sheetDataArray[o],a=e.uiState.currOpenTaskpane.type==="UpdateImports"&&e.uiState.currOpenTaskpane.failedReplayData!==void 0;return So.default.createElement("div",{className:"footer"},So.default.createElement("div",{className:M("footer-add-button","cursor-pointer"),onClick:()=>{a||e.setUIState(s=>f(m({},s),{currOpenTaskpane:{type:"import files"}}))}},So.default.createElement(I5,null)),So.default.createElement("div",{className:"footer-tab-bar scrollbar-gutter"},e.sheetDataArray.map(s=>s.dfName).map((s,l)=>So.default.createElement(bm,{key:l,tabName:s,tabIDObj:{tabType:"data",sheetIndex:l},isSelectedTab:r==="data"&&l===t,uiState:e.uiState,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,mitoAPI:e.mitoAPI,mitoContainerRef:e.mitoContainerRef,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,setEditorState:e.setEditorState})),Object.entries(e.graphDataDict||{}).map(([s,l])=>So.default.createElement(bm,{key:s,tabName:l.graphTabName,tabIDObj:{tabType:"graph",graphID:s},isSelectedTab:r==="graph"&&s===n,uiState:e.uiState,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,mitoAPI:e.mitoAPI,mitoContainerRef:e.mitoContainerRef,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,setEditorState:e.setEditorState}))),i!==void 0&&So.default.createElement("div",{className:"footer-right-side"},So.default.createElement("div",{className:"footer-sheet-shape"},"(",i.numRows," rows, ",i.numColumns," cols)")))}var x5=X8;var Cr=T(_());var nr=T(_());var J8=e=>{let t=e.modalType==="Error"?"#ED4747":"#343434",n=e.overlay!==void 0&&e.overlay;return nr.default.createElement("div",{className:M({"mito-modal-container":!n},{overlay:n})},nr.default.createElement("div",{className:M({"mito-modal-container":n})},nr.default.createElement("div",{className:M("mito-modal",{"modal-wide":e.wide})},e.setUIState!==void 0&&nr.default.createElement(I,{justify:"end"},nr.default.createElement(C,{offsetRight:.25},nr.default.createElement("div",{className:"default-taskpane-header-exit-button-div",onClick:()=>{e.setUIState!=null&&e.setUIState(r=>f(m({},r),{currOpenModal:{type:"None"}}))}},nr.default.createElement(at,null)))),nr.default.createElement("div",{className:M("mito-modal-header-text-div",{"mt-25px":e.setUIState===void 0}),style:{color:t}},nr.default.createElement("p",{className:"text-align-center-important"},e.header)),e.viewComponent&&nr.default.createElement("div",{className:"mito-modal-message"},e.viewComponent),nr.default.createElement("div",{className:"mito-modal-buttons"},e.buttons))))},si=J8;var z8=e=>{(0,Cr.useEffect)(()=>{e.mitoAPI.log("click_open_clear_analysis")},[]);let t=async()=>{e.mitoAPI.updateClear(),e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))};return Cr.default.createElement(si,{header:"Clear your current analysis?",modalType:"ClearAnalysis",viewComponent:Cr.default.createElement(Cr.default.Fragment,null,Cr.default.createElement("p",{className:"body-text-1"},"This will undo all transformations and you've made to imported dataframes and delete all of the graphs you've created.")),buttons:Cr.default.createElement(Cr.default.Fragment,null,Cr.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))}},"Close"),Cr.default.createElement(j,{variant:"dark",width:"small",onClick:t},"Clear"))})},w5=z8;var Vr=T(_());var K8=e=>{let t=e.dependantGraphTabNamesAndIDs.map(o=>o.graphID),n=e.dependantGraphTabNamesAndIDs.map(o=>o.graphTabName),r=async()=>{t.forEach(o=>{e.mitoAPI.editGraphDelete(o)}),await e.mitoAPI.editDataframeDelete(e.sheetIndex),e.setUIState(o=>f(m({},o),{selectedTabType:"data",selectedSheetIndex:o.selectedSheetIndex>0?o.selectedSheetIndex-1:0,currOpenModal:{type:"None"},currOpenTaskpane:{type:"none"}}))};return Vr.default.createElement(si,{header:"Delete Sheet and Dependant Graphs",modalType:"ClearAnalysis",viewComponent:Vr.default.createElement(Vr.default.Fragment,null,Vr.default.createElement("p",{className:"body-text-1"},"Deleting ",e.dfName," will delete the following graphs that rely on it:\xA0",Vr.default.createElement("span",{className:"text-color-mito-purple-important"},n.join(", ")))),buttons:Vr.default.createElement(Vr.default.Fragment,null,Vr.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(o=>f(m({},o),{currOpenModal:{type:"None"}}))}},"Close"),Vr.default.createElement(j,{variant:"dark",width:"large",onClick:r},"Delete Sheet and Graphs"))})},T5=K8;var Kt=T(_());var $8=e=>{let[t,n]=(0,Kt.useState)(!1);return e.error===void 0?Kt.default.createElement(Kt.default.Fragment,null):Kt.default.createElement(si,{header:e.error.errorShort,modalType:"Error",wide:!0,viewComponent:Kt.default.createElement(Kt.Fragment,null,e.error.error&&Kt.default.createElement("div",{className:"text-align-left text-body-1",onClick:()=>n(r=>!r)},e.error.error," "," ",e.error.traceback&&Kt.default.createElement("span",{className:"text-body-1-link"},"Click to view full traceback.")),e.error.traceback&&t&&Kt.default.createElement("div",{className:"flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px",style:{height:"200px",border:"1px solid var(--mito-purple)",borderRadius:"2px",padding:"5px"}},Kt.default.createElement("pre",null,e.error.traceback))),buttons:Kt.default.createElement(Kt.Fragment,null,Kt.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenModal:{type:"None"}}))}},"Close"),Kt.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))})},_5=$8;var yn=T(_());var Z8=e=>{var r,o;let[t,n]=(0,yn.useState)(!1);return yn.default.createElement(si,{header:e.header,modalType:"Error",wide:!0,viewComponent:yn.default.createElement(yn.Fragment,null,yn.default.createElement("div",{className:"text-align-left text-body-1",onClick:()=>n(i=>!i)},e.message," "," ",((r=e.error)==null?void 0:r.traceback)&&yn.default.createElement("span",{className:"text-body-1-link"},"Click to view full traceback.")),((o=e.error)==null?void 0:o.traceback)&&t&&yn.default.createElement("div",{className:"flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px",style:{height:"200px",border:"1px solid var(--mito-purple)",borderRadius:"2px",padding:"5px"}},yn.default.createElement("pre",null,e.error.traceback))),buttons:yn.default.createElement(yn.default.Fragment,null,yn.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}),yn.default.createElement(j,{variant:"dark",width:"medium",onClick:()=>{$u(e.oldAnalysisName,e.newAnalysisName,e.mitoAPI),e.setUIState(i=>f(m({},i),{currOpenModal:{type:"None"}}))}},"Start New Analysis"))})},D5=Z8;var ee=T(_());var B=T(_()),Y8=()=>B.createElement("svg",{width:172,height:129,fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scale(1.25)",margin:"100px 75px"},onClick:()=>{window.open("https://github.com/mito-ds/monorepo","_blank")}},B.createElement("g",{clipPath:"url(#a)"},B.createElement("path",{d:"m52.592 32.185 31.38 22.609",stroke:"#000",strokeWidth:5.525}),B.createElement("path",{d:"M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",fill:"#00090F"}),B.createElement("path",{d:"M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",fill:"url(#b)"}),B.createElement("path",{d:"M127.446 16.327c-3.244-1.852-7.002-2.997-10.892-3.488-6.766-.855-13.89.276-19.329 3.063-5.434 2.785-9.148 7.199-9.223 12.924l-.002.119-.079.093c-5.843 6.966-9.659 20.016-10.557 32.435-.449 6.201-.167 12.22.94 17.213.98 4.414 2.595 7.981 4.876 10.185 10.973 5.004 24.324 4.579 33.725-4.2 4.112-4.911 5.36-10.401 5.684-16.502.151-2.827.103-5.774.053-8.854l-.013-.754c-.052-3.35-.089-6.848.141-10.484l.006-.083.045-.073c7.013-11.272 8.769-19.79 7.397-25.817-.515-2.263-1.474-4.185-2.772-5.777Zm0 0c.844 1.351 3.096 3.896 3.489 5.622 1.424 6.257-.42 14.938-7.438 26.244-.223 3.577-.187 7.025-.134 10.348.003.254.008.507.012.76.05 3.073.098 6.043-.054 8.893-.328 6.176-1.598 11.84-5.858 16.918l-.014.017-.016.014c-8.937 8.36-21.315 9.34-31.965 5.426 5.714 3.396 14.266 3.799 22.595 2.16 8.998-1.77 17.592-5.896 21.881-11.009 4.278-5.1 4.913-11.662 4.946-18.411.006-1.28-.009-2.57-.025-3.856-.025-2.085-.05-4.16.018-6.165.11-3.248.462-6.369 1.463-9.17 2.857-10.047 1.252-17.428-2.702-22.506-1.295-1.663-4.459-4.094-6.198-5.285ZM79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Z",stroke:"#000",strokeWidth:1.105}),B.createElement("g",{filter:"url(#c)"},B.createElement("path",{d:"M123.137 48.094c-.921 14.487 2.423 26.813-5.96 36.805-9.657 9.033-23.41 9.346-34.564 4.096-11.757-8.734-7.874-48.46 3.484-61.999C95.75.75 151.273 2.868 123.137 48.094Z",fill:"#0081DE"}),B.createElement("path",{d:"m122.821 47.922-.045.072-.006.084c-.23 3.636-.193 7.134-.141 10.483l.013.755c.05 3.079.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.5-9.506 8.878-23.051 9.214-34.092 4.031-2.822-2.113-4.751-6.124-5.854-11.247-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.819 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.051l.04-.047.02-.056c2.375-6.458 7.575-11.182 13.626-13.934 6.054-2.755 12.93-3.522 18.62-2.094 5.676 1.423 10.163 5.024 11.529 11.026 1.372 6.027-.384 14.546-7.397 25.818Z",stroke:"#000",strokeWidth:1.105})),B.createElement("g",{filter:"url(#d)"},B.createElement("path",{d:"m85.013 75.222 26.868-2.453",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#e)"},B.createElement("path",{d:"m86.003 65.37 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#f)"},B.createElement("path",{d:"m88.856 55.66 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#g)"},B.createElement("path",{d:"m91.344 45.99 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#h)"},B.createElement("path",{d:"m88.096 80.49 12.163-41.706",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#i)"},B.createElement("path",{d:"m97.642 82.913 12.163-41.707",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("path",{d:"m109.5 23-2 1 .5 2",stroke:"#000"}),B.createElement("path",{d:"M102.743 33.484c1.514.834 3.574.173 4.6-1.477 1.025-1.65.629-3.663-.886-4.497-1.514-.834-3.574-.173-4.6 1.477-1.025 1.65-.629 3.663.886 4.497Z",fill:"#000"}),B.createElement("path",{d:"m88.975 91.492-10.787 33.683M110.007 92.21l15.69 35.99M123.199 47.411l31.38 22.61",stroke:"#000",strokeWidth:5.525}),B.createElement("path",{d:"M106.609 16.93c-1.961-.93-3.391-.23-4.422.383.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.256-.734-2.83-2.583-3.707ZM117.727 20.447c-1.961-.93-3.391-.231-4.422.382.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.255-.734-2.83-2.583-3.706Z",stroke:"#000",strokeWidth:1.105}),B.createElement("mask",{id:"j",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:103,y:17,width:3,height:2},B.createElement("path",{d:"M104.29 18.863c.484.23 1.073.047 1.317-.408.244-.455.05-1.01-.434-1.24-.484-.23-1.073-.046-1.317.409-.244.455-.049 1.01.434 1.24Z",fill:"#fff"})),B.createElement("g",{mask:"url(#j)"},B.createElement("path",{d:"M104.641 17.996a.166.166 0 0 1 .09-.077.09.09 0 0 1 .064.002l-1.01 1.885c.984.466 2.248.114 2.788-.893l-1.932-.917Zm.154-.075c.013.006.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.163.163 0 0 1-.09.077.091.091 0 0 1-.064-.002l1.01-1.884c-.984-.467-2.248-.115-2.788.893l1.932.916Zm-.154.075a.083.083 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.917c.54-1.008.089-2.174-.895-2.64l-1.01 1.884Z",fill:"#000"})),B.createElement("mask",{id:"k",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:115,y:21,width:3,height:3},B.createElement("path",{d:"M116.058 23.016c.484.229 1.073.046 1.317-.409.244-.455.049-1.01-.434-1.24-.484-.229-1.073-.046-1.317.41-.244.454-.05 1.01.434 1.239Z",fill:"#fff"})),B.createElement("g",{mask:"url(#k)"},B.createElement("path",{d:"M116.409 22.149a.163.163 0 0 1 .09-.077.091.091 0 0 1 .064.001l-1.01 1.885c.984.467 2.248.115 2.788-.893l-1.932-.916Zm.154-.076c.013.007.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.166.166 0 0 1-.09.077.091.091 0 0 1-.064-.001l1.01-1.885c-.984-.467-2.249-.114-2.788.893l1.932.916Zm-.154.076a.084.084 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.916c.54-1.007.089-2.173-.895-2.64l-1.01 1.885Z",fill:"#000"}))),B.createElement("rect",{y:13,width:100,height:22,rx:11,fill:"#000"}),B.createElement("path",{d:"m13.5 18.118 1.208 3.719.113.345h4.273l-3.163 2.299-.294.213.112.346 1.208 3.719-3.163-2.299-.294-.213-.294.213-3.163 2.299 1.208-3.72.112-.345-.294-.213-3.163-2.299h4.273l.113-.345 1.208-3.719Z",stroke:"#9D6CFF"}),B.createElement("path",{d:"M27.65 27.6c1.58 0 2.63-.97 2.63-2.21 0-1.43-.87-1.91-2.55-2.14-1.24-.18-1.48-.47-1.48-1.05 0-.55.42-.94 1.23-.94.82 0 1.25.32 1.38 1.07h1.22c-.14-1.37-1.06-2.07-2.6-2.07-1.49 0-2.49.88-2.49 2.05 0 1.34.81 1.86 2.52 2.09 1.16.19 1.49.44 1.49 1.1 0 .66-.56 1.1-1.35 1.1-1.21 0-1.5-.6-1.59-1.32h-1.28c.1 1.35.92 2.32 2.87 2.32Zm5.598-.01c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm3.33.01c.8 0 1.26-.29 1.6-.74v.64h1.19v-3.43c0-1.43-.92-1.91-2.09-1.91s-2.14.51-2.24 1.73h1.17c.06-.52.37-.82 1-.82.71 0 .95.35.95 1.05v.27h-.65c-1.5 0-2.68.44-2.68 1.66 0 1.09.79 1.55 1.75 1.55Zm.29-.87c-.6 0-.84-.29-.84-.73 0-.64.59-.85 1.51-.85h.62v.52c0 .67-.55 1.06-1.29 1.06Zm3.887.77h1.21v-2.72c0-1.11.64-1.45 1.7-1.46v-1.13c-.88.01-1.37.4-1.7 1.06v-.98h-1.21v5.23Zm8.698-.84c-.92 0-1.45-.67-1.45-1.74v-.08c0-1.08.55-1.73 1.45-1.73.9 0 1.44.66 1.44 1.74v.07c0 1.07-.54 1.74-1.44 1.74Zm-.01.94c1.54 0 2.69-1.06 2.69-2.69v-.08c0-1.6-1.15-2.67-2.68-2.67-1.54 0-2.69 1.08-2.69 2.7v.08c0 1.59 1.14 2.66 2.68 2.66Zm3.783-.1h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-.83h-1.21v5.23Zm11.777.1c2.02 0 3.26-1.2 3.26-3.18v-.66h-3.11v1h1.8c-.04.99-.59 1.8-1.93 1.8-1.5 0-2.21-1.05-2.21-2.58v-.08c0-1.57.81-2.61 2.21-2.61.93 0 1.57.41 1.73 1.36h1.33c-.19-1.71-1.55-2.41-3.08-2.41-2.09 0-3.57 1.52-3.57 3.65v.08c0 2.11 1.28 3.63 3.57 3.63Zm4.474-.1h1.21v-5.23h-1.21v5.23Zm.59-6.09c.4 0 .72-.3.72-.69 0-.4-.32-.7-.72-.7-.4 0-.72.3-.72.7 0 .39.32.69.72.69Zm3.874 6.18c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm1.912-.09h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-3.25h-1.21v7.65Zm7.834.1c.85 0 1.4-.41 1.66-.92v.82h1.21v-5.23h-1.21v3.11c0 .83-.57 1.25-1.22 1.25-.7 0-1.03-.36-1.03-1.15v-3.21h-1.21v3.35c0 1.39.77 1.98 1.8 1.98Zm7.225 0c1.35 0 2.32-1.02 2.32-2.7v-.08c0-1.69-1.01-2.66-2.32-2.66-.77 0-1.42.45-1.71.95v-3.26h-1.21v7.65h1.21v-.84c.28.53.88.94 1.71.94Zm-.3-.96c-.88 0-1.45-.55-1.45-1.72v-.08c0-1.16.6-1.73 1.44-1.73.79 0 1.39.57 1.39 1.73v.08c0 1.12-.49 1.72-1.38 1.72Z",fill:"#fff"}),B.createElement("defs",null,B.createElement("filter",{id:"c",x:70.865,y:9.821,width:64.757,height:91.658,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"d",x:80.536,y:72.219,width:35.822,height:12.392,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"e",x:81.533,y:62.882,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"f",x:84.386,y:53.173,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"g",x:86.874,y:43.502,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"h",x:83.142,y:38.646,width:22.072,height:50.822,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"i",x:92.688,y:41.068,width:22.072,height:50.822,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("linearGradient",{id:"b",x1:7984.7,y1:6352.37,x2:4940.57,y2:5739.01,gradientUnits:"userSpaceOnUse"},B.createElement("stop",null),B.createElement("stop",{offset:1,stopOpacity:0})),B.createElement("clipPath",{id:"a"},B.createElement("path",{fill:"#fff",transform:"translate(43)",d:"M0 0h129v129H0z"})))),v5=Y8;var V=T(_()),q8=()=>V.default.createElement("svg",{style:{transform:"scaleX(-1)",margin:"75px 50px"},width:"200",height:"200",viewBox:"0 0 139 152",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V.default.createElement("line",{y1:"-2.5",x2:"44.7223",y2:"-2.5",transform:"matrix(0.282454 0.959281 0.969447 -0.245301 108.706 62.2981)",stroke:"black",strokeWidth:"5"}),V.default.createElement("line",{y1:"-2.5",x2:"37.8202",y2:"-2.5",transform:"matrix(0.30917 0.951007 0.96312 -0.269071 94.2115 113.51)",stroke:"black",strokeWidth:"5"}),V.default.createElement("line",{y1:"-2.5",x2:"42.026",y2:"-2.5",transform:"matrix(-0.404697 0.914451 0.934686 0.355474 60.7272 113.51)",stroke:"black",strokeWidth:"5"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",fill:"#00090F"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",fill:"url(#paint0_linear)"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",stroke:"black",strokeWidth:"0.5"}),V.default.createElement("g",{filter:"url(#filter0_d)"},V.default.createElement("path",{d:"M50.5827 58.6809C49.5253 76.7216 43.3703 91.6895 52.5089 104.85C63.4182 116.939 80.8842 118.6 95.8988 113.127C112.216 103.39 113.383 53.7942 101 35.9614C92.7473 2.53842 21.7073 0.0230777 50.5827 58.6809Z",fill:"#FFEBEB"}),V.default.createElement("path",{d:"M50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.5237 116.675 80.8393 118.347 95.7767 112.909C99.7734 110.514 102.875 105.657 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C54.402 14.2799 48.056 18.3727 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),V.default.createElement("g",{filter:"url(#filter1_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.0263",y2:"-0.125",transform:"matrix(-1.00036 -0.232717 -0.303964 0.923249 90.9426 103.996)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter2_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 92.4263 92.9282)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter3_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 91.7477 81.6816)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter4_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 91.4735 70.5457)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter5_d)"},V.default.createElement("line",{y1:"-0.125",x2:"49.6473",y2:"-0.125",transform:"matrix(-0.056611 -0.972639 -1.01868 0.0895582 85.7439 108.932)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter6_d)"},V.default.createElement("line",{y1:"-0.125",x2:"49.0215",y2:"-0.125",transform:"matrix(-0.0447349 -0.972962 -1.01982 0.0794914 74.2345 109.899)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("path",{d:"M77.5748 21.6128C81.1721 21.0053 83.1051 22.723 84.446 24.1319C83.5748 25.0968 81.2156 27.1306 78.7489 27.5472C76.2822 27.9638 72.8613 27.3151 71.5987 26.3018C72.2742 24.3479 74.1847 22.1854 77.5748 21.6128Z",stroke:"black"}),V.default.createElement("path",{d:"M77.1438 24.7826C77.2286 25.211 77.6735 25.4954 78.138 25.417C78.6025 25.3385 78.9097 24.9272 78.8249 24.4987C78.7401 24.0703 78.2952 23.7859 77.8307 23.8643C77.3662 23.9428 77.059 24.3541 77.1438 24.7826Z",stroke:"black",strokeWidth:"1.5"}),V.default.createElement("path",{d:"M56.7304 23.0188C60.3276 22.4113 62.2607 24.129 63.6015 25.5379C62.7303 26.5028 60.3711 28.5366 57.9044 28.9532C55.4378 29.3698 52.0168 28.7211 50.7542 27.7078C51.4297 25.7539 53.3402 23.5914 56.7304 23.0188Z",stroke:"black"}),V.default.createElement("path",{d:"M56.2062 26.2049C56.291 26.6334 56.7359 26.9177 57.2004 26.8393C57.6649 26.7609 57.9721 26.3496 57.8873 25.9211C57.8025 25.4926 57.3576 25.2083 56.8931 25.2867C56.4286 25.3651 56.1214 25.7765 56.2062 26.2049Z",stroke:"black",strokeWidth:"1.5"}),V.default.createElement("path",{d:"M70.9027 31.9832L74.8034 33.746L74.6873 36.5264",stroke:"black"}),V.default.createElement("ellipse",{rx:"5.52852",ry:"7.22499",transform:"matrix(-1.00798 0.230879 0.25069 0.931832 78.3648 46.1813)",fill:"#0B0B0B"}),V.default.createElement("line",{y1:"-2.5",x2:"46.79",y2:"-2.5",transform:"matrix(0.181746 -0.947707 -1.01992 -0.168086 34.7046 107.134)",stroke:"black",strokeWidth:"5"}),V.default.createElement("defs",null,V.default.createElement("filter",{id:"filter0_d",x:"39.718",y:"12.3701",width:"73.6225",height:"111.741",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter1_d",x:"60.907",y:"97.7083",width:"34.1116",height:"14.2876",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter2_d",x:"61.8538",y:"86.2905",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter3_d",x:"61.1752",y:"75.0439",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter4_d",x:"60.901",y:"63.908",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter5_d",x:"78.9333",y:"60.6208",width:"11.0653",height:"56.3113",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter6_d",x:"68.0415",y:"62.1831",width:"10.4479",height:"55.716",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("linearGradient",{id:"paint0_linear",x1:"25.393",y1:"64.5732",x2:"215.189",y2:"46.963",gradientUnits:"userSpaceOnUse"},V.default.createElement("stop",{stopColor:"#D17485"}),V.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),P5=q8;var H=T(_()),Q8=()=>H.default.createElement("svg",{style:{margin:"75px 50px"},width:"200",height:"200",viewBox:"0 0 105 133",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H.default.createElement("line",{y1:"-2.5",x2:"47.2325",y2:"-2.5",transform:"matrix(-0.275217 0.961382 -0.963013 -0.269454 27.7317 82.8152)",stroke:"black",strokeWidth:"5"}),H.default.createElement("path",{d:"M65.2668 85.4294L72.7953 132.508",stroke:"black",strokeWidth:"5"}),H.default.createElement("line",{y1:"-2",x2:"17.4186",y2:"-2",transform:"matrix(0.447771 0.889458 -0.901022 0.443341 17.3323 33.123)",stroke:"black",strokeWidth:"4"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",fill:"#00090F"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",fill:"url(#paint0_linear)"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",stroke:"black",strokeWidth:"0.5"}),H.default.createElement("g",{filter:"url(#filter0_d)"},H.default.createElement("path",{d:"M66.7635 47.8141C65.9014 61.8826 69.0213 73.9921 61.1912 83.4343C52.1711 91.8995 39.3291 91.7402 28.9132 86.2544C17.9362 77.3573 21.5704 38.8254 32.1802 26.0312C41.1979 0.81291 93.0476 4.74773 66.7635 47.8141Z",fill:"#FFDAAE"}),H.default.createElement("path",{d:"M66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9914C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.598 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.094 91.6193 39.395 91.4836 29.0537 86.0465C26.3875 83.8735 24.5781 79.8737 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C67.9675 13.14 72.1875 16.8205 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),H.default.createElement("g",{filter:"url(#filter1_d)"},H.default.createElement("line",{y1:"-0.125",x2:"19.8557",y2:"-0.125",transform:"matrix(0.99225 -0.137652 0.173912 0.982961 33.1741 78.5916)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter2_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146111 0.182398 0.98144 33.1637 69.7397)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter3_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146111 0.182398 0.98144 34.7578 60.917)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter4_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146112 0.182397 0.98144 36.0442 52.1494)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter5_d)"},H.default.createElement("line",{y1:"-0.125",x2:"38.568",y2:"-0.125",transform:"matrix(0.175504 -0.982432 0.981683 0.200291 36.5092 82.8962)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter6_d)"},H.default.createElement("line",{y1:"-0.125",x2:"38.067",y2:"-0.125",transform:"matrix(0.164387 -0.984346 0.983775 0.189794 44.8636 84.5642)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("path",{d:"M49.2138 20.1738C46.9644 19.7261 45.7307 20.8571 44.8722 21.7876C45.407 22.4447 46.8621 23.8357 48.4045 24.1427C49.9469 24.4497 52.1011 24.0525 52.9056 23.3866C52.5057 22.068 51.3336 20.5957 49.2138 20.1738Z",stroke:"black"}),H.default.createElement("mask",{id:"path-14-inside-1",fill:"white"},H.default.createElement("ellipse",{rx:"1.01839",ry:"1.01835",transform:"matrix(0.986125 0.196328 -0.198641 0.974457 47.6494 21.8588)"})),H.default.createElement("path",{d:"M47.1744 21.7642C47.2273 21.505 47.4828 21.3372 47.7451 21.3894L47.1491 24.3128C48.5207 24.5859 49.8565 23.7086 50.1328 22.3532L47.1744 21.7642ZM47.7451 21.3894C48.0073 21.4417 48.1772 21.6941 48.1243 21.9533L45.1659 21.3644C44.8896 22.7197 45.7776 24.0398 47.1491 24.3128L47.7451 21.3894ZM48.1243 21.9533C48.0715 22.2126 47.816 22.3803 47.5537 22.3281L48.1496 19.4048C46.7781 19.1317 45.4422 20.009 45.1659 21.3644L48.1243 21.9533ZM47.5537 22.3281C47.2915 22.2759 47.1216 22.0235 47.1744 21.7642L50.1328 22.3532C50.4091 20.9978 49.5212 19.6778 48.1496 19.4048L47.5537 22.3281Z",fill:"black",mask:"url(#path-14-inside-1)"}),H.default.createElement("path",{d:"M62.2857 21.3483C60.0364 20.9006 58.8026 22.0317 57.9441 22.9622C58.4789 23.6193 59.9341 25.0103 61.4765 25.3173C63.0189 25.6243 65.1731 25.2271 65.9776 24.5612C65.5777 23.2426 64.4056 21.7703 62.2857 21.3483Z",stroke:"black"}),H.default.createElement("mask",{id:"path-17-inside-2",fill:"white"},H.default.createElement("ellipse",{rx:"1.01839",ry:"1.01835",transform:"matrix(0.986125 0.196328 -0.198641 0.974457 60.7213 23.0333)"})),H.default.createElement("path",{d:"M60.2464 22.9388C60.2993 22.6795 60.5548 22.5118 60.817 22.564L60.2211 25.4874C61.5926 25.7604 62.9285 24.8831 63.2048 23.5278L60.2464 22.9388ZM60.817 22.564C61.0793 22.6162 61.2491 22.8686 61.1963 23.1279L58.2379 22.5389C57.9616 23.8943 58.8496 25.2143 60.2211 25.4874L60.817 22.564ZM61.1963 23.1279C61.1434 23.3872 60.8879 23.5549 60.6257 23.5027L61.2216 20.5793C59.8501 20.3063 58.5142 21.1835 58.2379 22.5389L61.1963 23.1279ZM60.6257 23.5027C60.3634 23.4505 60.1936 23.198 60.2464 22.9388L63.2048 23.5278C63.4811 22.1724 62.5931 20.8524 61.2216 20.5793L60.6257 23.5027Z",fill:"black",mask:"url(#path-17-inside-2)"}),H.default.createElement("path",{d:"M55.1993 24.8215L51.5208 27.443L50.8515 30.2006",stroke:"black"}),H.default.createElement("ellipse",{rx:"3.30062",ry:"3.81835",transform:"matrix(0.971768 0.25679 -0.259902 0.960306 49.3348 36.0427)",fill:"#0B0B0B"}),H.default.createElement("line",{y1:"-2",x2:"22.0374",y2:"-2",transform:"matrix(-0.865141 0.508647 -0.513608 -0.853839 90.1277 43.4041)",stroke:"black",strokeWidth:"4"}),H.default.createElement("line",{y1:"-2",x2:"37.4541",y2:"-2",transform:"matrix(-0.786693 -0.617627 0.626127 -0.779496 90.7851 44.7039)",stroke:"black",strokeWidth:"4"}),H.default.createElement("line",{y1:"-2",x2:"24.946",y2:"-2",transform:"matrix(0.861194 -0.515172 0.263521 0.959152 18.4058 34.8635)",stroke:"black",strokeWidth:"4"}),H.default.createElement("defs",null,H.default.createElement("filter",{id:"filter0_d",x:"18.2485",y:"10.3994",width:"59.8773",height:"87.7246",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter1_d",x:"29.1307",y:"75.6125",width:"27.7453",height:"10.9789",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter2_d",x:"29.1181",y:"66.5266",width:"28.1757",height:"11.2132",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter3_d",x:"30.7122",y:"57.7039",width:"28.1757",height:"11.2132",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter4_d",x:"31.9986",y:"48.9363",width:"28.1757",height:"11.2133",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter5_d",x:"32.2638",y:"44.9558",width:"15.0143",height:"45.9405",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter6_d",x:"40.6176",y:"47.0457",width:"14.5037",height:"45.5186",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("linearGradient",{id:"paint0_linear",x1:"-22.3171",y1:"36.4033",x2:"105.851",y2:"59.8025",gradientUnits:"userSpaceOnUse"},H.default.createElement("stop",{stopColor:"#8A2E28"}),H.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),b5=Q8;var ex=e=>{let t=0;for(let n=0;nex(e)==1979576830;var qi=T(_());var E5=(e,t)=>{var n;return((n=e.experiment)==null?void 0:n.experiment_id)===t},A5=e=>{var t;return((t=e.experiment)==null?void 0:t.variant)==="A"};var tx=e=>E5(e.analysisData,e.experimentID)?A5(e.analysisData)?qi.default.createElement(qi.default.Fragment,null,e.aElement):qi.default.createElement(qi.default.Fragment,null,e.bElement):qi.default.createElement(qi.default.Fragment,null,e.aElement),k5=tx;var N5="Your Company/Organization",nx="AppleSoftBook",rx=e=>ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{margin:0}},"Sign Up for Mito"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},"We\u2019ll send you periodic product updates and welcome any feedback. And no spam. Duh.")),ee.default.createElement("form",{className:"signup-modal-email-form",onSubmit:async n=>{n.preventDefault(),await e.mitoAPI.updateSignUp(e.email),e.next()}},ee.default.createElement("p",{className:"text-body-1",style:{marginTop:"10px",marginBottom:0}},"Email"),ee.default.createElement(ne,{value:e.email,onChange:n=>{e.setEmail(n.target.value)},type:"email",width:"large",placeholder:"example@gmail.com",required:!0,autoFocus:!0}),ee.default.createElement("label",null,ee.default.createElement("p",{className:"text-body-1",style:{marginTop:"10px",marginBottom:0}},N5)),ee.default.createElement(ne,{value:e.firstResponse,onChange:n=>{e.setFirstResponse(n.target.value)},placeholder:nx,required:!0,style:{marginBottom:"10px"}}),ee.default.createElement("div",{className:"mt-10px",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"dark",width:"large",type:"submit"},"Sign Up")))),ox=e=>{let[t,n]=(0,ee.useState)(e.isPro),[r,o]=(0,ee.useState)(!1),[i,a]=(0,ee.useState)(""),[s,l]=(0,ee.useState)(!1),d=()=>{if(!Am(i)){l(!0);return}l(!1),o(!1),n(!0),e.mitoAPI.log("signup_completed_pro",{location:"signup"}),e.mitoAPI.updateGoPro(),e.next()};return ee.default.createElement(ee.default.Fragment,null,!r&&ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},t?"You've Signed up for Mito Pro!":"Want More Power? Consider Mito Pro"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},t?"Thanks for being a Mito Pro user! Paying for Mito gets you access to advanced functionality and turns off telemetry. In turn, it allows us to fund Mito's development.":"Mito Pro gives you access to advanced functionality, and allows you to turn off telemetry. It also allows us to continue to fund Mito's development!")),!t&&ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",href:"https://trymito.io/plans",target:"_blank",onClick:()=>{o(!0),e.mitoAPI.log("signup_clicked_pro")}},"See Plans"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:e.next,autoFocus:!0},ee.default.createElement(k5,{analysisData:e.analysisData,experimentID:"title_name",aElement:"No Thanks",bElement:"Skip"}))),t&&ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:e.next,autoFocus:!0},"Continue"))),r&&ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},"Access Pro"),ee.default.createElement("p",{className:"signup-modal-text"},"Complete the checkout flow. In the Pro documentation, click ",ee.default.createElement("b",null,"Get Access Code")," and enter it here."),ee.default.createElement("label",null,ee.default.createElement("h3",{className:"text-header-2",style:{marginTop:"5px",marginBottom:0}},"Access Code:")),ee.default.createElement(ne,{placeholder:"mito-pro-access-code-XXXXXXXXXXXX",value:i,onChange:u=>{a(u.target.value)},onKeyDown:u=>{u.key==="Enter"&&d()}}),s&&ee.default.createElement("p",{className:"signup-modal-text signup-modal-text-error"},"Invalid access code")),ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:()=>{o(!1)}},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:d,autoFocus:!0},"Submit"))))},ix=e=>{let t=async()=>{await e.mitoAPI.updateFeedback("company/organization",e.numUsages,[{question:N5,answer:e.firstResponse}]),e.next()};return ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},e.isPro&&"Mito Pro is Totally Private",!e.isPro&&"Mito is Built for Privacy"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},e.isPro&&"As a Mito Pro user, no data leaves your computer, ever. Check out our CCPA compliant privacy policy",!e.isPro&&"We make sure none of your private data leaves your computer. Read our CCPA compliant privacy policy"," "," ",ee.default.createElement("a",{href:"https://privacy.trymito.io/privacy-policy",target:"_blank",rel:"noreferrer"},ee.default.createElement("u",null,"here")),".")),ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:t,autoFocus:!0},"Accept")))},ax=e=>{let[t,n]=(0,ee.useState)(1),[r,o]=(0,ee.useState)(""),[i,a]=(0,ee.useState)(""),s=()=>{if(t+1>3)e.setUIState(u=>f(m({},u),{currOpenModal:{type:"None"},currOpenTaskpanel:{type:"import files"}})),e.mitoAPI.log("finished_signup");else{let u=Math.min(t+1,3);n(u),e.mitoAPI.log("switched_signup_step",{old_signup_step:t,new_signup_step:u})}},l=()=>{let u=Math.max(t-1,0);n(u),e.mitoAPI.log("switched_signup_step",{old_signup_step:t,new_signup_step:u})},d={1:"#FFEBEB",2:"#F0C5BB",3:"#FFDAAE"};return ee.default.createElement("div",{className:"overlay"},ee.default.createElement("div",{className:M("signup-modal-container")},ee.default.createElement("div",{className:"signup-modal-left-column-container"},t===1&&ee.default.createElement(rx,{next:s,email:r,setEmail:o,firstResponse:i,setFirstResponse:a,mitoAPI:e.mitoAPI}),t===2&&ee.default.createElement(ox,{next:s,back:l,isPro:e.isPro,mitoAPI:e.mitoAPI,analysisData:e.analysisData}),t===3&&ee.default.createElement(ix,{next:s,back:l,firstResponse:i,numUsages:e.numUsages,mitoAPI:e.mitoAPI,isPro:e.isPro})),ee.default.createElement("div",{className:"signup-modal-right-column-container",style:{backgroundColor:d[t]}},t===1&&ee.default.createElement(P5,null),t===2&&ee.default.createElement(v5,null),t===3&&ee.default.createElement(b5,null))))},M5=ax;var Ze=T(_());var sx=e=>((0,Ze.useEffect)(()=>{e.mitoAPI.log("opened_upgrade_modal")},[]),Ze.default.createElement("div",{className:"overlay"},Ze.default.createElement("div",{className:"upgrade-modal-container txt-16"},Ze.default.createElement("h2",{className:"mt-5px"},"Time to Upgrade!"),Ze.default.createElement("p",null,"To get Mito's most advanced functionality:"),Ze.default.createElement("ol",null,Ze.default.createElement("li",{className:"mt-5px"},Ze.default.createElement("p",null,"Open a new terminal/command prompt (where you ran the commands to install Mito).")),Ze.default.createElement("li",{className:"mt-10px"},Ze.default.createElement("div",{className:"upgrade-modal-code-list-item"},Ze.default.createElement("p",null,"Run the command:"),Ze.default.createElement("code",{className:"upgrade-modal-code"},"python -m pip install mitoinstaller --upgrade"))),Ze.default.createElement("li",{className:"mt-10px"},Ze.default.createElement("div",{className:"upgrade-modal-code-list-item"},Ze.default.createElement("p",null,"Run the command:"),Ze.default.createElement("code",{className:"upgrade-modal-code"},"python -m mitoinstaller upgrade"))),Ze.default.createElement("li",{className:"mt-10px"},Ze.default.createElement("p",null,Ze.default.createElement("b",null,"Restart your Kernel")," by clicking on Kernel > Restart Kernel.")),Ze.default.createElement("li",{className:"mt-10px"},Ze.default.createElement("p",null,Ze.default.createElement("b",null,"Refresh this webpage.")))),Ze.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.mitoAPI.log("closed_upgrade"),e.mitoAPI.updateManuallyMarkUpgraded(),e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))}},"Got it!")))),O5=sx;var Z=T(_());function lx(e,t,n){let r=e+"_edit",o=async s=>{let l=me(),d=await t._edit(r,s,l);if("error"in d)return d.error},a=n.stepSummaryList.filter(s=>s.step_type===e).map(s=>({params:s.params,results:s.result}));return{edit:o,previousParamsAndResults:a}}var km=lx;var N1=T(_()),dx=()=>N1.default.createElement("svg",{width:"20",height:"17",viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},N1.default.createElement("path",{d:"M12.7509 16.5995L19.5985 9.75201C20.1339 9.21791 20.1339 8.34964 19.5985 7.81553L12.7509 0.968013C12.2155 0.432537 11.3486 0.432537 10.8145 0.968013C10.2803 1.50349 10.279 2.37039 10.8145 2.90449L15.3242 7.41427H2.19616C1.4402 7.41427 0.82666 8.02781 0.82666 8.78377C0.82666 9.53974 1.4402 10.1533 2.19616 10.1533H15.3242L10.8145 14.6631C10.5474 14.9301 10.4132 15.2807 10.4132 15.6313C10.4132 15.9819 10.5474 16.3325 10.8145 16.5995C11.3499 17.135 12.2168 17.135 12.7509 16.5995Z",fill:"#767180"})),F5=dx;var dn=T(_());var jr=(e,t,n)=>dn.default.createElement(I,{onClick:()=>{var r;t(e),(r=n.current)==null||r.focus()},justify:"center",align:"center",className:"ai-transformation-example"},dn.default.createElement("p",null,e)),ux=(e,t)=>{var n;return e.length===0||(n=e[t].data[0])==null?void 0:n.columnHeader},mx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)&&G(r.columnHeader).toLowerCase().includes("date")))==null?void 0:n.columnHeader},cx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)&&G(r.columnHeader).toLowerCase().includes("number")))==null?void 0:n.columnHeader},fx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)))==null?void 0:n.columnHeader},px=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>et(r.columnDtype)))==null?void 0:n.columnHeader},hx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>it(r.columnDtype)))==null?void 0:n.columnHeader},gx=e=>{let t=ux(e.sheetDataArray,e.selectedSheetIndex),n=mx(e.sheetDataArray,e.selectedSheetIndex),r=cx(e.sheetDataArray,e.selectedSheetIndex),o=fx(e.sheetDataArray,e.selectedSheetIndex),i=px(e.sheetDataArray,e.selectedSheetIndex),a=hx(e.sheetDataArray,e.selectedSheetIndex),s=[t,n,r,o,i,a].filter(l=>l!==void 0).length;return dn.default.createElement(dn.default.Fragment,null,dn.default.createElement("div",{className:"mito-blue-container"},dn.default.createElement("div",{className:"text-header-3"},"Examples"),e.sheetDataArray.length===0?dn.default.createElement(dn.default.Fragment,null,jr("create a dataframe named df with sample data",e.setUserInput,e.chatInputRef),jr("import the most recent csv from the current folder",e.setUserInput,e.chatInputRef)):dn.default.createElement(dn.default.Fragment,null,t&&jr(`sort the column ${G(t)} in ascending order`,e.setUserInput,e.chatInputRef),n&&jr(`convert ${G(n)} to a datetime`,e.setUserInput,e.chatInputRef),r&&jr(`convert ${G(r)} to a number`,e.setUserInput,e.chatInputRef),o&&jr(`extract the first character from ${G(o)}`,e.setUserInput,e.chatInputRef),i&&jr(`add 100 to ${G(i)}`,e.setUserInput,e.chatInputRef),a&&jr(`extract the month from ${G(a)}`,e.setUserInput,e.chatInputRef),s<3&&dn.default.createElement(dn.default.Fragment,null,jr("can you delete columns with any null values",e.setUserInput,e.chatInputRef),jr("fully capitalize column headers",e.setUserInput,e.chatInputRef))),dn.default.createElement(I,{justify:"center"},dn.default.createElement("p",{className:"text-subtext-1"},"or send any message to Mito AI below."))),dn.default.createElement(se,{px:10}))},L5=gx;var ce=T(_());var Zl=T(_()),yx=e=>e.variant==="selected"?Zl.default.createElement("svg",{onClick:e.onClick,width:"18",height:"11",viewBox:"0 0 18 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zl.default.createElement("path",{d:"M8.8 0C4.9621 0 1.6346 2.2352 0 5.5C1.6346 8.7648 4.9621 11 8.8 11C12.6379 11 15.9654 8.7648 17.6 5.5C15.9654 2.2352 12.6379 0 8.8 0ZM13.1395 2.9172C14.1735 3.5772 15.0502 4.4605 15.708 5.5C15.0502 6.5406 14.1735 7.4239 13.1395 8.0828C11.8404 8.9111 10.34 9.35 8.8011 9.35C7.2622 9.35 5.7618 8.9122 4.4616 8.0828C3.4276 7.4228 2.5509 6.5395 1.8931 5.5C2.5509 4.4594 3.4276 3.5761 4.4616 2.9172C4.5287 2.8743 4.5969 2.8325 4.6651 2.7918C4.4935 3.2615 4.4 3.7686 4.4 4.2977C4.4 6.7276 6.3701 8.6977 8.8 8.6977C11.2299 8.6977 13.2 6.7276 13.2 4.2977C13.2 3.7686 13.1065 3.2615 12.9349 2.7918C13.0031 2.8325 13.0724 2.8743 13.1395 2.9172ZM8.8 3.85C8.8 4.7608 8.0608 5.5 7.15 5.5C6.2392 5.5 5.5 4.7608 5.5 3.85C5.5 2.9392 6.2392 2.2 7.15 2.2C8.0608 2.2 8.8 2.9392 8.8 3.85Z",fill:"#9D6CFF"})):Zl.default.createElement("svg",{onClick:e.onClick,width:"19",height:"11",viewBox:"0 0 19 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zl.default.createElement("path",{d:"M9.65693 0C5.81903 0 2.49153 2.2352 0.856934 5.5C2.49153 8.7648 5.81903 11 9.65693 11C13.4948 11 16.8223 8.7648 18.4569 5.5C16.8223 2.2352 13.4948 0 9.65693 0ZM13.9964 2.9172C15.0304 3.5772 15.9071 4.4605 16.5649 5.5C15.9071 6.5406 15.0304 7.4239 13.9964 8.0828C12.6973 8.9111 11.1969 9.35 9.65803 9.35C8.11913 9.35 6.61873 8.9122 5.31853 8.0828C4.28453 7.4228 3.40783 6.5395 2.75003 5.5C3.40783 4.4594 4.28453 3.5761 5.31853 2.9172C5.38563 2.8743 5.45383 2.8325 5.52203 2.7918C5.35043 3.2615 5.25693 3.7686 5.25693 4.2977C5.25693 6.7276 7.22703 8.6977 9.65693 8.6977C12.0868 8.6977 14.0569 6.7276 14.0569 4.2977C14.0569 3.7686 13.9634 3.2615 13.7918 2.7918C13.86 2.8325 13.9293 2.8743 13.9964 2.9172ZM9.65693 3.85C9.65693 4.7608 8.91773 5.5 8.00693 5.5C7.09613 5.5 6.35693 4.7608 6.35693 3.85C6.35693 2.9392 7.09613 2.2 8.00693 2.2C8.91773 2.2 9.65693 2.9392 9.65693 3.85Z",fill:"#767180"})),U5=yx;var Sx=e=>{let[t,n]=(0,ce.useState)(void 0),r=e.result;if(r===void 0)return ce.default.createElement(ce.default.Fragment,null);let o={prompt_version:e.params.prompt_version,prompt:e.params.prompt.split(` +`)})}render(){return this.state.hasError?$l.default.createElement("p",{className:"text-body-1 text-color-red p-10px"},"Looks like Mito had an error! Sorry about that. Rerun the Jupyter Cell above, and join our ",$l.default.createElement("a",{className:"text-body-1-link",href:ii,target:"_blank",rel:"noreferrer"},"Discord")," for support if this error occurs again."):this.props.children}},h5=P1;var So=T(_());var St=T(_());var b1=T(_()),G8=()=>b1.default.createElement("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},b1.default.createElement("path",{d:"M1 1L4.00283 4L7 1",stroke:"#F2F2F2",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),g5=G8;var E1=T(_()),V8=()=>E1.default.createElement("svg",{width:"8",height:"6",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},E1.default.createElement("path",{d:"M1 1L4.00283 4L7 1",stroke:"#343434",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),y5=V8;var yr=T(_()),j8=e=>e.variant==="light"?yr.default.createElement("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yr.default.createElement("path",{d:"M1 5.5874V14.3589",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M4.64453 9.67969V14.3588",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M8.28906 1V14.3588",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M11.9336 5.5874V14.3589",stroke:"white",strokeMiterlimit:"10",strokeLinecap:"round"})):yr.default.createElement("svg",{width:"13",height:"15",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},yr.default.createElement("path",{d:"M1 5.61938V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M4.64453 9.71167V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M8.28906 1.03198V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),yr.default.createElement("path",{d:"M11.9336 5.61938V14.3908",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),os=j8;var Sr=T(_());var R8=(e,t)=>{let n=Object.fromEntries(Object.entries(t||{}).filter(([,r])=>r.graphParams.graphCreation.sheet_index===e));return Object.entries(n).map(([r,o])=>({graphTabName:o.graphTabName,graphID:r}))};function A1(e){var l;let t=((l=e.sheetDataArray[e.sheetIndex])==null?void 0:l.dfSource)==="imported";(0,Sr.useEffect)(()=>{e.display&&e.mitoAPI.log("clicked_data_sheet_tab_actions",{sheet_index:e.sheetIndex})},[e.display]);let n=async()=>{let d=R8(e.sheetIndex,e.graphDataDict);d.length>0?e.setUIState(u=>f(m({},u),{currOpenModal:{type:"DeleteGraphs",dependantGraphTabNamesAndIDs:d,sheetIndex:e.sheetIndex}})):(e.setUIState(u=>f(m({},u),{selectedTabType:"data",selectedSheetIndex:u.selectedSheetIndex>0?u.selectedSheetIndex-1:0})),e.closeOpenEditingPopups(),await e.mitoAPI.editDataframeDelete(e.sheetIndex))},r=async()=>{e.closeOpenEditingPopups(),await e.mitoAPI.editDataframeDuplicate(e.sheetIndex)},o=()=>{e.setIsRename(!0)},i=async()=>{let d=me(),u=Gi(e.sheetDataArray,e.sheetIndex);await e.mitoAPI.editGraph(d,u,"100%","100%",me())},s=[Sr.default.createElement(v,{key:"Create graph",title:"Create graph",onClick:d=>{d==null||d.stopPropagation(),i()}}),Sr.default.createElement(v,{key:"Export",title:"Export",onClick:async()=>{e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"download"},currOpenModal:{type:"None"}}))}}),t?Sr.default.createElement(v,{key:"Change Import",title:"Change Import",onClick:()=>{e.closeOpenEditingPopups(),e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"UpdateImports"}}))}}):void 0,Sr.default.createElement(ve,{key:"sep",isDropdownSectionSeperator:!0}),Sr.default.createElement(v,{key:"Duplicate",title:"Duplicate",onClick:r}),Sr.default.createElement(v,{key:"Rename",title:"Rename",onClick:o,supressFocusSettingOnClose:!0}),Sr.default.createElement(v,{key:"Delete",title:"Delete",onClick:d=>{d==null||d.stopPropagation(),n()}})].filter(d=>d!=null);return Sr.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setDisplayActions(!1),width:"medium"},s)}var yo=T(_());function k1(e){(0,yo.useEffect)(()=>{e.display&&e.mitoAPI.log("clicked_graph_sheet_tab_actions",{graph_id:e.graphID})},[e.display]);let t=async()=>{e.closeOpenEditingPopups(),await e.mitoAPI.editGraphDelete(e.graphID)},n=async()=>{e.closeOpenEditingPopups();let i=me();await e.mitoAPI.editGraphDuplicate(e.graphID,i)},r=()=>{e.setIsRename(!0)},o=async()=>{e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"graph",graphID:e.graphID,graphSidebarTab:"export"}}))};return yo.default.createElement(pe,{display:e.display,closeDropdown:()=>e.setDisplayActions(!1),width:"small"},yo.default.createElement(v,{title:"Export",onClick:i=>{i==null||i.stopPropagation(),o()}}),yo.default.createElement(ve,{isDropdownSectionSeperator:!0}),yo.default.createElement(v,{title:"Duplicate",onClick:n}),yo.default.createElement(v,{title:"Rename",onClick:r,supressFocusSettingOnClose:!0}),yo.default.createElement(v,{title:"Delete",onClick:i=>{i==null||i.stopPropagation(),t()}}))}var C5=(e,t,n)=>{let r=Object.keys(e||{}),o;if(r.length>t?o=r[t]:r.length>0&&(o=r[t-1]),o!==void 0){let i=o;return n(a=>f(m({},a),{selectedGraphID:i,selectedTabType:"graph",currOpenTaskpane:{type:"graph",graphID:i}})),i}else{n(i=>f(m({},i),{selectedGraphID:void 0,selectedTabType:"data",currOpenTaskpane:{type:"none"}}));return}};function bm(e){var c,p;let t=(0,St.useRef)(null),[n,r]=(0,St.useState)(!1),[o,i]=(0,St.useState)(!1),[a,s]=(0,St.useState)(e.tabName);(0,St.useEffect)(()=>{s(e.tabName)},[e.tabName]);let l=async()=>{var x;e.closeOpenEditingPopups(),e.tabIDObj.tabType==="data"?await e.mitoAPI.editDataframeRename(e.tabIDObj.sheetIndex,a):await e.mitoAPI.editGraphRename(e.tabIDObj.graphID,a),r(!1),i(!1);let h=(x=e.mitoContainerRef.current)==null?void 0:x.querySelector(".endo-grid-container");cr(h)},d=(c=e.uiState.dataRecon)==null?void 0:c.created_dataframe_names.includes(e.tabName),u=Object.keys(((p=e.uiState.dataRecon)==null?void 0:p.modified_dataframes_recons)||{}).includes(e.tabName);return St.default.createElement("div",{className:M("tab",{"tab-graph":e.tabIDObj.tabType==="graph"},{"tab-selected":e.isSelectedTab},"cursor-pointer",{"tab-created-recon":d},{"tab-modified-recon":u}),onClick:()=>{e.tabIDObj.tabType==="graph"&&e.setEditorState(void 0),e.setUIState(h=>{if(e.tabIDObj.tabType==="data"){let x=h.currOpenTaskpane.type==="graph"?{type:"none"}:h.currOpenTaskpane;return f(m({},h),{selectedTabType:"data",selectedSheetIndex:e.tabIDObj.sheetIndex,currOpenTaskpane:x})}else return f(m({},h),{selectedTabType:"graph",selectedGraphID:e.tabIDObj.graphID,currOpenModal:{type:"None"},currOpenTaskpane:{type:"graph",graphID:e.tabIDObj.graphID}})})},onDoubleClick:()=>{i(!0)},onContextMenu:h=>{var x;h.preventDefault(),(x=t.current)==null||x.click()}},St.default.createElement("div",{className:"tab-content"},e.tabIDObj.tabType==="graph"&&St.default.createElement("div",{className:"mr-3px"},St.default.createElement(os,{variant:e.isSelectedTab?"light":void 0})),o&&St.default.createElement("form",{onSubmit:async h=>{h.preventDefault(),await l()},onBlur:l},St.default.createElement(ne,{value:a,onChange:h=>{s(h.target.value)},autoFocus:!0,onEscape:()=>{i(!1),s(e.tabName)}})),!o&&St.default.createElement("p",null,e.tabName),St.default.createElement("div",{ref:t,className:"sheet-tab-dropdown-button-div",onClick:()=>{r(!0)}},e.isSelectedTab?St.default.createElement(g5,null):St.default.createElement(y5,null))),e.tabIDObj.tabType==="data"&&St.default.createElement(A1,{setDisplayActions:r,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,setIsRename:i,sheetIndex:e.tabIDObj.sheetIndex,mitoAPI:e.mitoAPI,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,display:n&&e.tabIDObj.tabType==="data"}),e.tabIDObj.tabType==="graph"&&St.default.createElement(k1,{setDisplayActions:r,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,setIsRename:i,graphID:e.tabIDObj.graphID,mitoAPI:e.mitoAPI,graphDataDict:e.graphDataDict,display:n&&e.tabIDObj.tabType==="graph"}))}var Em=T(_()),W8=()=>Em.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Em.default.createElement("path",{d:"M7.0498 1.66016V13.7602",stroke:"#494650",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"}),Em.default.createElement("path",{d:"M13.1 7.71008H1",stroke:"#494650",strokeWidth:"2",strokeMiterlimit:"10",strokeLinecap:"round"})),I5=W8;function X8(e){let t=e.uiState.selectedSheetIndex,n=e.uiState.selectedGraphID,r=e.uiState.selectedTabType,o=r==="graph"&&n!==void 0&&e.graphDataDict[n]!==void 0?e.graphDataDict[n].graphParams.graphCreation.sheet_index:t,i=e.sheetDataArray[o],a=e.uiState.currOpenTaskpane.type==="UpdateImports"&&e.uiState.currOpenTaskpane.failedReplayData!==void 0;return So.default.createElement("div",{className:"footer"},So.default.createElement("div",{className:M("footer-add-button","cursor-pointer"),onClick:()=>{a||e.setUIState(s=>f(m({},s),{currOpenTaskpane:{type:"import files"}}))}},So.default.createElement(I5,null)),So.default.createElement("div",{className:"footer-tab-bar scrollbar-gutter"},e.sheetDataArray.map(s=>s.dfName).map((s,l)=>So.default.createElement(bm,{key:l,tabName:s,tabIDObj:{tabType:"data",sheetIndex:l},isSelectedTab:r==="data"&&l===t,uiState:e.uiState,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,mitoAPI:e.mitoAPI,mitoContainerRef:e.mitoContainerRef,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,setEditorState:e.setEditorState})),Object.entries(e.graphDataDict||{}).map(([s,l])=>So.default.createElement(bm,{key:s,tabName:l.graphTabName,tabIDObj:{tabType:"graph",graphID:s},isSelectedTab:r==="graph"&&s===n,uiState:e.uiState,setUIState:e.setUIState,closeOpenEditingPopups:e.closeOpenEditingPopups,mitoAPI:e.mitoAPI,mitoContainerRef:e.mitoContainerRef,graphDataDict:e.graphDataDict,sheetDataArray:e.sheetDataArray,setEditorState:e.setEditorState}))),i!==void 0&&So.default.createElement("div",{className:"footer-right-side"},So.default.createElement("div",{className:"footer-sheet-shape"},"(",i.numRows," rows, ",i.numColumns," cols)")))}var x5=X8;var Cr=T(_());var nr=T(_());var J8=e=>{let t=e.modalType==="Error"?"#ED4747":"#343434",n=e.overlay!==void 0&&e.overlay;return nr.default.createElement("div",{className:M({"mito-modal-container":!n},{overlay:n})},nr.default.createElement("div",{className:M({"mito-modal-container":n})},nr.default.createElement("div",{className:M("mito-modal",{"modal-wide":e.wide})},e.setUIState!==void 0&&nr.default.createElement(I,{justify:"end"},nr.default.createElement(C,{offsetRight:.25},nr.default.createElement("div",{className:"default-taskpane-header-exit-button-div",onClick:()=>{e.setUIState!=null&&e.setUIState(r=>f(m({},r),{currOpenModal:{type:"None"}}))}},nr.default.createElement(at,null)))),nr.default.createElement("div",{className:M("mito-modal-header-text-div",{"mt-25px":e.setUIState===void 0}),style:{color:t}},nr.default.createElement("p",{className:"text-align-center-important"},e.header)),e.viewComponent&&nr.default.createElement("div",{className:"mito-modal-message"},e.viewComponent),nr.default.createElement("div",{className:"mito-modal-buttons"},e.buttons))))},si=J8;var z8=e=>{(0,Cr.useEffect)(()=>{e.mitoAPI.log("click_open_clear_analysis")},[]);let t=async()=>{e.mitoAPI.updateClear(),e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))};return Cr.default.createElement(si,{header:"Clear your current analysis?",modalType:"ClearAnalysis",viewComponent:Cr.default.createElement(Cr.default.Fragment,null,Cr.default.createElement("p",{className:"body-text-1"},"This will undo all transformations and you've made to imported dataframes and delete all of the graphs you've created.")),buttons:Cr.default.createElement(Cr.default.Fragment,null,Cr.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))}},"Close"),Cr.default.createElement(j,{variant:"dark",width:"small",onClick:t},"Clear"))})},w5=z8;var Vr=T(_());var K8=e=>{let t=e.dependantGraphTabNamesAndIDs.map(o=>o.graphID),n=e.dependantGraphTabNamesAndIDs.map(o=>o.graphTabName),r=async()=>{t.forEach(o=>{e.mitoAPI.editGraphDelete(o)}),await e.mitoAPI.editDataframeDelete(e.sheetIndex),e.setUIState(o=>f(m({},o),{selectedTabType:"data",selectedSheetIndex:o.selectedSheetIndex>0?o.selectedSheetIndex-1:0,currOpenModal:{type:"None"},currOpenTaskpane:{type:"none"}}))};return Vr.default.createElement(si,{header:"Delete Sheet and Dependant Graphs",modalType:"ClearAnalysis",viewComponent:Vr.default.createElement(Vr.default.Fragment,null,Vr.default.createElement("p",{className:"body-text-1"},"Deleting ",e.dfName," will delete the following graphs that rely on it:\xA0",Vr.default.createElement("span",{className:"text-color-mito-purple-important"},n.join(", ")))),buttons:Vr.default.createElement(Vr.default.Fragment,null,Vr.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(o=>f(m({},o),{currOpenModal:{type:"None"}}))}},"Close"),Vr.default.createElement(j,{variant:"dark",width:"large",onClick:r},"Delete Sheet and Graphs"))})},T5=K8;var Kt=T(_());var $8=e=>{let[t,n]=(0,Kt.useState)(!1);return e.error===void 0?Kt.default.createElement(Kt.default.Fragment,null):Kt.default.createElement(si,{header:e.error.errorShort,modalType:"Error",wide:!0,viewComponent:Kt.default.createElement(Kt.Fragment,null,e.error.error&&Kt.default.createElement("div",{className:"text-align-left text-body-1",onClick:()=>n(r=>!r)},e.error.error," "," ",e.error.traceback&&Kt.default.createElement("span",{className:"text-body-1-link"},"Click to view full traceback.")),e.error.traceback&&t&&Kt.default.createElement("div",{className:"flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px",style:{height:"200px",border:"1px solid var(--mito-purple)",borderRadius:"2px",padding:"5px"}},Kt.default.createElement("pre",null,e.error.traceback))),buttons:Kt.default.createElement(Kt.Fragment,null,Kt.default.createElement(j,{variant:"light",width:"small",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenModal:{type:"None"}}))}},"Close"),Kt.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))})},_5=$8;var yn=T(_());var Z8=e=>{var r,o;let[t,n]=(0,yn.useState)(!1);return yn.default.createElement(si,{header:e.header,modalType:"Error",wide:!0,viewComponent:yn.default.createElement(yn.Fragment,null,yn.default.createElement("div",{className:"text-align-left text-body-1",onClick:()=>n(i=>!i)},e.message," "," ",((r=e.error)==null?void 0:r.traceback)&&yn.default.createElement("span",{className:"text-body-1-link"},"Click to view full traceback.")),((o=e.error)==null?void 0:o.traceback)&&t&&yn.default.createElement("div",{className:"flex flex-column text-align-left text-overflow-hidden text-overflow-scroll mt-5px",style:{height:"200px",border:"1px solid var(--mito-purple)",borderRadius:"2px",padding:"5px"}},yn.default.createElement("pre",null,e.error.traceback))),buttons:yn.default.createElement(yn.default.Fragment,null,yn.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}),yn.default.createElement(j,{variant:"dark",width:"medium",onClick:()=>{$u(e.oldAnalysisName,e.newAnalysisName,e.mitoAPI),e.setUIState(i=>f(m({},i),{currOpenModal:{type:"None"}}))}},"Start New Analysis"))})},D5=Z8;var ee=T(_());var B=T(_()),Y8=()=>B.createElement("svg",{width:172,height:129,fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{transform:"scale(1.25)",margin:"100px 75px"},onClick:()=>{window.open("https://github.com/mito-ds/monorepo","_blank")}},B.createElement("g",{clipPath:"url(#a)"},B.createElement("path",{d:"m52.592 32.185 31.38 22.609",stroke:"#000",strokeWidth:5.525}),B.createElement("path",{d:"M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",fill:"#00090F"}),B.createElement("path",{d:"M79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Zm3.742 4.29c-2.281-2.203-3.896-5.77-4.876-10.184-1.107-4.994-1.389-11.012-.94-17.213.898-12.42 4.714-25.469 10.557-32.434l.08-.094v-.12c.076-5.724 3.79-10.138 9.224-12.923 5.439-2.787 12.563-3.918 19.329-3.063 3.89.49 7.648 1.636 10.892 3.488 1.298 1.592 2.257 3.514 2.772 5.776 1.372 6.027-.384 14.546-7.397 25.818l-.045.073-.006.083c-.23 3.636-.193 7.135-.141 10.484l.013.754c.05 3.08.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.501-9.401 8.78-22.752 9.205-33.725 4.2Zm24.883 3.86c-8.329 1.638-16.88 1.235-22.595-2.16 10.65 3.913 23.028 2.933 31.965-5.427l.016-.014.014-.017c4.26-5.078 5.53-10.742 5.858-16.918.152-2.85.104-5.82.054-8.894-.004-.252-.009-.505-.012-.76-.053-3.322-.089-6.77.134-10.347 7.018-11.306 8.862-19.987 7.438-26.244a14.89 14.89 0 0 0-1.878-4.614c1.739 1.19 3.292 2.613 4.587 4.277 3.954 5.078 5.559 12.459 2.702 22.506-1.001 2.801-1.353 5.922-1.463 9.17-.068 2.006-.043 4.08-.018 6.165.016 1.286.031 2.576.025 3.856-.033 6.75-.669 13.312-4.946 18.411-4.289 5.113-12.883 9.238-21.881 11.01Z",fill:"url(#b)"}),B.createElement("path",{d:"M127.446 16.327c-3.244-1.852-7.002-2.997-10.892-3.488-6.766-.855-13.89.276-19.329 3.063-5.434 2.785-9.148 7.199-9.223 12.924l-.002.119-.079.093c-5.843 6.966-9.659 20.016-10.557 32.435-.449 6.201-.167 12.22.94 17.213.98 4.414 2.595 7.981 4.876 10.185 10.973 5.004 24.324 4.579 33.725-4.2 4.112-4.911 5.36-10.401 5.684-16.502.151-2.827.103-5.774.053-8.854l-.013-.754c-.052-3.35-.089-6.848.141-10.484l.006-.083.045-.073c7.013-11.272 8.769-19.79 7.397-25.817-.515-2.263-1.474-4.185-2.772-5.777Zm0 0c.844 1.351 3.096 3.896 3.489 5.622 1.424 6.257-.42 14.938-7.438 26.244-.223 3.577-.187 7.025-.134 10.348.003.254.008.507.012.76.05 3.073.098 6.043-.054 8.893-.328 6.176-1.598 11.84-5.858 16.918l-.014.017-.016.014c-8.937 8.36-21.315 9.34-31.965 5.426 5.714 3.396 14.266 3.799 22.595 2.16 8.998-1.77 17.592-5.896 21.881-11.009 4.278-5.1 4.913-11.662 4.946-18.411.006-1.28-.009-2.57-.025-3.856-.025-2.085-.05-4.16.018-6.165.11-3.248.462-6.369 1.463-9.17 2.857-10.047 1.252-17.428-2.702-22.506-1.295-1.663-4.459-4.094-6.198-5.285ZM79.438 84.58c-1.068-1.98-1.891-4.396-2.479-7.127-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.818 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.05l.04-.048.02-.056c2.375-6.458 7.575-11.181 13.626-13.934 6.054-2.754 12.93-3.521 18.62-2.094 2.777.697 5.27 1.914 7.252 3.68-2.873-1.34-6.039-2.195-9.28-2.604-6.903-.872-14.187.276-19.779 3.142-5.56 2.85-9.482 7.422-9.611 13.412-5.937 7.152-9.74 20.31-10.638 32.729-.452 6.245-.171 12.33.954 17.4.466 2.101 1.08 4.038 1.85 5.744Z",stroke:"#000",strokeWidth:1.105}),B.createElement("g",{filter:"url(#c)"},B.createElement("path",{d:"M123.137 48.094c-.921 14.487 2.423 26.813-5.96 36.805-9.657 9.033-23.41 9.346-34.564 4.096-11.757-8.734-7.874-48.46 3.484-61.999C95.75.75 151.273 2.868 123.137 48.094Z",fill:"#0081DE"}),B.createElement("path",{d:"m122.821 47.922-.045.072-.006.084c-.23 3.636-.193 7.134-.141 10.483l.013.755c.05 3.079.098 6.027-.053 8.854-.324 6.1-1.572 11.59-5.684 16.5-9.506 8.878-23.051 9.214-34.092 4.031-2.822-2.113-4.751-6.124-5.854-11.247-1.103-5.125-1.366-11.3-.907-17.637.46-6.335 1.638-12.819 3.407-18.557 1.772-5.744 4.127-10.717 6.924-14.051l.04-.047.02-.056c2.375-6.458 7.575-11.182 13.626-13.934 6.054-2.755 12.93-3.522 18.62-2.094 5.676 1.423 10.163 5.024 11.529 11.026 1.372 6.027-.384 14.546-7.397 25.818Z",stroke:"#000",strokeWidth:1.105})),B.createElement("g",{filter:"url(#d)"},B.createElement("path",{d:"m85.013 75.222 26.868-2.453",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#e)"},B.createElement("path",{d:"m86.003 65.37 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#f)"},B.createElement("path",{d:"m88.856 55.66 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#g)"},B.createElement("path",{d:"m91.344 45.99 23.79-1.938",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#h)"},B.createElement("path",{d:"m88.096 80.49 12.163-41.706",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("g",{filter:"url(#i)"},B.createElement("path",{d:"m97.642 82.913 12.163-41.707",stroke:"#3B6787",strokeWidth:1.104})),B.createElement("path",{d:"m109.5 23-2 1 .5 2",stroke:"#000"}),B.createElement("path",{d:"M102.743 33.484c1.514.834 3.574.173 4.6-1.477 1.025-1.65.629-3.663-.886-4.497-1.514-.834-3.574-.173-4.6 1.477-1.025 1.65-.629 3.663.886 4.497Z",fill:"#000"}),B.createElement("path",{d:"m88.975 91.492-10.787 33.683M110.007 92.21l15.69 35.99M123.199 47.411l31.38 22.61",stroke:"#000",strokeWidth:5.525}),B.createElement("path",{d:"M106.609 16.93c-1.961-.93-3.391-.23-4.422.383.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.256-.734-2.83-2.583-3.707ZM117.727 20.447c-1.961-.93-3.391-.231-4.422.382.325.705 1.311 2.276 2.656 2.914 1.345.638 3.436.803 4.349.41-.03-1.255-.734-2.83-2.583-3.706Z",stroke:"#000",strokeWidth:1.105}),B.createElement("mask",{id:"j",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:103,y:17,width:3,height:2},B.createElement("path",{d:"M104.29 18.863c.484.23 1.073.047 1.317-.408.244-.455.05-1.01-.434-1.24-.484-.23-1.073-.046-1.317.409-.244.455-.049 1.01.434 1.24Z",fill:"#fff"})),B.createElement("g",{mask:"url(#j)"},B.createElement("path",{d:"M104.641 17.996a.166.166 0 0 1 .09-.077.09.09 0 0 1 .064.002l-1.01 1.885c.984.466 2.248.114 2.788-.893l-1.932-.917Zm.154-.075c.013.006.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.163.163 0 0 1-.09.077.091.091 0 0 1-.064-.002l1.01-1.884c-.984-.467-2.248-.115-2.788.893l1.932.916Zm-.154.075a.083.083 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.917c.54-1.008.089-2.174-.895-2.64l-1.01 1.884Z",fill:"#000"})),B.createElement("mask",{id:"k",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:115,y:21,width:3,height:3},B.createElement("path",{d:"M116.058 23.016c.484.229 1.073.046 1.317-.409.244-.455.049-1.01-.434-1.24-.484-.229-1.073-.046-1.317.41-.244.454-.05 1.01.434 1.239Z",fill:"#fff"})),B.createElement("g",{mask:"url(#k)"},B.createElement("path",{d:"M116.409 22.149a.163.163 0 0 1 .09-.077.091.091 0 0 1 .064.001l-1.01 1.885c.984.467 2.248.115 2.788-.893l-1.932-.916Zm.154-.076c.013.007.03.022.039.047a.15.15 0 0 1-.012.114l-1.932-.916c-.54 1.007-.089 2.173.895 2.64l1.01-1.885Zm.027.161a.166.166 0 0 1-.09.077.091.091 0 0 1-.064-.001l1.01-1.885c-.984-.467-2.249-.114-2.788.893l1.932.916Zm-.154.076a.084.084 0 0 1-.039-.047.15.15 0 0 1 .012-.114l1.932.916c.54-1.007.089-2.173-.895-2.64l-1.01 1.885Z",fill:"#000"}))),B.createElement("rect",{y:13,width:100,height:22,rx:11,fill:"#000"}),B.createElement("path",{d:"m13.5 18.118 1.208 3.719.113.345h4.273l-3.163 2.299-.294.213.112.346 1.208 3.719-3.163-2.299-.294-.213-.294.213-3.163 2.299 1.208-3.72.112-.345-.294-.213-3.163-2.299h4.273l.113-.345 1.208-3.719Z",stroke:"#9D6CFF"}),B.createElement("path",{d:"M27.65 27.6c1.58 0 2.63-.97 2.63-2.21 0-1.43-.87-1.91-2.55-2.14-1.24-.18-1.48-.47-1.48-1.05 0-.55.42-.94 1.23-.94.82 0 1.25.32 1.38 1.07h1.22c-.14-1.37-1.06-2.07-2.6-2.07-1.49 0-2.49.88-2.49 2.05 0 1.34.81 1.86 2.52 2.09 1.16.19 1.49.44 1.49 1.1 0 .66-.56 1.1-1.35 1.1-1.21 0-1.5-.6-1.59-1.32h-1.28c.1 1.35.92 2.32 2.87 2.32Zm5.598-.01c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm3.33.01c.8 0 1.26-.29 1.6-.74v.64h1.19v-3.43c0-1.43-.92-1.91-2.09-1.91s-2.14.51-2.24 1.73h1.17c.06-.52.37-.82 1-.82.71 0 .95.35.95 1.05v.27h-.65c-1.5 0-2.68.44-2.68 1.66 0 1.09.79 1.55 1.75 1.55Zm.29-.87c-.6 0-.84-.29-.84-.73 0-.64.59-.85 1.51-.85h.62v.52c0 .67-.55 1.06-1.29 1.06Zm3.887.77h1.21v-2.72c0-1.11.64-1.45 1.7-1.46v-1.13c-.88.01-1.37.4-1.7 1.06v-.98h-1.21v5.23Zm8.698-.84c-.92 0-1.45-.67-1.45-1.74v-.08c0-1.08.55-1.73 1.45-1.73.9 0 1.44.66 1.44 1.74v.07c0 1.07-.54 1.74-1.44 1.74Zm-.01.94c1.54 0 2.69-1.06 2.69-2.69v-.08c0-1.6-1.15-2.67-2.68-2.67-1.54 0-2.69 1.08-2.69 2.7v.08c0 1.59 1.14 2.66 2.68 2.66Zm3.783-.1h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-.83h-1.21v5.23Zm11.777.1c2.02 0 3.26-1.2 3.26-3.18v-.66h-3.11v1h1.8c-.04.99-.59 1.8-1.93 1.8-1.5 0-2.21-1.05-2.21-2.58v-.08c0-1.57.81-2.61 2.21-2.61.93 0 1.57.41 1.73 1.36h1.33c-.19-1.71-1.55-2.41-3.08-2.41-2.09 0-3.57 1.52-3.57 3.65v.08c0 2.11 1.28 3.63 3.57 3.63Zm4.474-.1h1.21v-5.23h-1.21v5.23Zm.59-6.09c.4 0 .72-.3.72-.69 0-.4-.32-.7-.72-.7-.4 0-.72.3-.72.7 0 .39.32.69.72.69Zm3.874 6.18c.37 0 .63-.06.82-.13v-.96c-.17.07-.35.1-.59.1-.38 0-.6-.21-.6-.67v-2.75h1.15v-.91h-1.15v-1.15h-1.21v1.15h-.7v.91h.7v2.86c0 .99.54 1.55 1.58 1.55Zm1.912-.09h1.21v-3.08c0-.83.55-1.25 1.23-1.25.72 0 1.04.36 1.04 1.15v3.18h1.21v-3.29c0-1.44-.74-2.05-1.79-2.05-.86 0-1.44.43-1.69.94v-3.25h-1.21v7.65Zm7.834.1c.85 0 1.4-.41 1.66-.92v.82h1.21v-5.23h-1.21v3.11c0 .83-.57 1.25-1.22 1.25-.7 0-1.03-.36-1.03-1.15v-3.21h-1.21v3.35c0 1.39.77 1.98 1.8 1.98Zm7.225 0c1.35 0 2.32-1.02 2.32-2.7v-.08c0-1.69-1.01-2.66-2.32-2.66-.77 0-1.42.45-1.71.95v-3.26h-1.21v7.65h1.21v-.84c.28.53.88.94 1.71.94Zm-.3-.96c-.88 0-1.45-.55-1.45-1.72v-.08c0-1.16.6-1.73 1.44-1.73.79 0 1.39.57 1.39 1.73v.08c0 1.12-.49 1.72-1.38 1.72Z",fill:"#fff"}),B.createElement("defs",null,B.createElement("filter",{id:"c",x:70.865,y:9.821,width:64.757,height:91.658,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"d",x:80.536,y:72.219,width:35.822,height:12.392,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"e",x:81.533,y:62.882,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"f",x:84.386,y:53.173,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"g",x:86.874,y:43.502,width:32.731,height:11.877,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"h",x:83.142,y:38.646,width:22.072,height:50.822,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("filter",{id:"i",x:92.688,y:41.068,width:22.072,height:50.822,filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},B.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),B.createElement("feColorMatrix",{in:"SourceAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0",result:"hardAlpha"}),B.createElement("feOffset",{dy:4.42}),B.createElement("feGaussianBlur",{stdDeviation:2.21}),B.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),B.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_4703_152"}),B.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_4703_152",result:"shape"})),B.createElement("linearGradient",{id:"b",x1:7984.7,y1:6352.37,x2:4940.57,y2:5739.01,gradientUnits:"userSpaceOnUse"},B.createElement("stop",null),B.createElement("stop",{offset:1,stopOpacity:0})),B.createElement("clipPath",{id:"a"},B.createElement("path",{fill:"#fff",transform:"translate(43)",d:"M0 0h129v129H0z"})))),v5=Y8;var V=T(_()),q8=()=>V.default.createElement("svg",{style:{transform:"scaleX(-1)",margin:"75px 50px"},width:"200",height:"200",viewBox:"0 0 139 152",fill:"none",xmlns:"http://www.w3.org/2000/svg"},V.default.createElement("line",{y1:"-2.5",x2:"44.7223",y2:"-2.5",transform:"matrix(0.282454 0.959281 0.969447 -0.245301 108.706 62.2981)",stroke:"black",strokeWidth:"5"}),V.default.createElement("line",{y1:"-2.5",x2:"37.8202",y2:"-2.5",transform:"matrix(0.30917 0.951007 0.96312 -0.269071 94.2115 113.51)",stroke:"black",strokeWidth:"5"}),V.default.createElement("line",{y1:"-2.5",x2:"42.026",y2:"-2.5",transform:"matrix(-0.404697 0.914451 0.934686 0.355474 60.7272 113.51)",stroke:"black",strokeWidth:"5"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",fill:"#00090F"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",fill:"url(#paint0_linear)"}),V.default.createElement("path",{d:"M97.8672 111.365C100.871 108.702 103.275 104.518 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C57.7945 13.7155 54.0217 15.2578 51.0118 17.7322C55.1783 16.0594 59.747 15.1514 64.3541 14.9237C73.2372 14.4847 82.2938 16.5731 88.9362 20.6196C95.5578 24.6534 99.8036 30.6525 99.0257 38.0331C102.249 42.7078 104.564 49.1922 105.982 56.4278C107.408 63.705 107.929 71.7591 107.544 79.5305C107.159 87.301 105.867 94.7978 103.661 100.958C102.162 105.146 100.234 108.733 97.8672 111.365ZM95.2952 113.082C98.6041 110.526 101.236 106.2 103.172 100.792C105.359 94.6841 106.645 87.2331 107.029 79.4942C107.413 71.7562 106.893 63.7394 105.475 56.5022C104.057 49.2615 101.741 42.8184 98.5454 38.2157L98.4942 38.142L98.5037 38.0558C99.2981 30.8695 95.1951 25.0019 88.6645 21.0235C82.1291 17.0422 73.1858 14.9727 64.3958 15.4071C59.3271 15.6576 54.3197 16.74 49.8606 18.7609C47.927 20.6396 46.3826 22.9672 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.4077 116.547 80.4686 118.31 95.2952 113.082ZM62.8353 115.579C73.9568 118.589 85.8248 118.727 93.7629 114.109C79.2069 118.663 62.7794 116.601 52.3142 105.004L52.3034 104.991L52.2942 104.978C47.6798 98.333 46.9349 91.2383 47.4651 83.573C47.71 80.0323 48.2278 76.3618 48.7647 72.5552C48.8087 72.2433 48.8528 71.9304 48.8969 71.6166C49.4773 67.4894 50.0564 63.1995 50.3218 58.7213C43.1139 44.0566 42.1191 33.1641 44.874 25.6005C45.7514 23.1915 47.0073 21.1253 48.5583 19.3861C45.7969 20.7884 43.2762 22.5738 41.1213 24.7697C35.2478 30.755 32.0615 39.8204 34.1633 52.5799C35.0021 56.12 34.973 60.0019 34.6133 64.0333C34.3912 66.5219 34.0413 69.0827 33.6891 71.6598C33.4713 73.2535 33.2526 74.8536 33.0628 76.4467C32.0655 84.8179 31.8563 93.0672 36.5571 99.8369C41.2648 106.617 51.622 112.545 62.8353 115.579Z",stroke:"black",strokeWidth:"0.5"}),V.default.createElement("g",{filter:"url(#filter0_d)"},V.default.createElement("path",{d:"M50.5827 58.6809C49.5253 76.7216 43.3703 91.6895 52.5089 104.85C63.4182 116.939 80.8842 118.6 95.8988 113.127C112.216 103.39 113.383 53.7942 101 35.9614C92.7473 2.53842 21.7073 0.0230777 50.5827 58.6809Z",fill:"#FFEBEB"}),V.default.createElement("path",{d:"M50.8161 58.5846L50.8436 58.6404L50.84 58.7011C50.5751 63.2213 49.9909 67.5476 49.408 71.6934C49.364 72.0063 49.32 72.3181 49.2762 72.6289C48.7387 76.4394 48.2232 80.0942 47.9795 83.618C47.4528 91.2319 48.1984 98.1972 52.7144 104.709C63.5237 116.675 80.8393 118.347 95.7767 112.909C99.7734 110.514 102.875 105.657 105.076 99.388C107.277 93.1163 108.563 85.4693 108.954 77.5619C109.345 69.6555 108.841 61.498 107.468 54.208C106.094 46.9136 103.853 40.5075 100.785 36.0895L100.76 36.0525L100.749 36.0097C98.7055 27.7331 92.7735 21.362 85.4555 17.3707C78.1349 13.3779 69.4458 11.7774 61.9203 13.0292C54.402 14.2799 48.056 18.3727 45.3622 25.7687C42.6639 33.177 43.6113 43.9486 50.8161 58.5846Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),V.default.createElement("g",{filter:"url(#filter1_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.0263",y2:"-0.125",transform:"matrix(-1.00036 -0.232717 -0.303964 0.923249 90.9426 103.996)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter2_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 92.4263 92.9282)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter3_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 91.7477 81.6816)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter4_d)"},V.default.createElement("line",{y1:"-0.125",x2:"26.6148",y2:"-0.125",transform:"matrix(-0.998412 -0.240755 -0.312384 0.920564 91.4735 70.5457)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter5_d)"},V.default.createElement("line",{y1:"-0.125",x2:"49.6473",y2:"-0.125",transform:"matrix(-0.056611 -0.972639 -1.01868 0.0895582 85.7439 108.932)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("g",{filter:"url(#filter6_d)"},V.default.createElement("line",{y1:"-0.125",x2:"49.0215",y2:"-0.125",transform:"matrix(-0.0447349 -0.972962 -1.01982 0.0794914 74.2345 109.899)",stroke:"#002540",strokeWidth:"0.25"})),V.default.createElement("path",{d:"M77.5748 21.6128C81.1721 21.0053 83.1051 22.723 84.446 24.1319C83.5748 25.0968 81.2156 27.1306 78.7489 27.5472C76.2822 27.9638 72.8613 27.3151 71.5987 26.3018C72.2742 24.3479 74.1847 22.1854 77.5748 21.6128Z",stroke:"black"}),V.default.createElement("path",{d:"M77.1438 24.7826C77.2286 25.211 77.6735 25.4954 78.138 25.417C78.6025 25.3385 78.9097 24.9272 78.8249 24.4987C78.7401 24.0703 78.2952 23.7859 77.8307 23.8643C77.3662 23.9428 77.059 24.3541 77.1438 24.7826Z",stroke:"black",strokeWidth:"1.5"}),V.default.createElement("path",{d:"M56.7304 23.0188C60.3276 22.4113 62.2607 24.129 63.6015 25.5379C62.7303 26.5028 60.3711 28.5366 57.9044 28.9532C55.4378 29.3698 52.0168 28.7211 50.7542 27.7078C51.4297 25.7539 53.3402 23.5914 56.7304 23.0188Z",stroke:"black"}),V.default.createElement("path",{d:"M56.2062 26.2049C56.291 26.6334 56.7359 26.9177 57.2004 26.8393C57.6649 26.7609 57.9721 26.3496 57.8873 25.9211C57.8025 25.4926 57.3576 25.2083 56.8931 25.2867C56.4286 25.3651 56.1214 25.7765 56.2062 26.2049Z",stroke:"black",strokeWidth:"1.5"}),V.default.createElement("path",{d:"M70.9027 31.9832L74.8034 33.746L74.6873 36.5264",stroke:"black"}),V.default.createElement("ellipse",{rx:"5.52852",ry:"7.22499",transform:"matrix(-1.00798 0.230879 0.25069 0.931832 78.3648 46.1813)",fill:"#0B0B0B"}),V.default.createElement("line",{y1:"-2.5",x2:"46.79",y2:"-2.5",transform:"matrix(0.181746 -0.947707 -1.01992 -0.168086 34.7046 107.134)",stroke:"black",strokeWidth:"5"}),V.default.createElement("defs",null,V.default.createElement("filter",{id:"filter0_d",x:"39.718",y:"12.3701",width:"73.6225",height:"111.741",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter1_d",x:"60.907",y:"97.7083",width:"34.1116",height:"14.2876",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter2_d",x:"61.8538",y:"86.2905",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter3_d",x:"61.1752",y:"75.0439",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter4_d",x:"60.901",y:"63.908",width:"34.6506",height:"14.6378",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter5_d",x:"78.9333",y:"60.6208",width:"11.0653",height:"56.3113",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("filter",{id:"filter6_d",x:"68.0415",y:"62.1831",width:"10.4479",height:"55.716",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},V.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),V.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),V.default.createElement("feOffset",{dy:"4"}),V.default.createElement("feGaussianBlur",{stdDeviation:"2"}),V.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),V.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),V.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),V.default.createElement("linearGradient",{id:"paint0_linear",x1:"25.393",y1:"64.5732",x2:"215.189",y2:"46.963",gradientUnits:"userSpaceOnUse"},V.default.createElement("stop",{stopColor:"#D17485"}),V.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),P5=q8;var H=T(_()),Q8=()=>H.default.createElement("svg",{style:{margin:"75px 50px"},width:"200",height:"200",viewBox:"0 0 105 133",fill:"none",xmlns:"http://www.w3.org/2000/svg"},H.default.createElement("line",{y1:"-2.5",x2:"47.2325",y2:"-2.5",transform:"matrix(-0.275217 0.961382 -0.963013 -0.269454 27.7317 82.8152)",stroke:"black",strokeWidth:"5"}),H.default.createElement("path",{d:"M65.2668 85.4294L72.7953 132.508",stroke:"black",strokeWidth:"5"}),H.default.createElement("line",{y1:"-2",x2:"17.4186",y2:"-2",transform:"matrix(0.447771 0.889458 -0.901022 0.443341 17.3323 33.123)",stroke:"black",strokeWidth:"4"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",fill:"#00090F"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",fill:"url(#paint0_linear)"}),H.default.createElement("path",{d:"M26.9936 83.7798C25.4254 81.526 24.2862 78.4488 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C65.4373 12.3872 67.9311 13.7984 69.8536 15.8097C67.0517 14.2661 63.9247 13.2415 60.7165 12.7034C54.2889 11.6254 47.5057 12.4949 42.301 15.0867C37.1183 17.6675 33.4759 21.9734 33.3658 27.7745C30.6005 31.137 28.3333 35.9718 26.6505 41.4574C24.9553 46.9833 23.8481 53.1861 23.4254 59.2446C23.0027 65.3021 23.2638 71.2247 24.3113 76.1883C24.9241 79.0922 25.809 81.6819 26.9936 83.7798ZM29.3916 86.2218C27.2356 83.9806 25.7198 80.428 24.8034 76.0857C23.7678 71.1782 23.5065 65.3032 23.9269 59.2777C24.3472 53.2532 25.4484 47.0877 27.1316 41.6009C28.8158 36.1107 31.0778 31.3166 33.81 28.0218L33.866 27.9543L33.8672 27.867C33.9391 22.259 37.4335 18.0668 42.5263 15.5307C47.623 12.9927 54.2955 12.131 60.6314 13.1936C64.2807 13.8057 67.8085 15.0543 70.8547 16.9803C72.0807 18.5872 72.9856 20.5071 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9913C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.5979 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.1908 91.5285 39.6704 91.4856 29.3916 86.2218ZM52.7019 90.8343C44.5671 92.2087 36.1804 91.4087 30.8271 87.4633C40.9137 91.9819 52.8249 91.6283 61.364 83.6145L61.3754 83.6038L61.3854 83.5918C65.3495 78.8115 66.5336 73.3615 66.8414 67.3712C66.9835 64.6049 66.939 61.7156 66.8929 58.7215C66.8891 58.476 66.8853 58.2298 66.8816 57.9829C66.833 54.7406 66.7999 51.3747 67.0107 47.8897C73.571 37.1225 75.2849 28.7521 73.9624 22.643C73.5645 20.8053 72.893 19.1769 72.0003 17.7535C73.7735 19.0302 75.3517 20.5593 76.6538 22.3498C80.3662 27.4544 81.8631 34.7227 79.1866 44.4238C78.2549 47.1052 77.9251 50.122 77.822 53.2776C77.7584 55.2255 77.7813 57.2417 77.8043 59.2693C77.8186 60.5222 77.8328 61.7795 77.8268 63.0277C77.7949 69.5968 77.2007 75.989 73.1861 80.8301C69.1638 85.6806 61.1166 89.4127 52.7019 90.8343Z",stroke:"black",strokeWidth:"0.5"}),H.default.createElement("g",{filter:"url(#filter0_d)"},H.default.createElement("path",{d:"M66.7635 47.8141C65.9014 61.8826 69.0213 73.9921 61.1912 83.4343C52.1711 91.8995 39.3291 91.7402 28.9132 86.2544C17.9362 77.3573 21.5704 38.8254 32.1802 26.0312C41.1979 0.81291 93.0476 4.74773 66.7635 47.8141Z",fill:"#FFDAAE"}),H.default.createElement("path",{d:"M66.5484 47.686L66.5163 47.7385L66.5126 47.7996C66.2964 51.3271 66.33 54.7302 66.3789 57.9914C66.3826 58.2373 66.3864 58.4824 66.3901 58.7267C66.4363 61.7248 66.4806 64.598 66.3393 67.347C66.0343 73.284 64.865 78.6058 61.007 83.2649C52.094 91.6193 39.395 91.4836 29.0537 86.0465C26.3875 83.8735 24.5781 79.8737 23.5471 74.8403C22.5156 69.8046 22.2722 63.7776 22.7024 57.6208C23.1326 51.465 24.2356 45.1891 25.8911 39.6575C27.5478 34.1218 29.7523 29.3505 32.3744 26.1886L32.4024 26.1548L32.4171 26.1136C34.6444 19.8851 39.5187 15.4489 45.1857 12.9669C50.8554 10.4837 57.2988 9.96562 62.6371 11.554C67.9675 13.14 72.1875 16.8205 73.4708 22.7481C74.7573 28.6912 73.1036 36.9453 66.5484 47.686Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),H.default.createElement("g",{filter:"url(#filter1_d)"},H.default.createElement("line",{y1:"-0.125",x2:"19.8557",y2:"-0.125",transform:"matrix(0.99225 -0.137652 0.173912 0.982961 33.1741 78.5916)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter2_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146111 0.182398 0.98144 33.1637 69.7397)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter3_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146111 0.182398 0.98144 34.7578 60.917)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter4_d)"},H.default.createElement("line",{y1:"-0.125",x2:"20.3124",y2:"-0.125",transform:"matrix(0.991024 -0.146112 0.182397 0.98144 36.0442 52.1494)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter5_d)"},H.default.createElement("line",{y1:"-0.125",x2:"38.568",y2:"-0.125",transform:"matrix(0.175504 -0.982432 0.981683 0.200291 36.5092 82.8962)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("g",{filter:"url(#filter6_d)"},H.default.createElement("line",{y1:"-0.125",x2:"38.067",y2:"-0.125",transform:"matrix(0.164387 -0.984346 0.983775 0.189794 44.8636 84.5642)",stroke:"#002540",strokeWidth:"0.25"})),H.default.createElement("path",{d:"M49.2138 20.1738C46.9644 19.7261 45.7307 20.8571 44.8722 21.7876C45.407 22.4447 46.8621 23.8357 48.4045 24.1427C49.9469 24.4497 52.1011 24.0525 52.9056 23.3866C52.5057 22.068 51.3336 20.5957 49.2138 20.1738Z",stroke:"black"}),H.default.createElement("mask",{id:"path-14-inside-1",fill:"white"},H.default.createElement("ellipse",{rx:"1.01839",ry:"1.01835",transform:"matrix(0.986125 0.196328 -0.198641 0.974457 47.6494 21.8588)"})),H.default.createElement("path",{d:"M47.1744 21.7642C47.2273 21.505 47.4828 21.3372 47.7451 21.3894L47.1491 24.3128C48.5207 24.5859 49.8565 23.7086 50.1328 22.3532L47.1744 21.7642ZM47.7451 21.3894C48.0073 21.4417 48.1772 21.6941 48.1243 21.9533L45.1659 21.3644C44.8896 22.7197 45.7776 24.0398 47.1491 24.3128L47.7451 21.3894ZM48.1243 21.9533C48.0715 22.2126 47.816 22.3803 47.5537 22.3281L48.1496 19.4048C46.7781 19.1317 45.4422 20.009 45.1659 21.3644L48.1243 21.9533ZM47.5537 22.3281C47.2915 22.2759 47.1216 22.0235 47.1744 21.7642L50.1328 22.3532C50.4091 20.9978 49.5212 19.6778 48.1496 19.4048L47.5537 22.3281Z",fill:"black",mask:"url(#path-14-inside-1)"}),H.default.createElement("path",{d:"M62.2857 21.3483C60.0364 20.9006 58.8026 22.0317 57.9441 22.9622C58.4789 23.6193 59.9341 25.0103 61.4765 25.3173C63.0189 25.6243 65.1731 25.2271 65.9776 24.5612C65.5777 23.2426 64.4056 21.7703 62.2857 21.3483Z",stroke:"black"}),H.default.createElement("mask",{id:"path-17-inside-2",fill:"white"},H.default.createElement("ellipse",{rx:"1.01839",ry:"1.01835",transform:"matrix(0.986125 0.196328 -0.198641 0.974457 60.7213 23.0333)"})),H.default.createElement("path",{d:"M60.2464 22.9388C60.2993 22.6795 60.5548 22.5118 60.817 22.564L60.2211 25.4874C61.5926 25.7604 62.9285 24.8831 63.2048 23.5278L60.2464 22.9388ZM60.817 22.564C61.0793 22.6162 61.2491 22.8686 61.1963 23.1279L58.2379 22.5389C57.9616 23.8943 58.8496 25.2143 60.2211 25.4874L60.817 22.564ZM61.1963 23.1279C61.1434 23.3872 60.8879 23.5549 60.6257 23.5027L61.2216 20.5793C59.8501 20.3063 58.5142 21.1835 58.2379 22.5389L61.1963 23.1279ZM60.6257 23.5027C60.3634 23.4505 60.1936 23.198 60.2464 22.9388L63.2048 23.5278C63.4811 22.1724 62.5931 20.8524 61.2216 20.5793L60.6257 23.5027Z",fill:"black",mask:"url(#path-17-inside-2)"}),H.default.createElement("path",{d:"M55.1993 24.8215L51.5208 27.443L50.8515 30.2006",stroke:"black"}),H.default.createElement("ellipse",{rx:"3.30062",ry:"3.81835",transform:"matrix(0.971768 0.25679 -0.259902 0.960306 49.3348 36.0427)",fill:"#0B0B0B"}),H.default.createElement("line",{y1:"-2",x2:"22.0374",y2:"-2",transform:"matrix(-0.865141 0.508647 -0.513608 -0.853839 90.1277 43.4041)",stroke:"black",strokeWidth:"4"}),H.default.createElement("line",{y1:"-2",x2:"37.4541",y2:"-2",transform:"matrix(-0.786693 -0.617627 0.626127 -0.779496 90.7851 44.7039)",stroke:"black",strokeWidth:"4"}),H.default.createElement("line",{y1:"-2",x2:"24.946",y2:"-2",transform:"matrix(0.861194 -0.515172 0.263521 0.959152 18.4058 34.8635)",stroke:"black",strokeWidth:"4"}),H.default.createElement("defs",null,H.default.createElement("filter",{id:"filter0_d",x:"18.2485",y:"10.3994",width:"59.8773",height:"87.7246",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter1_d",x:"29.1307",y:"75.6125",width:"27.7453",height:"10.9789",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter2_d",x:"29.1181",y:"66.5266",width:"28.1757",height:"11.2132",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter3_d",x:"30.7122",y:"57.7039",width:"28.1757",height:"11.2132",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter4_d",x:"31.9986",y:"48.9363",width:"28.1757",height:"11.2133",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter5_d",x:"32.2638",y:"44.9558",width:"15.0143",height:"45.9405",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("filter",{id:"filter6_d",x:"40.6176",y:"47.0457",width:"14.5037",height:"45.5186",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},H.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),H.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),H.default.createElement("feOffset",{dy:"4"}),H.default.createElement("feGaussianBlur",{stdDeviation:"2"}),H.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),H.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),H.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),H.default.createElement("linearGradient",{id:"paint0_linear",x1:"-22.3171",y1:"36.4033",x2:"105.851",y2:"59.8025",gradientUnits:"userSpaceOnUse"},H.default.createElement("stop",{stopColor:"#8A2E28"}),H.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),b5=Q8;var ex=e=>{let t=0;for(let n=0;nex(e)==1979576830;var qi=T(_());var E5=(e,t)=>{var n;return((n=e.experiment)==null?void 0:n.experiment_id)===t},A5=e=>{var t;return((t=e.experiment)==null?void 0:t.variant)==="A"};var tx=e=>E5(e.analysisData,e.experimentID)?A5(e.analysisData)?qi.default.createElement(qi.default.Fragment,null,e.aElement):qi.default.createElement(qi.default.Fragment,null,e.bElement):qi.default.createElement(qi.default.Fragment,null,e.aElement),k5=tx;var N5="Your Company/Organization",nx="AppleSoftBook",rx=e=>ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{margin:0}},"Sign Up for Mito"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},"We\u2019ll send you periodic product updates and welcome any feedback. And no spam. Duh.")),ee.default.createElement("form",{className:"signup-modal-email-form",onSubmit:async n=>{n.preventDefault(),await e.mitoAPI.updateSignUp(e.email),e.next()}},ee.default.createElement("p",{className:"text-body-1",style:{marginTop:"10px",marginBottom:0}},"Email"),ee.default.createElement(ne,{value:e.email,onChange:n=>{e.setEmail(n.target.value)},type:"email",width:"large",placeholder:"example@gmail.com",required:!0,autoFocus:!0}),ee.default.createElement("label",null,ee.default.createElement("p",{className:"text-body-1",style:{marginTop:"10px",marginBottom:0}},N5)),ee.default.createElement(ne,{value:e.firstResponse,onChange:n=>{e.setFirstResponse(n.target.value)},placeholder:nx,required:!0,style:{marginBottom:"10px"}}),ee.default.createElement("div",{className:"mt-10px",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"dark",width:"large",type:"submit"},"Sign Up")))),ox=e=>{let[t,n]=(0,ee.useState)(e.isPro),[r,o]=(0,ee.useState)(!1),[i,a]=(0,ee.useState)(""),[s,l]=(0,ee.useState)(!1),d=()=>{if(!Am(i)){l(!0);return}l(!1),o(!1),n(!0),e.mitoAPI.log("signup_completed_pro",{location:"signup"}),e.mitoAPI.updateGoPro(),e.next()};return ee.default.createElement(ee.default.Fragment,null,!r&&ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},t?"You've Signed up for Mito Pro!":"Want More Power? Consider Mito Pro"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},t?"Thanks for being a Mito Pro user! Paying for Mito gets you access to advanced functionality and turns off telemetry. In turn, it allows us to fund Mito's development.":"Mito Pro gives you access to advanced functionality, and allows you to turn off telemetry. It also allows us to continue to fund Mito's development!")),!t&&ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",href:"https://trymito.io/plans",target:"_blank",onClick:()=>{o(!0),e.mitoAPI.log("signup_clicked_pro")}},"See Plans"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:e.next,autoFocus:!0},ee.default.createElement(k5,{analysisData:e.analysisData,experimentID:"title_name",aElement:"No Thanks",bElement:"Skip"}))),t&&ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:e.next,autoFocus:!0},"Continue"))),r&&ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},"Access Pro"),ee.default.createElement("p",{className:"signup-modal-text"},"Complete the checkout flow. In the Pro documentation, click ",ee.default.createElement("b",null,"Get Access Code")," and enter it here."),ee.default.createElement("label",null,ee.default.createElement("h3",{className:"text-header-2",style:{marginTop:"5px",marginBottom:0}},"Access Code:")),ee.default.createElement(ne,{placeholder:"mito-pro-access-code-XXXXXXXXXXXX",value:i,onChange:u=>{a(u.target.value)},onKeyDown:u=>{u.key==="Enter"&&d()}}),s&&ee.default.createElement("p",{className:"signup-modal-text signup-modal-text-error"},"Invalid access code")),ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:()=>{o(!1)}},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:d,autoFocus:!0},"Submit"))))},ix=e=>{let t=async()=>{await e.mitoAPI.updateFeedback("company/organization",e.numUsages,[{question:N5,answer:e.firstResponse}]),e.next()};return ee.default.createElement("div",{className:"signup-modal-left-column"},ee.default.createElement("div",null,ee.default.createElement("h1",{className:"text-header-1",style:{marginTop:0,marginBottom:0}},e.isPro&&"Mito Pro is Totally Private",!e.isPro&&"Mito is Built for Privacy"),ee.default.createElement("p",{className:"signup-modal-text",style:{marginTop:"10px"}},e.isPro&&"As a Mito Pro user, no data leaves your computer, ever. Check out our CCPA compliant privacy policy",!e.isPro&&"We make sure none of your private data leaves your computer. Read our CCPA compliant privacy policy"," "," ",ee.default.createElement("a",{href:"https://privacy.trymito.io/privacy-policy",target:"_blank",rel:"noreferrer"},ee.default.createElement("u",null,"here")),".")),ee.default.createElement("div",{className:"signup-modal-buttons",style:{marginTop:"10px"}},ee.default.createElement(j,{variant:"light",width:"small",onClick:e.back},"Back"),ee.default.createElement(j,{variant:"dark",width:"small",onClick:t,autoFocus:!0},"Accept")))},ax=e=>{let[t,n]=(0,ee.useState)(1),[r,o]=(0,ee.useState)(""),[i,a]=(0,ee.useState)(""),s=()=>{if(t+1>3)e.setUIState(u=>f(m({},u),{currOpenModal:{type:"None"},currOpenTaskpanel:{type:"import files"}})),e.mitoAPI.log("finished_signup");else{let u=Math.min(t+1,3);n(u),e.mitoAPI.log("switched_signup_step",{old_signup_step:t,new_signup_step:u})}},l=()=>{let u=Math.max(t-1,0);n(u),e.mitoAPI.log("switched_signup_step",{old_signup_step:t,new_signup_step:u})},d={1:"#FFEBEB",2:"#F0C5BB",3:"#FFDAAE"};return ee.default.createElement("div",{className:"overlay"},ee.default.createElement("div",{className:M("signup-modal-container")},ee.default.createElement("div",{className:"signup-modal-left-column-container"},t===1&&ee.default.createElement(rx,{next:s,email:r,setEmail:o,firstResponse:i,setFirstResponse:a,mitoAPI:e.mitoAPI}),t===2&&ee.default.createElement(ox,{next:s,back:l,isPro:e.isPro,mitoAPI:e.mitoAPI,analysisData:e.analysisData}),t===3&&ee.default.createElement(ix,{next:s,back:l,firstResponse:i,numUsages:e.numUsages,mitoAPI:e.mitoAPI,isPro:e.isPro})),ee.default.createElement("div",{className:"signup-modal-right-column-container",style:{backgroundColor:d[t]}},t===1&&ee.default.createElement(P5,null),t===2&&ee.default.createElement(v5,null),t===3&&ee.default.createElement(b5,null))))},M5=ax;var Ye=T(_());var sx=e=>((0,Ye.useEffect)(()=>{e.mitoAPI.log("opened_upgrade_modal")},[]),Ye.default.createElement("div",{className:"overlay"},Ye.default.createElement("div",{className:"upgrade-modal-container txt-16"},Ye.default.createElement("h2",{className:"mt-5px"},"Time to Upgrade!"),Ye.default.createElement("p",null,"To get Mito's most advanced functionality:"),Ye.default.createElement("ol",null,Ye.default.createElement("li",{className:"mt-5px"},Ye.default.createElement("p",null,"Open a new terminal/command prompt (where you ran the commands to install Mito).")),Ye.default.createElement("li",{className:"mt-10px"},Ye.default.createElement("div",{className:"upgrade-modal-code-list-item"},Ye.default.createElement("p",null,"Run the command:"),Ye.default.createElement("code",{className:"upgrade-modal-code"},"python -m pip install mitoinstaller --upgrade"))),Ye.default.createElement("li",{className:"mt-10px"},Ye.default.createElement("div",{className:"upgrade-modal-code-list-item"},Ye.default.createElement("p",null,"Run the command:"),Ye.default.createElement("code",{className:"upgrade-modal-code"},"python -m mitoinstaller upgrade"))),Ye.default.createElement("li",{className:"mt-10px"},Ye.default.createElement("p",null,Ye.default.createElement("b",null,"Restart your Kernel")," by clicking on Kernel > Restart Kernel.")),Ye.default.createElement("li",{className:"mt-10px"},Ye.default.createElement("p",null,Ye.default.createElement("b",null,"Refresh this webpage.")))),Ye.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.mitoAPI.log("closed_upgrade"),e.mitoAPI.updateManuallyMarkUpgraded(),e.setUIState(n=>f(m({},n),{currOpenModal:{type:"None"}}))}},"Got it!")))),O5=sx;var Z=T(_());function lx(e,t,n){let r=e+"_edit",o=async s=>{let l=me(),d=await t._edit(r,s,l);if("error"in d)return d.error},a=n.stepSummaryList.filter(s=>s.step_type===e).map(s=>({params:s.params,results:s.result}));return{edit:o,previousParamsAndResults:a}}var km=lx;var N1=T(_()),dx=()=>N1.default.createElement("svg",{width:"20",height:"17",viewBox:"0 0 20 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"},N1.default.createElement("path",{d:"M12.7509 16.5995L19.5985 9.75201C20.1339 9.21791 20.1339 8.34964 19.5985 7.81553L12.7509 0.968013C12.2155 0.432537 11.3486 0.432537 10.8145 0.968013C10.2803 1.50349 10.279 2.37039 10.8145 2.90449L15.3242 7.41427H2.19616C1.4402 7.41427 0.82666 8.02781 0.82666 8.78377C0.82666 9.53974 1.4402 10.1533 2.19616 10.1533H15.3242L10.8145 14.6631C10.5474 14.9301 10.4132 15.2807 10.4132 15.6313C10.4132 15.9819 10.5474 16.3325 10.8145 16.5995C11.3499 17.135 12.2168 17.135 12.7509 16.5995Z",fill:"#767180"})),F5=dx;var dn=T(_());var jr=(e,t,n)=>dn.default.createElement(I,{onClick:()=>{var r;t(e),(r=n.current)==null||r.focus()},justify:"center",align:"center",className:"ai-transformation-example"},dn.default.createElement("p",null,e)),ux=(e,t)=>{var n;return e.length===0||(n=e[t].data[0])==null?void 0:n.columnHeader},mx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)&&G(r.columnHeader).toLowerCase().includes("date")))==null?void 0:n.columnHeader},cx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)&&G(r.columnHeader).toLowerCase().includes("number")))==null?void 0:n.columnHeader},fx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>Zn(r.columnDtype)))==null?void 0:n.columnHeader},px=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>et(r.columnDtype)))==null?void 0:n.columnHeader},hx=(e,t)=>{var n;return e.length===0||(n=e[t].data.find(r=>it(r.columnDtype)))==null?void 0:n.columnHeader},gx=e=>{let t=ux(e.sheetDataArray,e.selectedSheetIndex),n=mx(e.sheetDataArray,e.selectedSheetIndex),r=cx(e.sheetDataArray,e.selectedSheetIndex),o=fx(e.sheetDataArray,e.selectedSheetIndex),i=px(e.sheetDataArray,e.selectedSheetIndex),a=hx(e.sheetDataArray,e.selectedSheetIndex),s=[t,n,r,o,i,a].filter(l=>l!==void 0).length;return dn.default.createElement(dn.default.Fragment,null,dn.default.createElement("div",{className:"mito-blue-container"},dn.default.createElement("div",{className:"text-header-3"},"Examples"),e.sheetDataArray.length===0?dn.default.createElement(dn.default.Fragment,null,jr("create a dataframe named df with sample data",e.setUserInput,e.chatInputRef),jr("import the most recent csv from the current folder",e.setUserInput,e.chatInputRef)):dn.default.createElement(dn.default.Fragment,null,t&&jr(`sort the column ${G(t)} in ascending order`,e.setUserInput,e.chatInputRef),n&&jr(`convert ${G(n)} to a datetime`,e.setUserInput,e.chatInputRef),r&&jr(`convert ${G(r)} to a number`,e.setUserInput,e.chatInputRef),o&&jr(`extract the first character from ${G(o)}`,e.setUserInput,e.chatInputRef),i&&jr(`add 100 to ${G(i)}`,e.setUserInput,e.chatInputRef),a&&jr(`extract the month from ${G(a)}`,e.setUserInput,e.chatInputRef),s<3&&dn.default.createElement(dn.default.Fragment,null,jr("can you delete columns with any null values",e.setUserInput,e.chatInputRef),jr("fully capitalize column headers",e.setUserInput,e.chatInputRef))),dn.default.createElement(I,{justify:"center"},dn.default.createElement("p",{className:"text-subtext-1"},"or send any message to Mito AI below."))),dn.default.createElement(se,{px:10}))},L5=gx;var ce=T(_());var Zl=T(_()),yx=e=>e.variant==="selected"?Zl.default.createElement("svg",{onClick:e.onClick,width:"18",height:"11",viewBox:"0 0 18 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zl.default.createElement("path",{d:"M8.8 0C4.9621 0 1.6346 2.2352 0 5.5C1.6346 8.7648 4.9621 11 8.8 11C12.6379 11 15.9654 8.7648 17.6 5.5C15.9654 2.2352 12.6379 0 8.8 0ZM13.1395 2.9172C14.1735 3.5772 15.0502 4.4605 15.708 5.5C15.0502 6.5406 14.1735 7.4239 13.1395 8.0828C11.8404 8.9111 10.34 9.35 8.8011 9.35C7.2622 9.35 5.7618 8.9122 4.4616 8.0828C3.4276 7.4228 2.5509 6.5395 1.8931 5.5C2.5509 4.4594 3.4276 3.5761 4.4616 2.9172C4.5287 2.8743 4.5969 2.8325 4.6651 2.7918C4.4935 3.2615 4.4 3.7686 4.4 4.2977C4.4 6.7276 6.3701 8.6977 8.8 8.6977C11.2299 8.6977 13.2 6.7276 13.2 4.2977C13.2 3.7686 13.1065 3.2615 12.9349 2.7918C13.0031 2.8325 13.0724 2.8743 13.1395 2.9172ZM8.8 3.85C8.8 4.7608 8.0608 5.5 7.15 5.5C6.2392 5.5 5.5 4.7608 5.5 3.85C5.5 2.9392 6.2392 2.2 7.15 2.2C8.0608 2.2 8.8 2.9392 8.8 3.85Z",fill:"#9D6CFF"})):Zl.default.createElement("svg",{onClick:e.onClick,width:"19",height:"11",viewBox:"0 0 19 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Zl.default.createElement("path",{d:"M9.65693 0C5.81903 0 2.49153 2.2352 0.856934 5.5C2.49153 8.7648 5.81903 11 9.65693 11C13.4948 11 16.8223 8.7648 18.4569 5.5C16.8223 2.2352 13.4948 0 9.65693 0ZM13.9964 2.9172C15.0304 3.5772 15.9071 4.4605 16.5649 5.5C15.9071 6.5406 15.0304 7.4239 13.9964 8.0828C12.6973 8.9111 11.1969 9.35 9.65803 9.35C8.11913 9.35 6.61873 8.9122 5.31853 8.0828C4.28453 7.4228 3.40783 6.5395 2.75003 5.5C3.40783 4.4594 4.28453 3.5761 5.31853 2.9172C5.38563 2.8743 5.45383 2.8325 5.52203 2.7918C5.35043 3.2615 5.25693 3.7686 5.25693 4.2977C5.25693 6.7276 7.22703 8.6977 9.65693 8.6977C12.0868 8.6977 14.0569 6.7276 14.0569 4.2977C14.0569 3.7686 13.9634 3.2615 13.7918 2.7918C13.86 2.8325 13.9293 2.8743 13.9964 2.9172ZM9.65693 3.85C9.65693 4.7608 8.91773 5.5 8.00693 5.5C7.09613 5.5 6.35693 4.7608 6.35693 3.85C6.35693 2.9392 7.09613 2.2 8.00693 2.2C8.91773 2.2 9.65693 2.9392 9.65693 3.85Z",fill:"#767180"})),U5=yx;var Sx=e=>{let[t,n]=(0,ce.useState)(void 0),r=e.result;if(r===void 0)return ce.default.createElement(ce.default.Fragment,null);let o={prompt_version:e.params.prompt_version,prompt:e.params.prompt.split(` `),completion:e.params.completion.split(` `),edited_completion:e.params.edited_completion.split(` `)};return ce.default.createElement("div",{className:"ai-transformation-result-section"},ce.default.createElement(I,{justify:"space-between"},ce.default.createElement(C,{span:22},r.last_line_value!==void 0&&r.last_line_value!==null&&ce.default.createElement("p",null,ce.default.createElement("span",null,"Value:")," ",r.last_line_value),r.prints.length>0&&ce.default.createElement(ce.default.Fragment,null,ce.default.createElement("p",null,ce.default.createElement("span",null,"Printed:")),ce.default.createElement("pre",null,r.prints)),r.created_dataframe_names.map(i=>{let a=e.sheetDataArray.findIndex(u=>u.dfName===i),s=e.sheetDataArray[a],l=(s==null?void 0:s.numRows)||0,d=(s==null?void 0:s.numColumns)||0;return ce.default.createElement("div",{key:i,onClick:()=>{e.setUIState(u=>f(m({},u),{selectedSheetIndex:a!==-1?a:u.selectedSheetIndex}))}},ce.default.createElement("span",{className:M({"text-color-recon-created":e.isMostRecentResult})},"Created:")," ",ce.default.createElement("span",{className:"text-underline"},i)," (",l," rows, ",d," columns)")}),Object.entries(r.modified_dataframes_recons).map(([i,a])=>{let s=a.column_recon,l=e.sheetDataArray.findIndex(c=>c.dfName===i),d=a.num_added_or_removed_rows,u=d!==0?d<0?`(Removed ${d*-1} rows)`:`(Added ${d} rows)`:void 0;return ce.default.createElement("div",{key:i},ce.default.createElement("div",{onClick:()=>{e.setUIState(c=>f(m({},c),{selectedSheetIndex:l!==-1?l:c.selectedSheetIndex}))}},ce.default.createElement("span",{className:M({"text-color-recon-modified":e.isMostRecentResult})},"Modified:")," ",ce.default.createElement("span",{className:"text-underline"},i)," ",u),s.created_columns.map((c,p)=>ce.default.createElement("div",{key:i+"added"+p,className:"ml-5px"},ce.default.createElement("span",{className:M({"text-color-recon-created":e.isMostRecentResult})},"Added column: "),G(c))),s.modified_columns.map((c,p)=>ce.default.createElement("div",{key:i+"modified"+p,className:"ml-5px"},ce.default.createElement("span",{className:M({"text-color-recon-modified":e.isMostRecentResult})},"Modified column: "),G(c))),Object.entries(s.renamed_columns).map(([c,p],h)=>ce.default.createElement("div",{key:i+"renamed"+h,className:"ml-5px"},ce.default.createElement("span",{className:M({"text-color-recon-modified":e.isMostRecentResult})},"Renamed column: "),G(c)," to ",G(p)," ")),s.deleted_columns.map((c,p)=>ce.default.createElement("div",{key:i+"removed"+p,className:"ml-5px"},"Deleted column: ",G(c))))}),r.deleted_dataframe_names.map(i=>ce.default.createElement("div",{key:i},ce.default.createElement("span",null,"Deleted:")," ",ce.default.createElement("span",null,i))),(r.last_line_value===void 0||r.last_line_value===null)&&r.created_dataframe_names.length===0&&Object.entries(r.modified_dataframes_recons).length===0&&r.prints.length===0&&r.deleted_dataframe_names.length===0&&ce.default.createElement("p",null,"No changes")),ce.default.createElement(C,{span:1.5,offset:.5},(r.created_dataframe_names.length>0||Object.entries(r.modified_dataframes_recons).length>0||r.deleted_dataframe_names.length>0)&&e.isMostRecentResult&&ce.default.createElement(U5,{variant:e.uiState.dataRecon!==void 0?"selected":"unselected",onClick:()=>{e.setUIState(i=>{if(i.dataRecon!==void 0)return e.setDisplayRecon(!1),f(m({},i),{dataRecon:void 0});let a={created_dataframe_names:r.created_dataframe_names,deleted_dataframe_names:r.deleted_dataframe_names,modified_dataframes_recons:r.modified_dataframes_recons};return f(m({},i),{dataRecon:a})})}}))),ce.default.createElement(I,{justify:"space-between",align:"center",suppressTopBottomMargin:!0},ce.default.createElement(C,null,ce.default.createElement("p",{className:"text-body-2"},"How did Mito AI Assistant do?")),ce.default.createElement(C,{offsetRight:.5},ce.default.createElement(I,{suppressTopBottomMargin:!0},ce.default.createElement(C,null,ce.default.createElement("p",{className:M("ai-transformation-feedback-button",{"ai-transformation-feedback-button-selected":t==="Up"}),onClick:()=>{n("Up"),e.mitoAPI.log("ai_transformation_feedback",m({feedback:"Up"},o))}},"\u{1F44D}")),ce.default.createElement(C,{offset:2},ce.default.createElement("p",{className:M("ai-transformation-feedback-button",{"ai-transformation-feedback-button-selected":t==="Down"}),onClick:()=>{n("Down"),e.mitoAPI.log("ai_transformation_feedback",m({feedback:"Down"},o))}},"\u{1F44E}"))))),t!==void 0&&ce.default.createElement("p",{className:"text-body-2"},"Thanks for the feedback - ",t==="Down"?"we're working hard to improve.":"we're glad things are working well!"))},B5=Sx;var is=T(_()),Cx=()=>is.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},is.default.createElement("circle",{cx:"8",cy:"8",r:"7.25",fill:"#F5F5F5",stroke:"#9D6CFF",strokeWidth:"0.5"}),is.default.createElement("path",{d:"M15 8C15 7.0256 14.7966 6.06193 14.4027 5.17067C14.0089 4.27941 13.4333 3.48019 12.7128 2.82416L8 8H15Z",fill:"#9D6CFF"},is.default.createElement("animateTransform",{attributeName:"transform",attributeType:"XML",type:"rotate",from:"0 8 8",to:"360 8 8",dur:"1s",repeatCount:"indefinite"})),is.default.createElement("circle",{cx:"8",cy:"8",r:"5",fill:"white",stroke:"#9D6CFF",strokeWidth:"0.5"})),Nm=Cx;var H5=T(_()),Mm=(e,t)=>{(0,H5.useEffect)(()=>{t.redoCount>0&&e()},[t.redoCount])};var G5=T(_()),Om=(e,t)=>{(0,G5.useEffect)(()=>{t.undoCount>0&&e()},[t.undoCount])};var Ce=T(_());var Ix=e=>Ce.default.createElement(Y,null,Ce.default.createElement(Q,{header:"Mito AI",setUIState:e.setUIState}),Ce.default.createElement(q,null,Ce.default.createElement("p",null,"Welcome to Mito AI powered by OpenAI. Before getting started, take a second to review our privacy policy."),Ce.default.createElement(se,{px:10}),Ce.default.createElement(je,{title:"What data does Mito AI collect?"},Ce.default.createElement("p",null,"Mito AI uses the instructions you provide (the prompt) and information about your dataframe to generate code that works in the context of your analysis. Without this information, the Mito generated code will require additional customization."),Ce.default.createElement(se,{px:5}),Ce.default.createElement("p",null,"Private data that is contained in the dataframe name, column headers, or first five rows of data might be shared with Mito and OpenAI.")),Ce.default.createElement(se,{px:10}),Ce.default.createElement(je,{title:"How is my data used?"},Ce.default.createElement("p",null,"The data collected by Mito AI is used to construct a prompt for OpenAI. Mito supplements the prompt you provide with additional information about your data to give OpenAI the best chance of generating helpful code."),Ce.default.createElement(se,{px:5}),Ce.default.createElement("p",null,"The data collected is also used to improve Mito AI. Such uses include:"),Ce.default.createElement("li",null,"Evaluating Mito AI to determine its effectiveness."),Ce.default.createElement("li",null,"Conducting research to improve Mito AI."),Ce.default.createElement("li",null,"Detecting potential abuse of Mito AI."),Ce.default.createElement(se,{px:5}),Ce.default.createElement("p",null,"Read ",Ce.default.createElement("a",{className:"text-underline text-color-mito-purple",href:"https://privacy.trymito.io/privacy-policy",target:"_blank",rel:"noreferrer"},"Mito")," and ",Ce.default.createElement("a",{className:"text-underline text-color-mito-purple",href:"https://openai.com/policies/privacy-policy",target:"_blank",rel:"noreferrer"},"OpenAI\u2019s")," privacy policy for more information.")),Ce.default.createElement(se,{px:10}),Ce.default.createElement(je,{title:"How can I further protect my data?"},Ce.default.createElement("p",null,"Mito AI uses OpenAI to generate code by default. Doing so requires sending your information to OpenAI. To further protect your data, Mito Enterprise users can connect Mito AI to a self-hosted large language model. As a result, Mito would not need to collect or share any information about your data with OpenAI. Your data will never leave your system."),Ce.default.createElement(se,{px:5}),Ce.default.createElement("p",null,"To learn more about this option, reach out to the ",Ce.default.createElement("a",{className:"text-underline text-color-mito-purple",href:"mailto:founders@sagacollab.com?subject=Mito Enterprise AI"},"Mito team"),".")),Ce.default.createElement(se,{px:10}),Ce.default.createElement(je,{title:"How can I use my own OpenAI API key?"},Ce.default.createElement("p",null,"If you want to route your completion through OpenAI servers directly, you can provide your own OpenAI API key."),Ce.default.createElement(se,{px:5}),Ce.default.createElement("p",null,"To use your own OpenAI API key, set the environment variable OPENAI_API_KEY to your OpenAI key. You can get one ",Ce.default.createElement("a",{className:"text-underline text-color-mito-purple",href:"https://platform.openai.com/account/api-keys",target:"_blank",rel:"noreferrer"},"here"),".")),Ce.default.createElement(se,{px:5})),Ce.default.createElement(Me,null,Ce.default.createElement(j,{onClick:()=>{e.mitoAPI.updateAcceptAITransformationPrivacyPolicy()},variant:"dark"},"Accept Privacy Policy"))),V5=Ix;var Yl=3,j5=["Mito AI can transform any sheet in Mito.","Unhappy with the results? Try the Undo button.","Mito AI is great at parsing strings.","New columns will be colored green.","Modified modified columns will be colored yellow.","Try breaking big prompts into smaller prompts.","Make sure to verify the AI generated code is correct.","Mito AI can apply a transformation to multiple columns."],R5=()=>j5[Math.floor(Math.random()*j5.length)],M1=()=>Z.default.createElement(C,null,Z.default.createElement(Nm,null)),xx=e=>{let t=e.userProfile.openAIAPIKey===null||e.userProfile.openAIAPIKey===void 0,n=e.userProfile.aiPrivacyPolicy,[r,o]=(0,Z.useState)(""),[i,a]=(0,Z.useState)({type:"default"}),[s,l]=(0,Z.useState)(!1),d=(0,Z.useRef)(null),u=y=>{d.current===null&&(d.current=y,y==null||y.focus())},c=(0,Z.useRef)(null),p=y=>{c.current=y},{previousParamsAndResults:h,edit:x}=km("ai_transformation",e.mitoAPI,e.analysisData);(0,Z.useEffect)(()=>{e.mitoAPI.log("opened_ai_transformation",{apiKeyNotDefined:t,aiPrivacyPolicyNotAccepted:!n})},[]),(0,Z.useEffect)(()=>{c.current!==null&&(c.current.scrollTop=c.current.scrollHeight),e.setUIState(y=>{if(h.length===0||!s)return f(m({},y),{dataRecon:void 0});let w=h[h.length-1].results,P={created_dataframe_names:w.created_dataframe_names,deleted_dataframe_names:w.deleted_dataframe_names,modified_dataframes_recons:w.modified_dataframes_recons};return f(m({},y),{dataRecon:P})})},[h.length,i.type,s]),(0,Z.useEffect)(()=>()=>{e.setUIState(function(y){return f(m({},y),{dataRecon:void 0})})},[]),(0,Z.useEffect)(()=>{if(i.type==="loading completion"){let y=setInterval(()=>{a(w=>w.type==="loading completion"?f(m({},w),{loadingMessage:R5()}):w)},15e3);return()=>clearInterval(y)}},[i.type]),Mm(()=>{a({type:"default"})},e.analysisData),Om(()=>{a({type:"default"})},e.analysisData);let D=async y=>{if(y==="")return;a({type:"loading completion",userInput:y,loadingMessage:R5()}),o("");let w=f3(e.uiState,e.gridState,e.sheetDataArray),P=[];for(let N=0;NN.type==="error executing code"?f(m({},N),{attempt:N.attempt+1}):N)},S=p3(r,d),g=h.length===0&&i.type==="default";return n?Z.default.createElement(Y,null,Z.default.createElement(Q,{header:"Mito AI",setUIState:e.setUIState}),Z.default.createElement(q,{setRef:p},g&&Z.default.createElement(L5,{selectedSheetIndex:e.uiState.selectedSheetIndex,sheetDataArray:e.sheetDataArray,setUserInput:o,previousParamsAndResults:h,chatInputRef:d}),Z.default.createElement("div",{className:"ai-transformation-chat-container"},h.map((y,w)=>Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-user"},Z.default.createElement("p",null,y.params.user_input)),Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-ai"},Z.default.createElement(B5,{uiState:e.uiState,setUIState:e.setUIState,result:y.results,sheetDataArray:e.sheetDataArray,mitoAPI:e.mitoAPI,params:y.params,isMostRecentResult:w===h.length-1,setDisplayRecon:l})))),i.type==="loading completion"&&Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-user"},Z.default.createElement("p",null,i.userInput)),Z.default.createElement(I,{justify:"space-between",align:"center",className:"ai-transformation-message ai-transformation-message-ai"},Z.default.createElement(C,null,Z.default.createElement("p",null,"Generating code..."),Z.default.createElement("p",{className:"text-body-2"},"Hint: ",i.loadingMessage)),Z.default.createElement(M1,null))),i.type==="executing code"&&(h.length===0||h[h.length-1].params.user_input!==i.userInput)&&Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-user"},Z.default.createElement("p",null,i.userInput)),Z.default.createElement(I,{justify:"space-between",align:"center",className:"ai-transformation-message ai-transformation-message-ai"},Z.default.createElement(C,null,Z.default.createElement("p",null,"Executing code...")),Z.default.createElement(M1,null))),i.type==="error loading completion"&&Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-user"},Z.default.createElement("p",null,i.userInput)),Z.default.createElement(I,{justify:"start",align:"center",className:M("ai-transformation-message","ai-transformation-message-ai")},Z.default.createElement("div",{className:"flexbox-column"},Z.default.createElement("p",null,"Error loading completion"),Z.default.createElement("p",null,i.error,i.error.includes("There was an error accessing the OpenAI API")&&Z.default.createElement(Z.default.Fragment,null,"\xA0 To learn about self-hosted LLMs for Mito Enterprise, contact ",Z.default.createElement("a",{className:"text-underline text-color-mito-purple",href:"mailto:founders@sagacollab.com?subject=Mito Enterprise AI"},"the Mito team"),"."),i.error.includes("You have used Mito AI")&&Z.default.createElement(Z.default.Fragment,null,"\xA0 Please ",Z.default.createElement("a",{className:"text-underline",href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},"upgrade to Mito Pro")," or ",Z.default.createElement("a",{className:"text-underline",href:s5,target:"_blank",rel:"noreferrer"},"set your own OPENAI_API key in your environment variables.")))))),i.type==="error executing code"&&Z.default.createElement(Z.default.Fragment,null,Z.default.createElement(I,{justify:"start",align:"center",className:"ai-transformation-message ai-transformation-message-user"},Z.default.createElement("p",null,i.userInput)),Z.default.createElement(I,{justify:"space-between",align:"center",className:M("ai-transformation-message","ai-transformation-message-ai")},Z.default.createElement("div",{className:"flexbox-column"},Z.default.createElement("p",null,"Execution failed. ",i.attempt=Yl&&Z.default.createElement("code",null,i.error)),i.attempt{o(y.target.value)},onKeyDown:y=>{y.key==="Enter"&&(y.shiftKey||(y.preventDefault(),D(r)))},onKeyUp:y=>{y.key==="Enter"&&y.shiftKey&&o(r+` `)}}))),Z.default.createElement(C,{span:1.5,onClick:()=>{var y;D(r),(y=d.current)==null||y.focus()}},Z.default.createElement(F5,null))))):Z.default.createElement(V5,{mitoAPI:e.mitoAPI,setUIState:e.setUIState})},W5=xx;var ut=T(_());var wx=e=>{let t="",n="",r="";return e.commCreationErrorStatus==="no_backend_comm_registered_error"?(t="Rerun Cell Above",n="Looks like you restarted your kernel.",r=ut.default.createElement(ut.default.Fragment,null,"Rerun the ",ut.default.createElement("code",null,"mitosheet.sheet()")," call above to refresh this mitosheet.")):e.commCreationErrorStatus==="non_valid_location_error"?(t="Unsupported Enviornment",n="Mito only supports JupyterLab and Jupyter Notebook, not wherever this is.",r=ut.default.createElement(ut.default.Fragment,null,"To install Mito in JupyterLab and Jupyter Notebook, follow our ",ut.default.createElement("a",{href:D1,target:"_blank",rel:"noreferrer"},ut.default.createElement("span",{className:"text-body-1-link"},"installation instructions.")))):e.commCreationErrorStatus==="non_working_extension_error"&&(t="Invalid installation",n="Try restarting your JupyterLab. Mito was unable to connect to your Python kernel.",r=ut.default.createElement(ut.default.Fragment,null,"If this does not resolve this error, please ensure you have followed our ",ut.default.createElement("a",{href:D1,target:"_blank",rel:"noreferrer"},ut.default.createElement("span",{className:"text-body-1-link"},"installation instructions.")))),ut.default.createElement(Y,null,ut.default.createElement(Q,{header:t,setUIState:e.setUIState,notCloseable:!0}),ut.default.createElement(q,null,ut.default.createElement("p",null,n),ut.default.createElement(se,{px:15}),ut.default.createElement("p",null,r),ut.default.createElement(se,{px:15}),ut.default.createElement("p",null,"If you are still receiving this error message, join our slack to get support!"),ut.default.createElement(se,{px:15}),ut.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,width:"block"})))},X5=wx;var $t=T(_());var mt=T(_());var J5=(e,t)=>t==="file_name"?z5(e):e,z5=e=>{let t=e.replace(/^.*[\\\/]/,"");return t=t.substring(0,t.length-1),t.startsWith('r"')||t.startsWith("r'")?t=t.substring(2):(t.startsWith("'")||t.startsWith('"'))&&(t=t.substring(1)),t},Tx=(e,t)=>{if(t==="file_name"){let n=z5(e);return n.substring(0,n.indexOf(".")).replace(/[^a-zA-Z0-9]/g,"_")+"_path"}else return e},_x=e=>{let[t]=ln([],async()=>{let o=await e.mitoAPI.getParameterizableParams();return"error"in o?void 0:o.result},void 0,[]);console.log(t);let n=t.filter(([o])=>!Object.values(e.codeOptions.function_params).includes(o)),r=t.length===0||e.codeOptions.as_function===!1;return mt.default.createElement(mt.default.Fragment,null,mt.default.createElement(I,{justify:"space-between",align:"center"},mt.default.createElement(C,null,mt.default.createElement(de,{tooltip:"Parameterize your analysis, making it easier to pass in different values."},"Function Parameters")),mt.default.createElement(C,null,mt.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0,disabled:r,title:e.codeOptions.as_function?t.length===0?"There are no available options to parameterize. Import data first.":void 0:"Toggle Generate Function before adding parameters."},n.map(([o,i,a],s)=>mt.default.createElement(v,{key:s,title:J5(o,i),subtext:a,onClick:()=>{e.setCodeOptions(l=>{let d=m({},l),u=Tx(o,i);return d.function_params[u]=o,d})}}))))),Object.entries(e.codeOptions.function_params).length>0&&mt.default.createElement(I,{justify:"space-between",align:"center"},mt.default.createElement(C,{span:8,offsetRight:2},mt.default.createElement("p",null,"Current Value")),mt.default.createElement(C,{span:10,offsetRight:2},mt.default.createElement("p",null,"Param Name")),mt.default.createElement(C,{span:2})),Object.entries(e.codeOptions.function_params).map(([o,i],a)=>mt.default.createElement(I,{key:a,justify:"space-between",align:"center"},mt.default.createElement(C,{span:8,offsetRight:2},mt.default.createElement("p",{title:i},J5(i,i.startsWith('r"')||i.startsWith("r'")||i.startsWith("'")?"file_name":"df_name"))),mt.default.createElement(C,{span:10,offsetRight:2},mt.default.createElement(ne,{width:"block",value:o,onChange:s=>{let l=s.target.value,d=l,u=m({},e.codeOptions);if(Object.keys(u.function_params).includes(l)){let c=1;for(d=l+c;Object.keys(u.function_params).includes(l+c);)c++,d=l+c}else d=l;u.function_params[d]=u.function_params[o],delete u.function_params[o],e.setCodeOptions(u)}})),mt.default.createElement(C,{span:2},mt.default.createElement(at,{onClick:()=>{let s=m({},e.codeOptions);delete s.function_params[o],e.setCodeOptions(s)}})))))},K5=_x;var Dx=e=>{let[t,n]=(0,$t.useState)(()=>e.analysisData.codeOptions);return on(()=>{e.mitoAPI.updateCodeOptions(t)},[t],100),$t.default.createElement(Y,null,$t.default.createElement(Q,{header:"Generated Code Options",setUIState:e.setUIState}),$t.default.createElement(q,{requiresEnterprise:{featureName:"code_options",mitoAPI:e.mitoAPI},userProfile:e.userProfile},$t.default.createElement(I,{justify:"space-between",align:"center"},$t.default.createElement(C,null,$t.default.createElement(de,{tooltip:"A Python function is a reusable block of code that performs a specific task. It takes input, processes it, and returns output, making your code more organized and able to be easily rerun on new datasets."},"Generate Function")),$t.default.createElement(C,null,$t.default.createElement(Ut,{value:e.analysisData.codeOptions.as_function,onChange:function(){let r=m({},t);r.as_function=!r.as_function,n(r)}}))),$t.default.createElement(I,{justify:"space-between",align:"center"},$t.default.createElement(C,null,$t.default.createElement(de,{tooltip:"Give your function a short, descriptive name descring what it does."},"Function Name")),$t.default.createElement(C,null,$t.default.createElement(ne,{disabled:!t.as_function,value:t.function_name,onChange:r=>{let o=m({},t);o.function_name=r.target.value,n(o)}}))),$t.default.createElement(K5,{mitoAPI:e.mitoAPI,codeOptions:t,setCodeOptions:n})))},$5=Dx;var We=T(_());var ql=T(_()),vx=()=>ql.default.createElement("svg",{width:"20",height:"16",viewBox:"0 0 4 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ql.default.createElement("circle",{cx:"2",cy:"2",r:"2",fill:"#343434"}),ql.default.createElement("circle",{cx:"2",cy:"8",r:"2",fill:"#343434"}),ql.default.createElement("circle",{cx:"2",cy:"14",r:"2",fill:"#343434"})),Z5=vx;var Ql=T(_()),Px=()=>Ql.default.createElement("svg",{width:"20",height:"20",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ql.default.createElement("line",{y1:"1",x2:"13",y2:"1",stroke:"#494650"}),Ql.default.createElement("line",{y1:"5",x2:"13",y2:"5",stroke:"#494650"}),Ql.default.createElement("line",{y1:"9",x2:"13",y2:"9",stroke:"#494650"})),Fm=Px;var bx="Copied code snippet to clipboard. Paste it in a code cell below.",Ex="Code snippet written to code cell below. Scroll down to see it.",Ax=e=>{let[t]=ln(void 0,async()=>{let d=await e.mitoAPI.getCodeSnippets();return"error"in d?void 0:d.result},void 0,[]),[n,r]=(0,We.useState)(""),[o,i]=(0,We.useState)(void 0),[a,s]=(0,We.useState)(void 0);if(on(()=>{a!==void 0&&s(void 0)},[a],3e3),(t==null?void 0:t.status)==="error")return We.default.createElement(ge,{setUIState:e.setUIState,header:"Error loading code snippets",message:t.error_message,errorMessage:!0,suppressImportLink:!0});let l=t==null?void 0:t.code_snippets.filter(d=>dr(d.Name,n)>.75||dr(d.Description,n)>.75||dr(d.Code.join(" "),n)>.75);return We.default.createElement(Y,null,We.default.createElement(Q,{header:"Code Snippets",setUIState:e.setUIState}),We.default.createElement(q,null,We.default.createElement(ne,{value:n,onChange:d=>{r(d.target.value)},placeholder:"Search for a code snippet by name or content"}),a!==void 0&&We.default.createElement("p",{className:"text-color-success"},a),l==null?void 0:l.map((d,u)=>{var D;let c=()=>{s(bx),rs(d.Code.join(` `)),e.mitoAPI.log("code_snippet_copied",{code_snippet_name:d.Name})},p=()=>{s(Ex),wy(e.analysisData.analysisName,d.Code.join(` -`)),e.mitoAPI.log("code_snippet_written_to_cell",{code_snippet_name:d.Name})},h=ii,x=(D=e.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS)==null?void 0:D.MITO_CONFIG_CODE_SNIPPETS_SUPPORT_EMAIL;return x!=null&&(h=`mailto:${x}?subject=Mito Code Snippet Support. Snippet Name: "${d.Name}" Snippet ID: "${d.Id}"`),We.default.createElement(I,{key:u,align:"center",className:M("highlight-on-hover",Ha),justify:"space-between",onClick:()=>{i(S=>{if(S!==u)return u})}},We.default.createElement(C,{offsetRight:.5},We.default.createElement(Fm,null)),We.default.createElement(C,{span:20},We.default.createElement("div",{className:"text-bold"},d.Name),We.default.createElement("div",{className:"text-overflow-wrap pb-5px"},d.Description)),We.default.createElement(C,{offset:2},We.default.createElement(Z5,null)),We.default.createElement(C,null,We.default.createElement(pe,{display:u===o,width:"medium",closeDropdown:()=>{i(void 0)}},We.default.createElement(v,{title:"Copy Code Snippet",onClick:c}),We.default.createElement(v,{title:"Write to Notebook",onClick:p}),We.default.createElement(v,{title:"Get Support",onClick:()=>{var S;window.open(h),(S=e.mitoAPI)==null||S.log("clicked_code_snippet_get_support_button")}}))))}),t===void 0&&We.default.createElement("p",{className:"mt-20px"},"Loading code snippets ",We.default.createElement(Yo,null))))},Y5=Ax;var Rr=T(_());var ct=T(_());var rr=T(_());function kx(e,t,n,r,o,i){let[a,s]=(0,rr.useState)(e),[l,d]=(0,rr.useState)(void 0),[u,c]=(0,rr.useState)(!1),[p,h]=(0,rr.useState)(!1),[x,D]=(0,rr.useState)({stepIDs:[],currStepIDIndex:0}),[S,g]=(0,rr.useState)(!1),[y,w]=(0,rr.useState)(!1);Om(()=>{k()},r),Mm(()=>{L()},r),(0,rr.useEffect)(()=>{if(p){let b=setTimeout(()=>{h(!1)},2e3);return()=>clearTimeout(b)}},[p]);let P=t+"_edit",N=(0,rr.useCallback)(b=>{s(b),g(!1),w(!1)},[]),A=async b=>{if(a===void 0)return;if(!(o!=null&&o.allowSameParamsToReapplyTwice)&&S){w(!0);return}let F=b?b(a):a;c(!0);let J=me();(o==null?void 0:o.overwiteStepIfClickedMultipleTimes)&&x.stepIDs.length>0&&(J=x.stepIDs[x.stepIDs.length-1]);let K=await n._edit(P,F,J);c(!1),"error"in K?d(K.error):(D(W=>{let z={stepIDs:[...W.stepIDs],currStepIDIndex:W.currStepIDIndex};return z.stepIDs.splice(z.currStepIDIndex+1,z.stepIDs.length),z.stepIDs.push(J),z.currStepIDIndex=z.stepIDs.length-1,z}),d(void 0),g(!0),h(!0))},k=async()=>{let b=x.stepIDs[x.currStepIDIndex-1];D(K=>{let W={stepIDs:[...K.stepIDs],currStepIDIndex:K.currStepIDIndex};return W.currStepIDIndex-=1,W});let F=await n.getParams(t,b,{}),J="error"in F?void 0:F.result;J!==void 0?((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(J),i!==void 0&&i(J)):((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(e),g(!1),i!==void 0&&i(e())),d(void 0)},L=async()=>{let b=x.stepIDs[x.currStepIDIndex+1];D(K=>{let W={stepIDs:[...K.stepIDs],currStepIDIndex:K.currStepIDIndex};return W.currStepIDIndex+=1,W});let F=await n.getParams(t,b,{}),J="error"in F?void 0:F.result;J!==void 0&&((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(J),i!==void 0&&i(J),g(!0)),d(void 0)},E;return S&&r.stepSummaryList[r.stepSummaryList.length-1].step_type===t&&(E=r.lastResult),{params:a,setParams:N,error:l,loading:u,edit:A,editApplied:S,attemptedEditWithTheseParamsMultipleTimes:y,result:E,appliedEditInLastTwoSeconds:p}}var wt=kx;var Nx=e=>{let{params:t,setParams:n,edit:r}=wt(()=>({sheet_index:e.selectedSheetIndex,transformation:{type:"replace",old:"",new:""}}),"column_headers_transform",e.mitoAPI,e.analysisData);return(0,ct.useEffect)(()=>{n(o=>o===void 0?o:{sheet_index:e.selectedSheetIndex,transformation:o.transformation})},[e.selectedSheetIndex]),t===void 0?ct.default.createElement(ct.default.Fragment,null):ct.default.createElement(ct.default.Fragment,null,ct.default.createElement(I,{justify:"start",align:"center"},ct.default.createElement(C,null,ct.default.createElement(de,{tooltip:"Find and replace in all string column headers."},"Find and Replace in Column Headers"))),ct.default.createElement(I,{justify:"space-between",align:"center"},ct.default.createElement(C,null,ct.default.createElement("p",null,"Find")),ct.default.createElement(C,null,ct.default.createElement(ne,{value:t.transformation.type==="replace"?t.transformation.old:"",onChange:o=>{let i=m({},t);i.transformation={type:"replace",old:o.target.value,new:t.transformation.type==="replace"?t.transformation.new:""},n(i)}}))),ct.default.createElement(I,{justify:"space-between",align:"center"},ct.default.createElement(C,null,ct.default.createElement("p",null,"Replace")),ct.default.createElement(C,null,ct.default.createElement(ne,{value:t.transformation.type==="replace"?t.transformation.new:"",onChange:o=>{let i=m({},t);i.transformation={type:"replace",old:t.transformation.type==="replace"?t.transformation.old:"",new:o.target.value},n(i)}}))),ct.default.createElement(I,null,ct.default.createElement(j,{disabled:t.transformation.type!=="replace",variant:"dark",onClick:()=>{r()}},"Replace in ",e.numHeaders," Headers")))},q5=Nx;var Mx=e=>{let t=e.sheetDataArray[e.selectedSheetIndex];if(t===void 0)return Rr.default.createElement(ge,{setUIState:e.setUIState});let n=t.data.length;return Rr.default.createElement(Y,null,Rr.default.createElement(Q,{header:"Column Headers Transformations",setUIState:e.setUIState}),Rr.default.createElement(q,{requiresPro:{featureName:"column_headers_transform",mitoAPI:e.mitoAPI},userProfile:e.userProfile},Rr.default.createElement(I,null,Rr.default.createElement(j,{variant:"dark",onClick:()=>{e.mitoAPI.editColumnHeadersTransform({sheet_index:e.selectedSheetIndex,transformation:{type:"uppercase"}})}},"Uppercase ",n," Headers")),Rr.default.createElement(I,null,Rr.default.createElement(j,{variant:"dark",onClick:()=>{e.mitoAPI.editColumnHeadersTransform({sheet_index:e.selectedSheetIndex,transformation:{type:"lowercase"}})}},"Lowercase ",n," Headers")),Rr.default.createElement(q5,{mitoAPI:e.mitoAPI,userProfile:e.userProfile,analysisData:e.analysisData,selectedSheetIndex:e.selectedSheetIndex,numHeaders:n})))},Q5=Mx;var xe=T(_());var Ox=(e,t)=>{if(e[t].length===0)return xe.default.createElement("p",null,"\u2713 All columns are included in the concatenated sheet.");let[n,r]=Jo(e[t],25);return r===0?xe.default.createElement("p",null,"Columns ",xe.default.createElement("span",{className:"text-color-gray-important"},n)," are not included."):xe.default.createElement("p",null,"Columns ",xe.default.createElement("span",{className:"text-color-gray-important"},n)," and ",xe.default.createElement("span",{className:"text-color-gray-important"},r)," others are not included.")},Fx=e=>{var s;let{params:t,setParams:n}=Dn({join:"inner",ignore_index:!0,sheet_indexes:[]},"concat",e.mitoAPI,e.analysisData,50),[r]=(0,xe.useState)(e.sheetDataArray.map((l,d)=>d)),o=Object.values(((s=e.sheetDataArray[e.sheetDataArray.length-1])==null?void 0:s.columnIDsMap)||{}),i=t==null?void 0:t.sheet_indexes.map(l=>{var d;return Object.values(((d=e.sheetDataArray[l])==null?void 0:d.columnIDsMap)||{}).filter(u=>!o.includes(u))});if(t===void 0)return xe.default.createElement(ge,{setUIState:e.setUIState,message:"Import at least two datasets before concating."});let a=t.sheet_indexes.map((l,d)=>xe.default.createElement("div",{key:d},xe.default.createElement(Nr,{titleMap:Object.fromEntries(e.sheetDataArray.map((u,c)=>[c+"",u.dfName])),value:l+"",onChange:u=>{let c=parseInt(u);n(p=>{let h=[...p.sheet_indexes];return h[d]=c,f(m({},p),{sheet_indexes:h})})},onDelete:()=>{n(u=>{let c=[...u.sheet_indexes];return c.splice(d,1),f(m({},u),{sheet_indexes:c})})},selectableValues:Object.keys(e.sheetDataArray)}),i!==void 0&&xe.default.createElement(I,{className:"text-subtext-1"},Ox(i,d))));return xe.default.createElement(Y,null,xe.default.createElement(Q,{header:"Concatenate Sheet",setUIState:e.setUIState}),xe.default.createElement(q,null,xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement("p",{className:"text-header-3"},"Join Type")),xe.default.createElement(C,null,xe.default.createElement($,{value:t.join,onChange:l=>{n(d=>f(m({},d),{join:l}))},width:"medium"},xe.default.createElement(v,{title:"inner",subtext:"Only includes columns that exist in all sheets"}),xe.default.createElement(v,{title:"outer",subtext:"Includes all columns from all sheets, regardless of if these columns are in the other sheets."})))),xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement(de,{tooltip:"When on, the resulting dataframe will have indexes 0, 1, 2, etc.. This is useful if you're concatenating objects that don't have meaningful index information."},"Ignore Existing Indexes")),xe.default.createElement(C,null,xe.default.createElement(Ut,{value:t.ignore_index,onChange:()=>{n(l=>f(m({},l),{ignore_index:!l.ignore_index}))}}))),xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement("p",{className:"text-header-3"},"Dataframes to Concatenate")),xe.default.createElement(C,null,xe.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},[xe.default.createElement(v,{key:-1,title:"Add all sheets",onClick:()=>{n(l=>{let d=[...r];return f(m({},l),{sheet_indexes:d})})}})].concat(e.sheetDataArray.filter((l,d)=>!!r.includes(d)).map((l,d)=>xe.default.createElement(v,{key:d,title:l.dfName,onClick:()=>{n(u=>{let c=[...u.sheet_indexes];return c.push(d),f(m({},u),{sheet_indexes:c})})}})))))),a))},eS=Fx;var nS=T(_());var un=T(_());var Lx=e=>e.df_names.length===0?"Select dataframes to import them":`Import ${e.df_names.length} Selected dataframe${e.df_names.length===1?"":"s"}`,Ux=e=>{var r,o;let[t]=ln([],async()=>{let i=await e.mitoAPI.getDefinedDfNames();return"error"in i?void 0:i.result},void 0,[]),n=(((r=e.params)==null?void 0:r.df_names)||[]).map((i,a)=>un.default.createElement(Nr,{key:a,value:i,onChange:s=>{e.setParams(l=>{let d=[...l.df_names];return d[a]=s,f(m({},l),{df_names:d})})},onDelete:()=>{e.setParams(s=>{let l=[...s.df_names];return l.splice(a,1),f(m({},s),{df_names:l})})},selectableValues:t}));return e.params===void 0?un.default.createElement("div",{className:"text-body-1"},"There has been an error loading dataframes to import. Please try again, or contact support."):un.default.createElement(Y,null,un.default.createElement(Q,{header:e.isUpdate?"Import Dataframes":"Update Import",setUIState:e.setUIState,backCallback:e.backCallback}),un.default.createElement(q,null,un.default.createElement(I,{justify:"space-between",align:"center"},un.default.createElement(C,null,un.default.createElement(de,{tooltip:"Dataframes that have been created elsewhere in this notebook can be imported through this taskpane."},"Dataframes to Import")),un.default.createElement(C,null,un.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},t.map((i,a)=>un.default.createElement(v,{key:a,title:i,onClick:()=>{e.setParams(s=>{let l=[...s.df_names];return l.push(i),f(m({},s),{df_names:l})})}}))))),n,n.length===0&&un.default.createElement(I,null,un.default.createElement("p",{className:"text-subtext-1"},"Import an existing dataframe as a new sheet tab in Mito"))),un.default.createElement(Me,null,un.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},disabled:(((o=e.params)==null?void 0:o.df_names.length)||0)===0},Lx(e.params))))},tS=Ux;var Bx=e=>{let{params:t,setParams:n,edit:r}=wt(()=>({df_names:[]}),"dataframe_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return nS.default.createElement(tS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!1,params:t,setParams:n,edit:r})},rS=Bx;var Qe=T(_());var Co=T(_());var O1=T(_()),Hx=e=>O1.default.createElement(O1.default.Fragment,null,"Excel formatting export coming soon!"),oS=Hx;var F1=T(_());var Gx=e=>{let t=[...e.selectedSheetIndexes].sort();return F1.default.createElement(Gr,{width:"block",height:e.height||"small",onToggleAll:n=>{n.sort(),e.onChange(n)}},e.sheetDataArray.map((n,r)=>{let o=n.dfName;return F1.default.createElement(hr,{key:r,title:o,toggled:t.includes(r),index:r,onToggle:()=>{let i=[...t];br(i,r),i.sort(),e.onChange(i)}})}))},Lm=Gx;var Vx=e=>Co.default.createElement(Co.default.Fragment,null,Co.default.createElement("p",{className:"text-header-3"},"Dataframes to Export"),Co.default.createElement(Lm,{sheetDataArray:e.sheetDataArray,selectedSheetIndexes:e.exportState.sheetIndexes,setUIState:e.setUIState,onChange:t=>{e.setUIState(n=>f(m({},n),{exportConfiguration:{exportType:"excel",sheetIndexes:t}}))}}),e.userProfile.isPro&&Co.default.createElement(oS,{dfNames:e.dfNames,mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,exportState:e.exportState,newlyFormattedColumns:e.newlyFormattedColumns,setNewlyFormattedColumns:e.setNewlyFormattedColumns}),!e.userProfile.isPro&&Co.default.createElement(I,{justify:"space-around"},Co.default.createElement("p",{className:"ma-25px text-align-center text-body-1"},"Want to preserving your formatting when exporting to Excel? Consider upgrading to\xA0",Co.default.createElement("a",{onClick:()=>void e.mitoAPI.log("clicked_pro_button",{pro_button_location:"download_taskpane_excel_format_export"}),className:"text-body-1-link",href:"https://www.trymito.io/plans",target:"_blank",rel:"noreferrer"},"Mito Pro"),"."))),iS=Vx;var as=T(_());var jx=e=>as.default.createElement(as.default.Fragment,null,as.default.createElement(Lt,{title:"Dataframe to Export",sheetDataArray:e.sheetDataArray,sheetIndex:e.selectedSheetIndex,onChange:t=>{e.setUIState(n=>f(m({},n),{selectedSheetIndex:t,exportConfiguration:{exportType:"csv"}}))}}),as.default.createElement(I,{justify:"space-around"},as.default.createElement("p",{className:"ma-25px text-align-center"},"CSV exports will not reflect any formatting changes made in Mito."))),aS=jx;var Rx=e=>{var c,p,h,x;let[t,n]=(0,Qe.useState)(()=>{let D={};return e.sheetDataArray.forEach((S,g)=>{D[g]=[]}),D}),[r,o]=(0,Qe.useState)(""),i=e.sheetDataArray.length===0,a=(c=e.sheetDataArray[e.selectedSheetIndex])==null?void 0:c.numRows,s=async()=>{if(!i){if(e.uiState.exportConfiguration.exportType==="csv"){let D=await e.mitoAPI.getDataframeAsCSV(e.selectedSheetIndex),S="error"in D?"":D.result;o(S)}else if(e.uiState.exportConfiguration.exportType==="excel"){let D=await e.mitoAPI.getDataframesAsExcel(e.uiState.exportConfiguration.sheetIndexes),S="error"in D?"":D.result;o(S)}}};on(()=>{o(""),s()},[e.uiState.exportConfiguration,e.selectedSheetIndex,e.sheetDataArray],500);let l=()=>{e.mitoAPI.log("button_download_log_event",{sheet_index:e.selectedSheetIndex,export_type:e.uiState.exportConfiguration.exportType})};if(i)return Qe.default.createElement(ge,{setUIState:e.setUIState});let d="",u="";return e.uiState.exportConfiguration.exportType==="csv"?(d=URL.createObjectURL(new Blob([r],{type:"text/csv"})),u=`${(p=e.uiState.exportConfiguration.fileName)!=null?p:"MitoExport"}.csv`):e.uiState.exportConfiguration.exportType==="excel"&&(d=URL.createObjectURL(new Blob([Uint8Array.from(window.atob(r),D=>D.charCodeAt(0))],{type:"text/csv"})),u=`${(h=e.uiState.exportConfiguration.fileName)!=null?h:"MitoExport"}.xlsx`),Qe.default.createElement(Y,null,Qe.default.createElement(Q,{header:"Download",setUIState:e.setUIState}),Qe.default.createElement(q,null,Qe.default.createElement("div",null,Qe.default.createElement(I,{justify:"space-between",align:"center"},Qe.default.createElement("p",{className:"text-header-3"},"Export Type"),Qe.default.createElement($,{width:"medium",value:e.uiState.exportConfiguration.exportType,onChange:D=>{o(""),e.setUIState(S=>D==="csv"?f(m({},S),{exportConfiguration:{exportType:"csv"}}):f(m({},S),{exportConfiguration:{exportType:"excel",sheetIndexes:[e.selectedSheetIndex]}}))}},Qe.default.createElement(v,{title:"csv"}),Qe.default.createElement(v,{title:"excel",subtext:a>1048576?`An Excel file holds at most 1,048,576 rows, but there are ${a} rows in this dataframe. We'll export the first 1,048,576 rows, but this may take several minutes.`:"Due to Python limitations, Excel export can be slower than CSV export."}))),Qe.default.createElement(I,{justify:"space-between",align:"center"},Qe.default.createElement("p",{className:"text-header-3"},"File Name"),Qe.default.createElement(ne,{value:(x=e.uiState.exportConfiguration.fileName)!=null?x:"",onChange:D=>{console.log(D),e.setUIState(S=>(console.log(S),f(m({},S),{exportConfiguration:f(m({},S.exportConfiguration),{fileName:D.target.value})})))},placeholder:"MitoExport"})),e.uiState.exportConfiguration.exportType==="excel"&&Qe.default.createElement(iS,{dfNames:e.dfNames,mitoAPI:e.mitoAPI,userProfile:e.userProfile,sheetDataArray:e.sheetDataArray,exportState:e.uiState.exportConfiguration,setUIState:e.setUIState,newlyFormattedColumns:t,setNewlyFormattedColumns:n}),e.uiState.exportConfiguration.exportType==="csv"&&Qe.default.createElement(aS,{sheetDataArray:e.sheetDataArray,mitoAPI:e.mitoAPI,selectedSheetIndex:e.selectedSheetIndex,setUIState:e.setUIState}))),Qe.default.createElement(Me,null,Qe.default.createElement(j,{variant:"dark",width:"block",disabled:r==="",href:d,download:u,onClick:l},r===""?Qe.default.createElement(Qe.default.Fragment,null,"Preparing data for download ",Qe.default.createElement(Yo,null)):`Download ${e.uiState.exportConfiguration.exportType==="csv"?"CSV file":"Excel workbook"}`)))},sS=Rx;var ft=T(_());var Wx=(e,t)=>{var n;if(t.length!==0)return{sheet_index:e,column_ids:Object.keys((n=t[e])==null?void 0:n.columnIDsMap),keep:"first"}},Xx=e=>{let{params:t,setParams:n,loading:r,edit:o,editApplied:i,attemptedEditWithTheseParamsMultipleTimes:a,result:s}=wt(()=>Wx(e.selectedSheetIndex,e.sheetDataArray),"drop_duplicates",e.mitoAPI,e.analysisData);return e.sheetDataArray.length===0||t===void 0?ft.default.createElement(ge,{setUIState:e.setUIState}):e.sheetDataArray[t.sheet_index]===void 0?(e.setUIState(l=>f(m({},l),{currOpenTaskpane:{type:"none"}})),ft.default.createElement(ge,{setUIState:e.setUIState})):ft.default.createElement(Y,null,ft.default.createElement(Q,{header:"Drop Duplicates",setUIState:e.setUIState}),ft.default.createElement(q,null,ft.default.createElement(Lt,{title:"Dataframe to drop duplicates within.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:l=>{n(d=>f(m({},d),{sheet_index:l,column_ids:e.sheetDataArray[l].data.map(u=>u.columnID)})),e.setUIState(d=>f(m({},d),{selectedSheetIndex:l}))}}),ft.default.createElement(I,{justify:"space-between",align:"center"},ft.default.createElement(C,null,ft.default.createElement("p",{className:"text-header-3"},"Duplicates to Keep")),ft.default.createElement(C,null,ft.default.createElement($,{width:"medium",value:t.keep+"",onChange:l=>{l==="false"&&(l=!1),n(d=>f(m({},d),{keep:l}))}},ft.default.createElement(v,{title:"first",subtext:"Keep the first instance of the duplicated row."}),ft.default.createElement(v,{title:"last",subtext:"Keep the last instance of the duplicated row."}),ft.default.createElement(v,{id:"false",title:"none",subtext:"Keep none of the duplicated rows."})))),ft.default.createElement("p",{className:"text-header-3 mt-10px"},"Columns to Deduplicate On"),ft.default.createElement(tr,{sheetData:e.sheetDataArray[t.sheet_index],selectedColumnIDs:t.column_ids,onChange:l=>{n(d=>f(m({},d),{column_ids:l}))}}),ft.default.createElement(se,{px:25}),ft.default.createElement(j,{variant:"dark",width:"block",onClick:()=>o(),disabled:!1},r?"Dropping duplicates...":`Drop duplicates in ${t.column_ids.length} columns`),i&&!r&&ft.default.createElement(I,{className:"mt-5"},ft.default.createElement("p",{className:"text-subtext-1"},"Removed ",ft.default.createElement("span",{className:"text-color-gray-important"},a?0:(s==null?void 0:s.num_rows_dropped)||0)," rows."))))},lS=Xx;var Pe=T(_());var li=T(_());var mn=T(_());function Jx(e){let t=e.conditionOptions[e.condition.type].title,n=e.conditionOptions[e.condition.type].subtext,r=e.conditionOptions[e.condition.type].placeholderValue;return mn.default.createElement(mn.default.Fragment,null,mn.default.createElement(I,{justify:"space-between",align:"center"},mn.default.createElement(C,null,mn.default.createElement("p",{className:"text-body-1"},e.title)),mn.default.createElement(C,null,mn.default.createElement($,{width:"medium",value:e.condition.type,onChange:o=>{let i=o,a=f(m({},e.condition),{type:i});e.conditionOptions[i].placeholderValue!==void 0?a.value="":"value"in a&&delete a.value,e.setCondition(a)}},Object.entries(e.conditionOptions).map(([o,i])=>mn.default.createElement(v,{title:i.title,id:o,subtext:i.subtext,key:o}))))),"value"in e.condition&&mn.default.createElement(mn.default.Fragment,null,mn.default.createElement(I,{justify:"space-between",align:"center"},mn.default.createElement(C,null,mn.default.createElement(de,{textBody:!0,tooltip:n},t)),mn.default.createElement(C,null,mn.default.createElement(ne,{width:"medium",placeholder:r,value:""+e.condition.value,onChange:o=>{let i=o.target.value;e.setCondition(f(m({},e.condition),{value:i}))}})))))}var Um=Jx;var zx=e=>{let t=e.rangeImport;return li.default.createElement(li.default.Fragment,null,li.default.createElement(Um,{title:"Starting Row Condition",condition:t.start_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.start_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"upper left corner value":{title:"Top Left Corner Value",subtext:"Mito will search for this exact value (including whitespace).",placeholderValue:"start value"},"upper left corner value starts with":{title:"Top Left Corner Starts With",subtext:"Mito will search for a cell that starts with this value.",placeholderValue:"start value"},"upper left corner value contains":{title:"Top Left Corner Contains",subtext:"Mito will search for a cell that contains this value.",placeholderValue:"start value"}}}),li.default.createElement(se,{px:10,seperatingLine:!0}),li.default.createElement(Um,{title:"Ending Row Condition",condition:t.end_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.end_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"first empty cell":{title:"First Empty Cell",subtext:"Mito will take all rows until it hits an empty cell in the first column."},"bottom left corner value":{title:"Bottom Left Corner Value",subtext:"Mito will take all rows until it finds this exact value (including whitespace) in the first column.",placeholderValue:"end value"},"bottom left corner value starts with":{title:"Bottom Left Corner Starts With",subtext:"Mito will take all rows until it finds a cell that starts with this value in the first column.",placeholderValue:"end value"},"bottom left corner value contains":{title:"Bottom Left Corner Contains",subtext:"Mito will take all rows until it finds a cell that contains with this value in the first column.",placeholderValue:"end value"},"bottom left corner consecutive empty cells":{title:"Number of Empty Cells in Row",subtext:"Mito will take all rows until it finds a row with at least this number of empty cells.",placeholderValue:"4"},"bottom left corner consecutive empty cells in first column":{title:"Consecutive Empty in Column",subtext:"Mito will take all rows until the first column has this number of empty cells in a row.",placeholderValue:"4"},"row entirely empty":{title:"Row Entirely Empty",subtext:"Mito will take all rows unitl it finds a row where all the columns have empty values."},"cumulative number of empty rows":{title:"Cumulative # of Empty Rows",subtext:"Mito will take all rows unitl it finds this number of empty rows. They do not need to be consecutive.",placeholderValue:"4"}}}),li.default.createElement(se,{px:10,seperatingLine:!0}),li.default.createElement(Um,{title:"Ending Column Condition",condition:t.column_end_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.column_end_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"first empty cell":{title:"First Empty Cell",subtext:"Mito will continue take all columns until it hits an empty cell in the first row."},"num columns":{title:"Number of Columns",subtext:"Mito will take this number of columns.",placeholderValue:"4"}}}))},dS=zx;var di=T(_());var Kx=e=>{let t=e.rangeImport;return di.default.createElement(di.default.Fragment,null,di.default.createElement(I,{justify:"space-between",align:"center"},di.default.createElement(C,null,di.default.createElement(de,{textBody:!0,tooltip:"The proper format is COLUMNROW:COLUMNROW. For example, A1:B10, C10:G1000."},"Excel Range")),di.default.createElement(C,null,di.default.createElement(ne,{width:"medium",placeholder:"A10:C100",value:""+t.value,onChange:n=>{let r=n.target.value;e.setParams(o=>{let i=window.structuredClone(o.range_imports),a=window.structuredClone(t);return a.value=r,i[e.index]=a,f(m({},o),{range_imports:i})})}}))))},uS=Kx;var Xe=T(_());function $x(e){let t=e.params,n=e.setParams,r=e.sheet_name;return Xe.default.createElement(Xe.default.Fragment,null,Xe.default.createElement(je,{title:"Select Sheet"},Xe.default.createElement(I,{justify:"space-between",align:"center"},Xe.default.createElement(C,null,Xe.default.createElement("p",{className:"text-header-3"},"Select Sheet By")),Xe.default.createElement(C,null,Xe.default.createElement($,{width:"medium",value:t.sheet.type,onChange:o=>{let i=m({},t);i.sheet.type=o,o==="sheet name"?i.sheet.value=e.sheet_names[0]:i.sheet.value=0,n(i)}},Xe.default.createElement(v,{title:"Sheet Name",id:"sheet name",subtext:"Select a sheet by name to import multiple ranges from."}),Xe.default.createElement(v,{title:"Sheet Index",id:"sheet index",subtext:"Select a sheet by index in the Excel file. Use a negative index to count backwards from the end of the sheet list"})))),t.sheet.type==="sheet name"&&Xe.default.createElement(I,{justify:"space-between",align:"center"},Xe.default.createElement(C,null,Xe.default.createElement("p",{className:"text-header-3"},"Sheet Name")),Xe.default.createElement(C,null,Xe.default.createElement($,{width:"medium",value:t.sheet.value,onChange:o=>{let i=m({},t);i.sheet.value=o,n(i)}},e.sheet_names.map((o,i)=>Xe.default.createElement(v,{title:o,key:i}))))),t.sheet.type==="sheet index"&&Xe.default.createElement(Xe.default.Fragment,null,Xe.default.createElement(I,{justify:"space-between",align:"center"},Xe.default.createElement(C,null,Xe.default.createElement("p",{className:"text-header-3"},"Sheet Index")),Xe.default.createElement(C,null,Xe.default.createElement(ne,{width:"medium",type:"number",value:""+t.sheet.value,onChange:o=>{let i=o.target.value,a=parseInt(i);isNaN(a)||(i=a);let s=m({},t);s.sheet.value=i,n(s)}}))),Xe.default.createElement("p",{className:"text-subtext-1"},r!==void 0&&`${r} is selected.`,r===void 0&&"No sheet is selected. The index is out of bounds or invalid."))),Xe.default.createElement(se,{px:10}))}var mS=$x;var Zx=(e,t)=>({file_path:e,sheet:{type:"sheet name",value:t},range_imports:[{type:"range",df_name:"",value:""}],convert_csv_to_xlsx:!e.endsWith("xlsx")&&!e.endsWith("xlsm")});function L1(e){if("value"in e){let t=e.value;if(typeof t=="string"){let n=parseFloat(t),r=/^[+-]?\d+(\.\d+)?$/.test(t);if(!isNaN(n)&&r)return f(m({},e),{value:n})}else return e}return e}var Yx=e=>{let{params:t,setParams:n,edit:r,error:o}=wt(()=>Zx(e.file_path,e.sheet_name),"excel_range_import",e.mitoAPI,e.analysisData,{overwiteStepIfClickedMultipleTimes:!0}),[i,a]=(0,Pe.useState)(0);if(t===void 0)return Pe.default.createElement(ge,{setUIState:e.setUIState});let s="";t.sheet.type==="sheet name"?s=t.sheet.value:s=e.sheet_names[t.sheet.value<0?e.sheet_names.length+t.sheet.value:t.sheet.value];let l;return t.range_imports.length===0?l="Please add range imports above before importing them.":s===void 0?l="Select a sheet to import from. The sheet index is out of bounds.":t.range_imports.forEach(d=>{d.df_name===""&&(l="Please ensure all range imports have a defined dataframe name."),d.type==="dynamic"?("value"in d.start_condition&&d.start_condition.value===""&&(l="Please ensure all range imports have a defined start condition."),"value"in d.end_condition&&d.end_condition.value===""&&(l="Please ensure all range imports have a defined row end condition."),"value"in d.column_end_condition&&d.column_end_condition.value===""&&(l="Please ensure all range imports have a defined column end condition.")):d.value===""&&(l="Please ensure all range imports have a defined range.")}),Pe.default.createElement(Y,null,Pe.default.createElement(Q,{header:"Excel Range Import",setUIState:e.setUIState}),Pe.default.createElement(q,null,Pe.default.createElement(mS,{params:t,setParams:n,sheet_names:e.sheet_names,sheet_name:s}),Pe.default.createElement(I,{justify:"space-between"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-header-3"},"Range Imports")),Pe.default.createElement(C,{span:4},Pe.default.createElement(j,{variant:"dark",onClick:()=>{n(d=>{let u=window.structuredClone(d.range_imports);return(u.length>0?u[0].type:"range")==="range"?u.unshift({type:"range",df_name:"",value:""}):u.unshift({type:"dynamic",df_name:"",start_condition:{type:"upper left corner value",value:""},end_condition:{type:"first empty cell"},column_end_condition:{type:"first empty cell"}}),f(m({},d),{range_imports:u})}),a(0)},width:"block"},"+ Add"))),o!==void 0&&Pe.default.createElement("p",{className:"text-color-error"},o),t.range_imports.map((d,u)=>Pe.default.createElement(vm,{key:u,title:d.df_name===""?"Unnamed dataframe":`Importing ${d.df_name}`,subtitle:"Expand to configure range import.",expandedTitle:"Edit Range Import",isExpanded:u===i,setExpanded:c=>{a(c?u:-1)},onDelete:()=>{n(c=>{let p=window.structuredClone(c.range_imports);return p.splice(u,1),f(m({},c),{range_imports:p})}),i>=u&&a(i-1)}},Pe.default.createElement(I,{justify:"space-between",align:"center"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-body-1"},"Dataframe Name")),Pe.default.createElement(C,null,Pe.default.createElement(ne,{width:"medium",autoFocus:!0,placeholder:"company_ids",value:d.df_name,onChange:c=>{let p=c.target.value;n(h=>{let x=window.structuredClone(h.range_imports);return x[u].df_name=p,f(m({},h),{range_imports:x})})}}))),Pe.default.createElement(I,{justify:"space-between",align:"center"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-body-1"},"Locate Dataframe By")),Pe.default.createElement(C,null,Pe.default.createElement($,{width:"medium",value:d.type,onChange:c=>{n(p=>{let h=window.structuredClone(p.range_imports),x=c,D=p.range_imports[u],S=p.range_imports[u];return x==="range"?S={type:x,df_name:D.df_name,value:"value"in D?D.value:""}:S={type:"dynamic",df_name:D.df_name,start_condition:{type:"upper left corner value",value:""},end_condition:{type:"first empty cell"},column_end_condition:{type:"first empty cell"}},h[u]=S,f(m({},p),{range_imports:h})})}},Pe.default.createElement(v,{title:"Exact Range",id:"range",subtext:"Specify the exact range to import as a sheet."}),Pe.default.createElement(v,{title:"Dynamic",id:"Dynamic",subtext:"Specify values and dynamic conditions to find the bounds of the data."})))),Pe.default.createElement(se,{px:10,seperatingLine:!0}),d.type==="range"&&Pe.default.createElement(uS,{rangeImport:d,index:u,setParams:n}),d.type==="dynamic"&&Pe.default.createElement(dS,{rangeImport:d,index:u,setParams:n})))),Pe.default.createElement(Me,null,Pe.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{r(d=>{let u=d.range_imports.map(c=>{let p=c;if(p.type==="dynamic"){let h=L1(p.start_condition),x=L1(p.end_condition),D=L1(p.column_end_condition);p=f(m({},p),{start_condition:h,end_condition:x,column_end_condition:D})}return p});return u.reverse(),f(m({},d),{range_imports:u})})},disabled:l!==void 0,disabledTooltip:l},"Import Ranges")))},cS=Yx;var Ye=T(_());var qx=(e,t)=>{if(e.length===0||e[t]===void 0)return;let n=e[t].dfName;return{type:"csv",sheet_indexes:[t],file_name:`${n}_export`}},Qx=["\\","/","<",">",":",'"',"|","?","*"],e9=e=>{let{params:t,setParams:n,edit:r,editApplied:o,loading:i}=wt(()=>qx(e.sheetDataArray,e.selectedSheetIndex),"export_to_file",e.mitoAPI,e.analysisData);if(t===void 0)return Ye.default.createElement(ge,{setUIState:e.setUIState,message:"Please import a dataframe before attempting to export it"});let a;return t.type==="csv"&&t.file_name.endsWith(".xlsx")?a="The .xlsx file extension does not match the CSV File Type.":t.type==="excel"&&(t.file_name.endsWith(".txt")||t.file_name.endsWith(".csv"))&&(a="The file extension ending does not match the Excel file type."),Qx.forEach(s=>{t.file_name.includes(s)&&(a=`The File Name cannot include ${s}`)}),Ye.default.createElement(Y,null,Ye.default.createElement(Q,{header:"Export To File",setUIState:e.setUIState}),Ye.default.createElement(q,null,Ye.default.createElement(I,{justify:"space-between",align:"center",title:"TODO"},Ye.default.createElement(C,null,Ye.default.createElement("p",{className:"text-header-3"},"File Name")),Ye.default.createElement(C,null,Ye.default.createElement(ne,{autoFocus:!0,placeholder:"MitoExport",width:"medium",value:""+t.file_name,onChange:s=>{let l=s.target.value;n(d=>f(m({},d),{file_name:l}))}}))),a!==void 0&&Ye.default.createElement("p",{className:"text-color-error"},a),Ye.default.createElement(I,{justify:"space-between",align:"center"},Ye.default.createElement(C,null,Ye.default.createElement("p",{className:"text-header-3"},"File Type")),Ye.default.createElement(C,null,Ye.default.createElement($,{width:"medium",value:t.type,onChange:s=>{n(l=>f(m({},l),{type:s}))}},Ye.default.createElement(v,{title:"CSV",id:"csv",subtext:"Each dataframe will be exported as a seperate CSV file. If multiple dataframes are exported, their names will be appended to the file name."}),Ye.default.createElement(v,{title:"Excel",id:"excel",subtext:"Each exported dataframe will be exported as a seperate sheet."})))),Ye.default.createElement(I,null,Ye.default.createElement(C,null,Ye.default.createElement("p",{className:"text-header-3"},"Dataframes to Export"))),Ye.default.createElement(Lm,{height:"medium",sheetDataArray:e.sheetDataArray,selectedSheetIndexes:t.sheet_indexes,setUIState:e.setUIState,onChange:s=>{n(l=>f(m({},l),{sheet_indexes:s}))}})),Ye.default.createElement(Me,null,o&&Ye.default.createElement("p",{className:"text-subtext-1"},"Files created in the same folder as this notebook. Export code generated."),Ye.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{r()},disabled:t.file_name===""||t.sheet_indexes.length===0||a!==void 0||i},i?"Generating...":"Generate Export Code")))},fS=e9;var ci=T(_());var kt=T(_());var U1=T(_()),t9=()=>U1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U1.default.createElement("path",{d:"M8.89617 1.82873L7.80328 2.57459L6.92896 2.04972V1H4.96175V2.04972L4.1694 2.57459L3.24044 1.82873L1.81967 3.18232L2.55738 4.09392C2.46135 4.43914 2.31148 5.06077 2.31148 5.06077L1 5.19889V6.96685L2.31148 7.1326L2.55738 8.20994L1.81967 9.14917L3.13115 10.3094L4.1694 9.50829L5.07104 10.0884V11H6.92896V10.0884L7.80328 9.50829L8.89617 10.3094L10.153 9.14917L9.44262 8.20994L9.79781 7.1326L11 6.96685V5.19889L9.79781 4.9779L9.44262 4.09392L10.153 3.18232L8.89617 1.82873Z",stroke:"#9D6CFF"})),pS=t9;var ss=(e,t)=>{let n=e.split(".").map(o=>parseInt(o)),r=t.split(".").map(o=>parseInt(o));n.length==1&&(n[1]=0),n.length==2&&(n[2]=0);for(let o=0;or[o])return!0;if(n[o]ss(e.pythonVersion,"3.6.0")&&ss(e.pandasVersion,"0.25.0");var B1="Parent Folder",H1=e=>{try{let t=e.split(".");return t[t.length-1]}catch(t){return}},G1=(e,t)=>{if(e.isDirectory)return;let n=["csv","tsv","txt","tab"];Bm(t)&&(n.push("xlsx"),t.pandasVersion!==void 0&&ss(t.pandasVersion,"1.0.0")&&n.push("xlsm"));for(let o of n)if(e.name.toLowerCase().endsWith(o))return;let r=H1(e.name);return r===void 0?"Sorry, we don't support that file type.":r=="xlsx"?"Upgrade to pandas>=0.25.0 and Python>3.6 to import Excel files.":`Sorry, we don't support ${r} files.`},hS=(e,t,n,r)=>e===void 0?{disabled:!0,buttonText:"Select a File to Import"}:e.isDirectory?{disabled:!0,buttonText:"That's a Directory. Select a File"}:G1(e,t)!==void 0?{disabled:!0,buttonText:"Select a Supported File Type"}:n?{disabled:!1,buttonText:"Importing..."}:{disabled:!1,buttonText:(r?"Update to ":"Import ")+e.name},ui=e=>e!==void 0&&!(e!=null&&e.isDirectory)&&((e==null?void 0:e.name.toLowerCase().endsWith(".xlsx"))||(e==null?void 0:e.name.toLowerCase().endsWith(".xlsm"))),Hm=e=>{let t=[...e.pathContents.elements];return V1(e.pathContents.path_parts)||t.push({isDirectory:!0,isParentDirectory:!0,name:B1,lastModified:0}),t.filter(r=>dr(r.name,e.searchString)>.8).sort((r,o)=>r.name===B1?-1:o.name===B1?1:e.sort==="name_ascending"?r.name=o.name?-1:1:typeof r.lastModified!="number"||typeof o.lastModified!="number"?1:e.sort==="last_modified_ascending"?r.lastModified=o.lastModified?-1:1)},V1=e=>(e=e.filter(t=>t!==""),e.length===1&&(e[0]==="/"||e[0]==="\\")),Qi=async(e,t,n)=>{let r=[...t];if(n===void 0)return;r.push(n==null?void 0:n.name);let o=await e.getPathJoined(r);return"error"in o?void 0:o.result};var Ae=T(_());var ed=T(_()),n9=e=>e.direction==="ascending"?ed.default.createElement("svg",{width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ed.default.createElement("path",{d:"M4.00073 4L0.536631 0.25H7.46483L4.00073 4Z",fill:"#C4C4C4"})):ed.default.createElement("svg",{width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ed.default.createElement("path",{d:"M4.00073 0L0.536631 3.75H7.46483L4.00073 0Z",fill:"#C4C4C4"})),j1=n9;var At=T(_());var gS=e=>{if(e==null)return"--";let t=Math.floor(Date.now()/1e3)-e;return t<3600?`${Math.round(t/60)} minutes ago`:t<86400?`${Math.round(t/3600)} hours ago`:t<604800?`${Math.round(t/86400)} days ago`:t<2419200?`${Math.round(t/604800)} weeks ago`:t<31536e3?`${Math.round(t/2419200)} months ago`:`${Math.round(t/31536e3)} years ago`},r9=async e=>{await new Promise(t=>setTimeout(t,e))},td=async(e,t)=>{let n=await e();for(let r=0;rR1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R1.default.createElement("path",{d:"M1 3.75V6C1 6.13807 1.11193 6.25 1.25 6.25H4M1 3.75V1.5C1 1.36193 1.11193 1.25 1.25 1.25H4M1 3.75H7M7 3.75V1.5C7 1.36193 6.88807 1.25 6.75 1.25H4M7 3.75V6C7 6.13807 6.88807 6.25 6.75 6.25H4M4 1.25V6.25",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),Gm=o9;var W1=T(_()),i9=()=>W1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W1.default.createElement("path",{d:"M3.86144 1H1.25C1.11193 1 1 1.11193 1 1.25V4.75C1 4.88807 1.11193 5 1.25 5H6.75C6.88807 5 7 4.88807 7 4.75V2.05C7 1.91193 6.88807 1.8 6.75 1.8H4.63856C4.55236 1.8 4.47225 1.75559 4.42656 1.6825L4.07344 1.1175C4.02775 1.0444 3.94764 1 3.86144 1Z",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),yS=i9;var nd=T(_()),a9=()=>nd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nd.default.createElement("path",{d:"M1 1.25V5.75C1 5.88807 1.11193 6 1.25 6H6.75C6.88807 6 7 5.88807 7 5.75V2.94244C7 2.89827 6.9883 2.85489 6.96609 2.81671L5.9814 1.12428C5.93663 1.04733 5.85433 1 5.76531 1H1.25C1.11193 1 1 1.11193 1 1.25Z",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),nd.default.createElement("path",{d:"M2.63647 2.71875H5.36375",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),nd.default.createElement("path",{d:"M2.63647 4.28125H5.36375",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),SS=a9;function s9(e){let t=(0,At.useRef)(null),n=e.index===e.fileBrowserState.selectedElementIndex;(0,At.useEffect)(()=>{var a;let o=t.current,i=(a=t.current)==null?void 0:a.parentElement;n&&o&&i&&vl(i,t.current,0)},[n]);let r=G1(e.element,e.userProfile);return At.default.createElement("div",{ref:t,className:"file-browser-element p-5px text-unselectable",title:e.element.name,style:{background:n?"#D5C0FF":""},onClick:o=>{o.detail>1||(n?e.setFileBrowserState(i=>f(m({},i),{selectedElementIndex:-1})):e.setFileBrowserState(i=>f(m({},i),{selectedElementIndex:e.index})))},onDoubleClick:()=>{if(e.element.isParentDirectory){let o=[...e.fileBrowserState.pathContents.path_parts];o.pop(),e.setCurrPathParts(o)}else if(e.element.isDirectory){let o=e.fileBrowserState.pathContents.path_parts||[];o.push(e.element.name),e.setCurrPathParts(o)}else ui(e.element)?(async()=>{let i=await Qi(e.mitoAPI,e.currPathParts,e.element);i!==void 0&&e.setImportState({screen:"xlsx_import_config",fileName:e.element.name,filePath:i})})():e.importCSVFile(e.element)}},At.default.createElement(I,{suppressTopBottomMargin:!0,justify:"space-between"},At.default.createElement(C,{span:17,offsetRight:1},At.default.createElement("div",{className:"flexbox-row"},At.default.createElement("div",{className:"mr-5px mt-2px"},e.element.isDirectory&&e.element.isParentDirectory&&At.default.createElement(im,{width:"14px"}),e.element.isDirectory&&!e.element.isParentDirectory&&At.default.createElement(yS,null),!e.element.isDirectory&&r===void 0&&At.default.createElement(Gm,null),!e.element.isDirectory&&r!==void 0&&At.default.createElement(SS,null)),At.default.createElement("div",null,e.element.name))),At.default.createElement(C,{span:6},At.default.createElement("p",{className:"text-align-right"},e.element.lastModified!==0&&gS(e.element.lastModified)))),n&&r!==void 0&&At.default.createElement("div",{className:"pl-5px pr-5px"},At.default.createElement("span",null," ",r," ")))}var CS=s9;var ea=T(_());var ls=T(_()),l9=()=>ls.default.createElement("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ls.default.createElement("path",{d:"M15.6711 7.6579V11.5C15.6711 11.9142 15.3353 12.25 14.9211 12.25H1.5C1.08579 12.25 0.75 11.9142 0.75 11.5V7.6579C0.75 7.24368 1.08579 6.9079 1.5 6.9079H4.10526H14.9211C15.3353 6.9079 15.6711 7.24368 15.6711 7.6579Z",stroke:"#494650",strokeWidth:"1.5"}),ls.default.createElement("path",{d:"M14.5503 2.63128L15.4318 6.43421H0.989295L1.87037 2.63151C2.08764 1.69377 2.16023 1.44349 2.28529 1.26975C2.42019 1.08234 2.60436 0.935958 2.81738 0.846842C3.01487 0.764224 3.27508 0.75 4.23766 0.75H8.21021H12.183C13.1455 0.75 13.4057 0.764222 13.6032 0.846828C13.8162 0.935931 14.0003 1.08229 14.1352 1.26968C14.2603 1.4434 14.3329 1.69365 14.5503 2.63128Z",stroke:"#494650",strokeWidth:"1.5"}),ls.default.createElement("circle",{cx:"10.6052",cy:"9.23683",r:"1.02632",fill:"#494650"}),ls.default.createElement("path",{d:"M14.3683 9.23683C14.3683 9.80364 13.9088 10.2631 13.342 10.2631C12.7752 10.2631 12.3157 9.80364 12.3157 9.23683C12.3157 8.67001 12.7752 8.21051 13.342 8.21051C13.9088 8.21051 14.3683 8.67001 14.3683 9.23683Z",fill:"#494650"})),IS=l9;function d9(e){var n;let t=r=>{if(e.pathParts===void 0)return;let o=e.pathParts.slice(0,r+1);e.setCurrPathParts(o)};return ea.default.createElement("div",{className:"file-browser-path-selector"},(n=e.pathParts)==null?void 0:n.map((r,o)=>ea.default.createElement(ea.default.Fragment,{key:o},ea.default.createElement("div",{className:"file-browser-path-part",key:o,onClick:()=>{t(o)}},o===0?ea.default.createElement(IS,null):r),ea.default.createElement("div",{className:"file-browser-path-seperator"},">"))))}var xS=d9;function u9(e){let t=(0,Ae.useRef)(null),n=Hm(e.fileBrowserState),r=n[e.fileBrowserState.selectedElementIndex];(0,Ae.useEffect)(()=>{var i;e.setFileBrowserState(a=>f(m({},a),{searchString:""})),(i=t.current)==null||i.focus()},[e.fileBrowserState.pathContents.path_parts]),(0,Ae.useEffect)(()=>{var i;(i=t.current)==null||i.focus()},[e.fileBrowserState.selectedElementIndex,e.fileBrowserState.sort]);let o=V1(e.fileBrowserState.pathContents.path_parts)&&!e.userProfile.isPro;return Ae.default.createElement("div",{className:"file-browser flexbox-column"},Ae.default.createElement("div",null,Ae.default.createElement(xS,{setCurrPathParts:e.setCurrPathParts,pathParts:e.fileBrowserState.pathContents.path_parts})),Ae.default.createElement(I,{className:"border-t-light-gray border-b-light-gray",justify:"space-between"},Ae.default.createElement(C,{span:18,className:"flexbox-row flexbox-space-between border-r-light-gray",onClick:()=>{e.setFileBrowserState(i=>f(m({},i),{sort:i.sort==="name_descending"?"name_ascending":"name_descending"}))}},Ae.default.createElement("p",{className:"text-body-2 pt-5px pb-5px"},"Name"),e.fileBrowserState.sort.startsWith("name")&&Ae.default.createElement("div",{className:"mr-5px ml-5px"},Ae.default.createElement(j1,{direction:e.fileBrowserState.sort.endsWith("descending")?"descending":"ascending"}))),Ae.default.createElement(C,{span:6,className:"flexbox-row flexbox-justify-end text-align-right",onClick:()=>{e.setFileBrowserState(i=>f(m({},i),{sort:i.sort==="last_modified_descending"?"last_modified_ascending":"last_modified_descending"}))}},e.fileBrowserState.sort.startsWith("last_modified")&&Ae.default.createElement("div",{className:"mr-5px ml-5px"},Ae.default.createElement(j1,{direction:e.fileBrowserState.sort.endsWith("descending")?"descending":"ascending"})),Ae.default.createElement("p",{className:"text-body-2 pt-5px pb-5px"},"Last Modified"))),Ae.default.createElement("div",{className:"mt-5px mb-5px"},Ae.default.createElement("input",{className:M("mito-input","text-body-2","element-width-block"),ref:t,value:e.fileBrowserState.searchString,placeholder:"Search the current folder",onChange:i=>{let a=i.target.value;e.setFileBrowserState(s=>f(m({},s),{searchString:a}))},onKeyDown:i=>{if(i.key=="ArrowUp")e.setFileBrowserState(a=>f(m({},a),{selectedElementIndex:Math.max(a.selectedElementIndex-1,-1)})),i.preventDefault();else if(i.key==="ArrowDown")e.setFileBrowserState(a=>f(m({},a),{selectedElementIndex:Math.min(a.selectedElementIndex+1,n.length-1)})),i.preventDefault();else if(i.key==="Enter"){if(!r)return;if(r.isParentDirectory){let a=[...e.fileBrowserState.pathContents.path_parts];a.pop(),e.setCurrPathParts(a)}else if(r.isDirectory){let a=e.fileBrowserState.pathContents.path_parts||[];a.push(r.name),e.setCurrPathParts(a)}else ui(r)?(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"xlsx_import_config",fileName:r.name,filePath:s})})():e.importCSVFile(r)}},width:"block",autoFocus:!0})),Ae.default.createElement("div",{className:"file-browser-element-list"},o&&Ae.default.createElement(Ae.default.Fragment,null,Ae.default.createElement(I,{justify:"space-around"},Ae.default.createElement("p",{className:"ma-25px text-align-center text-body-1"},"Want to import from a different drive? Consider\xA0",Ae.default.createElement("a",{onClick:()=>{e.mitoAPI.log("clicked_pro_button",{pro_button_location:"import_taskpane_root_folder_import"}),e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"upgrade_to_pro",proOrEnterprise:"Pro"},selectedTabType:"data"}))},className:"text-body-1-link"},"upgrading to Mito Pro")," or\xA0",Ae.default.createElement("a",{onClick:()=>{e.setCurrPathParts(["."])},className:"text-body-1-link"},"go back to current directory.")))),!o&&Ae.default.createElement(Ae.default.Fragment,null,!e.fileBrowserState.loadingFolder&&(n==null?void 0:n.map((i,a)=>Ae.default.createElement(CS,{key:a,mitoAPI:e.mitoAPI,index:a,element:i,fileBrowserState:e.fileBrowserState,setFileBrowserState:e.setFileBrowserState,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,excelImportEnabled:Bm(e.userProfile),setImportState:e.setImportState,importCSVFile:e.importCSVFile,userProfile:e.userProfile}))),e.fileBrowserState.loadingFolder&&Ae.default.createElement("p",null,"Loading folder contents..."))))}var wS=u9;function m9(e){let[t,n]=(0,kt.useState)({pathContents:{path_parts:e.currPathParts,elements:[]},sort:"last_modified_descending",searchString:"",selectedElementIndex:-1,loadingFolder:!1,loadingImport:!1}),r=Hm(t)[t.selectedElementIndex];(0,kt.useEffect)(()=>{o(e.currPathParts),n(a=>f(m({},a),{selectedElementIndex:-1})),e.mitoAPI.log("curr_path_changed",{path_parts_length:e.currPathParts.length})},[e.currPathParts]),(0,kt.useEffect)(()=>{let a="";if(r===void 0)a="undefined";else if(r.isDirectory)a="directory";else{let s=H1(r.name);s!==void 0?a=s:a="No File Ending"}e.mitoAPI.log("selected_element_changed",{selected_element:a})},[r]);async function o(a){n(d=>f(m({},d),{loadingFolder:!0}));let s=await e.mitoAPI.getPathContents(a),l="error"in s?void 0:s.result;n(l?d=>f(m({},d),{pathContents:l,loadingFolder:!1}):d=>f(m({},d),{loadingFolder:!1}))}let i=hS(r,e.userProfile,t.loadingImport,e.isUpdate);return kt.default.createElement(Y,null,kt.default.createElement(Q,{header:e.isUpdate?"Update Import":"Import Files",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),kt.default.createElement(q,{noScroll:!0},kt.default.createElement(wS,{mitoAPI:e.mitoAPI,userProfile:e.userProfile,setUIState:e.setUIState,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,fileBrowserState:t,setFileBrowserState:n,importCSVFile:e.importCSVFile,setImportState:e.setImportState})),kt.default.createElement(Me,null,kt.default.createElement(I,{justify:"space-between"},!i.disabled&&!ui(r)&&kt.default.createElement(C,null,kt.default.createElement(j,{variant:"light",width:"small",onClick:()=>{(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"csv_import_config",fileName:r.name,filePath:s})})()},disabled:i.disabled},kt.default.createElement(I,{suppressTopBottomMargin:!0,justify:"space-between",align:"center"},kt.default.createElement(pS,null),kt.default.createElement("p",{className:"ml-2px"},"Configure")))),kt.default.createElement(C,{span:!i.disabled&&!ui(r)?18:24},kt.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{ui(r)?(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"xlsx_import_config",fileName:r.name,filePath:s})})():e.importCSVFile(r)},disabled:i.disabled},i.buttonText)))))}var Vm=m9;var vS=T(_());var fe=T(_());var c9=["utf_8","ascii","latin_1","big5","big5hkscs","cp037","cp273","cp424","cp437","cp500","cp720","cp737","cp775","cp850","cp852","cp855","cp856","cp857","cp858","cp860","cp861","cp862","cp863","cp864","cp865","cp866","cp869","cp874","cp875","cp932","cp949","cp950","cp1006","cp1026","cp1125","cp1140","cp1250","cp1251","cp1252","cp1253","cp1254","cp1255","cp1256","cp1257","cp1258","euc_jp","euc_jis_2004","euc_jisx0213","euc_kr","gb2312","gbk","gb18030","hz","iso2022_jp","iso2022_jp_1","iso2022_jp_2","iso2022_jp_2004","iso2022_jp_3","iso2022_jp_ext","iso2022_kr","iso8859_2","iso8859_3","iso8859_4","iso8859_5","iso8859_6","iso8859_7","iso8859_8","iso8859_9","iso8859_10","iso8859_11","iso8859_13","iso8859_14","iso8859_15","iso8859_16","johab","koi8_r","koi8_t","koi8_u","kz1048","mac_cyrillic","mac_greek","mac_iceland","mac_latin2","mac_roman","mac_turkish","ptcp154","shift_jis","shift_jis_2004","shift_jisx0213","utf_32","utf_32_be","utf_32_le","utf_16","utf_16_be","utf_16_le","utf_7","utf_8_sig"];var ta={["."]:"period",[","]:"comma"},TS="The seperator that seperates one column from another.",_S="The encoding used to save this file.",id="The character used to separate the decimal places in numbers.",ad="The number of rows at the top of the file to skip when reading data into the dataframe.",DS="Turn on to skip any lines that error when being read in.",ds=",",rd="utf-8",us=".",X1=0,od=!0,f9=(e,t,n)=>t?"Importing...":n?`Update to ${e}`:`Import ${e}`;function p9(e){return`Imported ${e}`}function h9(e){let[t]=ln(void 0,async()=>{var x;let h=await e.mitoAPI.getCSVFilesMetadata(((x=e.params)==null?void 0:x.file_names)||[]);return"error"in h?void 0:h.result},h=>{e.setParams(x=>f(m({},x),{delimeters:(h==null?void 0:h.delimeters)||[ds],encodings:(h==null?void 0:h.encodings)||[rd],decimals:(h==null?void 0:h.decimals)||[us],skiprows:(h==null?void 0:h.skiprows)||[X1]}))},[]),n=()=>{e.setParams(h=>f(m({},h),{delimeters:(t==null?void 0:t.delimeters)||[ds],encodings:(t==null?void 0:t.encodings)||[rd],decimals:(t==null?void 0:t.decimals)||[us],skiprows:(t==null?void 0:t.skiprows)||[X1],error_bad_lines:[od]}))};if(e.params===void 0||e.fileName===void 0||e.filePath===void 0)return fe.default.createElement("div",{className:"text-body-1"},"There has been an error loading your CSV file encodings. Please try again, or contact support.");let r=e.params.delimeters,o=e.params.encodings,i=e.params.decimals,a=e.params.skiprows,s=e.params.error_bad_lines,l=r!==void 0?r[0]:ds,d=o!==void 0?o[0]:rd,u=i!==void 0?i[0]:us,c=a!==void 0?a[0]:X1,p=s!==void 0?s[0]:od;return fe.default.createElement(Y,null,fe.default.createElement(Q,{header:e.isUpdate?`Update to ${e.fileName}`:`Import ${e.fileName}`,setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),fe.default.createElement(q,{noScroll:!0},e.error!==void 0&&fe.default.createElement("p",{className:"text-color-error"}," ",e.error," "),fe.default.createElement(I,{justify:"space-between",align:"center",title:TS},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:TS},"Delimeter")),fe.default.createElement(C,null,fe.default.createElement(ne,{width:"medium",value:l,onChange:h=>{let x=h.target.value;e.setParams(D=>f(m({},D),{delimeters:[x]}))},onKeyDown:h=>{h.key==="Tab"&&(h.preventDefault(),e.setParams(x=>{let D=x.delimeters;return f(m({},x),{delimeters:[(D!==void 0?D[0]:ds)+" "]})}))},selectTextOnFocus:!0}))),fe.default.createElement(I,{justify:"space-between",align:"center",title:_S},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:_S},"Encoding")),fe.default.createElement(C,null,fe.default.createElement($,{searchable:!0,width:"medium",value:d,onChange:h=>{e.setParams(x=>f(m({},x),{encodings:[h]}))}},c9.map(h=>fe.default.createElement(v,{key:h,title:h}))))),fe.default.createElement(I,{justify:"space-between",align:"center",title:id},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:id},"Decimal Separator")),fe.default.createElement(C,null,fe.default.createElement($,{searchable:!0,width:"medium",value:ta[u],onChange:h=>{e.setParams(x=>f(m({},x),{decimals:[h]}))}},Object.keys(ta).map(h=>{let x=ta[h];return fe.default.createElement(v,{key:x,title:x,id:h})})))),fe.default.createElement(I,{justify:"space-between",align:"center",title:ad},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:ad},"Number of Rows to Skip")),fe.default.createElement(C,null,fe.default.createElement(ne,{value:""+c,type:"number",width:"medium",onChange:h=>{let x=h.target.value,D=Math.floor(parseFloat(x));e.setParams(S=>f(m({},S),{skiprows:[D]}))},selectTextOnFocus:!0}))),fe.default.createElement(I,{justify:"space-between",align:"center",title:DS},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:DS},"Skip Invalid Lines")),fe.default.createElement(C,null,fe.default.createElement(Ut,{value:!p,onChange:()=>{e.setParams(h=>{let x=h.error_bad_lines;return f(m({},h),{error_bad_lines:[x!==void 0?!x[0]:od]})})}}))),fe.default.createElement(I,null,fe.default.createElement("p",{onClick:()=>{e.setUIState(h=>f(m({},h),{currOpenTaskpane:{type:"Excel Range Import",file_path:e.filePath,sheet_name:"Sheet1",sheet_names:["Sheet1"]}}))}},"Want to import multiple ranges from this file? ",fe.default.createElement("span",{className:"text-underline"},"Click here.")))),fe.default.createElement(Me,null,fe.default.createElement("p",{className:"text-body-2 text-color-medium-gray-important mb-5px"},fe.default.createElement("span",{className:"text-body-2-link",onClick:n},"Reset parameters to automatically detected parameters. ")),fe.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},autoFocus:!0},f9(e.fileName,e.loading,e.isUpdate)),e.editApplied&&!e.loading&&fe.default.createElement("p",{className:"text-subtext-1"},p9(e.fileName)),!e.editApplied&&fe.default.createElement(se,{px:16})))}var jm=h9;var J1=e=>({file_names:[e],delimeters:[ds],encodings:[rd],error_bad_lines:[od]});function g9(e){let{params:t,setParams:n,loading:r,edit:o,editApplied:i,error:a}=wt(()=>J1(e.filePath),"simple_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return vS.default.createElement(jm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!1,fileName:e.fileName,filePath:e.filePath,params:t,setParams:n,edit:o,editApplied:i,loading:r,error:a!==void 0?a:e.error,backCallback:()=>{e.setScreen({screen:"file_browser"})}})}var PS=g9;var AS=T(_());var we=T(_());var mi=T(_());var Rm=T(_());var y9=e=>Rm.default.createElement("div",{key:e.value,onClick:()=>{e.onClick()},className:M("radio-button-box-row",{"radio-button-box-row-selected":e.checked})},Rm.default.createElement("input",{type:"radio",name:e.value,value:e.value,checked:e.checked}),Rm.default.createElement("label",{htmlFor:e.value},e.value)),bS=y9;var S9=e=>e.loading?mi.default.createElement(I,{justify:"center"},mi.default.createElement("p",{className:"text-body-1"},"Loading...")):e.values.length===0?mi.default.createElement(I,{justify:"center"},mi.default.createElement("p",{className:"text-body-1"},"No items to display.")):null,C9=e=>{let t=e.height||"block",n=e.width||"block",r=`element-height-${t}`,o=`element-width-${n}`;return mi.default.createElement("div",{className:M("text-body-2","radio-button-box",r,o,e.className)},mi.default.createElement(S9,{values:e.values,loading:e.loading}),e.values.map(i=>mi.default.createElement(bS,{key:i,value:i,checked:i==e.selectedValue,onClick:()=>{e.onChange(i)}})))},Wm=C9;var I9=(e,t,n)=>t?"Importing...":e.sheet_names.length===0?"Select sheets to import them":n?`Update to ${e.sheet_names[0]}`:`Import ${e.sheet_names.length} Selected Sheet${e.sheet_names.length===1?"":"s"}`;function x9(e){return`Imported ${e.sheet_names.length} sheet${e.sheet_names.length===1?"":"s"}.`}var ES='Select "Yes" if Mito should set the first non-skipped row as the column headers. Select "No" if Mito should generate column headers';function w9(e){let[t,n]=ln({sheet_names:[],size:0},async i=>{let a=await e.mitoAPI.getExcelFileMetadata(i);return"error"in a?void 0:a.result},i=>{i!==void 0&&e.setParams(a=>f(m({},a),{sheet_names:e.isUpdate?i.sheet_names.slice(0,1):i.sheet_names}))},[e.filePath]),r=e.params;if(r===void 0)return we.default.createElement("div",{className:"text-body-1"},"There has been an error loading your Excel file metadata. Please try again, or contact support.");let o=r.sheet_names.length;return we.default.createElement(Y,null,we.default.createElement(Q,{header:e.isUpdate?`Update to ${e.fileName}`:`Import ${e.fileName}`,setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),we.default.createElement(q,null,we.default.createElement("div",null,!e.isUpdate&&we.default.createElement(Gr,{loading:n,searchable:!0,height:"medium",emptyMessage:"There are no sheets to choose from. Either the workbook is empty or password protected.",onToggleAll:i=>{e.setParams(a=>{let s=i.map(l=>t.sheet_names[l]);return f(m({},a),{sheet_names:s})})}},t.sheet_names.map((i,a)=>we.default.createElement(hr,{key:a,title:i,toggled:r.sheet_names.includes(i),onToggle:()=>{e.setParams(s=>{let l=[...s.sheet_names];return br(l,i),f(m({},s),{sheet_names:l})})},index:a}))),e.isUpdate&&we.default.createElement(Wm,{values:t.sheet_names,selectedValue:r.sheet_names[0],height:"medium",onChange:i=>e.setParams(a=>f(m({},a),{sheet_names:[i]})),loading:n}),we.default.createElement(I,{justify:"space-between",align:"center",title:ES},we.default.createElement(C,null,we.default.createElement(de,{tooltip:ES},"Has Header Row")),we.default.createElement(C,null,we.default.createElement($,{value:r.has_headers?"Yes":"No",width:"medium",onChange:i=>e.setParams(a=>f(m({},a),{has_headers:i==="Yes"}))},we.default.createElement(v,{title:"Yes"}),we.default.createElement(v,{title:"No"})))),we.default.createElement(I,{justify:"space-between",align:"center",title:ad},we.default.createElement(C,null,we.default.createElement(de,{tooltip:ad},"Number of Rows to Skip")),we.default.createElement(C,null,we.default.createElement(ne,{value:""+r.skiprows,type:"number",width:"medium",onChange:i=>{let a=i.target.value;e.setParams(s=>f(m({},s),{skiprows:a}))}}))),ss(e.userProfile.pandasVersion,"1.4.0")&&we.default.createElement(I,{justify:"space-between",align:"center",title:id},we.default.createElement(C,null,we.default.createElement(de,{tooltip:id},"Decimal Separator")),we.default.createElement(C,null,we.default.createElement($,{width:"medium",value:ta[r.decimal],onChange:i=>{e.setParams(a=>f(m({},a),{decimals:[i]}))}},Object.keys(ta).map(i=>{let a=ta[i];return we.default.createElement(v,{key:a,title:a,id:i})})))),!e.isUpdate&&r.sheet_names.length===1&&we.default.createElement("p",{onClick:()=>{e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"Excel Range Import",file_path:e.filePath,sheet_name:r.sheet_names[0],sheet_names:t.sheet_names}}))}},"Want to import multiple ranges from ",r.sheet_names[0],"? ",we.default.createElement("span",{className:"text-underline"},"Click here.")),t.size>=1e5&&t.size<1e7&&we.default.createElement("p",{className:"text-body-2 mt-20px"},"Due to Python limitations, large Excel files take minutes to import."),t.size>=1e7&&we.default.createElement("p",{className:"text-body-2 mt-20px"},"Due to Python limitations, massive Excel files take many minutes to import. If possible, save the Excel file as a CSV before importing."))),we.default.createElement(Me,null,we.default.createElement(j,{variant:"dark",width:"block",onClick:()=>e.edit(i=>{let a=parseInt(""+i.skiprows);return f(m({},i),{skiprows:a})}),disabled:o===0,autoFocus:!0},I9(r,e.loading,e.isUpdate)),e.editApplied&&!e.loading&&we.default.createElement("p",{className:"text-subtext-1"},x9(r)),!e.editApplied&&we.default.createElement(se,{px:18})))}var Xm=w9;var z1=e=>({file_name:e,sheet_names:[],has_headers:!0,decimal:us,skiprows:0});function T9(e){let{params:t,setParams:n,loading:r,edit:o,editApplied:i}=wt(()=>z1(e.filePath),"excel_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return AS.default.createElement(Xm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!1,fileName:e.fileName,filePath:e.filePath,params:t,setParams:n,edit:o,editApplied:i,loading:r,backCallback:()=>{e.setImportState({screen:"file_browser"})}})}var kS=T9;function _9(e){let[t,n]=(0,ci.useState)({screen:"file_browser"});return t.screen==="file_browser"?ci.default.createElement(Vm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!1,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,setImportState:n,importCSVFile:async r=>{let o=await e.mitoAPI.getPathJoined([...e.currPathParts,r.name]),i="error"in o?void 0:o.result;if(i===void 0)return;let a=await e.mitoAPI.editSimpleImport([i]);"error"in a&&n({screen:"csv_import_config",fileName:r.name,filePath:i,error:a.error})}}):t.screen=="csv_import_config"?ci.default.createElement(PS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,fileName:t.fileName,filePath:t.filePath,error:t.error,setScreen:n}):t.screen=="xlsx_import_config"?ci.default.createElement(kS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,fileName:t.fileName,filePath:t.filePath,setImportState:n}):ci.default.createElement(ci.default.Fragment,null)}var NS=_9;var ye=T(_());var D9=["True","true","False","false"],K1=(e,t,n,r)=>{if(e.length===0||e[t]===void 0)return;let o=e[t],i=n||{type:"value",value:0};(i.type==="mean"||i.type==="median")&&(Object.values(o.columnDtypeMap).map(l=>et(l)||it(l)||Er(l)).every(l=>l===!0)||(i={type:"value",value:0}));let a=r===void 0?Object.keys(o.columnIDsMap):Tl(Object.keys(o.columnIDsMap),r);return{sheet_index:t,column_ids:a,fill_method:i}},v9=(e,t)=>{if(t.length===0)return"Select columns to fill NaN values";let n=t.map(i=>e==null?void 0:e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,25);return o===0?`Fill NaNs in ${r}`:`Fill NaNs in ${r} and ${o} others`},P9=(e,t)=>{let n=t.map(i=>e==null?void 0:e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,25);return o===0?ye.default.createElement("p",null,"Filled NaNs in ",ye.default.createElement("span",{className:"text-color-gray-important"},r),"."):ye.default.createElement("p",null,"Filled NaNs in ",ye.default.createElement("span",{className:"text-color-gray-important"},r)," and ",ye.default.createElement("span",{className:"text-color-gray-important"},o)," other columns.")},b9=e=>{let{params:t,setParams:n,loading:r,edit:o,editApplied:i}=wt(()=>K1(e.sheetDataArray,e.selectedSheetIndex,void 0,e.startingColumnIDs),"fill_na",e.mitoAPI,e.analysisData);if((0,ye.useEffect)(()=>{n(d=>{let u=K1(e.sheetDataArray,e.selectedSheetIndex,d.fill_method,e.startingColumnIDs);return u||d})},[e.startingColumnIDs]),t===void 0)return ye.default.createElement(ge,{setUIState:e.setUIState,message:"Import a dataset before filling NaN values."});let a=e.sheetDataArray[t.sheet_index],s=(a==null?void 0:a.columnDtypeMap)||{},l=t.column_ids.length===0||t.column_ids.map(d=>s[d]).filter(d=>d!==void 0).map(d=>et(d)||it(d)||Er(d)).every(d=>d===!0);return ye.default.createElement(Y,null,ye.default.createElement(Q,{header:"Fill NaN Values",setUIState:e.setUIState}),ye.default.createElement(q,null,ye.default.createElement(Lt,{title:"Select the dataframe to fill nan values in.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:d=>{n(u=>{let c=K1(e.sheetDataArray,d,u.fill_method);return c||f(m({},u),{sheet_index:d})})}}),ye.default.createElement(se,{px:15}),ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the columns to fill nan values in."},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Columns to Fill NaN Values In"))),ye.default.createElement(tr,{sheetData:a,selectedColumnIDs:t.column_ids,getIsDisabledColumnID:(d,u,c)=>(t.fill_method.type==="mean"||t.fill_method.type==="median")&&!(et(c)||Er(c)||it(c)),onChange:d=>{n(u=>f(m({},u),{column_ids:d}))}}),ye.default.createElement(se,{px:15}),ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the method for filling nan values"},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Fill Method")),ye.default.createElement(C,null,ye.default.createElement($,{value:t.fill_method.type,onChange:d=>{n(u=>{let c={type:"bfill"};return d==="value"?c={type:"value",value:0}:c={type:d},f(m({},u),{fill_method:c})})},width:"medium"},ye.default.createElement(v,{id:"value",title:"Value",subtext:"Replaces NaN values with a specific value that you input."}),ye.default.createElement(v,{id:"ffill",title:"Forward Fill",subtext:"Replaces NaNs in the column with the value in the row before."}),ye.default.createElement(v,{id:"bfill",title:"Back Fill",subtext:"Replaces NaNs in the column with the value in the row after."}),ye.default.createElement(v,{id:"mean",title:"Column Mean",subtext:l?"Replaces NaN values in number columns with the average of the column.":"Only number, datetime, and timedetla columns support fill with mean.",disabled:!l}),ye.default.createElement(v,{id:"median",title:"Column Median",subtext:l?"Replaces NaN values in number columns with the median of the column.":"Only number, datetime, and timedetla columns support fill with median.",disabled:!l})))),t.fill_method.type==="value"&&ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the dataframe to fill nan values in."},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Fill Value")),ye.default.createElement(C,null,ye.default.createElement(ne,{autoFocus:!0,width:"medium",value:""+t.fill_method.value,onChange:d=>{let u=d.target.value;n(c=>f(m({},c),{fill_method:{type:"value",value:u}}))}}))),ye.default.createElement(se,{px:10+(t.fill_method.type==="value"?0:38)}),ye.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{o(d=>{if(d.fill_method.type==="value"&&typeof d.fill_method.value=="string"){let u=d.fill_method.value;return D9.includes(u)?u=!!u.toLowerCase().startsWith("t"):U2(d.fill_method.value)&&(u=parseFloat(d.fill_method.value)),f(m({},d),{fill_method:{type:"value",value:u}})}return d})},disabled:t.column_ids.length===0,disabledTooltip:"Select at least one column to fill NaN values in"},v9(a,t.column_ids)),i&&!r&&ye.default.createElement(I,{className:"mt-5"},ye.default.createElement("p",{className:"text-subtext-1"},P9(a,t.column_ids)))))},MS=b9;var ke=T(_());var fi=T(_());function E9(e){let t=n=>{e.setSelectedGraphSidebarTab(n),e.mitoAPI.log("clicked_graph_"+n+"_tab")};return fi.default.createElement("div",{className:"graph-sidebar-tab-container"},fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="setup"?"selected":"unselected"),onClick:()=>t("setup")},fi.default.createElement("p",null,"Setup")),fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="style"?"selected":"unselected"),onClick:()=>t("style")},fi.default.createElement("p",null,"Style")),fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="export"?"selected":"unselected"),onClick:()=>t("export")},fi.default.createElement("p",null,"Export")))}var OS=E9;var Jm=T(_());function $1(){let e=[...Array(12)].map((t,n)=>Jm.default.createElement("div",{key:n},Jm.default.createElement("div",{className:"div-after",style:{background:"#7f58af"}})));return Jm.default.createElement("div",{className:"lds-spinner"},e)}var O=T(_());function A9(e){var o;let t=e.graphParams.graphCreation,n=e.graphParams.graphStyling;function r(i){e.setGraphParams(a=>jt(a,i)),e.setGraphUpdatedNumber(a=>a+1)}return O.default.createElement("div",{className:"graph-sidebar-toolbar-content"},O.default.createElement(je,{title:"Titles"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Graph Title")),O.default.createElement(ne,{value:n.title.title||"",placeholder:"Default Graph Title",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{title:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"X Axis Title")),O.default.createElement(ne,{value:n.xaxis.title||"",placeholder:"Default X Axis",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{xaxis:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Y Axis Title")),O.default.createElement(ne,{value:n.yaxis.title||"",placeholder:"Default Y Axis",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{yaxis:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Title")),O.default.createElement(Ut,{value:n.title.visible,onChange:()=>r({graphStyling:{title:{visible:!n.title.visible}}})})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display X Axis Title")),O.default.createElement(Ut,{value:n.xaxis.visible,onChange:()=>r({graphStyling:{xaxis:{visible:!n.xaxis.visible}}})})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Y Axis Title")),O.default.createElement(Ut,{value:n.yaxis.visible,onChange:()=>r({graphStyling:{yaxis:{visible:!n.yaxis.visible}}})}))),O.default.createElement(je,{title:"Axis Transformations"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"X Axis Transform")),O.default.createElement($,{value:e.graphParams.graphStyling.xaxis.type||"default",onChange:i=>r({graphStyling:{xaxis:{type:i!=="default"?i:void 0}}}),width:"small",dropdownWidth:"medium"},O.default.createElement(v,{title:"default"}),O.default.createElement(v,{title:"linear"}),O.default.createElement(v,{title:"log"}),O.default.createElement(v,{title:"date"}),O.default.createElement(v,{title:"category"}))),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Y Axis Transform")),O.default.createElement($,{value:e.graphParams.graphStyling.yaxis.type||"default",onChange:i=>r({graphStyling:{yaxis:{type:i!=="default"?i:void 0}}}),width:"small",dropdownWidth:"medium"},O.default.createElement(v,{title:"default"}),O.default.createElement(v,{title:"linear"}),O.default.createElement(v,{title:"log"}),O.default.createElement(v,{title:"date"}),O.default.createElement(v,{title:"category"})))),O.default.createElement(je,{title:"Legend",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to customize the legend? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"Title of legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Legend")),O.default.createElement(Ut,{value:n.showlegend,onChange:()=>r({graphStyling:{showlegend:!n.showlegend}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"Display the legend vertically or horizontally"},O.default.createElement(C,null,O.default.createElement("p",null,"Orientation")),O.default.createElement($,{value:n.legend.orientation==="v"?"vertical":"horiztonal",width:"medium",onChange:i=>r({graphStyling:{legend:{orientation:i}}})},O.default.createElement(v,{title:"vertical",id:"v"}),O.default.createElement(v,{title:"horizontal",id:"h"}))),O.default.createElement(I,{justify:"space-between",align:"center",title:"Title of legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Legend title")),O.default.createElement(ne,{value:(o=n.legend.title)!=null&&o.text?n.legend.title.text:"",width:"medium",placeholder:"Legend title",onChange:i=>{let a=i.target.value;return r({graphStyling:{legend:{title:{text:a}}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The x position of the legend"},O.default.createElement(C,null,O.default.createElement("p",null,"X position (-2 to 3)")),O.default.createElement(ne,{value:n.legend.x?n.legend.x.toString():"",type:"number",width:"small",placeholder:n.legend.orientation==="v"?"1.02":"0.00",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{legend:{x:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The y position of the legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Y position (-2 to 3)")),O.default.createElement(ne,{value:n.legend.y?n.legend.y.toString():"",type:"number",width:"small",placeholder:n.legend.orientation==="v"?"1.00":n.xaxis.rangeslider.visible?"1.10":"-0.10",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{legend:{y:a}}})}})))),O.default.createElement(je,{title:"Grid Lines",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to customize the grid lines? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"Turn on/off vertical grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Show vertical grid")),O.default.createElement(Ut,{value:n.xaxis.showgrid,onChange:()=>r({graphStyling:{xaxis:{showgrid:!n.xaxis.showgrid}}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"Turn on/off horiztonal grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Show horizontal grid")),O.default.createElement(Ut,{value:n.yaxis.showgrid,onChange:()=>r({graphStyling:{yaxis:{showgrid:!n.yaxis.showgrid}}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The width of the vertical grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Vertical grid width")),O.default.createElement(ne,{value:n.xaxis.gridwidth?n.xaxis.gridwidth.toString():"",type:"number",width:"small",placeholder:"1",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{xaxis:{gridwidth:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The width of the horizontal grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Horizontal grid width")),O.default.createElement(ne,{value:n.yaxis.gridwidth?n.yaxis.gridwidth.toString():"",type:"number",width:"small",placeholder:"1",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{yaxis:{gridwidth:a}}})}})))),O.default.createElement(je,{title:"Colors",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to set the colors of your graph? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(Xt,{label:"Plot Background Color",color:n.plot_bgcolor,onChange:i=>r({graphStyling:{plot_bgcolor:i}})}),O.default.createElement(Xt,{label:"Paper Background Color",color:n.paper_bgcolor,onChange:i=>r({graphStyling:{paper_bgcolor:i}})}),O.default.createElement(Xt,{label:"Title color",color:n.title.title_font_color,onChange:i=>r({graphStyling:{title:{title_font_color:i}}})}),O.default.createElement(Xt,{label:"X axis title color",color:n.xaxis.title_font_color,onChange:i=>r({graphStyling:{xaxis:{title_font_color:i}}})}),O.default.createElement(Xt,{label:"Y axis title color",color:n.yaxis.title_font_color,onChange:i=>r({graphStyling:{yaxis:{title_font_color:i}}})}))),O.default.createElement(je,{title:"Facet Styling",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to style facet plots? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"The number of plots to display per row. Has no effect when facet row is used."},O.default.createElement(C,null,O.default.createElement("p",null,"Number of cols (int)")),O.default.createElement(ne,{value:t.facet_col_wrap?t.facet_col_wrap.toString():"",type:"number",width:"small",placeholder:"num cols",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_col_wrap:a}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The spacing between columns of facet plots. Set as a fraction of plotting area."},O.default.createElement(C,null,O.default.createElement("p",null,"Column spacing (0 to 1)")),O.default.createElement(ne,{value:t.facet_col_spacing?t.facet_col_spacing.toString():"",type:"number",width:"small",placeholder:".03",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_col_spacing:a}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The spacing between rows of facet plots. Set as a fraction of plotting area."},O.default.createElement(C,null,O.default.createElement("p",null,"Row spacing (0 to 1)")),O.default.createElement(ne,{value:t.facet_row_spacing?t.facet_row_spacing.toString():"",type:"number",width:"small",placeholder:".07",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_row_spacing:a}})}})))),O.default.createElement(je,{title:"Range slider"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display range slider")),O.default.createElement(Ut,{value:n.xaxis.rangeslider.visible,onChange:()=>r({graphStyling:{xaxis:{rangeslider:{visible:!n.xaxis.rangeslider.visible}}}})}))))}var FS=A9;var bn=T(_());var ms=T(_());var Z1=(e,t=2500)=>{let[n,r]=(0,ms.useState)(!1),o=(0,ms.useCallback)(()=>{e!=null&&rs(e).then(()=>{r(!0)},()=>{r(!1)})},[e]);return(0,ms.useEffect)(()=>{if(!n)return;let i=setTimeout(()=>{r(!1)},t);return()=>clearTimeout(i)},[n]),[o,n]};function k9(e){var s,l;let[t,n]=Z1((((s=e.graphOutput)==null?void 0:s.graphGeneratedCode)||"")+` +`)),e.mitoAPI.log("code_snippet_written_to_cell",{code_snippet_name:d.Name})},h=ii,x=(D=e.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS)==null?void 0:D.MITO_CONFIG_CODE_SNIPPETS_SUPPORT_EMAIL;return x!=null&&(h=`mailto:${x}?subject=Mito Code Snippet Support. Snippet Name: "${d.Name}" Snippet ID: "${d.Id}"`),We.default.createElement(I,{key:u,align:"center",className:M("highlight-on-hover",Ha),justify:"space-between",onClick:()=>{i(S=>{if(S!==u)return u})}},We.default.createElement(C,{offsetRight:.5},We.default.createElement(Fm,null)),We.default.createElement(C,{span:20},We.default.createElement("div",{className:"text-bold"},d.Name),We.default.createElement("div",{className:"text-overflow-wrap pb-5px"},d.Description)),We.default.createElement(C,{offset:2},We.default.createElement(Z5,null)),We.default.createElement(C,null,We.default.createElement(pe,{display:u===o,width:"medium",closeDropdown:()=>{i(void 0)}},We.default.createElement(v,{title:"Copy Code Snippet",onClick:c}),We.default.createElement(v,{title:"Write to Notebook",onClick:p}),We.default.createElement(v,{title:"Get Support",onClick:()=>{var S;window.open(h),(S=e.mitoAPI)==null||S.log("clicked_code_snippet_get_support_button")}}))))}),t===void 0&&We.default.createElement("p",{className:"mt-20px"},"Loading code snippets ",We.default.createElement(Yo,null))))},Y5=Ax;var Rr=T(_());var ct=T(_());var rr=T(_());function kx(e,t,n,r,o,i){let[a,s]=(0,rr.useState)(e),[l,d]=(0,rr.useState)(void 0),[u,c]=(0,rr.useState)(!1),[p,h]=(0,rr.useState)(!1),[x,D]=(0,rr.useState)({stepIDs:[],currStepIDIndex:0}),[S,g]=(0,rr.useState)(!1),[y,w]=(0,rr.useState)(!1);Om(()=>{k()},r),Mm(()=>{L()},r),(0,rr.useEffect)(()=>{if(p){let b=setTimeout(()=>{h(!1)},2e3);return()=>clearTimeout(b)}},[p]);let P=t+"_edit",N=(0,rr.useCallback)(b=>{s(b),g(!1),w(!1)},[]),A=async b=>{if(a===void 0)return;if(!(o!=null&&o.allowSameParamsToReapplyTwice)&&S){w(!0);return}let F=b?b(a):a;c(!0);let J=me();(o==null?void 0:o.overwiteStepIfClickedMultipleTimes)&&x.stepIDs.length>0&&(J=x.stepIDs[x.stepIDs.length-1]);let K=await n._edit(P,F,J);c(!1),"error"in K?d(K.error):(D(W=>{let z={stepIDs:[...W.stepIDs],currStepIDIndex:W.currStepIDIndex};return z.stepIDs.splice(z.currStepIDIndex+1,z.stepIDs.length),z.stepIDs.push(J),z.currStepIDIndex=z.stepIDs.length-1,z}),d(void 0),g(!0),h(!0))},k=async()=>{let b=x.stepIDs[x.currStepIDIndex-1];D(K=>{let W={stepIDs:[...K.stepIDs],currStepIDIndex:K.currStepIDIndex};return W.currStepIDIndex-=1,W});let F=await n.getParams(t,b,{}),J="error"in F?void 0:F.result;J!==void 0?((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(J),i!==void 0&&i(J)):((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(e),g(!1),i!==void 0&&i(e())),d(void 0)},L=async()=>{let b=x.stepIDs[x.currStepIDIndex+1];D(K=>{let W={stepIDs:[...K.stepIDs],currStepIDIndex:K.currStepIDIndex};return W.currStepIDIndex+=1,W});let F=await n.getParams(t,b,{}),J="error"in F?void 0:F.result;J!==void 0&&((o==null?void 0:o.doNotRefreshParamsOnUndoAndRedo)!==!0&&s(J),i!==void 0&&i(J),g(!0)),d(void 0)},E;return S&&r.stepSummaryList[r.stepSummaryList.length-1].step_type===t&&(E=r.lastResult),{params:a,setParams:N,error:l,loading:u,edit:A,editApplied:S,attemptedEditWithTheseParamsMultipleTimes:y,result:E,appliedEditInLastTwoSeconds:p}}var wt=kx;var Nx=e=>{let{params:t,setParams:n,edit:r}=wt(()=>({sheet_index:e.selectedSheetIndex,transformation:{type:"replace",old:"",new:""}}),"column_headers_transform",e.mitoAPI,e.analysisData);return(0,ct.useEffect)(()=>{n(o=>o===void 0?o:{sheet_index:e.selectedSheetIndex,transformation:o.transformation})},[e.selectedSheetIndex]),t===void 0?ct.default.createElement(ct.default.Fragment,null):ct.default.createElement(ct.default.Fragment,null,ct.default.createElement(I,{justify:"start",align:"center"},ct.default.createElement(C,null,ct.default.createElement(de,{tooltip:"Find and replace in all string column headers."},"Find and Replace in Column Headers"))),ct.default.createElement(I,{justify:"space-between",align:"center"},ct.default.createElement(C,null,ct.default.createElement("p",null,"Find")),ct.default.createElement(C,null,ct.default.createElement(ne,{value:t.transformation.type==="replace"?t.transformation.old:"",onChange:o=>{let i=m({},t);i.transformation={type:"replace",old:o.target.value,new:t.transformation.type==="replace"?t.transformation.new:""},n(i)}}))),ct.default.createElement(I,{justify:"space-between",align:"center"},ct.default.createElement(C,null,ct.default.createElement("p",null,"Replace")),ct.default.createElement(C,null,ct.default.createElement(ne,{value:t.transformation.type==="replace"?t.transformation.new:"",onChange:o=>{let i=m({},t);i.transformation={type:"replace",old:t.transformation.type==="replace"?t.transformation.old:"",new:o.target.value},n(i)}}))),ct.default.createElement(I,null,ct.default.createElement(j,{disabled:t.transformation.type!=="replace",variant:"dark",onClick:()=>{r()}},"Replace in ",e.numHeaders," Headers")))},q5=Nx;var Mx=e=>{let t=e.sheetDataArray[e.selectedSheetIndex];if(t===void 0)return Rr.default.createElement(ge,{setUIState:e.setUIState});let n=t.data.length;return Rr.default.createElement(Y,null,Rr.default.createElement(Q,{header:"Column Headers Transformations",setUIState:e.setUIState}),Rr.default.createElement(q,{requiresPro:{featureName:"column_headers_transform",mitoAPI:e.mitoAPI},userProfile:e.userProfile},Rr.default.createElement(I,null,Rr.default.createElement(j,{variant:"dark",onClick:()=>{e.mitoAPI.editColumnHeadersTransform({sheet_index:e.selectedSheetIndex,transformation:{type:"uppercase"}})}},"Uppercase ",n," Headers")),Rr.default.createElement(I,null,Rr.default.createElement(j,{variant:"dark",onClick:()=>{e.mitoAPI.editColumnHeadersTransform({sheet_index:e.selectedSheetIndex,transformation:{type:"lowercase"}})}},"Lowercase ",n," Headers")),Rr.default.createElement(q5,{mitoAPI:e.mitoAPI,userProfile:e.userProfile,analysisData:e.analysisData,selectedSheetIndex:e.selectedSheetIndex,numHeaders:n})))},Q5=Mx;var xe=T(_());var Ox=(e,t)=>{if(e[t].length===0)return xe.default.createElement("p",null,"\u2713 All columns are included in the concatenated sheet.");let[n,r]=Jo(e[t],25);return r===0?xe.default.createElement("p",null,"Columns ",xe.default.createElement("span",{className:"text-color-gray-important"},n)," are not included."):xe.default.createElement("p",null,"Columns ",xe.default.createElement("span",{className:"text-color-gray-important"},n)," and ",xe.default.createElement("span",{className:"text-color-gray-important"},r)," others are not included.")},Fx=e=>{var s;let{params:t,setParams:n}=Dn({join:"inner",ignore_index:!0,sheet_indexes:[]},"concat",e.mitoAPI,e.analysisData,50),[r]=(0,xe.useState)(e.sheetDataArray.map((l,d)=>d)),o=Object.values(((s=e.sheetDataArray[e.sheetDataArray.length-1])==null?void 0:s.columnIDsMap)||{}),i=t==null?void 0:t.sheet_indexes.map(l=>{var d;return Object.values(((d=e.sheetDataArray[l])==null?void 0:d.columnIDsMap)||{}).filter(u=>!o.includes(u))});if(t===void 0)return xe.default.createElement(ge,{setUIState:e.setUIState,message:"Import at least two datasets before concating."});let a=t.sheet_indexes.map((l,d)=>xe.default.createElement("div",{key:d},xe.default.createElement(Nr,{titleMap:Object.fromEntries(e.sheetDataArray.map((u,c)=>[c+"",u.dfName])),value:l+"",onChange:u=>{let c=parseInt(u);n(p=>{let h=[...p.sheet_indexes];return h[d]=c,f(m({},p),{sheet_indexes:h})})},onDelete:()=>{n(u=>{let c=[...u.sheet_indexes];return c.splice(d,1),f(m({},u),{sheet_indexes:c})})},selectableValues:Object.keys(e.sheetDataArray)}),i!==void 0&&xe.default.createElement(I,{className:"text-subtext-1"},Ox(i,d))));return xe.default.createElement(Y,null,xe.default.createElement(Q,{header:"Concatenate Sheet",setUIState:e.setUIState}),xe.default.createElement(q,null,xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement("p",{className:"text-header-3"},"Join Type")),xe.default.createElement(C,null,xe.default.createElement($,{value:t.join,onChange:l=>{n(d=>f(m({},d),{join:l}))},width:"medium"},xe.default.createElement(v,{title:"inner",subtext:"Only includes columns that exist in all sheets"}),xe.default.createElement(v,{title:"outer",subtext:"Includes all columns from all sheets, regardless of if these columns are in the other sheets."})))),xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement(de,{tooltip:"When on, the resulting dataframe will have indexes 0, 1, 2, etc.. This is useful if you're concatenating objects that don't have meaningful index information."},"Ignore Existing Indexes")),xe.default.createElement(C,null,xe.default.createElement(Ut,{value:t.ignore_index,onChange:()=>{n(l=>f(m({},l),{ignore_index:!l.ignore_index}))}}))),xe.default.createElement(I,{justify:"space-between",align:"center"},xe.default.createElement(C,null,xe.default.createElement("p",{className:"text-header-3"},"Dataframes to Concatenate")),xe.default.createElement(C,null,xe.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},[xe.default.createElement(v,{key:-1,title:"Add all sheets",onClick:()=>{n(l=>{let d=[...r];return f(m({},l),{sheet_indexes:d})})}})].concat(e.sheetDataArray.filter((l,d)=>!!r.includes(d)).map((l,d)=>xe.default.createElement(v,{key:d,title:l.dfName,onClick:()=>{n(u=>{let c=[...u.sheet_indexes];return c.push(d),f(m({},u),{sheet_indexes:c})})}})))))),a))},eS=Fx;var nS=T(_());var un=T(_());var Lx=e=>e.df_names.length===0?"Select dataframes to import them":`Import ${e.df_names.length} Selected dataframe${e.df_names.length===1?"":"s"}`,Ux=e=>{var r,o;let[t]=ln([],async()=>{let i=await e.mitoAPI.getDefinedDfNames();return"error"in i?void 0:i.result},void 0,[]),n=(((r=e.params)==null?void 0:r.df_names)||[]).map((i,a)=>un.default.createElement(Nr,{key:a,value:i,onChange:s=>{e.setParams(l=>{let d=[...l.df_names];return d[a]=s,f(m({},l),{df_names:d})})},onDelete:()=>{e.setParams(s=>{let l=[...s.df_names];return l.splice(a,1),f(m({},s),{df_names:l})})},selectableValues:t}));return e.params===void 0?un.default.createElement("div",{className:"text-body-1"},"There has been an error loading dataframes to import. Please try again, or contact support."):un.default.createElement(Y,null,un.default.createElement(Q,{header:e.isUpdate?"Import Dataframes":"Update Import",setUIState:e.setUIState,backCallback:e.backCallback}),un.default.createElement(q,null,un.default.createElement(I,{justify:"space-between",align:"center"},un.default.createElement(C,null,un.default.createElement(de,{tooltip:"Dataframes that have been created elsewhere in this notebook can be imported through this taskpane."},"Dataframes to Import")),un.default.createElement(C,null,un.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},t.map((i,a)=>un.default.createElement(v,{key:a,title:i,onClick:()=>{e.setParams(s=>{let l=[...s.df_names];return l.push(i),f(m({},s),{df_names:l})})}}))))),n,n.length===0&&un.default.createElement(I,null,un.default.createElement("p",{className:"text-subtext-1"},"Import an existing dataframe as a new sheet tab in Mito"))),un.default.createElement(Me,null,un.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},disabled:(((o=e.params)==null?void 0:o.df_names.length)||0)===0},Lx(e.params))))},tS=Ux;var Bx=e=>{let{params:t,setParams:n,edit:r}=wt(()=>({df_names:[]}),"dataframe_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return nS.default.createElement(tS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!1,params:t,setParams:n,edit:r})},rS=Bx;var Xe=T(_());var Co=T(_());var O1=T(_()),Hx=e=>O1.default.createElement(O1.default.Fragment,null,"Excel formatting export coming soon!"),oS=Hx;var F1=T(_());var Gx=e=>{let t=[...e.selectedSheetIndexes].sort();return F1.default.createElement(Gr,{width:"block",height:e.height||"small",onToggleAll:n=>{n.sort(),e.onChange(n)}},e.sheetDataArray.map((n,r)=>{let o=n.dfName;return F1.default.createElement(hr,{key:r,title:o,toggled:t.includes(r),index:r,onToggle:()=>{let i=[...t];br(i,r),i.sort(),e.onChange(i)}})}))},Lm=Gx;var Vx=e=>Co.default.createElement(Co.default.Fragment,null,Co.default.createElement("p",{className:"text-header-3"},"Dataframes to Export"),Co.default.createElement(Lm,{sheetDataArray:e.sheetDataArray,selectedSheetIndexes:e.exportState.sheetIndexes,setUIState:e.setUIState,onChange:t=>{e.setUIState(n=>f(m({},n),{exportConfiguration:{exportType:"excel",sheetIndexes:t}}))}}),e.userProfile.isPro&&Co.default.createElement(oS,{dfNames:e.dfNames,mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,exportState:e.exportState,newlyFormattedColumns:e.newlyFormattedColumns,setNewlyFormattedColumns:e.setNewlyFormattedColumns}),!e.userProfile.isPro&&Co.default.createElement(I,{justify:"space-around"},Co.default.createElement("p",{className:"ma-25px text-align-center text-body-1"},"Want to preserving your formatting when exporting to Excel? Consider upgrading to\xA0",Co.default.createElement("a",{onClick:()=>void e.mitoAPI.log("clicked_pro_button",{pro_button_location:"download_taskpane_excel_format_export"}),className:"text-body-1-link",href:"https://www.trymito.io/plans",target:"_blank",rel:"noreferrer"},"Mito Pro"),"."))),iS=Vx;var as=T(_());var jx=e=>as.default.createElement(as.default.Fragment,null,as.default.createElement(Lt,{title:"Dataframe to Export",sheetDataArray:e.sheetDataArray,sheetIndex:e.selectedSheetIndex,onChange:t=>{e.setUIState(n=>f(m({},n),{selectedSheetIndex:t,exportConfiguration:{exportType:"csv"}}))}}),as.default.createElement(I,{justify:"space-around"},as.default.createElement("p",{className:"ma-25px text-align-center"},"CSV exports will not reflect any formatting changes made in Mito."))),aS=jx;var Rx=["\\","/","<",">",":",'"',"|","?","*"],Wx=e=>{var h,x;let[t,n]=(0,Xe.useState)(()=>{let D={};return e.sheetDataArray.forEach((S,g)=>{D[g]=[]}),D}),[r,o]=(0,Xe.useState)(""),i=e.sheetDataArray.length===0,a=(h=e.sheetDataArray[e.selectedSheetIndex])==null?void 0:h.numRows,s=async()=>{if(!i){if(e.uiState.exportConfiguration.exportType==="csv"){let D=await e.mitoAPI.getDataframeAsCSV(e.selectedSheetIndex),S="error"in D?"":D.result;o(S)}else if(e.uiState.exportConfiguration.exportType==="excel"){let D=await e.mitoAPI.getDataframesAsExcel(e.uiState.exportConfiguration.sheetIndexes),S="error"in D?"":D.result;o(S)}}};on(()=>{o(""),s()},[e.uiState.exportConfiguration,e.selectedSheetIndex,e.sheetDataArray],500);let l=()=>{e.mitoAPI.log("button_download_log_event",{sheet_index:e.selectedSheetIndex,export_type:e.uiState.exportConfiguration.exportType})};if(i)return Xe.default.createElement(ge,{setUIState:e.setUIState});let d="",u="",c=e.uiState.exportConfiguration.fileName;(!c||c==="")&&(c="MitoExport"),e.uiState.exportConfiguration.exportType==="csv"?(d=URL.createObjectURL(new Blob([r],{type:"text/csv"})),u=`${c}.csv`):e.uiState.exportConfiguration.exportType==="excel"&&(d=URL.createObjectURL(new Blob([Uint8Array.from(window.atob(r),D=>D.charCodeAt(0))],{type:"text/csv"})),u=`${c}.xlsx`);let p;return Rx.forEach(D=>{var S;(S=e.uiState.exportConfiguration.fileName)!=null&&S.includes(D)&&(p=`The File Name cannot include ${D}`)}),Xe.default.createElement(Y,null,Xe.default.createElement(Q,{header:"Download",setUIState:e.setUIState}),Xe.default.createElement(q,null,Xe.default.createElement("div",null,Xe.default.createElement(I,{justify:"space-between",align:"center"},Xe.default.createElement("p",{className:"text-header-3"},"Export Type"),Xe.default.createElement($,{width:"medium",value:e.uiState.exportConfiguration.exportType,onChange:D=>{o(""),e.setUIState(S=>D==="csv"?f(m({},S),{exportConfiguration:{exportType:"csv"}}):f(m({},S),{exportConfiguration:{exportType:"excel",sheetIndexes:[e.selectedSheetIndex]}}))}},Xe.default.createElement(v,{title:"csv"}),Xe.default.createElement(v,{title:"excel",subtext:a>1048576?`An Excel file holds at most 1,048,576 rows, but there are ${a} rows in this dataframe. We'll export the first 1,048,576 rows, but this may take several minutes.`:"Due to Python limitations, Excel export can be slower than CSV export."}))),Xe.default.createElement(I,{justify:"space-between",align:"center"},Xe.default.createElement("p",{className:"text-header-3"},"File Name"),Xe.default.createElement(ne,{width:"medium",value:(x=e.uiState.exportConfiguration.fileName)!=null?x:"",onChange:D=>{e.setUIState(S=>f(m({},S),{exportConfiguration:f(m({},S.exportConfiguration),{fileName:D.target.value})}))},placeholder:"MitoExport"})),p!==void 0&&Xe.default.createElement(I,{justify:"end",align:"end"}," ",Xe.default.createElement("p",{className:"text-color-error"},p)," "),e.uiState.exportConfiguration.exportType==="excel"&&Xe.default.createElement(iS,{dfNames:e.dfNames,mitoAPI:e.mitoAPI,userProfile:e.userProfile,sheetDataArray:e.sheetDataArray,exportState:e.uiState.exportConfiguration,setUIState:e.setUIState,newlyFormattedColumns:t,setNewlyFormattedColumns:n}),e.uiState.exportConfiguration.exportType==="csv"&&Xe.default.createElement(aS,{sheetDataArray:e.sheetDataArray,mitoAPI:e.mitoAPI,selectedSheetIndex:e.selectedSheetIndex,setUIState:e.setUIState}))),Xe.default.createElement(Me,null,Xe.default.createElement(j,{variant:"dark",width:"block",disabled:r==="",href:d,download:u,onClick:l},r===""?Xe.default.createElement(Xe.default.Fragment,null,"Preparing data for download ",Xe.default.createElement(Yo,null)):`Download ${e.uiState.exportConfiguration.exportType==="csv"?"CSV file":"Excel workbook"}`)))},sS=Wx;var ft=T(_());var Xx=(e,t)=>{var n;if(t.length!==0)return{sheet_index:e,column_ids:Object.keys((n=t[e])==null?void 0:n.columnIDsMap),keep:"first"}},Jx=e=>{let{params:t,setParams:n,loading:r,edit:o,editApplied:i,attemptedEditWithTheseParamsMultipleTimes:a,result:s}=wt(()=>Xx(e.selectedSheetIndex,e.sheetDataArray),"drop_duplicates",e.mitoAPI,e.analysisData);return e.sheetDataArray.length===0||t===void 0?ft.default.createElement(ge,{setUIState:e.setUIState}):e.sheetDataArray[t.sheet_index]===void 0?(e.setUIState(l=>f(m({},l),{currOpenTaskpane:{type:"none"}})),ft.default.createElement(ge,{setUIState:e.setUIState})):ft.default.createElement(Y,null,ft.default.createElement(Q,{header:"Drop Duplicates",setUIState:e.setUIState}),ft.default.createElement(q,null,ft.default.createElement(Lt,{title:"Dataframe to drop duplicates within.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:l=>{n(d=>f(m({},d),{sheet_index:l,column_ids:e.sheetDataArray[l].data.map(u=>u.columnID)})),e.setUIState(d=>f(m({},d),{selectedSheetIndex:l}))}}),ft.default.createElement(I,{justify:"space-between",align:"center"},ft.default.createElement(C,null,ft.default.createElement("p",{className:"text-header-3"},"Duplicates to Keep")),ft.default.createElement(C,null,ft.default.createElement($,{width:"medium",value:t.keep+"",onChange:l=>{l==="false"&&(l=!1),n(d=>f(m({},d),{keep:l}))}},ft.default.createElement(v,{title:"first",subtext:"Keep the first instance of the duplicated row."}),ft.default.createElement(v,{title:"last",subtext:"Keep the last instance of the duplicated row."}),ft.default.createElement(v,{id:"false",title:"none",subtext:"Keep none of the duplicated rows."})))),ft.default.createElement("p",{className:"text-header-3 mt-10px"},"Columns to Deduplicate On"),ft.default.createElement(tr,{sheetData:e.sheetDataArray[t.sheet_index],selectedColumnIDs:t.column_ids,onChange:l=>{n(d=>f(m({},d),{column_ids:l}))}}),ft.default.createElement(se,{px:25}),ft.default.createElement(j,{variant:"dark",width:"block",onClick:()=>o(),disabled:!1},r?"Dropping duplicates...":`Drop duplicates in ${t.column_ids.length} columns`),i&&!r&&ft.default.createElement(I,{className:"mt-5"},ft.default.createElement("p",{className:"text-subtext-1"},"Removed ",ft.default.createElement("span",{className:"text-color-gray-important"},a?0:(s==null?void 0:s.num_rows_dropped)||0)," rows."))))},lS=Jx;var Pe=T(_());var li=T(_());var mn=T(_());function zx(e){let t=e.conditionOptions[e.condition.type].title,n=e.conditionOptions[e.condition.type].subtext,r=e.conditionOptions[e.condition.type].placeholderValue;return mn.default.createElement(mn.default.Fragment,null,mn.default.createElement(I,{justify:"space-between",align:"center"},mn.default.createElement(C,null,mn.default.createElement("p",{className:"text-body-1"},e.title)),mn.default.createElement(C,null,mn.default.createElement($,{width:"medium",value:e.condition.type,onChange:o=>{let i=o,a=f(m({},e.condition),{type:i});e.conditionOptions[i].placeholderValue!==void 0?a.value="":"value"in a&&delete a.value,e.setCondition(a)}},Object.entries(e.conditionOptions).map(([o,i])=>mn.default.createElement(v,{title:i.title,id:o,subtext:i.subtext,key:o}))))),"value"in e.condition&&mn.default.createElement(mn.default.Fragment,null,mn.default.createElement(I,{justify:"space-between",align:"center"},mn.default.createElement(C,null,mn.default.createElement(de,{textBody:!0,tooltip:n},t)),mn.default.createElement(C,null,mn.default.createElement(ne,{width:"medium",placeholder:r,value:""+e.condition.value,onChange:o=>{let i=o.target.value;e.setCondition(f(m({},e.condition),{value:i}))}})))))}var Um=zx;var Kx=e=>{let t=e.rangeImport;return li.default.createElement(li.default.Fragment,null,li.default.createElement(Um,{title:"Starting Row Condition",condition:t.start_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.start_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"upper left corner value":{title:"Top Left Corner Value",subtext:"Mito will search for this exact value (including whitespace).",placeholderValue:"start value"},"upper left corner value starts with":{title:"Top Left Corner Starts With",subtext:"Mito will search for a cell that starts with this value.",placeholderValue:"start value"},"upper left corner value contains":{title:"Top Left Corner Contains",subtext:"Mito will search for a cell that contains this value.",placeholderValue:"start value"}}}),li.default.createElement(se,{px:10,seperatingLine:!0}),li.default.createElement(Um,{title:"Ending Row Condition",condition:t.end_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.end_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"first empty cell":{title:"First Empty Cell",subtext:"Mito will take all rows until it hits an empty cell in the first column."},"bottom left corner value":{title:"Bottom Left Corner Value",subtext:"Mito will take all rows until it finds this exact value (including whitespace) in the first column.",placeholderValue:"end value"},"bottom left corner value starts with":{title:"Bottom Left Corner Starts With",subtext:"Mito will take all rows until it finds a cell that starts with this value in the first column.",placeholderValue:"end value"},"bottom left corner value contains":{title:"Bottom Left Corner Contains",subtext:"Mito will take all rows until it finds a cell that contains with this value in the first column.",placeholderValue:"end value"},"bottom left corner consecutive empty cells":{title:"Number of Empty Cells in Row",subtext:"Mito will take all rows until it finds a row with at least this number of empty cells.",placeholderValue:"4"},"bottom left corner consecutive empty cells in first column":{title:"Consecutive Empty in Column",subtext:"Mito will take all rows until the first column has this number of empty cells in a row.",placeholderValue:"4"},"row entirely empty":{title:"Row Entirely Empty",subtext:"Mito will take all rows unitl it finds a row where all the columns have empty values."},"cumulative number of empty rows":{title:"Cumulative # of Empty Rows",subtext:"Mito will take all rows unitl it finds this number of empty rows. They do not need to be consecutive.",placeholderValue:"4"}}}),li.default.createElement(se,{px:10,seperatingLine:!0}),li.default.createElement(Um,{title:"Ending Column Condition",condition:t.column_end_condition,setCondition:n=>{e.setParams(r=>{let o=window.structuredClone(r.range_imports),i=window.structuredClone(t);return i.column_end_condition=n,o[e.index]=i,f(m({},r),{range_imports:o})})},conditionOptions:{"first empty cell":{title:"First Empty Cell",subtext:"Mito will continue take all columns until it hits an empty cell in the first row."},"num columns":{title:"Number of Columns",subtext:"Mito will take this number of columns.",placeholderValue:"4"}}}))},dS=Kx;var di=T(_());var $x=e=>{let t=e.rangeImport;return di.default.createElement(di.default.Fragment,null,di.default.createElement(I,{justify:"space-between",align:"center"},di.default.createElement(C,null,di.default.createElement(de,{textBody:!0,tooltip:"The proper format is COLUMNROW:COLUMNROW. For example, A1:B10, C10:G1000."},"Excel Range")),di.default.createElement(C,null,di.default.createElement(ne,{width:"medium",placeholder:"A10:C100",value:""+t.value,onChange:n=>{let r=n.target.value;e.setParams(o=>{let i=window.structuredClone(o.range_imports),a=window.structuredClone(t);return a.value=r,i[e.index]=a,f(m({},o),{range_imports:i})})}}))))},uS=$x;var Je=T(_());function Zx(e){let t=e.params,n=e.setParams,r=e.sheet_name;return Je.default.createElement(Je.default.Fragment,null,Je.default.createElement(je,{title:"Select Sheet"},Je.default.createElement(I,{justify:"space-between",align:"center"},Je.default.createElement(C,null,Je.default.createElement("p",{className:"text-header-3"},"Select Sheet By")),Je.default.createElement(C,null,Je.default.createElement($,{width:"medium",value:t.sheet.type,onChange:o=>{let i=m({},t);i.sheet.type=o,o==="sheet name"?i.sheet.value=e.sheet_names[0]:i.sheet.value=0,n(i)}},Je.default.createElement(v,{title:"Sheet Name",id:"sheet name",subtext:"Select a sheet by name to import multiple ranges from."}),Je.default.createElement(v,{title:"Sheet Index",id:"sheet index",subtext:"Select a sheet by index in the Excel file. Use a negative index to count backwards from the end of the sheet list"})))),t.sheet.type==="sheet name"&&Je.default.createElement(I,{justify:"space-between",align:"center"},Je.default.createElement(C,null,Je.default.createElement("p",{className:"text-header-3"},"Sheet Name")),Je.default.createElement(C,null,Je.default.createElement($,{width:"medium",value:t.sheet.value,onChange:o=>{let i=m({},t);i.sheet.value=o,n(i)}},e.sheet_names.map((o,i)=>Je.default.createElement(v,{title:o,key:i}))))),t.sheet.type==="sheet index"&&Je.default.createElement(Je.default.Fragment,null,Je.default.createElement(I,{justify:"space-between",align:"center"},Je.default.createElement(C,null,Je.default.createElement("p",{className:"text-header-3"},"Sheet Index")),Je.default.createElement(C,null,Je.default.createElement(ne,{width:"medium",type:"number",value:""+t.sheet.value,onChange:o=>{let i=o.target.value,a=parseInt(i);isNaN(a)||(i=a);let s=m({},t);s.sheet.value=i,n(s)}}))),Je.default.createElement("p",{className:"text-subtext-1"},r!==void 0&&`${r} is selected.`,r===void 0&&"No sheet is selected. The index is out of bounds or invalid."))),Je.default.createElement(se,{px:10}))}var mS=Zx;var Yx=(e,t)=>({file_path:e,sheet:{type:"sheet name",value:t},range_imports:[{type:"range",df_name:"",value:""}],convert_csv_to_xlsx:!e.endsWith("xlsx")&&!e.endsWith("xlsm")});function L1(e){if("value"in e){let t=e.value;if(typeof t=="string"){let n=parseFloat(t),r=/^[+-]?\d+(\.\d+)?$/.test(t);if(!isNaN(n)&&r)return f(m({},e),{value:n})}else return e}return e}var qx=e=>{let{params:t,setParams:n,edit:r,error:o}=wt(()=>Yx(e.file_path,e.sheet_name),"excel_range_import",e.mitoAPI,e.analysisData,{overwiteStepIfClickedMultipleTimes:!0}),[i,a]=(0,Pe.useState)(0);if(t===void 0)return Pe.default.createElement(ge,{setUIState:e.setUIState});let s="";t.sheet.type==="sheet name"?s=t.sheet.value:s=e.sheet_names[t.sheet.value<0?e.sheet_names.length+t.sheet.value:t.sheet.value];let l;return t.range_imports.length===0?l="Please add range imports above before importing them.":s===void 0?l="Select a sheet to import from. The sheet index is out of bounds.":t.range_imports.forEach(d=>{d.df_name===""&&(l="Please ensure all range imports have a defined dataframe name."),d.type==="dynamic"?("value"in d.start_condition&&d.start_condition.value===""&&(l="Please ensure all range imports have a defined start condition."),"value"in d.end_condition&&d.end_condition.value===""&&(l="Please ensure all range imports have a defined row end condition."),"value"in d.column_end_condition&&d.column_end_condition.value===""&&(l="Please ensure all range imports have a defined column end condition.")):d.value===""&&(l="Please ensure all range imports have a defined range.")}),Pe.default.createElement(Y,null,Pe.default.createElement(Q,{header:"Excel Range Import",setUIState:e.setUIState}),Pe.default.createElement(q,null,Pe.default.createElement(mS,{params:t,setParams:n,sheet_names:e.sheet_names,sheet_name:s}),Pe.default.createElement(I,{justify:"space-between"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-header-3"},"Range Imports")),Pe.default.createElement(C,{span:4},Pe.default.createElement(j,{variant:"dark",onClick:()=>{n(d=>{let u=window.structuredClone(d.range_imports);return(u.length>0?u[0].type:"range")==="range"?u.unshift({type:"range",df_name:"",value:""}):u.unshift({type:"dynamic",df_name:"",start_condition:{type:"upper left corner value",value:""},end_condition:{type:"first empty cell"},column_end_condition:{type:"first empty cell"}}),f(m({},d),{range_imports:u})}),a(0)},width:"block"},"+ Add"))),o!==void 0&&Pe.default.createElement("p",{className:"text-color-error"},o),t.range_imports.map((d,u)=>Pe.default.createElement(vm,{key:u,title:d.df_name===""?"Unnamed dataframe":`Importing ${d.df_name}`,subtitle:"Expand to configure range import.",expandedTitle:"Edit Range Import",isExpanded:u===i,setExpanded:c=>{a(c?u:-1)},onDelete:()=>{n(c=>{let p=window.structuredClone(c.range_imports);return p.splice(u,1),f(m({},c),{range_imports:p})}),i>=u&&a(i-1)}},Pe.default.createElement(I,{justify:"space-between",align:"center"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-body-1"},"Dataframe Name")),Pe.default.createElement(C,null,Pe.default.createElement(ne,{width:"medium",autoFocus:!0,placeholder:"company_ids",value:d.df_name,onChange:c=>{let p=c.target.value;n(h=>{let x=window.structuredClone(h.range_imports);return x[u].df_name=p,f(m({},h),{range_imports:x})})}}))),Pe.default.createElement(I,{justify:"space-between",align:"center"},Pe.default.createElement(C,null,Pe.default.createElement("p",{className:"text-body-1"},"Locate Dataframe By")),Pe.default.createElement(C,null,Pe.default.createElement($,{width:"medium",value:d.type,onChange:c=>{n(p=>{let h=window.structuredClone(p.range_imports),x=c,D=p.range_imports[u],S=p.range_imports[u];return x==="range"?S={type:x,df_name:D.df_name,value:"value"in D?D.value:""}:S={type:"dynamic",df_name:D.df_name,start_condition:{type:"upper left corner value",value:""},end_condition:{type:"first empty cell"},column_end_condition:{type:"first empty cell"}},h[u]=S,f(m({},p),{range_imports:h})})}},Pe.default.createElement(v,{title:"Exact Range",id:"range",subtext:"Specify the exact range to import as a sheet."}),Pe.default.createElement(v,{title:"Dynamic",id:"Dynamic",subtext:"Specify values and dynamic conditions to find the bounds of the data."})))),Pe.default.createElement(se,{px:10,seperatingLine:!0}),d.type==="range"&&Pe.default.createElement(uS,{rangeImport:d,index:u,setParams:n}),d.type==="dynamic"&&Pe.default.createElement(dS,{rangeImport:d,index:u,setParams:n})))),Pe.default.createElement(Me,null,Pe.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{r(d=>{let u=d.range_imports.map(c=>{let p=c;if(p.type==="dynamic"){let h=L1(p.start_condition),x=L1(p.end_condition),D=L1(p.column_end_condition);p=f(m({},p),{start_condition:h,end_condition:x,column_end_condition:D})}return p});return u.reverse(),f(m({},d),{range_imports:u})})},disabled:l!==void 0,disabledTooltip:l},"Import Ranges")))},cS=qx;var qe=T(_());var Qx=(e,t)=>{if(e.length===0||e[t]===void 0)return;let n=e[t].dfName;return{type:"csv",sheet_indexes:[t],file_name:`${n}_export`}},e9=["\\","/","<",">",":",'"',"|","?","*"],t9=e=>{let{params:t,setParams:n,edit:r,editApplied:o,loading:i}=wt(()=>Qx(e.sheetDataArray,e.selectedSheetIndex),"export_to_file",e.mitoAPI,e.analysisData);if(t===void 0)return qe.default.createElement(ge,{setUIState:e.setUIState,message:"Please import a dataframe before attempting to export it"});let a;return t.type==="csv"&&t.file_name.endsWith(".xlsx")?a="The .xlsx file extension does not match the CSV File Type.":t.type==="excel"&&(t.file_name.endsWith(".txt")||t.file_name.endsWith(".csv"))&&(a="The file extension ending does not match the Excel file type."),e9.forEach(s=>{t.file_name.includes(s)&&(a=`The File Name cannot include ${s}`)}),qe.default.createElement(Y,null,qe.default.createElement(Q,{header:"Export To File",setUIState:e.setUIState}),qe.default.createElement(q,null,qe.default.createElement(I,{justify:"space-between",align:"center",title:"TODO"},qe.default.createElement(C,null,qe.default.createElement("p",{className:"text-header-3"},"File Name")),qe.default.createElement(C,null,qe.default.createElement(ne,{autoFocus:!0,placeholder:"MitoExport",width:"medium",value:""+t.file_name,onChange:s=>{let l=s.target.value;n(d=>f(m({},d),{file_name:l}))}}))),a!==void 0&&qe.default.createElement("p",{className:"text-color-error"},a),qe.default.createElement(I,{justify:"space-between",align:"center"},qe.default.createElement(C,null,qe.default.createElement("p",{className:"text-header-3"},"File Type")),qe.default.createElement(C,null,qe.default.createElement($,{width:"medium",value:t.type,onChange:s=>{n(l=>f(m({},l),{type:s}))}},qe.default.createElement(v,{title:"CSV",id:"csv",subtext:"Each dataframe will be exported as a seperate CSV file. If multiple dataframes are exported, their names will be appended to the file name."}),qe.default.createElement(v,{title:"Excel",id:"excel",subtext:"Each exported dataframe will be exported as a seperate sheet."})))),qe.default.createElement(I,null,qe.default.createElement(C,null,qe.default.createElement("p",{className:"text-header-3"},"Dataframes to Export"))),qe.default.createElement(Lm,{height:"medium",sheetDataArray:e.sheetDataArray,selectedSheetIndexes:t.sheet_indexes,setUIState:e.setUIState,onChange:s=>{n(l=>f(m({},l),{sheet_indexes:s}))}})),qe.default.createElement(Me,null,o&&qe.default.createElement("p",{className:"text-subtext-1"},"Files created in the same folder as this notebook. Export code generated."),qe.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{r()},disabled:t.file_name===""||t.sheet_indexes.length===0||a!==void 0||i},i?"Generating...":"Generate Export Code")))},fS=t9;var ci=T(_());var kt=T(_());var U1=T(_()),n9=()=>U1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg"},U1.default.createElement("path",{d:"M8.89617 1.82873L7.80328 2.57459L6.92896 2.04972V1H4.96175V2.04972L4.1694 2.57459L3.24044 1.82873L1.81967 3.18232L2.55738 4.09392C2.46135 4.43914 2.31148 5.06077 2.31148 5.06077L1 5.19889V6.96685L2.31148 7.1326L2.55738 8.20994L1.81967 9.14917L3.13115 10.3094L4.1694 9.50829L5.07104 10.0884V11H6.92896V10.0884L7.80328 9.50829L8.89617 10.3094L10.153 9.14917L9.44262 8.20994L9.79781 7.1326L11 6.96685V5.19889L9.79781 4.9779L9.44262 4.09392L10.153 3.18232L8.89617 1.82873Z",stroke:"#9D6CFF"})),pS=n9;var ss=(e,t)=>{let n=e.split(".").map(o=>parseInt(o)),r=t.split(".").map(o=>parseInt(o));n.length==1&&(n[1]=0),n.length==2&&(n[2]=0);for(let o=0;or[o])return!0;if(n[o]ss(e.pythonVersion,"3.6.0")&&ss(e.pandasVersion,"0.25.0");var B1="Parent Folder",H1=e=>{try{let t=e.split(".");return t[t.length-1]}catch(t){return}},G1=(e,t)=>{if(e.isDirectory)return;let n=["csv","tsv","txt","tab"];Bm(t)&&(n.push("xlsx"),t.pandasVersion!==void 0&&ss(t.pandasVersion,"1.0.0")&&n.push("xlsm"));for(let o of n)if(e.name.toLowerCase().endsWith(o))return;let r=H1(e.name);return r===void 0?"Sorry, we don't support that file type.":r=="xlsx"?"Upgrade to pandas>=0.25.0 and Python>3.6 to import Excel files.":`Sorry, we don't support ${r} files.`},hS=(e,t,n,r)=>e===void 0?{disabled:!0,buttonText:"Select a File to Import"}:e.isDirectory?{disabled:!0,buttonText:"That's a Directory. Select a File"}:G1(e,t)!==void 0?{disabled:!0,buttonText:"Select a Supported File Type"}:n?{disabled:!1,buttonText:"Importing..."}:{disabled:!1,buttonText:(r?"Update to ":"Import ")+e.name},ui=e=>e!==void 0&&!(e!=null&&e.isDirectory)&&((e==null?void 0:e.name.toLowerCase().endsWith(".xlsx"))||(e==null?void 0:e.name.toLowerCase().endsWith(".xlsm"))),Hm=e=>{let t=[...e.pathContents.elements];return V1(e.pathContents.path_parts)||t.push({isDirectory:!0,isParentDirectory:!0,name:B1,lastModified:0}),t.filter(r=>dr(r.name,e.searchString)>.8).sort((r,o)=>r.name===B1?-1:o.name===B1?1:e.sort==="name_ascending"?r.name=o.name?-1:1:typeof r.lastModified!="number"||typeof o.lastModified!="number"?1:e.sort==="last_modified_ascending"?r.lastModified=o.lastModified?-1:1)},V1=e=>(e=e.filter(t=>t!==""),e.length===1&&(e[0]==="/"||e[0]==="\\")),Qi=async(e,t,n)=>{let r=[...t];if(n===void 0)return;r.push(n==null?void 0:n.name);let o=await e.getPathJoined(r);return"error"in o?void 0:o.result};var Ae=T(_());var ed=T(_()),r9=e=>e.direction==="ascending"?ed.default.createElement("svg",{width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ed.default.createElement("path",{d:"M4.00073 4L0.536631 0.25H7.46483L4.00073 4Z",fill:"#C4C4C4"})):ed.default.createElement("svg",{width:"8",height:"4",viewBox:"0 0 8 4",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ed.default.createElement("path",{d:"M4.00073 0L0.536631 3.75H7.46483L4.00073 0Z",fill:"#C4C4C4"})),j1=r9;var At=T(_());var gS=e=>{if(e==null)return"--";let t=Math.floor(Date.now()/1e3)-e;return t<3600?`${Math.round(t/60)} minutes ago`:t<86400?`${Math.round(t/3600)} hours ago`:t<604800?`${Math.round(t/86400)} days ago`:t<2419200?`${Math.round(t/604800)} weeks ago`:t<31536e3?`${Math.round(t/2419200)} months ago`:`${Math.round(t/31536e3)} years ago`},o9=async e=>{await new Promise(t=>setTimeout(t,e))},td=async(e,t)=>{let n=await e();for(let r=0;rR1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},R1.default.createElement("path",{d:"M1 3.75V6C1 6.13807 1.11193 6.25 1.25 6.25H4M1 3.75V1.5C1 1.36193 1.11193 1.25 1.25 1.25H4M1 3.75H7M7 3.75V1.5C7 1.36193 6.88807 1.25 6.75 1.25H4M7 3.75V6C7 6.13807 6.88807 6.25 6.75 6.25H4M4 1.25V6.25",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),Gm=i9;var W1=T(_()),a9=()=>W1.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 6",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W1.default.createElement("path",{d:"M3.86144 1H1.25C1.11193 1 1 1.11193 1 1.25V4.75C1 4.88807 1.11193 5 1.25 5H6.75C6.88807 5 7 4.88807 7 4.75V2.05C7 1.91193 6.88807 1.8 6.75 1.8H4.63856C4.55236 1.8 4.47225 1.75559 4.42656 1.6825L4.07344 1.1175C4.02775 1.0444 3.94764 1 3.86144 1Z",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),yS=a9;var nd=T(_()),s9=()=>nd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 8 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},nd.default.createElement("path",{d:"M1 1.25V5.75C1 5.88807 1.11193 6 1.25 6H6.75C6.88807 6 7 5.88807 7 5.75V2.94244C7 2.89827 6.9883 2.85489 6.96609 2.81671L5.9814 1.12428C5.93663 1.04733 5.85433 1 5.76531 1H1.25C1.11193 1 1 1.11193 1 1.25Z",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),nd.default.createElement("path",{d:"M2.63647 2.71875H5.36375",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"}),nd.default.createElement("path",{d:"M2.63647 4.28125H5.36375",stroke:"#343434",strokeWidth:"0.75",strokeLinecap:"round",strokeLinejoin:"round"})),SS=s9;function l9(e){let t=(0,At.useRef)(null),n=e.index===e.fileBrowserState.selectedElementIndex;(0,At.useEffect)(()=>{var a;let o=t.current,i=(a=t.current)==null?void 0:a.parentElement;n&&o&&i&&vl(i,t.current,0)},[n]);let r=G1(e.element,e.userProfile);return At.default.createElement("div",{ref:t,className:"file-browser-element p-5px text-unselectable",title:e.element.name,style:{background:n?"#D5C0FF":""},onClick:o=>{o.detail>1||(n?e.setFileBrowserState(i=>f(m({},i),{selectedElementIndex:-1})):e.setFileBrowserState(i=>f(m({},i),{selectedElementIndex:e.index})))},onDoubleClick:()=>{if(e.element.isParentDirectory){let o=[...e.fileBrowserState.pathContents.path_parts];o.pop(),e.setCurrPathParts(o)}else if(e.element.isDirectory){let o=e.fileBrowserState.pathContents.path_parts||[];o.push(e.element.name),e.setCurrPathParts(o)}else ui(e.element)?(async()=>{let i=await Qi(e.mitoAPI,e.currPathParts,e.element);i!==void 0&&e.setImportState({screen:"xlsx_import_config",fileName:e.element.name,filePath:i})})():e.importCSVFile(e.element)}},At.default.createElement(I,{suppressTopBottomMargin:!0,justify:"space-between"},At.default.createElement(C,{span:17,offsetRight:1},At.default.createElement("div",{className:"flexbox-row"},At.default.createElement("div",{className:"mr-5px mt-2px"},e.element.isDirectory&&e.element.isParentDirectory&&At.default.createElement(im,{width:"14px"}),e.element.isDirectory&&!e.element.isParentDirectory&&At.default.createElement(yS,null),!e.element.isDirectory&&r===void 0&&At.default.createElement(Gm,null),!e.element.isDirectory&&r!==void 0&&At.default.createElement(SS,null)),At.default.createElement("div",null,e.element.name))),At.default.createElement(C,{span:6},At.default.createElement("p",{className:"text-align-right"},e.element.lastModified!==0&&gS(e.element.lastModified)))),n&&r!==void 0&&At.default.createElement("div",{className:"pl-5px pr-5px"},At.default.createElement("span",null," ",r," ")))}var CS=l9;var ea=T(_());var ls=T(_()),d9=()=>ls.default.createElement("svg",{width:"17",height:"13",viewBox:"0 0 17 13",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ls.default.createElement("path",{d:"M15.6711 7.6579V11.5C15.6711 11.9142 15.3353 12.25 14.9211 12.25H1.5C1.08579 12.25 0.75 11.9142 0.75 11.5V7.6579C0.75 7.24368 1.08579 6.9079 1.5 6.9079H4.10526H14.9211C15.3353 6.9079 15.6711 7.24368 15.6711 7.6579Z",stroke:"#494650",strokeWidth:"1.5"}),ls.default.createElement("path",{d:"M14.5503 2.63128L15.4318 6.43421H0.989295L1.87037 2.63151C2.08764 1.69377 2.16023 1.44349 2.28529 1.26975C2.42019 1.08234 2.60436 0.935958 2.81738 0.846842C3.01487 0.764224 3.27508 0.75 4.23766 0.75H8.21021H12.183C13.1455 0.75 13.4057 0.764222 13.6032 0.846828C13.8162 0.935931 14.0003 1.08229 14.1352 1.26968C14.2603 1.4434 14.3329 1.69365 14.5503 2.63128Z",stroke:"#494650",strokeWidth:"1.5"}),ls.default.createElement("circle",{cx:"10.6052",cy:"9.23683",r:"1.02632",fill:"#494650"}),ls.default.createElement("path",{d:"M14.3683 9.23683C14.3683 9.80364 13.9088 10.2631 13.342 10.2631C12.7752 10.2631 12.3157 9.80364 12.3157 9.23683C12.3157 8.67001 12.7752 8.21051 13.342 8.21051C13.9088 8.21051 14.3683 8.67001 14.3683 9.23683Z",fill:"#494650"})),IS=d9;function u9(e){var n;let t=r=>{if(e.pathParts===void 0)return;let o=e.pathParts.slice(0,r+1);e.setCurrPathParts(o)};return ea.default.createElement("div",{className:"file-browser-path-selector"},(n=e.pathParts)==null?void 0:n.map((r,o)=>ea.default.createElement(ea.default.Fragment,{key:o},ea.default.createElement("div",{className:"file-browser-path-part",key:o,onClick:()=>{t(o)}},o===0?ea.default.createElement(IS,null):r),ea.default.createElement("div",{className:"file-browser-path-seperator"},">"))))}var xS=u9;function m9(e){let t=(0,Ae.useRef)(null),n=Hm(e.fileBrowserState),r=n[e.fileBrowserState.selectedElementIndex];(0,Ae.useEffect)(()=>{var i;e.setFileBrowserState(a=>f(m({},a),{searchString:""})),(i=t.current)==null||i.focus()},[e.fileBrowserState.pathContents.path_parts]),(0,Ae.useEffect)(()=>{var i;(i=t.current)==null||i.focus()},[e.fileBrowserState.selectedElementIndex,e.fileBrowserState.sort]);let o=V1(e.fileBrowserState.pathContents.path_parts)&&!e.userProfile.isPro;return Ae.default.createElement("div",{className:"file-browser flexbox-column"},Ae.default.createElement("div",null,Ae.default.createElement(xS,{setCurrPathParts:e.setCurrPathParts,pathParts:e.fileBrowserState.pathContents.path_parts})),Ae.default.createElement(I,{className:"border-t-light-gray border-b-light-gray",justify:"space-between"},Ae.default.createElement(C,{span:18,className:"flexbox-row flexbox-space-between border-r-light-gray",onClick:()=>{e.setFileBrowserState(i=>f(m({},i),{sort:i.sort==="name_descending"?"name_ascending":"name_descending"}))}},Ae.default.createElement("p",{className:"text-body-2 pt-5px pb-5px"},"Name"),e.fileBrowserState.sort.startsWith("name")&&Ae.default.createElement("div",{className:"mr-5px ml-5px"},Ae.default.createElement(j1,{direction:e.fileBrowserState.sort.endsWith("descending")?"descending":"ascending"}))),Ae.default.createElement(C,{span:6,className:"flexbox-row flexbox-justify-end text-align-right",onClick:()=>{e.setFileBrowserState(i=>f(m({},i),{sort:i.sort==="last_modified_descending"?"last_modified_ascending":"last_modified_descending"}))}},e.fileBrowserState.sort.startsWith("last_modified")&&Ae.default.createElement("div",{className:"mr-5px ml-5px"},Ae.default.createElement(j1,{direction:e.fileBrowserState.sort.endsWith("descending")?"descending":"ascending"})),Ae.default.createElement("p",{className:"text-body-2 pt-5px pb-5px"},"Last Modified"))),Ae.default.createElement("div",{className:"mt-5px mb-5px"},Ae.default.createElement("input",{className:M("mito-input","text-body-2","element-width-block"),ref:t,value:e.fileBrowserState.searchString,placeholder:"Search the current folder",onChange:i=>{let a=i.target.value;e.setFileBrowserState(s=>f(m({},s),{searchString:a}))},onKeyDown:i=>{if(i.key=="ArrowUp")e.setFileBrowserState(a=>f(m({},a),{selectedElementIndex:Math.max(a.selectedElementIndex-1,-1)})),i.preventDefault();else if(i.key==="ArrowDown")e.setFileBrowserState(a=>f(m({},a),{selectedElementIndex:Math.min(a.selectedElementIndex+1,n.length-1)})),i.preventDefault();else if(i.key==="Enter"){if(!r)return;if(r.isParentDirectory){let a=[...e.fileBrowserState.pathContents.path_parts];a.pop(),e.setCurrPathParts(a)}else if(r.isDirectory){let a=e.fileBrowserState.pathContents.path_parts||[];a.push(r.name),e.setCurrPathParts(a)}else ui(r)?(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"xlsx_import_config",fileName:r.name,filePath:s})})():e.importCSVFile(r)}},width:"block",autoFocus:!0})),Ae.default.createElement("div",{className:"file-browser-element-list"},o&&Ae.default.createElement(Ae.default.Fragment,null,Ae.default.createElement(I,{justify:"space-around"},Ae.default.createElement("p",{className:"ma-25px text-align-center text-body-1"},"Want to import from a different drive? Consider\xA0",Ae.default.createElement("a",{onClick:()=>{e.mitoAPI.log("clicked_pro_button",{pro_button_location:"import_taskpane_root_folder_import"}),e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"upgrade_to_pro",proOrEnterprise:"Pro"},selectedTabType:"data"}))},className:"text-body-1-link"},"upgrading to Mito Pro")," or\xA0",Ae.default.createElement("a",{onClick:()=>{e.setCurrPathParts(["."])},className:"text-body-1-link"},"go back to current directory.")))),!o&&Ae.default.createElement(Ae.default.Fragment,null,!e.fileBrowserState.loadingFolder&&(n==null?void 0:n.map((i,a)=>Ae.default.createElement(CS,{key:a,mitoAPI:e.mitoAPI,index:a,element:i,fileBrowserState:e.fileBrowserState,setFileBrowserState:e.setFileBrowserState,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,excelImportEnabled:Bm(e.userProfile),setImportState:e.setImportState,importCSVFile:e.importCSVFile,userProfile:e.userProfile}))),e.fileBrowserState.loadingFolder&&Ae.default.createElement("p",null,"Loading folder contents..."))))}var wS=m9;function c9(e){let[t,n]=(0,kt.useState)({pathContents:{path_parts:e.currPathParts,elements:[]},sort:"last_modified_descending",searchString:"",selectedElementIndex:-1,loadingFolder:!1,loadingImport:!1}),r=Hm(t)[t.selectedElementIndex];(0,kt.useEffect)(()=>{o(e.currPathParts),n(a=>f(m({},a),{selectedElementIndex:-1})),e.mitoAPI.log("curr_path_changed",{path_parts_length:e.currPathParts.length})},[e.currPathParts]),(0,kt.useEffect)(()=>{let a="";if(r===void 0)a="undefined";else if(r.isDirectory)a="directory";else{let s=H1(r.name);s!==void 0?a=s:a="No File Ending"}e.mitoAPI.log("selected_element_changed",{selected_element:a})},[r]);async function o(a){n(d=>f(m({},d),{loadingFolder:!0}));let s=await e.mitoAPI.getPathContents(a),l="error"in s?void 0:s.result;n(l?d=>f(m({},d),{pathContents:l,loadingFolder:!1}):d=>f(m({},d),{loadingFolder:!1}))}let i=hS(r,e.userProfile,t.loadingImport,e.isUpdate);return kt.default.createElement(Y,null,kt.default.createElement(Q,{header:e.isUpdate?"Update Import":"Import Files",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),kt.default.createElement(q,{noScroll:!0},kt.default.createElement(wS,{mitoAPI:e.mitoAPI,userProfile:e.userProfile,setUIState:e.setUIState,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,fileBrowserState:t,setFileBrowserState:n,importCSVFile:e.importCSVFile,setImportState:e.setImportState})),kt.default.createElement(Me,null,kt.default.createElement(I,{justify:"space-between"},!i.disabled&&!ui(r)&&kt.default.createElement(C,null,kt.default.createElement(j,{variant:"light",width:"small",onClick:()=>{(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"csv_import_config",fileName:r.name,filePath:s})})()},disabled:i.disabled},kt.default.createElement(I,{suppressTopBottomMargin:!0,justify:"space-between",align:"center"},kt.default.createElement(pS,null),kt.default.createElement("p",{className:"ml-2px"},"Configure")))),kt.default.createElement(C,{span:!i.disabled&&!ui(r)?18:24},kt.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{ui(r)?(async()=>{let s=await Qi(e.mitoAPI,e.currPathParts,r);s===void 0||r===void 0||e.setImportState({screen:"xlsx_import_config",fileName:r.name,filePath:s})})():e.importCSVFile(r)},disabled:i.disabled},i.buttonText)))))}var Vm=c9;var vS=T(_());var fe=T(_());var f9=["utf_8","ascii","latin_1","big5","big5hkscs","cp037","cp273","cp424","cp437","cp500","cp720","cp737","cp775","cp850","cp852","cp855","cp856","cp857","cp858","cp860","cp861","cp862","cp863","cp864","cp865","cp866","cp869","cp874","cp875","cp932","cp949","cp950","cp1006","cp1026","cp1125","cp1140","cp1250","cp1251","cp1252","cp1253","cp1254","cp1255","cp1256","cp1257","cp1258","euc_jp","euc_jis_2004","euc_jisx0213","euc_kr","gb2312","gbk","gb18030","hz","iso2022_jp","iso2022_jp_1","iso2022_jp_2","iso2022_jp_2004","iso2022_jp_3","iso2022_jp_ext","iso2022_kr","iso8859_2","iso8859_3","iso8859_4","iso8859_5","iso8859_6","iso8859_7","iso8859_8","iso8859_9","iso8859_10","iso8859_11","iso8859_13","iso8859_14","iso8859_15","iso8859_16","johab","koi8_r","koi8_t","koi8_u","kz1048","mac_cyrillic","mac_greek","mac_iceland","mac_latin2","mac_roman","mac_turkish","ptcp154","shift_jis","shift_jis_2004","shift_jisx0213","utf_32","utf_32_be","utf_32_le","utf_16","utf_16_be","utf_16_le","utf_7","utf_8_sig"];var ta={["."]:"period",[","]:"comma"},TS="The seperator that seperates one column from another.",_S="The encoding used to save this file.",id="The character used to separate the decimal places in numbers.",ad="The number of rows at the top of the file to skip when reading data into the dataframe.",DS="Turn on to skip any lines that error when being read in.",ds=",",rd="utf-8",us=".",X1=0,od=!0,p9=(e,t,n)=>t?"Importing...":n?`Update to ${e}`:`Import ${e}`;function h9(e){return`Imported ${e}`}function g9(e){let[t]=ln(void 0,async()=>{var x;let h=await e.mitoAPI.getCSVFilesMetadata(((x=e.params)==null?void 0:x.file_names)||[]);return"error"in h?void 0:h.result},h=>{e.setParams(x=>f(m({},x),{delimeters:(h==null?void 0:h.delimeters)||[ds],encodings:(h==null?void 0:h.encodings)||[rd],decimals:(h==null?void 0:h.decimals)||[us],skiprows:(h==null?void 0:h.skiprows)||[X1]}))},[]),n=()=>{e.setParams(h=>f(m({},h),{delimeters:(t==null?void 0:t.delimeters)||[ds],encodings:(t==null?void 0:t.encodings)||[rd],decimals:(t==null?void 0:t.decimals)||[us],skiprows:(t==null?void 0:t.skiprows)||[X1],error_bad_lines:[od]}))};if(e.params===void 0||e.fileName===void 0||e.filePath===void 0)return fe.default.createElement("div",{className:"text-body-1"},"There has been an error loading your CSV file encodings. Please try again, or contact support.");let r=e.params.delimeters,o=e.params.encodings,i=e.params.decimals,a=e.params.skiprows,s=e.params.error_bad_lines,l=r!==void 0?r[0]:ds,d=o!==void 0?o[0]:rd,u=i!==void 0?i[0]:us,c=a!==void 0?a[0]:X1,p=s!==void 0?s[0]:od;return fe.default.createElement(Y,null,fe.default.createElement(Q,{header:e.isUpdate?`Update to ${e.fileName}`:`Import ${e.fileName}`,setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),fe.default.createElement(q,{noScroll:!0},e.error!==void 0&&fe.default.createElement("p",{className:"text-color-error"}," ",e.error," "),fe.default.createElement(I,{justify:"space-between",align:"center",title:TS},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:TS},"Delimeter")),fe.default.createElement(C,null,fe.default.createElement(ne,{width:"medium",value:l,onChange:h=>{let x=h.target.value;e.setParams(D=>f(m({},D),{delimeters:[x]}))},onKeyDown:h=>{h.key==="Tab"&&(h.preventDefault(),e.setParams(x=>{let D=x.delimeters;return f(m({},x),{delimeters:[(D!==void 0?D[0]:ds)+" "]})}))},selectTextOnFocus:!0}))),fe.default.createElement(I,{justify:"space-between",align:"center",title:_S},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:_S},"Encoding")),fe.default.createElement(C,null,fe.default.createElement($,{searchable:!0,width:"medium",value:d,onChange:h=>{e.setParams(x=>f(m({},x),{encodings:[h]}))}},f9.map(h=>fe.default.createElement(v,{key:h,title:h}))))),fe.default.createElement(I,{justify:"space-between",align:"center",title:id},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:id},"Decimal Separator")),fe.default.createElement(C,null,fe.default.createElement($,{searchable:!0,width:"medium",value:ta[u],onChange:h=>{e.setParams(x=>f(m({},x),{decimals:[h]}))}},Object.keys(ta).map(h=>{let x=ta[h];return fe.default.createElement(v,{key:x,title:x,id:h})})))),fe.default.createElement(I,{justify:"space-between",align:"center",title:ad},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:ad},"Number of Rows to Skip")),fe.default.createElement(C,null,fe.default.createElement(ne,{value:""+c,type:"number",width:"medium",onChange:h=>{let x=h.target.value,D=Math.floor(parseFloat(x));e.setParams(S=>f(m({},S),{skiprows:[D]}))},selectTextOnFocus:!0}))),fe.default.createElement(I,{justify:"space-between",align:"center",title:DS},fe.default.createElement(C,null,fe.default.createElement(de,{tooltip:DS},"Skip Invalid Lines")),fe.default.createElement(C,null,fe.default.createElement(Ut,{value:!p,onChange:()=>{e.setParams(h=>{let x=h.error_bad_lines;return f(m({},h),{error_bad_lines:[x!==void 0?!x[0]:od]})})}}))),fe.default.createElement(I,null,fe.default.createElement("p",{onClick:()=>{e.setUIState(h=>f(m({},h),{currOpenTaskpane:{type:"Excel Range Import",file_path:e.filePath,sheet_name:"Sheet1",sheet_names:["Sheet1"]}}))}},"Want to import multiple ranges from this file? ",fe.default.createElement("span",{className:"text-underline"},"Click here.")))),fe.default.createElement(Me,null,fe.default.createElement("p",{className:"text-body-2 text-color-medium-gray-important mb-5px"},fe.default.createElement("span",{className:"text-body-2-link",onClick:n},"Reset parameters to automatically detected parameters. ")),fe.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},autoFocus:!0},p9(e.fileName,e.loading,e.isUpdate)),e.editApplied&&!e.loading&&fe.default.createElement("p",{className:"text-subtext-1"},h9(e.fileName)),!e.editApplied&&fe.default.createElement(se,{px:16})))}var jm=g9;var J1=e=>({file_names:[e],delimeters:[ds],encodings:[rd],error_bad_lines:[od]});function y9(e){let{params:t,setParams:n,loading:r,edit:o,editApplied:i,error:a}=wt(()=>J1(e.filePath),"simple_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return vS.default.createElement(jm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!1,fileName:e.fileName,filePath:e.filePath,params:t,setParams:n,edit:o,editApplied:i,loading:r,error:a!==void 0?a:e.error,backCallback:()=>{e.setScreen({screen:"file_browser"})}})}var PS=y9;var AS=T(_());var we=T(_());var mi=T(_());var Rm=T(_());var S9=e=>Rm.default.createElement("div",{key:e.value,onClick:()=>{e.onClick()},className:M("radio-button-box-row",{"radio-button-box-row-selected":e.checked})},Rm.default.createElement("input",{type:"radio",name:e.value,value:e.value,checked:e.checked}),Rm.default.createElement("label",{htmlFor:e.value},e.value)),bS=S9;var C9=e=>e.loading?mi.default.createElement(I,{justify:"center"},mi.default.createElement("p",{className:"text-body-1"},"Loading...")):e.values.length===0?mi.default.createElement(I,{justify:"center"},mi.default.createElement("p",{className:"text-body-1"},"No items to display.")):null,I9=e=>{let t=e.height||"block",n=e.width||"block",r=`element-height-${t}`,o=`element-width-${n}`;return mi.default.createElement("div",{className:M("text-body-2","radio-button-box",r,o,e.className)},mi.default.createElement(C9,{values:e.values,loading:e.loading}),e.values.map(i=>mi.default.createElement(bS,{key:i,value:i,checked:i==e.selectedValue,onClick:()=>{e.onChange(i)}})))},Wm=I9;var x9=(e,t,n)=>t?"Importing...":e.sheet_names.length===0?"Select sheets to import them":n?`Update to ${e.sheet_names[0]}`:`Import ${e.sheet_names.length} Selected Sheet${e.sheet_names.length===1?"":"s"}`;function w9(e){return`Imported ${e.sheet_names.length} sheet${e.sheet_names.length===1?"":"s"}.`}var ES='Select "Yes" if Mito should set the first non-skipped row as the column headers. Select "No" if Mito should generate column headers';function T9(e){let[t,n]=ln({sheet_names:[],size:0},async i=>{let a=await e.mitoAPI.getExcelFileMetadata(i);return"error"in a?void 0:a.result},i=>{i!==void 0&&e.setParams(a=>f(m({},a),{sheet_names:e.isUpdate?i.sheet_names.slice(0,1):i.sheet_names}))},[e.filePath]),r=e.params;if(r===void 0)return we.default.createElement("div",{className:"text-body-1"},"There has been an error loading your Excel file metadata. Please try again, or contact support.");let o=r.sheet_names.length;return we.default.createElement(Y,null,we.default.createElement(Q,{header:e.isUpdate?`Update to ${e.fileName}`:`Import ${e.fileName}`,setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),we.default.createElement(q,null,we.default.createElement("div",null,!e.isUpdate&&we.default.createElement(Gr,{loading:n,searchable:!0,height:"medium",emptyMessage:"There are no sheets to choose from. Either the workbook is empty or password protected.",onToggleAll:i=>{e.setParams(a=>{let s=i.map(l=>t.sheet_names[l]);return f(m({},a),{sheet_names:s})})}},t.sheet_names.map((i,a)=>we.default.createElement(hr,{key:a,title:i,toggled:r.sheet_names.includes(i),onToggle:()=>{e.setParams(s=>{let l=[...s.sheet_names];return br(l,i),f(m({},s),{sheet_names:l})})},index:a}))),e.isUpdate&&we.default.createElement(Wm,{values:t.sheet_names,selectedValue:r.sheet_names[0],height:"medium",onChange:i=>e.setParams(a=>f(m({},a),{sheet_names:[i]})),loading:n}),we.default.createElement(I,{justify:"space-between",align:"center",title:ES},we.default.createElement(C,null,we.default.createElement(de,{tooltip:ES},"Has Header Row")),we.default.createElement(C,null,we.default.createElement($,{value:r.has_headers?"Yes":"No",width:"medium",onChange:i=>e.setParams(a=>f(m({},a),{has_headers:i==="Yes"}))},we.default.createElement(v,{title:"Yes"}),we.default.createElement(v,{title:"No"})))),we.default.createElement(I,{justify:"space-between",align:"center",title:ad},we.default.createElement(C,null,we.default.createElement(de,{tooltip:ad},"Number of Rows to Skip")),we.default.createElement(C,null,we.default.createElement(ne,{value:""+r.skiprows,type:"number",width:"medium",onChange:i=>{let a=i.target.value;e.setParams(s=>f(m({},s),{skiprows:a}))}}))),ss(e.userProfile.pandasVersion,"1.4.0")&&we.default.createElement(I,{justify:"space-between",align:"center",title:id},we.default.createElement(C,null,we.default.createElement(de,{tooltip:id},"Decimal Separator")),we.default.createElement(C,null,we.default.createElement($,{width:"medium",value:ta[r.decimal],onChange:i=>{e.setParams(a=>f(m({},a),{decimals:[i]}))}},Object.keys(ta).map(i=>{let a=ta[i];return we.default.createElement(v,{key:a,title:a,id:i})})))),!e.isUpdate&&r.sheet_names.length===1&&we.default.createElement("p",{onClick:()=>{e.setUIState(i=>f(m({},i),{currOpenTaskpane:{type:"Excel Range Import",file_path:e.filePath,sheet_name:r.sheet_names[0],sheet_names:t.sheet_names}}))}},"Want to import multiple ranges from ",r.sheet_names[0],"? ",we.default.createElement("span",{className:"text-underline"},"Click here.")),t.size>=1e5&&t.size<1e7&&we.default.createElement("p",{className:"text-body-2 mt-20px"},"Due to Python limitations, large Excel files take minutes to import."),t.size>=1e7&&we.default.createElement("p",{className:"text-body-2 mt-20px"},"Due to Python limitations, massive Excel files take many minutes to import. If possible, save the Excel file as a CSV before importing."))),we.default.createElement(Me,null,we.default.createElement(j,{variant:"dark",width:"block",onClick:()=>e.edit(i=>{let a=parseInt(""+i.skiprows);return f(m({},i),{skiprows:a})}),disabled:o===0,autoFocus:!0},x9(r,e.loading,e.isUpdate)),e.editApplied&&!e.loading&&we.default.createElement("p",{className:"text-subtext-1"},w9(r)),!e.editApplied&&we.default.createElement(se,{px:18})))}var Xm=T9;var z1=e=>({file_name:e,sheet_names:[],has_headers:!0,decimal:us,skiprows:0});function _9(e){let{params:t,setParams:n,loading:r,edit:o,editApplied:i}=wt(()=>z1(e.filePath),"excel_import",e.mitoAPI,e.analysisData,{allowSameParamsToReapplyTwice:!0});return AS.default.createElement(Xm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!1,fileName:e.fileName,filePath:e.filePath,params:t,setParams:n,edit:o,editApplied:i,loading:r,backCallback:()=>{e.setImportState({screen:"file_browser"})}})}var kS=_9;function D9(e){let[t,n]=(0,ci.useState)({screen:"file_browser"});return t.screen==="file_browser"?ci.default.createElement(Vm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!1,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,setImportState:n,importCSVFile:async r=>{let o=await e.mitoAPI.getPathJoined([...e.currPathParts,r.name]),i="error"in o?void 0:o.result;if(i===void 0)return;let a=await e.mitoAPI.editSimpleImport([i]);"error"in a&&n({screen:"csv_import_config",fileName:r.name,filePath:i,error:a.error})}}):t.screen=="csv_import_config"?ci.default.createElement(PS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,fileName:t.fileName,filePath:t.filePath,error:t.error,setScreen:n}):t.screen=="xlsx_import_config"?ci.default.createElement(kS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,fileName:t.fileName,filePath:t.filePath,setImportState:n}):ci.default.createElement(ci.default.Fragment,null)}var NS=D9;var ye=T(_());var v9=["True","true","False","false"],K1=(e,t,n,r)=>{if(e.length===0||e[t]===void 0)return;let o=e[t],i=n||{type:"value",value:0};(i.type==="mean"||i.type==="median")&&(Object.values(o.columnDtypeMap).map(l=>et(l)||it(l)||Er(l)).every(l=>l===!0)||(i={type:"value",value:0}));let a=r===void 0?Object.keys(o.columnIDsMap):Tl(Object.keys(o.columnIDsMap),r);return{sheet_index:t,column_ids:a,fill_method:i}},P9=(e,t)=>{if(t.length===0)return"Select columns to fill NaN values";let n=t.map(i=>e==null?void 0:e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,25);return o===0?`Fill NaNs in ${r}`:`Fill NaNs in ${r} and ${o} others`},b9=(e,t)=>{let n=t.map(i=>e==null?void 0:e.columnIDsMap[i]).filter(i=>i!==void 0),[r,o]=Jo(n,25);return o===0?ye.default.createElement("p",null,"Filled NaNs in ",ye.default.createElement("span",{className:"text-color-gray-important"},r),"."):ye.default.createElement("p",null,"Filled NaNs in ",ye.default.createElement("span",{className:"text-color-gray-important"},r)," and ",ye.default.createElement("span",{className:"text-color-gray-important"},o)," other columns.")},E9=e=>{let{params:t,setParams:n,loading:r,edit:o,editApplied:i}=wt(()=>K1(e.sheetDataArray,e.selectedSheetIndex,void 0,e.startingColumnIDs),"fill_na",e.mitoAPI,e.analysisData);if((0,ye.useEffect)(()=>{n(d=>{let u=K1(e.sheetDataArray,e.selectedSheetIndex,d.fill_method,e.startingColumnIDs);return u||d})},[e.startingColumnIDs]),t===void 0)return ye.default.createElement(ge,{setUIState:e.setUIState,message:"Import a dataset before filling NaN values."});let a=e.sheetDataArray[t.sheet_index],s=(a==null?void 0:a.columnDtypeMap)||{},l=t.column_ids.length===0||t.column_ids.map(d=>s[d]).filter(d=>d!==void 0).map(d=>et(d)||it(d)||Er(d)).every(d=>d===!0);return ye.default.createElement(Y,null,ye.default.createElement(Q,{header:"Fill NaN Values",setUIState:e.setUIState}),ye.default.createElement(q,null,ye.default.createElement(Lt,{title:"Select the dataframe to fill nan values in.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:d=>{n(u=>{let c=K1(e.sheetDataArray,d,u.fill_method);return c||f(m({},u),{sheet_index:d})})}}),ye.default.createElement(se,{px:15}),ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the columns to fill nan values in."},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Columns to Fill NaN Values In"))),ye.default.createElement(tr,{sheetData:a,selectedColumnIDs:t.column_ids,getIsDisabledColumnID:(d,u,c)=>(t.fill_method.type==="mean"||t.fill_method.type==="median")&&!(et(c)||Er(c)||it(c)),onChange:d=>{n(u=>f(m({},u),{column_ids:d}))}}),ye.default.createElement(se,{px:15}),ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the method for filling nan values"},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Fill Method")),ye.default.createElement(C,null,ye.default.createElement($,{value:t.fill_method.type,onChange:d=>{n(u=>{let c={type:"bfill"};return d==="value"?c={type:"value",value:0}:c={type:d},f(m({},u),{fill_method:c})})},width:"medium"},ye.default.createElement(v,{id:"value",title:"Value",subtext:"Replaces NaN values with a specific value that you input."}),ye.default.createElement(v,{id:"ffill",title:"Forward Fill",subtext:"Replaces NaNs in the column with the value in the row before."}),ye.default.createElement(v,{id:"bfill",title:"Back Fill",subtext:"Replaces NaNs in the column with the value in the row after."}),ye.default.createElement(v,{id:"mean",title:"Column Mean",subtext:l?"Replaces NaN values in number columns with the average of the column.":"Only number, datetime, and timedetla columns support fill with mean.",disabled:!l}),ye.default.createElement(v,{id:"median",title:"Column Median",subtext:l?"Replaces NaN values in number columns with the median of the column.":"Only number, datetime, and timedetla columns support fill with median.",disabled:!l})))),t.fill_method.type==="value"&&ye.default.createElement(I,{justify:"space-between",align:"center",title:"Select the dataframe to fill nan values in."},ye.default.createElement(C,null,ye.default.createElement("p",{className:"text-header-3"},"Fill Value")),ye.default.createElement(C,null,ye.default.createElement(ne,{autoFocus:!0,width:"medium",value:""+t.fill_method.value,onChange:d=>{let u=d.target.value;n(c=>f(m({},c),{fill_method:{type:"value",value:u}}))}}))),ye.default.createElement(se,{px:10+(t.fill_method.type==="value"?0:38)}),ye.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{o(d=>{if(d.fill_method.type==="value"&&typeof d.fill_method.value=="string"){let u=d.fill_method.value;return v9.includes(u)?u=!!u.toLowerCase().startsWith("t"):U2(d.fill_method.value)&&(u=parseFloat(d.fill_method.value)),f(m({},d),{fill_method:{type:"value",value:u}})}return d})},disabled:t.column_ids.length===0,disabledTooltip:"Select at least one column to fill NaN values in"},P9(a,t.column_ids)),i&&!r&&ye.default.createElement(I,{className:"mt-5"},ye.default.createElement("p",{className:"text-subtext-1"},b9(a,t.column_ids)))))},MS=E9;var ke=T(_());var fi=T(_());function A9(e){let t=n=>{e.setSelectedGraphSidebarTab(n),e.mitoAPI.log("clicked_graph_"+n+"_tab")};return fi.default.createElement("div",{className:"graph-sidebar-tab-container"},fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="setup"?"selected":"unselected"),onClick:()=>t("setup")},fi.default.createElement("p",null,"Setup")),fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="style"?"selected":"unselected"),onClick:()=>t("style")},fi.default.createElement("p",null,"Style")),fi.default.createElement("div",{className:M("control-panel-taskpane-tab",e.selectedTab==="export"?"selected":"unselected"),onClick:()=>t("export")},fi.default.createElement("p",null,"Export")))}var OS=A9;var Jm=T(_());function $1(){let e=[...Array(12)].map((t,n)=>Jm.default.createElement("div",{key:n},Jm.default.createElement("div",{className:"div-after",style:{background:"#7f58af"}})));return Jm.default.createElement("div",{className:"lds-spinner"},e)}var O=T(_());function k9(e){var o;let t=e.graphParams.graphCreation,n=e.graphParams.graphStyling;function r(i){e.setGraphParams(a=>jt(a,i)),e.setGraphUpdatedNumber(a=>a+1)}return O.default.createElement("div",{className:"graph-sidebar-toolbar-content"},O.default.createElement(je,{title:"Titles"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Graph Title")),O.default.createElement(ne,{value:n.title.title||"",placeholder:"Default Graph Title",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{title:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"X Axis Title")),O.default.createElement(ne,{value:n.xaxis.title||"",placeholder:"Default X Axis",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{xaxis:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Y Axis Title")),O.default.createElement(ne,{value:n.yaxis.title||"",placeholder:"Default Y Axis",onChange:i=>{let a=i.target.value!==""?i.target.value:void 0;return r({graphStyling:{yaxis:{title:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Title")),O.default.createElement(Ut,{value:n.title.visible,onChange:()=>r({graphStyling:{title:{visible:!n.title.visible}}})})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display X Axis Title")),O.default.createElement(Ut,{value:n.xaxis.visible,onChange:()=>r({graphStyling:{xaxis:{visible:!n.xaxis.visible}}})})),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Y Axis Title")),O.default.createElement(Ut,{value:n.yaxis.visible,onChange:()=>r({graphStyling:{yaxis:{visible:!n.yaxis.visible}}})}))),O.default.createElement(je,{title:"Axis Transformations"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"X Axis Transform")),O.default.createElement($,{value:e.graphParams.graphStyling.xaxis.type||"default",onChange:i=>r({graphStyling:{xaxis:{type:i!=="default"?i:void 0}}}),width:"small",dropdownWidth:"medium"},O.default.createElement(v,{title:"default"}),O.default.createElement(v,{title:"linear"}),O.default.createElement(v,{title:"log"}),O.default.createElement(v,{title:"date"}),O.default.createElement(v,{title:"category"}))),O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Y Axis Transform")),O.default.createElement($,{value:e.graphParams.graphStyling.yaxis.type||"default",onChange:i=>r({graphStyling:{yaxis:{type:i!=="default"?i:void 0}}}),width:"small",dropdownWidth:"medium"},O.default.createElement(v,{title:"default"}),O.default.createElement(v,{title:"linear"}),O.default.createElement(v,{title:"log"}),O.default.createElement(v,{title:"date"}),O.default.createElement(v,{title:"category"})))),O.default.createElement(je,{title:"Legend",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to customize the legend? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"Title of legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Display Legend")),O.default.createElement(Ut,{value:n.showlegend,onChange:()=>r({graphStyling:{showlegend:!n.showlegend}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"Display the legend vertically or horizontally"},O.default.createElement(C,null,O.default.createElement("p",null,"Orientation")),O.default.createElement($,{value:n.legend.orientation==="v"?"vertical":"horiztonal",width:"medium",onChange:i=>r({graphStyling:{legend:{orientation:i}}})},O.default.createElement(v,{title:"vertical",id:"v"}),O.default.createElement(v,{title:"horizontal",id:"h"}))),O.default.createElement(I,{justify:"space-between",align:"center",title:"Title of legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Legend title")),O.default.createElement(ne,{value:(o=n.legend.title)!=null&&o.text?n.legend.title.text:"",width:"medium",placeholder:"Legend title",onChange:i=>{let a=i.target.value;return r({graphStyling:{legend:{title:{text:a}}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The x position of the legend"},O.default.createElement(C,null,O.default.createElement("p",null,"X position (-2 to 3)")),O.default.createElement(ne,{value:n.legend.x?n.legend.x.toString():"",type:"number",width:"small",placeholder:n.legend.orientation==="v"?"1.02":"0.00",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{legend:{x:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The y position of the legend"},O.default.createElement(C,null,O.default.createElement("p",null,"Y position (-2 to 3)")),O.default.createElement(ne,{value:n.legend.y?n.legend.y.toString():"",type:"number",width:"small",placeholder:n.legend.orientation==="v"?"1.00":n.xaxis.rangeslider.visible?"1.10":"-0.10",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{legend:{y:a}}})}})))),O.default.createElement(je,{title:"Grid Lines",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to customize the grid lines? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"Turn on/off vertical grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Show vertical grid")),O.default.createElement(Ut,{value:n.xaxis.showgrid,onChange:()=>r({graphStyling:{xaxis:{showgrid:!n.xaxis.showgrid}}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"Turn on/off horiztonal grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Show horizontal grid")),O.default.createElement(Ut,{value:n.yaxis.showgrid,onChange:()=>r({graphStyling:{yaxis:{showgrid:!n.yaxis.showgrid}}})})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The width of the vertical grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Vertical grid width")),O.default.createElement(ne,{value:n.xaxis.gridwidth?n.xaxis.gridwidth.toString():"",type:"number",width:"small",placeholder:"1",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{xaxis:{gridwidth:a}}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The width of the horizontal grid lines"},O.default.createElement(C,null,O.default.createElement("p",null,"Horizontal grid width")),O.default.createElement(ne,{value:n.yaxis.gridwidth?n.yaxis.gridwidth.toString():"",type:"number",width:"small",placeholder:"1",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphStyling:{yaxis:{gridwidth:a}}})}})))),O.default.createElement(je,{title:"Colors",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to set the colors of your graph? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(Xt,{label:"Plot Background Color",color:n.plot_bgcolor,onChange:i=>r({graphStyling:{plot_bgcolor:i}})}),O.default.createElement(Xt,{label:"Paper Background Color",color:n.paper_bgcolor,onChange:i=>r({graphStyling:{paper_bgcolor:i}})}),O.default.createElement(Xt,{label:"Title color",color:n.title.title_font_color,onChange:i=>r({graphStyling:{title:{title_font_color:i}}})}),O.default.createElement(Xt,{label:"X axis title color",color:n.xaxis.title_font_color,onChange:i=>r({graphStyling:{xaxis:{title_font_color:i}}})}),O.default.createElement(Xt,{label:"Y axis title color",color:n.yaxis.title_font_color,onChange:i=>r({graphStyling:{yaxis:{title_font_color:i}}})}))),O.default.createElement(je,{title:"Facet Styling",proSection:!0,isPro:e.userProfile.isPro},!e.userProfile.isPro&&O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement("p",{className:"text-body-1"},"Want to style facet plots? ",O.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},O.default.createElement("span",{className:"text-body-1-link"},"Upgrade to Mito Pro.")))),e.userProfile.isPro&&O.default.createElement(O.default.Fragment,null,O.default.createElement(I,{justify:"space-between",align:"center",title:"The number of plots to display per row. Has no effect when facet row is used."},O.default.createElement(C,null,O.default.createElement("p",null,"Number of cols (int)")),O.default.createElement(ne,{value:t.facet_col_wrap?t.facet_col_wrap.toString():"",type:"number",width:"small",placeholder:"num cols",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_col_wrap:a}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The spacing between columns of facet plots. Set as a fraction of plotting area."},O.default.createElement(C,null,O.default.createElement("p",null,"Column spacing (0 to 1)")),O.default.createElement(ne,{value:t.facet_col_spacing?t.facet_col_spacing.toString():"",type:"number",width:"small",placeholder:".03",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_col_spacing:a}})}})),O.default.createElement(I,{justify:"space-between",align:"center",title:"The spacing between rows of facet plots. Set as a fraction of plotting area."},O.default.createElement(C,null,O.default.createElement("p",null,"Row spacing (0 to 1)")),O.default.createElement(ne,{value:t.facet_row_spacing?t.facet_row_spacing.toString():"",type:"number",width:"small",placeholder:".07",onChange:i=>{let a=i.target.value===""?void 0:i.target.value;return r({graphCreation:{facet_row_spacing:a}})}})))),O.default.createElement(je,{title:"Range slider"},O.default.createElement(I,{justify:"space-between",align:"center"},O.default.createElement(C,null,O.default.createElement("p",null,"Display range slider")),O.default.createElement(Ut,{value:n.xaxis.rangeslider.visible,onChange:()=>r({graphStyling:{xaxis:{rangeslider:{visible:!n.xaxis.rangeslider.visible}}}})}))))}var FS=k9;var bn=T(_());var ms=T(_());var Z1=(e,t=2500)=>{let[n,r]=(0,ms.useState)(!1),o=(0,ms.useCallback)(()=>{e!=null&&rs(e).then(()=>{r(!0)},()=>{r(!1)})},[e]);return(0,ms.useEffect)(()=>{if(!n)return;let i=setTimeout(()=>{r(!1)},t);return()=>clearTimeout(i)},[n]),[o,n]};function N9(e){var s,l;let[t,n]=Z1((((s=e.graphOutput)==null?void 0:s.graphGeneratedCode)||"")+` fig.show(renderer="iframe")`),[r,o]=Z1((((l=e.graphOutput)==null?void 0:l.graphGeneratedCode)||"")+` -fig.write_html("${e.graphTabName}.html")`),i=()=>{t(),e.mitoAPI.log("copy_graph_code",{graph_type:e.graphParams.graphCreation.graph_type})},a=()=>{r(),e.mitoAPI.log("copy_export_html_graph_code",{graph_type:e.graphParams.graphCreation.graph_type})};return bn.default.createElement("div",{className:"graph-sidebar-toolbar-content"},bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:i,disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to copy code that creates graph and displays it in the notebook"},n?"Copied to Clipboard!":"Copy code that displays graph"),n?bn.default.createElement(I,{justify:"center",className:"text-subtext-1"},"Paste copied code in code cell below"):bn.default.createElement(bn.default.Fragment,null)),bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:a,disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to copy code that creates graph and exports it as an html file"},o?"Copied to Clipboard!":"Copy code to create graph HTML file"),o?bn.default.createElement(I,{justify:"center",className:"text-subtext-1"},"Paste copied code in code cell below"):bn.default.createElement(bn.default.Fragment,null)),bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:()=>{var u;let d=(u=e.mitoContainerRef.current)==null?void 0:u.querySelector('[data-title="Download plot as a png"]');d==null||d.click()},disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to download graph as png"},"Download as PNG")))}var LS=k9;var N9=1e3,M9=e=>{var g,y,w;let t=e.graphID,[n,r]=(0,ke.useState)(()=>me()),[o,i]=(0,ke.useState)(()=>Ju(e.graphDataDict,t,e.uiState.selectedSheetIndex,e.sheetDataArray)),a=o.graphCreation.sheet_index,s=(g=e.graphDataDict[t])==null?void 0:g.graphOutput,l=(y=e.graphDataDict[t])==null?void 0:y.graphTabName,[d,u]=(0,ke.useState)(!1),[c,p]=(0,ke.useState)("setup");(0,ke.useEffect)(()=>{e.graphSidebarTab==="export"&&p(e.graphSidebarTab)},[e.graphSidebarTab]);let[h,x]=(0,ke.useState)(0);(0,ke.useEffect)(()=>{window.Plotly||e.mitoAPI.log("plotly_define_failed")},[]),am(()=>{x(P=>P+1)},[],"mito-center-content-container"),Wa(()=>{S()},e.analysisData),(0,ke.useEffect)(()=>{r(me()),i(Ju(e.graphDataDict,e.graphID,e.uiState.selectedSheetIndex,e.sheetDataArray)),x(P=>P+1)},[e.graphID]),on(()=>{u(!0),D()},[h],N9),(0,ke.useEffect)(()=>{try{if(s===void 0)return;new Function(s.graphScript)()}catch(P){console.error("Failed to execute graph function",P)}},[s]);let D=async()=>{var N;let P=(N=document.getElementById("mito-center-content-container"))==null?void 0:N.getBoundingClientRect();P!==void 0&&await e.mitoAPI.editGraph(t,o,`${(P==null?void 0:P.height)-10}px`,`${(P==null?void 0:P.width)-20-300}px`,n),u(!1)},S=async()=>{let P=Ju(e.graphDataDict,t,a,e.sheetDataArray);i(P)};return e.sheetDataArray.length===0?(e.setUIState(P=>f(m({},P),{currOpenTaskpane:{type:"none"}})),ke.default.createElement(ge,{setUIState:e.setUIState})):ke.default.createElement("div",{className:"graph-sidebar-div"},ke.default.createElement("div",{className:"graph-sidebar-graph-div",id:"graph-div",style:{backgroundColor:o.graphStyling.paper_bgcolor}},s===void 0&&ke.default.createElement("p",{className:"graph-sidebar-welcome-text text-align-center-important"},"To generate a graph, select an axis."),s!==void 0&&ke.default.createElement("div",{dangerouslySetInnerHTML:{__html:s.graphHTML}})),ke.default.createElement("div",{className:"graph-sidebar-toolbar-container"},ke.default.createElement("div",{className:"graph-sidebar-toolbar-content-container"},ke.default.createElement(I,{justify:"space-between",align:"center"},ke.default.createElement(C,null,ke.default.createElement("p",{className:"text-header-2"},c==="setup"&&"Setup Graph",c==="style"&&"Style Graph",c==="export"&&"Export Graph")),ke.default.createElement(C,null,ke.default.createElement(at,{onClick:()=>{e.setUIState(P=>f(m({},P),{selectedTabType:"data",currOpenTaskpane:{type:"none"}}))}}))),c==="setup"&&ke.default.createElement(oy,{graphParams:o,setGraphParams:i,setGraphUpdatedNumber:x,uiState:e.uiState,mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,dfNames:e.dfNames,columnDtypesMap:((w=e.sheetDataArray[a])==null?void 0:w.columnDtypeMap)||{},columnIDsMapArray:e.columnIDsMapArray,setUIState:e.setUIState}),c==="style"&&ke.default.createElement(FS,{graphParams:o,setGraphParams:i,setGraphUpdatedNumber:x,userProfile:e.userProfile}),c==="export"&&ke.default.createElement(LS,{graphTabName:l,graphParams:o,mitoAPI:e.mitoAPI,loading:d,graphOutput:s,mitoContainerRef:e.mitoContainerRef})),ke.default.createElement(OS,{selectedTab:c,setSelectedGraphSidebarTab:p,mitoAPI:e.mitoAPI})),d&&ke.default.createElement("div",{className:"popup-div"},ke.default.createElement($1,null),ke.default.createElement("p",{className:"popup-text-div"},"loading")))},US=M9;var Hn=T(_());var BS=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,id_var_column_ids:[],value_var_column_ids:Object.keys(e[t].columnDtypeMap||{})}},O9=e=>{let{params:t,setParams:n}=Dn(()=>BS(e.sheetDataArray,e.selectedSheetIndex),"melt",e.mitoAPI,e.analysisData,50);if(t===void 0)return Hn.default.createElement(ge,{setUIState:e.setUIState});let r=e.sheetDataArray[t.sheet_index];return Hn.default.createElement(Y,null,Hn.default.createElement(Q,{header:"Unpivot Dataframe",setUIState:e.setUIState}),Hn.default.createElement(q,null,Hn.default.createElement(Lt,{title:"Select a dataframe to unpivot.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:o=>{n(i=>{let a=BS(e.sheetDataArray,o);return a||f(m({},i),{sheet_index:o})})}}),Hn.default.createElement(I,{justify:"start",align:"center",title:"Column to use as identifier variables."},Hn.default.createElement(de,{tooltip:"Column to use as identifier variables. These columns will be present in the unpivoted dataframe."},"ID Variables")),Hn.default.createElement(tr,{sheetData:r,selectedColumnIDs:t.id_var_column_ids,onChange:o=>{n(i=>f(m({},i),{id_var_column_ids:o}))}}),Hn.default.createElement(se,{px:10}),Hn.default.createElement(I,{justify:"start",align:"center",title:"Columns to unpivot."},Hn.default.createElement(de,{tooltip:"Column to unpivot. Each column header will go in the variables column, and the column values will go in the values column."},"Values")),Hn.default.createElement(tr,{sheetData:r,selectedColumnIDs:t.value_var_column_ids.filter(o=>!t.id_var_column_ids.includes(o)),disabledColumnIDs:t.id_var_column_ids,onChange:o=>{n(i=>f(m({},i),{value_var_column_ids:o}))}})))},HS=O9;var Oe=T(_());var Bt=T(_());var zm=(e,t,n,r)=>{var l,d;let o=Object.entries(((l=e[t])==null?void 0:l.columnIDsMap)||{}),i=Object.entries(((d=e[n])==null?void 0:d.columnIDsMap)||{}),s=o.map(([u,c])=>{let p=i.findIndex(([,h])=>G(c)===G(h));if(p>-1)return[u,i[p][0]]}).filter(u=>u!==void 0);if(s.length===0)return o[0]===void 0||i[0]===void 0?void 0:[o[0][0],i[0][0]];if(r){let u=s.filter(([c,p])=>{let h=r.findIndex(([D])=>c===D)!==-1,x=r.findIndex(([,D])=>p===D)!==-1;return!h&&!x});return u.length===0?s[0]:u[0]}else return s[0]};var F9=e=>{let t=e.sheetDataArray[e.params.sheet_index_one],n=e.sheetDataArray[e.params.sheet_index_two],r=Object.keys((t==null?void 0:t.columnDtypeMap)||{}).length===0||Object.keys((n==null?void 0:n.columnDtypeMap)||{}).length===0;return Bt.default.createElement("div",{className:"light-gray-container"},Bt.default.createElement(I,{suppressTopBottomMargin:!0},Bt.default.createElement(C,null,Bt.default.createElement("p",{className:"text-header-3"},"Match rows where:"))),e.params.merge_key_column_ids.map(([o,i],a)=>Bt.default.createElement(I,{key:a,justify:"space-between",align:"center"},Bt.default.createElement(C,null,Bt.default.createElement($,{value:o,onChange:s=>{e.setParams(l=>{let d=[...l.merge_key_column_ids];return d[a][0]=s,f(m({},l),{merge_key_column_ids:d})})},width:"medium",searchable:!0},Object.entries((t==null?void 0:t.columnIDsMap)||{}).map(([s,l])=>Bt.default.createElement(v,{key:s,id:s,title:G(l)})))),Bt.default.createElement(C,{className:"text-header-3"},"="),Bt.default.createElement(C,null,Bt.default.createElement($,{value:i,onChange:s=>{e.setParams(l=>{let d=[...l.merge_key_column_ids];return d[a][1]=s,f(m({},l),{merge_key_column_ids:d})})},width:"medium",searchable:!0},Object.entries((n==null?void 0:n.columnIDsMap)||{}).map(([s,l])=>Bt.default.createElement(v,{key:s,id:s,title:G(l)})))),Bt.default.createElement(C,null,Bt.default.createElement(at,{onClick:()=>{e.setParams(s=>{let l=[...s.merge_key_column_ids];return l.splice(a,1),f(m({},s),{merge_key_column_ids:l})})}})))),e.error!==void 0&&Bt.default.createElement("p",{className:"text-color-error"},e.error),Bt.default.createElement(se,{px:15}),Bt.default.createElement(j,{width:"medium",variant:"dark",onClick:()=>{e.setParams(o=>{let i=[...o.merge_key_column_ids],a=zm(e.sheetDataArray,e.params.sheet_index_one,e.params.sheet_index_two,e.params.merge_key_column_ids);return a&&i.push(a),f(m({},o),{merge_key_column_ids:i})})},disabled:r,disabledTooltip:"One of these dataframes has no columns, so no merge keys can be added."},"+ Add Merge Keys"))},GS=F9;var Gn=T(_());var L9=e=>{let[t]=(0,Gn.useState)(e.sheetDataArray.map(n=>n.dfName));return Gn.default.createElement("div",null,Gn.default.createElement(I,{justify:"space-between"},Gn.default.createElement(C,null,Gn.default.createElement("p",{className:"text-header-3"},"First Dataframe"),Gn.default.createElement($,{value:t[e.params.sheet_index_one]||"",onChange:n=>{let r=t.indexOf(n);e.setParams(o=>{let i=Km(e.sheetDataArray,r,o.sheet_index_two,o);return i||o})},className:"merge-sheet-selection-first-dataframe-select"},t.map(n=>Gn.default.createElement(v,{key:n,title:n})))),Gn.default.createElement(C,{offsetRight:2},Gn.default.createElement("p",{className:"text-header-3"},"Second Dataframe"),Gn.default.createElement($,{value:t[e.params.sheet_index_two]||"",onChange:n=>{let r=t.indexOf(n);e.setParams(o=>{let i=Km(e.sheetDataArray,o.sheet_index_one,r,o);return i||o})},width:"medium"},t.map(n=>Gn.default.createElement(v,{key:n,title:n}))))))},VS=L9;var Km=(e,t,n,r)=>{var d,u;if(e.length<2)return;let o=t,i=n!==void 0?n:o+1<=e.length-1?o+1:o-1>=0?o-1:o;if(r&&r.sheet_index_one==o&&r.sheet_index_two===i)return r;let a=zm(e,o,i),s=[],l=[];return r&&r.sheet_index_one==o?s=r.selected_column_ids_one:s=[...Object.keys(((d=e[o])==null?void 0:d.columnIDsMap)||{})],r&&r.sheet_index_two==i?l=r.selected_column_ids_two:l=[...Object.keys(((u=e[i])==null?void 0:u.columnIDsMap)||{})],{how:r?r.how:"lookup",sheet_index_one:o,sheet_index_two:i,merge_key_column_ids:a?[a]:[],selected_column_ids_one:s,selected_column_ids_two:l}},U9=e=>{let{params:t,setParams:n,error:r}=Dn(()=>Km(e.sheetDataArray,e.selectedSheetIndex),"merge",e.mitoAPI,e.analysisData,50);if(t===void 0)return Oe.default.createElement(ge,{setUIState:e.setUIState,message:"You need two dataframes before you can merge them."});let o=e.sheetDataArray[t.sheet_index_one],i=e.sheetDataArray[t.sheet_index_two],a=t.merge_key_column_ids.map(([l])=>l),s=t.merge_key_column_ids.map(([,l])=>l);return Oe.default.createElement(Y,null,Oe.default.createElement(Q,{header:"Merge Dataframes",setUIState:e.setUIState}),Oe.default.createElement(q,null,Oe.default.createElement(I,{justify:"space-between",align:"center",suppressTopBottomMargin:!0},Oe.default.createElement(C,{offsetRight:1},Oe.default.createElement("p",{className:"text-header-3"},"Merge Type")),Oe.default.createElement(C,{offsetRight:2},Oe.default.createElement($,{value:t.how,onChange:l=>{let d=l;n(u=>f(m({},u),{how:d}))},width:"medium-large"},Oe.default.createElement(v,{title:"lookup",subtext:"Includes all rows from the first sheet and only matching rows from the second sheet. If there are mulitple matches in the second sheet, only takes the first."}),Oe.default.createElement(v,{title:"left",subtext:"Includes all rows from the first sheet and only matching rows from the second sheet. Includes all matches."}),Oe.default.createElement(v,{title:"right",subtext:"Includes all rows from the second sheet and only matching rows from the first sheet. Includes all matches."}),Oe.default.createElement(v,{title:"inner",subtext:"Only includes rows that have matches in both sheets."}),Oe.default.createElement(v,{title:"outer",subtext:"Includes all rows from both sheets, regardless of whether there is a match in the other sheet."}),Oe.default.createElement(v,{title:"unique in left",subtext:"Includes each row from the first sheet that doesn't have a match in the second sheet."}),Oe.default.createElement(v,{title:"unique in right",subtext:"Includes each row from second sheet that doesn't have a match in the first sheet."})))),Oe.default.createElement(se,{px:20}),Oe.default.createElement(VS,{params:t,setParams:n,sheetDataArray:e.sheetDataArray}),Oe.default.createElement(se,{px:20}),Oe.default.createElement(GS,{params:t,setParams:n,sheetDataArray:e.sheetDataArray,error:r}),Oe.default.createElement(se,{px:20}),Oe.default.createElement("p",{className:"text-header-3"},"Columns to Keep from First Dataframe"),t.how!=="unique in right"&&Oe.default.createElement(tr,{sheetData:o,selectedColumnIDs:t.selected_column_ids_one.concat(a),disabledColumnIDs:a,onChange:l=>{n(d=>f(m({},d),{selected_column_ids_one:l}))}}),t.how==="unique in right"&&Oe.default.createElement("p",null,"Finding the unique values in the second sheet doesn't keep any columns from the first sheet."),Oe.default.createElement(se,{px:20}),Oe.default.createElement("div",null,Oe.default.createElement("p",{className:"text-header-3"},"Columns to Keep from Second Dataframe"),t.how!=="unique in left"&&Oe.default.createElement(tr,{sheetData:i,selectedColumnIDs:t.selected_column_ids_two.concat(s),disabledColumnIDs:s,onChange:l=>{n(d=>f(m({},d),{selected_column_ids_two:l}))}}),t.how==="unique in left"&&Oe.default.createElement("p",null,"Finding the unique values in the first sheet doesn't keep any columns from the second sheet."))))},jS=U9;var Sn=T(_());var Zt=T(_());var cs=T(_()),B9=e=>{let t=e.selectedColumnIDs.filter(n=>e.columnIDsMap[n]===void 0);return(0,cs.useEffect)(()=>{t.length>0&&e.mitoAPI.log("pivot_invalid_selected_columns",{pivot_section:e.pivotSection,num_invalid:t.length})},[]),cs.default.createElement(cs.default.Fragment,null,t.length>0&&cs.default.createElement("div",{className:"text-color-error",style:{overflowX:"hidden"}},"The ",t.length===1?"column":"columns"," ",t.length===1?t[0]:t.join(", ")," ",t.length===1?"does":"do"," not exist in this sheet anymore. Delete ",t.length===1?"it":"them"," to make this pivot valid."))},fs=B9;var H9={"no-op":"exact time",year:"year","year-quarter":"year-quarter","year-month":"year-month","year-month-day":"year-month-day","year-month-day-hour":"year-month-day-hour","year-month-day-hour-minute":"year-month-day-hour-minute",quarter:"quarter",month:"month",week:"week","day of month":"day of month","day of week":"day of week",hour:"hour",minute:"minute",second:"second","month-day":"month-day","day-hour":"day-hour","hour-minute":"hour-minute"},G9="Date columns can be further processed before being aggregated. For example, if you want to compare the aggregated values across months, then select `months` in this dropdown.",V9="Rows are used to group your source data into distinct buckets. The unique values that create the buckets are placed in the first column of the resulting pivot table.",j9="Columns are used to group your source data into distinct buckets. The unique values that create the buckets are placed across the top of the resulting pivot table. For the best performance, select columns with a small number of unique values.",R9=e=>{var i,a;let t=((i=e.sheetData)==null?void 0:i.columnIDsMap)||{},n=((a=e.sheetData)==null?void 0:a.columnDtypeMap)||{},r=e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?[...e.params.pivotRowColumnIDsWithTransforms]:[...e.params.pivotColumnsColumnIDsWithTransforms],o=r.map(({column_id:s,transformation:l},d)=>{let u=n[s],c=Zt.default.createElement(Nr,{key:d,value:s,titleMap:Lu(t),onChange:p=>{e.setParams(h=>{let x=[...r];return x[d].column_id=p,f(m({},h),{[e.rowOrColumn]:x})})},onDelete:()=>{e.setParams(p=>{let h=[...r];return h.splice(d,1),f(m({},p),{[e.rowOrColumn]:h})})},selectableValues:Object.keys(t)});return u!==void 0&&it(u)?Zt.default.createElement("div",{className:"mito-blue-container mt-4px mb-4px",key:d},c,Zt.default.createElement(I,{justify:"space-between",align:"center"},Zt.default.createElement(C,{offset:.25},Zt.default.createElement(de,{tooltip:G9},"group date by")),Zt.default.createElement(C,{offsetRight:3},Zt.default.createElement($,{value:l,onChange:p=>{e.setParams(h=>{let x=[...r];return x[d].transformation=p,f(m({},h),{[e.rowOrColumn]:x})})},searchable:!0,width:"medium"},Object.entries(H9).map(([p,h])=>Zt.default.createElement(v,{key:p,id:p,title:h})))))):c});return Zt.default.createElement("div",null,Zt.default.createElement(I,{justify:"space-between",align:"center"},Zt.default.createElement(C,null,Zt.default.createElement(de,{tooltip:e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?V9:j9},e.sectionTitle)),Zt.default.createElement(C,null,Zt.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([s,l])=>Zt.default.createElement(v,{key:s,title:G(l),onClick:()=>{e.setParams(d=>{let u=[...r];return u.push({column_id:s,transformation:"no-op"}),f(m({},d),{[e.rowOrColumn]:u})})}}))))),Zt.default.createElement(fs,{columnIDsMap:t,selectedColumnIDs:r.map(({column_id:s})=>s),pivotSection:e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?"row":"column",mitoAPI:e.mitoAPI}),o)},Y1=R9;var Xr=T(_());var Wr=T(_());var W9=["count","count unique"],X9=["count","count unique","mean","median","min","max"],J9=["count","count unique","sum","mean","median","min","max"],q1=(e,t,n)=>{if(e.length!==0)return n===void 0?{sourceSheetIndex:t,pivotRowColumnIDsWithTransforms:[],pivotColumnsColumnIDsWithTransforms:[],pivotValuesColumnIDsArray:[],pivotFilters:[],flattenColumnHeaders:!0,destinationSheetIndex:void 0}:Q1(n)},Q1=e=>({sourceSheetIndex:e.sheet_index,pivotRowColumnIDsWithTransforms:e.pivot_rows_column_ids_with_transforms,pivotColumnsColumnIDsWithTransforms:e.pivot_columns_column_ids_with_transforms,pivotValuesColumnIDsArray:z9(e.values_column_ids_map),pivotFilters:e.pivot_filters,flattenColumnHeaders:e.flatten_column_headers,destinationSheetIndex:e.destination_sheet_index}),RS=(e,t)=>{var o;let n=t!==void 0?((o=t[e.sourceSheetIndex])==null?void 0:o.columnDtypeMap)||{}:{},r=e.pivotFilters.map(({column_id:i,filter:a})=>{let s=n[i]||"",l=om([a],s);if(l.length!==0)return{column_id:i,filter:l[0]}}).filter(i=>i!==void 0);return{sheet_index:e.sourceSheetIndex,pivot_rows_column_ids_with_transforms:e.pivotRowColumnIDsWithTransforms,pivot_columns_column_ids_with_transforms:e.pivotColumnsColumnIDsWithTransforms,values_column_ids_map:K9(e.pivotValuesColumnIDsArray),pivot_filters:r,flatten_column_headers:e.flattenColumnHeaders,destination_sheet_index:e.destinationSheetIndex}},z9=e=>{let t=[];return Object.keys(e).forEach(n=>{e[n].forEach(r=>{t.push([n,r])})}),t},K9=e=>{let t={};for(let n=0;n{if(Zn(t)&&!W9.includes(e))return"Not valid for string column";if(it(t)&&!X9.includes(e))return"Not valid for datetime column";if(Er(t)&&!J9.includes(e))return"Not valid for timedelta column"};var $9=e=>{let t=Object.values(Ml),n=r=>{let o=r;t.includes(o)&&e.editPivotValueAggregation(o,e.columnID)};return Wr.default.createElement(I,{align:"center"},Wr.default.createElement(C,null,Wr.default.createElement($,{value:e.aggregationType,onChange:n,width:"small",dropdownWidth:"medium"},t.map(r=>{let o=$m(r,e.columnDtype);return Wr.default.createElement(v,{key:r,title:r,disabled:o!==void 0,subtext:o,hideSubtext:!0,displaySubtextOnHover:!0})}))),Wr.default.createElement(C,{offset:1,flex:"1"},Wr.default.createElement($,{value:e.columnID,onChange:r=>{e.editPivotValueAggregation(e.aggregationType,r)},searchable:!0},Object.keys(e.columnIDsMap).map(r=>{let o=e.columnIDsMap[r];return Wr.default.createElement(v,{key:r,id:r,title:G(o)})}))),Wr.default.createElement(C,{offset:1,offsetRight:1},Wr.default.createElement(at,{onClick:()=>e.removePivotValueAggregation()})))},WS=$9;var Z9="Values are used to summarize your source data for each of the pivot table buckets. These buckets are created by the rows and/or columns selected above.",Y9=e=>{var r,o;let t=((r=e.sheetData)==null?void 0:r.columnIDsMap)||{},n=((o=e.sheetData)==null?void 0:o.columnDtypeMap)||{};return Xr.default.createElement("div",null,Xr.default.createElement(I,{justify:"space-between",align:"center"},Xr.default.createElement(C,null,Xr.default.createElement(de,{tooltip:Z9},"Values")),Xr.default.createElement(C,null,Xr.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([i,a])=>Xr.default.createElement(v,{key:i,title:G(a),onClick:()=>{e.setParams(s=>{let l=[...s.pivotValuesColumnIDsArray];return l.push([i,"count"]),f(m({},s),{pivotValuesColumnIDsArray:l})})}}))))),Xr.default.createElement(fs,{columnIDsMap:t,pivotSection:"values",selectedColumnIDs:e.params.pivotValuesColumnIDsArray.map(([i])=>i),mitoAPI:e.mitoAPI}),e.params.pivotValuesColumnIDsArray.map(([i,a],s)=>{var d;let l=((d=e.sheetData)==null?void 0:d.columnDtypeMap[i])||"";return Xr.default.createElement(WS,{key:i+s+a,columnIDsMap:t,columnID:i,columnDtype:l,aggregationType:a,removePivotValueAggregation:()=>{e.setParams(u=>{let c=[...u.pivotValuesColumnIDsArray];return c.splice(s,1),f(m({},u),{pivotValuesColumnIDsArray:c})})},editPivotValueAggregation:(u,c)=>{e.setParams(p=>{let h=[...p.pivotValuesColumnIDsArray],x=n[c]||"";return $m(a,x)!==void 0&&(u="count"),h[s]=[c,u],f(m({},p),{pivotValuesColumnIDsArray:h})})}})}))},XS=Y9;var cn=T(_());var q9="Filters are used to only include a subset of the source data in the pivot table.",Q9=e=>{var o;let t=((o=e.sheetData)==null?void 0:o.columnIDsMap)||{},n=Object.keys(t),r={};return Object.entries(t).map(([i,a])=>{r[i]=G(a)}),cn.default.createElement("div",null,cn.default.createElement(I,{justify:"space-between",align:"center"},cn.default.createElement(C,null,cn.default.createElement(de,{tooltip:q9},"Filters")),cn.default.createElement(C,null,cn.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([i,a])=>cn.default.createElement(v,{key:i,title:G(a),onClick:()=>{e.setParams(s=>{let d=[{column_id:i,filter:{condition:"not_empty",value:""}}].concat(s.pivotFilters);return f(m({},s),{pivotFilters:d})})}}))))),e.error!==void 0&&e.error.includes("filter")&&cn.default.createElement("p",{className:"text-color-error"},e.error),cn.default.createElement(fs,{columnIDsMap:t,pivotSection:"values",selectedColumnIDs:e.params.pivotFilters.map(({column_id:i})=>i),mitoAPI:e.mitoAPI}),e.params.pivotFilters.map(({column_id:i,filter:a},s)=>{var d;let l=((d=e.sheetData)==null?void 0:d.columnDtypeMap[i])||"";return cn.default.createElement("div",{className:"mito-blue-container mb-5px",key:s},cn.default.createElement(I,{suppressTopBottomMargin:!0},cn.default.createElement(Nr,{value:i,titleMap:r,onChange:u=>{e.setParams(c=>{let p=[...c.pivotFilters];return p[s].column_id=u,f(m({},c),{pivotFilters:p})})},onDelete:()=>{e.setParams(u=>{let c=[...u.pivotFilters];return c.splice(s,1),f(m({},u),{pivotFilters:c})})},selectableValues:n})),cn.default.createElement(I,{suppressTopBottomMargin:!0},cn.default.createElement(ri,{filter:a,operator:"And",displayOperator:!1,setFilter:u=>{e.setParams(c=>{let p=[...c.pivotFilters];return p[s].filter=u,f(m({},c),{pivotFilters:p})})},columnDtype:l,nameLength:"short_name",suppressTopBottomMargin:!0}),cn.default.createElement(C,{span:3.5})))}))},JS=Q9;var ew=e=>{let{params:t,setParams:n,error:r}=Dn(()=>q1(e.sheetDataArray,e.sourceSheetIndex,e.existingPivotParams),"pivot",e.mitoAPI,e.analysisData,0,{getBackendFromFrontend:RS,getFrontendFromBackend:Q1},{doNotSendDefaultParams:e.destinationSheetIndex!==void 0},e.sheetDataArray);if(t===void 0)return Sn.default.createElement(ge,{setUIState:e.setUIState});let o=e.sheetDataArray[t.sourceSheetIndex];return Sn.default.createElement(Y,null,Sn.default.createElement(Q,{header:e.destinationSheetIndex?`Edit Pivot Table ${e.dfNames[e.destinationSheetIndex]}`:`Create Pivot Table ${e.dfNames[e.dfNames.length-1]}`,setUIState:e.setUIState}),Sn.default.createElement(q,null,r!==void 0&&!r.includes("filter")&&Sn.default.createElement("p",{className:"text-color-error"},r),Sn.default.createElement(Lt,{title:"Dataframe to pivot",sheetDataArray:e.sheetDataArray,sheetIndex:t.sourceSheetIndex,onChange:i=>{let a=q1(e.sheetDataArray,i,void 0);n(s=>a||s)},sheetIndexToIgnore:e.destinationSheetIndex}),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(Y1,{mitoAPI:e.mitoAPI,sheetData:o,sectionTitle:"Rows",params:t,setParams:n,rowOrColumn:"pivotRowColumnIDsWithTransforms"})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(Y1,{mitoAPI:e.mitoAPI,sheetData:o,sectionTitle:"Columns",params:t,setParams:n,rowOrColumn:"pivotColumnsColumnIDsWithTransforms"})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(XS,{mitoAPI:e.mitoAPI,sheetData:o,params:t,setParams:n})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(JS,{error:r,sheetData:o,params:t,setParams:n,mitoAPI:e.mitoAPI}))))},zS=ew;var ie=T(_());var Le=T(_());var ps=T(_()),tw=()=>{let[e,t]=(0,ps.useState)(1);return(0,ps.useEffect)(()=>{let n=setInterval(()=>{t(r=>r+1)},1e3);return()=>clearInterval(n)},[]),ps.default.createElement("span",null," \xA0( ",e,"s )")},sd=tw;var nw=()=>({type:"username/password",username:"",password:"",account:""}),rw=e=>{let[t,n]=(0,Le.useState)(()=>e.defaultCredentials||nw()),[r,o]=(0,Le.useState)(e.defaultCredentials?{type:"success"}:void 0),[i,a]=(0,Le.useState)(!1),s=async l=>{a(!0);let d=await e.mitoAPI.validateSnowflakeCredentials(l),u="error"in d?void 0:d.result;o(u),(u==null?void 0:u.type)==="success"?e.onValidCredentials():e.onInvalidCredentials!==void 0&&e.onInvalidCredentials(),a(!1)};return Le.default.createElement("div",{className:"mito-collapsible-content-card-container"},Le.default.createElement(je,{title:Le.default.createElement("div",{className:M("text-header-3",{"text-color-gray-disabled":i})},"Connection"),open:e.isOpen},Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Username")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.username,disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{username:d}))}}))),Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Password")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.password,type:"password",disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{password:d}))}}))),Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Account")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.account,disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{account:d}))}}))),Le.default.createElement(j,{disabled:t.username.length===0||t.password.length===0||t.account.length===0||i,disabledTooltip:"Please fill out the username, password, and account fields below.",onClick:async()=>{await s(t)},variant:"dark"},"Connect to Snowflake")),!i&&r!==void 0&&Le.default.createElement("div",{className:M({"text-color-error":r.type==="error","text-color-success":r.type==="success"},"mito-collapsible-content-card-subtext")},r.type==="success"&&"Successfully connected to Snowflake instance.",r.type==="error"&&r.error_message),i&&Le.default.createElement(I,{suppressTopBottomMargin:!0,className:M("text-subtext-1","mito-collapsible-content-card-subtext")},Le.default.createElement("p",null,"Connecting to Snowflake"),Le.default.createElement(sd,null)))},Zm=rw;var KS="Used to specify the number of rows to return. When working with large datasets, it might be helpful to begin with a subset of your data.",$S=()=>({table_loc_and_warehouse:{warehouse:void 0,database:void 0,schema:void 0,table_or_view:void 0},query_params:{columns:[],limit:void 0}}),eh=(e,t,n,r)=>{let o=window.structuredClone(e),i=f(m({},o),{table_loc_and_warehouse:f(m({},o.table_loc_and_warehouse),{database:t,schema:n,table_or_view:r}),query_params:{columns:[],limit:void 0}});return JSON.stringify(i)===JSON.stringify(e)?e:i},ow=e=>{var S;let{params:t,setParams:n,edit:r,loading:o,error:i}=wt(()=>$S(),"snowflake_import",e.mitoAPI,e.analysisData,void 0,g=>{g!==void 0&&D(g)}),[a,s]=(0,ie.useState)(e.userProfile.snowflakeCredentials!==null),[l,d]=(0,ie.useState)(e.userProfile.snowflakeCredentials===null),[u,c]=(0,ie.useState)(void 0),[p,h]=(0,ie.useState)(!1);(0,ie.useEffect)(()=>{e.userProfile.snowflakeCredentials!==null&&t!==void 0&&D(t)},[]);let x=g=>{n(g),D(g)};if(t===void 0)return ie.default.createElement(ge,{setUIState:e.setUIState});let D=async g=>{h(!0);let y=await e.mitoAPI.getAvailableSnowflakeOptionsAndDefaults(g.table_loc_and_warehouse),w="error"in y?void 0:y.result;c(w),(w==null?void 0:w.type)==="success"&&n(P=>f(m({},P),{table_loc_and_warehouse:w.default_values})),h(!1)};return ie.default.createElement(Y,null,ie.default.createElement(Q,{header:"Import from Snowflake",setUIState:e.setUIState}),ie.default.createElement(q,{userProfile:e.userProfile,requiresEnterprise:e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_ENABLE_SNOWFLAKE_IMPORT?void 0:{featureName:"snowflake_import",mitoAPI:e.mitoAPI}},ie.default.createElement(Zm,{mitoAPI:e.mitoAPI,defaultCredentials:e.userProfile.snowflakeCredentials,onValidCredentials:()=>{d(!1),s(!0),D(t)},onInvalidCredentials:()=>{s(!1),n($S()),c(void 0)},isOpen:l}),ie.default.createElement(se,{px:20}),ie.default.createElement(je,{title:ie.default.createElement("div",{className:M("text-header-3",{"text-color-gray-disabled":p})},"Configure Query"),open:(u==null?void 0:u.type)==="success"},ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Warehouse")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.warehouse||"None available",disabled:p,onChange:g=>{n(y=>jt(y,{table_loc_and_warehouse:{warehouse:g}}))}},(u==null?void 0:u.type)==="success"?u.config_options.warehouses.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Database")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.database||"None available",disabled:p,onChange:g=>{let y=eh(t,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.databases.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Schema")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.schema||"None available",disabled:p,onChange:g=>{let y=eh(t,t.table_loc_and_warehouse.database,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.schemas.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Table/View")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.table_or_view||"None available",disabled:p,onChange:g=>{let y=eh(t,t.table_loc_and_warehouse.database,t.table_loc_and_warehouse.schema,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.tables_and_views.map(g=>ie.default.createElement(v,{key:g,title:g})):[]))),p&&ie.default.createElement(I,{className:M("text-subtext-1")},ie.default.createElement("p",null,"Loading Snowflake options"),ie.default.createElement(sd,null))),(u==null?void 0:u.type)==="success"&&ie.default.createElement("div",null,ie.default.createElement(I,{justify:"start"},ie.default.createElement("p",{className:"text-header-3"},"Columns to Import")),ie.default.createElement(Gr,{disabled:p,height:"medium",onToggleAll:g=>{n(y=>{let w=g.map(P=>u.config_options.columns[P]);return jt(y,{query_params:{columns:w}})})}},u.config_options.columns.map((g,y)=>{let w=t.query_params.columns.includes(g);return ie.default.createElement(hr,{key:g,title:g,toggled:w,onToggle:()=>{n(P=>{let N=[...P.query_params.columns];return br(N,g),jt(P,{query_params:{columns:N}})})},index:y})})),ie.default.createElement(I,{justify:"space-between",align:"center",title:KS},ie.default.createElement(C,null,ie.default.createElement(de,{tooltip:KS},"Limit")),ie.default.createElement(C,null,ie.default.createElement(ne,{width:"medium",value:((S=t.query_params.limit)==null?void 0:S.toString())||"",placeholder:"100000",disabled:p,onChange:g=>{let y=parseInt(g.target.value);isNaN(y)&&(y=void 0),n(w=>jt(w,{query_params:{limit:y}}))}}))),o&&ie.default.createElement(I,{className:M("text-subtext-1")},ie.default.createElement("p",null,"Executing query"),ie.default.createElement(sd,null)),i!==void 0&&ie.default.createElement("p",{className:"text-color-error"},i)),ie.default.createElement(I,null,ie.default.createElement(j,{disabled:!a||t.table_loc_and_warehouse.warehouse===void 0||t.table_loc_and_warehouse.database===void 0||t.table_loc_and_warehouse.schema===void 0||t.table_loc_and_warehouse.table_or_view===void 0||t.query_params.columns.length===0,disabledTooltip:"Fill out all required fields",onClick:()=>r(),variant:"dark"},"Run Query"))))},ZS=ow;var Ie=T(_());var Ym=T(_()),iw=e=>Ym.default.createElement("div",{key:e.title,onClick:()=>{e.onToggle(e.id?e.id:e.title)},className:"text-body-2"},Ym.default.createElement("input",{type:"checkbox",name:e.title,value:e.id?e.id:e.title,checked:e.checked}),Ym.default.createElement("label",{style:{marginRight:"3px"},htmlFor:e.title},e.title)),YS=iw;var th={",":"Comma","-":"Dash"," ":"Tab"," ":"Space"},nh=(e,t,n)=>{var o;if(t.length===0||t[n]===void 0)return;let r;return e!==void 0&&Object.keys(t[n].columnIDsMap).includes(e)?r=e:r=Object.keys(((o=t[n])==null?void 0:o.columnIDsMap)||{})[0],{sheet_index:n,column_id:r,delimiters:[],new_column_header_suffix:_l()}},aw=e=>{var u,c;let{params:t,setParams:n,loading:r,edit:o,editApplied:i,result:a}=wt(()=>nh(e.startingColumnID,e.sheetDataArray,e.selectedSheetIndex),"split_text_to_columns",e.mitoAPI,e.analysisData),[s,l]=(0,Ie.useState)([]);(0,Ie.useEffect)(()=>{n(p=>{let h=nh(e.startingColumnID,e.sheetDataArray,e.selectedSheetIndex);return h||p})},[e.startingColumnID]),(0,Ie.useEffect)(()=>{d()},[t]);async function d(){if(t!==void 0&&t.column_id!==void 0&&t.delimiters.length>0){let p=await e.mitoAPI.getSplitTextToColumnsPreview(t),h="error"in p?void 0:p.result;l(h!==void 0?h.dfPreviewRowDataArray:[])}else l([])}return t===void 0||t.column_id===void 0?Ie.default.createElement(ge,{setUIState:e.setUIState}):Ie.default.createElement(Y,null,Ie.default.createElement(Q,{header:"Split Text to Columns",setUIState:e.setUIState}),Ie.default.createElement(q,null,Ie.default.createElement(Lt,{title:"Dataframe to select a column to split text within",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:p=>{n(h=>{let x=nh(void 0,e.sheetDataArray,p);return x||f(m({},h),{sheet_index:p})})}}),Ie.default.createElement(I,{justify:"space-between",align:"center"},Ie.default.createElement(C,null,Ie.default.createElement("p",{className:"text-header-3"},"Column")),Ie.default.createElement(C,null,Ie.default.createElement($,{width:"medium-large",value:G(((u=e.sheetDataArray[t.sheet_index])==null?void 0:u.columnIDsMap[t.column_id])||"select a column"),searchable:!0},Object.entries(((c=e.sheetDataArray[t.sheet_index])==null?void 0:c.columnIDsMap)||{}).map(([p,h])=>Ie.default.createElement(v,{key:p,title:G(h),onClick:()=>{n(x=>f(m({},x),{column_id:p}))}}))))),Ie.default.createElement(I,{justify:"space-between"},Ie.default.createElement(C,{span:6},Ie.default.createElement("p",{className:"text-header-3"},"Delimiters")),Ie.default.createElement(C,{className:"light-gray-container element-width-medium-large"},Object.entries(th).map(([p,h])=>Ie.default.createElement(YS,{key:h,id:p,title:h,checked:t.delimiters.includes(p),onToggle:x=>{n(D=>{let S=[...D.delimiters];return br(S,x),f(m({},D),{delimiters:S})})}})),Ie.default.createElement(ne,{value:t.delimiters.filter(p=>!Object.keys(th).includes(p))[0],placeholder:"Custom Delimiter",className:"mt-5px",onChange:p=>{let h=p.target.value;n(x=>{let D=[...x.delimiters].filter(S=>Object.keys(th).includes(S));return h!==""&&D.push(h),f(m({},x),{delimiters:D})})}}))),Ie.default.createElement("div",null,Ie.default.createElement(I,null,Ie.default.createElement("p",{className:"text-header-3"},"Columns Preview")),s.length>0&&Ie.default.createElement(I,{style:{width:"100%",overflowX:"auto"},suppressTopBottomMargin:!0},Ie.default.createElement("table",{className:"preview-table",cellSpacing:"0"},Ie.default.createElement("tbody",null,s.map((p,h)=>Ie.default.createElement("tr",{className:"preview-table-table-row",key:h},p.map((x,D)=>Ie.default.createElement("td",{className:"preview-table-table-data",key:D},""+x))))))),s.length===0&&Ie.default.createElement(I,{style:{width:"100%"},justify:"center"},Ie.default.createElement("p",{className:"mt-10px"},"Select a delimiter to preview the split")))),Ie.default.createElement(Me,null,Ie.default.createElement(j,{variant:"dark",width:"block",onClick:()=>o(p=>f(m({},p),{new_column_header_suffix:_l()})),disabled:t.delimiters.length===0,disabledTooltip:"Select at least one delimiter"},i?r?"Splitting column ...":`Split on delimiter${t.delimiters.length>1?"s":""}`:`Split on delimiter${t.delimiters.length>1?"s":""}`),i&&Ie.default.createElement("p",{className:"text-subtext-1"},"Created ",a==null?void 0:a.num_cols_created," new columns"),!i&&Ie.default.createElement(se,{px:18})))},qS=aw;var Yt=T(_());var Vn=T(_());var sw=e=>e.df_names.length===0?"Select dataframe to update":`Update to ${e.df_names[0]}`,lw=e=>{var o,i;let[t,n]=ln([],async()=>{let a=await e.mitoAPI.getDefinedDfNames();return"error"in a?void 0:a.result},void 0,[]),r=Vn.default.createElement(Wm,{values:t,selectedValue:(o=e.params)==null?void 0:o.df_names[0],onChange:a=>e.setParams(s=>f(m({},s),{df_names:[a]})),loading:n});return e.params===void 0?Vn.default.createElement("div",{className:"text-body-1"},"There has been an error loading dataframes to import. Please try again, or ",Vn.default.createElement("a",{className:"text-body-1-link",href:"https://join.slack.com/t/trymito/shared_invite/zt-1h6t163v7-xLPudO7pjQNKccXz7h7GSg",target:"_blank",rel:"noreferrer"},"contact support"),"."):Vn.default.createElement(Y,null,Vn.default.createElement(Q,{header:e.isUpdate?"Import Dataframes":"Update Import",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),Vn.default.createElement(q,null,Vn.default.createElement(I,{justify:"start",align:"center"},Vn.default.createElement(C,null,Vn.default.createElement(de,{tooltip:"Dataframes that have been created elsewhere in this notebook can be imported through this taskpane."},"Dataframes to Import"))),r,Vn.default.createElement(se,{px:10})),Vn.default.createElement(Me,null,Vn.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},disabled:(((i=e.params)==null?void 0:i.df_names.length)||0)===0},sw(e.params))))},QS=lw;var En=T(_());var le=T(_());var rh=T(_()),dw=()=>rh.default.createElement("svg",{width:"10",height:"15",viewBox:"0 0 10 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rh.default.createElement("path",{d:"M1.36401 1.13672L7.72797 7.50068L1.36401 13.8646",stroke:"#494650",strokeWidth:"2",strokeLinecap:"round"})),e4=dw;function n4(e){return e!==void 0&&"file_names"in e&&!("sheet_names"in e)}function r4(e){return e!==void 0&&"sheet_names"in e}function o4(e){return e!==void 0&&"df_names"in e}var i4=e=>e.replace(/^.*[\\\\/]/,"");function uw(e,t,n){let r=[...e],o=0;return r.forEach(i=>{o+i.imports.length>t&&(i.imports[t-o]=n),o+=i.imports.length}),r}var t4=e=>e===void 0?[]:e.map(t=>t.imports).flat(),qm=(e,t)=>{let n=t4(e),r=e!==void 0&&t===void 0?n:t4(t);return n.map((o,i)=>[o,r[i]])},hs=(e,t,n,r,o,i)=>{n(a=>{if(a!==void 0)return uw(a,e,t)}),r(a=>{if(a.includes(e))return a;let s=[...a];return s.push(e),s}),o(a=>{let s=m({},a);return s[e]!==void 0&&delete s[e],s}),i(void 0)},a4=(e,t,n,r,o)=>{e!==void 0&&e.forEach((i,a)=>{i.imports[0].step_type==="snowflake_import"&&hs(a,i.imports[0],t,n,r,o)})},gs=e=>e+" Update imports to fix this error.";var ys=e=>{let t=i4(e);return le.default.createElement("span",{title:e},t)},na=e=>le.default.createElement("span",{title:e||"not definend"},e),mw=e=>e.step_type==="excel_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.sheet_names[0])," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_name)):e.step_type==="simple_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",ys(e.params.file_names[0])):e.step_type==="dataframe_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.df_names[0])):e.step_type==="excel_range_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.range_imports[0].df_name)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_path)):e.step_type==="snowflake_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.table_loc_and_warehouse.table_or_view)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from Snowflake ")):le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)),cw=(e,t,n)=>n?e.step_type==="excel_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.sheet_names[0])," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_name)):e.step_type==="simple_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",ys(e.params.file_names[0])):e.step_type==="dataframe_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.df_names[0])):e.step_type==="excel_range_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.range_imports[0].df_name)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_path)):e.step_type==="snowflake_import"?le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)):le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)):t!==void 0?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-error-important text-overflow-wrap"},t)):null,fw=e=>{let t=e.displayedImportCardDropdown===e.dataframeCreationIndex,n=()=>{e.setDisplayedImportCardDropdown(e.dataframeCreationIndex)},r=()=>{e.setDisplayedImportCardDropdown(i=>{if(i!==e.dataframeCreationIndex)return i})},o=()=>{let i=[];return e.dataframeCreationData.step_type==="snowflake_import"&&i.push(le.default.createElement(v,{key:"Connect to Snowflake",title:"Connect to Snowflake",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"authenticate_to_snowflake"},params:void 0})}})),i=i.concat([le.default.createElement(v,{key:"Replace with file",title:"Replace with file",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"file_browser"},params:void 0})}}),le.default.createElement(v,{key:"Replace with dataframe",title:"Replace with dataframe",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"dataframe_import"},params:{df_names:[]}})}})]),i};return le.default.createElement(I,{justify:"space-between",align:"top",onClick:()=>{n()}},le.default.createElement(C,{span:22},le.default.createElement(I,{align:"top"},le.default.createElement("div",{className:"mt-1px"},le.default.createElement(Gm,null)),le.default.createElement(C,{span:22,offset:.25},mw(e.dataframeCreationData),cw(e.updatedDataframeCreationData,e.preUpdateInvalidImportMessage,e.isUpdated))),e.postUpdateInvalidImportMessage&&le.default.createElement(I,{align:"top"},le.default.createElement(C,{span:22,offset:1.2},le.default.createElement("span",{className:"text-color-error-important text-overflow-wrap"},e.postUpdateInvalidImportMessage)))),le.default.createElement(C,{className:"mt-3px"},le.default.createElement("div",null,le.default.createElement(e4,null),le.default.createElement(pe,{display:t,closeDropdown:()=>r(),width:"medium"},o()))))},Qm=fw;var pw=e=>{var s,l,d;let[t,n]=(0,En.useState)(!1),r=null;if(e.importDataAndErrors===void 0)r=En.default.createElement("p",null,"Loading previously imported data...");else{if((((s=e.importDataAndErrors)==null?void 0:s.importData.length)||0)===0&&e.sheetDataArray.length===0)return En.default.createElement(ge,{setUIState:e.setUIState,message:"Before changing imports, you need to import something."});if((((l=e.importDataAndErrors)==null?void 0:l.importData.length)||0)===0)return En.default.createElement(ge,{header:"Update passed dataframes",setUIState:e.setUIState,message:"You can change imports by changing the data passed to the mitosheet.sheet call above.",suppressImportLink:!0});r=qm(((d=e.importDataAndErrors)==null?void 0:d.importData)||[],e.updatedStepImportData).map(([c,p],h)=>En.default.createElement(Qm,{key:h,dataframeCreationIndex:h,dataframeCreationData:c,isUpdated:e.updatedIndexes.includes(h),updatedDataframeCreationData:p,displayedImportCardDropdown:e.displayedImportCardDropdown,setDisplayedImportCardDropdown:e.setDisplayedImportCardDropdown,setReplacingDataframeState:e.setReplacingDataframeState,preUpdateInvalidImportMessage:void 0,postUpdateInvalidImportMessage:e.invalidImportMessages[h]}))}let o=e.updatedIndexes.length>0,i=Object.keys(e.invalidImportMessages).length>0,a=!o||i||t;return En.default.createElement(Y,null,En.default.createElement(Q,{header:"Change Imports",setUIState:e.setUIState}),En.default.createElement(q,null,e.invalidReplayError&&En.default.createElement("p",{className:"text-color-error"},e.invalidReplayError),r),En.default.createElement(Me,null,En.default.createElement(j,{variant:"dark",onClick:async()=>{let u=async()=>{if(e.updatedStepImportData===void 0)return;let c=await e.mitoAPI.getTestImports(e.updatedStepImportData),p="error"in c?void 0:c.result;if(p!==void 0&&(e.setInvalidImportMessages(p),e.mitoAPI.log("clicked_update_from_post_replay_update_imports"),e.mitoAPI.log("get_test_import_results",{open_due_to_replay_error:!1,num_invalid_imports:Object.keys(p).length}),Object.keys(p).length===0)){let h=await e.mitoAPI.updateExistingImports(e.updatedStepImportData);"error"in h?e.setInvalidReplayError(gs(h.error)):e.setUIState(x=>f(m({},x),{currOpenTaskpane:{type:"none"},currOpenPopups:f(m({},x.currOpenPopups),{["top_right"]:{type:"ephemeral_message",message:"Successfully replayed analysis on new data"}})}))}};n(!0),await u(),n(!1)},disabled:a,disabledTooltip:a?"Please resolve all errors with above imports.":void 0},En.default.createElement("p",{className:"text-align-center-important"},t?"Changing Imports...":"Change Imports"))))},s4=pw;var fn=T(_());var ec="Please fix failed data imports to replay analysis.",hw=e=>{var l;let[t,n]=(0,fn.useState)(!1),r=null,o=e.importDataAndErrors===void 0;e.importDataAndErrors===void 0?r=fn.default.createElement("p",null,"Loading previously imported data..."):r=qm(e.importDataAndErrors.importData,e.updatedStepImportData).map(([u,c],p)=>{var h;return fn.default.createElement(Qm,{key:p,dataframeCreationIndex:p,dataframeCreationData:u,isUpdated:e.updatedIndexes.includes(p),updatedDataframeCreationData:c,displayedImportCardDropdown:e.displayedImportCardDropdown,setDisplayedImportCardDropdown:e.setDisplayedImportCardDropdown,setReplacingDataframeState:e.setReplacingDataframeState,preUpdateInvalidImportMessage:(h=e.importDataAndErrors)==null?void 0:h.invalidImportMessages[p],postUpdateInvalidImportMessage:e.postUpdateInvalidImportMessages[p]})});let i=Object.keys(((l=e.importDataAndErrors)==null?void 0:l.invalidImportMessages)||{}).filter(d=>!e.updatedIndexes.includes(parseInt(d))).length===0,a=Object.keys(e.postUpdateInvalidImportMessages).length>0,s=!i||a||o||t;return fn.default.createElement(Y,null,fn.default.createElement(Q,{header:"Change Imports to Replay Analysis",setUIState:e.setUIState,notCloseable:!0}),fn.default.createElement(q,null,(e.invalidReplayError===ec&&!i||e.invalidReplayError!==void 0&&e.invalidReplayError!==ec)&&fn.default.createElement("p",{className:"text-color-error"},e.invalidReplayError),r),fn.default.createElement(Me,null,fn.default.createElement(I,{justify:"space-between"},fn.default.createElement(C,null,fn.default.createElement(j,{variant:"light",width:"medium",onClick:()=>{$u(e.failedReplayData.analysisName,e.analysisData.analysisName,e.mitoAPI),e.mitoAPI.log("clicked_start_new_analysis_from_pre_replay_update_imports"),e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"none"}}))},tooltip:"This will start a new analysis with no steps in this mitosheet."},"Start New Analysis")),fn.default.createElement(C,{span:12},fn.default.createElement(j,{variant:"dark",onClick:async()=>{let d=async()=>{if(e.updatedStepImportData===void 0)return;let u=await e.mitoAPI.getTestImports(e.updatedStepImportData),c="error"in u?void 0:u.result;if(c!==void 0&&(e.setPostUpdateInvalidImportMessages(c),e.mitoAPI.log("clicked_update_from_pre_replay_update_imports"),e.mitoAPI.log("get_test_import_results",{num_invalid_imports:Object.keys(c).length,open_due_to_replay_error:!0}),Object.keys(c).length===0)){e.setInvalidReplayError(void 0);let p=await e.mitoAPI.updateReplayAnalysis(e.failedReplayData.analysisName,e.failedReplayData.args,e.updatedStepImportData);"error"in p?e.setInvalidReplayError(gs(p.error)):e.setUIState(h=>f(m({},h),{currOpenTaskpane:{type:"none"},currOpenPopups:f(m({},h.currOpenPopups),{["top_right"]:{type:"ephemeral_message",message:"Successfully replayed analysis on new data"}})}))}};n(!0),await d(),n(!1)},disabled:s,disabledTooltip:s?"Please resolve all errors with above imports.":void 0},fn.default.createElement("p",{className:"text-align-center-important"},t?"Updating Imports...":"Retry With Updated Imports"))))))},l4=hw;var ld=T(_());var gw=e=>ld.default.createElement(Y,null,ld.default.createElement(Q,{header:"Connect to Snowflake",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),ld.default.createElement(q,null,ld.default.createElement(Zm,{mitoAPI:e.mitoAPI,onValidCredentials:()=>e.edit(),isOpen:!0}))),d4=gw;var yw=e=>{let t=e.failedReplayData,n=t!==void 0,[r,o]=(0,Yt.useState)(void 0),[i,a]=(0,Yt.useState)([]),[s,l]=(0,Yt.useState)(void 0),[d,u]=(0,Yt.useState)(void 0),[c,p]=(0,Yt.useState)({}),[h]=ln(void 0,async()=>{let g,y;if(t!==void 0){let w=await e.mitoAPI.getImportedFilesAndDataframesFromAnalysisName(t.analysisName,t.args);g="error"in w?void 0:w.result;let P=await e.mitoAPI.getTestImports(g||[]);y="error"in P?{}:P.result}else{let w=await e.mitoAPI.getImportedFilesAndDataframesFromCurrentSteps();g="error"in w?void 0:w.result,y={}}if(g!==void 0&&y!==void 0)return{importData:g,invalidImportMessages:y}},g=>{g!==void 0&&(o(y=>y===void 0?window.structuredClone(g.importData):y),t!==void 0&&(Object.keys(g.invalidImportMessages).length>0?D(ec):D(gs(t.error.error))))},[]),[x,D]=(0,Yt.useState)(void 0);if((0,Yt.useEffect)(()=>{e.mitoAPI.log("opened_update_imports_taskpane",{open_due_to_replay_error:n,num_invalid_imports:(h==null?void 0:h.invalidImportMessages)===void 0?0:Object.keys(h.invalidImportMessages).length,num_total_imports:(h==null?void 0:h.importData)===void 0?0:h==null?void 0:h.importData.length})},[h]),d===void 0)return e.failedReplayData!==void 0?Yt.default.createElement(l4,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,updatedStepImportData:r,setUpdatedStepImportData:o,updatedIndexes:i,setUpdatedIndexes:a,displayedImportCardDropdown:s,setDisplayedImportCardDropdown:l,setReplacingDataframeState:u,postUpdateInvalidImportMessages:c,setPostUpdateInvalidImportMessages:p,failedReplayData:e.failedReplayData,importDataAndErrors:h,invalidReplayError:x,setInvalidReplayError:D}):Yt.default.createElement(s4,{mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,setUIState:e.setUIState,updatedStepImportData:r,setUpdatedStepImportData:o,updatedIndexes:i,setUpdatedIndexes:a,displayedImportCardDropdown:s,setDisplayedImportCardDropdown:l,setReplacingDataframeState:u,invalidImportMessages:c,setInvalidImportMessages:p,importDataAndErrors:h,invalidReplayError:x,setInvalidReplayError:D});let S=d.importState;if(S.screen==="file_browser")return Yt.default.createElement(Vm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!0,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,setImportState:g=>{u({importState:g,params:void 0,dataframeCreationIndex:d.dataframeCreationIndex})},importCSVFile:async g=>{let y=[...e.currPathParts];y.push(g.name);let w=await e.mitoAPI.getPathJoined(y),P="error"in w?void 0:w.result;if(P===void 0)return;let N={step_type:"simple_import",params:{file_names:[P]}},A=await e.mitoAPI.getTestImports([{step_id:"fake_id",imports:[N]}]),k="error"in A?void 0:A.result;if(k===void 0||Object.keys(k).length>0){u({importState:{screen:"csv_import_config",fileName:g.name,filePath:P,error:k!==void 0?k[0]:void 0},params:void 0,dataframeCreationIndex:d.dataframeCreationIndex});return}hs(d.dataframeCreationIndex,N,o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n});if(S.screen==="csv_import_config"){let g=n4(d.params)?d.params:J1(S.filePath);return Yt.default.createElement(jm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!0,fileName:S.fileName,filePath:S.filePath,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:async()=>{var N;let y={step_type:"simple_import",params:g},w=await e.mitoAPI.getTestImports([{step_id:"fake_id",imports:[y]}]),P="error"in w?void 0:w.result;if(P===void 0||Object.keys(P).length>0){let A=P!==void 0?P[0]:void 0,k=A&&((N=S.error)==null?void 0:N.startsWith(A))?`${S.error} Still invalid.`:A;u({importState:f(m({},S),{error:k}),params:void 0,dataframeCreationIndex:d.dataframeCreationIndex});return}hs(d.dataframeCreationIndex,{step_type:"simple_import",params:g},o,a,p,u)},editApplied:!1,loading:!1,error:S.error,backCallback:()=>{u(void 0)},notCloseable:n})}else if(d.importState.screen==="xlsx_import_config"){let g=r4(d.params)?d.params:z1(d.importState.filePath);return Yt.default.createElement(Xm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!0,fileName:d.importState.fileName,filePath:d.importState.filePath,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:()=>{hs(d.dataframeCreationIndex,{step_type:"excel_import",params:g},o,a,p,u)},editApplied:!1,loading:!1,backCallback:()=>{u(void 0)},notCloseable:n})}else{if(d.importState.screen==="authenticate_to_snowflake")return Yt.default.createElement(d4,{mitoAPI:e.mitoAPI,setUIState:e.setUIState,edit:()=>{a4(r,o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n});{let g=o4(d.params)?d.params:{df_names:[]};return Yt.default.createElement(QS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!0,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:()=>{hs(d.dataframeCreationIndex,{step_type:"dataframe_import",params:g},o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n})}}},u4=yw;var Nt=T(_());var Sw=e=>{if(e.userDefinedImporters.length!==0)return{importer:e.userDefinedImporters[0].name}},Cw="You have not defined any importers. To define importers, pass them to the mitosheet.sheet call with the `importers` parameter. An importer is just a function that returns a pandas dataframe.",Iw=e=>{let[t,n]=(0,Nt.useState)(()=>Sw(e.analysisData)),[r,o]=(0,Nt.useState)(void 0),{edit:i}=km("user_defined_import",e.mitoAPI,e.analysisData);return Nt.default.createElement(Y,null,Nt.default.createElement(Q,{header:"Custom Import",setUIState:e.setUIState}),Nt.default.createElement(q,{requiresEnterprise:{featureName:"user_defined_import",mitoAPI:e.mitoAPI},userProfile:e.userProfile},t===void 0&&Nt.default.createElement("p",null,"Pass importers to the mitosheet.sheet call with the `importers` parameter. An importer is just a function that returns some number of pandas dataframes."),t!==void 0&&Nt.default.createElement(Nt.default.Fragment,null,Nt.default.createElement(I,{justify:"space-between",align:"center",title:"TODO"},Nt.default.createElement(C,null,Nt.default.createElement("p",{className:"text-header-3"},"Import Method")),Nt.default.createElement(C,null,Nt.default.createElement($,{width:"medium",value:t.importer,onChange:a=>{n(s=>f(m({},s),{importer:a}))}},e.analysisData.userDefinedImporters.map(a=>Nt.default.createElement(v,{key:a.name,title:a.name,subtext:a.docstring}))))),r!==void 0&&Nt.default.createElement("p",{className:"text-color-error"},r))),Nt.default.createElement(Me,null,Nt.default.createElement(j,{variant:"dark",width:"block",onClick:async()=>{if(t!==void 0){let a=await i(t);o(a)}},disabled:t===void 0,disabledTooltip:Cw},"Import Data")))},m4=Iw;var ah=T(_());var c4=(e,t,n,r,o)=>{let[i,a]=(0,ah.useState)("loading"),[s]=(0,ah.useState)(()=>new Ol(async()=>{let l=await e();if(typeof l=="string"){a(l);return}else return a("finished"),l},t,n,r,o));return{mitoAPI:s,sendFunctionStatus:i}};var wo=T(_());var _t=T(_());var sh=T(_()),xw=()=>sh.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sh.default.createElement("path",{d:"M8 15.25C12.0041 15.25 15.25 12.0041 15.25 8C15.25 3.99594 12.0041 0.75 8 0.75C3.99593 0.75 0.75 3.99594 0.75 8C0.75 12.0041 3.99593 15.25 8 15.25Z",fill:"#E8EBF8",stroke:"#ACACAD",strokeWidth:"0.5"})),f4=xw;var he=T(_());var dd=T(_()),ww=()=>dd.default.createElement("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dd.default.createElement("path",{d:"M3.58008 6.88696L6.87312 10.1738L10.16 6.88696",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),dd.default.createElement("path",{d:"M12.7458 9.68372L12.7334 12.1209C12.7272 13.1628 11.8838 14 10.8482 14H2.88532C1.84345 14 0.993832 13.1566 1.00003 12.1085V9.68372",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),dd.default.createElement("path",{d:"M6.87305 0.741211V9.11335",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),Ss=ww;var tc=T(_()),Tw=()=>tc.default.createElement("svg",{width:"19",height:"15",viewBox:"0 0 19 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tc.default.createElement("path",{d:"M7.17099 14.267C10.7582 14.267 13.6662 11.359 13.6662 7.77182C13.6662 4.18462 10.7582 1.27661 7.17099 1.27661C3.58378 1.27661 0.675781 4.18462 0.675781 7.77182C0.675781 11.359 3.58378 14.267 7.17099 14.267Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),tc.default.createElement("path",{d:"M11.6671 14.267C15.2543 14.267 18.1623 11.359 18.1623 7.77182C18.1623 4.18462 15.2543 1.27661 11.6671 1.27661C8.07988 1.27661 5.17188 4.18462 5.17188 7.77182C5.17188 11.359 8.07988 14.267 11.6671 14.267Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),p4=Tw;var pi=T(_()),_w=()=>pi.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pi.default.createElement("path",{d:"M14 1.39062H1V14.3906H14V1.39062Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M4.56445 1.71179V14.2353",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M1.24023 5.02649H13.7741",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M10.7165 7.89587V10.962H7.75391",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M9.74219 8.81775L10.747 7.80261L11.731 8.77632",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M8.01123 11.9564L6.99609 10.9412L7.9698 9.96753",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),nc=_w;var ra=T(_()),Dw=()=>ra.default.createElement("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ra.default.createElement("path",{d:"M9.27408 14.3835H4.67924C3.65951 14.3835 2.82795 13.558 2.83402 12.5322L2.84009 3.94946H11.1618L11.1193 12.5443C11.1193 13.564 10.2938 14.3835 9.27408 14.3835Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M1 3.94946H13",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M8.35669 1.4126H5.63742C5.21861 1.4126 4.88477 1.75251 4.88477 2.16525V3.94977H9.11542V2.16525C9.11542 1.75251 8.77551 1.4126 8.35669 1.4126Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M5.43164 6.69983V11.3796",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M8.38477 6.69983V11.3796",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),Cs=Dw;var ud=T(_()),vw=()=>ud.default.createElement("svg",{width:"11",height:"15",viewBox:"0 0 11 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ud.default.createElement("path",{d:"M7.44262 12.3725V13.6741C7.44262 14.0686 7.12049 14.3907 6.72604 14.3907H1.71657C1.32213 14.3907 1 14.0686 1 13.6741V2.07742C1 1.68297 1.32213 1.36084 1.71657 1.36084H6.72604C7.12049 1.36084 7.44262 1.68297 7.44262 2.07742V3.24103",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ud.default.createElement("path",{d:"M7.44141 5.41052V10.3411",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ud.default.createElement("path",{d:"M9.91371 7.87573H4.97656",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),rc=vw;var md=T(_()),Pw=e=>md.default.createElement("svg",{width:e.width||"25",height:e.height||"25",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},md.default.createElement("rect",{x:"8.67323",y:"2.56851",width:"2.27778",height:"9.93478",transform:"rotate(36.5296 8.67323 2.56851)",stroke:"black",strokeWidth:"0.5"}),md.default.createElement("rect",{x:"0.349697",y:"-0.0520781",width:"2.27778",height:"2.1087",transform:"matrix(0.80355 0.595237 0.595237 -0.80355 8.33261 2.44081)",stroke:"black",strokeWidth:"0.5"}),md.default.createElement("path",{d:"M1.9732 13.5266L4.22513 12.7599L2.05046 11.149L1.9732 13.5266Z",fill:"black"})),oa=Pw;var Tt=T(_()),bw=e=>Tt.default.createElement("svg",{width:e.width||"25",height:e.height||"25",viewBox:"0 0 36 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",fill:"#00090F"}),Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",fill:"url(#paint0_linear)"}),Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",stroke:"black",strokeWidth:"0.5"}),Tt.default.createElement("g",{filter:"url(#filter0_d)"},Tt.default.createElement("path",{d:"M22.5916 16.1028C18.6195 19.3058 16.0425 23.2075 11.7956 23.2075C7.55216 22.6146 4.79526 18.7684 4 14.3321C4 8.89088 15.1567 0.495911 20.9111 0.495911C29.6603 -3.03026 39.906 13.3076 22.5916 16.1028Z",fill:"#4FBFE8"}),Tt.default.createElement("path",{d:"M22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5046 19.4603 18.5655C18.663 19.3171 17.9036 20.0329 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.73525 22.3784 5.03904 18.6732 4.25006 14.3102C4.25756 13.0333 4.91743 11.5494 6.03489 10.0223C7.15426 8.49265 8.71139 6.94887 10.4529 5.56953C12.1938 4.19062 14.1116 2.98186 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727787C23.1081 -0.119971 25.3091 0.221693 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C32.0133 7.95094 31.9406 10.0545 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),Tt.default.createElement("defs",null,Tt.default.createElement("filter",{id:"filter0_d",x:"0",y:"0",width:"36",height:"31.2075",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Tt.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Tt.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Tt.default.createElement("feOffset",{dy:"4"}),Tt.default.createElement("feGaussianBlur",{stdDeviation:"2"}),Tt.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),Tt.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Tt.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),Tt.default.createElement("linearGradient",{id:"paint0_linear",x1:"24.6767",y1:"23.0067",x2:"-1.7759",y2:"-21.8983",gradientUnits:"userSpaceOnUse"},Tt.default.createElement("stop",{stopColor:"#D17485"}),Tt.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),h4=bw;var Jr=T(_()),Ew=()=>Jr.default.createElement("svg",{width:"20",height:"14",viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jr.default.createElement("rect",{x:"0.5",y:"0.5",width:"6",height:"13",rx:"0.5",stroke:"#494650"}),Jr.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("rect",{x:"13.5",y:"0.5",width:"6",height:"13",rx:"0.5",stroke:"#494650"}),Jr.default.createElement("path",{d:"M18 3.5L15 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M10.3675 5.83334L11 7.00559L10.3934 8.15366",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M10.9103 7.01642H9",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),g4=Ew;var lh=T(_()),Aw=()=>lh.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lh.default.createElement("path",{d:"M3.13939 1.29046V8.80908M1.14394 3.28045H8.66878M4.7103 5.28418H5.6307L6.90303 5.26621V7.04481M5.26378 5.86944L4.65433 5.26621L5.2389 4.67542M7.5 6.89055L6.89055 7.5L6.30598 6.91543M1 1.09766H8.80469V8.90234H1V1.09766Z",stroke:"#494650",strokeWidth:"0.600361",strokeMiterlimit:"10",strokeLinecap:"round"})),y4=Aw;var dh=T(_()),kw=()=>dh.default.createElement("svg",{width:"33",height:"15",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dh.default.createElement("path",{d:"M2.83203 1.3125V7H2.08984V1.3125H2.83203ZM4.66016 1.3125V1.92969H0.265625V1.3125H4.66016ZM10.3039 7L13.5199 1.424H7.07988L10.3039 7Z",fill:"#494650"})),oc=kw;var or=T(_()),Nw=()=>or.default.createElement("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},or.default.createElement("rect",{x:"0.5",y:"0.5",width:"11",height:"13",rx:"0.5",stroke:"#494650"}),or.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 3.5L7 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 7L7 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 10.5L7 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),S4=Nw;var Io=T(_()),Mw=()=>Io.default.createElement("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Io.default.createElement("rect",{x:"0.5",y:"15.5",width:"5",height:"9",rx:"0.5",transform:"rotate(-90 0.5 15.5)",stroke:"#494650"}),Io.default.createElement("path",{d:"M3.44 11.74L3.43999 14.26",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M6.94 11.74L6.93999 14.26",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("rect",{x:"16.5",y:"9.5",width:"5",height:"9",rx:"0.5",transform:"rotate(-180 16.5 9.5)",stroke:"#494650"}),Io.default.createElement("path",{d:"M12.74 6.56L15.26 6.56001",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M12.74 3.06L15.26 3.06001",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M8.02263 3.5L8.02263 3.25L8.02263 3.25L8.02263 3.5ZM9.17677 3.67678C9.27441 3.57914 9.27441 3.42085 9.17678 3.32322L7.58578 1.73223C7.48815 1.6346 7.32986 1.6346 7.23223 1.73223C7.1346 1.82986 7.1346 1.98815 7.23223 2.08579L8.64644 3.5L7.23223 4.91421C7.1346 5.01184 7.1346 5.17013 7.23223 5.26777C7.32986 5.3654 7.48815 5.3654 7.58578 5.26777L9.17677 3.67678ZM8.02263 3.75L9 3.75L9 3.25L8.02263 3.25L8.02263 3.75ZM3.24897 8.97731C2.99378 6.17025 5.20399 3.75 8.02263 3.75L8.02263 3.25C4.90997 3.25 2.46922 5.92271 2.75103 9.02258L3.24897 8.97731Z",fill:"#494650"})),C4=Mw;var An=T(_()),Ow=()=>An.default.createElement("svg",{width:"17",height:"14",viewBox:"0 0 17 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},An.default.createElement("rect",{x:"7.5",y:"0.499969",width:"9",height:"13",rx:"0.5",stroke:"#494650"}),An.default.createElement("path",{d:"M11.1667 3.49997L8.66667 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 6.99997L8.66667 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 10.5L8.66667 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 3.49997L8.66667 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 6.99997L8.66667 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 10.5L8.66667 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 3.49997L12.8333 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 6.99997L12.8333 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 10.5L12.8333 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M3.82844 2.24857L5.59653 3.83479L4.01031 5.60288",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M6 10C4 10 6 10 4.09629 9.94194C2.38551 9.70294 1.19356 8.12387 1.43256 6.41309C1.67156 4.70232 3.25063 3.51036 4.96141 3.74936",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),I4=Ow;var ic=T(_()),Fw=()=>ic.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ic.default.createElement("path",{d:"M1.32422 4.71448L4.08798 8.82064L8.19415 6.05688",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ic.default.createElement("path",{d:"M10.6103 13.9999C14.2098 13.9999 17.1249 11.0848 17.1249 7.48529C17.1249 3.88582 14.2098 0.970703 10.6103 0.970703C7.01082 0.970703 4.0957 3.88582 4.0957 7.48529",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),ac=Fw;var sc=T(_()),Lw=()=>sc.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sc.default.createElement("path",{d:"M17.1239 4.71448L14.3602 8.82064L10.254 6.05688",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),sc.default.createElement("path",{d:"M7.83881 13.9999C4.23933 13.9999 1.32422 11.0848 1.32422 7.48529C1.32422 3.88582 4.23933 0.970703 7.83881 0.970703C11.4383 0.970703 14.3534 3.88582 14.3534 7.48529",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),lc=Lw;var dc=T(_()),Uw=()=>dc.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dc.default.createElement("path",{d:"M14.0287 10.0429C14.2915 10.1349 14.581 9.99671 14.6538 9.72797C14.9938 8.47296 14.9784 7.14441 14.6041 5.89227C14.1814 4.47868 13.323 3.23478 12.1512 2.33818C10.9795 1.44158 9.55445 0.938138 8.07954 0.89974C6.60464 0.861343 5.15531 1.28996 3.93852 2.12437C2.72173 2.95879 1.7997 4.15634 1.3041 5.54602C0.808504 6.9357 0.764674 8.44644 1.17887 9.86252C1.59307 11.2786 2.44412 12.5276 3.61049 13.4311C4.64364 14.2315 5.87741 14.7246 7.17065 14.8595C7.44758 14.8885 7.68076 14.6682 7.68967 14.3899V14.3899C7.69857 14.1116 7.47971 13.881 7.20315 13.8487C6.12249 13.7227 5.09307 13.3042 4.22798 12.634C3.22961 11.8606 2.50115 10.7916 2.14662 9.57945C1.79208 8.36735 1.8296 7.07422 2.25381 5.88471C2.67802 4.69521 3.46724 3.67015 4.50876 2.95593C5.55028 2.2417 6.79084 1.87483 8.0533 1.90769C9.31576 1.94056 10.5356 2.37149 11.5385 3.13894C12.5415 3.90639 13.2763 4.97112 13.638 6.18109C13.9515 7.22955 13.9709 8.3406 13.6991 9.39409C13.6296 9.66369 13.7659 9.95095 14.0287 10.0429V10.0429Z",fill:"#494650"}),dc.default.createElement("path",{d:"M11.0684 10.9853C10.8453 11.2084 10.4835 11.2084 10.2603 10.9853L8.23999 8.96498L6.21968 10.9853C5.99653 11.2084 5.63472 11.2084 5.41156 10.9853V10.9853C5.18841 10.7621 5.18841 10.4003 5.41156 10.1772L7.43187 8.15685L5.41156 6.13655C5.18841 5.91339 5.18841 5.55158 5.41156 5.32843V5.32843C5.63472 5.10527 5.99653 5.10527 6.21969 5.32843L8.23999 7.34873L10.2603 5.32843C10.4835 5.10527 10.8453 5.10527 11.0684 5.32843V5.32843C11.2916 5.55158 11.2916 5.91339 11.0684 6.13655L9.04811 8.15685L11.0684 10.1772C11.2916 10.4003 11.2916 10.7621 11.0684 10.9853V10.9853Z",fill:"#494650"})),uc=Uw;var xo=T(_()),Bw=()=>xo.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M3 2.29869V9.50504C3 9.7775 2.9 10 2.77755 10H1.22245C1.1 10 1 9.7775 1 9.50504V1.49495C1 1.2225 1.1 1 1.22245 1H2.77755C2.9 1 3 1.2225 3 1.49495V2.29869Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 1L6.89001 1C6.95055 1 7 1.1 7 1.22245V2.77755C7 2.9 6.95055 3 6.89001 3H5.10999C5.04944 3 5 2.9 5 2.77755V1.22245C5 1.1 5.04944 1 5.10999 1H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 4.5H6.89001C6.95055 4.5 7 4.6 7 4.72245V6.27755C7 6.4 6.95055 6.5 6.89001 6.5H5.10999C5.04944 6.5 5 6.4 5 6.27755V4.72245C5 4.6 5.04944 4.5 5.10999 4.5H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 8H6.89001C6.95055 8 7 8.1 7 8.22245V9.77755C7 9.9 6.95055 10 6.89001 10H5.10999C5.04944 10 5 9.9 5 9.77755V8.22245C5 8.1 5.04944 8 5.10999 8H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 1L10.89 1C10.9506 1 11 1.1 11 1.22245V2.77755C11 2.9 10.9506 3 10.89 3H9.10999C9.04944 3 9 2.9 9 2.77755V1.22245C9 1.1 9.04944 1 9.10999 1H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 4.5H10.89C10.9506 4.5 11 4.6 11 4.72245V6.27755C11 6.4 10.9506 6.5 10.89 6.5H9.10999C9.04944 6.5 9 6.4 9 6.27755V4.72245C9 4.6 9.04944 4.5 9.10999 4.5H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 8H10.89C10.9506 8 11 8.1 11 8.22245V9.77755C11 9.9 10.9506 10 10.89 10H9.10999C9.04944 10 9 9.9 9 9.77755V8.22245C9 8.1 9.04944 8 9.10999 8H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),x4=Bw;var cd=T(_()),Hw=()=>cd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 11 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cd.default.createElement("path",{d:"M10.5 3.5C10.5 1.84315 9.15685 0.5 7.5 0.5H3.5C1.84315 0.5 0.5 1.84315 0.5 3.5V3.5C0.5 5.15685 1.84315 6.5 3.5 6.5H7.5C9.15685 6.5 10.5 5.15685 10.5 3.5V3.5Z",fill:"#494650",stroke:"#494650",strokeWidth:"0.600361",strokeMiterlimit:"10",strokeLinecap:"round"}),cd.default.createElement("circle",{cx:"3",cy:"3.5",r:"1",transform:"rotate(-90 3 3.5)",fill:"#C8ADFF"}),cd.default.createElement("circle",{cx:"8",cy:"3.5",r:"1",transform:"rotate(-90 8 3.5)",fill:"#C8ADFF"})),mc=Hw;function uh(e,t,n){switch(e){case"initialize":return he.default.createElement(h4,null);case"ai_transformation":return he.default.createElement(mc,null);case"add_column":return he.default.createElement(rc,null);case"delete_column":return he.default.createElement(Cs,null);case"rename_column":return he.default.createElement(oa,{height:t,width:n});case"reorder_column":return he.default.createElement(oa,{height:t,width:n});case"filter_column":return he.default.createElement(Ka,{purpleOrDark:"dark"});case"set_column_formula":return he.default.createElement("div",{className:"step-taskpane-missing-icon"},"Fx");case"dataframe_delete":return he.default.createElement(Cs,null);case"dataframe_duplicate":return he.default.createElement(oa,{height:t,width:n});case"dataframe_rename":return he.default.createElement(oa,{height:t,width:n});case"simple_import":return he.default.createElement(Ss,null);case"dataframe_import":return he.default.createElement(Ss,null);case"excel_import":return he.default.createElement(Ss,null);case"sort":return he.default.createElement(oa,{height:t,width:n});case"pivot":return he.default.createElement(nc,null);case"melt":return he.default.createElement(y4,null);case"merge":return he.default.createElement(p4,null);case"drop_duplicates":return he.default.createElement(g4,null);case"graph":return he.default.createElement(os,null);case"change_column_dtype":return he.default.createElement(oc,null);case"delete_row":return he.default.createElement(Cs,null);case"split_text_to_columns":return he.default.createElement(S4,null);case"transpose":return he.default.createElement(C4,null);case"promote_row_to_header":return he.default.createElement(I4,null);case"one_hot_encoding":return he.default.createElement(x4,null);case"undo":return he.default.createElement(ac,null);case"redo":return he.default.createElement(lc,null);case"clear":return he.default.createElement(uc,null);default:return he.default.createElement(oa,{height:t,width:n})}}function Gw(e){let t=()=>{e.isCurrIdx?e.mitoAPI.updateCheckoutStepByIndex(e.lastIndex):e.mitoAPI.updateCheckoutStepByIndex(e.stepData.step_idx)},n=()=>{e.mitoAPI.updateUndoToStepIndex(e.stepData.step_idx)};return he.default.createElement("div",{className:"step-taskpane-step-container",style:{opacity:e.beforeCurrIdx?"1":".5"},onContextMenu:r=>{r.preventDefault(),r.stopPropagation(),e.setDisplayDropdown(e.stepIdx)},onClick:t},he.default.createElement("div",{className:"step-taskpane-step-icon"},uh(e.stepData.step_type)),he.default.createElement("div",{className:"element-width-block hide-scrollbar"},he.default.createElement("div",{className:"text-header-3"},e.stepData.step_display_name),he.default.createElement("div",{className:"text-body-2 text-overflow-scroll hide-scrollbar"},e.stepData.step_description)),he.default.createElement(pe,{display:e.displayDropdown,closeDropdown:()=>{e.setDisplayDropdown(void 0)}},he.default.createElement(v,{title:"Undo all following steps",onClick:()=>n(),disabled:!e.isPro,subtext:e.isPro?void 0:"Bulk step undo requires Mito Pro or Enterprise"}),he.default.createElement(v,{title:"View analysis at this step",onClick:()=>t()})))}var w4=Gw;var Vw=e=>e.endsWith("_edit"),jw=e=>Object.values(Qu).includes(e),Rw=e=>{switch(e){case"initialize":return"Created a Mitosheet";case"add_column":return"Adding a column";case"delete_column":return"Deleting a column";case"rename_column":return"Renaming a column";case"reorder_column":return"Reording a column";case"fill_na":return"Filling NaN values";case"filter_column":return"Filtering a column";case"set_column_formula":return"Setting a formula";case"dataframe_delete":return"Deleting a dataframe";case"dataframe_duplicate":return"Duplicating a dataframe";case"dataframe_rename":return"Renaming a dataframe";case"simple_import":return"Importing a CSV";case"sort":return"Sorting a dataframe";case"pivot":return"Pivoting a dataframe";case"merge":return"Merging dataframes";case"concat":return"Concatenating dataframes";case"drop_duplicates":return"Dropping duplicates";case"change_column_dtype":return"Changing a dtype";case"set_cell_value":return"Setting a cell value";case"bulk_old_rename":return"Bulk old rename";case"excel_import":return"Importing Excel file";case"graph":return"Creating graph";case"graph_duplicate":return"Duplicating graph";case"graph_delete":return"Deleting graph";case"graph_rename":return"Renaming graph";case"delete_row":return"Deleting row";case"promote_row_to_header":return"Promoting row to header";case"split_text_to_columns":return"Spliting column";case"transpose":return"Transposing dataframe";case"melt":return"Melting dataframe";case"set_dataframe_format":return"Changing formatting";case"one_hot_encoding":return"One hot encoding";case"dataframe_import":return"Dataframe Import";case"snowflake_import":return"Snowflake Import";case"excel_range_import":return"Excel Range Import";case"export_to_file":return"Generating Export Code";case"reset_index":return"Resetting Index";case"ai_transformation":return"Transforming with AI";case"column_headers_transform":return"Transforming Headers";case"user_defined_import":return"Importing";case"undo":return"Undoing previous edit";case"redo":return"Redoing previous edit";case"clear":return"Clearing all edits";case"args_update":return"Updating user profile";case"code_options_update":return"Updating code options";case"save_analysis_update":return"Saving analysis";case"replay_analysis_update":return"Replaying analysis";case"checkout_step_by_idx_update":return"Checking out step";case"append_user_field_update":return"Updating user profile";case"set_user_field_update":return"Updating user profile";case"update_feedback_v2_obj_update":return"Updating user profile";case"go_pro":return"Activating Mito Pro";case"render_count_update":return"Updating user profile";case"checklist_update":return"Updating checklist";case"update_existing_import_update":return"Changing imports";case"undo_to_step_index_update":return"Undoing steps"}},Ww=e=>{if(Vw(e))return e.substring(0,e.length-5);if(jw(e))return e},T4=e=>{let t=[];return e.filter(([,n])=>{if(n!==void 0){if(t.includes(n))return!1;t.push(n)}return!0}).map(([n,,r])=>[Ww(r),n]).filter(([n])=>n!==void 0)},Xw=(e,t)=>{let n=e&&t===e[1]&&e[0]<=Date.now()-1e4,r=e&&t===e[1]&&e[0]<=Date.now()-20*1e3,o=e&&t===e[1]&&e[0]<=Date.now()-30*1e3,i=e&&t===e[1]&&e[0]<=Date.now()-40*1e3,a=e&&t===e[1]&&e[0]<=Date.now()-40*1e3;if(e&&t===e[1]&&e[0]<=Date.now()-60*1e3)return"Still executing pandas code";if(a)return"Doing the dataframe dance";if(i)return"Working hard behind the scenes";if(o)return"Still executing pandas code";if(r)return"Doing the dataframe dance";if(n)return"Still executing pandas code"},Jw=e=>{let[t,n]=(0,_t.useState)(void 0);(0,_t.useEffect)(()=>{let o=setInterval(()=>{let i=T4(e.loading);i.length===0?n(void 0):n(a=>{let s=i[0][1];return a===void 0||s!==a[1]?[Date.now(),s]:a}),n(a=>a===void 0?a:[a[0],a[1]])},1e3);return()=>{clearInterval(o)}},[e.loading]);let r=T4(e.loading);return r.length===0?_t.default.createElement(_t.default.Fragment,null):_t.default.createElement(_t.default.Fragment,null,_t.default.createElement("p",{className:"loading-indicator-header text-header-3 text-color-white-important"},"Processing ",r.length," edit",r.length<=1?"":"s"),_t.default.createElement("div",{className:"loading-indicator-content"},r.map(([o,i],a)=>{let s=Xw(t,i);return o!==void 0&&_t.default.createElement("div",{key:a,className:M("mb-5px","mt-5px",{"text-color-medium-gray-important":a!==0})},_t.default.createElement("div",{key:a,className:M("loading-indicator-item")},_t.default.createElement("div",{className:"loading-indicator-icon",style:{opacity:a!==0?"50%":void 0}},uh(o,"15","15")),_t.default.createElement("div",{className:"ml-5px"},_t.default.createElement("div",{className:"text-body-1"},Rw(o)),s!==void 0&&_t.default.createElement("div",{className:"text-subtext-1"},s)),_t.default.createElement("div",{className:"loading-indicator-loader"},a===0&&_t.default.createElement(Nm,null),a!==0&&_t.default.createElement(f4,null))))})))},_4=Jw;var zw=e=>{let[t,n]=(0,wo.useState)(!1);return(0,wo.useEffect)(()=>{if(e.loading.length===0)n(!1);else if(e.loading.length>0){let r=setTimeout(()=>{n(!0)},500);return()=>{clearTimeout(r)}}},[e.loading.length]),wo.default.createElement(wo.default.Fragment,null,t&&wo.default.createElement("div",{className:"bottom-left-popup-container"},wo.default.createElement(_4,{loading:e.loading})))},D4=zw;var hi=T(_());var v4=T(_());var Kw=e=>{let t;switch(e.popupLocation){case"top_right":t="top-right-popup-container"}return v4.default.createElement("div",{className:M("popup-container",t,e.className)},e.children)},P4=Kw;var $w=e=>{let t=()=>{e.setUIState(n=>f(m({},n),{currOpenPopups:f(m({},n.currOpenPopups),{[e.popupLocation]:{type:"none"}})}))};return(0,hi.useEffect)(()=>{let n=setInterval(()=>{t()},6e3);return()=>{clearInterval(n)}},[e.message]),hi.default.createElement(P4,{popupLocation:e.popupLocation,className:"ephemeral-message-animation"},hi.default.createElement(I,{className:M("ephemeral-message-container"),align:"center",suppressTopBottomMargin:!0},hi.default.createElement("p",{className:M("text-body-1","text-color-white-important","mr-10px")},e.message),hi.default.createElement("div",{className:"mt-5px ml-5px",onClick:()=>t()},hi.default.createElement(at,{variant:"light"}))))},b4=$w;var gi=T(_());function Zw(e){let[t,n]=(0,gi.useState)(void 0);return gi.default.createElement(Y,null,gi.default.createElement(Q,{header:"Step History",setUIState:e.setUIState}),gi.default.createElement(q,null,gi.default.createElement("div",{className:"step-takspane-container"},e.stepSummaryList.map(r=>gi.default.createElement(w4,{key:r.step_id,beforeCurrIdx:r.step_idx<=e.currStepIdx,isCurrIdx:r.step_idx===e.currStepIdx,lastIndex:e.stepSummaryList[e.stepSummaryList.length-1].step_idx,stepData:r,mitoAPI:e.mitoAPI,stepIdx:r.step_idx,isPro:e.userProfile.isPro,displayDropdown:t===r.step_idx,setDisplayDropdown:()=>{n(o=>{if(o!==r.step_idx)return r.step_idx})}})))))}var E4=Zw;var ae=T(_());var A4=T(_()),k4=(e="",t="")=>{let[n,r]=(0,A4.useState)(e);return{value:n,placeholder:t,onChange:i=>{let a=i.target.value;r(a)}}};var mh=T(_()),Yw=()=>mh.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},mh.default.createElement("path",{d:"M2 8.88525L6.15622 12.4914C6.57338 12.8534 7.20496 12.8086 7.5669 12.3914L16.3562 2.26144",stroke:"#9D6CFF",strokeWidth:"4"})),N4=Yw;var kn=e=>ae.default.createElement(I,null,ae.default.createElement(C,{span:2},ae.default.createElement(N4,null)),ae.default.createElement("p",{className:"text-body-1"},e.text)),qw=e=>{let[t,n]=(0,ae.useState)(!1),r=k4("","mito-pro-access-code-ASKDJQWDKQWDLL"),[o,i]=(0,ae.useState)(!1),a=e.userProfile.isPro;return(0,ae.useEffect)(()=>{e.mitoAPI.log("opened_upgrade_to_pro_taskpane")},[]),!a&&!t?ae.default.createElement(Y,null,ae.default.createElement(Q,{header:"Upgrade to Mito Pro",setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement("p",{className:"text-body-1 mb-10px"},ae.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},ae.default.createElement("span",{className:"text-body-1-link"},"Mito Pro"))," gives you extra features to super charge your analysis:"),ae.default.createElement(kn,{text:"Turn off all telemetry"}),ae.default.createElement(kn,{text:"Generated code optimization"}),ae.default.createElement(kn,{text:"Import from external drives"}),ae.default.createElement(kn,{text:"Format datframes"}),ae.default.createElement(kn,{text:"Style graphs"}),ae.default.createElement(kn,{text:"Priority support"}),ae.default.createElement(kn,{text:"All future pro functionality!"}),ae.default.createElement("div",{className:"mt-25px"},ae.default.createElement(I,{justify:"space-around"},ae.default.createElement("form",{className:"element-width-block",action:"https://jl76z192i0.execute-api.us-east-1.amazonaws.com/Prod/create_checkout_session/",method:"POST",target:"_blank"},ae.default.createElement("button",{className:M("text-button","text-header-3","text-overflow-wrap","element-width-block","text-button-variant-dark"),type:"submit",onClick:()=>{e.mitoAPI.log("clicked_purchase_mito_pro"),setTimeout(()=>n(!0),100)}},"Purchase Mito Pro"))),ae.default.createElement(I,{justify:"space-around",className:"mb-5px mt-5px"},ae.default.createElement("p",{className:"text-body-1"},"Or")),ae.default.createElement(I,{justify:"space-around"},ae.default.createElement(j,{variant:"dark",onClick:()=>{n(!0)}},"Enter Access Code"))))):!a&&t?ae.default.createElement(Y,null,ae.default.createElement(Q,{header:"Enter Access Code",setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement(I,{align:"center"},ae.default.createElement(C,{span:5},ae.default.createElement("p",{className:"text-heading-2"},"Access Code:")),ae.default.createElement(C,{span:2},ae.default.createElement(Hu,{title:"Get an access code by purchasing a Pro license on the previous page."}))),ae.default.createElement(ne,m({},r)),o&&ae.default.createElement("div",{className:"text-color-error"},"Sorry, that access code is invalid. Purchase Mito Pro from the previous page and then enter the access code here."),ae.default.createElement(se,{px:20}),ae.default.createElement(I,{justify:"space-around"},ae.default.createElement(C,null,ae.default.createElement(j,{variant:"light",onClick:()=>{n(!1)}},"Back")),ae.default.createElement(C,null,ae.default.createElement(j,{variant:"dark",onClick:async()=>{if(!Am(r.value)){i(!0);return}i(!1),await e.mitoAPI.log("signup_completed_pro",{location:"upgrade_to_pro_taskpane"}),await e.mitoAPI.updateGoPro(),n(!1)}},"Submit Access Code"))))):ae.default.createElement(Y,null,ae.default.createElement(Q,{header:`Welcome to Mito ${e.proOrEnterprise}!`,setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement("p",{className:"text-heading-4 mb-10px"},e.proOrEnterprise==="Pro"?"You've successfully upgraded to Mito Pro. You can cancel any time by sending us an email.":"Mito Enterprise is the fastest way to automate any Python analysis."),ae.default.createElement(kn,{text:"All telemetry is off"}),ae.default.createElement(kn,{text:"Generated code is being optimized"}),ae.default.createElement(kn,{text:"Style graphs"}),ae.default.createElement(kn,{text:"Format dataframes"}),ae.default.createElement(kn,{text:"Export formatting"}),ae.default.createElement(kn,{text:"Get priority support"}),ae.default.createElement(kn,{text:`All future ${e.proOrEnterprise} functionality!`})))},M4=qw;var re=T(_());var O4=T(_());var Qw=e=>{let t=e.uiState.currOpenTaskpane.type==="UpdateImports"&&e.uiState.currOpenTaskpane.failedReplayData!==void 0,n="Upgrade to Mito Pro",r="Pro";return e.userProfile.isPro&&(n="Mito Pro"),e.userProfile.isEnterprise&&(n="Mito Enterprise",r="Enterprise"),O4.default.createElement("div",{className:M("text-button","text-button-variant-dark","mito-plan-button","cursor-pointer"),onClick:()=>{t||(e.userProfile.isPro||e.mitoAPI.log("clicked_plan_button"),e.setUIState(o=>f(m({},o),{currOpenTaskpane:{type:"upgrade_to_pro",proOrEnterprise:r},selectedTabType:"data"})))}},n)},F4=Qw;var Is=T(_());var Ct=T(_());var fd=T(_()),eT=()=>fd.default.createElement("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fd.default.createElement("path",{d:"M9.58016 3.81644L6.50004 0.734863L3.41992 3.81644",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),fd.default.createElement("path",{d:"M12 9.10571L11.9883 11.3851C11.9839 12.3571 11.1934 13.1447 10.2213 13.1447H2.76697C1.79052 13.1432 1 12.3513 1 11.3748L1.00146 9.10571",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),fd.default.createElement("path",{d:"M6.5 9.56679V1.73181",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),L4=eT;var Ir=T(_()),U4=()=>Ir.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ir.default.createElement("path",{d:"M6.05571 9.08911L1 14.1448",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M14.001 1.14478L8.94531 6.20048",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M1 9.08911V14.1448H6.05571",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M14.001 6.20048V1.14478H8.94531",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),B4=()=>Ir.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ir.default.createElement("path",{d:"M6.05555 8.94434L1 13.9999",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M8.94445 6.05566L14 1.00011",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M6.05469 13.9998V8.9442H0.999135",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M8.94445 1.00011V6.05566H14",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}));var pd=T(_()),tT=()=>pd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pd.default.createElement("path",{d:"M12.6916 13.5156H2.30835C1.58458 13.5156 1 12.9881 1 12.335V12.0963C1 11.4432 1.58458 10.9156 2.30835 10.9156H12.6916C13.4154 10.9156 14 11.4432 14 12.0963V12.335C14 12.9881 13.4154 13.5156 12.6916 13.5156Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pd.default.createElement("path",{d:"M12.6916 8.31558H2.30835C1.58458 8.31558 1 7.79058 1 7.14058V6.89058C1 6.24058 1.58458 5.71558 2.30835 5.71558H12.6916C13.4154 5.71558 14 6.24058 14 6.89058V7.12808C14 7.79058 13.4154 8.31558 12.6916 8.31558Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pd.default.createElement("path",{d:"M12.6916 3.11563H2.30835C1.58458 3.11563 1 2.58809 1 1.93495V1.6963C1 1.04316 1.58458 0.515625 2.30835 0.515625H12.6916C13.4154 0.515625 14 1.04316 14 1.6963V1.93495C14 2.58809 13.4154 3.11563 12.6916 3.11563Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),H4=tT;var ch=T(_()),nT=()=>ch.default.createElement("svg",{width:"33",height:"15",viewBox:"0 0 33 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ch.default.createElement("path",{d:"M3.73236 9.3125H2.64252V2.08789L0.45697 2.89062V1.90625L3.56244 0.740234H3.73236V9.3125ZM12.498 9.3125H6.90814V8.5332L9.86127 5.25195C10.2988 4.75586 10.5995 4.35352 10.7636 4.04492C10.9316 3.73242 11.0156 3.41016 11.0156 3.07812C11.0156 2.63281 10.8808 2.26758 10.6113 1.98242C10.3417 1.69727 9.98236 1.55469 9.53314 1.55469C8.99408 1.55469 8.57416 1.70898 8.27338 2.01758C7.9765 2.32227 7.82806 2.74805 7.82806 3.29492H6.74408C6.74408 2.50977 6.99603 1.875 7.49994 1.39062C8.00775 0.90625 8.68549 0.664062 9.53314 0.664062C10.3261 0.664062 10.9531 0.873047 11.414 1.29102C11.8749 1.70508 12.1054 2.25781 12.1054 2.94922C12.1054 3.78906 11.5703 4.78906 10.4999 5.94922L8.21478 8.42773H12.498V9.3125ZM15.2226 4.51953H16.037C16.5488 4.51172 16.9511 4.37695 17.2441 4.11523C17.537 3.85352 17.6835 3.5 17.6835 3.05469C17.6835 2.05469 17.1855 1.55469 16.1894 1.55469C15.7206 1.55469 15.3456 1.68945 15.0644 1.95898C14.787 2.22461 14.6484 2.57813 14.6484 3.01953H13.5644C13.5644 2.34375 13.8105 1.7832 14.3027 1.33789C14.7988 0.888672 15.4277 0.664062 16.1894 0.664062C16.9941 0.664062 17.6249 0.876953 18.082 1.30273C18.539 1.72852 18.7675 2.32031 18.7675 3.07812C18.7675 3.44922 18.6464 3.80859 18.4042 4.15625C18.166 4.50391 17.8398 4.76367 17.4257 4.93555C17.8945 5.08398 18.2558 5.33008 18.5097 5.67383C18.7675 6.01758 18.8964 6.4375 18.8964 6.93359C18.8964 7.69922 18.6464 8.30664 18.1464 8.75586C17.6464 9.20508 16.996 9.42969 16.1953 9.42969C15.3945 9.42969 14.7421 9.21289 14.2382 8.7793C13.7382 8.3457 13.4882 7.77344 13.4882 7.0625H14.5781C14.5781 7.51172 14.7245 7.87109 15.0175 8.14062C15.3105 8.41016 15.7031 8.54492 16.1953 8.54492C16.7187 8.54492 17.1191 8.4082 17.3964 8.13477C17.6738 7.86133 17.8124 7.46875 17.8124 6.95703C17.8124 6.46094 17.6601 6.08008 17.3554 5.81445C17.0507 5.54883 16.6113 5.41211 16.037 5.4043H15.2226V4.51953ZM28.1003 9.3125L23.2643 0.9485H32.9243L28.1003 9.3125Z",fill:"#494650"})),G4=nT;var fh=T(_()),rT=()=>fh.default.createElement("svg",{width:"22",height:"15",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fh.default.createElement("path",{d:"M1.50781 6.61719C1.50781 6.49479 1.54557 6.39193 1.62109 6.30859C1.69922 6.22266 1.8112 6.17969 1.95703 6.17969C2.10286 6.17969 2.21354 6.22266 2.28906 6.30859C2.36719 6.39193 2.40625 6.49479 2.40625 6.61719C2.40625 6.73698 2.36719 6.83854 2.28906 6.92188C2.21354 7.00521 2.10286 7.04688 1.95703 7.04688C1.8112 7.04688 1.69922 7.00521 1.62109 6.92188C1.54557 6.83854 1.50781 6.73698 1.50781 6.61719ZM7.09766 3.70312V4.57031C7.09766 5.03646 7.05599 5.42969 6.97266 5.75C6.88932 6.07031 6.76953 6.32812 6.61328 6.52344C6.45703 6.71875 6.26823 6.86068 6.04688 6.94922C5.82812 7.03516 5.58073 7.07812 5.30469 7.07812C5.08594 7.07812 4.88411 7.05078 4.69922 6.99609C4.51432 6.94141 4.34766 6.85417 4.19922 6.73438C4.05339 6.61198 3.92839 6.45312 3.82422 6.25781C3.72005 6.0625 3.64062 5.82552 3.58594 5.54688C3.53125 5.26823 3.50391 4.94271 3.50391 4.57031V3.70312C3.50391 3.23698 3.54557 2.84635 3.62891 2.53125C3.71484 2.21615 3.83594 1.96354 3.99219 1.77344C4.14844 1.58073 4.33594 1.44271 4.55469 1.35938C4.77604 1.27604 5.02344 1.23438 5.29688 1.23438C5.51823 1.23438 5.72135 1.26172 5.90625 1.31641C6.09375 1.36849 6.26042 1.45312 6.40625 1.57031C6.55208 1.6849 6.67578 1.83854 6.77734 2.03125C6.88151 2.22135 6.96094 2.45443 7.01562 2.73047C7.07031 3.00651 7.09766 3.33073 7.09766 3.70312ZM6.37109 4.6875V3.58203C6.37109 3.32682 6.35547 3.10286 6.32422 2.91016C6.29557 2.71484 6.2526 2.54818 6.19531 2.41016C6.13802 2.27214 6.0651 2.16016 5.97656 2.07422C5.89062 1.98828 5.79036 1.92578 5.67578 1.88672C5.5638 1.84505 5.4375 1.82422 5.29688 1.82422C5.125 1.82422 4.97266 1.85677 4.83984 1.92188C4.70703 1.98438 4.59505 2.08464 4.50391 2.22266C4.41536 2.36068 4.34766 2.54167 4.30078 2.76562C4.25391 2.98958 4.23047 3.26172 4.23047 3.58203V4.6875C4.23047 4.94271 4.24479 5.16797 4.27344 5.36328C4.30469 5.55859 4.35026 5.72786 4.41016 5.87109C4.47005 6.01172 4.54297 6.1276 4.62891 6.21875C4.71484 6.3099 4.8138 6.3776 4.92578 6.42188C5.04036 6.46354 5.16667 6.48438 5.30469 6.48438C5.48177 6.48438 5.63672 6.45052 5.76953 6.38281C5.90234 6.3151 6.01302 6.20964 6.10156 6.06641C6.19271 5.92057 6.26042 5.73438 6.30469 5.50781C6.34896 5.27865 6.37109 5.00521 6.37109 4.6875ZM11.5977 3.70312V4.57031C11.5977 5.03646 11.556 5.42969 11.4727 5.75C11.3893 6.07031 11.2695 6.32812 11.1133 6.52344C10.957 6.71875 10.7682 6.86068 10.5469 6.94922C10.3281 7.03516 10.0807 7.07812 9.80469 7.07812C9.58594 7.07812 9.38411 7.05078 9.19922 6.99609C9.01432 6.94141 8.84766 6.85417 8.69922 6.73438C8.55339 6.61198 8.42839 6.45312 8.32422 6.25781C8.22005 6.0625 8.14062 5.82552 8.08594 5.54688C8.03125 5.26823 8.00391 4.94271 8.00391 4.57031V3.70312C8.00391 3.23698 8.04557 2.84635 8.12891 2.53125C8.21484 2.21615 8.33594 1.96354 8.49219 1.77344C8.64844 1.58073 8.83594 1.44271 9.05469 1.35938C9.27604 1.27604 9.52344 1.23438 9.79688 1.23438C10.0182 1.23438 10.2214 1.26172 10.4062 1.31641C10.5938 1.36849 10.7604 1.45312 10.9062 1.57031C11.0521 1.6849 11.1758 1.83854 11.2773 2.03125C11.3815 2.22135 11.4609 2.45443 11.5156 2.73047C11.5703 3.00651 11.5977 3.33073 11.5977 3.70312ZM10.8711 4.6875V3.58203C10.8711 3.32682 10.8555 3.10286 10.8242 2.91016C10.7956 2.71484 10.7526 2.54818 10.6953 2.41016C10.638 2.27214 10.5651 2.16016 10.4766 2.07422C10.3906 1.98828 10.2904 1.92578 10.1758 1.88672C10.0638 1.84505 9.9375 1.82422 9.79688 1.82422C9.625 1.82422 9.47266 1.85677 9.33984 1.92188C9.20703 1.98438 9.09505 2.08464 9.00391 2.22266C8.91536 2.36068 8.84766 2.54167 8.80078 2.76562C8.75391 2.98958 8.73047 3.26172 8.73047 3.58203V4.6875C8.73047 4.94271 8.74479 5.16797 8.77344 5.36328C8.80469 5.55859 8.85026 5.72786 8.91016 5.87109C8.97005 6.01172 9.04297 6.1276 9.12891 6.21875C9.21484 6.3099 9.3138 6.3776 9.42578 6.42188C9.54036 6.46354 9.66667 6.48438 9.80469 6.48438C9.98177 6.48438 10.1367 6.45052 10.2695 6.38281C10.4023 6.3151 10.513 6.20964 10.6016 6.06641C10.6927 5.92057 10.7604 5.73438 10.8047 5.50781C10.849 5.27865 10.8711 5.00521 10.8711 4.6875Z",fill:"#494650"})),V4=rT;var ph=T(_()),oT=()=>ph.default.createElement("svg",{width:"22",height:"15",viewBox:"0 0 7 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ph.default.createElement("path",{d:"M0.757812 6.61719C0.757812 6.49479 0.795573 6.39193 0.871094 6.30859C0.949219 6.22266 1.0612 6.17969 1.20703 6.17969C1.35286 6.17969 1.46354 6.22266 1.53906 6.30859C1.61719 6.39193 1.65625 6.49479 1.65625 6.61719C1.65625 6.73698 1.61719 6.83854 1.53906 6.92188C1.46354 7.00521 1.35286 7.04688 1.20703 7.04688C1.0612 7.04688 0.949219 7.00521 0.871094 6.92188C0.795573 6.83854 0.757812 6.73698 0.757812 6.61719ZM6.34766 3.70312V4.57031C6.34766 5.03646 6.30599 5.42969 6.22266 5.75C6.13932 6.07031 6.01953 6.32812 5.86328 6.52344C5.70703 6.71875 5.51823 6.86068 5.29688 6.94922C5.07812 7.03516 4.83073 7.07812 4.55469 7.07812C4.33594 7.07812 4.13411 7.05078 3.94922 6.99609C3.76432 6.94141 3.59766 6.85417 3.44922 6.73438C3.30339 6.61198 3.17839 6.45312 3.07422 6.25781C2.97005 6.0625 2.89062 5.82552 2.83594 5.54688C2.78125 5.26823 2.75391 4.94271 2.75391 4.57031V3.70312C2.75391 3.23698 2.79557 2.84635 2.87891 2.53125C2.96484 2.21615 3.08594 1.96354 3.24219 1.77344C3.39844 1.58073 3.58594 1.44271 3.80469 1.35938C4.02604 1.27604 4.27344 1.23438 4.54688 1.23438C4.76823 1.23438 4.97135 1.26172 5.15625 1.31641C5.34375 1.36849 5.51042 1.45312 5.65625 1.57031C5.80208 1.6849 5.92578 1.83854 6.02734 2.03125C6.13151 2.22135 6.21094 2.45443 6.26562 2.73047C6.32031 3.00651 6.34766 3.33073 6.34766 3.70312ZM5.62109 4.6875V3.58203C5.62109 3.32682 5.60547 3.10286 5.57422 2.91016C5.54557 2.71484 5.5026 2.54818 5.44531 2.41016C5.38802 2.27214 5.3151 2.16016 5.22656 2.07422C5.14062 1.98828 5.04036 1.92578 4.92578 1.88672C4.8138 1.84505 4.6875 1.82422 4.54688 1.82422C4.375 1.82422 4.22266 1.85677 4.08984 1.92188C3.95703 1.98438 3.84505 2.08464 3.75391 2.22266C3.66536 2.36068 3.59766 2.54167 3.55078 2.76562C3.50391 2.98958 3.48047 3.26172 3.48047 3.58203V4.6875C3.48047 4.94271 3.49479 5.16797 3.52344 5.36328C3.55469 5.55859 3.60026 5.72786 3.66016 5.87109C3.72005 6.01172 3.79297 6.1276 3.87891 6.21875C3.96484 6.3099 4.0638 6.3776 4.17578 6.42188C4.29036 6.46354 4.41667 6.48438 4.55469 6.48438C4.73177 6.48438 4.88672 6.45052 5.01953 6.38281C5.15234 6.3151 5.26302 6.20964 5.35156 6.06641C5.44271 5.92057 5.51042 5.73438 5.55469 5.50781C5.59896 5.27865 5.62109 5.00521 5.62109 4.6875Z",fill:"#494650"})),j4=oT;var R4=e=>{switch(e){case"UNDO":return Ct.default.createElement(ac,null);case"REDO":return Ct.default.createElement(lc,null);case"CLEAR":return Ct.default.createElement(uc,null);case"IMPORT":return Ct.default.createElement(Ss,null);case"EXPORT":return Ct.default.createElement(L4,null);case"ADD COL":return Ct.default.createElement(rc,null);case"DEL COL":return Ct.default.createElement(Cs,null);case"DTYPE":return Ct.default.createElement(oc,null);case"LESS":return Ct.default.createElement(j4,null);case"MORE":return Ct.default.createElement(V4,null);case"FORMAT":return Ct.default.createElement(G4,null);case"PIVOT":return Ct.default.createElement(nc,null);case"GRAPH":return Ct.default.createElement(os,null);case"AI_TRANSFORMATION":return Ct.default.createElement(mc,null);case"CODE_SNIPPETS":return Ct.default.createElement(Fm,null);case"CATCH UP":return Ct.default.createElement(Kl,null);case"STEPS":return Ct.default.createElement(H4,null);case"OPEN FULLSCREEN":return Ct.default.createElement(U4,null);case"CLOSE FULLSCREEN":return Ct.default.createElement(B4,null)}},oe=(e,t,n)=>Ct.default.createElement(v,{key:e.longTitle,title:e.longTitle,onClick:e.actionFunction,disabled:e.isDisabled()!==void 0,tooltip:e.isDisabled(),rightText:iT(e,t),supressFocusSettingOnClose:n}),iT=(e,t)=>{var n,r;return e.requiredPlan==="pro"&&!t.isPro?"Mito Pro":e.requiredPlan==="enterprise"&&!t.isEnterprise?"Mito Enterprise":window.navigator.userAgent.toUpperCase().includes("MAC")?(n=e.displayKeyboardShortcuts)==null?void 0:n.mac:(r=e.displayKeyboardShortcuts)==null?void 0:r.windows};var aT=e=>{let t=e.disabledTooltip!==void 0,n=e.highlightToolbarButton===!0?"mito-toolbar-button-draw-attention":"";return Is.default.createElement("div",{className:M("mito-toolbar-button-container",t?"mito-toolbar-button-container-disabled":"mito-toolbar-button-container-enabled"),id:e.id,onClick:()=>{t||(e.setEditorState&&e.setEditorState(void 0),e.action.actionFunction())}},Is.default.createElement("button",{className:M("mito-toolbar-button","vertical-align-content",n),type:"button"},Is.default.createElement("span",{title:e.disabledTooltip||e.action.tooltip},Is.default.createElement("div",{className:"mito-toolbar-button-icon-container"},R4(e.toolbarButtonType)),Is.default.createElement("p",{className:"mito-toolbar-button-label"},e.action.shortTitle))),e.children!==void 0&&e.children)},Mt=aT;var To=T(_());var sT=e=>To.default.createElement(To.default.Fragment,null,To.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Columns",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Columns"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["add column"],e.userProfile),oe(e.actions["rename column"],e.userProfile,!0),oe(e.actions["delete column"],e.userProfile),oe(e.actions["Column_Headers_Transform"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["set column formula"],e.userProfile,!0),oe(e.actions["set cell value"],e.userProfile,!0),oe(e.actions["split text to column"],e.userProfile),e.userProfile.isPro?oe(e.actions["one_hot_encoding"],e.userProfile):To.default.createElement(To.default.Fragment,null),oe(e.actions["format number columns"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["filter"],e.userProfile),oe(e.actions["sort"],e.userProfile),oe(e.actions["change dtype"],e.userProfile),oe(e.actions["fill na"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["unique values"],e.userProfile),oe(e.actions["column summary"],e.userProfile))),W4=sT;var _o=T(_());var lT=e=>_o.default.createElement(_o.default.Fragment,null,_o.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Dataframes",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Dataframes"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["import files"],e.userProfile),oe(e.actions["Dataframe_Import"],e.userProfile),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT?oe(e.actions["SnowflakeImport"],e.userProfile):_o.default.createElement(_o.default.Fragment,null),oe(e.actions["UserDefinedImport"],e.userProfile),oe(e.actions["updateImports"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["export"],e.userProfile),oe(e.actions["Export_To_File"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["pivot"],e.userProfile),oe(e.actions["melt"],e.userProfile),oe(e.actions["drop duplicates"],e.userProfile),oe(e.actions["merge"],e.userProfile),oe(e.actions["concat_dataframes"],e.userProfile),oe(e.actions["transpose"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["duplicate dataframe"],e.userProfile),oe(e.actions["rename dataframe"],e.userProfile,!0),oe(e.actions["delete dataframe"],e.userProfile))),X4=lT;var hh=T(_());var dT=e=>{let t=e.uiState.currOpenToolbarDropdown===e.type;return hh.default.createElement("div",null,hh.default.createElement("p",{className:M("mito-toolbar-dropdown-selector","text-unselectable",{"mito-toolbar-dropdown-selector-selected":t}),onClick:()=>{e.setUIState(n=>f(m({},n),{currOpenToolbarDropdown:e.type}))},onMouseEnter:()=>{e.setUIState(n=>n.currOpenToolbarDropdown!==void 0&&!t?f(m({},n),{currOpenToolbarDropdown:e.type}):n)}},e.type),e.children)},zr=dT;var hd=T(_());var uT=e=>hd.default.createElement(hd.default.Fragment,null,hd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Edit",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Edit"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["undo"],e.userProfile),oe(e.actions["redo"],e.userProfile),oe(e.actions["clear"],e.userProfile),hd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["copy"],e.userProfile))),J4=uT;var gd=T(_());var mT=e=>gd.default.createElement(gd.default.Fragment,null,gd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Format",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Format"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["set_dataframe_format"],e.userProfile),oe(e.actions["ConditionalFormatting"],e.userProfile),gd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["format number columns"],e.userProfile),oe(e.actions["precision decrease"],e.userProfile),oe(e.actions["precision increase"],e.userProfile))),z4=mT;var yd=T(_());var cT=e=>yd.default.createElement(yd.default.Fragment,null,yd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Graphs",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Graphs"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["graph"],e.userProfile),yd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["duplicate graph"],e.userProfile),oe(e.actions["rename graph"],e.userProfile),oe(e.actions["delete graph"],e.userProfile))),K4=cT;var yi=T(_());var fT=e=>{let t=c5(e.actions);return yi.default.createElement(yi.default.Fragment,null,yi.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Help",searchable:!0,closeDropdown:()=>e.setUIState(n=>n.currOpenToolbarDropdown==="Help"?f(m({},n),{currOpenToolbarDropdown:void 0}):n),width:"large"},t.map(n=>n.type=="AI_Transformation"&&!e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION?yi.default.createElement(yi.default.Fragment,null):n.type=="SnowflakeImport"&&!e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT?yi.default.createElement(yi.default.Fragment,null):oe(n,e.userProfile))))},$4=fT;var cc=T(_());var pT=e=>cc.default.createElement(cc.default.Fragment,null,cc.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Rows",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Rows"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["delete row"],e.userProfile),oe(e.actions["promote row to header"],e.userProfile))),Z4=pT;var fc=T(_());var hT=e=>fc.default.createElement(fc.default.Fragment,null,fc.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="View",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="View"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["fullscreen"],e.userProfile))),Y4=hT;var xs=T(_());var gT=e=>xs.default.createElement(xs.default.Fragment,null,xs.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Code",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Code"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["CodeOptions"],e.userProfile),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION?oe(e.actions["AI_Transformation"],e.userProfile):xs.default.createElement(xs.default.Fragment,null),oe(e.actions["CodeSnippets"],e.userProfile))),q4=gT;var yT=e=>{var n;let t=[re.default.createElement(v,{title:"Import Files",key:"Import Files",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"import files"}}))}}),re.default.createElement(v,{title:"Import Dataframes",key:"Import Dataframes",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"DataframeImport"}}))}})];return e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT&&t.push(re.default.createElement(v,{title:"Import from Snowflake",key:"Import from Snowflake",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"SnowflakeImport"}}))}})),t.push(re.default.createElement(v,{title:"Custom Imports",key:"Custom Imports",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"UserDefinedImport"}}))}})),re.default.createElement("div",{className:"mito-toolbar-container"},re.default.createElement("div",{className:"mito-toolbar-top"},re.default.createElement("div",{className:"mito-toolbar-top-left"},re.default.createElement(zr,{type:"Edit",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(J4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Dataframes",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(X4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Columns",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(W4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Rows",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(Z4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Graphs",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(K4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Format",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(z4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Code",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(q4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"View",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(Y4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Help",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement($4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile}))),re.default.createElement("div",{className:"mito-toolbar-top-right"},re.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI,width:"small",className:"mito-plan-button"}),re.default.createElement(F4,{uiState:e.uiState,userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))),re.default.createElement("div",{className:"mito-toolbar-top-bottom-seperator"}),re.default.createElement("div",{className:"mito-toolbar-bottom"},re.default.createElement("div",{className:"mito-toolbar-bottom-left-half"},re.default.createElement(Mt,{id:"mito-undo-button",toolbarButtonType:"UNDO",action:e.actions["undo"],disabledTooltip:e.actions["undo"].isDisabled()}),re.default.createElement(Mt,{id:"mito-redo-button",toolbarButtonType:"REDO",action:e.actions["redo"],disabledTooltip:e.actions["redo"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"CLEAR",action:e.actions["clear"],disabledTooltip:e.actions["clear"].isDisabled()}),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"IMPORT",action:e.actions["import dropdown"],setEditorState:e.setEditorState,disabledTooltip:e.actions["import dropdown"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="import",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="import"?r:f(m({},r),{toolbarDropdown:void 0})),width:"medium"},t)),re.default.createElement(Mt,{toolbarButtonType:"EXPORT",action:e.actions["export dropdown"],setEditorState:e.setEditorState,disabledTooltip:e.actions["export dropdown"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="export",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="export"?r:f(m({},r),{toolbarDropdown:void 0})),width:"large"},re.default.createElement(v,{title:"Download File Now",subtext:"Download the file to your downloads folder.",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"download"}}))}}),re.default.createElement(v,{title:"Download File when Executing Code",subtext:"Download the file to the same folder as this notebook when you run the generated code.",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"Export To File"}}))}}))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"ADD COL",action:e.actions["add column"],highlightToolbarButton:e.highlightAddColButton,setEditorState:e.setEditorState,disabledTooltip:e.actions["add column"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"DEL COL",action:e.actions["delete column"],setEditorState:e.setEditorState,disabledTooltip:e.actions["delete column"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"DTYPE",action:e.actions["change dtype"],setEditorState:e.setEditorState,disabledTooltip:e.actions["change dtype"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="dtype",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="dtype"?r:f(m({},r),{toolbarDropdown:void 0})),width:"medium"},I1(r=>{let o=xm(e.gridState.selections,e.sheetData);e.mitoAPI.editChangeColumnDtype(e.sheetIndex,o,r,me())}))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"LESS",action:e.actions["precision decrease"],setEditorState:e.setEditorState,disabledTooltip:e.actions["precision decrease"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"MORE",action:e.actions["precision increase"],setEditorState:e.setEditorState,disabledTooltip:e.actions["precision increase"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"FORMAT",action:e.actions["format number columns"],setEditorState:e.setEditorState,disabledTooltip:e.actions["format number columns"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="format",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="format"?r:f(m({},r),{toolbarDropdown:void 0}))},gm(e.gridState.sheetIndex,e.sheetData,ti(e.gridState.selections,e.sheetData),e.mitoAPI,e.closeOpenEditingPopups))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"PIVOT",action:e.actions["pivot"],highlightToolbarButton:e.highlightPivotTableButton,setEditorState:e.setEditorState,disabledTooltip:e.actions["pivot"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"GRAPH",action:e.actions["graph"],setEditorState:e.setEditorState,disabledTooltip:e.actions["graph"].isDisabled()}),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION&&re.default.createElement(Mt,{toolbarButtonType:"AI_TRANSFORMATION",action:e.actions["AI_Transformation"],setEditorState:e.setEditorState,disabledTooltip:e.actions["AI_Transformation"].isDisabled()}),((n=e.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS)==null?void 0:n.MITO_CONFIG_CODE_SNIPPETS_URL)!==void 0&&re.default.createElement(Mt,{toolbarButtonType:"CODE_SNIPPETS",action:e.actions["CodeSnippets"],setEditorState:e.setEditorState,disabledTooltip:e.actions["CodeSnippets"].isDisabled()})),re.default.createElement("div",{className:"mito-toolbar-bottom-right-half"},e.currStepIdx!==e.lastStepIndex&&re.default.createElement(Mt,{toolbarButtonType:"CATCH UP",action:e.actions["catch up"]}),re.default.createElement(Mt,{toolbarButtonType:"STEPS",action:e.actions["steps"],disabledTooltip:e.actions["steps"].isDisabled()}),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:Ft.fullscreenElement?"CLOSE FULLSCREEN":"OPEN FULLSCREEN",action:e.actions["fullscreen"]}))))},Q4=yT;var tt=T(_());var Ue=T(_());var ST=[{tourName:"Intro",stepNumber:1,stepHeader:"Seeing your data",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Your data is visible in the sheet. Each dataframe is represented by a different tab. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!1,hideXIcon:!0},{tourName:"Intro",stepNumber:2,stepHeader:"Find functionality",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," All functionality can be found through the toolbar. Explore the toolbar to see what is possible. "),location:"top_left",advanceButtonText:"Continue",displayBackButton:!0,hideXIcon:!0},{tourName:"Intro",stepNumber:3,stepHeader:"Use the generated code",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,"Each time you make an edit, Mito generates equivalent Python code in the cell below. Running this generated code edits the dataframes in your notebook directly."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],CT=[{tourName:"Pivot",stepNumber:1,stepHeader:"Creating a pivot table",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," ",Ue.default.createElement("b",null," Click on the Pivot button")," to get started. Mito\u2019s pivot tables make it easy to slice and dice your data into different categories. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Pivot",stepNumber:2,stepHeader:"Configure your pivot table",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," In the open sidebar, ",Ue.default.createElement("b",null,"select a row and value ")," to create your pivot table."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Pivot",stepNumber:3,stepHeader:"That was easy!",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Checkout the pivot table code below"),". Each time you create a pivot table, a new dataframe is created in both the Mito sheet and the generated code. We just saved our first few trips to stack overflow :) "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],IT=[{tourName:"Column_Formulas",stepNumber:1,stepHeader:"Our Formulas are Different",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Edit a column by updating its formula. If you want to uppercase the column ",Ue.default.createElement("b",null,"Name"),", set its formula to ",Ue.default.createElement("b",null,"UPPER(Name)"),". No extra columns necessary. "),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Column_Formulas",stepNumber:2,stepHeader:"Manually Reapply Formulas",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," Mito differs from other spreadsheets because formulas do not automatically update when the input data changes. If you want to update a specific formula, simply resubmit it! "),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Column_Formulas",stepNumber:3,stepHeader:"Become a Formula Expert",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," Want to learn more about how Mito's formulas are different? ",Ue.default.createElement("a",{className:"text-body-1-link text-color-white-important",href:a5,target:"_blank",rel:"noreferrer"},"Check out our detailed formula documentation.")),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0}],xT=[{tourName:"Explore_Datasets",stepNumber:1,stepHeader:"Exploring data with Mito",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Mito makes it easy to build intuition for your data by automatically generating summary information about each column. To get started, ",Ue.default.createElement("b",null,"click on the filter button in the column header")," of one of your columns."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:2,stepHeader:"View summary stats",stepHeaderBackgroundColor:"#CAD1FF",stepText:Ue.default.createElement("div",null," ",Ue.default.createElement("b",null,"Click on the Summary Stats tab ")," at the bottom of the sidebar. The chart at the top shows you the distribution of your column, and there\u2019s more specific summary information down below. Check it out!"),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:3,stepHeader:"Add a filter",stepHeaderBackgroundColor:"#FFDAAE",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Switch over to the Filter/Sort Tab ")," to clean up your data now that you've built up some intuition. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:4,stepHeader:"Create a filter",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Click on the Add Filter button "),", and then set the filter ",Ue.default.createElement("b",null,"condition and value"),". "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:5,stepHeader:"Enjoy your cleaned data",stepHeaderBackgroundColor:"#FFCBDE",stepText:Ue.default.createElement("div",null,"Nice work! In just a few clicks, we\u2019ve built some intuition for our data and removed the values we're not interested in. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],wT=[{tourName:"Tutorial",stepNumber:1,stepHeader:"Before you go!",stepHeaderBackgroundColor:"#FFDAAE",stepText:Ue.default.createElement("div",null,"If you want more information on how to clean and analyze your data by writing spreadsheet formulas, visualizing your data, and adding filters, checkout our more detailed tutorial ",Ue.default.createElement("a",{href:i5,target:"_blank",rel:"noreferrer",style:{color:"#0081DE"}},"here"),"."),location:"bottom_left",advanceButtonText:"Close",displayBackButton:!0}],eC={Intro:ST,Pivot:CT,Tutorial:wT,Column_Formulas:IT,Explore_Datasets:xT};var _T={["bottom_left"]:"tour-container-bottom-left",["bottom_right"]:"tour-container-bottom-right",["top_left"]:"tour-container-top-left",["top_right"]:"tour-container-top-right"},DT=e=>{var h;let[t,n]=(0,tt.useState)(0),[r,o]=(0,tt.useState)(!1),i=[];e.tourNames.forEach(x=>{i.push(...eC[x])}),(0,tt.useEffect)(()=>{e.mitoAPI.log("begin_tour",{tour_names:e.tourNames,total_number_of_tour_steps:i.length})},[]),(0,tt.useEffect)(()=>{i[t].tourName==="Pivot"&&i[t].stepNumber===1?e.setHighlightPivotTableButton(!0):(e.setHighlightPivotTableButton(!1),e.setHighlightAddColButton(!1))},[t]);let a=x=>{x<=i.length-1?(e.mitoAPI.log("switched_tour_step",{old_tour_name:i[t].tourName,old_tour_step:t,new_tour_name:i[x].tourName,new_tour_step:x,tour_names:e.tourNames,total_number_of_tour_steps:i.length}),n(x)):l()},s=async()=>{e.mitoAPI.log("closed_tour_early",{tour_names:e.tourNames,tour_name:i[t].tourName,relative_tour_step_number:i[t].stepNumber,absolute_tour_step_number:t,total_number_of_tour_steps:i.length}),o(!0),i[t].tourName==="Intro"?n(i.length-1):l(!0)},l=async x=>{!r&&!x&&e.mitoAPI.log("finished_tour",{tour_names:e.tourNames,total_number_of_tour_steps:i.length}),e.setHighlightPivotTableButton(!1),e.setHighlightAddColButton(!1),await e.mitoAPI.updateCloseTour(e.tourNames)},d=i[t].stepText,u=i[t].stepTextFunction,c=d||u&&u(((h=e.sheetData)==null?void 0:h.data[0].columnID)||""),p=i[t].hideXIcon===!0;return tt.default.createElement("div",{className:M("tour-container",_T[i[t].location]),key:t},tt.default.createElement(I,{justify:"space-between",align:"center"},tt.default.createElement(C,null,tt.default.createElement("p",{className:"text-header-2"},t+1,"/",i.length)),!p&&tt.default.createElement(C,null,tt.default.createElement(at,{variant:"light",onClick:async()=>{t>=i.length-1?await l():await s()}}))),tt.default.createElement(I,null,tt.default.createElement(C,null,tt.default.createElement("p",{className:"text-header-2 text-color-white-important"},i[t].stepHeader))),tt.default.createElement("div",{className:"text-overflow-wrap mb-20px"},c),tt.default.createElement(I,{justify:"space-between"},t-1>=0&&tt.default.createElement(C,null,tt.default.createElement(j,{variant:"dark",width:"small",onClick:()=>a(t-1)},"Back")),t-1<=0&&tt.default.createElement(C,null),tt.default.createElement(C,null,tt.default.createElement(j,{variant:"light",width:"small",onClick:()=>a(t+1)},i[t].advanceButtonText))))},tC=DT;var vT=e=>{let t=(0,R.useRef)(null),[n,r]=(0,R.useState)(e.sheetDataArray),[o,i]=(0,R.useState)(e.analysisData),[a,s]=(0,R.useState)(e.userProfile),[l,d]=(0,R.useState)(()=>$y(n,0)),[u,c]=(0,R.useState)({loading:[],currOpenModal:a.userEmail==""&&a.telemetryEnabled?{type:"SignUp"}:a.shouldUpgradeMitosheet?{type:"Upgrade"}:{type:"None"},currOpenTaskpane:{type:"none"},selectedColumnControlPanelTab:"filter_sort",selectedSheetIndex:0,selectedGraphID:Object.keys(o.graphDataDict||{}).length===0?void 0:Object.keys(o.graphDataDict)[0],selectedTabType:"data",currOpenToolbarDropdown:void 0,toolbarDropdown:void 0,exportConfiguration:{exportType:"csv"},currOpenPopups:{["top_right"]:{type:"none"}},dataRecon:void 0}),[p,h]=(0,R.useState)(void 0),[x,D]=(0,R.useState)(!1),[S,g]=(0,R.useState)(!1),[y,w]=(0,R.useState)(["."]),[P,N]=(0,R.useState)([]),{mitoAPI:A,sendFunctionStatus:k}=c4(e.getSendFunction,r,i,s,c);(0,R.useEffect)(()=>{(k==="no_backend_comm_registered_error"||k==="non_valid_location_error"||k==="non_working_extension_error")&&c(Te=>f(m({},Te),{currOpenTaskpane:{type:"CannotCreateComm",commCreationErrorStatus:k}}))},[k]),(0,R.useEffect)(()=>{A.log("mitosheet_rendered")},[A]),(0,R.useEffect)(()=>{let Te=async()=>{var pt,Zr;let xt=await Ty((pt=o.analysisToReplay)==null?void 0:pt.analysisName);if(o.analysisToReplay){let Ci=(Zr=o.analysisToReplay)==null?void 0:Zr.analysisName;if(!o.analysisToReplay.existsOnDisk){A.log("replayed_nonexistant_analysis_failed"),c(hc=>f(m({},hc),{currOpenModal:{type:"ErrorReplayAnalysis",header:"analysis_to_replay does not exist",message:`We're unable to replay ${Ci} because you don't have access to it. This is probably because the analysis was created on a different computer.`,error:void 0,oldAnalysisName:Ci,newAnalysisName:o.analysisName}}));return}let gh=await A.updateReplayAnalysis(Ci,xt);"error"in gh&&c(hc=>f(m({},hc),{currOpenTaskpane:{type:"UpdateImports",failedReplayData:{analysisName:Ci,error:gh,args:xt}}}))}else Iy(o.analysisName,A),await A.updateArgs(xt)};(async()=>{let xt=await A.getRenderCount();("error"in xt?void 0:xt.result)===0&&k==="finished"&&await Te(),await A.updateRenderCount()})()},[A,k]),(0,R.useEffect)(()=>{o.renderCount>=1&&xy(o.analysisName,o.code,a.telemetryEnabled,o.publicInterfaceVersion)},[o]),(0,R.useEffect)(()=>{f5()},[]);let L=(0,R.useRef)(n.length);(0,R.useEffect)(()=>{let Te=L.current;c(Dt=>{let xt=Dt.selectedSheetIndex,pt=xt;return(Te=n.length)&&(pt=n.length-1>=0?n.length-1:0),f(m({},Dt),{selectedSheetIndex:pt})}),L.current=n.length},[n]);let E=(0,R.useRef)(Object.keys(o.graphDataDict||{}).length),b=(0,R.useRef)(u.selectedGraphID!==void 0?Object.keys(o.graphDataDict||{}).indexOf(u.selectedGraphID):-1);(0,R.useEffect)(()=>{b.current=u.selectedGraphID!==void 0?Object.keys(o.graphDataDict||{}).indexOf(u.selectedGraphID):-1},[u.selectedGraphID]),(0,R.useEffect)(()=>{let Te=Object.keys(o.graphDataDict||{}),Dt=E.current,xt=Object.keys(o.graphDataDict||{}).length;if(Dtf(m({},Zr),{selectedGraphID:pt,selectedTabType:"graph",currOpenTaskpane:{type:"graph",graphID:pt}})),b.current=Te.indexOf(pt)}else if(Dt>xt){let pt=C5(o.graphDataDict,b.current,c);b.current=pt!==void 0?Te.indexOf(pt):-1}E.current=xt},[Object.keys(o.graphDataDict||{}).length]),(0,R.useEffect)(()=>{let Te=async()=>{let xt=await A.getPivotParams(u.selectedSheetIndex),pt="error"in xt?void 0:xt.result;pt!==void 0&&c(Zr=>f(m({},Zr),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"pivot",sourceSheetIndex:pt.sheet_index,destinationSheetIndex:u.selectedSheetIndex,existingPivotParams:pt},selectedTabType:"data"}))},Dt=K[u.selectedSheetIndex];Dt!==void 0&&Dt==="pivoted"&&u.currOpenTaskpane.type==="none"&&Te(),p!==void 0&&h(void 0)},[u.selectedSheetIndex]);let F=(0,R.useRef)(u.currOpenTaskpane.type);(0,R.useEffect)(()=>{var Te;if(F.current!=="none"&&u.currOpenTaskpane.type==="none"){let Dt=(Te=t.current)==null?void 0:Te.querySelector(".endo-grid-container");cr(Dt)}F.current=u.currOpenTaskpane.type},[u]);let J=n.map(Te=>Te.dfName),K=n.map(Te=>Te.dfSource),W=n.map(Te=>Te.columnIDsMap),z=o.stepSummaryList[o.stepSummaryList.length-1],{columnID:Se}=st(n[u.selectedSheetIndex],l.selections[l.selections.length-1].startingRowIndex,l.selections[l.selections.length-1].startingColumnIndex),nt=(0,R.useCallback)(Te=>{Ly.includes(u.currOpenTaskpane.type)&&(Te===void 0||!Te.includes(u.currOpenTaskpane.type))&&c(Dt=>f(m({},Dt),{currOpenTaskpane:{type:"none"},currOpenModal:{type:"None"},selectedTabType:"data"}))},[u]),Kr=()=>{switch(u.currOpenModal.type){case"None":return R.default.createElement("div",null);case"Error":return R.default.createElement(_5,{error:u.currOpenModal.error,setUIState:c,mitoAPI:A,userProfile:a});case"ClearAnalysis":return R.default.createElement(w5,{setUIState:c,mitoAPI:A});case"SignUp":return R.default.createElement(M5,{setUIState:c,numUsages:a.numUsages,mitoAPI:A,isPro:a.isPro,sheetDataArray:n,analysisData:o});case"Upgrade":return R.default.createElement(O5,{setUIState:c,mitoAPI:A});case"ErrorReplayAnalysis":return R.default.createElement(D5,{setUIState:c,mitoAPI:A,header:u.currOpenModal.header,message:u.currOpenModal.message,error:u.currOpenModal.error,newAnalysisName:u.currOpenModal.newAnalysisName,oldAnalysisName:u.currOpenModal.oldAnalysisName,userProfile:a});case"DeleteGraphs":return R.default.createElement(T5,{setUIState:c,mitoAPI:A,sheetIndex:u.currOpenModal.sheetIndex,dependantGraphTabNamesAndIDs:u.currOpenModal.dependantGraphTabNamesAndIDs,dfName:n[u.currOpenModal.sheetIndex]?n[u.currOpenModal.sheetIndex].dfName:"this dataframe"})}},$r=()=>{switch(u.currOpenTaskpane.type){case"control_panel":return R.default.createElement(j3,{key:""+Se+u.selectedSheetIndex+u.selectedColumnControlPanelTab,selectedSheetIndex:u.selectedSheetIndex,sheetData:n[u.selectedSheetIndex],columnIDsMapArray:W,selection:l.selections[l.selections.length-1],gridState:l,mitoContainerRef:t,setUIState:c,setEditorState:h,mitoAPI:A,tab:u.selectedColumnControlPanelTab,lastStepIndex:z.step_idx,lastStepType:z.step_type,analysisData:o,closeOpenEditingPopups:nt});case"upgrade_to_pro":return R.default.createElement(M4,{mitoAPI:A,userProfile:a,setUIState:c,proOrEnterprise:u.currOpenTaskpane.proOrEnterprise});case"download":return R.default.createElement(sS,{dfNames:J,userProfile:a,selectedSheetIndex:u.selectedSheetIndex,uiState:u,setUIState:c,mitoAPI:A,sheetDataArray:n});case"drop_duplicates":return R.default.createElement(lS,{dfNames:J,selectedSheetIndex:u.selectedSheetIndex,setUIState:c,mitoAPI:A,sheetDataArray:n,analysisData:o});case"graph":return R.default.createElement(US,{graphID:u.currOpenTaskpane.graphID,graphSidebarTab:u.currOpenTaskpane.graphSidebarTab,dfNames:J,columnIDsMapArray:W,sheetDataArray:n,mitoAPI:A,setUIState:c,uiState:u,graphDataDict:o.graphDataDict,analysisData:o,mitoContainerRef:t,userProfile:a});case"import files":return R.default.createElement(NS,{mitoAPI:A,analysisData:o,userProfile:a,setUIState:c,currPathParts:y,setCurrPathParts:w});case"merge":return R.default.createElement(jS,{selectedSheetIndex:u.selectedSheetIndex,sheetDataArray:n,setUIState:c,mitoAPI:A,analysisData:o});case"concat":return R.default.createElement(eS,{analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A});case"none":return R.default.createElement(R.Fragment,null);case"pivot":return R.default.createElement(zS,{dfNames:J,sheetDataArray:n,columnIDsMapArray:W,mitoAPI:A,sourceSheetIndex:u.currOpenTaskpane.sourceSheetIndex,analysisData:o,setUIState:c,destinationSheetIndex:u.currOpenTaskpane.destinationSheetIndex,existingPivotParams:u.currOpenTaskpane.existingPivotParams});case"split_text_to_columns":return R.default.createElement(qS,{mitoAPI:A,analysisData:o,sheetDataArray:n,selectedSheetIndex:u.selectedSheetIndex,setUIState:c,dfNames:J,startingColumnID:u.currOpenTaskpane.startingColumnID});case"steps":return R.default.createElement(E4,{stepSummaryList:o.stepSummaryList,setUIState:c,mitoAPI:A,currStepIdx:o.currStepIdx,userProfile:a});case"import_first":return R.default.createElement(ge,{setUIState:c,message:u.currOpenTaskpane.message});case"fill_na":return R.default.createElement(MS,{setUIState:c,uiState:u,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex,sheetDataArray:n,analysisData:o,startingColumnIDs:u.currOpenTaskpane.startingColumnIDs});case"melt":return R.default.createElement(HS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"set_dataframe_format":return R.default.createElement(Q3,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"ConditionalFormatting":return R.default.createElement(o5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"DataframeImport":return R.default.createElement(rS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"UpdateImports":return R.default.createElement(u4,{mitoAPI:A,sheetDataArray:n,setUIState:c,userProfile:a,analysisData:o,currPathParts:y,setCurrPathParts:w,failedReplayData:u.currOpenTaskpane.failedReplayData});case"CannotCreateComm":return R.default.createElement(X5,{userProfile:a,setUIState:c,commCreationErrorStatus:u.currOpenTaskpane.commCreationErrorStatus});case"CodeSnippets":return R.default.createElement(Y5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"SnowflakeImport":return R.default.createElement(ZS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"Excel Range Import":return R.default.createElement(cS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,file_path:u.currOpenTaskpane.file_path,sheet_name:u.currOpenTaskpane.sheet_name,sheet_names:u.currOpenTaskpane.sheet_names});case"Export To File":return R.default.createElement(fS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"AITransformation":return R.default.createElement(W5,{userProfile:a,analysisData:o,gridState:l,uiState:u,setUIState:c,mitoAPI:A,sheetDataArray:n,previousAITransformParams:P,setPreviousAITransformParams:N});case"CodeOptions":return R.default.createElement($5,{userProfile:a,analysisData:o,setUIState:c,mitoAPI:A});case"Column Headers Transform":return R.default.createElement(Q5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"UserDefinedImport":return R.default.createElement(m4,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex})}},It=Te=>{let Dt=u.currOpenPopups[Te];switch(Dt.type){case"ephemeral_message":return R.default.createElement(b4,{message:Dt.message,setUIState:c,popupLocation:Te});case"none":return R.default.createElement(R.Fragment,null)}},ir=m5(n,l,K,nt,h,u,c,d,A,t,o,a,k);vy(t,ir,d);let Si=()=>{if(o.dataTypeInTool==="none"||o.dataTypeInTool==="tutorial")return R.default.createElement(R.default.Fragment,null);if(a.mitoConfig.MITO_CONFIG_DISABLE_TOURS)return R.default.createElement(R.default.Fragment,null);let Te=[];return a.receivedTours.includes("Intro")||Te.push("Intro"),p!==void 0&&p.rowIndex>=0&&!a.receivedTours.includes("Column_Formulas")&&Te.push("Column_Formulas"),R.default.createElement(R.default.Fragment,null,Te.length!==0&&u.currOpenModal.type!=="SignUp"&&R.default.createElement(tC,{sheetData:n[u.selectedSheetIndex],setHighlightPivotTableButton:D,setHighlightAddColButton:g,tourNames:Te,mitoAPI:A}))},Cd=u.currOpenTaskpane.type!=="none",ws=u.currOpenTaskpane.type==="graph"&&u.selectedTabType==="graph",Ts=Cd&&!ws,Id=M("mito-sheet-and-formula-bar-container",{"mito-sheet-and-formula-bar-container-wide-taskpane-open":ws,"mito-sheet-and-formula-bar-container-narrow-taskpane-open":Ts}),xd=M({"mito-taskpane-container":!Cd,"mito-taskpane-container-wide":ws,"mito-taskpane-container-narrow":Ts});return R.default.createElement("div",{className:"mito-container","data-jp-suppress-context-menu":!0,ref:t,tabIndex:0},R.default.createElement(h5,{mitoAPI:A,analyisData:o,userProfile:a,sheetDataArray:n},R.default.createElement(Q4,{mitoAPI:A,currStepIdx:o.currStepIdx,lastStepIndex:z.step_idx,highlightPivotTableButton:x,highlightAddColButton:S,actions:ir,mitoContainerRef:t,gridState:l,setGridState:d,uiState:u,setUIState:c,sheetData:n[u.selectedSheetIndex],userProfile:a,setEditorState:h,analysisData:o,sheetIndex:u.selectedSheetIndex,closeOpenEditingPopups:nt}),R.default.createElement("div",{className:"mito-center-content-container",id:"mito-center-content-container"},R.default.createElement("div",{className:Id},R.default.createElement(w3,{sheetDataArray:n,mitoAPI:A,uiState:u,setUIState:c,sheetIndex:u.selectedSheetIndex,gridState:l,setGridState:d,editorState:p,setEditorState:h,mitoContainerRef:t,closeOpenEditingPopups:nt,sendFunctionStatus:k,analysisData:o})),u.currOpenTaskpane.type!=="none"&&R.default.createElement("div",{className:xd},$r())),Si(),R.default.createElement(x5,{sheetDataArray:n,graphDataDict:o.graphDataDict,gridState:l,setGridState:d,mitoAPI:A,closeOpenEditingPopups:nt,uiState:u,setUIState:c,mitoContainerRef:t,setEditorState:h}),Kr(),R.default.createElement(D4,{loading:u.loading,sheetDataArray:n,userProfile:a,analysisData:o,mitoAPI:A,currOpenModal:u.currOpenModal,actions:ir,setUIState:c}),It("top_right"),o.currStepIdx!==z.step_idx&&R.default.createElement(p5,{fastForward:()=>{A.updateCheckoutStepByIndex(z.step_idx)},deleteStepsAfterIdx:()=>{A.updateUndoToStepIndex(o.currStepIdx)},isPro:a.isPro})))},nC=vT;var Sd=1e4;var PT=5*6e4,oC=25,rC=PT/oC,bT=async e=>new Promise(t=>{(async()=>{let r=!1;return e.on_msg(o=>{o.content.data.echo&&(r=!0)}),await td(()=>r,Sd),t(r)})()}),ET=async e=>{var n,r,o,i;let t=(i=(o=(r=(n=window.Jupyter)==null?void 0:n.notebook)==null?void 0:r.kernel)==null?void 0:o.comm_manager)==null?void 0:i.new_comm(e);return await td(async()=>{var a,s,l,d;return t=(d=(l=(s=(a=window.Jupyter)==null?void 0:a.notebook)==null?void 0:s.kernel)==null?void 0:l.comm_manager)==null?void 0:d.new_comm(e),t!==void 0},Sd),t===void 0?"non_working_extension_error":await bT(t)?{type:"notebook",comm:t}:"no_backend_comm_registered_error"},AT=async e=>new Promise(t=>{(async()=>{let r=e.onMsg,o=!1;return e.onMsg=i=>{i.content.data.echo&&(o=!0)},await td(()=>o,Sd),e.onMsg=r,t(o)})()}),kT=async(e,t)=>{let n;return await td(async()=>{var r;try{n=await((r=window.commands)==null?void 0:r.execute("mitosheet:create-mitosheet-comm",{kernelID:e,commTargetID:t}))}catch(o){return console.error(o),!0}return n!==void 0&&n!=="no_backend_comm_registered_error"},Sd),n===void 0?"non_working_extension_error":n==="no_backend_comm_registered_error"?"no_backend_comm_registered_error":(n.open(),await AT(n)?{type:"lab",comm:n}:"no_backend_comm_registered_error")};async function pc(e,t){let n="non_valid_location_error";if(ji()?n=await ET(t):uo()&&(n=await kT(e,t)),typeof n=="string")return n;let r=n.comm,o=r.send;n.type==="notebook"?n.comm.on_msg(d=>a(d)):n.comm.onMsg=d=>a(d);let i=pc.unconsumedResponses||(pc.unconsumedResponses=[]);function a(d){i.push(d.content.data)}function s(d,u=rC){return new Promise(c=>{let p=0,h=setInterval(()=>{if(p++,p>u)return console.error(`No response on message: {id: ${d}}`),clearInterval(h),c({error:`No response on message: {id: ${d}}`,errorShort:"No response received",showErrorModal:!1});let x=i.findIndex(D=>D.id===d);if(x!==-1){clearInterval(h);let D=i[x];if(i.splice(x,1),D.event=="error")return c({error:D.error,errorShort:D.errorShort,showErrorModal:D.showErrorModal,traceback:D.traceback});let S=D.shared_variables;return c({sheetDataArray:S?Zu(S.sheet_data_json):void 0,analysisData:S?qu(S.analysis_data_json):void 0,userProfile:S?Yu(S.user_profile_json):void 0,result:D.data})}},oC)})}async function l(d){return console.log(`Sending: {type: ${d.type}, id: ${d.id}}`),o.call(r,d),await s(d.id,rC)}return l}var NT=new Uint8Array(["REPLACE_THIS_WITH_SHEET_DATA_BYTES"]),MT=new Uint8Array(["REPLACE_THIS_WITH_ANALYSIS_DATA_BYTES"]),OT=new Uint8Array(["REPLACE_THIS_WITH_USER_PROFILE_BYTES"]),FT=Zu(new TextDecoder().decode(NT)),LT=qu(new TextDecoder().decode(MT)),UT=Yu(new TextDecoder().decode(OT)),BT="REPLACE_THIS_WITH_COMM_TARGET_ID",HT="REPLACE_THIS_WITH_DIV_ID",GT="REPLACE_THIS_WITH_KERNEL_ID",VT="REPLACE_THIS_WITH_CSS",sC=document.createElement("style");sC.appendChild(document.createTextNode(VT));document.head.append(sC);var lC=document.getElementById(HT);console.log("Rendering to div",lC);async function jT(){return await pc(GT,BT)}aC.default.render(iC.createElement(nC,{getSendFunction:jT,sheetDataArray:FT,analysisData:LT,userProfile:UT}),lC);})(); +fig.write_html("${e.graphTabName}.html")`),i=()=>{t(),e.mitoAPI.log("copy_graph_code",{graph_type:e.graphParams.graphCreation.graph_type})},a=()=>{r(),e.mitoAPI.log("copy_export_html_graph_code",{graph_type:e.graphParams.graphCreation.graph_type})};return bn.default.createElement("div",{className:"graph-sidebar-toolbar-content"},bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:i,disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to copy code that creates graph and displays it in the notebook"},n?"Copied to Clipboard!":"Copy code that displays graph"),n?bn.default.createElement(I,{justify:"center",className:"text-subtext-1"},"Paste copied code in code cell below"):bn.default.createElement(bn.default.Fragment,null)),bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:a,disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to copy code that creates graph and exports it as an html file"},o?"Copied to Clipboard!":"Copy code to create graph HTML file"),o?bn.default.createElement(I,{justify:"center",className:"text-subtext-1"},"Paste copied code in code cell below"):bn.default.createElement(bn.default.Fragment,null)),bn.default.createElement("div",null,bn.default.createElement(j,{variant:"dark",onClick:()=>{var u;let d=(u=e.mitoContainerRef.current)==null?void 0:u.querySelector('[data-title="Download plot as a png"]');d==null||d.click()},disabled:e.loading||e.graphOutput===void 0,tooltip:"Click to download graph as png"},"Download as PNG")))}var LS=N9;var M9=1e3,O9=e=>{var g,y,w;let t=e.graphID,[n,r]=(0,ke.useState)(()=>me()),[o,i]=(0,ke.useState)(()=>Ju(e.graphDataDict,t,e.uiState.selectedSheetIndex,e.sheetDataArray)),a=o.graphCreation.sheet_index,s=(g=e.graphDataDict[t])==null?void 0:g.graphOutput,l=(y=e.graphDataDict[t])==null?void 0:y.graphTabName,[d,u]=(0,ke.useState)(!1),[c,p]=(0,ke.useState)("setup");(0,ke.useEffect)(()=>{e.graphSidebarTab==="export"&&p(e.graphSidebarTab)},[e.graphSidebarTab]);let[h,x]=(0,ke.useState)(0);(0,ke.useEffect)(()=>{window.Plotly||e.mitoAPI.log("plotly_define_failed")},[]),am(()=>{x(P=>P+1)},[],"mito-center-content-container"),Wa(()=>{S()},e.analysisData),(0,ke.useEffect)(()=>{r(me()),i(Ju(e.graphDataDict,e.graphID,e.uiState.selectedSheetIndex,e.sheetDataArray)),x(P=>P+1)},[e.graphID]),on(()=>{u(!0),D()},[h],M9),(0,ke.useEffect)(()=>{try{if(s===void 0)return;new Function(s.graphScript)()}catch(P){console.error("Failed to execute graph function",P)}},[s]);let D=async()=>{var N;let P=(N=document.getElementById("mito-center-content-container"))==null?void 0:N.getBoundingClientRect();P!==void 0&&await e.mitoAPI.editGraph(t,o,`${(P==null?void 0:P.height)-10}px`,`${(P==null?void 0:P.width)-20-300}px`,n),u(!1)},S=async()=>{let P=Ju(e.graphDataDict,t,a,e.sheetDataArray);i(P)};return e.sheetDataArray.length===0?(e.setUIState(P=>f(m({},P),{currOpenTaskpane:{type:"none"}})),ke.default.createElement(ge,{setUIState:e.setUIState})):ke.default.createElement("div",{className:"graph-sidebar-div"},ke.default.createElement("div",{className:"graph-sidebar-graph-div",id:"graph-div",style:{backgroundColor:o.graphStyling.paper_bgcolor}},s===void 0&&ke.default.createElement("p",{className:"graph-sidebar-welcome-text text-align-center-important"},"To generate a graph, select an axis."),s!==void 0&&ke.default.createElement("div",{dangerouslySetInnerHTML:{__html:s.graphHTML}})),ke.default.createElement("div",{className:"graph-sidebar-toolbar-container"},ke.default.createElement("div",{className:"graph-sidebar-toolbar-content-container"},ke.default.createElement(I,{justify:"space-between",align:"center"},ke.default.createElement(C,null,ke.default.createElement("p",{className:"text-header-2"},c==="setup"&&"Setup Graph",c==="style"&&"Style Graph",c==="export"&&"Export Graph")),ke.default.createElement(C,null,ke.default.createElement(at,{onClick:()=>{e.setUIState(P=>f(m({},P),{selectedTabType:"data",currOpenTaskpane:{type:"none"}}))}}))),c==="setup"&&ke.default.createElement(oy,{graphParams:o,setGraphParams:i,setGraphUpdatedNumber:x,uiState:e.uiState,mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,dfNames:e.dfNames,columnDtypesMap:((w=e.sheetDataArray[a])==null?void 0:w.columnDtypeMap)||{},columnIDsMapArray:e.columnIDsMapArray,setUIState:e.setUIState}),c==="style"&&ke.default.createElement(FS,{graphParams:o,setGraphParams:i,setGraphUpdatedNumber:x,userProfile:e.userProfile}),c==="export"&&ke.default.createElement(LS,{graphTabName:l,graphParams:o,mitoAPI:e.mitoAPI,loading:d,graphOutput:s,mitoContainerRef:e.mitoContainerRef})),ke.default.createElement(OS,{selectedTab:c,setSelectedGraphSidebarTab:p,mitoAPI:e.mitoAPI})),d&&ke.default.createElement("div",{className:"popup-div"},ke.default.createElement($1,null),ke.default.createElement("p",{className:"popup-text-div"},"loading")))},US=O9;var Hn=T(_());var BS=(e,t)=>{if(!(e.length===0||e[t]===void 0))return{sheet_index:t,id_var_column_ids:[],value_var_column_ids:Object.keys(e[t].columnDtypeMap||{})}},F9=e=>{let{params:t,setParams:n}=Dn(()=>BS(e.sheetDataArray,e.selectedSheetIndex),"melt",e.mitoAPI,e.analysisData,50);if(t===void 0)return Hn.default.createElement(ge,{setUIState:e.setUIState});let r=e.sheetDataArray[t.sheet_index];return Hn.default.createElement(Y,null,Hn.default.createElement(Q,{header:"Unpivot Dataframe",setUIState:e.setUIState}),Hn.default.createElement(q,null,Hn.default.createElement(Lt,{title:"Select a dataframe to unpivot.",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:o=>{n(i=>{let a=BS(e.sheetDataArray,o);return a||f(m({},i),{sheet_index:o})})}}),Hn.default.createElement(I,{justify:"start",align:"center",title:"Column to use as identifier variables."},Hn.default.createElement(de,{tooltip:"Column to use as identifier variables. These columns will be present in the unpivoted dataframe."},"ID Variables")),Hn.default.createElement(tr,{sheetData:r,selectedColumnIDs:t.id_var_column_ids,onChange:o=>{n(i=>f(m({},i),{id_var_column_ids:o}))}}),Hn.default.createElement(se,{px:10}),Hn.default.createElement(I,{justify:"start",align:"center",title:"Columns to unpivot."},Hn.default.createElement(de,{tooltip:"Column to unpivot. Each column header will go in the variables column, and the column values will go in the values column."},"Values")),Hn.default.createElement(tr,{sheetData:r,selectedColumnIDs:t.value_var_column_ids.filter(o=>!t.id_var_column_ids.includes(o)),disabledColumnIDs:t.id_var_column_ids,onChange:o=>{n(i=>f(m({},i),{value_var_column_ids:o}))}})))},HS=F9;var Oe=T(_());var Bt=T(_());var zm=(e,t,n,r)=>{var l,d;let o=Object.entries(((l=e[t])==null?void 0:l.columnIDsMap)||{}),i=Object.entries(((d=e[n])==null?void 0:d.columnIDsMap)||{}),s=o.map(([u,c])=>{let p=i.findIndex(([,h])=>G(c)===G(h));if(p>-1)return[u,i[p][0]]}).filter(u=>u!==void 0);if(s.length===0)return o[0]===void 0||i[0]===void 0?void 0:[o[0][0],i[0][0]];if(r){let u=s.filter(([c,p])=>{let h=r.findIndex(([D])=>c===D)!==-1,x=r.findIndex(([,D])=>p===D)!==-1;return!h&&!x});return u.length===0?s[0]:u[0]}else return s[0]};var L9=e=>{let t=e.sheetDataArray[e.params.sheet_index_one],n=e.sheetDataArray[e.params.sheet_index_two],r=Object.keys((t==null?void 0:t.columnDtypeMap)||{}).length===0||Object.keys((n==null?void 0:n.columnDtypeMap)||{}).length===0;return Bt.default.createElement("div",{className:"light-gray-container"},Bt.default.createElement(I,{suppressTopBottomMargin:!0},Bt.default.createElement(C,null,Bt.default.createElement("p",{className:"text-header-3"},"Match rows where:"))),e.params.merge_key_column_ids.map(([o,i],a)=>Bt.default.createElement(I,{key:a,justify:"space-between",align:"center"},Bt.default.createElement(C,null,Bt.default.createElement($,{value:o,onChange:s=>{e.setParams(l=>{let d=[...l.merge_key_column_ids];return d[a][0]=s,f(m({},l),{merge_key_column_ids:d})})},width:"medium",searchable:!0},Object.entries((t==null?void 0:t.columnIDsMap)||{}).map(([s,l])=>Bt.default.createElement(v,{key:s,id:s,title:G(l)})))),Bt.default.createElement(C,{className:"text-header-3"},"="),Bt.default.createElement(C,null,Bt.default.createElement($,{value:i,onChange:s=>{e.setParams(l=>{let d=[...l.merge_key_column_ids];return d[a][1]=s,f(m({},l),{merge_key_column_ids:d})})},width:"medium",searchable:!0},Object.entries((n==null?void 0:n.columnIDsMap)||{}).map(([s,l])=>Bt.default.createElement(v,{key:s,id:s,title:G(l)})))),Bt.default.createElement(C,null,Bt.default.createElement(at,{onClick:()=>{e.setParams(s=>{let l=[...s.merge_key_column_ids];return l.splice(a,1),f(m({},s),{merge_key_column_ids:l})})}})))),e.error!==void 0&&Bt.default.createElement("p",{className:"text-color-error"},e.error),Bt.default.createElement(se,{px:15}),Bt.default.createElement(j,{width:"medium",variant:"dark",onClick:()=>{e.setParams(o=>{let i=[...o.merge_key_column_ids],a=zm(e.sheetDataArray,e.params.sheet_index_one,e.params.sheet_index_two,e.params.merge_key_column_ids);return a&&i.push(a),f(m({},o),{merge_key_column_ids:i})})},disabled:r,disabledTooltip:"One of these dataframes has no columns, so no merge keys can be added."},"+ Add Merge Keys"))},GS=L9;var Gn=T(_());var U9=e=>{let[t]=(0,Gn.useState)(e.sheetDataArray.map(n=>n.dfName));return Gn.default.createElement("div",null,Gn.default.createElement(I,{justify:"space-between"},Gn.default.createElement(C,null,Gn.default.createElement("p",{className:"text-header-3"},"First Dataframe"),Gn.default.createElement($,{value:t[e.params.sheet_index_one]||"",onChange:n=>{let r=t.indexOf(n);e.setParams(o=>{let i=Km(e.sheetDataArray,r,o.sheet_index_two,o);return i||o})},className:"merge-sheet-selection-first-dataframe-select"},t.map(n=>Gn.default.createElement(v,{key:n,title:n})))),Gn.default.createElement(C,{offsetRight:2},Gn.default.createElement("p",{className:"text-header-3"},"Second Dataframe"),Gn.default.createElement($,{value:t[e.params.sheet_index_two]||"",onChange:n=>{let r=t.indexOf(n);e.setParams(o=>{let i=Km(e.sheetDataArray,o.sheet_index_one,r,o);return i||o})},width:"medium"},t.map(n=>Gn.default.createElement(v,{key:n,title:n}))))))},VS=U9;var Km=(e,t,n,r)=>{var d,u;if(e.length<2)return;let o=t,i=n!==void 0?n:o+1<=e.length-1?o+1:o-1>=0?o-1:o;if(r&&r.sheet_index_one==o&&r.sheet_index_two===i)return r;let a=zm(e,o,i),s=[],l=[];return r&&r.sheet_index_one==o?s=r.selected_column_ids_one:s=[...Object.keys(((d=e[o])==null?void 0:d.columnIDsMap)||{})],r&&r.sheet_index_two==i?l=r.selected_column_ids_two:l=[...Object.keys(((u=e[i])==null?void 0:u.columnIDsMap)||{})],{how:r?r.how:"lookup",sheet_index_one:o,sheet_index_two:i,merge_key_column_ids:a?[a]:[],selected_column_ids_one:s,selected_column_ids_two:l}},B9=e=>{let{params:t,setParams:n,error:r}=Dn(()=>Km(e.sheetDataArray,e.selectedSheetIndex),"merge",e.mitoAPI,e.analysisData,50);if(t===void 0)return Oe.default.createElement(ge,{setUIState:e.setUIState,message:"You need two dataframes before you can merge them."});let o=e.sheetDataArray[t.sheet_index_one],i=e.sheetDataArray[t.sheet_index_two],a=t.merge_key_column_ids.map(([l])=>l),s=t.merge_key_column_ids.map(([,l])=>l);return Oe.default.createElement(Y,null,Oe.default.createElement(Q,{header:"Merge Dataframes",setUIState:e.setUIState}),Oe.default.createElement(q,null,Oe.default.createElement(I,{justify:"space-between",align:"center",suppressTopBottomMargin:!0},Oe.default.createElement(C,{offsetRight:1},Oe.default.createElement("p",{className:"text-header-3"},"Merge Type")),Oe.default.createElement(C,{offsetRight:2},Oe.default.createElement($,{value:t.how,onChange:l=>{let d=l;n(u=>f(m({},u),{how:d}))},width:"medium-large"},Oe.default.createElement(v,{title:"lookup",subtext:"Includes all rows from the first sheet and only matching rows from the second sheet. If there are mulitple matches in the second sheet, only takes the first."}),Oe.default.createElement(v,{title:"left",subtext:"Includes all rows from the first sheet and only matching rows from the second sheet. Includes all matches."}),Oe.default.createElement(v,{title:"right",subtext:"Includes all rows from the second sheet and only matching rows from the first sheet. Includes all matches."}),Oe.default.createElement(v,{title:"inner",subtext:"Only includes rows that have matches in both sheets."}),Oe.default.createElement(v,{title:"outer",subtext:"Includes all rows from both sheets, regardless of whether there is a match in the other sheet."}),Oe.default.createElement(v,{title:"unique in left",subtext:"Includes each row from the first sheet that doesn't have a match in the second sheet."}),Oe.default.createElement(v,{title:"unique in right",subtext:"Includes each row from second sheet that doesn't have a match in the first sheet."})))),Oe.default.createElement(se,{px:20}),Oe.default.createElement(VS,{params:t,setParams:n,sheetDataArray:e.sheetDataArray}),Oe.default.createElement(se,{px:20}),Oe.default.createElement(GS,{params:t,setParams:n,sheetDataArray:e.sheetDataArray,error:r}),Oe.default.createElement(se,{px:20}),Oe.default.createElement("p",{className:"text-header-3"},"Columns to Keep from First Dataframe"),t.how!=="unique in right"&&Oe.default.createElement(tr,{sheetData:o,selectedColumnIDs:t.selected_column_ids_one.concat(a),disabledColumnIDs:a,onChange:l=>{n(d=>f(m({},d),{selected_column_ids_one:l}))}}),t.how==="unique in right"&&Oe.default.createElement("p",null,"Finding the unique values in the second sheet doesn't keep any columns from the first sheet."),Oe.default.createElement(se,{px:20}),Oe.default.createElement("div",null,Oe.default.createElement("p",{className:"text-header-3"},"Columns to Keep from Second Dataframe"),t.how!=="unique in left"&&Oe.default.createElement(tr,{sheetData:i,selectedColumnIDs:t.selected_column_ids_two.concat(s),disabledColumnIDs:s,onChange:l=>{n(d=>f(m({},d),{selected_column_ids_two:l}))}}),t.how==="unique in left"&&Oe.default.createElement("p",null,"Finding the unique values in the first sheet doesn't keep any columns from the second sheet."))))},jS=B9;var Sn=T(_());var Zt=T(_());var cs=T(_()),H9=e=>{let t=e.selectedColumnIDs.filter(n=>e.columnIDsMap[n]===void 0);return(0,cs.useEffect)(()=>{t.length>0&&e.mitoAPI.log("pivot_invalid_selected_columns",{pivot_section:e.pivotSection,num_invalid:t.length})},[]),cs.default.createElement(cs.default.Fragment,null,t.length>0&&cs.default.createElement("div",{className:"text-color-error",style:{overflowX:"hidden"}},"The ",t.length===1?"column":"columns"," ",t.length===1?t[0]:t.join(", ")," ",t.length===1?"does":"do"," not exist in this sheet anymore. Delete ",t.length===1?"it":"them"," to make this pivot valid."))},fs=H9;var G9={"no-op":"exact time",year:"year","year-quarter":"year-quarter","year-month":"year-month","year-month-day":"year-month-day","year-month-day-hour":"year-month-day-hour","year-month-day-hour-minute":"year-month-day-hour-minute",quarter:"quarter",month:"month",week:"week","day of month":"day of month","day of week":"day of week",hour:"hour",minute:"minute",second:"second","month-day":"month-day","day-hour":"day-hour","hour-minute":"hour-minute"},V9="Date columns can be further processed before being aggregated. For example, if you want to compare the aggregated values across months, then select `months` in this dropdown.",j9="Rows are used to group your source data into distinct buckets. The unique values that create the buckets are placed in the first column of the resulting pivot table.",R9="Columns are used to group your source data into distinct buckets. The unique values that create the buckets are placed across the top of the resulting pivot table. For the best performance, select columns with a small number of unique values.",W9=e=>{var i,a;let t=((i=e.sheetData)==null?void 0:i.columnIDsMap)||{},n=((a=e.sheetData)==null?void 0:a.columnDtypeMap)||{},r=e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?[...e.params.pivotRowColumnIDsWithTransforms]:[...e.params.pivotColumnsColumnIDsWithTransforms],o=r.map(({column_id:s,transformation:l},d)=>{let u=n[s],c=Zt.default.createElement(Nr,{key:d,value:s,titleMap:Lu(t),onChange:p=>{e.setParams(h=>{let x=[...r];return x[d].column_id=p,f(m({},h),{[e.rowOrColumn]:x})})},onDelete:()=>{e.setParams(p=>{let h=[...r];return h.splice(d,1),f(m({},p),{[e.rowOrColumn]:h})})},selectableValues:Object.keys(t)});return u!==void 0&&it(u)?Zt.default.createElement("div",{className:"mito-blue-container mt-4px mb-4px",key:d},c,Zt.default.createElement(I,{justify:"space-between",align:"center"},Zt.default.createElement(C,{offset:.25},Zt.default.createElement(de,{tooltip:V9},"group date by")),Zt.default.createElement(C,{offsetRight:3},Zt.default.createElement($,{value:l,onChange:p=>{e.setParams(h=>{let x=[...r];return x[d].transformation=p,f(m({},h),{[e.rowOrColumn]:x})})},searchable:!0,width:"medium"},Object.entries(G9).map(([p,h])=>Zt.default.createElement(v,{key:p,id:p,title:h})))))):c});return Zt.default.createElement("div",null,Zt.default.createElement(I,{justify:"space-between",align:"center"},Zt.default.createElement(C,null,Zt.default.createElement(de,{tooltip:e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?j9:R9},e.sectionTitle)),Zt.default.createElement(C,null,Zt.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([s,l])=>Zt.default.createElement(v,{key:s,title:G(l),onClick:()=>{e.setParams(d=>{let u=[...r];return u.push({column_id:s,transformation:"no-op"}),f(m({},d),{[e.rowOrColumn]:u})})}}))))),Zt.default.createElement(fs,{columnIDsMap:t,selectedColumnIDs:r.map(({column_id:s})=>s),pivotSection:e.rowOrColumn==="pivotRowColumnIDsWithTransforms"?"row":"column",mitoAPI:e.mitoAPI}),o)},Y1=W9;var Xr=T(_());var Wr=T(_());var X9=["count","count unique"],J9=["count","count unique","mean","median","min","max"],z9=["count","count unique","sum","mean","median","min","max"],q1=(e,t,n)=>{if(e.length!==0)return n===void 0?{sourceSheetIndex:t,pivotRowColumnIDsWithTransforms:[],pivotColumnsColumnIDsWithTransforms:[],pivotValuesColumnIDsArray:[],pivotFilters:[],flattenColumnHeaders:!0,destinationSheetIndex:void 0}:Q1(n)},Q1=e=>({sourceSheetIndex:e.sheet_index,pivotRowColumnIDsWithTransforms:e.pivot_rows_column_ids_with_transforms,pivotColumnsColumnIDsWithTransforms:e.pivot_columns_column_ids_with_transforms,pivotValuesColumnIDsArray:K9(e.values_column_ids_map),pivotFilters:e.pivot_filters,flattenColumnHeaders:e.flatten_column_headers,destinationSheetIndex:e.destination_sheet_index}),RS=(e,t)=>{var o;let n=t!==void 0?((o=t[e.sourceSheetIndex])==null?void 0:o.columnDtypeMap)||{}:{},r=e.pivotFilters.map(({column_id:i,filter:a})=>{let s=n[i]||"",l=om([a],s);if(l.length!==0)return{column_id:i,filter:l[0]}}).filter(i=>i!==void 0);return{sheet_index:e.sourceSheetIndex,pivot_rows_column_ids_with_transforms:e.pivotRowColumnIDsWithTransforms,pivot_columns_column_ids_with_transforms:e.pivotColumnsColumnIDsWithTransforms,values_column_ids_map:$9(e.pivotValuesColumnIDsArray),pivot_filters:r,flatten_column_headers:e.flattenColumnHeaders,destination_sheet_index:e.destinationSheetIndex}},K9=e=>{let t=[];return Object.keys(e).forEach(n=>{e[n].forEach(r=>{t.push([n,r])})}),t},$9=e=>{let t={};for(let n=0;n{if(Zn(t)&&!X9.includes(e))return"Not valid for string column";if(it(t)&&!J9.includes(e))return"Not valid for datetime column";if(Er(t)&&!z9.includes(e))return"Not valid for timedelta column"};var Z9=e=>{let t=Object.values(Ml),n=r=>{let o=r;t.includes(o)&&e.editPivotValueAggregation(o,e.columnID)};return Wr.default.createElement(I,{align:"center"},Wr.default.createElement(C,null,Wr.default.createElement($,{value:e.aggregationType,onChange:n,width:"small",dropdownWidth:"medium"},t.map(r=>{let o=$m(r,e.columnDtype);return Wr.default.createElement(v,{key:r,title:r,disabled:o!==void 0,subtext:o,hideSubtext:!0,displaySubtextOnHover:!0})}))),Wr.default.createElement(C,{offset:1,flex:"1"},Wr.default.createElement($,{value:e.columnID,onChange:r=>{e.editPivotValueAggregation(e.aggregationType,r)},searchable:!0},Object.keys(e.columnIDsMap).map(r=>{let o=e.columnIDsMap[r];return Wr.default.createElement(v,{key:r,id:r,title:G(o)})}))),Wr.default.createElement(C,{offset:1,offsetRight:1},Wr.default.createElement(at,{onClick:()=>e.removePivotValueAggregation()})))},WS=Z9;var Y9="Values are used to summarize your source data for each of the pivot table buckets. These buckets are created by the rows and/or columns selected above.",q9=e=>{var r,o;let t=((r=e.sheetData)==null?void 0:r.columnIDsMap)||{},n=((o=e.sheetData)==null?void 0:o.columnDtypeMap)||{};return Xr.default.createElement("div",null,Xr.default.createElement(I,{justify:"space-between",align:"center"},Xr.default.createElement(C,null,Xr.default.createElement(de,{tooltip:Y9},"Values")),Xr.default.createElement(C,null,Xr.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([i,a])=>Xr.default.createElement(v,{key:i,title:G(a),onClick:()=>{e.setParams(s=>{let l=[...s.pivotValuesColumnIDsArray];return l.push([i,"count"]),f(m({},s),{pivotValuesColumnIDsArray:l})})}}))))),Xr.default.createElement(fs,{columnIDsMap:t,pivotSection:"values",selectedColumnIDs:e.params.pivotValuesColumnIDsArray.map(([i])=>i),mitoAPI:e.mitoAPI}),e.params.pivotValuesColumnIDsArray.map(([i,a],s)=>{var d;let l=((d=e.sheetData)==null?void 0:d.columnDtypeMap[i])||"";return Xr.default.createElement(WS,{key:i+s+a,columnIDsMap:t,columnID:i,columnDtype:l,aggregationType:a,removePivotValueAggregation:()=>{e.setParams(u=>{let c=[...u.pivotValuesColumnIDsArray];return c.splice(s,1),f(m({},u),{pivotValuesColumnIDsArray:c})})},editPivotValueAggregation:(u,c)=>{e.setParams(p=>{let h=[...p.pivotValuesColumnIDsArray],x=n[c]||"";return $m(a,x)!==void 0&&(u="count"),h[s]=[c,u],f(m({},p),{pivotValuesColumnIDsArray:h})})}})}))},XS=q9;var cn=T(_());var Q9="Filters are used to only include a subset of the source data in the pivot table.",ew=e=>{var o;let t=((o=e.sheetData)==null?void 0:o.columnIDsMap)||{},n=Object.keys(t),r={};return Object.entries(t).map(([i,a])=>{r[i]=G(a)}),cn.default.createElement("div",null,cn.default.createElement(I,{justify:"space-between",align:"center"},cn.default.createElement(C,null,cn.default.createElement(de,{tooltip:Q9},"Filters")),cn.default.createElement(C,null,cn.default.createElement(rn,{text:"+ Add",width:"small",searchable:!0},Object.entries(t).map(([i,a])=>cn.default.createElement(v,{key:i,title:G(a),onClick:()=>{e.setParams(s=>{let d=[{column_id:i,filter:{condition:"not_empty",value:""}}].concat(s.pivotFilters);return f(m({},s),{pivotFilters:d})})}}))))),e.error!==void 0&&e.error.includes("filter")&&cn.default.createElement("p",{className:"text-color-error"},e.error),cn.default.createElement(fs,{columnIDsMap:t,pivotSection:"values",selectedColumnIDs:e.params.pivotFilters.map(({column_id:i})=>i),mitoAPI:e.mitoAPI}),e.params.pivotFilters.map(({column_id:i,filter:a},s)=>{var d;let l=((d=e.sheetData)==null?void 0:d.columnDtypeMap[i])||"";return cn.default.createElement("div",{className:"mito-blue-container mb-5px",key:s},cn.default.createElement(I,{suppressTopBottomMargin:!0},cn.default.createElement(Nr,{value:i,titleMap:r,onChange:u=>{e.setParams(c=>{let p=[...c.pivotFilters];return p[s].column_id=u,f(m({},c),{pivotFilters:p})})},onDelete:()=>{e.setParams(u=>{let c=[...u.pivotFilters];return c.splice(s,1),f(m({},u),{pivotFilters:c})})},selectableValues:n})),cn.default.createElement(I,{suppressTopBottomMargin:!0},cn.default.createElement(ri,{filter:a,operator:"And",displayOperator:!1,setFilter:u=>{e.setParams(c=>{let p=[...c.pivotFilters];return p[s].filter=u,f(m({},c),{pivotFilters:p})})},columnDtype:l,nameLength:"short_name",suppressTopBottomMargin:!0}),cn.default.createElement(C,{span:3.5})))}))},JS=ew;var tw=e=>{let{params:t,setParams:n,error:r}=Dn(()=>q1(e.sheetDataArray,e.sourceSheetIndex,e.existingPivotParams),"pivot",e.mitoAPI,e.analysisData,0,{getBackendFromFrontend:RS,getFrontendFromBackend:Q1},{doNotSendDefaultParams:e.destinationSheetIndex!==void 0},e.sheetDataArray);if(t===void 0)return Sn.default.createElement(ge,{setUIState:e.setUIState});let o=e.sheetDataArray[t.sourceSheetIndex];return Sn.default.createElement(Y,null,Sn.default.createElement(Q,{header:e.destinationSheetIndex?`Edit Pivot Table ${e.dfNames[e.destinationSheetIndex]}`:`Create Pivot Table ${e.dfNames[e.dfNames.length-1]}`,setUIState:e.setUIState}),Sn.default.createElement(q,null,r!==void 0&&!r.includes("filter")&&Sn.default.createElement("p",{className:"text-color-error"},r),Sn.default.createElement(Lt,{title:"Dataframe to pivot",sheetDataArray:e.sheetDataArray,sheetIndex:t.sourceSheetIndex,onChange:i=>{let a=q1(e.sheetDataArray,i,void 0);n(s=>a||s)},sheetIndexToIgnore:e.destinationSheetIndex}),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(Y1,{mitoAPI:e.mitoAPI,sheetData:o,sectionTitle:"Rows",params:t,setParams:n,rowOrColumn:"pivotRowColumnIDsWithTransforms"})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(Y1,{mitoAPI:e.mitoAPI,sheetData:o,sectionTitle:"Columns",params:t,setParams:n,rowOrColumn:"pivotColumnsColumnIDsWithTransforms"})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(XS,{mitoAPI:e.mitoAPI,sheetData:o,params:t,setParams:n})),Sn.default.createElement("div",{className:"default-taskpane-body-section-div"},Sn.default.createElement(JS,{error:r,sheetData:o,params:t,setParams:n,mitoAPI:e.mitoAPI}))))},zS=tw;var ie=T(_());var Le=T(_());var ps=T(_()),nw=()=>{let[e,t]=(0,ps.useState)(1);return(0,ps.useEffect)(()=>{let n=setInterval(()=>{t(r=>r+1)},1e3);return()=>clearInterval(n)},[]),ps.default.createElement("span",null," \xA0( ",e,"s )")},sd=nw;var rw=()=>({type:"username/password",username:"",password:"",account:""}),ow=e=>{let[t,n]=(0,Le.useState)(()=>e.defaultCredentials||rw()),[r,o]=(0,Le.useState)(e.defaultCredentials?{type:"success"}:void 0),[i,a]=(0,Le.useState)(!1),s=async l=>{a(!0);let d=await e.mitoAPI.validateSnowflakeCredentials(l),u="error"in d?void 0:d.result;o(u),(u==null?void 0:u.type)==="success"?e.onValidCredentials():e.onInvalidCredentials!==void 0&&e.onInvalidCredentials(),a(!1)};return Le.default.createElement("div",{className:"mito-collapsible-content-card-container"},Le.default.createElement(je,{title:Le.default.createElement("div",{className:M("text-header-3",{"text-color-gray-disabled":i})},"Connection"),open:e.isOpen},Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Username")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.username,disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{username:d}))}}))),Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Password")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.password,type:"password",disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{password:d}))}}))),Le.default.createElement(I,{justify:"space-between"},Le.default.createElement(C,null,Le.default.createElement("p",{className:M({"text-color-gray-disabled":i})},"Account")),Le.default.createElement(C,null,Le.default.createElement(ne,{value:t.account,disabled:i,onChange:l=>{let d=l.target.value;n(u=>jt(u,{account:d}))}}))),Le.default.createElement(j,{disabled:t.username.length===0||t.password.length===0||t.account.length===0||i,disabledTooltip:"Please fill out the username, password, and account fields below.",onClick:async()=>{await s(t)},variant:"dark"},"Connect to Snowflake")),!i&&r!==void 0&&Le.default.createElement("div",{className:M({"text-color-error":r.type==="error","text-color-success":r.type==="success"},"mito-collapsible-content-card-subtext")},r.type==="success"&&"Successfully connected to Snowflake instance.",r.type==="error"&&r.error_message),i&&Le.default.createElement(I,{suppressTopBottomMargin:!0,className:M("text-subtext-1","mito-collapsible-content-card-subtext")},Le.default.createElement("p",null,"Connecting to Snowflake"),Le.default.createElement(sd,null)))},Zm=ow;var KS="Used to specify the number of rows to return. When working with large datasets, it might be helpful to begin with a subset of your data.",$S=()=>({table_loc_and_warehouse:{warehouse:void 0,database:void 0,schema:void 0,table_or_view:void 0},query_params:{columns:[],limit:void 0}}),eh=(e,t,n,r)=>{let o=window.structuredClone(e),i=f(m({},o),{table_loc_and_warehouse:f(m({},o.table_loc_and_warehouse),{database:t,schema:n,table_or_view:r}),query_params:{columns:[],limit:void 0}});return JSON.stringify(i)===JSON.stringify(e)?e:i},iw=e=>{var S;let{params:t,setParams:n,edit:r,loading:o,error:i}=wt(()=>$S(),"snowflake_import",e.mitoAPI,e.analysisData,void 0,g=>{g!==void 0&&D(g)}),[a,s]=(0,ie.useState)(e.userProfile.snowflakeCredentials!==null),[l,d]=(0,ie.useState)(e.userProfile.snowflakeCredentials===null),[u,c]=(0,ie.useState)(void 0),[p,h]=(0,ie.useState)(!1);(0,ie.useEffect)(()=>{e.userProfile.snowflakeCredentials!==null&&t!==void 0&&D(t)},[]);let x=g=>{n(g),D(g)};if(t===void 0)return ie.default.createElement(ge,{setUIState:e.setUIState});let D=async g=>{h(!0);let y=await e.mitoAPI.getAvailableSnowflakeOptionsAndDefaults(g.table_loc_and_warehouse),w="error"in y?void 0:y.result;c(w),(w==null?void 0:w.type)==="success"&&n(P=>f(m({},P),{table_loc_and_warehouse:w.default_values})),h(!1)};return ie.default.createElement(Y,null,ie.default.createElement(Q,{header:"Import from Snowflake",setUIState:e.setUIState}),ie.default.createElement(q,{userProfile:e.userProfile,requiresEnterprise:e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_ENABLE_SNOWFLAKE_IMPORT?void 0:{featureName:"snowflake_import",mitoAPI:e.mitoAPI}},ie.default.createElement(Zm,{mitoAPI:e.mitoAPI,defaultCredentials:e.userProfile.snowflakeCredentials,onValidCredentials:()=>{d(!1),s(!0),D(t)},onInvalidCredentials:()=>{s(!1),n($S()),c(void 0)},isOpen:l}),ie.default.createElement(se,{px:20}),ie.default.createElement(je,{title:ie.default.createElement("div",{className:M("text-header-3",{"text-color-gray-disabled":p})},"Configure Query"),open:(u==null?void 0:u.type)==="success"},ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Warehouse")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.warehouse||"None available",disabled:p,onChange:g=>{n(y=>jt(y,{table_loc_and_warehouse:{warehouse:g}}))}},(u==null?void 0:u.type)==="success"?u.config_options.warehouses.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Database")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.database||"None available",disabled:p,onChange:g=>{let y=eh(t,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.databases.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Schema")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.schema||"None available",disabled:p,onChange:g=>{let y=eh(t,t.table_loc_and_warehouse.database,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.schemas.map(g=>ie.default.createElement(v,{key:g,id:g,title:g})):[]))),ie.default.createElement(I,{justify:"space-between"},ie.default.createElement(C,null,ie.default.createElement("p",{className:M({"text-color-gray-disabled":p})},"Table/View")),ie.default.createElement(C,null,ie.default.createElement($,{width:"medium",value:t.table_loc_and_warehouse.table_or_view||"None available",disabled:p,onChange:g=>{let y=eh(t,t.table_loc_and_warehouse.database,t.table_loc_and_warehouse.schema,g);x(y)}},(u==null?void 0:u.type)==="success"?u.config_options.tables_and_views.map(g=>ie.default.createElement(v,{key:g,title:g})):[]))),p&&ie.default.createElement(I,{className:M("text-subtext-1")},ie.default.createElement("p",null,"Loading Snowflake options"),ie.default.createElement(sd,null))),(u==null?void 0:u.type)==="success"&&ie.default.createElement("div",null,ie.default.createElement(I,{justify:"start"},ie.default.createElement("p",{className:"text-header-3"},"Columns to Import")),ie.default.createElement(Gr,{disabled:p,height:"medium",onToggleAll:g=>{n(y=>{let w=g.map(P=>u.config_options.columns[P]);return jt(y,{query_params:{columns:w}})})}},u.config_options.columns.map((g,y)=>{let w=t.query_params.columns.includes(g);return ie.default.createElement(hr,{key:g,title:g,toggled:w,onToggle:()=>{n(P=>{let N=[...P.query_params.columns];return br(N,g),jt(P,{query_params:{columns:N}})})},index:y})})),ie.default.createElement(I,{justify:"space-between",align:"center",title:KS},ie.default.createElement(C,null,ie.default.createElement(de,{tooltip:KS},"Limit")),ie.default.createElement(C,null,ie.default.createElement(ne,{width:"medium",value:((S=t.query_params.limit)==null?void 0:S.toString())||"",placeholder:"100000",disabled:p,onChange:g=>{let y=parseInt(g.target.value);isNaN(y)&&(y=void 0),n(w=>jt(w,{query_params:{limit:y}}))}}))),o&&ie.default.createElement(I,{className:M("text-subtext-1")},ie.default.createElement("p",null,"Executing query"),ie.default.createElement(sd,null)),i!==void 0&&ie.default.createElement("p",{className:"text-color-error"},i)),ie.default.createElement(I,null,ie.default.createElement(j,{disabled:!a||t.table_loc_and_warehouse.warehouse===void 0||t.table_loc_and_warehouse.database===void 0||t.table_loc_and_warehouse.schema===void 0||t.table_loc_and_warehouse.table_or_view===void 0||t.query_params.columns.length===0,disabledTooltip:"Fill out all required fields",onClick:()=>r(),variant:"dark"},"Run Query"))))},ZS=iw;var Ie=T(_());var Ym=T(_()),aw=e=>Ym.default.createElement("div",{key:e.title,onClick:()=>{e.onToggle(e.id?e.id:e.title)},className:"text-body-2"},Ym.default.createElement("input",{type:"checkbox",name:e.title,value:e.id?e.id:e.title,checked:e.checked}),Ym.default.createElement("label",{style:{marginRight:"3px"},htmlFor:e.title},e.title)),YS=aw;var th={",":"Comma","-":"Dash"," ":"Tab"," ":"Space"},nh=(e,t,n)=>{var o;if(t.length===0||t[n]===void 0)return;let r;return e!==void 0&&Object.keys(t[n].columnIDsMap).includes(e)?r=e:r=Object.keys(((o=t[n])==null?void 0:o.columnIDsMap)||{})[0],{sheet_index:n,column_id:r,delimiters:[],new_column_header_suffix:_l()}},sw=e=>{var u,c;let{params:t,setParams:n,loading:r,edit:o,editApplied:i,result:a}=wt(()=>nh(e.startingColumnID,e.sheetDataArray,e.selectedSheetIndex),"split_text_to_columns",e.mitoAPI,e.analysisData),[s,l]=(0,Ie.useState)([]);(0,Ie.useEffect)(()=>{n(p=>{let h=nh(e.startingColumnID,e.sheetDataArray,e.selectedSheetIndex);return h||p})},[e.startingColumnID]),(0,Ie.useEffect)(()=>{d()},[t]);async function d(){if(t!==void 0&&t.column_id!==void 0&&t.delimiters.length>0){let p=await e.mitoAPI.getSplitTextToColumnsPreview(t),h="error"in p?void 0:p.result;l(h!==void 0?h.dfPreviewRowDataArray:[])}else l([])}return t===void 0||t.column_id===void 0?Ie.default.createElement(ge,{setUIState:e.setUIState}):Ie.default.createElement(Y,null,Ie.default.createElement(Q,{header:"Split Text to Columns",setUIState:e.setUIState}),Ie.default.createElement(q,null,Ie.default.createElement(Lt,{title:"Dataframe to select a column to split text within",sheetDataArray:e.sheetDataArray,sheetIndex:t.sheet_index,onChange:p=>{n(h=>{let x=nh(void 0,e.sheetDataArray,p);return x||f(m({},h),{sheet_index:p})})}}),Ie.default.createElement(I,{justify:"space-between",align:"center"},Ie.default.createElement(C,null,Ie.default.createElement("p",{className:"text-header-3"},"Column")),Ie.default.createElement(C,null,Ie.default.createElement($,{width:"medium-large",value:G(((u=e.sheetDataArray[t.sheet_index])==null?void 0:u.columnIDsMap[t.column_id])||"select a column"),searchable:!0},Object.entries(((c=e.sheetDataArray[t.sheet_index])==null?void 0:c.columnIDsMap)||{}).map(([p,h])=>Ie.default.createElement(v,{key:p,title:G(h),onClick:()=>{n(x=>f(m({},x),{column_id:p}))}}))))),Ie.default.createElement(I,{justify:"space-between"},Ie.default.createElement(C,{span:6},Ie.default.createElement("p",{className:"text-header-3"},"Delimiters")),Ie.default.createElement(C,{className:"light-gray-container element-width-medium-large"},Object.entries(th).map(([p,h])=>Ie.default.createElement(YS,{key:h,id:p,title:h,checked:t.delimiters.includes(p),onToggle:x=>{n(D=>{let S=[...D.delimiters];return br(S,x),f(m({},D),{delimiters:S})})}})),Ie.default.createElement(ne,{value:t.delimiters.filter(p=>!Object.keys(th).includes(p))[0],placeholder:"Custom Delimiter",className:"mt-5px",onChange:p=>{let h=p.target.value;n(x=>{let D=[...x.delimiters].filter(S=>Object.keys(th).includes(S));return h!==""&&D.push(h),f(m({},x),{delimiters:D})})}}))),Ie.default.createElement("div",null,Ie.default.createElement(I,null,Ie.default.createElement("p",{className:"text-header-3"},"Columns Preview")),s.length>0&&Ie.default.createElement(I,{style:{width:"100%",overflowX:"auto"},suppressTopBottomMargin:!0},Ie.default.createElement("table",{className:"preview-table",cellSpacing:"0"},Ie.default.createElement("tbody",null,s.map((p,h)=>Ie.default.createElement("tr",{className:"preview-table-table-row",key:h},p.map((x,D)=>Ie.default.createElement("td",{className:"preview-table-table-data",key:D},""+x))))))),s.length===0&&Ie.default.createElement(I,{style:{width:"100%"},justify:"center"},Ie.default.createElement("p",{className:"mt-10px"},"Select a delimiter to preview the split")))),Ie.default.createElement(Me,null,Ie.default.createElement(j,{variant:"dark",width:"block",onClick:()=>o(p=>f(m({},p),{new_column_header_suffix:_l()})),disabled:t.delimiters.length===0,disabledTooltip:"Select at least one delimiter"},i?r?"Splitting column ...":`Split on delimiter${t.delimiters.length>1?"s":""}`:`Split on delimiter${t.delimiters.length>1?"s":""}`),i&&Ie.default.createElement("p",{className:"text-subtext-1"},"Created ",a==null?void 0:a.num_cols_created," new columns"),!i&&Ie.default.createElement(se,{px:18})))},qS=sw;var Yt=T(_());var Vn=T(_());var lw=e=>e.df_names.length===0?"Select dataframe to update":`Update to ${e.df_names[0]}`,dw=e=>{var o,i;let[t,n]=ln([],async()=>{let a=await e.mitoAPI.getDefinedDfNames();return"error"in a?void 0:a.result},void 0,[]),r=Vn.default.createElement(Wm,{values:t,selectedValue:(o=e.params)==null?void 0:o.df_names[0],onChange:a=>e.setParams(s=>f(m({},s),{df_names:[a]})),loading:n});return e.params===void 0?Vn.default.createElement("div",{className:"text-body-1"},"There has been an error loading dataframes to import. Please try again, or ",Vn.default.createElement("a",{className:"text-body-1-link",href:"https://join.slack.com/t/trymito/shared_invite/zt-1h6t163v7-xLPudO7pjQNKccXz7h7GSg",target:"_blank",rel:"noreferrer"},"contact support"),"."):Vn.default.createElement(Y,null,Vn.default.createElement(Q,{header:e.isUpdate?"Import Dataframes":"Update Import",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),Vn.default.createElement(q,null,Vn.default.createElement(I,{justify:"start",align:"center"},Vn.default.createElement(C,null,Vn.default.createElement(de,{tooltip:"Dataframes that have been created elsewhere in this notebook can be imported through this taskpane."},"Dataframes to Import"))),r,Vn.default.createElement(se,{px:10})),Vn.default.createElement(Me,null,Vn.default.createElement(j,{variant:"dark",width:"block",onClick:()=>{e.edit()},disabled:(((i=e.params)==null?void 0:i.df_names.length)||0)===0},lw(e.params))))},QS=dw;var En=T(_());var le=T(_());var rh=T(_()),uw=()=>rh.default.createElement("svg",{width:"10",height:"15",viewBox:"0 0 10 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},rh.default.createElement("path",{d:"M1.36401 1.13672L7.72797 7.50068L1.36401 13.8646",stroke:"#494650",strokeWidth:"2",strokeLinecap:"round"})),e4=uw;function n4(e){return e!==void 0&&"file_names"in e&&!("sheet_names"in e)}function r4(e){return e!==void 0&&"sheet_names"in e}function o4(e){return e!==void 0&&"df_names"in e}var i4=e=>e.replace(/^.*[\\\\/]/,"");function mw(e,t,n){let r=[...e],o=0;return r.forEach(i=>{o+i.imports.length>t&&(i.imports[t-o]=n),o+=i.imports.length}),r}var t4=e=>e===void 0?[]:e.map(t=>t.imports).flat(),qm=(e,t)=>{let n=t4(e),r=e!==void 0&&t===void 0?n:t4(t);return n.map((o,i)=>[o,r[i]])},hs=(e,t,n,r,o,i)=>{n(a=>{if(a!==void 0)return mw(a,e,t)}),r(a=>{if(a.includes(e))return a;let s=[...a];return s.push(e),s}),o(a=>{let s=m({},a);return s[e]!==void 0&&delete s[e],s}),i(void 0)},a4=(e,t,n,r,o)=>{e!==void 0&&e.forEach((i,a)=>{i.imports[0].step_type==="snowflake_import"&&hs(a,i.imports[0],t,n,r,o)})},gs=e=>e+" Update imports to fix this error.";var ys=e=>{let t=i4(e);return le.default.createElement("span",{title:e},t)},na=e=>le.default.createElement("span",{title:e||"not definend"},e),cw=e=>e.step_type==="excel_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.sheet_names[0])," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_name)):e.step_type==="simple_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",ys(e.params.file_names[0])):e.step_type==="dataframe_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.df_names[0])):e.step_type==="excel_range_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.range_imports[0].df_name)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_path)):e.step_type==="snowflake_import"?le.default.createElement("div",null,le.default.createElement("span",{className:"text-color-medium-gray-important"},"Imported ")," ",na(e.params.table_loc_and_warehouse.table_or_view)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from Snowflake ")):le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)),fw=(e,t,n)=>n?e.step_type==="excel_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.sheet_names[0])," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_name)):e.step_type==="simple_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",ys(e.params.file_names[0])):e.step_type==="dataframe_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.df_names[0])):e.step_type==="excel_range_import"?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-medium-gray-important"},"Update to ")," ",na(e.params.range_imports[0].df_name)," ",le.default.createElement("span",{className:"text-color-medium-gray-important"},"from ")," ",ys(e.params.file_path)):e.step_type==="snowflake_import"?le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)):le.default.createElement("div",null,le.default.createElement(le.default.Fragment,null)):t!==void 0?le.default.createElement("div",{className:"mt-3px"},le.default.createElement("span",{className:"text-color-error-important text-overflow-wrap"},t)):null,pw=e=>{let t=e.displayedImportCardDropdown===e.dataframeCreationIndex,n=()=>{e.setDisplayedImportCardDropdown(e.dataframeCreationIndex)},r=()=>{e.setDisplayedImportCardDropdown(i=>{if(i!==e.dataframeCreationIndex)return i})},o=()=>{let i=[];return e.dataframeCreationData.step_type==="snowflake_import"&&i.push(le.default.createElement(v,{key:"Connect to Snowflake",title:"Connect to Snowflake",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"authenticate_to_snowflake"},params:void 0})}})),i=i.concat([le.default.createElement(v,{key:"Replace with file",title:"Replace with file",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"file_browser"},params:void 0})}}),le.default.createElement(v,{key:"Replace with dataframe",title:"Replace with dataframe",onClick:()=>{e.setReplacingDataframeState({dataframeCreationIndex:e.dataframeCreationIndex,importState:{screen:"dataframe_import"},params:{df_names:[]}})}})]),i};return le.default.createElement(I,{justify:"space-between",align:"top",onClick:()=>{n()}},le.default.createElement(C,{span:22},le.default.createElement(I,{align:"top"},le.default.createElement("div",{className:"mt-1px"},le.default.createElement(Gm,null)),le.default.createElement(C,{span:22,offset:.25},cw(e.dataframeCreationData),fw(e.updatedDataframeCreationData,e.preUpdateInvalidImportMessage,e.isUpdated))),e.postUpdateInvalidImportMessage&&le.default.createElement(I,{align:"top"},le.default.createElement(C,{span:22,offset:1.2},le.default.createElement("span",{className:"text-color-error-important text-overflow-wrap"},e.postUpdateInvalidImportMessage)))),le.default.createElement(C,{className:"mt-3px"},le.default.createElement("div",null,le.default.createElement(e4,null),le.default.createElement(pe,{display:t,closeDropdown:()=>r(),width:"medium"},o()))))},Qm=pw;var hw=e=>{var s,l,d;let[t,n]=(0,En.useState)(!1),r=null;if(e.importDataAndErrors===void 0)r=En.default.createElement("p",null,"Loading previously imported data...");else{if((((s=e.importDataAndErrors)==null?void 0:s.importData.length)||0)===0&&e.sheetDataArray.length===0)return En.default.createElement(ge,{setUIState:e.setUIState,message:"Before changing imports, you need to import something."});if((((l=e.importDataAndErrors)==null?void 0:l.importData.length)||0)===0)return En.default.createElement(ge,{header:"Update passed dataframes",setUIState:e.setUIState,message:"You can change imports by changing the data passed to the mitosheet.sheet call above.",suppressImportLink:!0});r=qm(((d=e.importDataAndErrors)==null?void 0:d.importData)||[],e.updatedStepImportData).map(([c,p],h)=>En.default.createElement(Qm,{key:h,dataframeCreationIndex:h,dataframeCreationData:c,isUpdated:e.updatedIndexes.includes(h),updatedDataframeCreationData:p,displayedImportCardDropdown:e.displayedImportCardDropdown,setDisplayedImportCardDropdown:e.setDisplayedImportCardDropdown,setReplacingDataframeState:e.setReplacingDataframeState,preUpdateInvalidImportMessage:void 0,postUpdateInvalidImportMessage:e.invalidImportMessages[h]}))}let o=e.updatedIndexes.length>0,i=Object.keys(e.invalidImportMessages).length>0,a=!o||i||t;return En.default.createElement(Y,null,En.default.createElement(Q,{header:"Change Imports",setUIState:e.setUIState}),En.default.createElement(q,null,e.invalidReplayError&&En.default.createElement("p",{className:"text-color-error"},e.invalidReplayError),r),En.default.createElement(Me,null,En.default.createElement(j,{variant:"dark",onClick:async()=>{let u=async()=>{if(e.updatedStepImportData===void 0)return;let c=await e.mitoAPI.getTestImports(e.updatedStepImportData),p="error"in c?void 0:c.result;if(p!==void 0&&(e.setInvalidImportMessages(p),e.mitoAPI.log("clicked_update_from_post_replay_update_imports"),e.mitoAPI.log("get_test_import_results",{open_due_to_replay_error:!1,num_invalid_imports:Object.keys(p).length}),Object.keys(p).length===0)){let h=await e.mitoAPI.updateExistingImports(e.updatedStepImportData);"error"in h?e.setInvalidReplayError(gs(h.error)):e.setUIState(x=>f(m({},x),{currOpenTaskpane:{type:"none"},currOpenPopups:f(m({},x.currOpenPopups),{["top_right"]:{type:"ephemeral_message",message:"Successfully replayed analysis on new data"}})}))}};n(!0),await u(),n(!1)},disabled:a,disabledTooltip:a?"Please resolve all errors with above imports.":void 0},En.default.createElement("p",{className:"text-align-center-important"},t?"Changing Imports...":"Change Imports"))))},s4=hw;var fn=T(_());var ec="Please fix failed data imports to replay analysis.",gw=e=>{var l;let[t,n]=(0,fn.useState)(!1),r=null,o=e.importDataAndErrors===void 0;e.importDataAndErrors===void 0?r=fn.default.createElement("p",null,"Loading previously imported data..."):r=qm(e.importDataAndErrors.importData,e.updatedStepImportData).map(([u,c],p)=>{var h;return fn.default.createElement(Qm,{key:p,dataframeCreationIndex:p,dataframeCreationData:u,isUpdated:e.updatedIndexes.includes(p),updatedDataframeCreationData:c,displayedImportCardDropdown:e.displayedImportCardDropdown,setDisplayedImportCardDropdown:e.setDisplayedImportCardDropdown,setReplacingDataframeState:e.setReplacingDataframeState,preUpdateInvalidImportMessage:(h=e.importDataAndErrors)==null?void 0:h.invalidImportMessages[p],postUpdateInvalidImportMessage:e.postUpdateInvalidImportMessages[p]})});let i=Object.keys(((l=e.importDataAndErrors)==null?void 0:l.invalidImportMessages)||{}).filter(d=>!e.updatedIndexes.includes(parseInt(d))).length===0,a=Object.keys(e.postUpdateInvalidImportMessages).length>0,s=!i||a||o||t;return fn.default.createElement(Y,null,fn.default.createElement(Q,{header:"Change Imports to Replay Analysis",setUIState:e.setUIState,notCloseable:!0}),fn.default.createElement(q,null,(e.invalidReplayError===ec&&!i||e.invalidReplayError!==void 0&&e.invalidReplayError!==ec)&&fn.default.createElement("p",{className:"text-color-error"},e.invalidReplayError),r),fn.default.createElement(Me,null,fn.default.createElement(I,{justify:"space-between"},fn.default.createElement(C,null,fn.default.createElement(j,{variant:"light",width:"medium",onClick:()=>{$u(e.failedReplayData.analysisName,e.analysisData.analysisName,e.mitoAPI),e.mitoAPI.log("clicked_start_new_analysis_from_pre_replay_update_imports"),e.setUIState(d=>f(m({},d),{currOpenTaskpane:{type:"none"}}))},tooltip:"This will start a new analysis with no steps in this mitosheet."},"Start New Analysis")),fn.default.createElement(C,{span:12},fn.default.createElement(j,{variant:"dark",onClick:async()=>{let d=async()=>{if(e.updatedStepImportData===void 0)return;let u=await e.mitoAPI.getTestImports(e.updatedStepImportData),c="error"in u?void 0:u.result;if(c!==void 0&&(e.setPostUpdateInvalidImportMessages(c),e.mitoAPI.log("clicked_update_from_pre_replay_update_imports"),e.mitoAPI.log("get_test_import_results",{num_invalid_imports:Object.keys(c).length,open_due_to_replay_error:!0}),Object.keys(c).length===0)){e.setInvalidReplayError(void 0);let p=await e.mitoAPI.updateReplayAnalysis(e.failedReplayData.analysisName,e.failedReplayData.args,e.updatedStepImportData);"error"in p?e.setInvalidReplayError(gs(p.error)):e.setUIState(h=>f(m({},h),{currOpenTaskpane:{type:"none"},currOpenPopups:f(m({},h.currOpenPopups),{["top_right"]:{type:"ephemeral_message",message:"Successfully replayed analysis on new data"}})}))}};n(!0),await d(),n(!1)},disabled:s,disabledTooltip:s?"Please resolve all errors with above imports.":void 0},fn.default.createElement("p",{className:"text-align-center-important"},t?"Updating Imports...":"Retry With Updated Imports"))))))},l4=gw;var ld=T(_());var yw=e=>ld.default.createElement(Y,null,ld.default.createElement(Q,{header:"Connect to Snowflake",setUIState:e.setUIState,backCallback:e.backCallback,notCloseable:e.notCloseable}),ld.default.createElement(q,null,ld.default.createElement(Zm,{mitoAPI:e.mitoAPI,onValidCredentials:()=>e.edit(),isOpen:!0}))),d4=yw;var Sw=e=>{let t=e.failedReplayData,n=t!==void 0,[r,o]=(0,Yt.useState)(void 0),[i,a]=(0,Yt.useState)([]),[s,l]=(0,Yt.useState)(void 0),[d,u]=(0,Yt.useState)(void 0),[c,p]=(0,Yt.useState)({}),[h]=ln(void 0,async()=>{let g,y;if(t!==void 0){let w=await e.mitoAPI.getImportedFilesAndDataframesFromAnalysisName(t.analysisName,t.args);g="error"in w?void 0:w.result;let P=await e.mitoAPI.getTestImports(g||[]);y="error"in P?{}:P.result}else{let w=await e.mitoAPI.getImportedFilesAndDataframesFromCurrentSteps();g="error"in w?void 0:w.result,y={}}if(g!==void 0&&y!==void 0)return{importData:g,invalidImportMessages:y}},g=>{g!==void 0&&(o(y=>y===void 0?window.structuredClone(g.importData):y),t!==void 0&&(Object.keys(g.invalidImportMessages).length>0?D(ec):D(gs(t.error.error))))},[]),[x,D]=(0,Yt.useState)(void 0);if((0,Yt.useEffect)(()=>{e.mitoAPI.log("opened_update_imports_taskpane",{open_due_to_replay_error:n,num_invalid_imports:(h==null?void 0:h.invalidImportMessages)===void 0?0:Object.keys(h.invalidImportMessages).length,num_total_imports:(h==null?void 0:h.importData)===void 0?0:h==null?void 0:h.importData.length})},[h]),d===void 0)return e.failedReplayData!==void 0?Yt.default.createElement(l4,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,updatedStepImportData:r,setUpdatedStepImportData:o,updatedIndexes:i,setUpdatedIndexes:a,displayedImportCardDropdown:s,setDisplayedImportCardDropdown:l,setReplacingDataframeState:u,postUpdateInvalidImportMessages:c,setPostUpdateInvalidImportMessages:p,failedReplayData:e.failedReplayData,importDataAndErrors:h,invalidReplayError:x,setInvalidReplayError:D}):Yt.default.createElement(s4,{mitoAPI:e.mitoAPI,sheetDataArray:e.sheetDataArray,setUIState:e.setUIState,updatedStepImportData:r,setUpdatedStepImportData:o,updatedIndexes:i,setUpdatedIndexes:a,displayedImportCardDropdown:s,setDisplayedImportCardDropdown:l,setReplacingDataframeState:u,invalidImportMessages:c,setInvalidImportMessages:p,importDataAndErrors:h,invalidReplayError:x,setInvalidReplayError:D});let S=d.importState;if(S.screen==="file_browser")return Yt.default.createElement(Vm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!0,currPathParts:e.currPathParts,setCurrPathParts:e.setCurrPathParts,setImportState:g=>{u({importState:g,params:void 0,dataframeCreationIndex:d.dataframeCreationIndex})},importCSVFile:async g=>{let y=[...e.currPathParts];y.push(g.name);let w=await e.mitoAPI.getPathJoined(y),P="error"in w?void 0:w.result;if(P===void 0)return;let N={step_type:"simple_import",params:{file_names:[P]}},A=await e.mitoAPI.getTestImports([{step_id:"fake_id",imports:[N]}]),k="error"in A?void 0:A.result;if(k===void 0||Object.keys(k).length>0){u({importState:{screen:"csv_import_config",fileName:g.name,filePath:P,error:k!==void 0?k[0]:void 0},params:void 0,dataframeCreationIndex:d.dataframeCreationIndex});return}hs(d.dataframeCreationIndex,N,o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n});if(S.screen==="csv_import_config"){let g=n4(d.params)?d.params:J1(S.filePath);return Yt.default.createElement(jm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!0,fileName:S.fileName,filePath:S.filePath,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:async()=>{var N;let y={step_type:"simple_import",params:g},w=await e.mitoAPI.getTestImports([{step_id:"fake_id",imports:[y]}]),P="error"in w?void 0:w.result;if(P===void 0||Object.keys(P).length>0){let A=P!==void 0?P[0]:void 0,k=A&&((N=S.error)==null?void 0:N.startsWith(A))?`${S.error} Still invalid.`:A;u({importState:f(m({},S),{error:k}),params:void 0,dataframeCreationIndex:d.dataframeCreationIndex});return}hs(d.dataframeCreationIndex,{step_type:"simple_import",params:g},o,a,p,u)},editApplied:!1,loading:!1,error:S.error,backCallback:()=>{u(void 0)},notCloseable:n})}else if(d.importState.screen==="xlsx_import_config"){let g=r4(d.params)?d.params:z1(d.importState.filePath);return Yt.default.createElement(Xm,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,userProfile:e.userProfile,setUIState:e.setUIState,isUpdate:!0,fileName:d.importState.fileName,filePath:d.importState.filePath,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:()=>{hs(d.dataframeCreationIndex,{step_type:"excel_import",params:g},o,a,p,u)},editApplied:!1,loading:!1,backCallback:()=>{u(void 0)},notCloseable:n})}else{if(d.importState.screen==="authenticate_to_snowflake")return Yt.default.createElement(d4,{mitoAPI:e.mitoAPI,setUIState:e.setUIState,edit:()=>{a4(r,o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n});{let g=o4(d.params)?d.params:{df_names:[]};return Yt.default.createElement(QS,{mitoAPI:e.mitoAPI,analysisData:e.analysisData,setUIState:e.setUIState,isUpdate:!0,params:g,setParams:y=>{u(w=>{if(w!==void 0)return f(m({},w),{params:y(g)})})},edit:()=>{hs(d.dataframeCreationIndex,{step_type:"dataframe_import",params:g},o,a,p,u)},backCallback:()=>{u(void 0)},notCloseable:n})}}},u4=Sw;var Nt=T(_());var Cw=e=>{if(e.userDefinedImporters.length!==0)return{importer:e.userDefinedImporters[0].name}},Iw="You have not defined any importers. To define importers, pass them to the mitosheet.sheet call with the `importers` parameter. An importer is just a function that returns a pandas dataframe.",xw=e=>{let[t,n]=(0,Nt.useState)(()=>Cw(e.analysisData)),[r,o]=(0,Nt.useState)(void 0),{edit:i}=km("user_defined_import",e.mitoAPI,e.analysisData);return Nt.default.createElement(Y,null,Nt.default.createElement(Q,{header:"Custom Import",setUIState:e.setUIState}),Nt.default.createElement(q,{requiresEnterprise:{featureName:"user_defined_import",mitoAPI:e.mitoAPI},userProfile:e.userProfile},t===void 0&&Nt.default.createElement("p",null,"Pass importers to the mitosheet.sheet call with the `importers` parameter. An importer is just a function that returns some number of pandas dataframes."),t!==void 0&&Nt.default.createElement(Nt.default.Fragment,null,Nt.default.createElement(I,{justify:"space-between",align:"center",title:"TODO"},Nt.default.createElement(C,null,Nt.default.createElement("p",{className:"text-header-3"},"Import Method")),Nt.default.createElement(C,null,Nt.default.createElement($,{width:"medium",value:t.importer,onChange:a=>{n(s=>f(m({},s),{importer:a}))}},e.analysisData.userDefinedImporters.map(a=>Nt.default.createElement(v,{key:a.name,title:a.name,subtext:a.docstring}))))),r!==void 0&&Nt.default.createElement("p",{className:"text-color-error"},r))),Nt.default.createElement(Me,null,Nt.default.createElement(j,{variant:"dark",width:"block",onClick:async()=>{if(t!==void 0){let a=await i(t);o(a)}},disabled:t===void 0,disabledTooltip:Iw},"Import Data")))},m4=xw;var ah=T(_());var c4=(e,t,n,r,o)=>{let[i,a]=(0,ah.useState)("loading"),[s]=(0,ah.useState)(()=>new Ol(async()=>{let l=await e();if(typeof l=="string"){a(l);return}else return a("finished"),l},t,n,r,o));return{mitoAPI:s,sendFunctionStatus:i}};var wo=T(_());var _t=T(_());var sh=T(_()),ww=()=>sh.default.createElement("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sh.default.createElement("path",{d:"M8 15.25C12.0041 15.25 15.25 12.0041 15.25 8C15.25 3.99594 12.0041 0.75 8 0.75C3.99593 0.75 0.75 3.99594 0.75 8C0.75 12.0041 3.99593 15.25 8 15.25Z",fill:"#E8EBF8",stroke:"#ACACAD",strokeWidth:"0.5"})),f4=ww;var he=T(_());var dd=T(_()),Tw=()=>dd.default.createElement("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dd.default.createElement("path",{d:"M3.58008 6.88696L6.87312 10.1738L10.16 6.88696",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),dd.default.createElement("path",{d:"M12.7458 9.68372L12.7334 12.1209C12.7272 13.1628 11.8838 14 10.8482 14H2.88532C1.84345 14 0.993832 13.1566 1.00003 12.1085V9.68372",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),dd.default.createElement("path",{d:"M6.87305 0.741211V9.11335",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),Ss=Tw;var tc=T(_()),_w=()=>tc.default.createElement("svg",{width:"19",height:"15",viewBox:"0 0 19 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},tc.default.createElement("path",{d:"M7.17099 14.267C10.7582 14.267 13.6662 11.359 13.6662 7.77182C13.6662 4.18462 10.7582 1.27661 7.17099 1.27661C3.58378 1.27661 0.675781 4.18462 0.675781 7.77182C0.675781 11.359 3.58378 14.267 7.17099 14.267Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),tc.default.createElement("path",{d:"M11.6671 14.267C15.2543 14.267 18.1623 11.359 18.1623 7.77182C18.1623 4.18462 15.2543 1.27661 11.6671 1.27661C8.07988 1.27661 5.17188 4.18462 5.17188 7.77182C5.17188 11.359 8.07988 14.267 11.6671 14.267Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),p4=_w;var pi=T(_()),Dw=()=>pi.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pi.default.createElement("path",{d:"M14 1.39062H1V14.3906H14V1.39062Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M4.56445 1.71179V14.2353",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M1.24023 5.02649H13.7741",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M10.7165 7.89587V10.962H7.75391",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M9.74219 8.81775L10.747 7.80261L11.731 8.77632",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pi.default.createElement("path",{d:"M8.01123 11.9564L6.99609 10.9412L7.9698 9.96753",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),nc=Dw;var ra=T(_()),vw=()=>ra.default.createElement("svg",{width:"14",height:"15",viewBox:"0 0 14 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ra.default.createElement("path",{d:"M9.27408 14.3835H4.67924C3.65951 14.3835 2.82795 13.558 2.83402 12.5322L2.84009 3.94946H11.1618L11.1193 12.5443C11.1193 13.564 10.2938 14.3835 9.27408 14.3835Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M1 3.94946H13",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M8.35669 1.4126H5.63742C5.21861 1.4126 4.88477 1.75251 4.88477 2.16525V3.94977H9.11542V2.16525C9.11542 1.75251 8.77551 1.4126 8.35669 1.4126Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M5.43164 6.69983V11.3796",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ra.default.createElement("path",{d:"M8.38477 6.69983V11.3796",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),Cs=vw;var ud=T(_()),Pw=()=>ud.default.createElement("svg",{width:"11",height:"15",viewBox:"0 0 11 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ud.default.createElement("path",{d:"M7.44262 12.3725V13.6741C7.44262 14.0686 7.12049 14.3907 6.72604 14.3907H1.71657C1.32213 14.3907 1 14.0686 1 13.6741V2.07742C1 1.68297 1.32213 1.36084 1.71657 1.36084H6.72604C7.12049 1.36084 7.44262 1.68297 7.44262 2.07742V3.24103",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ud.default.createElement("path",{d:"M7.44141 5.41052V10.3411",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ud.default.createElement("path",{d:"M9.91371 7.87573H4.97656",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),rc=Pw;var md=T(_()),bw=e=>md.default.createElement("svg",{width:e.width||"25",height:e.height||"25",viewBox:"0 0 13 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},md.default.createElement("rect",{x:"8.67323",y:"2.56851",width:"2.27778",height:"9.93478",transform:"rotate(36.5296 8.67323 2.56851)",stroke:"black",strokeWidth:"0.5"}),md.default.createElement("rect",{x:"0.349697",y:"-0.0520781",width:"2.27778",height:"2.1087",transform:"matrix(0.80355 0.595237 0.595237 -0.80355 8.33261 2.44081)",stroke:"black",strokeWidth:"0.5"}),md.default.createElement("path",{d:"M1.9732 13.5266L4.22513 12.7599L2.05046 11.149L1.9732 13.5266Z",fill:"black"})),oa=bw;var Tt=T(_()),Ew=e=>Tt.default.createElement("svg",{width:e.width||"25",height:e.height||"25",viewBox:"0 0 36 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",fill:"#00090F"}),Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",fill:"url(#paint0_linear)"}),Tt.default.createElement("path",{d:"M4.27806 14.4605C4.41192 13.3117 5.01895 12.0216 5.97434 10.7002C7.05826 9.20103 8.57046 7.68957 10.2741 6.33985C11.9773 4.99054 13.8647 3.80854 15.6941 2.96488C17.5272 2.11946 19.2841 1.62217 20.731 1.62217H20.8262L20.8973 1.55886C22.3577 0.258248 24.1677 0.253529 25.9155 1.11776C27.6712 1.98588 29.3356 3.7235 30.4197 5.84055C31.0401 7.05223 31.4658 8.37926 31.6121 9.72767C31.4497 10.4602 31.1397 11.1739 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5047 19.4603 18.5656C18.6629 19.3172 17.9036 20.033 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.78218 22.385 5.10127 18.758 4.27806 14.4605ZM8.07142 22.403C6.88109 21.2513 5.86085 19.9151 5.17471 18.5227C6.56859 21.1106 8.80658 23.0423 11.761 23.4551L11.7783 23.4575H11.7956C14.0044 23.4575 15.7662 22.4397 17.4555 21.0493C18.235 20.4078 19.0063 19.6806 19.8006 18.9319C19.8661 18.8701 19.9318 18.8082 19.9976 18.7462C20.8491 17.9441 21.7325 17.1207 22.6972 16.339C27.0236 15.6292 29.6835 14.0688 31.0672 12.1346C31.3017 11.8069 31.4986 11.4697 31.6603 11.1258C31.6376 11.6681 31.5653 12.2087 31.4378 12.7414C30.8855 15.0491 29.2908 17.2422 26.141 18.8137C25.1942 19.2071 24.2969 19.8633 23.4233 20.6105C22.8835 21.0722 22.3406 21.5797 21.7977 22.0873C21.4643 22.399 21.131 22.7107 20.7983 23.0118C19.0215 24.6198 17.2161 25.9694 15.1112 25.9694C12.9939 25.9694 10.2755 24.5356 8.07142 22.403ZM31.7045 7.69414C31.4887 6.97391 31.204 6.27528 30.8647 5.61267C29.932 3.7912 28.5772 2.22312 27.0733 1.21431C27.108 1.23321 27.1426 1.25235 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C31.4961 6.56563 31.6371 7.12861 31.7045 7.69414ZM10.479 5.54883C12.213 4.17852 14.1208 2.97754 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727788C21.1373 0.67428 21.2705 0.625511 21.4039 0.58136C21.1408 0.730055 20.8844 0.909881 20.6364 1.12282C19.1081 1.14374 17.3123 1.66796 15.4847 2.51083C13.799 3.28822 12.0713 4.34354 10.479 5.54883Z",stroke:"black",strokeWidth:"0.5"}),Tt.default.createElement("g",{filter:"url(#filter0_d)"},Tt.default.createElement("path",{d:"M22.5916 16.1028C18.6195 19.3058 16.0425 23.2075 11.7956 23.2075C7.55216 22.6146 4.79526 18.7684 4 14.3321C4 8.89088 15.1567 0.495911 20.9111 0.495911C29.6603 -3.03026 39.906 13.3076 22.5916 16.1028Z",fill:"#4FBFE8"}),Tt.default.createElement("path",{d:"M22.5518 15.856L22.4863 15.8666L22.4347 15.9082C21.4334 16.7156 20.5213 17.566 19.6548 18.3822C19.5897 18.4435 19.5249 18.5046 19.4603 18.5655C18.663 19.3171 17.9036 20.0329 17.1378 20.6632C15.4886 22.0206 13.8431 22.9522 11.813 22.9575C7.73525 22.3784 5.03904 18.6732 4.25006 14.3102C4.25756 13.0333 4.91743 11.5494 6.03489 10.0223C7.15426 8.49265 8.71139 6.94887 10.4529 5.56953C12.1938 4.19062 14.1116 2.98186 15.9474 2.1189C17.788 1.25371 19.5255 0.745911 20.9111 0.745911H20.9596L21.0046 0.727787C23.1081 -0.119971 25.3091 0.221693 27.1771 1.27174C29.0479 2.32337 30.567 4.0771 31.291 6.01628C32.0133 7.95094 31.9406 10.0545 30.6606 11.8437C29.3761 13.639 26.8438 15.1631 22.5518 15.856Z",stroke:"#0A0A0A",strokeWidth:"0.5"})),Tt.default.createElement("defs",null,Tt.default.createElement("filter",{id:"filter0_d",x:"0",y:"0",width:"36",height:"31.2075",filterUnits:"userSpaceOnUse",colorInterpolationFilters:"sRGB"},Tt.default.createElement("feFlood",{floodOpacity:"0",result:"BackgroundImageFix"}),Tt.default.createElement("feColorMatrix",{in:"SourceAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),Tt.default.createElement("feOffset",{dy:"4"}),Tt.default.createElement("feGaussianBlur",{stdDeviation:"2"}),Tt.default.createElement("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),Tt.default.createElement("feBlend",{mode:"normal",in2:"BackgroundImageFix",result:"effect1_dropShadow"}),Tt.default.createElement("feBlend",{mode:"normal",in:"SourceGraphic",in2:"effect1_dropShadow",result:"shape"})),Tt.default.createElement("linearGradient",{id:"paint0_linear",x1:"24.6767",y1:"23.0067",x2:"-1.7759",y2:"-21.8983",gradientUnits:"userSpaceOnUse"},Tt.default.createElement("stop",{stopColor:"#D17485"}),Tt.default.createElement("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})))),h4=Ew;var Jr=T(_()),Aw=()=>Jr.default.createElement("svg",{width:"20",height:"14",viewBox:"0 0 20 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Jr.default.createElement("rect",{x:"0.5",y:"0.5",width:"6",height:"13",rx:"0.5",stroke:"#494650"}),Jr.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("rect",{x:"13.5",y:"0.5",width:"6",height:"13",rx:"0.5",stroke:"#494650"}),Jr.default.createElement("path",{d:"M18 3.5L15 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M10.3675 5.83334L11 7.00559L10.3934 8.15366",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Jr.default.createElement("path",{d:"M10.9103 7.01642H9",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),g4=Aw;var lh=T(_()),kw=()=>lh.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},lh.default.createElement("path",{d:"M3.13939 1.29046V8.80908M1.14394 3.28045H8.66878M4.7103 5.28418H5.6307L6.90303 5.26621V7.04481M5.26378 5.86944L4.65433 5.26621L5.2389 4.67542M7.5 6.89055L6.89055 7.5L6.30598 6.91543M1 1.09766H8.80469V8.90234H1V1.09766Z",stroke:"#494650",strokeWidth:"0.600361",strokeMiterlimit:"10",strokeLinecap:"round"})),y4=kw;var dh=T(_()),Nw=()=>dh.default.createElement("svg",{width:"33",height:"15",viewBox:"0 0 14 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dh.default.createElement("path",{d:"M2.83203 1.3125V7H2.08984V1.3125H2.83203ZM4.66016 1.3125V1.92969H0.265625V1.3125H4.66016ZM10.3039 7L13.5199 1.424H7.07988L10.3039 7Z",fill:"#494650"})),oc=Nw;var or=T(_()),Mw=()=>or.default.createElement("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},or.default.createElement("rect",{x:"0.5",y:"0.5",width:"11",height:"13",rx:"0.5",stroke:"#494650"}),or.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 3.5L2 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 7L2 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M5 10.5L2 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 3.5L7 3.49999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 7L7 6.99999",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),or.default.createElement("path",{d:"M10 10.5L7 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),S4=Mw;var Io=T(_()),Ow=()=>Io.default.createElement("svg",{width:"17",height:"16",viewBox:"0 0 17 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Io.default.createElement("rect",{x:"0.5",y:"15.5",width:"5",height:"9",rx:"0.5",transform:"rotate(-90 0.5 15.5)",stroke:"#494650"}),Io.default.createElement("path",{d:"M3.44 11.74L3.43999 14.26",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M6.94 11.74L6.93999 14.26",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("rect",{x:"16.5",y:"9.5",width:"5",height:"9",rx:"0.5",transform:"rotate(-180 16.5 9.5)",stroke:"#494650"}),Io.default.createElement("path",{d:"M12.74 6.56L15.26 6.56001",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M12.74 3.06L15.26 3.06001",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),Io.default.createElement("path",{d:"M8.02263 3.5L8.02263 3.25L8.02263 3.25L8.02263 3.5ZM9.17677 3.67678C9.27441 3.57914 9.27441 3.42085 9.17678 3.32322L7.58578 1.73223C7.48815 1.6346 7.32986 1.6346 7.23223 1.73223C7.1346 1.82986 7.1346 1.98815 7.23223 2.08579L8.64644 3.5L7.23223 4.91421C7.1346 5.01184 7.1346 5.17013 7.23223 5.26777C7.32986 5.3654 7.48815 5.3654 7.58578 5.26777L9.17677 3.67678ZM8.02263 3.75L9 3.75L9 3.25L8.02263 3.25L8.02263 3.75ZM3.24897 8.97731C2.99378 6.17025 5.20399 3.75 8.02263 3.75L8.02263 3.25C4.90997 3.25 2.46922 5.92271 2.75103 9.02258L3.24897 8.97731Z",fill:"#494650"})),C4=Ow;var An=T(_()),Fw=()=>An.default.createElement("svg",{width:"17",height:"14",viewBox:"0 0 17 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},An.default.createElement("rect",{x:"7.5",y:"0.499969",width:"9",height:"13",rx:"0.5",stroke:"#494650"}),An.default.createElement("path",{d:"M11.1667 3.49997L8.66667 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 6.99997L8.66667 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 10.5L8.66667 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 3.49997L8.66667 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 6.99997L8.66667 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M11.1667 10.5L8.66667 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 3.49997L12.8333 3.49996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 6.99997L12.8333 6.99996",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M15.3333 10.5L12.8333 10.5",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M3.82844 2.24857L5.59653 3.83479L4.01031 5.60288",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),An.default.createElement("path",{d:"M6 10C4 10 6 10 4.09629 9.94194C2.38551 9.70294 1.19356 8.12387 1.43256 6.41309C1.67156 4.70232 3.25063 3.51036 4.96141 3.74936",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),I4=Fw;var ic=T(_()),Lw=()=>ic.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ic.default.createElement("path",{d:"M1.32422 4.71448L4.08798 8.82064L8.19415 6.05688",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),ic.default.createElement("path",{d:"M10.6103 13.9999C14.2098 13.9999 17.1249 11.0848 17.1249 7.48529C17.1249 3.88582 14.2098 0.970703 10.6103 0.970703C7.01082 0.970703 4.0957 3.88582 4.0957 7.48529",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),ac=Lw;var sc=T(_()),Uw=()=>sc.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},sc.default.createElement("path",{d:"M17.1239 4.71448L14.3602 8.82064L10.254 6.05688",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),sc.default.createElement("path",{d:"M7.83881 13.9999C4.23933 13.9999 1.32422 11.0848 1.32422 7.48529C1.32422 3.88582 4.23933 0.970703 7.83881 0.970703C11.4383 0.970703 14.3534 3.88582 14.3534 7.48529",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),lc=Uw;var dc=T(_()),Bw=()=>dc.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},dc.default.createElement("path",{d:"M14.0287 10.0429C14.2915 10.1349 14.581 9.99671 14.6538 9.72797C14.9938 8.47296 14.9784 7.14441 14.6041 5.89227C14.1814 4.47868 13.323 3.23478 12.1512 2.33818C10.9795 1.44158 9.55445 0.938138 8.07954 0.89974C6.60464 0.861343 5.15531 1.28996 3.93852 2.12437C2.72173 2.95879 1.7997 4.15634 1.3041 5.54602C0.808504 6.9357 0.764674 8.44644 1.17887 9.86252C1.59307 11.2786 2.44412 12.5276 3.61049 13.4311C4.64364 14.2315 5.87741 14.7246 7.17065 14.8595C7.44758 14.8885 7.68076 14.6682 7.68967 14.3899V14.3899C7.69857 14.1116 7.47971 13.881 7.20315 13.8487C6.12249 13.7227 5.09307 13.3042 4.22798 12.634C3.22961 11.8606 2.50115 10.7916 2.14662 9.57945C1.79208 8.36735 1.8296 7.07422 2.25381 5.88471C2.67802 4.69521 3.46724 3.67015 4.50876 2.95593C5.55028 2.2417 6.79084 1.87483 8.0533 1.90769C9.31576 1.94056 10.5356 2.37149 11.5385 3.13894C12.5415 3.90639 13.2763 4.97112 13.638 6.18109C13.9515 7.22955 13.9709 8.3406 13.6991 9.39409C13.6296 9.66369 13.7659 9.95095 14.0287 10.0429V10.0429Z",fill:"#494650"}),dc.default.createElement("path",{d:"M11.0684 10.9853C10.8453 11.2084 10.4835 11.2084 10.2603 10.9853L8.23999 8.96498L6.21968 10.9853C5.99653 11.2084 5.63472 11.2084 5.41156 10.9853V10.9853C5.18841 10.7621 5.18841 10.4003 5.41156 10.1772L7.43187 8.15685L5.41156 6.13655C5.18841 5.91339 5.18841 5.55158 5.41156 5.32843V5.32843C5.63472 5.10527 5.99653 5.10527 6.21969 5.32843L8.23999 7.34873L10.2603 5.32843C10.4835 5.10527 10.8453 5.10527 11.0684 5.32843V5.32843C11.2916 5.55158 11.2916 5.91339 11.0684 6.13655L9.04811 8.15685L11.0684 10.1772C11.2916 10.4003 11.2916 10.7621 11.0684 10.9853V10.9853Z",fill:"#494650"})),uc=Bw;var xo=T(_()),Hw=()=>xo.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 12 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},xo.default.createElement("path",{d:"M3 2.29869V9.50504C3 9.7775 2.9 10 2.77755 10H1.22245C1.1 10 1 9.7775 1 9.50504V1.49495C1 1.2225 1.1 1 1.22245 1H2.77755C2.9 1 3 1.2225 3 1.49495V2.29869Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 1L6.89001 1C6.95055 1 7 1.1 7 1.22245V2.77755C7 2.9 6.95055 3 6.89001 3H5.10999C5.04944 3 5 2.9 5 2.77755V1.22245C5 1.1 5.04944 1 5.10999 1H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 4.5H6.89001C6.95055 4.5 7 4.6 7 4.72245V6.27755C7 6.4 6.95055 6.5 6.89001 6.5H5.10999C5.04944 6.5 5 6.4 5 6.27755V4.72245C5 4.6 5.04944 4.5 5.10999 4.5H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M5.2886 8H6.89001C6.95055 8 7 8.1 7 8.22245V9.77755C7 9.9 6.95055 10 6.89001 10H5.10999C5.04944 10 5 9.9 5 9.77755V8.22245C5 8.1 5.04944 8 5.10999 8H5.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 1L10.89 1C10.9506 1 11 1.1 11 1.22245V2.77755C11 2.9 10.9506 3 10.89 3H9.10999C9.04944 3 9 2.9 9 2.77755V1.22245C9 1.1 9.04944 1 9.10999 1H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 4.5H10.89C10.9506 4.5 11 4.6 11 4.72245V6.27755C11 6.4 10.9506 6.5 10.89 6.5H9.10999C9.04944 6.5 9 6.4 9 6.27755V4.72245C9 4.6 9.04944 4.5 9.10999 4.5H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"}),xo.default.createElement("path",{d:"M9.2886 8H10.89C10.9506 8 11 8.1 11 8.22245V9.77755C11 9.9 10.9506 10 10.89 10H9.10999C9.04944 10 9 9.9 9 9.77755V8.22245C9 8.1 9.04944 8 9.10999 8H9.2886Z",stroke:"#494650",strokeMiterlimit:"10",strokeLinecap:"round"})),x4=Hw;var cd=T(_()),Gw=()=>cd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 11 7",fill:"none",xmlns:"http://www.w3.org/2000/svg"},cd.default.createElement("path",{d:"M10.5 3.5C10.5 1.84315 9.15685 0.5 7.5 0.5H3.5C1.84315 0.5 0.5 1.84315 0.5 3.5V3.5C0.5 5.15685 1.84315 6.5 3.5 6.5H7.5C9.15685 6.5 10.5 5.15685 10.5 3.5V3.5Z",fill:"#494650",stroke:"#494650",strokeWidth:"0.600361",strokeMiterlimit:"10",strokeLinecap:"round"}),cd.default.createElement("circle",{cx:"3",cy:"3.5",r:"1",transform:"rotate(-90 3 3.5)",fill:"#C8ADFF"}),cd.default.createElement("circle",{cx:"8",cy:"3.5",r:"1",transform:"rotate(-90 8 3.5)",fill:"#C8ADFF"})),mc=Gw;function uh(e,t,n){switch(e){case"initialize":return he.default.createElement(h4,null);case"ai_transformation":return he.default.createElement(mc,null);case"add_column":return he.default.createElement(rc,null);case"delete_column":return he.default.createElement(Cs,null);case"rename_column":return he.default.createElement(oa,{height:t,width:n});case"reorder_column":return he.default.createElement(oa,{height:t,width:n});case"filter_column":return he.default.createElement(Ka,{purpleOrDark:"dark"});case"set_column_formula":return he.default.createElement("div",{className:"step-taskpane-missing-icon"},"Fx");case"dataframe_delete":return he.default.createElement(Cs,null);case"dataframe_duplicate":return he.default.createElement(oa,{height:t,width:n});case"dataframe_rename":return he.default.createElement(oa,{height:t,width:n});case"simple_import":return he.default.createElement(Ss,null);case"dataframe_import":return he.default.createElement(Ss,null);case"excel_import":return he.default.createElement(Ss,null);case"sort":return he.default.createElement(oa,{height:t,width:n});case"pivot":return he.default.createElement(nc,null);case"melt":return he.default.createElement(y4,null);case"merge":return he.default.createElement(p4,null);case"drop_duplicates":return he.default.createElement(g4,null);case"graph":return he.default.createElement(os,null);case"change_column_dtype":return he.default.createElement(oc,null);case"delete_row":return he.default.createElement(Cs,null);case"split_text_to_columns":return he.default.createElement(S4,null);case"transpose":return he.default.createElement(C4,null);case"promote_row_to_header":return he.default.createElement(I4,null);case"one_hot_encoding":return he.default.createElement(x4,null);case"undo":return he.default.createElement(ac,null);case"redo":return he.default.createElement(lc,null);case"clear":return he.default.createElement(uc,null);default:return he.default.createElement(oa,{height:t,width:n})}}function Vw(e){let t=()=>{e.isCurrIdx?e.mitoAPI.updateCheckoutStepByIndex(e.lastIndex):e.mitoAPI.updateCheckoutStepByIndex(e.stepData.step_idx)},n=()=>{e.mitoAPI.updateUndoToStepIndex(e.stepData.step_idx)};return he.default.createElement("div",{className:"step-taskpane-step-container",style:{opacity:e.beforeCurrIdx?"1":".5"},onContextMenu:r=>{r.preventDefault(),r.stopPropagation(),e.setDisplayDropdown(e.stepIdx)},onClick:t},he.default.createElement("div",{className:"step-taskpane-step-icon"},uh(e.stepData.step_type)),he.default.createElement("div",{className:"element-width-block hide-scrollbar"},he.default.createElement("div",{className:"text-header-3"},e.stepData.step_display_name),he.default.createElement("div",{className:"text-body-2 text-overflow-scroll hide-scrollbar"},e.stepData.step_description)),he.default.createElement(pe,{display:e.displayDropdown,closeDropdown:()=>{e.setDisplayDropdown(void 0)}},he.default.createElement(v,{title:"Undo all following steps",onClick:()=>n(),disabled:!e.isPro,subtext:e.isPro?void 0:"Bulk step undo requires Mito Pro or Enterprise"}),he.default.createElement(v,{title:"View analysis at this step",onClick:()=>t()})))}var w4=Vw;var jw=e=>e.endsWith("_edit"),Rw=e=>Object.values(Qu).includes(e),Ww=e=>{switch(e){case"initialize":return"Created a Mitosheet";case"add_column":return"Adding a column";case"delete_column":return"Deleting a column";case"rename_column":return"Renaming a column";case"reorder_column":return"Reording a column";case"fill_na":return"Filling NaN values";case"filter_column":return"Filtering a column";case"set_column_formula":return"Setting a formula";case"dataframe_delete":return"Deleting a dataframe";case"dataframe_duplicate":return"Duplicating a dataframe";case"dataframe_rename":return"Renaming a dataframe";case"simple_import":return"Importing a CSV";case"sort":return"Sorting a dataframe";case"pivot":return"Pivoting a dataframe";case"merge":return"Merging dataframes";case"concat":return"Concatenating dataframes";case"drop_duplicates":return"Dropping duplicates";case"change_column_dtype":return"Changing a dtype";case"set_cell_value":return"Setting a cell value";case"bulk_old_rename":return"Bulk old rename";case"excel_import":return"Importing Excel file";case"graph":return"Creating graph";case"graph_duplicate":return"Duplicating graph";case"graph_delete":return"Deleting graph";case"graph_rename":return"Renaming graph";case"delete_row":return"Deleting row";case"promote_row_to_header":return"Promoting row to header";case"split_text_to_columns":return"Spliting column";case"transpose":return"Transposing dataframe";case"melt":return"Melting dataframe";case"set_dataframe_format":return"Changing formatting";case"one_hot_encoding":return"One hot encoding";case"dataframe_import":return"Dataframe Import";case"snowflake_import":return"Snowflake Import";case"excel_range_import":return"Excel Range Import";case"export_to_file":return"Generating Export Code";case"reset_index":return"Resetting Index";case"ai_transformation":return"Transforming with AI";case"column_headers_transform":return"Transforming Headers";case"user_defined_import":return"Importing";case"undo":return"Undoing previous edit";case"redo":return"Redoing previous edit";case"clear":return"Clearing all edits";case"args_update":return"Updating user profile";case"code_options_update":return"Updating code options";case"save_analysis_update":return"Saving analysis";case"replay_analysis_update":return"Replaying analysis";case"checkout_step_by_idx_update":return"Checking out step";case"append_user_field_update":return"Updating user profile";case"set_user_field_update":return"Updating user profile";case"update_feedback_v2_obj_update":return"Updating user profile";case"go_pro":return"Activating Mito Pro";case"render_count_update":return"Updating user profile";case"checklist_update":return"Updating checklist";case"update_existing_import_update":return"Changing imports";case"undo_to_step_index_update":return"Undoing steps"}},Xw=e=>{if(jw(e))return e.substring(0,e.length-5);if(Rw(e))return e},T4=e=>{let t=[];return e.filter(([,n])=>{if(n!==void 0){if(t.includes(n))return!1;t.push(n)}return!0}).map(([n,,r])=>[Xw(r),n]).filter(([n])=>n!==void 0)},Jw=(e,t)=>{let n=e&&t===e[1]&&e[0]<=Date.now()-1e4,r=e&&t===e[1]&&e[0]<=Date.now()-20*1e3,o=e&&t===e[1]&&e[0]<=Date.now()-30*1e3,i=e&&t===e[1]&&e[0]<=Date.now()-40*1e3,a=e&&t===e[1]&&e[0]<=Date.now()-40*1e3;if(e&&t===e[1]&&e[0]<=Date.now()-60*1e3)return"Still executing pandas code";if(a)return"Doing the dataframe dance";if(i)return"Working hard behind the scenes";if(o)return"Still executing pandas code";if(r)return"Doing the dataframe dance";if(n)return"Still executing pandas code"},zw=e=>{let[t,n]=(0,_t.useState)(void 0);(0,_t.useEffect)(()=>{let o=setInterval(()=>{let i=T4(e.loading);i.length===0?n(void 0):n(a=>{let s=i[0][1];return a===void 0||s!==a[1]?[Date.now(),s]:a}),n(a=>a===void 0?a:[a[0],a[1]])},1e3);return()=>{clearInterval(o)}},[e.loading]);let r=T4(e.loading);return r.length===0?_t.default.createElement(_t.default.Fragment,null):_t.default.createElement(_t.default.Fragment,null,_t.default.createElement("p",{className:"loading-indicator-header text-header-3 text-color-white-important"},"Processing ",r.length," edit",r.length<=1?"":"s"),_t.default.createElement("div",{className:"loading-indicator-content"},r.map(([o,i],a)=>{let s=Jw(t,i);return o!==void 0&&_t.default.createElement("div",{key:a,className:M("mb-5px","mt-5px",{"text-color-medium-gray-important":a!==0})},_t.default.createElement("div",{key:a,className:M("loading-indicator-item")},_t.default.createElement("div",{className:"loading-indicator-icon",style:{opacity:a!==0?"50%":void 0}},uh(o,"15","15")),_t.default.createElement("div",{className:"ml-5px"},_t.default.createElement("div",{className:"text-body-1"},Ww(o)),s!==void 0&&_t.default.createElement("div",{className:"text-subtext-1"},s)),_t.default.createElement("div",{className:"loading-indicator-loader"},a===0&&_t.default.createElement(Nm,null),a!==0&&_t.default.createElement(f4,null))))})))},_4=zw;var Kw=e=>{let[t,n]=(0,wo.useState)(!1);return(0,wo.useEffect)(()=>{if(e.loading.length===0)n(!1);else if(e.loading.length>0){let r=setTimeout(()=>{n(!0)},500);return()=>{clearTimeout(r)}}},[e.loading.length]),wo.default.createElement(wo.default.Fragment,null,t&&wo.default.createElement("div",{className:"bottom-left-popup-container"},wo.default.createElement(_4,{loading:e.loading})))},D4=Kw;var hi=T(_());var v4=T(_());var $w=e=>{let t;switch(e.popupLocation){case"top_right":t="top-right-popup-container"}return v4.default.createElement("div",{className:M("popup-container",t,e.className)},e.children)},P4=$w;var Zw=e=>{let t=()=>{e.setUIState(n=>f(m({},n),{currOpenPopups:f(m({},n.currOpenPopups),{[e.popupLocation]:{type:"none"}})}))};return(0,hi.useEffect)(()=>{let n=setInterval(()=>{t()},6e3);return()=>{clearInterval(n)}},[e.message]),hi.default.createElement(P4,{popupLocation:e.popupLocation,className:"ephemeral-message-animation"},hi.default.createElement(I,{className:M("ephemeral-message-container"),align:"center",suppressTopBottomMargin:!0},hi.default.createElement("p",{className:M("text-body-1","text-color-white-important","mr-10px")},e.message),hi.default.createElement("div",{className:"mt-5px ml-5px",onClick:()=>t()},hi.default.createElement(at,{variant:"light"}))))},b4=Zw;var gi=T(_());function Yw(e){let[t,n]=(0,gi.useState)(void 0);return gi.default.createElement(Y,null,gi.default.createElement(Q,{header:"Step History",setUIState:e.setUIState}),gi.default.createElement(q,null,gi.default.createElement("div",{className:"step-takspane-container"},e.stepSummaryList.map(r=>gi.default.createElement(w4,{key:r.step_id,beforeCurrIdx:r.step_idx<=e.currStepIdx,isCurrIdx:r.step_idx===e.currStepIdx,lastIndex:e.stepSummaryList[e.stepSummaryList.length-1].step_idx,stepData:r,mitoAPI:e.mitoAPI,stepIdx:r.step_idx,isPro:e.userProfile.isPro,displayDropdown:t===r.step_idx,setDisplayDropdown:()=>{n(o=>{if(o!==r.step_idx)return r.step_idx})}})))))}var E4=Yw;var ae=T(_());var A4=T(_()),k4=(e="",t="")=>{let[n,r]=(0,A4.useState)(e);return{value:n,placeholder:t,onChange:i=>{let a=i.target.value;r(a)}}};var mh=T(_()),qw=()=>mh.default.createElement("svg",{width:"18",height:"15",viewBox:"0 0 18 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},mh.default.createElement("path",{d:"M2 8.88525L6.15622 12.4914C6.57338 12.8534 7.20496 12.8086 7.5669 12.3914L16.3562 2.26144",stroke:"#9D6CFF",strokeWidth:"4"})),N4=qw;var kn=e=>ae.default.createElement(I,null,ae.default.createElement(C,{span:2},ae.default.createElement(N4,null)),ae.default.createElement("p",{className:"text-body-1"},e.text)),Qw=e=>{let[t,n]=(0,ae.useState)(!1),r=k4("","mito-pro-access-code-ASKDJQWDKQWDLL"),[o,i]=(0,ae.useState)(!1),a=e.userProfile.isPro;return(0,ae.useEffect)(()=>{e.mitoAPI.log("opened_upgrade_to_pro_taskpane")},[]),!a&&!t?ae.default.createElement(Y,null,ae.default.createElement(Q,{header:"Upgrade to Mito Pro",setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement("p",{className:"text-body-1 mb-10px"},ae.default.createElement("a",{href:"https://trymito.io/plans",target:"_blank",rel:"noreferrer"},ae.default.createElement("span",{className:"text-body-1-link"},"Mito Pro"))," gives you extra features to super charge your analysis:"),ae.default.createElement(kn,{text:"Turn off all telemetry"}),ae.default.createElement(kn,{text:"Generated code optimization"}),ae.default.createElement(kn,{text:"Import from external drives"}),ae.default.createElement(kn,{text:"Format datframes"}),ae.default.createElement(kn,{text:"Style graphs"}),ae.default.createElement(kn,{text:"Priority support"}),ae.default.createElement(kn,{text:"All future pro functionality!"}),ae.default.createElement("div",{className:"mt-25px"},ae.default.createElement(I,{justify:"space-around"},ae.default.createElement("form",{className:"element-width-block",action:"https://jl76z192i0.execute-api.us-east-1.amazonaws.com/Prod/create_checkout_session/",method:"POST",target:"_blank"},ae.default.createElement("button",{className:M("text-button","text-header-3","text-overflow-wrap","element-width-block","text-button-variant-dark"),type:"submit",onClick:()=>{e.mitoAPI.log("clicked_purchase_mito_pro"),setTimeout(()=>n(!0),100)}},"Purchase Mito Pro"))),ae.default.createElement(I,{justify:"space-around",className:"mb-5px mt-5px"},ae.default.createElement("p",{className:"text-body-1"},"Or")),ae.default.createElement(I,{justify:"space-around"},ae.default.createElement(j,{variant:"dark",onClick:()=>{n(!0)}},"Enter Access Code"))))):!a&&t?ae.default.createElement(Y,null,ae.default.createElement(Q,{header:"Enter Access Code",setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement(I,{align:"center"},ae.default.createElement(C,{span:5},ae.default.createElement("p",{className:"text-heading-2"},"Access Code:")),ae.default.createElement(C,{span:2},ae.default.createElement(Hu,{title:"Get an access code by purchasing a Pro license on the previous page."}))),ae.default.createElement(ne,m({},r)),o&&ae.default.createElement("div",{className:"text-color-error"},"Sorry, that access code is invalid. Purchase Mito Pro from the previous page and then enter the access code here."),ae.default.createElement(se,{px:20}),ae.default.createElement(I,{justify:"space-around"},ae.default.createElement(C,null,ae.default.createElement(j,{variant:"light",onClick:()=>{n(!1)}},"Back")),ae.default.createElement(C,null,ae.default.createElement(j,{variant:"dark",onClick:async()=>{if(!Am(r.value)){i(!0);return}i(!1),await e.mitoAPI.log("signup_completed_pro",{location:"upgrade_to_pro_taskpane"}),await e.mitoAPI.updateGoPro(),n(!1)}},"Submit Access Code"))))):ae.default.createElement(Y,null,ae.default.createElement(Q,{header:`Welcome to Mito ${e.proOrEnterprise}!`,setUIState:e.setUIState}),ae.default.createElement(q,null,ae.default.createElement("p",{className:"text-heading-4 mb-10px"},e.proOrEnterprise==="Pro"?"You've successfully upgraded to Mito Pro. You can cancel any time by sending us an email.":"Mito Enterprise is the fastest way to automate any Python analysis."),ae.default.createElement(kn,{text:"All telemetry is off"}),ae.default.createElement(kn,{text:"Generated code is being optimized"}),ae.default.createElement(kn,{text:"Style graphs"}),ae.default.createElement(kn,{text:"Format dataframes"}),ae.default.createElement(kn,{text:"Export formatting"}),ae.default.createElement(kn,{text:"Get priority support"}),ae.default.createElement(kn,{text:`All future ${e.proOrEnterprise} functionality!`})))},M4=Qw;var re=T(_());var O4=T(_());var eT=e=>{let t=e.uiState.currOpenTaskpane.type==="UpdateImports"&&e.uiState.currOpenTaskpane.failedReplayData!==void 0,n="Upgrade to Mito Pro",r="Pro";return e.userProfile.isPro&&(n="Mito Pro"),e.userProfile.isEnterprise&&(n="Mito Enterprise",r="Enterprise"),O4.default.createElement("div",{className:M("text-button","text-button-variant-dark","mito-plan-button","cursor-pointer"),onClick:()=>{t||(e.userProfile.isPro||e.mitoAPI.log("clicked_plan_button"),e.setUIState(o=>f(m({},o),{currOpenTaskpane:{type:"upgrade_to_pro",proOrEnterprise:r},selectedTabType:"data"})))}},n)},F4=eT;var Is=T(_());var Ct=T(_());var fd=T(_()),tT=()=>fd.default.createElement("svg",{width:"13",height:"14",viewBox:"0 0 13 14",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fd.default.createElement("path",{d:"M9.58016 3.81644L6.50004 0.734863L3.41992 3.81644",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),fd.default.createElement("path",{d:"M12 9.10571L11.9883 11.3851C11.9839 12.3571 11.1934 13.1447 10.2213 13.1447H2.76697C1.79052 13.1432 1 12.3513 1 11.3748L1.00146 9.10571",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),fd.default.createElement("path",{d:"M6.5 9.56679V1.73181",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),L4=tT;var Ir=T(_()),U4=()=>Ir.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ir.default.createElement("path",{d:"M6.05571 9.08911L1 14.1448",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M14.001 1.14478L8.94531 6.20048",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M1 9.08911V14.1448H6.05571",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M14.001 6.20048V1.14478H8.94531",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),B4=()=>Ir.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},Ir.default.createElement("path",{d:"M6.05555 8.94434L1 13.9999",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M8.94445 6.05566L14 1.00011",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M6.05469 13.9998V8.9442H0.999135",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),Ir.default.createElement("path",{d:"M8.94445 1.00011V6.05566H14",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}));var pd=T(_()),nT=()=>pd.default.createElement("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},pd.default.createElement("path",{d:"M12.6916 13.5156H2.30835C1.58458 13.5156 1 12.9881 1 12.335V12.0963C1 11.4432 1.58458 10.9156 2.30835 10.9156H12.6916C13.4154 10.9156 14 11.4432 14 12.0963V12.335C14 12.9881 13.4154 13.5156 12.6916 13.5156Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pd.default.createElement("path",{d:"M12.6916 8.31558H2.30835C1.58458 8.31558 1 7.79058 1 7.14058V6.89058C1 6.24058 1.58458 5.71558 2.30835 5.71558H12.6916C13.4154 5.71558 14 6.24058 14 6.89058V7.12808C14 7.79058 13.4154 8.31558 12.6916 8.31558Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"}),pd.default.createElement("path",{d:"M12.6916 3.11563H2.30835C1.58458 3.11563 1 2.58809 1 1.93495V1.6963C1 1.04316 1.58458 0.515625 2.30835 0.515625H12.6916C13.4154 0.515625 14 1.04316 14 1.6963V1.93495C14 2.58809 13.4154 3.11563 12.6916 3.11563Z",stroke:"#343434",strokeMiterlimit:"10",strokeLinecap:"round"})),H4=nT;var ch=T(_()),rT=()=>ch.default.createElement("svg",{width:"33",height:"15",viewBox:"0 0 33 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ch.default.createElement("path",{d:"M3.73236 9.3125H2.64252V2.08789L0.45697 2.89062V1.90625L3.56244 0.740234H3.73236V9.3125ZM12.498 9.3125H6.90814V8.5332L9.86127 5.25195C10.2988 4.75586 10.5995 4.35352 10.7636 4.04492C10.9316 3.73242 11.0156 3.41016 11.0156 3.07812C11.0156 2.63281 10.8808 2.26758 10.6113 1.98242C10.3417 1.69727 9.98236 1.55469 9.53314 1.55469C8.99408 1.55469 8.57416 1.70898 8.27338 2.01758C7.9765 2.32227 7.82806 2.74805 7.82806 3.29492H6.74408C6.74408 2.50977 6.99603 1.875 7.49994 1.39062C8.00775 0.90625 8.68549 0.664062 9.53314 0.664062C10.3261 0.664062 10.9531 0.873047 11.414 1.29102C11.8749 1.70508 12.1054 2.25781 12.1054 2.94922C12.1054 3.78906 11.5703 4.78906 10.4999 5.94922L8.21478 8.42773H12.498V9.3125ZM15.2226 4.51953H16.037C16.5488 4.51172 16.9511 4.37695 17.2441 4.11523C17.537 3.85352 17.6835 3.5 17.6835 3.05469C17.6835 2.05469 17.1855 1.55469 16.1894 1.55469C15.7206 1.55469 15.3456 1.68945 15.0644 1.95898C14.787 2.22461 14.6484 2.57813 14.6484 3.01953H13.5644C13.5644 2.34375 13.8105 1.7832 14.3027 1.33789C14.7988 0.888672 15.4277 0.664062 16.1894 0.664062C16.9941 0.664062 17.6249 0.876953 18.082 1.30273C18.539 1.72852 18.7675 2.32031 18.7675 3.07812C18.7675 3.44922 18.6464 3.80859 18.4042 4.15625C18.166 4.50391 17.8398 4.76367 17.4257 4.93555C17.8945 5.08398 18.2558 5.33008 18.5097 5.67383C18.7675 6.01758 18.8964 6.4375 18.8964 6.93359C18.8964 7.69922 18.6464 8.30664 18.1464 8.75586C17.6464 9.20508 16.996 9.42969 16.1953 9.42969C15.3945 9.42969 14.7421 9.21289 14.2382 8.7793C13.7382 8.3457 13.4882 7.77344 13.4882 7.0625H14.5781C14.5781 7.51172 14.7245 7.87109 15.0175 8.14062C15.3105 8.41016 15.7031 8.54492 16.1953 8.54492C16.7187 8.54492 17.1191 8.4082 17.3964 8.13477C17.6738 7.86133 17.8124 7.46875 17.8124 6.95703C17.8124 6.46094 17.6601 6.08008 17.3554 5.81445C17.0507 5.54883 16.6113 5.41211 16.037 5.4043H15.2226V4.51953ZM28.1003 9.3125L23.2643 0.9485H32.9243L28.1003 9.3125Z",fill:"#494650"})),G4=rT;var fh=T(_()),oT=()=>fh.default.createElement("svg",{width:"22",height:"15",viewBox:"0 0 13 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},fh.default.createElement("path",{d:"M1.50781 6.61719C1.50781 6.49479 1.54557 6.39193 1.62109 6.30859C1.69922 6.22266 1.8112 6.17969 1.95703 6.17969C2.10286 6.17969 2.21354 6.22266 2.28906 6.30859C2.36719 6.39193 2.40625 6.49479 2.40625 6.61719C2.40625 6.73698 2.36719 6.83854 2.28906 6.92188C2.21354 7.00521 2.10286 7.04688 1.95703 7.04688C1.8112 7.04688 1.69922 7.00521 1.62109 6.92188C1.54557 6.83854 1.50781 6.73698 1.50781 6.61719ZM7.09766 3.70312V4.57031C7.09766 5.03646 7.05599 5.42969 6.97266 5.75C6.88932 6.07031 6.76953 6.32812 6.61328 6.52344C6.45703 6.71875 6.26823 6.86068 6.04688 6.94922C5.82812 7.03516 5.58073 7.07812 5.30469 7.07812C5.08594 7.07812 4.88411 7.05078 4.69922 6.99609C4.51432 6.94141 4.34766 6.85417 4.19922 6.73438C4.05339 6.61198 3.92839 6.45312 3.82422 6.25781C3.72005 6.0625 3.64062 5.82552 3.58594 5.54688C3.53125 5.26823 3.50391 4.94271 3.50391 4.57031V3.70312C3.50391 3.23698 3.54557 2.84635 3.62891 2.53125C3.71484 2.21615 3.83594 1.96354 3.99219 1.77344C4.14844 1.58073 4.33594 1.44271 4.55469 1.35938C4.77604 1.27604 5.02344 1.23438 5.29688 1.23438C5.51823 1.23438 5.72135 1.26172 5.90625 1.31641C6.09375 1.36849 6.26042 1.45312 6.40625 1.57031C6.55208 1.6849 6.67578 1.83854 6.77734 2.03125C6.88151 2.22135 6.96094 2.45443 7.01562 2.73047C7.07031 3.00651 7.09766 3.33073 7.09766 3.70312ZM6.37109 4.6875V3.58203C6.37109 3.32682 6.35547 3.10286 6.32422 2.91016C6.29557 2.71484 6.2526 2.54818 6.19531 2.41016C6.13802 2.27214 6.0651 2.16016 5.97656 2.07422C5.89062 1.98828 5.79036 1.92578 5.67578 1.88672C5.5638 1.84505 5.4375 1.82422 5.29688 1.82422C5.125 1.82422 4.97266 1.85677 4.83984 1.92188C4.70703 1.98438 4.59505 2.08464 4.50391 2.22266C4.41536 2.36068 4.34766 2.54167 4.30078 2.76562C4.25391 2.98958 4.23047 3.26172 4.23047 3.58203V4.6875C4.23047 4.94271 4.24479 5.16797 4.27344 5.36328C4.30469 5.55859 4.35026 5.72786 4.41016 5.87109C4.47005 6.01172 4.54297 6.1276 4.62891 6.21875C4.71484 6.3099 4.8138 6.3776 4.92578 6.42188C5.04036 6.46354 5.16667 6.48438 5.30469 6.48438C5.48177 6.48438 5.63672 6.45052 5.76953 6.38281C5.90234 6.3151 6.01302 6.20964 6.10156 6.06641C6.19271 5.92057 6.26042 5.73438 6.30469 5.50781C6.34896 5.27865 6.37109 5.00521 6.37109 4.6875ZM11.5977 3.70312V4.57031C11.5977 5.03646 11.556 5.42969 11.4727 5.75C11.3893 6.07031 11.2695 6.32812 11.1133 6.52344C10.957 6.71875 10.7682 6.86068 10.5469 6.94922C10.3281 7.03516 10.0807 7.07812 9.80469 7.07812C9.58594 7.07812 9.38411 7.05078 9.19922 6.99609C9.01432 6.94141 8.84766 6.85417 8.69922 6.73438C8.55339 6.61198 8.42839 6.45312 8.32422 6.25781C8.22005 6.0625 8.14062 5.82552 8.08594 5.54688C8.03125 5.26823 8.00391 4.94271 8.00391 4.57031V3.70312C8.00391 3.23698 8.04557 2.84635 8.12891 2.53125C8.21484 2.21615 8.33594 1.96354 8.49219 1.77344C8.64844 1.58073 8.83594 1.44271 9.05469 1.35938C9.27604 1.27604 9.52344 1.23438 9.79688 1.23438C10.0182 1.23438 10.2214 1.26172 10.4062 1.31641C10.5938 1.36849 10.7604 1.45312 10.9062 1.57031C11.0521 1.6849 11.1758 1.83854 11.2773 2.03125C11.3815 2.22135 11.4609 2.45443 11.5156 2.73047C11.5703 3.00651 11.5977 3.33073 11.5977 3.70312ZM10.8711 4.6875V3.58203C10.8711 3.32682 10.8555 3.10286 10.8242 2.91016C10.7956 2.71484 10.7526 2.54818 10.6953 2.41016C10.638 2.27214 10.5651 2.16016 10.4766 2.07422C10.3906 1.98828 10.2904 1.92578 10.1758 1.88672C10.0638 1.84505 9.9375 1.82422 9.79688 1.82422C9.625 1.82422 9.47266 1.85677 9.33984 1.92188C9.20703 1.98438 9.09505 2.08464 9.00391 2.22266C8.91536 2.36068 8.84766 2.54167 8.80078 2.76562C8.75391 2.98958 8.73047 3.26172 8.73047 3.58203V4.6875C8.73047 4.94271 8.74479 5.16797 8.77344 5.36328C8.80469 5.55859 8.85026 5.72786 8.91016 5.87109C8.97005 6.01172 9.04297 6.1276 9.12891 6.21875C9.21484 6.3099 9.3138 6.3776 9.42578 6.42188C9.54036 6.46354 9.66667 6.48438 9.80469 6.48438C9.98177 6.48438 10.1367 6.45052 10.2695 6.38281C10.4023 6.3151 10.513 6.20964 10.6016 6.06641C10.6927 5.92057 10.7604 5.73438 10.8047 5.50781C10.849 5.27865 10.8711 5.00521 10.8711 4.6875Z",fill:"#494650"})),V4=oT;var ph=T(_()),iT=()=>ph.default.createElement("svg",{width:"22",height:"15",viewBox:"0 0 7 9",fill:"none",xmlns:"http://www.w3.org/2000/svg"},ph.default.createElement("path",{d:"M0.757812 6.61719C0.757812 6.49479 0.795573 6.39193 0.871094 6.30859C0.949219 6.22266 1.0612 6.17969 1.20703 6.17969C1.35286 6.17969 1.46354 6.22266 1.53906 6.30859C1.61719 6.39193 1.65625 6.49479 1.65625 6.61719C1.65625 6.73698 1.61719 6.83854 1.53906 6.92188C1.46354 7.00521 1.35286 7.04688 1.20703 7.04688C1.0612 7.04688 0.949219 7.00521 0.871094 6.92188C0.795573 6.83854 0.757812 6.73698 0.757812 6.61719ZM6.34766 3.70312V4.57031C6.34766 5.03646 6.30599 5.42969 6.22266 5.75C6.13932 6.07031 6.01953 6.32812 5.86328 6.52344C5.70703 6.71875 5.51823 6.86068 5.29688 6.94922C5.07812 7.03516 4.83073 7.07812 4.55469 7.07812C4.33594 7.07812 4.13411 7.05078 3.94922 6.99609C3.76432 6.94141 3.59766 6.85417 3.44922 6.73438C3.30339 6.61198 3.17839 6.45312 3.07422 6.25781C2.97005 6.0625 2.89062 5.82552 2.83594 5.54688C2.78125 5.26823 2.75391 4.94271 2.75391 4.57031V3.70312C2.75391 3.23698 2.79557 2.84635 2.87891 2.53125C2.96484 2.21615 3.08594 1.96354 3.24219 1.77344C3.39844 1.58073 3.58594 1.44271 3.80469 1.35938C4.02604 1.27604 4.27344 1.23438 4.54688 1.23438C4.76823 1.23438 4.97135 1.26172 5.15625 1.31641C5.34375 1.36849 5.51042 1.45312 5.65625 1.57031C5.80208 1.6849 5.92578 1.83854 6.02734 2.03125C6.13151 2.22135 6.21094 2.45443 6.26562 2.73047C6.32031 3.00651 6.34766 3.33073 6.34766 3.70312ZM5.62109 4.6875V3.58203C5.62109 3.32682 5.60547 3.10286 5.57422 2.91016C5.54557 2.71484 5.5026 2.54818 5.44531 2.41016C5.38802 2.27214 5.3151 2.16016 5.22656 2.07422C5.14062 1.98828 5.04036 1.92578 4.92578 1.88672C4.8138 1.84505 4.6875 1.82422 4.54688 1.82422C4.375 1.82422 4.22266 1.85677 4.08984 1.92188C3.95703 1.98438 3.84505 2.08464 3.75391 2.22266C3.66536 2.36068 3.59766 2.54167 3.55078 2.76562C3.50391 2.98958 3.48047 3.26172 3.48047 3.58203V4.6875C3.48047 4.94271 3.49479 5.16797 3.52344 5.36328C3.55469 5.55859 3.60026 5.72786 3.66016 5.87109C3.72005 6.01172 3.79297 6.1276 3.87891 6.21875C3.96484 6.3099 4.0638 6.3776 4.17578 6.42188C4.29036 6.46354 4.41667 6.48438 4.55469 6.48438C4.73177 6.48438 4.88672 6.45052 5.01953 6.38281C5.15234 6.3151 5.26302 6.20964 5.35156 6.06641C5.44271 5.92057 5.51042 5.73438 5.55469 5.50781C5.59896 5.27865 5.62109 5.00521 5.62109 4.6875Z",fill:"#494650"})),j4=iT;var R4=e=>{switch(e){case"UNDO":return Ct.default.createElement(ac,null);case"REDO":return Ct.default.createElement(lc,null);case"CLEAR":return Ct.default.createElement(uc,null);case"IMPORT":return Ct.default.createElement(Ss,null);case"EXPORT":return Ct.default.createElement(L4,null);case"ADD COL":return Ct.default.createElement(rc,null);case"DEL COL":return Ct.default.createElement(Cs,null);case"DTYPE":return Ct.default.createElement(oc,null);case"LESS":return Ct.default.createElement(j4,null);case"MORE":return Ct.default.createElement(V4,null);case"FORMAT":return Ct.default.createElement(G4,null);case"PIVOT":return Ct.default.createElement(nc,null);case"GRAPH":return Ct.default.createElement(os,null);case"AI_TRANSFORMATION":return Ct.default.createElement(mc,null);case"CODE_SNIPPETS":return Ct.default.createElement(Fm,null);case"CATCH UP":return Ct.default.createElement(Kl,null);case"STEPS":return Ct.default.createElement(H4,null);case"OPEN FULLSCREEN":return Ct.default.createElement(U4,null);case"CLOSE FULLSCREEN":return Ct.default.createElement(B4,null)}},oe=(e,t,n)=>Ct.default.createElement(v,{key:e.longTitle,title:e.longTitle,onClick:e.actionFunction,disabled:e.isDisabled()!==void 0,tooltip:e.isDisabled(),rightText:aT(e,t),supressFocusSettingOnClose:n}),aT=(e,t)=>{var n,r;return e.requiredPlan==="pro"&&!t.isPro?"Mito Pro":e.requiredPlan==="enterprise"&&!t.isEnterprise?"Mito Enterprise":window.navigator.userAgent.toUpperCase().includes("MAC")?(n=e.displayKeyboardShortcuts)==null?void 0:n.mac:(r=e.displayKeyboardShortcuts)==null?void 0:r.windows};var sT=e=>{let t=e.disabledTooltip!==void 0,n=e.highlightToolbarButton===!0?"mito-toolbar-button-draw-attention":"";return Is.default.createElement("div",{className:M("mito-toolbar-button-container",t?"mito-toolbar-button-container-disabled":"mito-toolbar-button-container-enabled"),id:e.id,onClick:()=>{t||(e.setEditorState&&e.setEditorState(void 0),e.action.actionFunction())}},Is.default.createElement("button",{className:M("mito-toolbar-button","vertical-align-content",n),type:"button"},Is.default.createElement("span",{title:e.disabledTooltip||e.action.tooltip},Is.default.createElement("div",{className:"mito-toolbar-button-icon-container"},R4(e.toolbarButtonType)),Is.default.createElement("p",{className:"mito-toolbar-button-label"},e.action.shortTitle))),e.children!==void 0&&e.children)},Mt=sT;var To=T(_());var lT=e=>To.default.createElement(To.default.Fragment,null,To.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Columns",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Columns"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["add column"],e.userProfile),oe(e.actions["rename column"],e.userProfile,!0),oe(e.actions["delete column"],e.userProfile),oe(e.actions["Column_Headers_Transform"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["set column formula"],e.userProfile,!0),oe(e.actions["set cell value"],e.userProfile,!0),oe(e.actions["split text to column"],e.userProfile),e.userProfile.isPro?oe(e.actions["one_hot_encoding"],e.userProfile):To.default.createElement(To.default.Fragment,null),oe(e.actions["format number columns"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["filter"],e.userProfile),oe(e.actions["sort"],e.userProfile),oe(e.actions["change dtype"],e.userProfile),oe(e.actions["fill na"],e.userProfile),To.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["unique values"],e.userProfile),oe(e.actions["column summary"],e.userProfile))),W4=lT;var _o=T(_());var dT=e=>_o.default.createElement(_o.default.Fragment,null,_o.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Dataframes",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Dataframes"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["import files"],e.userProfile),oe(e.actions["Dataframe_Import"],e.userProfile),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT?oe(e.actions["SnowflakeImport"],e.userProfile):_o.default.createElement(_o.default.Fragment,null),oe(e.actions["UserDefinedImport"],e.userProfile),oe(e.actions["updateImports"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["export"],e.userProfile),oe(e.actions["Export_To_File"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["pivot"],e.userProfile),oe(e.actions["melt"],e.userProfile),oe(e.actions["drop duplicates"],e.userProfile),oe(e.actions["merge"],e.userProfile),oe(e.actions["concat_dataframes"],e.userProfile),oe(e.actions["transpose"],e.userProfile),_o.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["duplicate dataframe"],e.userProfile),oe(e.actions["rename dataframe"],e.userProfile,!0),oe(e.actions["delete dataframe"],e.userProfile))),X4=dT;var hh=T(_());var uT=e=>{let t=e.uiState.currOpenToolbarDropdown===e.type;return hh.default.createElement("div",null,hh.default.createElement("p",{className:M("mito-toolbar-dropdown-selector","text-unselectable",{"mito-toolbar-dropdown-selector-selected":t}),onClick:()=>{e.setUIState(n=>f(m({},n),{currOpenToolbarDropdown:e.type}))},onMouseEnter:()=>{e.setUIState(n=>n.currOpenToolbarDropdown!==void 0&&!t?f(m({},n),{currOpenToolbarDropdown:e.type}):n)}},e.type),e.children)},zr=uT;var hd=T(_());var mT=e=>hd.default.createElement(hd.default.Fragment,null,hd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Edit",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Edit"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["undo"],e.userProfile),oe(e.actions["redo"],e.userProfile),oe(e.actions["clear"],e.userProfile),hd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["copy"],e.userProfile))),J4=mT;var gd=T(_());var cT=e=>gd.default.createElement(gd.default.Fragment,null,gd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Format",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Format"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["set_dataframe_format"],e.userProfile),oe(e.actions["ConditionalFormatting"],e.userProfile),gd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["format number columns"],e.userProfile),oe(e.actions["precision decrease"],e.userProfile),oe(e.actions["precision increase"],e.userProfile))),z4=cT;var yd=T(_());var fT=e=>yd.default.createElement(yd.default.Fragment,null,yd.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Graphs",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Graphs"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["graph"],e.userProfile),yd.default.createElement(ve,{isDropdownSectionSeperator:!0}),oe(e.actions["duplicate graph"],e.userProfile),oe(e.actions["rename graph"],e.userProfile),oe(e.actions["delete graph"],e.userProfile))),K4=fT;var yi=T(_());var pT=e=>{let t=c5(e.actions);return yi.default.createElement(yi.default.Fragment,null,yi.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Help",searchable:!0,closeDropdown:()=>e.setUIState(n=>n.currOpenToolbarDropdown==="Help"?f(m({},n),{currOpenToolbarDropdown:void 0}):n),width:"large"},t.map(n=>n.type=="AI_Transformation"&&!e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION?yi.default.createElement(yi.default.Fragment,null):n.type=="SnowflakeImport"&&!e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT?yi.default.createElement(yi.default.Fragment,null):oe(n,e.userProfile))))},$4=pT;var cc=T(_());var hT=e=>cc.default.createElement(cc.default.Fragment,null,cc.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Rows",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Rows"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"large"},oe(e.actions["delete row"],e.userProfile),oe(e.actions["promote row to header"],e.userProfile))),Z4=hT;var fc=T(_());var gT=e=>fc.default.createElement(fc.default.Fragment,null,fc.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="View",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="View"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["fullscreen"],e.userProfile))),Y4=gT;var xs=T(_());var yT=e=>xs.default.createElement(xs.default.Fragment,null,xs.default.createElement(pe,{display:e.uiState.currOpenToolbarDropdown==="Code",closeDropdown:()=>e.setUIState(t=>t.currOpenToolbarDropdown==="Code"?f(m({},t),{currOpenToolbarDropdown:void 0}):t),width:"medium"},oe(e.actions["CodeOptions"],e.userProfile),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION?oe(e.actions["AI_Transformation"],e.userProfile):xs.default.createElement(xs.default.Fragment,null),oe(e.actions["CodeSnippets"],e.userProfile))),q4=yT;var ST=e=>{var n;let t=[re.default.createElement(v,{title:"Import Files",key:"Import Files",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"import files"}}))}}),re.default.createElement(v,{title:"Import Dataframes",key:"Import Dataframes",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"DataframeImport"}}))}})];return e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_SNOWFLAKE_IMPORT&&t.push(re.default.createElement(v,{title:"Import from Snowflake",key:"Import from Snowflake",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"SnowflakeImport"}}))}})),t.push(re.default.createElement(v,{title:"Custom Imports",key:"Custom Imports",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"UserDefinedImport"}}))}})),re.default.createElement("div",{className:"mito-toolbar-container"},re.default.createElement("div",{className:"mito-toolbar-top"},re.default.createElement("div",{className:"mito-toolbar-top-left"},re.default.createElement(zr,{type:"Edit",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(J4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Dataframes",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(X4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Columns",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(W4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Rows",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(Z4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Graphs",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(K4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Format",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(z4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Code",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(q4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"View",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement(Y4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile})),re.default.createElement(zr,{type:"Help",uiState:e.uiState,setUIState:e.setUIState},re.default.createElement($4,{actions:e.actions,uiState:e.uiState,setUIState:e.setUIState,userProfile:e.userProfile}))),re.default.createElement("div",{className:"mito-toolbar-top-right"},re.default.createElement(ai,{userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI,width:"small",className:"mito-plan-button"}),re.default.createElement(F4,{uiState:e.uiState,userProfile:e.userProfile,setUIState:e.setUIState,mitoAPI:e.mitoAPI}))),re.default.createElement("div",{className:"mito-toolbar-top-bottom-seperator"}),re.default.createElement("div",{className:"mito-toolbar-bottom"},re.default.createElement("div",{className:"mito-toolbar-bottom-left-half"},re.default.createElement(Mt,{id:"mito-undo-button",toolbarButtonType:"UNDO",action:e.actions["undo"],disabledTooltip:e.actions["undo"].isDisabled()}),re.default.createElement(Mt,{id:"mito-redo-button",toolbarButtonType:"REDO",action:e.actions["redo"],disabledTooltip:e.actions["redo"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"CLEAR",action:e.actions["clear"],disabledTooltip:e.actions["clear"].isDisabled()}),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"IMPORT",action:e.actions["import dropdown"],setEditorState:e.setEditorState,disabledTooltip:e.actions["import dropdown"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="import",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="import"?r:f(m({},r),{toolbarDropdown:void 0})),width:"medium"},t)),re.default.createElement(Mt,{toolbarButtonType:"EXPORT",action:e.actions["export dropdown"],setEditorState:e.setEditorState,disabledTooltip:e.actions["export dropdown"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="export",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="export"?r:f(m({},r),{toolbarDropdown:void 0})),width:"large"},re.default.createElement(v,{title:"Download File Now",subtext:"Download the file to your downloads folder.",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"download"}}))}}),re.default.createElement(v,{title:"Download File when Executing Code",subtext:"Download the file to the same folder as this notebook when you run the generated code.",onClick:()=>{e.setUIState(r=>f(m({},r),{currOpenTaskpane:{type:"Export To File"}}))}}))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"ADD COL",action:e.actions["add column"],highlightToolbarButton:e.highlightAddColButton,setEditorState:e.setEditorState,disabledTooltip:e.actions["add column"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"DEL COL",action:e.actions["delete column"],setEditorState:e.setEditorState,disabledTooltip:e.actions["delete column"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"DTYPE",action:e.actions["change dtype"],setEditorState:e.setEditorState,disabledTooltip:e.actions["change dtype"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="dtype",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="dtype"?r:f(m({},r),{toolbarDropdown:void 0})),width:"medium"},I1(r=>{let o=xm(e.gridState.selections,e.sheetData);e.mitoAPI.editChangeColumnDtype(e.sheetIndex,o,r,me())}))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"LESS",action:e.actions["precision decrease"],setEditorState:e.setEditorState,disabledTooltip:e.actions["precision decrease"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"MORE",action:e.actions["precision increase"],setEditorState:e.setEditorState,disabledTooltip:e.actions["precision increase"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"FORMAT",action:e.actions["format number columns"],setEditorState:e.setEditorState,disabledTooltip:e.actions["format number columns"].isDisabled()},re.default.createElement(pe,{display:e.uiState.toolbarDropdown==="format",closeDropdown:()=>e.setUIState(r=>r.toolbarDropdown!=="format"?r:f(m({},r),{toolbarDropdown:void 0}))},gm(e.gridState.sheetIndex,e.sheetData,ti(e.gridState.selections,e.sheetData),e.mitoAPI,e.closeOpenEditingPopups))),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:"PIVOT",action:e.actions["pivot"],highlightToolbarButton:e.highlightPivotTableButton,setEditorState:e.setEditorState,disabledTooltip:e.actions["pivot"].isDisabled()}),re.default.createElement(Mt,{toolbarButtonType:"GRAPH",action:e.actions["graph"],setEditorState:e.setEditorState,disabledTooltip:e.actions["graph"].isDisabled()}),e.userProfile.mitoConfig.MITO_CONFIG_FEATURE_DISPLAY_AI_TRANSFORMATION&&re.default.createElement(Mt,{toolbarButtonType:"AI_TRANSFORMATION",action:e.actions["AI_Transformation"],setEditorState:e.setEditorState,disabledTooltip:e.actions["AI_Transformation"].isDisabled()}),((n=e.userProfile.mitoConfig.MITO_CONFIG_CODE_SNIPPETS)==null?void 0:n.MITO_CONFIG_CODE_SNIPPETS_URL)!==void 0&&re.default.createElement(Mt,{toolbarButtonType:"CODE_SNIPPETS",action:e.actions["CodeSnippets"],setEditorState:e.setEditorState,disabledTooltip:e.actions["CodeSnippets"].isDisabled()})),re.default.createElement("div",{className:"mito-toolbar-bottom-right-half"},e.currStepIdx!==e.lastStepIndex&&re.default.createElement(Mt,{toolbarButtonType:"CATCH UP",action:e.actions["catch up"]}),re.default.createElement(Mt,{toolbarButtonType:"STEPS",action:e.actions["steps"],disabledTooltip:e.actions["steps"].isDisabled()}),re.default.createElement("div",{className:"toolbar-vertical-line"}),re.default.createElement(Mt,{toolbarButtonType:Ft.fullscreenElement?"CLOSE FULLSCREEN":"OPEN FULLSCREEN",action:e.actions["fullscreen"]}))))},Q4=ST;var tt=T(_());var Ue=T(_());var CT=[{tourName:"Intro",stepNumber:1,stepHeader:"Seeing your data",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Your data is visible in the sheet. Each dataframe is represented by a different tab. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!1,hideXIcon:!0},{tourName:"Intro",stepNumber:2,stepHeader:"Find functionality",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," All functionality can be found through the toolbar. Explore the toolbar to see what is possible. "),location:"top_left",advanceButtonText:"Continue",displayBackButton:!0,hideXIcon:!0},{tourName:"Intro",stepNumber:3,stepHeader:"Use the generated code",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,"Each time you make an edit, Mito generates equivalent Python code in the cell below. Running this generated code edits the dataframes in your notebook directly."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],IT=[{tourName:"Pivot",stepNumber:1,stepHeader:"Creating a pivot table",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," ",Ue.default.createElement("b",null," Click on the Pivot button")," to get started. Mito\u2019s pivot tables make it easy to slice and dice your data into different categories. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Pivot",stepNumber:2,stepHeader:"Configure your pivot table",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," In the open sidebar, ",Ue.default.createElement("b",null,"select a row and value ")," to create your pivot table."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Pivot",stepNumber:3,stepHeader:"That was easy!",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Checkout the pivot table code below"),". Each time you create a pivot table, a new dataframe is created in both the Mito sheet and the generated code. We just saved our first few trips to stack overflow :) "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],xT=[{tourName:"Column_Formulas",stepNumber:1,stepHeader:"Our Formulas are Different",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Edit a column by updating its formula. If you want to uppercase the column ",Ue.default.createElement("b",null,"Name"),", set its formula to ",Ue.default.createElement("b",null,"UPPER(Name)"),". No extra columns necessary. "),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Column_Formulas",stepNumber:2,stepHeader:"Manually Reapply Formulas",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," Mito differs from other spreadsheets because formulas do not automatically update when the input data changes. If you want to update a specific formula, simply resubmit it! "),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Column_Formulas",stepNumber:3,stepHeader:"Become a Formula Expert",stepHeaderBackgroundColor:"#DDA1A1",stepText:Ue.default.createElement("div",null," Want to learn more about how Mito's formulas are different? ",Ue.default.createElement("a",{className:"text-body-1-link text-color-white-important",href:a5,target:"_blank",rel:"noreferrer"},"Check out our detailed formula documentation.")),location:"bottom_right",advanceButtonText:"Continue",displayBackButton:!0}],wT=[{tourName:"Explore_Datasets",stepNumber:1,stepHeader:"Exploring data with Mito",stepHeaderBackgroundColor:"#BCDFBC",stepText:Ue.default.createElement("div",null," Mito makes it easy to build intuition for your data by automatically generating summary information about each column. To get started, ",Ue.default.createElement("b",null,"click on the filter button in the column header")," of one of your columns."),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:2,stepHeader:"View summary stats",stepHeaderBackgroundColor:"#CAD1FF",stepText:Ue.default.createElement("div",null," ",Ue.default.createElement("b",null,"Click on the Summary Stats tab ")," at the bottom of the sidebar. The chart at the top shows you the distribution of your column, and there\u2019s more specific summary information down below. Check it out!"),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:3,stepHeader:"Add a filter",stepHeaderBackgroundColor:"#FFDAAE",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Switch over to the Filter/Sort Tab ")," to clean up your data now that you've built up some intuition. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:4,stepHeader:"Create a filter",stepHeaderBackgroundColor:"#79C2F8",stepText:Ue.default.createElement("div",null,Ue.default.createElement("b",null,"Click on the Add Filter button "),", and then set the filter ",Ue.default.createElement("b",null,"condition and value"),". "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0},{tourName:"Explore_Datasets",stepNumber:5,stepHeader:"Enjoy your cleaned data",stepHeaderBackgroundColor:"#FFCBDE",stepText:Ue.default.createElement("div",null,"Nice work! In just a few clicks, we\u2019ve built some intuition for our data and removed the values we're not interested in. "),location:"bottom_left",advanceButtonText:"Continue",displayBackButton:!0}],TT=[{tourName:"Tutorial",stepNumber:1,stepHeader:"Before you go!",stepHeaderBackgroundColor:"#FFDAAE",stepText:Ue.default.createElement("div",null,"If you want more information on how to clean and analyze your data by writing spreadsheet formulas, visualizing your data, and adding filters, checkout our more detailed tutorial ",Ue.default.createElement("a",{href:i5,target:"_blank",rel:"noreferrer",style:{color:"#0081DE"}},"here"),"."),location:"bottom_left",advanceButtonText:"Close",displayBackButton:!0}],eC={Intro:CT,Pivot:IT,Tutorial:TT,Column_Formulas:xT,Explore_Datasets:wT};var DT={["bottom_left"]:"tour-container-bottom-left",["bottom_right"]:"tour-container-bottom-right",["top_left"]:"tour-container-top-left",["top_right"]:"tour-container-top-right"},vT=e=>{var h;let[t,n]=(0,tt.useState)(0),[r,o]=(0,tt.useState)(!1),i=[];e.tourNames.forEach(x=>{i.push(...eC[x])}),(0,tt.useEffect)(()=>{e.mitoAPI.log("begin_tour",{tour_names:e.tourNames,total_number_of_tour_steps:i.length})},[]),(0,tt.useEffect)(()=>{i[t].tourName==="Pivot"&&i[t].stepNumber===1?e.setHighlightPivotTableButton(!0):(e.setHighlightPivotTableButton(!1),e.setHighlightAddColButton(!1))},[t]);let a=x=>{x<=i.length-1?(e.mitoAPI.log("switched_tour_step",{old_tour_name:i[t].tourName,old_tour_step:t,new_tour_name:i[x].tourName,new_tour_step:x,tour_names:e.tourNames,total_number_of_tour_steps:i.length}),n(x)):l()},s=async()=>{e.mitoAPI.log("closed_tour_early",{tour_names:e.tourNames,tour_name:i[t].tourName,relative_tour_step_number:i[t].stepNumber,absolute_tour_step_number:t,total_number_of_tour_steps:i.length}),o(!0),i[t].tourName==="Intro"?n(i.length-1):l(!0)},l=async x=>{!r&&!x&&e.mitoAPI.log("finished_tour",{tour_names:e.tourNames,total_number_of_tour_steps:i.length}),e.setHighlightPivotTableButton(!1),e.setHighlightAddColButton(!1),await e.mitoAPI.updateCloseTour(e.tourNames)},d=i[t].stepText,u=i[t].stepTextFunction,c=d||u&&u(((h=e.sheetData)==null?void 0:h.data[0].columnID)||""),p=i[t].hideXIcon===!0;return tt.default.createElement("div",{className:M("tour-container",DT[i[t].location]),key:t},tt.default.createElement(I,{justify:"space-between",align:"center"},tt.default.createElement(C,null,tt.default.createElement("p",{className:"text-header-2"},t+1,"/",i.length)),!p&&tt.default.createElement(C,null,tt.default.createElement(at,{variant:"light",onClick:async()=>{t>=i.length-1?await l():await s()}}))),tt.default.createElement(I,null,tt.default.createElement(C,null,tt.default.createElement("p",{className:"text-header-2 text-color-white-important"},i[t].stepHeader))),tt.default.createElement("div",{className:"text-overflow-wrap mb-20px"},c),tt.default.createElement(I,{justify:"space-between"},t-1>=0&&tt.default.createElement(C,null,tt.default.createElement(j,{variant:"dark",width:"small",onClick:()=>a(t-1)},"Back")),t-1<=0&&tt.default.createElement(C,null),tt.default.createElement(C,null,tt.default.createElement(j,{variant:"light",width:"small",onClick:()=>a(t+1)},i[t].advanceButtonText))))},tC=vT;var PT=e=>{let t=(0,R.useRef)(null),[n,r]=(0,R.useState)(e.sheetDataArray),[o,i]=(0,R.useState)(e.analysisData),[a,s]=(0,R.useState)(e.userProfile),[l,d]=(0,R.useState)(()=>$y(n,0)),[u,c]=(0,R.useState)({loading:[],currOpenModal:a.userEmail==""&&a.telemetryEnabled?{type:"SignUp"}:a.shouldUpgradeMitosheet?{type:"Upgrade"}:{type:"None"},currOpenTaskpane:{type:"none"},selectedColumnControlPanelTab:"filter_sort",selectedSheetIndex:0,selectedGraphID:Object.keys(o.graphDataDict||{}).length===0?void 0:Object.keys(o.graphDataDict)[0],selectedTabType:"data",currOpenToolbarDropdown:void 0,toolbarDropdown:void 0,exportConfiguration:{exportType:"csv"},currOpenPopups:{["top_right"]:{type:"none"}},dataRecon:void 0}),[p,h]=(0,R.useState)(void 0),[x,D]=(0,R.useState)(!1),[S,g]=(0,R.useState)(!1),[y,w]=(0,R.useState)(["."]),[P,N]=(0,R.useState)([]),{mitoAPI:A,sendFunctionStatus:k}=c4(e.getSendFunction,r,i,s,c);(0,R.useEffect)(()=>{(k==="no_backend_comm_registered_error"||k==="non_valid_location_error"||k==="non_working_extension_error")&&c(Te=>f(m({},Te),{currOpenTaskpane:{type:"CannotCreateComm",commCreationErrorStatus:k}}))},[k]),(0,R.useEffect)(()=>{A.log("mitosheet_rendered")},[A]),(0,R.useEffect)(()=>{let Te=async()=>{var pt,Zr;let xt=await Ty((pt=o.analysisToReplay)==null?void 0:pt.analysisName);if(o.analysisToReplay){let Ci=(Zr=o.analysisToReplay)==null?void 0:Zr.analysisName;if(!o.analysisToReplay.existsOnDisk){A.log("replayed_nonexistant_analysis_failed"),c(hc=>f(m({},hc),{currOpenModal:{type:"ErrorReplayAnalysis",header:"analysis_to_replay does not exist",message:`We're unable to replay ${Ci} because you don't have access to it. This is probably because the analysis was created on a different computer.`,error:void 0,oldAnalysisName:Ci,newAnalysisName:o.analysisName}}));return}let gh=await A.updateReplayAnalysis(Ci,xt);"error"in gh&&c(hc=>f(m({},hc),{currOpenTaskpane:{type:"UpdateImports",failedReplayData:{analysisName:Ci,error:gh,args:xt}}}))}else Iy(o.analysisName,A),await A.updateArgs(xt)};(async()=>{let xt=await A.getRenderCount();("error"in xt?void 0:xt.result)===0&&k==="finished"&&await Te(),await A.updateRenderCount()})()},[A,k]),(0,R.useEffect)(()=>{o.renderCount>=1&&xy(o.analysisName,o.code,a.telemetryEnabled,o.publicInterfaceVersion)},[o]),(0,R.useEffect)(()=>{f5()},[]);let L=(0,R.useRef)(n.length);(0,R.useEffect)(()=>{let Te=L.current;c(Dt=>{let xt=Dt.selectedSheetIndex,pt=xt;return(Te=n.length)&&(pt=n.length-1>=0?n.length-1:0),f(m({},Dt),{selectedSheetIndex:pt})}),L.current=n.length},[n]);let E=(0,R.useRef)(Object.keys(o.graphDataDict||{}).length),b=(0,R.useRef)(u.selectedGraphID!==void 0?Object.keys(o.graphDataDict||{}).indexOf(u.selectedGraphID):-1);(0,R.useEffect)(()=>{b.current=u.selectedGraphID!==void 0?Object.keys(o.graphDataDict||{}).indexOf(u.selectedGraphID):-1},[u.selectedGraphID]),(0,R.useEffect)(()=>{let Te=Object.keys(o.graphDataDict||{}),Dt=E.current,xt=Object.keys(o.graphDataDict||{}).length;if(Dtf(m({},Zr),{selectedGraphID:pt,selectedTabType:"graph",currOpenTaskpane:{type:"graph",graphID:pt}})),b.current=Te.indexOf(pt)}else if(Dt>xt){let pt=C5(o.graphDataDict,b.current,c);b.current=pt!==void 0?Te.indexOf(pt):-1}E.current=xt},[Object.keys(o.graphDataDict||{}).length]),(0,R.useEffect)(()=>{let Te=async()=>{let xt=await A.getPivotParams(u.selectedSheetIndex),pt="error"in xt?void 0:xt.result;pt!==void 0&&c(Zr=>f(m({},Zr),{currOpenModal:{type:"None"},currOpenTaskpane:{type:"pivot",sourceSheetIndex:pt.sheet_index,destinationSheetIndex:u.selectedSheetIndex,existingPivotParams:pt},selectedTabType:"data"}))},Dt=K[u.selectedSheetIndex];Dt!==void 0&&Dt==="pivoted"&&u.currOpenTaskpane.type==="none"&&Te(),p!==void 0&&h(void 0)},[u.selectedSheetIndex]);let F=(0,R.useRef)(u.currOpenTaskpane.type);(0,R.useEffect)(()=>{var Te;if(F.current!=="none"&&u.currOpenTaskpane.type==="none"){let Dt=(Te=t.current)==null?void 0:Te.querySelector(".endo-grid-container");cr(Dt)}F.current=u.currOpenTaskpane.type},[u]);let J=n.map(Te=>Te.dfName),K=n.map(Te=>Te.dfSource),W=n.map(Te=>Te.columnIDsMap),z=o.stepSummaryList[o.stepSummaryList.length-1],{columnID:Se}=st(n[u.selectedSheetIndex],l.selections[l.selections.length-1].startingRowIndex,l.selections[l.selections.length-1].startingColumnIndex),nt=(0,R.useCallback)(Te=>{Ly.includes(u.currOpenTaskpane.type)&&(Te===void 0||!Te.includes(u.currOpenTaskpane.type))&&c(Dt=>f(m({},Dt),{currOpenTaskpane:{type:"none"},currOpenModal:{type:"None"},selectedTabType:"data"}))},[u]),Kr=()=>{switch(u.currOpenModal.type){case"None":return R.default.createElement("div",null);case"Error":return R.default.createElement(_5,{error:u.currOpenModal.error,setUIState:c,mitoAPI:A,userProfile:a});case"ClearAnalysis":return R.default.createElement(w5,{setUIState:c,mitoAPI:A});case"SignUp":return R.default.createElement(M5,{setUIState:c,numUsages:a.numUsages,mitoAPI:A,isPro:a.isPro,sheetDataArray:n,analysisData:o});case"Upgrade":return R.default.createElement(O5,{setUIState:c,mitoAPI:A});case"ErrorReplayAnalysis":return R.default.createElement(D5,{setUIState:c,mitoAPI:A,header:u.currOpenModal.header,message:u.currOpenModal.message,error:u.currOpenModal.error,newAnalysisName:u.currOpenModal.newAnalysisName,oldAnalysisName:u.currOpenModal.oldAnalysisName,userProfile:a});case"DeleteGraphs":return R.default.createElement(T5,{setUIState:c,mitoAPI:A,sheetIndex:u.currOpenModal.sheetIndex,dependantGraphTabNamesAndIDs:u.currOpenModal.dependantGraphTabNamesAndIDs,dfName:n[u.currOpenModal.sheetIndex]?n[u.currOpenModal.sheetIndex].dfName:"this dataframe"})}},$r=()=>{switch(u.currOpenTaskpane.type){case"control_panel":return R.default.createElement(j3,{key:""+Se+u.selectedSheetIndex+u.selectedColumnControlPanelTab,selectedSheetIndex:u.selectedSheetIndex,sheetData:n[u.selectedSheetIndex],columnIDsMapArray:W,selection:l.selections[l.selections.length-1],gridState:l,mitoContainerRef:t,setUIState:c,setEditorState:h,mitoAPI:A,tab:u.selectedColumnControlPanelTab,lastStepIndex:z.step_idx,lastStepType:z.step_type,analysisData:o,closeOpenEditingPopups:nt});case"upgrade_to_pro":return R.default.createElement(M4,{mitoAPI:A,userProfile:a,setUIState:c,proOrEnterprise:u.currOpenTaskpane.proOrEnterprise});case"download":return R.default.createElement(sS,{dfNames:J,userProfile:a,selectedSheetIndex:u.selectedSheetIndex,uiState:u,setUIState:c,mitoAPI:A,sheetDataArray:n});case"drop_duplicates":return R.default.createElement(lS,{dfNames:J,selectedSheetIndex:u.selectedSheetIndex,setUIState:c,mitoAPI:A,sheetDataArray:n,analysisData:o});case"graph":return R.default.createElement(US,{graphID:u.currOpenTaskpane.graphID,graphSidebarTab:u.currOpenTaskpane.graphSidebarTab,dfNames:J,columnIDsMapArray:W,sheetDataArray:n,mitoAPI:A,setUIState:c,uiState:u,graphDataDict:o.graphDataDict,analysisData:o,mitoContainerRef:t,userProfile:a});case"import files":return R.default.createElement(NS,{mitoAPI:A,analysisData:o,userProfile:a,setUIState:c,currPathParts:y,setCurrPathParts:w});case"merge":return R.default.createElement(jS,{selectedSheetIndex:u.selectedSheetIndex,sheetDataArray:n,setUIState:c,mitoAPI:A,analysisData:o});case"concat":return R.default.createElement(eS,{analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A});case"none":return R.default.createElement(R.Fragment,null);case"pivot":return R.default.createElement(zS,{dfNames:J,sheetDataArray:n,columnIDsMapArray:W,mitoAPI:A,sourceSheetIndex:u.currOpenTaskpane.sourceSheetIndex,analysisData:o,setUIState:c,destinationSheetIndex:u.currOpenTaskpane.destinationSheetIndex,existingPivotParams:u.currOpenTaskpane.existingPivotParams});case"split_text_to_columns":return R.default.createElement(qS,{mitoAPI:A,analysisData:o,sheetDataArray:n,selectedSheetIndex:u.selectedSheetIndex,setUIState:c,dfNames:J,startingColumnID:u.currOpenTaskpane.startingColumnID});case"steps":return R.default.createElement(E4,{stepSummaryList:o.stepSummaryList,setUIState:c,mitoAPI:A,currStepIdx:o.currStepIdx,userProfile:a});case"import_first":return R.default.createElement(ge,{setUIState:c,message:u.currOpenTaskpane.message});case"fill_na":return R.default.createElement(MS,{setUIState:c,uiState:u,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex,sheetDataArray:n,analysisData:o,startingColumnIDs:u.currOpenTaskpane.startingColumnIDs});case"melt":return R.default.createElement(HS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"set_dataframe_format":return R.default.createElement(Q3,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"ConditionalFormatting":return R.default.createElement(o5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"DataframeImport":return R.default.createElement(rS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"UpdateImports":return R.default.createElement(u4,{mitoAPI:A,sheetDataArray:n,setUIState:c,userProfile:a,analysisData:o,currPathParts:y,setCurrPathParts:w,failedReplayData:u.currOpenTaskpane.failedReplayData});case"CannotCreateComm":return R.default.createElement(X5,{userProfile:a,setUIState:c,commCreationErrorStatus:u.currOpenTaskpane.commCreationErrorStatus});case"CodeSnippets":return R.default.createElement(Y5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"SnowflakeImport":return R.default.createElement(ZS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"Excel Range Import":return R.default.createElement(cS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,file_path:u.currOpenTaskpane.file_path,sheet_name:u.currOpenTaskpane.sheet_name,sheet_names:u.currOpenTaskpane.sheet_names});case"Export To File":return R.default.createElement(fS,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"AITransformation":return R.default.createElement(W5,{userProfile:a,analysisData:o,gridState:l,uiState:u,setUIState:c,mitoAPI:A,sheetDataArray:n,previousAITransformParams:P,setPreviousAITransformParams:N});case"CodeOptions":return R.default.createElement($5,{userProfile:a,analysisData:o,setUIState:c,mitoAPI:A});case"Column Headers Transform":return R.default.createElement(Q5,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex});case"UserDefinedImport":return R.default.createElement(m4,{userProfile:a,analysisData:o,sheetDataArray:n,setUIState:c,mitoAPI:A,selectedSheetIndex:u.selectedSheetIndex})}},It=Te=>{let Dt=u.currOpenPopups[Te];switch(Dt.type){case"ephemeral_message":return R.default.createElement(b4,{message:Dt.message,setUIState:c,popupLocation:Te});case"none":return R.default.createElement(R.Fragment,null)}},ir=m5(n,l,K,nt,h,u,c,d,A,t,o,a,k);vy(t,ir,d);let Si=()=>{if(o.dataTypeInTool==="none"||o.dataTypeInTool==="tutorial")return R.default.createElement(R.default.Fragment,null);if(a.mitoConfig.MITO_CONFIG_DISABLE_TOURS)return R.default.createElement(R.default.Fragment,null);let Te=[];return a.receivedTours.includes("Intro")||Te.push("Intro"),p!==void 0&&p.rowIndex>=0&&!a.receivedTours.includes("Column_Formulas")&&Te.push("Column_Formulas"),R.default.createElement(R.default.Fragment,null,Te.length!==0&&u.currOpenModal.type!=="SignUp"&&R.default.createElement(tC,{sheetData:n[u.selectedSheetIndex],setHighlightPivotTableButton:D,setHighlightAddColButton:g,tourNames:Te,mitoAPI:A}))},Cd=u.currOpenTaskpane.type!=="none",ws=u.currOpenTaskpane.type==="graph"&&u.selectedTabType==="graph",Ts=Cd&&!ws,Id=M("mito-sheet-and-formula-bar-container",{"mito-sheet-and-formula-bar-container-wide-taskpane-open":ws,"mito-sheet-and-formula-bar-container-narrow-taskpane-open":Ts}),xd=M({"mito-taskpane-container":!Cd,"mito-taskpane-container-wide":ws,"mito-taskpane-container-narrow":Ts});return R.default.createElement("div",{className:"mito-container","data-jp-suppress-context-menu":!0,ref:t,tabIndex:0},R.default.createElement(h5,{mitoAPI:A,analyisData:o,userProfile:a,sheetDataArray:n},R.default.createElement(Q4,{mitoAPI:A,currStepIdx:o.currStepIdx,lastStepIndex:z.step_idx,highlightPivotTableButton:x,highlightAddColButton:S,actions:ir,mitoContainerRef:t,gridState:l,setGridState:d,uiState:u,setUIState:c,sheetData:n[u.selectedSheetIndex],userProfile:a,setEditorState:h,analysisData:o,sheetIndex:u.selectedSheetIndex,closeOpenEditingPopups:nt}),R.default.createElement("div",{className:"mito-center-content-container",id:"mito-center-content-container"},R.default.createElement("div",{className:Id},R.default.createElement(w3,{sheetDataArray:n,mitoAPI:A,uiState:u,setUIState:c,sheetIndex:u.selectedSheetIndex,gridState:l,setGridState:d,editorState:p,setEditorState:h,mitoContainerRef:t,closeOpenEditingPopups:nt,sendFunctionStatus:k,analysisData:o})),u.currOpenTaskpane.type!=="none"&&R.default.createElement("div",{className:xd},$r())),Si(),R.default.createElement(x5,{sheetDataArray:n,graphDataDict:o.graphDataDict,gridState:l,setGridState:d,mitoAPI:A,closeOpenEditingPopups:nt,uiState:u,setUIState:c,mitoContainerRef:t,setEditorState:h}),Kr(),R.default.createElement(D4,{loading:u.loading,sheetDataArray:n,userProfile:a,analysisData:o,mitoAPI:A,currOpenModal:u.currOpenModal,actions:ir,setUIState:c}),It("top_right"),o.currStepIdx!==z.step_idx&&R.default.createElement(p5,{fastForward:()=>{A.updateCheckoutStepByIndex(z.step_idx)},deleteStepsAfterIdx:()=>{A.updateUndoToStepIndex(o.currStepIdx)},isPro:a.isPro})))},nC=PT;var Sd=1e4;var bT=5*6e4,oC=25,rC=bT/oC,ET=async e=>new Promise(t=>{(async()=>{let r=!1;return e.on_msg(o=>{o.content.data.echo&&(r=!0)}),await td(()=>r,Sd),t(r)})()}),AT=async e=>{var n,r,o,i;let t=(i=(o=(r=(n=window.Jupyter)==null?void 0:n.notebook)==null?void 0:r.kernel)==null?void 0:o.comm_manager)==null?void 0:i.new_comm(e);return await td(async()=>{var a,s,l,d;return t=(d=(l=(s=(a=window.Jupyter)==null?void 0:a.notebook)==null?void 0:s.kernel)==null?void 0:l.comm_manager)==null?void 0:d.new_comm(e),t!==void 0},Sd),t===void 0?"non_working_extension_error":await ET(t)?{type:"notebook",comm:t}:"no_backend_comm_registered_error"},kT=async e=>new Promise(t=>{(async()=>{let r=e.onMsg,o=!1;return e.onMsg=i=>{i.content.data.echo&&(o=!0)},await td(()=>o,Sd),e.onMsg=r,t(o)})()}),NT=async(e,t)=>{let n;return await td(async()=>{var r;try{n=await((r=window.commands)==null?void 0:r.execute("mitosheet:create-mitosheet-comm",{kernelID:e,commTargetID:t}))}catch(o){return console.error(o),!0}return n!==void 0&&n!=="no_backend_comm_registered_error"},Sd),n===void 0?"non_working_extension_error":n==="no_backend_comm_registered_error"?"no_backend_comm_registered_error":(n.open(),await kT(n)?{type:"lab",comm:n}:"no_backend_comm_registered_error")};async function pc(e,t){let n="non_valid_location_error";if(ji()?n=await AT(t):uo()&&(n=await NT(e,t)),typeof n=="string")return n;let r=n.comm,o=r.send;n.type==="notebook"?n.comm.on_msg(d=>a(d)):n.comm.onMsg=d=>a(d);let i=pc.unconsumedResponses||(pc.unconsumedResponses=[]);function a(d){i.push(d.content.data)}function s(d,u=rC){return new Promise(c=>{let p=0,h=setInterval(()=>{if(p++,p>u)return console.error(`No response on message: {id: ${d}}`),clearInterval(h),c({error:`No response on message: {id: ${d}}`,errorShort:"No response received",showErrorModal:!1});let x=i.findIndex(D=>D.id===d);if(x!==-1){clearInterval(h);let D=i[x];if(i.splice(x,1),D.event=="error")return c({error:D.error,errorShort:D.errorShort,showErrorModal:D.showErrorModal,traceback:D.traceback});let S=D.shared_variables;return c({sheetDataArray:S?Zu(S.sheet_data_json):void 0,analysisData:S?qu(S.analysis_data_json):void 0,userProfile:S?Yu(S.user_profile_json):void 0,result:D.data})}},oC)})}async function l(d){return console.log(`Sending: {type: ${d.type}, id: ${d.id}}`),o.call(r,d),await s(d.id,rC)}return l}var MT=new Uint8Array(["REPLACE_THIS_WITH_SHEET_DATA_BYTES"]),OT=new Uint8Array(["REPLACE_THIS_WITH_ANALYSIS_DATA_BYTES"]),FT=new Uint8Array(["REPLACE_THIS_WITH_USER_PROFILE_BYTES"]),LT=Zu(new TextDecoder().decode(MT)),UT=qu(new TextDecoder().decode(OT)),BT=Yu(new TextDecoder().decode(FT)),HT="REPLACE_THIS_WITH_COMM_TARGET_ID",GT="REPLACE_THIS_WITH_DIV_ID",VT="REPLACE_THIS_WITH_KERNEL_ID",jT="REPLACE_THIS_WITH_CSS",sC=document.createElement("style");sC.appendChild(document.createTextNode(jT));document.head.append(sC);var lC=document.getElementById(GT);console.log("Rendering to div",lC);async function RT(){return await pc(VT,HT)}aC.default.render(iC.createElement(nC,{getSendFunction:RT,sheetDataArray:LT,analysisData:UT,userProfile:BT}),lC);})(); /* object-assign (c) Sindre Sorhus diff --git a/mitosheet/src/components/taskpanes/Download/DownloadTaskpane.tsx b/mitosheet/src/components/taskpanes/Download/DownloadTaskpane.tsx index c70813c73..f3579f350 100644 --- a/mitosheet/src/components/taskpanes/Download/DownloadTaskpane.tsx +++ b/mitosheet/src/components/taskpanes/Download/DownloadTaskpane.tsx @@ -22,6 +22,18 @@ import DefaultEmptyTaskpane from '../DefaultTaskpane/DefaultEmptyTaskpane'; import DefaultTaskpaneFooter from '../DefaultTaskpane/DefaultTaskpaneFooter'; +const INVALID_CHARACTERS_IN_FILENAME = [ + '\\', + '/', + '<', + '>', + ':', + '"', + '|', + '?', + '*', +] + interface DownloadTaskpaneProps { uiState: UIState setUIState: React.Dispatch>; @@ -105,12 +117,16 @@ const DownloadTaskpane = (props: DownloadTaskpaneProps): JSX.Element => { let exportHRef = ''; let exportName = ''; + let fileName = props.uiState.exportConfiguration.fileName; + if (!fileName || fileName === '') { + fileName = 'MitoExport'; + } if (props.uiState.exportConfiguration.exportType === 'csv') { exportHRef = URL.createObjectURL(new Blob( [ exportString ], { type: 'text/csv' } )) - exportName = `${props.uiState.exportConfiguration.fileName ?? 'MitoExport'}.csv`; + exportName = `${fileName}.csv`; } else if (props.uiState.exportConfiguration.exportType === 'excel') { exportHRef = URL.createObjectURL(new Blob( /* @@ -120,9 +136,19 @@ const DownloadTaskpane = (props: DownloadTaskpaneProps): JSX.Element => { [ Uint8Array.from(window.atob(exportString), c => c.charCodeAt(0)) ], { type: 'text/csv' } // TODO: for some reason, text/csv works fine here )) - exportName = `${props.uiState.exportConfiguration.fileName ?? 'MitoExport'}.xlsx`; + exportName = `${fileName}.xlsx`; } + + // Warn the user if they have some ending that is invalid + let invalidFileNameWarning: string | undefined = undefined; + + INVALID_CHARACTERS_IN_FILENAME.forEach((char) => { + if (props.uiState.exportConfiguration.fileName?.includes(char)) { + invalidFileNameWarning= `The File Name cannot include ${char}` + } + }) + return ( { File Name

{ - console.log(event) props.setUIState((prevUiState => { - console.log(prevUiState) return { ...prevUiState, exportConfiguration: { @@ -192,6 +217,7 @@ const DownloadTaskpane = (props: DownloadTaskpaneProps): JSX.Element => { placeholder='MitoExport' /> + { invalidFileNameWarning !== undefined &&

{invalidFileNameWarning}

} { props.uiState.exportConfiguration.exportType === 'excel' &&