easy_ml 0.2.0.pre.rc101 → 0.2.0.pre.rc103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/controllers/easy_ml/datasets_controller.rb +1 -0
- data/app/frontend/components/dataset/PreprocessingConfig.tsx +0 -1
- data/app/frontend/components/dataset/splitters/types.ts +3 -4
- data/app/frontend/pages/NewDatasetPage.tsx +17 -0
- data/app/frontend/types/datasource.ts +14 -6
- data/app/models/easy_ml/column/imputers/base.rb +3 -1
- data/app/models/easy_ml/column.rb +26 -13
- data/app/models/easy_ml/column_list.rb +2 -2
- data/app/models/easy_ml/dataset/learner/lazy/datetime.rb +3 -1
- data/app/models/easy_ml/dataset/learner/lazy/numeric.rb +24 -5
- data/app/models/easy_ml/dataset/learner/lazy/query.rb +19 -7
- data/app/models/easy_ml/dataset/learner/lazy/string.rb +4 -1
- data/app/models/easy_ml/dataset/learner/lazy.rb +17 -4
- data/app/models/easy_ml/dataset.rb +47 -9
- data/app/models/easy_ml/dataset_history.rb +1 -0
- data/app/models/easy_ml/feature.rb +5 -13
- data/app/models/easy_ml/lineage.rb +2 -1
- data/app/models/easy_ml/models/xgboost/evals_callback.rb +1 -0
- data/app/models/easy_ml/models/xgboost.rb +8 -3
- data/app/models/easy_ml/prediction.rb +1 -1
- data/app/models/easy_ml/splitters/base_splitter.rb +4 -8
- data/app/models/easy_ml/splitters/date_splitter.rb +2 -1
- data/app/models/easy_ml/splitters/predefined_splitter.rb +8 -3
- data/lib/easy_ml/data/dataset_manager/schema/normalizer.rb +201 -0
- data/lib/easy_ml/data/dataset_manager/schema.rb +9 -0
- data/lib/easy_ml/data/dataset_manager.rb +5 -0
- data/lib/easy_ml/data/date_converter.rb +24 -165
- data/lib/easy_ml/data/polars_column.rb +4 -2
- data/lib/easy_ml/data/polars_reader.rb +5 -2
- data/lib/easy_ml/engine.rb +4 -0
- data/lib/easy_ml/railtie/generators/migration/migration_generator.rb +1 -0
- data/lib/easy_ml/railtie/templates/migration/add_view_class_to_easy_ml_datasets.rb.tt +9 -0
- data/lib/easy_ml/version.rb +1 -1
- data/public/easy_ml/assets/.vite/manifest.json +1 -1
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-BXwsBCuQ.js → Application.tsx-gkZ77wo8.js} +8 -8
- data/public/easy_ml/assets/assets/entrypoints/{Application.tsx-BXwsBCuQ.js.map → Application.tsx-gkZ77wo8.js.map} +1 -1
- metadata +7 -5
- data/lib/easy_ml/data/dataset_manager/normalizer.rb +0 -0
@@ -435,7 +435,7 @@ Please specify a more appropriate element using the "as" attribute. For example:
|
|
435
435
|
* Released under MIT license <https://lodash.com/license>
|
436
436
|
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
437
437
|
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
438
|
-
*/wd.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",m=500,h="__lodash_placeholder__",g=1,x=2,j=4,b=1,_=2,N=1,y=2,w=4,C=8,R=16,D=32,T=64,F=128,z=256,B=512,W=30,pe="...",oe=800,we=16,be=1,J=2,ee=3,le=1/0,G=9007199254740991,re=17976931348623157e292,ne=NaN,me=4294967295,Re=me-1,gt=me>>>1,tt=[["ary",F],["bind",N],["bindKey",y],["curry",C],["curryRight",R],["flip",B],["partial",D],["partialRight",T],["rearg",z]],K="[object Arguments]",je="[object Array]",Ae="[object AsyncFunction]",ke="[object Boolean]",Y="[object Date]",fe="[object DOMException]",ve="[object Error]",Ve="[object Function]",pn="[object GeneratorFunction]",Ye="[object Map]",Sn="[object Number]",nr="[object Null]",jt="[object Object]",on="[object Promise]",St="[object Proxy]",Zt="[object RegExp]",Lt="[object Set]",Nn="[object String]",Fn="[object Symbol]",ie="[object Undefined]",xe="[object WeakMap]",at="[object WeakSet]",Ge="[object ArrayBuffer]",st="[object DataView]",kn="[object Float32Array]",Nt="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",br="[object Int32Array]",zn="[object Uint8Array]",Cn="[object Uint8ClampedArray]",ar="[object Uint16Array]",sr="[object Uint32Array]",ii=/\b__p \+= '';/g,Q=/\b(__p \+=) '' \+/g,ae=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ye=/&(?:amp|lt|gt|quot|#39);/g,nt=/[&<>"']/g,Ce=RegExp(ye.source),pt=RegExp(nt.source),Dt=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,en=/<%=([\s\S]+?)%>/g,Vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$n=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/[\\^$.*+?()[\]{}|]/g,ai=RegExp(fn.source),mn=/^\s+/,zr=/\s/,wr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_r=/\{\n\/\* \[wrapped with (.+)\] \*/,ws=/,? & /,_s=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,js=/[()=,{}\[\]\/\s]/,Ss=/\\(\\)?/g,Ns=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,En=/\w*$/,Fe=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,xt=/^\[object .+?Constructor\]$/,$r=/^0o[0-7]+$/i,Ur=/^(?:0|[1-9]\d*)$/,An=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ki=/($^)/,jp=/['\n\r\u2028\u2029\\]/g,ks="\\ud800-\\udfff",Sp="\\u0300-\\u036f",Np="\\ufe20-\\ufe2f",Cs="\\u20d0-\\u20ff",jc=Sp+Np+Cs,Sc="\\u2700-\\u27bf",Br="a-z\\xdf-\\xf6\\xf8-\\xff",kp="\\xac\\xb1\\xd7\\xf7",Cp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ep="\\u2000-\\u206f",Ap=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nc="A-Z\\xc0-\\xd6\\xd8-\\xde",kc="\\ufe0e\\ufe0f",Da=kp+Cp+Ep+Ap,Wo="['’]",Fa="["+ks+"]",Ho="["+Da+"]",za="["+jc+"]",Cc="\\d+",Pp="["+Sc+"]",Ec="["+Br+"]",Ac="[^"+ks+Da+Cc+Sc+Br+Nc+"]",Es="\\ud83c[\\udffb-\\udfff]",Tp="(?:"+za+"|"+Es+")",Pc="[^"+ks+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Qi="[\\ud800-\\udbff][\\udc00-\\udfff]",or="["+Nc+"]",Tc="\\u200d",Oc="(?:"+Ec+"|"+Ac+")",si="(?:"+or+"|"+Ac+")",Rc="(?:"+Wo+"(?:d|ll|m|re|s|t|ve))?",Ic="(?:"+Wo+"(?:D|LL|M|RE|S|T|VE))?",Mc=Tp+"?",Lc="["+kc+"]?",Op="(?:"+Tc+"(?:"+[Pc,As,Qi].join("|")+")"+Lc+Mc+")*",ji="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fc=Lc+Mc+Op,Ps="(?:"+[Pp,As,Qi].join("|")+")"+Fc,Rp="(?:"+[Pc+za+"?",za,As,Qi,Fa].join("|")+")",qo=RegExp(Wo,"g"),Ip=RegExp(za,"g"),Ts=RegExp(Es+"(?="+Es+")|"+Rp+Fc,"g"),zc=RegExp([or+"?"+Ec+"+"+Rc+"(?="+[Ho,or,"$"].join("|")+")",si+"+"+Ic+"(?="+[Ho,or+Oc,"$"].join("|")+")",or+"?"+Oc+"+"+Rc,or+"+"+Ic,Dc,ji,Cc,Ps].join("|"),"g"),$c=RegExp("["+Tc+ks+jc+kc+"]"),$a=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Uc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mp=-1,ot={};ot[kn]=ot[Nt]=ot[rr]=ot[ir]=ot[br]=ot[zn]=ot[Cn]=ot[ar]=ot[sr]=!0,ot[K]=ot[je]=ot[Ge]=ot[ke]=ot[st]=ot[Y]=ot[ve]=ot[Ve]=ot[Ye]=ot[Sn]=ot[jt]=ot[Zt]=ot[Lt]=ot[Nn]=ot[xe]=!1;var it={};it[K]=it[je]=it[Ge]=it[st]=it[ke]=it[Y]=it[kn]=it[Nt]=it[rr]=it[ir]=it[br]=it[Ye]=it[Sn]=it[jt]=it[Zt]=it[Lt]=it[Nn]=it[Fn]=it[zn]=it[Cn]=it[ar]=it[sr]=!0,it[ve]=it[Ve]=it[xe]=!1;var A={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},M={"&":"&","<":"<",">":">",'"':""","'":"'"},X={"&":"&","<":"<",">":">",""":'"',"'":"'"},ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,Pe=parseInt,vt=typeof bn=="object"&&bn&&bn.Object===Object&&bn,Wt=typeof self=="object"&&self&&self.Object===Object&&self,We=vt||Wt||Function("return this")(),ct=t&&!t.nodeType&&t,Ft=ct&&!0&&e&&!e.nodeType&&e,Un=Ft&&Ft.exports===ct,Ht=Un&&vt.process,yt=function(){try{var I=Ft&&Ft.require&&Ft.require("util").types;return I||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Pn=yt&&yt.isArrayBuffer,Wr=yt&&yt.isDate,jr=yt&&yt.isMap,oi=yt&&yt.isRegExp,Vo=yt&&yt.isSet,Ua=yt&&yt.isTypedArray;function tn(I,H,$){switch($.length){case 0:return I.call(H);case 1:return I.call(H,$[0]);case 2:return I.call(H,$[0],$[1]);case 3:return I.call(H,$[0],$[1],$[2])}return I.apply(H,$)}function O2(I,H,$,ue){for(var Ee=-1,Ke=I==null?0:I.length;++Ee<Ke;){var Gt=I[Ee];H(ue,Gt,$(Gt),I)}return ue}function Sr(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue&&H(I[$],$,I)!==!1;);return I}function R2(I,H){for(var $=I==null?0:I.length;$--&&H(I[$],$,I)!==!1;);return I}function j0(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue;)if(!H(I[$],$,I))return!1;return!0}function Xi(I,H){for(var $=-1,ue=I==null?0:I.length,Ee=0,Ke=[];++$<ue;){var Gt=I[$];H(Gt,$,I)&&(Ke[Ee++]=Gt)}return Ke}function Bc(I,H){var $=I==null?0:I.length;return!!$&&Os(I,H,0)>-1}function Lp(I,H,$){for(var ue=-1,Ee=I==null?0:I.length;++ue<Ee;)if($(H,I[ue]))return!0;return!1}function kt(I,H){for(var $=-1,ue=I==null?0:I.length,Ee=Array(ue);++$<ue;)Ee[$]=H(I[$],$,I);return Ee}function Yi(I,H){for(var $=-1,ue=H.length,Ee=I.length;++$<ue;)I[Ee+$]=H[$];return I}function Dp(I,H,$,ue){var Ee=-1,Ke=I==null?0:I.length;for(ue&&Ke&&($=I[++Ee]);++Ee<Ke;)$=H($,I[Ee],Ee,I);return $}function I2(I,H,$,ue){var Ee=I==null?0:I.length;for(ue&&Ee&&($=I[--Ee]);Ee--;)$=H($,I[Ee],Ee,I);return $}function Fp(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue;)if(H(I[$],$,I))return!0;return!1}var M2=zp("length");function L2(I){return I.split("")}function D2(I){return I.match(_s)||[]}function S0(I,H,$){var ue;return $(I,function(Ee,Ke,Gt){if(H(Ee,Ke,Gt))return ue=Ke,!1}),ue}function Wc(I,H,$,ue){for(var Ee=I.length,Ke=$+(ue?1:-1);ue?Ke--:++Ke<Ee;)if(H(I[Ke],Ke,I))return Ke;return-1}function Os(I,H,$){return H===H?Q2(I,H,$):Wc(I,N0,$)}function F2(I,H,$,ue){for(var Ee=$-1,Ke=I.length;++Ee<Ke;)if(ue(I[Ee],H))return Ee;return-1}function N0(I){return I!==I}function k0(I,H){var $=I==null?0:I.length;return $?Up(I,H)/$:ne}function zp(I){return function(H){return H==null?n:H[I]}}function $p(I){return function(H){return I==null?n:I[H]}}function C0(I,H,$,ue,Ee){return Ee(I,function(Ke,Gt,ut){$=ue?(ue=!1,Ke):H($,Ke,Gt,ut)}),$}function z2(I,H){var $=I.length;for(I.sort(H);$--;)I[$]=I[$].value;return I}function Up(I,H){for(var $,ue=-1,Ee=I.length;++ue<Ee;){var Ke=H(I[ue]);Ke!==n&&($=$===n?Ke:$+Ke)}return $}function Bp(I,H){for(var $=-1,ue=Array(I);++$<I;)ue[$]=H($);return ue}function $2(I,H){return kt(H,function($){return[$,I[$]]})}function E0(I){return I&&I.slice(0,O0(I)+1).replace(mn,"")}function lr(I){return function(H){return I(H)}}function Wp(I,H){return kt(H,function($){return I[$]})}function Go(I,H){return I.has(H)}function A0(I,H){for(var $=-1,ue=I.length;++$<ue&&Os(H,I[$],0)>-1;);return $}function P0(I,H){for(var $=I.length;$--&&Os(H,I[$],0)>-1;);return $}function U2(I,H){for(var $=I.length,ue=0;$--;)I[$]===H&&++ue;return ue}var B2=$p(A),W2=$p(M);function H2(I){return"\\"+ce[I]}function q2(I,H){return I==null?n:I[H]}function Rs(I){return $c.test(I)}function V2(I){return $a.test(I)}function G2(I){for(var H,$=[];!(H=I.next()).done;)$.push(H.value);return $}function Hp(I){var H=-1,$=Array(I.size);return I.forEach(function(ue,Ee){$[++H]=[Ee,ue]}),$}function T0(I,H){return function($){return I(H($))}}function Ji(I,H){for(var $=-1,ue=I.length,Ee=0,Ke=[];++$<ue;){var Gt=I[$];(Gt===H||Gt===h)&&(I[$]=h,Ke[Ee++]=$)}return Ke}function Hc(I){var H=-1,$=Array(I.size);return I.forEach(function(ue){$[++H]=ue}),$}function K2(I){var H=-1,$=Array(I.size);return I.forEach(function(ue){$[++H]=[ue,ue]}),$}function Q2(I,H,$){for(var ue=$-1,Ee=I.length;++ue<Ee;)if(I[ue]===H)return ue;return-1}function X2(I,H,$){for(var ue=$+1;ue--;)if(I[ue]===H)return ue;return ue}function Is(I){return Rs(I)?J2(I):M2(I)}function Hr(I){return Rs(I)?Z2(I):L2(I)}function O0(I){for(var H=I.length;H--&&zr.test(I.charAt(H)););return H}var Y2=$p(X);function J2(I){for(var H=Ts.lastIndex=0;Ts.test(I);)++H;return H}function Z2(I){return I.match(Ts)||[]}function eS(I){return I.match(zc)||[]}var tS=function I(H){H=H==null?We:Ms.defaults(We.Object(),H,Ms.pick(We,Uc));var $=H.Array,ue=H.Date,Ee=H.Error,Ke=H.Function,Gt=H.Math,ut=H.Object,qp=H.RegExp,nS=H.String,Nr=H.TypeError,qc=$.prototype,rS=Ke.prototype,Ls=ut.prototype,Vc=H["__core-js_shared__"],Gc=rS.toString,Je=Ls.hasOwnProperty,iS=0,R0=function(){var i=/[^.]+$/.exec(Vc&&Vc.keys&&Vc.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Kc=Ls.toString,aS=Gc.call(ut),sS=We._,oS=qp("^"+Gc.call(Je).replace(fn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qc=Un?H.Buffer:n,Zi=H.Symbol,Xc=H.Uint8Array,I0=Qc?Qc.allocUnsafe:n,Yc=T0(ut.getPrototypeOf,ut),M0=ut.create,L0=Ls.propertyIsEnumerable,Jc=qc.splice,D0=Zi?Zi.isConcatSpreadable:n,Ko=Zi?Zi.iterator:n,Ba=Zi?Zi.toStringTag:n,Zc=function(){try{var i=Ga(ut,"defineProperty");return i({},"",{}),i}catch{}}(),lS=H.clearTimeout!==We.clearTimeout&&H.clearTimeout,cS=ue&&ue.now!==We.Date.now&&ue.now,uS=H.setTimeout!==We.setTimeout&&H.setTimeout,eu=Gt.ceil,tu=Gt.floor,Vp=ut.getOwnPropertySymbols,dS=Qc?Qc.isBuffer:n,F0=H.isFinite,pS=qc.join,fS=T0(ut.keys,ut),Kt=Gt.max,hn=Gt.min,mS=ue.now,hS=H.parseInt,z0=Gt.random,gS=qc.reverse,Gp=Ga(H,"DataView"),Qo=Ga(H,"Map"),Kp=Ga(H,"Promise"),Ds=Ga(H,"Set"),Xo=Ga(H,"WeakMap"),Yo=Ga(ut,"create"),nu=Xo&&new Xo,Fs={},xS=Ka(Gp),vS=Ka(Qo),yS=Ka(Kp),bS=Ka(Ds),wS=Ka(Xo),ru=Zi?Zi.prototype:n,Jo=ru?ru.valueOf:n,$0=ru?ru.toString:n;function S(i){if(Rt(i)&&!Te(i)&&!(i instanceof Ue)){if(i instanceof kr)return i;if(Je.call(i,"__wrapped__"))return Ux(i)}return new kr(i)}var zs=function(){function i(){}return function(o){if(!Et(o))return{};if(M0)return M0(o);i.prototype=o;var u=new i;return i.prototype=n,u}}();function iu(){}function kr(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=n}S.templateSettings={escape:Dt,evaluate:ft,interpolate:en,variable:"",imports:{_:S}},S.prototype=iu.prototype,S.prototype.constructor=S,kr.prototype=zs(iu.prototype),kr.prototype.constructor=kr;function Ue(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=me,this.__views__=[]}function _S(){var i=new Ue(this.__wrapped__);return i.__actions__=Bn(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Bn(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Bn(this.__views__),i}function jS(){if(this.__filtered__){var i=new Ue(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function SS(){var i=this.__wrapped__.value(),o=this.__dir__,u=Te(i),f=o<0,v=u?i.length:0,k=LN(0,v,this.__views__),P=k.start,O=k.end,L=O-P,q=f?O:P-1,V=this.__iteratees__,Z=V.length,se=0,ge=hn(L,this.__takeCount__);if(!u||!f&&v==L&&ge==L)return ux(i,this.__actions__);var Se=[];e:for(;L--&&se<ge;){q+=o;for(var Le=-1,Ne=i[q];++Le<Z;){var ze=V[Le],He=ze.iteratee,dr=ze.type,Rn=He(Ne);if(dr==J)Ne=Rn;else if(!Rn){if(dr==be)continue e;break e}}Se[se++]=Ne}return Se}Ue.prototype=zs(iu.prototype),Ue.prototype.constructor=Ue;function Wa(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function NS(){this.__data__=Yo?Yo(null):{},this.size=0}function kS(i){var o=this.has(i)&&delete this.__data__[i];return this.size-=o?1:0,o}function CS(i){var o=this.__data__;if(Yo){var u=o[i];return u===p?n:u}return Je.call(o,i)?o[i]:n}function ES(i){var o=this.__data__;return Yo?o[i]!==n:Je.call(o,i)}function AS(i,o){var u=this.__data__;return this.size+=this.has(i)?0:1,u[i]=Yo&&o===n?p:o,this}Wa.prototype.clear=NS,Wa.prototype.delete=kS,Wa.prototype.get=CS,Wa.prototype.has=ES,Wa.prototype.set=AS;function Si(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function PS(){this.__data__=[],this.size=0}function TS(i){var o=this.__data__,u=au(o,i);if(u<0)return!1;var f=o.length-1;return u==f?o.pop():Jc.call(o,u,1),--this.size,!0}function OS(i){var o=this.__data__,u=au(o,i);return u<0?n:o[u][1]}function RS(i){return au(this.__data__,i)>-1}function IS(i,o){var u=this.__data__,f=au(u,i);return f<0?(++this.size,u.push([i,o])):u[f][1]=o,this}Si.prototype.clear=PS,Si.prototype.delete=TS,Si.prototype.get=OS,Si.prototype.has=RS,Si.prototype.set=IS;function Ni(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function MS(){this.size=0,this.__data__={hash:new Wa,map:new(Qo||Si),string:new Wa}}function LS(i){var o=xu(this,i).delete(i);return this.size-=o?1:0,o}function DS(i){return xu(this,i).get(i)}function FS(i){return xu(this,i).has(i)}function zS(i,o){var u=xu(this,i),f=u.size;return u.set(i,o),this.size+=u.size==f?0:1,this}Ni.prototype.clear=MS,Ni.prototype.delete=LS,Ni.prototype.get=DS,Ni.prototype.has=FS,Ni.prototype.set=zS;function Ha(i){var o=-1,u=i==null?0:i.length;for(this.__data__=new Ni;++o<u;)this.add(i[o])}function $S(i){return this.__data__.set(i,p),this}function US(i){return this.__data__.has(i)}Ha.prototype.add=Ha.prototype.push=$S,Ha.prototype.has=US;function qr(i){var o=this.__data__=new Si(i);this.size=o.size}function BS(){this.__data__=new Si,this.size=0}function WS(i){var o=this.__data__,u=o.delete(i);return this.size=o.size,u}function HS(i){return this.__data__.get(i)}function qS(i){return this.__data__.has(i)}function VS(i,o){var u=this.__data__;if(u instanceof Si){var f=u.__data__;if(!Qo||f.length<a-1)return f.push([i,o]),this.size=++u.size,this;u=this.__data__=new Ni(f)}return u.set(i,o),this.size=u.size,this}qr.prototype.clear=BS,qr.prototype.delete=WS,qr.prototype.get=HS,qr.prototype.has=qS,qr.prototype.set=VS;function U0(i,o){var u=Te(i),f=!u&&Qa(i),v=!u&&!f&&ia(i),k=!u&&!f&&!v&&Ws(i),P=u||f||v||k,O=P?Bp(i.length,nS):[],L=O.length;for(var q in i)(o||Je.call(i,q))&&!(P&&(q=="length"||v&&(q=="offset"||q=="parent")||k&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||Ai(q,L)))&&O.push(q);return O}function B0(i){var o=i.length;return o?i[sf(0,o-1)]:n}function GS(i,o){return vu(Bn(i),qa(o,0,i.length))}function KS(i){return vu(Bn(i))}function Qp(i,o,u){(u!==n&&!Vr(i[o],u)||u===n&&!(o in i))&&ki(i,o,u)}function Zo(i,o,u){var f=i[o];(!(Je.call(i,o)&&Vr(f,u))||u===n&&!(o in i))&&ki(i,o,u)}function au(i,o){for(var u=i.length;u--;)if(Vr(i[u][0],o))return u;return-1}function QS(i,o,u,f){return ea(i,function(v,k,P){o(f,v,u(v),P)}),f}function W0(i,o){return i&&ci(o,nn(o),i)}function XS(i,o){return i&&ci(o,Hn(o),i)}function ki(i,o,u){o=="__proto__"&&Zc?Zc(i,o,{configurable:!0,enumerable:!0,value:u,writable:!0}):i[o]=u}function Xp(i,o){for(var u=-1,f=o.length,v=$(f),k=i==null;++u<f;)v[u]=k?n:Tf(i,o[u]);return v}function qa(i,o,u){return i===i&&(u!==n&&(i=i<=u?i:u),o!==n&&(i=i>=o?i:o)),i}function Cr(i,o,u,f,v,k){var P,O=o&g,L=o&x,q=o&j;if(u&&(P=v?u(i,f,v,k):u(i)),P!==n)return P;if(!Et(i))return i;var V=Te(i);if(V){if(P=FN(i),!O)return Bn(i,P)}else{var Z=gn(i),se=Z==Ve||Z==pn;if(ia(i))return fx(i,O);if(Z==jt||Z==K||se&&!v){if(P=L||se?{}:Ox(i),!O)return L?CN(i,XS(P,i)):kN(i,W0(P,i))}else{if(!it[Z])return v?i:{};P=zN(i,Z,O)}}k||(k=new qr);var ge=k.get(i);if(ge)return ge;k.set(i,P),ov(i)?i.forEach(function(Ne){P.add(Cr(Ne,o,u,Ne,i,k))}):av(i)&&i.forEach(function(Ne,ze){P.set(ze,Cr(Ne,o,u,ze,i,k))});var Se=q?L?xf:gf:L?Hn:nn,Le=V?n:Se(i);return Sr(Le||i,function(Ne,ze){Le&&(ze=Ne,Ne=i[ze]),Zo(P,ze,Cr(Ne,o,u,ze,i,k))}),P}function YS(i){var o=nn(i);return function(u){return H0(u,i,o)}}function H0(i,o,u){var f=u.length;if(i==null)return!f;for(i=ut(i);f--;){var v=u[f],k=o[v],P=i[v];if(P===n&&!(v in i)||!k(P))return!1}return!0}function q0(i,o,u){if(typeof i!="function")throw new Nr(c);return sl(function(){i.apply(n,u)},o)}function el(i,o,u,f){var v=-1,k=Bc,P=!0,O=i.length,L=[],q=o.length;if(!O)return L;u&&(o=kt(o,lr(u))),f?(k=Lp,P=!1):o.length>=a&&(k=Go,P=!1,o=new Ha(o));e:for(;++v<O;){var V=i[v],Z=u==null?V:u(V);if(V=f||V!==0?V:0,P&&Z===Z){for(var se=q;se--;)if(o[se]===Z)continue e;L.push(V)}else k(o,Z,f)||L.push(V)}return L}var ea=vx(li),V0=vx(Jp,!0);function JS(i,o){var u=!0;return ea(i,function(f,v,k){return u=!!o(f,v,k),u}),u}function su(i,o,u){for(var f=-1,v=i.length;++f<v;){var k=i[f],P=o(k);if(P!=null&&(O===n?P===P&&!ur(P):u(P,O)))var O=P,L=k}return L}function ZS(i,o,u,f){var v=i.length;for(u=Ie(u),u<0&&(u=-u>v?0:v+u),f=f===n||f>v?v:Ie(f),f<0&&(f+=v),f=u>f?0:cv(f);u<f;)i[u++]=o;return i}function G0(i,o){var u=[];return ea(i,function(f,v,k){o(f,v,k)&&u.push(f)}),u}function ln(i,o,u,f,v){var k=-1,P=i.length;for(u||(u=UN),v||(v=[]);++k<P;){var O=i[k];o>0&&u(O)?o>1?ln(O,o-1,u,f,v):Yi(v,O):f||(v[v.length]=O)}return v}var Yp=yx(),K0=yx(!0);function li(i,o){return i&&Yp(i,o,nn)}function Jp(i,o){return i&&K0(i,o,nn)}function ou(i,o){return Xi(o,function(u){return Pi(i[u])})}function Va(i,o){o=na(o,i);for(var u=0,f=o.length;i!=null&&u<f;)i=i[ui(o[u++])];return u&&u==f?i:n}function Q0(i,o,u){var f=o(i);return Te(i)?f:Yi(f,u(i))}function Tn(i){return i==null?i===n?ie:nr:Ba&&Ba in ut(i)?MN(i):KN(i)}function Zp(i,o){return i>o}function eN(i,o){return i!=null&&Je.call(i,o)}function tN(i,o){return i!=null&&o in ut(i)}function nN(i,o,u){return i>=hn(o,u)&&i<Kt(o,u)}function ef(i,o,u){for(var f=u?Lp:Bc,v=i[0].length,k=i.length,P=k,O=$(k),L=1/0,q=[];P--;){var V=i[P];P&&o&&(V=kt(V,lr(o))),L=hn(V.length,L),O[P]=!u&&(o||v>=120&&V.length>=120)?new Ha(P&&V):n}V=i[0];var Z=-1,se=O[0];e:for(;++Z<v&&q.length<L;){var ge=V[Z],Se=o?o(ge):ge;if(ge=u||ge!==0?ge:0,!(se?Go(se,Se):f(q,Se,u))){for(P=k;--P;){var Le=O[P];if(!(Le?Go(Le,Se):f(i[P],Se,u)))continue e}se&&se.push(Se),q.push(ge)}}return q}function rN(i,o,u,f){return li(i,function(v,k,P){o(f,u(v),k,P)}),f}function tl(i,o,u){o=na(o,i),i=Lx(i,o);var f=i==null?i:i[ui(Ar(o))];return f==null?n:tn(f,i,u)}function X0(i){return Rt(i)&&Tn(i)==K}function iN(i){return Rt(i)&&Tn(i)==Ge}function aN(i){return Rt(i)&&Tn(i)==Y}function nl(i,o,u,f,v){return i===o?!0:i==null||o==null||!Rt(i)&&!Rt(o)?i!==i&&o!==o:sN(i,o,u,f,nl,v)}function sN(i,o,u,f,v,k){var P=Te(i),O=Te(o),L=P?je:gn(i),q=O?je:gn(o);L=L==K?jt:L,q=q==K?jt:q;var V=L==jt,Z=q==jt,se=L==q;if(se&&ia(i)){if(!ia(o))return!1;P=!0,V=!1}if(se&&!V)return k||(k=new qr),P||Ws(i)?Ax(i,o,u,f,v,k):RN(i,o,L,u,f,v,k);if(!(u&b)){var ge=V&&Je.call(i,"__wrapped__"),Se=Z&&Je.call(o,"__wrapped__");if(ge||Se){var Le=ge?i.value():i,Ne=Se?o.value():o;return k||(k=new qr),v(Le,Ne,u,f,k)}}return se?(k||(k=new qr),IN(i,o,u,f,v,k)):!1}function oN(i){return Rt(i)&&gn(i)==Ye}function tf(i,o,u,f){var v=u.length,k=v,P=!f;if(i==null)return!k;for(i=ut(i);v--;){var O=u[v];if(P&&O[2]?O[1]!==i[O[0]]:!(O[0]in i))return!1}for(;++v<k;){O=u[v];var L=O[0],q=i[L],V=O[1];if(P&&O[2]){if(q===n&&!(L in i))return!1}else{var Z=new qr;if(f)var se=f(q,V,L,i,o,Z);if(!(se===n?nl(V,q,b|_,f,Z):se))return!1}}return!0}function Y0(i){if(!Et(i)||WN(i))return!1;var o=Pi(i)?oS:xt;return o.test(Ka(i))}function lN(i){return Rt(i)&&Tn(i)==Zt}function cN(i){return Rt(i)&&gn(i)==Lt}function uN(i){return Rt(i)&&Su(i.length)&&!!ot[Tn(i)]}function J0(i){return typeof i=="function"?i:i==null?qn:typeof i=="object"?Te(i)?tx(i[0],i[1]):ex(i):bv(i)}function nf(i){if(!al(i))return fS(i);var o=[];for(var u in ut(i))Je.call(i,u)&&u!="constructor"&&o.push(u);return o}function dN(i){if(!Et(i))return GN(i);var o=al(i),u=[];for(var f in i)f=="constructor"&&(o||!Je.call(i,f))||u.push(f);return u}function rf(i,o){return i<o}function Z0(i,o){var u=-1,f=Wn(i)?$(i.length):[];return ea(i,function(v,k,P){f[++u]=o(v,k,P)}),f}function ex(i){var o=yf(i);return o.length==1&&o[0][2]?Ix(o[0][0],o[0][1]):function(u){return u===i||tf(u,i,o)}}function tx(i,o){return wf(i)&&Rx(o)?Ix(ui(i),o):function(u){var f=Tf(u,i);return f===n&&f===o?Of(u,i):nl(o,f,b|_)}}function lu(i,o,u,f,v){i!==o&&Yp(o,function(k,P){if(v||(v=new qr),Et(k))pN(i,o,P,u,lu,f,v);else{var O=f?f(jf(i,P),k,P+"",i,o,v):n;O===n&&(O=k),Qp(i,P,O)}},Hn)}function pN(i,o,u,f,v,k,P){var O=jf(i,u),L=jf(o,u),q=P.get(L);if(q){Qp(i,u,q);return}var V=k?k(O,L,u+"",i,o,P):n,Z=V===n;if(Z){var se=Te(L),ge=!se&&ia(L),Se=!se&&!ge&&Ws(L);V=L,se||ge||Se?Te(O)?V=O:zt(O)?V=Bn(O):ge?(Z=!1,V=fx(L,!0)):Se?(Z=!1,V=mx(L,!0)):V=[]:ol(L)||Qa(L)?(V=O,Qa(O)?V=uv(O):(!Et(O)||Pi(O))&&(V=Ox(L))):Z=!1}Z&&(P.set(L,V),v(V,L,f,k,P),P.delete(L)),Qp(i,u,V)}function nx(i,o){var u=i.length;if(u)return o+=o<0?u:0,Ai(o,u)?i[o]:n}function rx(i,o,u){o.length?o=kt(o,function(k){return Te(k)?function(P){return Va(P,k.length===1?k[0]:k)}:k}):o=[qn];var f=-1;o=kt(o,lr(_e()));var v=Z0(i,function(k,P,O){var L=kt(o,function(q){return q(k)});return{criteria:L,index:++f,value:k}});return z2(v,function(k,P){return NN(k,P,u)})}function fN(i,o){return ix(i,o,function(u,f){return Of(i,f)})}function ix(i,o,u){for(var f=-1,v=o.length,k={};++f<v;){var P=o[f],O=Va(i,P);u(O,P)&&rl(k,na(P,i),O)}return k}function mN(i){return function(o){return Va(o,i)}}function af(i,o,u,f){var v=f?F2:Os,k=-1,P=o.length,O=i;for(i===o&&(o=Bn(o)),u&&(O=kt(i,lr(u)));++k<P;)for(var L=0,q=o[k],V=u?u(q):q;(L=v(O,V,L,f))>-1;)O!==i&&Jc.call(O,L,1),Jc.call(i,L,1);return i}function ax(i,o){for(var u=i?o.length:0,f=u-1;u--;){var v=o[u];if(u==f||v!==k){var k=v;Ai(v)?Jc.call(i,v,1):cf(i,v)}}return i}function sf(i,o){return i+tu(z0()*(o-i+1))}function hN(i,o,u,f){for(var v=-1,k=Kt(eu((o-i)/(u||1)),0),P=$(k);k--;)P[f?k:++v]=i,i+=u;return P}function of(i,o){var u="";if(!i||o<1||o>G)return u;do o%2&&(u+=i),o=tu(o/2),o&&(i+=i);while(o);return u}function De(i,o){return Sf(Mx(i,o,qn),i+"")}function gN(i){return B0(Hs(i))}function xN(i,o){var u=Hs(i);return vu(u,qa(o,0,u.length))}function rl(i,o,u,f){if(!Et(i))return i;o=na(o,i);for(var v=-1,k=o.length,P=k-1,O=i;O!=null&&++v<k;){var L=ui(o[v]),q=u;if(L==="__proto__"||L==="constructor"||L==="prototype")return i;if(v!=P){var V=O[L];q=f?f(V,L,O):n,q===n&&(q=Et(V)?V:Ai(o[v+1])?[]:{})}Zo(O,L,q),O=O[L]}return i}var sx=nu?function(i,o){return nu.set(i,o),i}:qn,vN=Zc?function(i,o){return Zc(i,"toString",{configurable:!0,enumerable:!1,value:If(o),writable:!0})}:qn;function yN(i){return vu(Hs(i))}function Er(i,o,u){var f=-1,v=i.length;o<0&&(o=-o>v?0:v+o),u=u>v?v:u,u<0&&(u+=v),v=o>u?0:u-o>>>0,o>>>=0;for(var k=$(v);++f<v;)k[f]=i[f+o];return k}function bN(i,o){var u;return ea(i,function(f,v,k){return u=o(f,v,k),!u}),!!u}function cu(i,o,u){var f=0,v=i==null?f:i.length;if(typeof o=="number"&&o===o&&v<=gt){for(;f<v;){var k=f+v>>>1,P=i[k];P!==null&&!ur(P)&&(u?P<=o:P<o)?f=k+1:v=k}return v}return lf(i,o,qn,u)}function lf(i,o,u,f){var v=0,k=i==null?0:i.length;if(k===0)return 0;o=u(o);for(var P=o!==o,O=o===null,L=ur(o),q=o===n;v<k;){var V=tu((v+k)/2),Z=u(i[V]),se=Z!==n,ge=Z===null,Se=Z===Z,Le=ur(Z);if(P)var Ne=f||Se;else q?Ne=Se&&(f||se):O?Ne=Se&&se&&(f||!ge):L?Ne=Se&&se&&!ge&&(f||!Le):ge||Le?Ne=!1:Ne=f?Z<=o:Z<o;Ne?v=V+1:k=V}return hn(k,Re)}function ox(i,o){for(var u=-1,f=i.length,v=0,k=[];++u<f;){var P=i[u],O=o?o(P):P;if(!u||!Vr(O,L)){var L=O;k[v++]=P===0?0:P}}return k}function lx(i){return typeof i=="number"?i:ur(i)?ne:+i}function cr(i){if(typeof i=="string")return i;if(Te(i))return kt(i,cr)+"";if(ur(i))return $0?$0.call(i):"";var o=i+"";return o=="0"&&1/i==-le?"-0":o}function ta(i,o,u){var f=-1,v=Bc,k=i.length,P=!0,O=[],L=O;if(u)P=!1,v=Lp;else if(k>=a){var q=o?null:TN(i);if(q)return Hc(q);P=!1,v=Go,L=new Ha}else L=o?[]:O;e:for(;++f<k;){var V=i[f],Z=o?o(V):V;if(V=u||V!==0?V:0,P&&Z===Z){for(var se=L.length;se--;)if(L[se]===Z)continue e;o&&L.push(Z),O.push(V)}else v(L,Z,u)||(L!==O&&L.push(Z),O.push(V))}return O}function cf(i,o){return o=na(o,i),i=Lx(i,o),i==null||delete i[ui(Ar(o))]}function cx(i,o,u,f){return rl(i,o,u(Va(i,o)),f)}function uu(i,o,u,f){for(var v=i.length,k=f?v:-1;(f?k--:++k<v)&&o(i[k],k,i););return u?Er(i,f?0:k,f?k+1:v):Er(i,f?k+1:0,f?v:k)}function ux(i,o){var u=i;return u instanceof Ue&&(u=u.value()),Dp(o,function(f,v){return v.func.apply(v.thisArg,Yi([f],v.args))},u)}function uf(i,o,u){var f=i.length;if(f<2)return f?ta(i[0]):[];for(var v=-1,k=$(f);++v<f;)for(var P=i[v],O=-1;++O<f;)O!=v&&(k[v]=el(k[v]||P,i[O],o,u));return ta(ln(k,1),o,u)}function dx(i,o,u){for(var f=-1,v=i.length,k=o.length,P={};++f<v;){var O=f<k?o[f]:n;u(P,i[f],O)}return P}function df(i){return zt(i)?i:[]}function pf(i){return typeof i=="function"?i:qn}function na(i,o){return Te(i)?i:wf(i,o)?[i]:$x(Xe(i))}var wN=De;function ra(i,o,u){var f=i.length;return u=u===n?f:u,!o&&u>=f?i:Er(i,o,u)}var px=lS||function(i){return We.clearTimeout(i)};function fx(i,o){if(o)return i.slice();var u=i.length,f=I0?I0(u):new i.constructor(u);return i.copy(f),f}function ff(i){var o=new i.constructor(i.byteLength);return new Xc(o).set(new Xc(i)),o}function _N(i,o){var u=o?ff(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function jN(i){var o=new i.constructor(i.source,En.exec(i));return o.lastIndex=i.lastIndex,o}function SN(i){return Jo?ut(Jo.call(i)):{}}function mx(i,o){var u=o?ff(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function hx(i,o){if(i!==o){var u=i!==n,f=i===null,v=i===i,k=ur(i),P=o!==n,O=o===null,L=o===o,q=ur(o);if(!O&&!q&&!k&&i>o||k&&P&&L&&!O&&!q||f&&P&&L||!u&&L||!v)return 1;if(!f&&!k&&!q&&i<o||q&&u&&v&&!f&&!k||O&&u&&v||!P&&v||!L)return-1}return 0}function NN(i,o,u){for(var f=-1,v=i.criteria,k=o.criteria,P=v.length,O=u.length;++f<P;){var L=hx(v[f],k[f]);if(L){if(f>=O)return L;var q=u[f];return L*(q=="desc"?-1:1)}}return i.index-o.index}function gx(i,o,u,f){for(var v=-1,k=i.length,P=u.length,O=-1,L=o.length,q=Kt(k-P,0),V=$(L+q),Z=!f;++O<L;)V[O]=o[O];for(;++v<P;)(Z||v<k)&&(V[u[v]]=i[v]);for(;q--;)V[O++]=i[v++];return V}function xx(i,o,u,f){for(var v=-1,k=i.length,P=-1,O=u.length,L=-1,q=o.length,V=Kt(k-O,0),Z=$(V+q),se=!f;++v<V;)Z[v]=i[v];for(var ge=v;++L<q;)Z[ge+L]=o[L];for(;++P<O;)(se||v<k)&&(Z[ge+u[P]]=i[v++]);return Z}function Bn(i,o){var u=-1,f=i.length;for(o||(o=$(f));++u<f;)o[u]=i[u];return o}function ci(i,o,u,f){var v=!u;u||(u={});for(var k=-1,P=o.length;++k<P;){var O=o[k],L=f?f(u[O],i[O],O,u,i):n;L===n&&(L=i[O]),v?ki(u,O,L):Zo(u,O,L)}return u}function kN(i,o){return ci(i,bf(i),o)}function CN(i,o){return ci(i,Px(i),o)}function du(i,o){return function(u,f){var v=Te(u)?O2:QS,k=o?o():{};return v(u,i,_e(f,2),k)}}function $s(i){return De(function(o,u){var f=-1,v=u.length,k=v>1?u[v-1]:n,P=v>2?u[2]:n;for(k=i.length>3&&typeof k=="function"?(v--,k):n,P&&On(u[0],u[1],P)&&(k=v<3?n:k,v=1),o=ut(o);++f<v;){var O=u[f];O&&i(o,O,f,k)}return o})}function vx(i,o){return function(u,f){if(u==null)return u;if(!Wn(u))return i(u,f);for(var v=u.length,k=o?v:-1,P=ut(u);(o?k--:++k<v)&&f(P[k],k,P)!==!1;);return u}}function yx(i){return function(o,u,f){for(var v=-1,k=ut(o),P=f(o),O=P.length;O--;){var L=P[i?O:++v];if(u(k[L],L,k)===!1)break}return o}}function EN(i,o,u){var f=o&N,v=il(i);function k(){var P=this&&this!==We&&this instanceof k?v:i;return P.apply(f?u:this,arguments)}return k}function bx(i){return function(o){o=Xe(o);var u=Rs(o)?Hr(o):n,f=u?u[0]:o.charAt(0),v=u?ra(u,1).join(""):o.slice(1);return f[i]()+v}}function Us(i){return function(o){return Dp(vv(xv(o).replace(qo,"")),i,"")}}function il(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var u=zs(i.prototype),f=i.apply(u,o);return Et(f)?f:u}}function AN(i,o,u){var f=il(i);function v(){for(var k=arguments.length,P=$(k),O=k,L=Bs(v);O--;)P[O]=arguments[O];var q=k<3&&P[0]!==L&&P[k-1]!==L?[]:Ji(P,L);if(k-=q.length,k<u)return Nx(i,o,pu,v.placeholder,n,P,q,n,n,u-k);var V=this&&this!==We&&this instanceof v?f:i;return tn(V,this,P)}return v}function wx(i){return function(o,u,f){var v=ut(o);if(!Wn(o)){var k=_e(u,3);o=nn(o),u=function(O){return k(v[O],O,v)}}var P=i(o,u,f);return P>-1?v[k?o[P]:P]:n}}function _x(i){return Ei(function(o){var u=o.length,f=u,v=kr.prototype.thru;for(i&&o.reverse();f--;){var k=o[f];if(typeof k!="function")throw new Nr(c);if(v&&!P&&gu(k)=="wrapper")var P=new kr([],!0)}for(f=P?f:u;++f<u;){k=o[f];var O=gu(k),L=O=="wrapper"?vf(k):n;L&&_f(L[0])&&L[1]==(F|C|D|z)&&!L[4].length&&L[9]==1?P=P[gu(L[0])].apply(P,L[3]):P=k.length==1&&_f(k)?P[O]():P.thru(k)}return function(){var q=arguments,V=q[0];if(P&&q.length==1&&Te(V))return P.plant(V).value();for(var Z=0,se=u?o[Z].apply(this,q):V;++Z<u;)se=o[Z].call(this,se);return se}})}function pu(i,o,u,f,v,k,P,O,L,q){var V=o&F,Z=o&N,se=o&y,ge=o&(C|R),Se=o&B,Le=se?n:il(i);function Ne(){for(var ze=arguments.length,He=$(ze),dr=ze;dr--;)He[dr]=arguments[dr];if(ge)var Rn=Bs(Ne),pr=U2(He,Rn);if(f&&(He=gx(He,f,v,ge)),k&&(He=xx(He,k,P,ge)),ze-=pr,ge&&ze<q){var $t=Ji(He,Rn);return Nx(i,o,pu,Ne.placeholder,u,He,$t,O,L,q-ze)}var Gr=Z?u:this,Oi=se?Gr[i]:i;return ze=He.length,O?He=QN(He,O):Se&&ze>1&&He.reverse(),V&&L<ze&&(He.length=L),this&&this!==We&&this instanceof Ne&&(Oi=Le||il(Oi)),Oi.apply(Gr,He)}return Ne}function jx(i,o){return function(u,f){return rN(u,i,o(f),{})}}function fu(i,o){return function(u,f){var v;if(u===n&&f===n)return o;if(u!==n&&(v=u),f!==n){if(v===n)return f;typeof u=="string"||typeof f=="string"?(u=cr(u),f=cr(f)):(u=lx(u),f=lx(f)),v=i(u,f)}return v}}function mf(i){return Ei(function(o){return o=kt(o,lr(_e())),De(function(u){var f=this;return i(o,function(v){return tn(v,f,u)})})})}function mu(i,o){o=o===n?" ":cr(o);var u=o.length;if(u<2)return u?of(o,i):o;var f=of(o,eu(i/Is(o)));return Rs(o)?ra(Hr(f),0,i).join(""):f.slice(0,i)}function PN(i,o,u,f){var v=o&N,k=il(i);function P(){for(var O=-1,L=arguments.length,q=-1,V=f.length,Z=$(V+L),se=this&&this!==We&&this instanceof P?k:i;++q<V;)Z[q]=f[q];for(;L--;)Z[q++]=arguments[++O];return tn(se,v?u:this,Z)}return P}function Sx(i){return function(o,u,f){return f&&typeof f!="number"&&On(o,u,f)&&(u=f=n),o=Ti(o),u===n?(u=o,o=0):u=Ti(u),f=f===n?o<u?1:-1:Ti(f),hN(o,u,f,i)}}function hu(i){return function(o,u){return typeof o=="string"&&typeof u=="string"||(o=Pr(o),u=Pr(u)),i(o,u)}}function Nx(i,o,u,f,v,k,P,O,L,q){var V=o&C,Z=V?P:n,se=V?n:P,ge=V?k:n,Se=V?n:k;o|=V?D:T,o&=~(V?T:D),o&w||(o&=~(N|y));var Le=[i,o,v,ge,Z,Se,se,O,L,q],Ne=u.apply(n,Le);return _f(i)&&Dx(Ne,Le),Ne.placeholder=f,Fx(Ne,i,o)}function hf(i){var o=Gt[i];return function(u,f){if(u=Pr(u),f=f==null?0:hn(Ie(f),292),f&&F0(u)){var v=(Xe(u)+"e").split("e"),k=o(v[0]+"e"+(+v[1]+f));return v=(Xe(k)+"e").split("e"),+(v[0]+"e"+(+v[1]-f))}return o(u)}}var TN=Ds&&1/Hc(new Ds([,-0]))[1]==le?function(i){return new Ds(i)}:Df;function kx(i){return function(o){var u=gn(o);return u==Ye?Hp(o):u==Lt?K2(o):$2(o,i(o))}}function Ci(i,o,u,f,v,k,P,O){var L=o&y;if(!L&&typeof i!="function")throw new Nr(c);var q=f?f.length:0;if(q||(o&=~(D|T),f=v=n),P=P===n?P:Kt(Ie(P),0),O=O===n?O:Ie(O),q-=v?v.length:0,o&T){var V=f,Z=v;f=v=n}var se=L?n:vf(i),ge=[i,o,u,f,v,V,Z,k,P,O];if(se&&VN(ge,se),i=ge[0],o=ge[1],u=ge[2],f=ge[3],v=ge[4],O=ge[9]=ge[9]===n?L?0:i.length:Kt(ge[9]-q,0),!O&&o&(C|R)&&(o&=~(C|R)),!o||o==N)var Se=EN(i,o,u);else o==C||o==R?Se=AN(i,o,O):(o==D||o==(N|D))&&!v.length?Se=PN(i,o,u,f):Se=pu.apply(n,ge);var Le=se?sx:Dx;return Fx(Le(Se,ge),i,o)}function Cx(i,o,u,f){return i===n||Vr(i,Ls[u])&&!Je.call(f,u)?o:i}function Ex(i,o,u,f,v,k){return Et(i)&&Et(o)&&(k.set(o,i),lu(i,o,n,Ex,k),k.delete(o)),i}function ON(i){return ol(i)?n:i}function Ax(i,o,u,f,v,k){var P=u&b,O=i.length,L=o.length;if(O!=L&&!(P&&L>O))return!1;var q=k.get(i),V=k.get(o);if(q&&V)return q==o&&V==i;var Z=-1,se=!0,ge=u&_?new Ha:n;for(k.set(i,o),k.set(o,i);++Z<O;){var Se=i[Z],Le=o[Z];if(f)var Ne=P?f(Le,Se,Z,o,i,k):f(Se,Le,Z,i,o,k);if(Ne!==n){if(Ne)continue;se=!1;break}if(ge){if(!Fp(o,function(ze,He){if(!Go(ge,He)&&(Se===ze||v(Se,ze,u,f,k)))return ge.push(He)})){se=!1;break}}else if(!(Se===Le||v(Se,Le,u,f,k))){se=!1;break}}return k.delete(i),k.delete(o),se}function RN(i,o,u,f,v,k,P){switch(u){case st:if(i.byteLength!=o.byteLength||i.byteOffset!=o.byteOffset)return!1;i=i.buffer,o=o.buffer;case Ge:return!(i.byteLength!=o.byteLength||!k(new Xc(i),new Xc(o)));case ke:case Y:case Sn:return Vr(+i,+o);case ve:return i.name==o.name&&i.message==o.message;case Zt:case Nn:return i==o+"";case Ye:var O=Hp;case Lt:var L=f&b;if(O||(O=Hc),i.size!=o.size&&!L)return!1;var q=P.get(i);if(q)return q==o;f|=_,P.set(i,o);var V=Ax(O(i),O(o),f,v,k,P);return P.delete(i),V;case Fn:if(Jo)return Jo.call(i)==Jo.call(o)}return!1}function IN(i,o,u,f,v,k){var P=u&b,O=gf(i),L=O.length,q=gf(o),V=q.length;if(L!=V&&!P)return!1;for(var Z=L;Z--;){var se=O[Z];if(!(P?se in o:Je.call(o,se)))return!1}var ge=k.get(i),Se=k.get(o);if(ge&&Se)return ge==o&&Se==i;var Le=!0;k.set(i,o),k.set(o,i);for(var Ne=P;++Z<L;){se=O[Z];var ze=i[se],He=o[se];if(f)var dr=P?f(He,ze,se,o,i,k):f(ze,He,se,i,o,k);if(!(dr===n?ze===He||v(ze,He,u,f,k):dr)){Le=!1;break}Ne||(Ne=se=="constructor")}if(Le&&!Ne){var Rn=i.constructor,pr=o.constructor;Rn!=pr&&"constructor"in i&&"constructor"in o&&!(typeof Rn=="function"&&Rn instanceof Rn&&typeof pr=="function"&&pr instanceof pr)&&(Le=!1)}return k.delete(i),k.delete(o),Le}function Ei(i){return Sf(Mx(i,n,Hx),i+"")}function gf(i){return Q0(i,nn,bf)}function xf(i){return Q0(i,Hn,Px)}var vf=nu?function(i){return nu.get(i)}:Df;function gu(i){for(var o=i.name+"",u=Fs[o],f=Je.call(Fs,o)?u.length:0;f--;){var v=u[f],k=v.func;if(k==null||k==i)return v.name}return o}function Bs(i){var o=Je.call(S,"placeholder")?S:i;return o.placeholder}function _e(){var i=S.iteratee||Mf;return i=i===Mf?J0:i,arguments.length?i(arguments[0],arguments[1]):i}function xu(i,o){var u=i.__data__;return BN(o)?u[typeof o=="string"?"string":"hash"]:u.map}function yf(i){for(var o=nn(i),u=o.length;u--;){var f=o[u],v=i[f];o[u]=[f,v,Rx(v)]}return o}function Ga(i,o){var u=q2(i,o);return Y0(u)?u:n}function MN(i){var o=Je.call(i,Ba),u=i[Ba];try{i[Ba]=n;var f=!0}catch{}var v=Kc.call(i);return f&&(o?i[Ba]=u:delete i[Ba]),v}var bf=Vp?function(i){return i==null?[]:(i=ut(i),Xi(Vp(i),function(o){return L0.call(i,o)}))}:Ff,Px=Vp?function(i){for(var o=[];i;)Yi(o,bf(i)),i=Yc(i);return o}:Ff,gn=Tn;(Gp&&gn(new Gp(new ArrayBuffer(1)))!=st||Qo&&gn(new Qo)!=Ye||Kp&&gn(Kp.resolve())!=on||Ds&&gn(new Ds)!=Lt||Xo&&gn(new Xo)!=xe)&&(gn=function(i){var o=Tn(i),u=o==jt?i.constructor:n,f=u?Ka(u):"";if(f)switch(f){case xS:return st;case vS:return Ye;case yS:return on;case bS:return Lt;case wS:return xe}return o});function LN(i,o,u){for(var f=-1,v=u.length;++f<v;){var k=u[f],P=k.size;switch(k.type){case"drop":i+=P;break;case"dropRight":o-=P;break;case"take":o=hn(o,i+P);break;case"takeRight":i=Kt(i,o-P);break}}return{start:i,end:o}}function DN(i){var o=i.match(_r);return o?o[1].split(ws):[]}function Tx(i,o,u){o=na(o,i);for(var f=-1,v=o.length,k=!1;++f<v;){var P=ui(o[f]);if(!(k=i!=null&&u(i,P)))break;i=i[P]}return k||++f!=v?k:(v=i==null?0:i.length,!!v&&Su(v)&&Ai(P,v)&&(Te(i)||Qa(i)))}function FN(i){var o=i.length,u=new i.constructor(o);return o&&typeof i[0]=="string"&&Je.call(i,"index")&&(u.index=i.index,u.input=i.input),u}function Ox(i){return typeof i.constructor=="function"&&!al(i)?zs(Yc(i)):{}}function zN(i,o,u){var f=i.constructor;switch(o){case Ge:return ff(i);case ke:case Y:return new f(+i);case st:return _N(i,u);case kn:case Nt:case rr:case ir:case br:case zn:case Cn:case ar:case sr:return mx(i,u);case Ye:return new f;case Sn:case Nn:return new f(i);case Zt:return jN(i);case Lt:return new f;case Fn:return SN(i)}}function $N(i,o){var u=o.length;if(!u)return i;var f=u-1;return o[f]=(u>1?"& ":"")+o[f],o=o.join(u>2?", ":" "),i.replace(wr,`{
|
438
|
+
*/wd.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,l="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",c="Expected a function",d="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",m=500,h="__lodash_placeholder__",g=1,x=2,j=4,b=1,_=2,N=1,y=2,w=4,C=8,R=16,D=32,T=64,F=128,z=256,B=512,W=30,pe="...",oe=800,we=16,be=1,J=2,ee=3,le=1/0,G=9007199254740991,re=17976931348623157e292,ne=NaN,me=4294967295,Re=me-1,gt=me>>>1,tt=[["ary",F],["bind",N],["bindKey",y],["curry",C],["curryRight",R],["flip",B],["partial",D],["partialRight",T],["rearg",z]],K="[object Arguments]",je="[object Array]",Ae="[object AsyncFunction]",ke="[object Boolean]",Y="[object Date]",fe="[object DOMException]",ve="[object Error]",Ve="[object Function]",pn="[object GeneratorFunction]",Ye="[object Map]",Sn="[object Number]",nr="[object Null]",jt="[object Object]",on="[object Promise]",St="[object Proxy]",Zt="[object RegExp]",Lt="[object Set]",Nn="[object String]",Fn="[object Symbol]",ie="[object Undefined]",xe="[object WeakMap]",at="[object WeakSet]",Ge="[object ArrayBuffer]",st="[object DataView]",kn="[object Float32Array]",Nt="[object Float64Array]",rr="[object Int8Array]",ir="[object Int16Array]",br="[object Int32Array]",zn="[object Uint8Array]",Cn="[object Uint8ClampedArray]",ar="[object Uint16Array]",sr="[object Uint32Array]",ii=/\b__p \+= '';/g,Q=/\b(__p \+=) '' \+/g,ae=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ye=/&(?:amp|lt|gt|quot|#39);/g,nt=/[&<>"']/g,Ce=RegExp(ye.source),pt=RegExp(nt.source),Dt=/<%-([\s\S]+?)%>/g,ft=/<%([\s\S]+?)%>/g,en=/<%=([\s\S]+?)%>/g,Vt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,$n=/^\w*$/,Fr=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fn=/[\\^$.*+?()[\]{}|]/g,ai=RegExp(fn.source),mn=/^\s+/,zr=/\s/,wr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,_r=/\{\n\/\* \[wrapped with (.+)\] \*/,ws=/,? & /,_s=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,js=/[()=,{}\[\]\/\s]/,Ss=/\\(\\)?/g,Ns=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,En=/\w*$/,Fe=/^[-+]0x[0-9a-f]+$/i,rt=/^0b[01]+$/i,xt=/^\[object .+?Constructor\]$/,$r=/^0o[0-7]+$/i,Ur=/^(?:0|[1-9]\d*)$/,An=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Ki=/($^)/,jp=/['\n\r\u2028\u2029\\]/g,ks="\\ud800-\\udfff",Sp="\\u0300-\\u036f",Np="\\ufe20-\\ufe2f",Cs="\\u20d0-\\u20ff",jc=Sp+Np+Cs,Sc="\\u2700-\\u27bf",Br="a-z\\xdf-\\xf6\\xf8-\\xff",kp="\\xac\\xb1\\xd7\\xf7",Cp="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ep="\\u2000-\\u206f",Ap=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Nc="A-Z\\xc0-\\xd6\\xd8-\\xde",kc="\\ufe0e\\ufe0f",Da=kp+Cp+Ep+Ap,Wo="['’]",Fa="["+ks+"]",Ho="["+Da+"]",za="["+jc+"]",Cc="\\d+",Pp="["+Sc+"]",Ec="["+Br+"]",Ac="[^"+ks+Da+Cc+Sc+Br+Nc+"]",Es="\\ud83c[\\udffb-\\udfff]",Tp="(?:"+za+"|"+Es+")",Pc="[^"+ks+"]",As="(?:\\ud83c[\\udde6-\\uddff]){2}",Qi="[\\ud800-\\udbff][\\udc00-\\udfff]",or="["+Nc+"]",Tc="\\u200d",Oc="(?:"+Ec+"|"+Ac+")",si="(?:"+or+"|"+Ac+")",Rc="(?:"+Wo+"(?:d|ll|m|re|s|t|ve))?",Ic="(?:"+Wo+"(?:D|LL|M|RE|S|T|VE))?",Mc=Tp+"?",Lc="["+kc+"]?",Op="(?:"+Tc+"(?:"+[Pc,As,Qi].join("|")+")"+Lc+Mc+")*",ji="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Dc="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Fc=Lc+Mc+Op,Ps="(?:"+[Pp,As,Qi].join("|")+")"+Fc,Rp="(?:"+[Pc+za+"?",za,As,Qi,Fa].join("|")+")",qo=RegExp(Wo,"g"),Ip=RegExp(za,"g"),Ts=RegExp(Es+"(?="+Es+")|"+Rp+Fc,"g"),zc=RegExp([or+"?"+Ec+"+"+Rc+"(?="+[Ho,or,"$"].join("|")+")",si+"+"+Ic+"(?="+[Ho,or+Oc,"$"].join("|")+")",or+"?"+Oc+"+"+Rc,or+"+"+Ic,Dc,ji,Cc,Ps].join("|"),"g"),$c=RegExp("["+Tc+ks+jc+kc+"]"),$a=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Uc=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mp=-1,ot={};ot[kn]=ot[Nt]=ot[rr]=ot[ir]=ot[br]=ot[zn]=ot[Cn]=ot[ar]=ot[sr]=!0,ot[K]=ot[je]=ot[Ge]=ot[ke]=ot[st]=ot[Y]=ot[ve]=ot[Ve]=ot[Ye]=ot[Sn]=ot[jt]=ot[Zt]=ot[Lt]=ot[Nn]=ot[xe]=!1;var it={};it[K]=it[je]=it[Ge]=it[st]=it[ke]=it[Y]=it[kn]=it[Nt]=it[rr]=it[ir]=it[br]=it[Ye]=it[Sn]=it[jt]=it[Zt]=it[Lt]=it[Nn]=it[Fn]=it[zn]=it[Cn]=it[ar]=it[sr]=!0,it[ve]=it[Ve]=it[xe]=!1;var A={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},M={"&":"&","<":"<",">":">",'"':""","'":"'"},X={"&":"&","<":"<",">":">",""":'"',"'":"'"},ce={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},lt=parseFloat,Pe=parseInt,vt=typeof bn=="object"&&bn&&bn.Object===Object&&bn,Wt=typeof self=="object"&&self&&self.Object===Object&&self,We=vt||Wt||Function("return this")(),ct=t&&!t.nodeType&&t,Ft=ct&&!0&&e&&!e.nodeType&&e,Un=Ft&&Ft.exports===ct,Ht=Un&&vt.process,yt=function(){try{var I=Ft&&Ft.require&&Ft.require("util").types;return I||Ht&&Ht.binding&&Ht.binding("util")}catch{}}(),Pn=yt&&yt.isArrayBuffer,Wr=yt&&yt.isDate,jr=yt&&yt.isMap,oi=yt&&yt.isRegExp,Vo=yt&&yt.isSet,Ua=yt&&yt.isTypedArray;function tn(I,H,$){switch($.length){case 0:return I.call(H);case 1:return I.call(H,$[0]);case 2:return I.call(H,$[0],$[1]);case 3:return I.call(H,$[0],$[1],$[2])}return I.apply(H,$)}function O2(I,H,$,ue){for(var Ee=-1,Qe=I==null?0:I.length;++Ee<Qe;){var Gt=I[Ee];H(ue,Gt,$(Gt),I)}return ue}function Sr(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue&&H(I[$],$,I)!==!1;);return I}function R2(I,H){for(var $=I==null?0:I.length;$--&&H(I[$],$,I)!==!1;);return I}function j0(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue;)if(!H(I[$],$,I))return!1;return!0}function Xi(I,H){for(var $=-1,ue=I==null?0:I.length,Ee=0,Qe=[];++$<ue;){var Gt=I[$];H(Gt,$,I)&&(Qe[Ee++]=Gt)}return Qe}function Bc(I,H){var $=I==null?0:I.length;return!!$&&Os(I,H,0)>-1}function Lp(I,H,$){for(var ue=-1,Ee=I==null?0:I.length;++ue<Ee;)if($(H,I[ue]))return!0;return!1}function kt(I,H){for(var $=-1,ue=I==null?0:I.length,Ee=Array(ue);++$<ue;)Ee[$]=H(I[$],$,I);return Ee}function Yi(I,H){for(var $=-1,ue=H.length,Ee=I.length;++$<ue;)I[Ee+$]=H[$];return I}function Dp(I,H,$,ue){var Ee=-1,Qe=I==null?0:I.length;for(ue&&Qe&&($=I[++Ee]);++Ee<Qe;)$=H($,I[Ee],Ee,I);return $}function I2(I,H,$,ue){var Ee=I==null?0:I.length;for(ue&&Ee&&($=I[--Ee]);Ee--;)$=H($,I[Ee],Ee,I);return $}function Fp(I,H){for(var $=-1,ue=I==null?0:I.length;++$<ue;)if(H(I[$],$,I))return!0;return!1}var M2=zp("length");function L2(I){return I.split("")}function D2(I){return I.match(_s)||[]}function S0(I,H,$){var ue;return $(I,function(Ee,Qe,Gt){if(H(Ee,Qe,Gt))return ue=Qe,!1}),ue}function Wc(I,H,$,ue){for(var Ee=I.length,Qe=$+(ue?1:-1);ue?Qe--:++Qe<Ee;)if(H(I[Qe],Qe,I))return Qe;return-1}function Os(I,H,$){return H===H?Q2(I,H,$):Wc(I,N0,$)}function F2(I,H,$,ue){for(var Ee=$-1,Qe=I.length;++Ee<Qe;)if(ue(I[Ee],H))return Ee;return-1}function N0(I){return I!==I}function k0(I,H){var $=I==null?0:I.length;return $?Up(I,H)/$:ne}function zp(I){return function(H){return H==null?n:H[I]}}function $p(I){return function(H){return I==null?n:I[H]}}function C0(I,H,$,ue,Ee){return Ee(I,function(Qe,Gt,ut){$=ue?(ue=!1,Qe):H($,Qe,Gt,ut)}),$}function z2(I,H){var $=I.length;for(I.sort(H);$--;)I[$]=I[$].value;return I}function Up(I,H){for(var $,ue=-1,Ee=I.length;++ue<Ee;){var Qe=H(I[ue]);Qe!==n&&($=$===n?Qe:$+Qe)}return $}function Bp(I,H){for(var $=-1,ue=Array(I);++$<I;)ue[$]=H($);return ue}function $2(I,H){return kt(H,function($){return[$,I[$]]})}function E0(I){return I&&I.slice(0,O0(I)+1).replace(mn,"")}function lr(I){return function(H){return I(H)}}function Wp(I,H){return kt(H,function($){return I[$]})}function Go(I,H){return I.has(H)}function A0(I,H){for(var $=-1,ue=I.length;++$<ue&&Os(H,I[$],0)>-1;);return $}function P0(I,H){for(var $=I.length;$--&&Os(H,I[$],0)>-1;);return $}function U2(I,H){for(var $=I.length,ue=0;$--;)I[$]===H&&++ue;return ue}var B2=$p(A),W2=$p(M);function H2(I){return"\\"+ce[I]}function q2(I,H){return I==null?n:I[H]}function Rs(I){return $c.test(I)}function V2(I){return $a.test(I)}function G2(I){for(var H,$=[];!(H=I.next()).done;)$.push(H.value);return $}function Hp(I){var H=-1,$=Array(I.size);return I.forEach(function(ue,Ee){$[++H]=[Ee,ue]}),$}function T0(I,H){return function($){return I(H($))}}function Ji(I,H){for(var $=-1,ue=I.length,Ee=0,Qe=[];++$<ue;){var Gt=I[$];(Gt===H||Gt===h)&&(I[$]=h,Qe[Ee++]=$)}return Qe}function Hc(I){var H=-1,$=Array(I.size);return I.forEach(function(ue){$[++H]=ue}),$}function K2(I){var H=-1,$=Array(I.size);return I.forEach(function(ue){$[++H]=[ue,ue]}),$}function Q2(I,H,$){for(var ue=$-1,Ee=I.length;++ue<Ee;)if(I[ue]===H)return ue;return-1}function X2(I,H,$){for(var ue=$+1;ue--;)if(I[ue]===H)return ue;return ue}function Is(I){return Rs(I)?J2(I):M2(I)}function Hr(I){return Rs(I)?Z2(I):L2(I)}function O0(I){for(var H=I.length;H--&&zr.test(I.charAt(H)););return H}var Y2=$p(X);function J2(I){for(var H=Ts.lastIndex=0;Ts.test(I);)++H;return H}function Z2(I){return I.match(Ts)||[]}function eS(I){return I.match(zc)||[]}var tS=function I(H){H=H==null?We:Ms.defaults(We.Object(),H,Ms.pick(We,Uc));var $=H.Array,ue=H.Date,Ee=H.Error,Qe=H.Function,Gt=H.Math,ut=H.Object,qp=H.RegExp,nS=H.String,Nr=H.TypeError,qc=$.prototype,rS=Qe.prototype,Ls=ut.prototype,Vc=H["__core-js_shared__"],Gc=rS.toString,Je=Ls.hasOwnProperty,iS=0,R0=function(){var i=/[^.]+$/.exec(Vc&&Vc.keys&&Vc.keys.IE_PROTO||"");return i?"Symbol(src)_1."+i:""}(),Kc=Ls.toString,aS=Gc.call(ut),sS=We._,oS=qp("^"+Gc.call(Je).replace(fn,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Qc=Un?H.Buffer:n,Zi=H.Symbol,Xc=H.Uint8Array,I0=Qc?Qc.allocUnsafe:n,Yc=T0(ut.getPrototypeOf,ut),M0=ut.create,L0=Ls.propertyIsEnumerable,Jc=qc.splice,D0=Zi?Zi.isConcatSpreadable:n,Ko=Zi?Zi.iterator:n,Ba=Zi?Zi.toStringTag:n,Zc=function(){try{var i=Ga(ut,"defineProperty");return i({},"",{}),i}catch{}}(),lS=H.clearTimeout!==We.clearTimeout&&H.clearTimeout,cS=ue&&ue.now!==We.Date.now&&ue.now,uS=H.setTimeout!==We.setTimeout&&H.setTimeout,eu=Gt.ceil,tu=Gt.floor,Vp=ut.getOwnPropertySymbols,dS=Qc?Qc.isBuffer:n,F0=H.isFinite,pS=qc.join,fS=T0(ut.keys,ut),Kt=Gt.max,hn=Gt.min,mS=ue.now,hS=H.parseInt,z0=Gt.random,gS=qc.reverse,Gp=Ga(H,"DataView"),Qo=Ga(H,"Map"),Kp=Ga(H,"Promise"),Ds=Ga(H,"Set"),Xo=Ga(H,"WeakMap"),Yo=Ga(ut,"create"),nu=Xo&&new Xo,Fs={},xS=Ka(Gp),vS=Ka(Qo),yS=Ka(Kp),bS=Ka(Ds),wS=Ka(Xo),ru=Zi?Zi.prototype:n,Jo=ru?ru.valueOf:n,$0=ru?ru.toString:n;function S(i){if(Rt(i)&&!Te(i)&&!(i instanceof Ue)){if(i instanceof kr)return i;if(Je.call(i,"__wrapped__"))return Ux(i)}return new kr(i)}var zs=function(){function i(){}return function(o){if(!Et(o))return{};if(M0)return M0(o);i.prototype=o;var u=new i;return i.prototype=n,u}}();function iu(){}function kr(i,o){this.__wrapped__=i,this.__actions__=[],this.__chain__=!!o,this.__index__=0,this.__values__=n}S.templateSettings={escape:Dt,evaluate:ft,interpolate:en,variable:"",imports:{_:S}},S.prototype=iu.prototype,S.prototype.constructor=S,kr.prototype=zs(iu.prototype),kr.prototype.constructor=kr;function Ue(i){this.__wrapped__=i,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=me,this.__views__=[]}function _S(){var i=new Ue(this.__wrapped__);return i.__actions__=Bn(this.__actions__),i.__dir__=this.__dir__,i.__filtered__=this.__filtered__,i.__iteratees__=Bn(this.__iteratees__),i.__takeCount__=this.__takeCount__,i.__views__=Bn(this.__views__),i}function jS(){if(this.__filtered__){var i=new Ue(this);i.__dir__=-1,i.__filtered__=!0}else i=this.clone(),i.__dir__*=-1;return i}function SS(){var i=this.__wrapped__.value(),o=this.__dir__,u=Te(i),f=o<0,v=u?i.length:0,k=LN(0,v,this.__views__),P=k.start,O=k.end,L=O-P,q=f?O:P-1,V=this.__iteratees__,Z=V.length,se=0,ge=hn(L,this.__takeCount__);if(!u||!f&&v==L&&ge==L)return ux(i,this.__actions__);var Se=[];e:for(;L--&&se<ge;){q+=o;for(var Le=-1,Ne=i[q];++Le<Z;){var ze=V[Le],He=ze.iteratee,dr=ze.type,Rn=He(Ne);if(dr==J)Ne=Rn;else if(!Rn){if(dr==be)continue e;break e}}Se[se++]=Ne}return Se}Ue.prototype=zs(iu.prototype),Ue.prototype.constructor=Ue;function Wa(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function NS(){this.__data__=Yo?Yo(null):{},this.size=0}function kS(i){var o=this.has(i)&&delete this.__data__[i];return this.size-=o?1:0,o}function CS(i){var o=this.__data__;if(Yo){var u=o[i];return u===p?n:u}return Je.call(o,i)?o[i]:n}function ES(i){var o=this.__data__;return Yo?o[i]!==n:Je.call(o,i)}function AS(i,o){var u=this.__data__;return this.size+=this.has(i)?0:1,u[i]=Yo&&o===n?p:o,this}Wa.prototype.clear=NS,Wa.prototype.delete=kS,Wa.prototype.get=CS,Wa.prototype.has=ES,Wa.prototype.set=AS;function Si(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function PS(){this.__data__=[],this.size=0}function TS(i){var o=this.__data__,u=au(o,i);if(u<0)return!1;var f=o.length-1;return u==f?o.pop():Jc.call(o,u,1),--this.size,!0}function OS(i){var o=this.__data__,u=au(o,i);return u<0?n:o[u][1]}function RS(i){return au(this.__data__,i)>-1}function IS(i,o){var u=this.__data__,f=au(u,i);return f<0?(++this.size,u.push([i,o])):u[f][1]=o,this}Si.prototype.clear=PS,Si.prototype.delete=TS,Si.prototype.get=OS,Si.prototype.has=RS,Si.prototype.set=IS;function Ni(i){var o=-1,u=i==null?0:i.length;for(this.clear();++o<u;){var f=i[o];this.set(f[0],f[1])}}function MS(){this.size=0,this.__data__={hash:new Wa,map:new(Qo||Si),string:new Wa}}function LS(i){var o=xu(this,i).delete(i);return this.size-=o?1:0,o}function DS(i){return xu(this,i).get(i)}function FS(i){return xu(this,i).has(i)}function zS(i,o){var u=xu(this,i),f=u.size;return u.set(i,o),this.size+=u.size==f?0:1,this}Ni.prototype.clear=MS,Ni.prototype.delete=LS,Ni.prototype.get=DS,Ni.prototype.has=FS,Ni.prototype.set=zS;function Ha(i){var o=-1,u=i==null?0:i.length;for(this.__data__=new Ni;++o<u;)this.add(i[o])}function $S(i){return this.__data__.set(i,p),this}function US(i){return this.__data__.has(i)}Ha.prototype.add=Ha.prototype.push=$S,Ha.prototype.has=US;function qr(i){var o=this.__data__=new Si(i);this.size=o.size}function BS(){this.__data__=new Si,this.size=0}function WS(i){var o=this.__data__,u=o.delete(i);return this.size=o.size,u}function HS(i){return this.__data__.get(i)}function qS(i){return this.__data__.has(i)}function VS(i,o){var u=this.__data__;if(u instanceof Si){var f=u.__data__;if(!Qo||f.length<a-1)return f.push([i,o]),this.size=++u.size,this;u=this.__data__=new Ni(f)}return u.set(i,o),this.size=u.size,this}qr.prototype.clear=BS,qr.prototype.delete=WS,qr.prototype.get=HS,qr.prototype.has=qS,qr.prototype.set=VS;function U0(i,o){var u=Te(i),f=!u&&Qa(i),v=!u&&!f&&ia(i),k=!u&&!f&&!v&&Ws(i),P=u||f||v||k,O=P?Bp(i.length,nS):[],L=O.length;for(var q in i)(o||Je.call(i,q))&&!(P&&(q=="length"||v&&(q=="offset"||q=="parent")||k&&(q=="buffer"||q=="byteLength"||q=="byteOffset")||Ai(q,L)))&&O.push(q);return O}function B0(i){var o=i.length;return o?i[sf(0,o-1)]:n}function GS(i,o){return vu(Bn(i),qa(o,0,i.length))}function KS(i){return vu(Bn(i))}function Qp(i,o,u){(u!==n&&!Vr(i[o],u)||u===n&&!(o in i))&&ki(i,o,u)}function Zo(i,o,u){var f=i[o];(!(Je.call(i,o)&&Vr(f,u))||u===n&&!(o in i))&&ki(i,o,u)}function au(i,o){for(var u=i.length;u--;)if(Vr(i[u][0],o))return u;return-1}function QS(i,o,u,f){return ea(i,function(v,k,P){o(f,v,u(v),P)}),f}function W0(i,o){return i&&ci(o,nn(o),i)}function XS(i,o){return i&&ci(o,Hn(o),i)}function ki(i,o,u){o=="__proto__"&&Zc?Zc(i,o,{configurable:!0,enumerable:!0,value:u,writable:!0}):i[o]=u}function Xp(i,o){for(var u=-1,f=o.length,v=$(f),k=i==null;++u<f;)v[u]=k?n:Tf(i,o[u]);return v}function qa(i,o,u){return i===i&&(u!==n&&(i=i<=u?i:u),o!==n&&(i=i>=o?i:o)),i}function Cr(i,o,u,f,v,k){var P,O=o&g,L=o&x,q=o&j;if(u&&(P=v?u(i,f,v,k):u(i)),P!==n)return P;if(!Et(i))return i;var V=Te(i);if(V){if(P=FN(i),!O)return Bn(i,P)}else{var Z=gn(i),se=Z==Ve||Z==pn;if(ia(i))return fx(i,O);if(Z==jt||Z==K||se&&!v){if(P=L||se?{}:Ox(i),!O)return L?CN(i,XS(P,i)):kN(i,W0(P,i))}else{if(!it[Z])return v?i:{};P=zN(i,Z,O)}}k||(k=new qr);var ge=k.get(i);if(ge)return ge;k.set(i,P),ov(i)?i.forEach(function(Ne){P.add(Cr(Ne,o,u,Ne,i,k))}):av(i)&&i.forEach(function(Ne,ze){P.set(ze,Cr(Ne,o,u,ze,i,k))});var Se=q?L?xf:gf:L?Hn:nn,Le=V?n:Se(i);return Sr(Le||i,function(Ne,ze){Le&&(ze=Ne,Ne=i[ze]),Zo(P,ze,Cr(Ne,o,u,ze,i,k))}),P}function YS(i){var o=nn(i);return function(u){return H0(u,i,o)}}function H0(i,o,u){var f=u.length;if(i==null)return!f;for(i=ut(i);f--;){var v=u[f],k=o[v],P=i[v];if(P===n&&!(v in i)||!k(P))return!1}return!0}function q0(i,o,u){if(typeof i!="function")throw new Nr(c);return sl(function(){i.apply(n,u)},o)}function el(i,o,u,f){var v=-1,k=Bc,P=!0,O=i.length,L=[],q=o.length;if(!O)return L;u&&(o=kt(o,lr(u))),f?(k=Lp,P=!1):o.length>=a&&(k=Go,P=!1,o=new Ha(o));e:for(;++v<O;){var V=i[v],Z=u==null?V:u(V);if(V=f||V!==0?V:0,P&&Z===Z){for(var se=q;se--;)if(o[se]===Z)continue e;L.push(V)}else k(o,Z,f)||L.push(V)}return L}var ea=vx(li),V0=vx(Jp,!0);function JS(i,o){var u=!0;return ea(i,function(f,v,k){return u=!!o(f,v,k),u}),u}function su(i,o,u){for(var f=-1,v=i.length;++f<v;){var k=i[f],P=o(k);if(P!=null&&(O===n?P===P&&!ur(P):u(P,O)))var O=P,L=k}return L}function ZS(i,o,u,f){var v=i.length;for(u=Ie(u),u<0&&(u=-u>v?0:v+u),f=f===n||f>v?v:Ie(f),f<0&&(f+=v),f=u>f?0:cv(f);u<f;)i[u++]=o;return i}function G0(i,o){var u=[];return ea(i,function(f,v,k){o(f,v,k)&&u.push(f)}),u}function ln(i,o,u,f,v){var k=-1,P=i.length;for(u||(u=UN),v||(v=[]);++k<P;){var O=i[k];o>0&&u(O)?o>1?ln(O,o-1,u,f,v):Yi(v,O):f||(v[v.length]=O)}return v}var Yp=yx(),K0=yx(!0);function li(i,o){return i&&Yp(i,o,nn)}function Jp(i,o){return i&&K0(i,o,nn)}function ou(i,o){return Xi(o,function(u){return Pi(i[u])})}function Va(i,o){o=na(o,i);for(var u=0,f=o.length;i!=null&&u<f;)i=i[ui(o[u++])];return u&&u==f?i:n}function Q0(i,o,u){var f=o(i);return Te(i)?f:Yi(f,u(i))}function Tn(i){return i==null?i===n?ie:nr:Ba&&Ba in ut(i)?MN(i):KN(i)}function Zp(i,o){return i>o}function eN(i,o){return i!=null&&Je.call(i,o)}function tN(i,o){return i!=null&&o in ut(i)}function nN(i,o,u){return i>=hn(o,u)&&i<Kt(o,u)}function ef(i,o,u){for(var f=u?Lp:Bc,v=i[0].length,k=i.length,P=k,O=$(k),L=1/0,q=[];P--;){var V=i[P];P&&o&&(V=kt(V,lr(o))),L=hn(V.length,L),O[P]=!u&&(o||v>=120&&V.length>=120)?new Ha(P&&V):n}V=i[0];var Z=-1,se=O[0];e:for(;++Z<v&&q.length<L;){var ge=V[Z],Se=o?o(ge):ge;if(ge=u||ge!==0?ge:0,!(se?Go(se,Se):f(q,Se,u))){for(P=k;--P;){var Le=O[P];if(!(Le?Go(Le,Se):f(i[P],Se,u)))continue e}se&&se.push(Se),q.push(ge)}}return q}function rN(i,o,u,f){return li(i,function(v,k,P){o(f,u(v),k,P)}),f}function tl(i,o,u){o=na(o,i),i=Lx(i,o);var f=i==null?i:i[ui(Ar(o))];return f==null?n:tn(f,i,u)}function X0(i){return Rt(i)&&Tn(i)==K}function iN(i){return Rt(i)&&Tn(i)==Ge}function aN(i){return Rt(i)&&Tn(i)==Y}function nl(i,o,u,f,v){return i===o?!0:i==null||o==null||!Rt(i)&&!Rt(o)?i!==i&&o!==o:sN(i,o,u,f,nl,v)}function sN(i,o,u,f,v,k){var P=Te(i),O=Te(o),L=P?je:gn(i),q=O?je:gn(o);L=L==K?jt:L,q=q==K?jt:q;var V=L==jt,Z=q==jt,se=L==q;if(se&&ia(i)){if(!ia(o))return!1;P=!0,V=!1}if(se&&!V)return k||(k=new qr),P||Ws(i)?Ax(i,o,u,f,v,k):RN(i,o,L,u,f,v,k);if(!(u&b)){var ge=V&&Je.call(i,"__wrapped__"),Se=Z&&Je.call(o,"__wrapped__");if(ge||Se){var Le=ge?i.value():i,Ne=Se?o.value():o;return k||(k=new qr),v(Le,Ne,u,f,k)}}return se?(k||(k=new qr),IN(i,o,u,f,v,k)):!1}function oN(i){return Rt(i)&&gn(i)==Ye}function tf(i,o,u,f){var v=u.length,k=v,P=!f;if(i==null)return!k;for(i=ut(i);v--;){var O=u[v];if(P&&O[2]?O[1]!==i[O[0]]:!(O[0]in i))return!1}for(;++v<k;){O=u[v];var L=O[0],q=i[L],V=O[1];if(P&&O[2]){if(q===n&&!(L in i))return!1}else{var Z=new qr;if(f)var se=f(q,V,L,i,o,Z);if(!(se===n?nl(V,q,b|_,f,Z):se))return!1}}return!0}function Y0(i){if(!Et(i)||WN(i))return!1;var o=Pi(i)?oS:xt;return o.test(Ka(i))}function lN(i){return Rt(i)&&Tn(i)==Zt}function cN(i){return Rt(i)&&gn(i)==Lt}function uN(i){return Rt(i)&&Su(i.length)&&!!ot[Tn(i)]}function J0(i){return typeof i=="function"?i:i==null?qn:typeof i=="object"?Te(i)?tx(i[0],i[1]):ex(i):bv(i)}function nf(i){if(!al(i))return fS(i);var o=[];for(var u in ut(i))Je.call(i,u)&&u!="constructor"&&o.push(u);return o}function dN(i){if(!Et(i))return GN(i);var o=al(i),u=[];for(var f in i)f=="constructor"&&(o||!Je.call(i,f))||u.push(f);return u}function rf(i,o){return i<o}function Z0(i,o){var u=-1,f=Wn(i)?$(i.length):[];return ea(i,function(v,k,P){f[++u]=o(v,k,P)}),f}function ex(i){var o=yf(i);return o.length==1&&o[0][2]?Ix(o[0][0],o[0][1]):function(u){return u===i||tf(u,i,o)}}function tx(i,o){return wf(i)&&Rx(o)?Ix(ui(i),o):function(u){var f=Tf(u,i);return f===n&&f===o?Of(u,i):nl(o,f,b|_)}}function lu(i,o,u,f,v){i!==o&&Yp(o,function(k,P){if(v||(v=new qr),Et(k))pN(i,o,P,u,lu,f,v);else{var O=f?f(jf(i,P),k,P+"",i,o,v):n;O===n&&(O=k),Qp(i,P,O)}},Hn)}function pN(i,o,u,f,v,k,P){var O=jf(i,u),L=jf(o,u),q=P.get(L);if(q){Qp(i,u,q);return}var V=k?k(O,L,u+"",i,o,P):n,Z=V===n;if(Z){var se=Te(L),ge=!se&&ia(L),Se=!se&&!ge&&Ws(L);V=L,se||ge||Se?Te(O)?V=O:zt(O)?V=Bn(O):ge?(Z=!1,V=fx(L,!0)):Se?(Z=!1,V=mx(L,!0)):V=[]:ol(L)||Qa(L)?(V=O,Qa(O)?V=uv(O):(!Et(O)||Pi(O))&&(V=Ox(L))):Z=!1}Z&&(P.set(L,V),v(V,L,f,k,P),P.delete(L)),Qp(i,u,V)}function nx(i,o){var u=i.length;if(u)return o+=o<0?u:0,Ai(o,u)?i[o]:n}function rx(i,o,u){o.length?o=kt(o,function(k){return Te(k)?function(P){return Va(P,k.length===1?k[0]:k)}:k}):o=[qn];var f=-1;o=kt(o,lr(_e()));var v=Z0(i,function(k,P,O){var L=kt(o,function(q){return q(k)});return{criteria:L,index:++f,value:k}});return z2(v,function(k,P){return NN(k,P,u)})}function fN(i,o){return ix(i,o,function(u,f){return Of(i,f)})}function ix(i,o,u){for(var f=-1,v=o.length,k={};++f<v;){var P=o[f],O=Va(i,P);u(O,P)&&rl(k,na(P,i),O)}return k}function mN(i){return function(o){return Va(o,i)}}function af(i,o,u,f){var v=f?F2:Os,k=-1,P=o.length,O=i;for(i===o&&(o=Bn(o)),u&&(O=kt(i,lr(u)));++k<P;)for(var L=0,q=o[k],V=u?u(q):q;(L=v(O,V,L,f))>-1;)O!==i&&Jc.call(O,L,1),Jc.call(i,L,1);return i}function ax(i,o){for(var u=i?o.length:0,f=u-1;u--;){var v=o[u];if(u==f||v!==k){var k=v;Ai(v)?Jc.call(i,v,1):cf(i,v)}}return i}function sf(i,o){return i+tu(z0()*(o-i+1))}function hN(i,o,u,f){for(var v=-1,k=Kt(eu((o-i)/(u||1)),0),P=$(k);k--;)P[f?k:++v]=i,i+=u;return P}function of(i,o){var u="";if(!i||o<1||o>G)return u;do o%2&&(u+=i),o=tu(o/2),o&&(i+=i);while(o);return u}function De(i,o){return Sf(Mx(i,o,qn),i+"")}function gN(i){return B0(Hs(i))}function xN(i,o){var u=Hs(i);return vu(u,qa(o,0,u.length))}function rl(i,o,u,f){if(!Et(i))return i;o=na(o,i);for(var v=-1,k=o.length,P=k-1,O=i;O!=null&&++v<k;){var L=ui(o[v]),q=u;if(L==="__proto__"||L==="constructor"||L==="prototype")return i;if(v!=P){var V=O[L];q=f?f(V,L,O):n,q===n&&(q=Et(V)?V:Ai(o[v+1])?[]:{})}Zo(O,L,q),O=O[L]}return i}var sx=nu?function(i,o){return nu.set(i,o),i}:qn,vN=Zc?function(i,o){return Zc(i,"toString",{configurable:!0,enumerable:!1,value:If(o),writable:!0})}:qn;function yN(i){return vu(Hs(i))}function Er(i,o,u){var f=-1,v=i.length;o<0&&(o=-o>v?0:v+o),u=u>v?v:u,u<0&&(u+=v),v=o>u?0:u-o>>>0,o>>>=0;for(var k=$(v);++f<v;)k[f]=i[f+o];return k}function bN(i,o){var u;return ea(i,function(f,v,k){return u=o(f,v,k),!u}),!!u}function cu(i,o,u){var f=0,v=i==null?f:i.length;if(typeof o=="number"&&o===o&&v<=gt){for(;f<v;){var k=f+v>>>1,P=i[k];P!==null&&!ur(P)&&(u?P<=o:P<o)?f=k+1:v=k}return v}return lf(i,o,qn,u)}function lf(i,o,u,f){var v=0,k=i==null?0:i.length;if(k===0)return 0;o=u(o);for(var P=o!==o,O=o===null,L=ur(o),q=o===n;v<k;){var V=tu((v+k)/2),Z=u(i[V]),se=Z!==n,ge=Z===null,Se=Z===Z,Le=ur(Z);if(P)var Ne=f||Se;else q?Ne=Se&&(f||se):O?Ne=Se&&se&&(f||!ge):L?Ne=Se&&se&&!ge&&(f||!Le):ge||Le?Ne=!1:Ne=f?Z<=o:Z<o;Ne?v=V+1:k=V}return hn(k,Re)}function ox(i,o){for(var u=-1,f=i.length,v=0,k=[];++u<f;){var P=i[u],O=o?o(P):P;if(!u||!Vr(O,L)){var L=O;k[v++]=P===0?0:P}}return k}function lx(i){return typeof i=="number"?i:ur(i)?ne:+i}function cr(i){if(typeof i=="string")return i;if(Te(i))return kt(i,cr)+"";if(ur(i))return $0?$0.call(i):"";var o=i+"";return o=="0"&&1/i==-le?"-0":o}function ta(i,o,u){var f=-1,v=Bc,k=i.length,P=!0,O=[],L=O;if(u)P=!1,v=Lp;else if(k>=a){var q=o?null:TN(i);if(q)return Hc(q);P=!1,v=Go,L=new Ha}else L=o?[]:O;e:for(;++f<k;){var V=i[f],Z=o?o(V):V;if(V=u||V!==0?V:0,P&&Z===Z){for(var se=L.length;se--;)if(L[se]===Z)continue e;o&&L.push(Z),O.push(V)}else v(L,Z,u)||(L!==O&&L.push(Z),O.push(V))}return O}function cf(i,o){return o=na(o,i),i=Lx(i,o),i==null||delete i[ui(Ar(o))]}function cx(i,o,u,f){return rl(i,o,u(Va(i,o)),f)}function uu(i,o,u,f){for(var v=i.length,k=f?v:-1;(f?k--:++k<v)&&o(i[k],k,i););return u?Er(i,f?0:k,f?k+1:v):Er(i,f?k+1:0,f?v:k)}function ux(i,o){var u=i;return u instanceof Ue&&(u=u.value()),Dp(o,function(f,v){return v.func.apply(v.thisArg,Yi([f],v.args))},u)}function uf(i,o,u){var f=i.length;if(f<2)return f?ta(i[0]):[];for(var v=-1,k=$(f);++v<f;)for(var P=i[v],O=-1;++O<f;)O!=v&&(k[v]=el(k[v]||P,i[O],o,u));return ta(ln(k,1),o,u)}function dx(i,o,u){for(var f=-1,v=i.length,k=o.length,P={};++f<v;){var O=f<k?o[f]:n;u(P,i[f],O)}return P}function df(i){return zt(i)?i:[]}function pf(i){return typeof i=="function"?i:qn}function na(i,o){return Te(i)?i:wf(i,o)?[i]:$x(Xe(i))}var wN=De;function ra(i,o,u){var f=i.length;return u=u===n?f:u,!o&&u>=f?i:Er(i,o,u)}var px=lS||function(i){return We.clearTimeout(i)};function fx(i,o){if(o)return i.slice();var u=i.length,f=I0?I0(u):new i.constructor(u);return i.copy(f),f}function ff(i){var o=new i.constructor(i.byteLength);return new Xc(o).set(new Xc(i)),o}function _N(i,o){var u=o?ff(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.byteLength)}function jN(i){var o=new i.constructor(i.source,En.exec(i));return o.lastIndex=i.lastIndex,o}function SN(i){return Jo?ut(Jo.call(i)):{}}function mx(i,o){var u=o?ff(i.buffer):i.buffer;return new i.constructor(u,i.byteOffset,i.length)}function hx(i,o){if(i!==o){var u=i!==n,f=i===null,v=i===i,k=ur(i),P=o!==n,O=o===null,L=o===o,q=ur(o);if(!O&&!q&&!k&&i>o||k&&P&&L&&!O&&!q||f&&P&&L||!u&&L||!v)return 1;if(!f&&!k&&!q&&i<o||q&&u&&v&&!f&&!k||O&&u&&v||!P&&v||!L)return-1}return 0}function NN(i,o,u){for(var f=-1,v=i.criteria,k=o.criteria,P=v.length,O=u.length;++f<P;){var L=hx(v[f],k[f]);if(L){if(f>=O)return L;var q=u[f];return L*(q=="desc"?-1:1)}}return i.index-o.index}function gx(i,o,u,f){for(var v=-1,k=i.length,P=u.length,O=-1,L=o.length,q=Kt(k-P,0),V=$(L+q),Z=!f;++O<L;)V[O]=o[O];for(;++v<P;)(Z||v<k)&&(V[u[v]]=i[v]);for(;q--;)V[O++]=i[v++];return V}function xx(i,o,u,f){for(var v=-1,k=i.length,P=-1,O=u.length,L=-1,q=o.length,V=Kt(k-O,0),Z=$(V+q),se=!f;++v<V;)Z[v]=i[v];for(var ge=v;++L<q;)Z[ge+L]=o[L];for(;++P<O;)(se||v<k)&&(Z[ge+u[P]]=i[v++]);return Z}function Bn(i,o){var u=-1,f=i.length;for(o||(o=$(f));++u<f;)o[u]=i[u];return o}function ci(i,o,u,f){var v=!u;u||(u={});for(var k=-1,P=o.length;++k<P;){var O=o[k],L=f?f(u[O],i[O],O,u,i):n;L===n&&(L=i[O]),v?ki(u,O,L):Zo(u,O,L)}return u}function kN(i,o){return ci(i,bf(i),o)}function CN(i,o){return ci(i,Px(i),o)}function du(i,o){return function(u,f){var v=Te(u)?O2:QS,k=o?o():{};return v(u,i,_e(f,2),k)}}function $s(i){return De(function(o,u){var f=-1,v=u.length,k=v>1?u[v-1]:n,P=v>2?u[2]:n;for(k=i.length>3&&typeof k=="function"?(v--,k):n,P&&On(u[0],u[1],P)&&(k=v<3?n:k,v=1),o=ut(o);++f<v;){var O=u[f];O&&i(o,O,f,k)}return o})}function vx(i,o){return function(u,f){if(u==null)return u;if(!Wn(u))return i(u,f);for(var v=u.length,k=o?v:-1,P=ut(u);(o?k--:++k<v)&&f(P[k],k,P)!==!1;);return u}}function yx(i){return function(o,u,f){for(var v=-1,k=ut(o),P=f(o),O=P.length;O--;){var L=P[i?O:++v];if(u(k[L],L,k)===!1)break}return o}}function EN(i,o,u){var f=o&N,v=il(i);function k(){var P=this&&this!==We&&this instanceof k?v:i;return P.apply(f?u:this,arguments)}return k}function bx(i){return function(o){o=Xe(o);var u=Rs(o)?Hr(o):n,f=u?u[0]:o.charAt(0),v=u?ra(u,1).join(""):o.slice(1);return f[i]()+v}}function Us(i){return function(o){return Dp(vv(xv(o).replace(qo,"")),i,"")}}function il(i){return function(){var o=arguments;switch(o.length){case 0:return new i;case 1:return new i(o[0]);case 2:return new i(o[0],o[1]);case 3:return new i(o[0],o[1],o[2]);case 4:return new i(o[0],o[1],o[2],o[3]);case 5:return new i(o[0],o[1],o[2],o[3],o[4]);case 6:return new i(o[0],o[1],o[2],o[3],o[4],o[5]);case 7:return new i(o[0],o[1],o[2],o[3],o[4],o[5],o[6])}var u=zs(i.prototype),f=i.apply(u,o);return Et(f)?f:u}}function AN(i,o,u){var f=il(i);function v(){for(var k=arguments.length,P=$(k),O=k,L=Bs(v);O--;)P[O]=arguments[O];var q=k<3&&P[0]!==L&&P[k-1]!==L?[]:Ji(P,L);if(k-=q.length,k<u)return Nx(i,o,pu,v.placeholder,n,P,q,n,n,u-k);var V=this&&this!==We&&this instanceof v?f:i;return tn(V,this,P)}return v}function wx(i){return function(o,u,f){var v=ut(o);if(!Wn(o)){var k=_e(u,3);o=nn(o),u=function(O){return k(v[O],O,v)}}var P=i(o,u,f);return P>-1?v[k?o[P]:P]:n}}function _x(i){return Ei(function(o){var u=o.length,f=u,v=kr.prototype.thru;for(i&&o.reverse();f--;){var k=o[f];if(typeof k!="function")throw new Nr(c);if(v&&!P&&gu(k)=="wrapper")var P=new kr([],!0)}for(f=P?f:u;++f<u;){k=o[f];var O=gu(k),L=O=="wrapper"?vf(k):n;L&&_f(L[0])&&L[1]==(F|C|D|z)&&!L[4].length&&L[9]==1?P=P[gu(L[0])].apply(P,L[3]):P=k.length==1&&_f(k)?P[O]():P.thru(k)}return function(){var q=arguments,V=q[0];if(P&&q.length==1&&Te(V))return P.plant(V).value();for(var Z=0,se=u?o[Z].apply(this,q):V;++Z<u;)se=o[Z].call(this,se);return se}})}function pu(i,o,u,f,v,k,P,O,L,q){var V=o&F,Z=o&N,se=o&y,ge=o&(C|R),Se=o&B,Le=se?n:il(i);function Ne(){for(var ze=arguments.length,He=$(ze),dr=ze;dr--;)He[dr]=arguments[dr];if(ge)var Rn=Bs(Ne),pr=U2(He,Rn);if(f&&(He=gx(He,f,v,ge)),k&&(He=xx(He,k,P,ge)),ze-=pr,ge&&ze<q){var $t=Ji(He,Rn);return Nx(i,o,pu,Ne.placeholder,u,He,$t,O,L,q-ze)}var Gr=Z?u:this,Oi=se?Gr[i]:i;return ze=He.length,O?He=QN(He,O):Se&&ze>1&&He.reverse(),V&&L<ze&&(He.length=L),this&&this!==We&&this instanceof Ne&&(Oi=Le||il(Oi)),Oi.apply(Gr,He)}return Ne}function jx(i,o){return function(u,f){return rN(u,i,o(f),{})}}function fu(i,o){return function(u,f){var v;if(u===n&&f===n)return o;if(u!==n&&(v=u),f!==n){if(v===n)return f;typeof u=="string"||typeof f=="string"?(u=cr(u),f=cr(f)):(u=lx(u),f=lx(f)),v=i(u,f)}return v}}function mf(i){return Ei(function(o){return o=kt(o,lr(_e())),De(function(u){var f=this;return i(o,function(v){return tn(v,f,u)})})})}function mu(i,o){o=o===n?" ":cr(o);var u=o.length;if(u<2)return u?of(o,i):o;var f=of(o,eu(i/Is(o)));return Rs(o)?ra(Hr(f),0,i).join(""):f.slice(0,i)}function PN(i,o,u,f){var v=o&N,k=il(i);function P(){for(var O=-1,L=arguments.length,q=-1,V=f.length,Z=$(V+L),se=this&&this!==We&&this instanceof P?k:i;++q<V;)Z[q]=f[q];for(;L--;)Z[q++]=arguments[++O];return tn(se,v?u:this,Z)}return P}function Sx(i){return function(o,u,f){return f&&typeof f!="number"&&On(o,u,f)&&(u=f=n),o=Ti(o),u===n?(u=o,o=0):u=Ti(u),f=f===n?o<u?1:-1:Ti(f),hN(o,u,f,i)}}function hu(i){return function(o,u){return typeof o=="string"&&typeof u=="string"||(o=Pr(o),u=Pr(u)),i(o,u)}}function Nx(i,o,u,f,v,k,P,O,L,q){var V=o&C,Z=V?P:n,se=V?n:P,ge=V?k:n,Se=V?n:k;o|=V?D:T,o&=~(V?T:D),o&w||(o&=~(N|y));var Le=[i,o,v,ge,Z,Se,se,O,L,q],Ne=u.apply(n,Le);return _f(i)&&Dx(Ne,Le),Ne.placeholder=f,Fx(Ne,i,o)}function hf(i){var o=Gt[i];return function(u,f){if(u=Pr(u),f=f==null?0:hn(Ie(f),292),f&&F0(u)){var v=(Xe(u)+"e").split("e"),k=o(v[0]+"e"+(+v[1]+f));return v=(Xe(k)+"e").split("e"),+(v[0]+"e"+(+v[1]-f))}return o(u)}}var TN=Ds&&1/Hc(new Ds([,-0]))[1]==le?function(i){return new Ds(i)}:Df;function kx(i){return function(o){var u=gn(o);return u==Ye?Hp(o):u==Lt?K2(o):$2(o,i(o))}}function Ci(i,o,u,f,v,k,P,O){var L=o&y;if(!L&&typeof i!="function")throw new Nr(c);var q=f?f.length:0;if(q||(o&=~(D|T),f=v=n),P=P===n?P:Kt(Ie(P),0),O=O===n?O:Ie(O),q-=v?v.length:0,o&T){var V=f,Z=v;f=v=n}var se=L?n:vf(i),ge=[i,o,u,f,v,V,Z,k,P,O];if(se&&VN(ge,se),i=ge[0],o=ge[1],u=ge[2],f=ge[3],v=ge[4],O=ge[9]=ge[9]===n?L?0:i.length:Kt(ge[9]-q,0),!O&&o&(C|R)&&(o&=~(C|R)),!o||o==N)var Se=EN(i,o,u);else o==C||o==R?Se=AN(i,o,O):(o==D||o==(N|D))&&!v.length?Se=PN(i,o,u,f):Se=pu.apply(n,ge);var Le=se?sx:Dx;return Fx(Le(Se,ge),i,o)}function Cx(i,o,u,f){return i===n||Vr(i,Ls[u])&&!Je.call(f,u)?o:i}function Ex(i,o,u,f,v,k){return Et(i)&&Et(o)&&(k.set(o,i),lu(i,o,n,Ex,k),k.delete(o)),i}function ON(i){return ol(i)?n:i}function Ax(i,o,u,f,v,k){var P=u&b,O=i.length,L=o.length;if(O!=L&&!(P&&L>O))return!1;var q=k.get(i),V=k.get(o);if(q&&V)return q==o&&V==i;var Z=-1,se=!0,ge=u&_?new Ha:n;for(k.set(i,o),k.set(o,i);++Z<O;){var Se=i[Z],Le=o[Z];if(f)var Ne=P?f(Le,Se,Z,o,i,k):f(Se,Le,Z,i,o,k);if(Ne!==n){if(Ne)continue;se=!1;break}if(ge){if(!Fp(o,function(ze,He){if(!Go(ge,He)&&(Se===ze||v(Se,ze,u,f,k)))return ge.push(He)})){se=!1;break}}else if(!(Se===Le||v(Se,Le,u,f,k))){se=!1;break}}return k.delete(i),k.delete(o),se}function RN(i,o,u,f,v,k,P){switch(u){case st:if(i.byteLength!=o.byteLength||i.byteOffset!=o.byteOffset)return!1;i=i.buffer,o=o.buffer;case Ge:return!(i.byteLength!=o.byteLength||!k(new Xc(i),new Xc(o)));case ke:case Y:case Sn:return Vr(+i,+o);case ve:return i.name==o.name&&i.message==o.message;case Zt:case Nn:return i==o+"";case Ye:var O=Hp;case Lt:var L=f&b;if(O||(O=Hc),i.size!=o.size&&!L)return!1;var q=P.get(i);if(q)return q==o;f|=_,P.set(i,o);var V=Ax(O(i),O(o),f,v,k,P);return P.delete(i),V;case Fn:if(Jo)return Jo.call(i)==Jo.call(o)}return!1}function IN(i,o,u,f,v,k){var P=u&b,O=gf(i),L=O.length,q=gf(o),V=q.length;if(L!=V&&!P)return!1;for(var Z=L;Z--;){var se=O[Z];if(!(P?se in o:Je.call(o,se)))return!1}var ge=k.get(i),Se=k.get(o);if(ge&&Se)return ge==o&&Se==i;var Le=!0;k.set(i,o),k.set(o,i);for(var Ne=P;++Z<L;){se=O[Z];var ze=i[se],He=o[se];if(f)var dr=P?f(He,ze,se,o,i,k):f(ze,He,se,i,o,k);if(!(dr===n?ze===He||v(ze,He,u,f,k):dr)){Le=!1;break}Ne||(Ne=se=="constructor")}if(Le&&!Ne){var Rn=i.constructor,pr=o.constructor;Rn!=pr&&"constructor"in i&&"constructor"in o&&!(typeof Rn=="function"&&Rn instanceof Rn&&typeof pr=="function"&&pr instanceof pr)&&(Le=!1)}return k.delete(i),k.delete(o),Le}function Ei(i){return Sf(Mx(i,n,Hx),i+"")}function gf(i){return Q0(i,nn,bf)}function xf(i){return Q0(i,Hn,Px)}var vf=nu?function(i){return nu.get(i)}:Df;function gu(i){for(var o=i.name+"",u=Fs[o],f=Je.call(Fs,o)?u.length:0;f--;){var v=u[f],k=v.func;if(k==null||k==i)return v.name}return o}function Bs(i){var o=Je.call(S,"placeholder")?S:i;return o.placeholder}function _e(){var i=S.iteratee||Mf;return i=i===Mf?J0:i,arguments.length?i(arguments[0],arguments[1]):i}function xu(i,o){var u=i.__data__;return BN(o)?u[typeof o=="string"?"string":"hash"]:u.map}function yf(i){for(var o=nn(i),u=o.length;u--;){var f=o[u],v=i[f];o[u]=[f,v,Rx(v)]}return o}function Ga(i,o){var u=q2(i,o);return Y0(u)?u:n}function MN(i){var o=Je.call(i,Ba),u=i[Ba];try{i[Ba]=n;var f=!0}catch{}var v=Kc.call(i);return f&&(o?i[Ba]=u:delete i[Ba]),v}var bf=Vp?function(i){return i==null?[]:(i=ut(i),Xi(Vp(i),function(o){return L0.call(i,o)}))}:Ff,Px=Vp?function(i){for(var o=[];i;)Yi(o,bf(i)),i=Yc(i);return o}:Ff,gn=Tn;(Gp&&gn(new Gp(new ArrayBuffer(1)))!=st||Qo&&gn(new Qo)!=Ye||Kp&&gn(Kp.resolve())!=on||Ds&&gn(new Ds)!=Lt||Xo&&gn(new Xo)!=xe)&&(gn=function(i){var o=Tn(i),u=o==jt?i.constructor:n,f=u?Ka(u):"";if(f)switch(f){case xS:return st;case vS:return Ye;case yS:return on;case bS:return Lt;case wS:return xe}return o});function LN(i,o,u){for(var f=-1,v=u.length;++f<v;){var k=u[f],P=k.size;switch(k.type){case"drop":i+=P;break;case"dropRight":o-=P;break;case"take":o=hn(o,i+P);break;case"takeRight":i=Kt(i,o-P);break}}return{start:i,end:o}}function DN(i){var o=i.match(_r);return o?o[1].split(ws):[]}function Tx(i,o,u){o=na(o,i);for(var f=-1,v=o.length,k=!1;++f<v;){var P=ui(o[f]);if(!(k=i!=null&&u(i,P)))break;i=i[P]}return k||++f!=v?k:(v=i==null?0:i.length,!!v&&Su(v)&&Ai(P,v)&&(Te(i)||Qa(i)))}function FN(i){var o=i.length,u=new i.constructor(o);return o&&typeof i[0]=="string"&&Je.call(i,"index")&&(u.index=i.index,u.input=i.input),u}function Ox(i){return typeof i.constructor=="function"&&!al(i)?zs(Yc(i)):{}}function zN(i,o,u){var f=i.constructor;switch(o){case Ge:return ff(i);case ke:case Y:return new f(+i);case st:return _N(i,u);case kn:case Nt:case rr:case ir:case br:case zn:case Cn:case ar:case sr:return mx(i,u);case Ye:return new f;case Sn:case Nn:return new f(i);case Zt:return jN(i);case Lt:return new f;case Fn:return SN(i)}}function $N(i,o){var u=o.length;if(!u)return i;var f=u-1;return o[f]=(u>1?"& ":"")+o[f],o=o.join(u>2?", ":" "),i.replace(wr,`{
|
439
439
|
/* [wrapped with `+o+`] */
|
440
440
|
`)}function UN(i){return Te(i)||Qa(i)||!!(D0&&i&&i[D0])}function Ai(i,o){var u=typeof i;return o=o??G,!!o&&(u=="number"||u!="symbol"&&Ur.test(i))&&i>-1&&i%1==0&&i<o}function On(i,o,u){if(!Et(u))return!1;var f=typeof o;return(f=="number"?Wn(u)&&Ai(o,u.length):f=="string"&&o in u)?Vr(u[o],i):!1}function wf(i,o){if(Te(i))return!1;var u=typeof i;return u=="number"||u=="symbol"||u=="boolean"||i==null||ur(i)?!0:$n.test(i)||!Vt.test(i)||o!=null&&i in ut(o)}function BN(i){var o=typeof i;return o=="string"||o=="number"||o=="symbol"||o=="boolean"?i!=="__proto__":i===null}function _f(i){var o=gu(i),u=S[o];if(typeof u!="function"||!(o in Ue.prototype))return!1;if(i===u)return!0;var f=vf(u);return!!f&&i===f[0]}function WN(i){return!!R0&&R0 in i}var HN=Vc?Pi:zf;function al(i){var o=i&&i.constructor,u=typeof o=="function"&&o.prototype||Ls;return i===u}function Rx(i){return i===i&&!Et(i)}function Ix(i,o){return function(u){return u==null?!1:u[i]===o&&(o!==n||i in ut(u))}}function qN(i){var o=_u(i,function(f){return u.size===m&&u.clear(),f}),u=o.cache;return o}function VN(i,o){var u=i[1],f=o[1],v=u|f,k=v<(N|y|F),P=f==F&&u==C||f==F&&u==z&&i[7].length<=o[8]||f==(F|z)&&o[7].length<=o[8]&&u==C;if(!(k||P))return i;f&N&&(i[2]=o[2],v|=u&N?0:w);var O=o[3];if(O){var L=i[3];i[3]=L?gx(L,O,o[4]):O,i[4]=L?Ji(i[3],h):o[4]}return O=o[5],O&&(L=i[5],i[5]=L?xx(L,O,o[6]):O,i[6]=L?Ji(i[5],h):o[6]),O=o[7],O&&(i[7]=O),f&F&&(i[8]=i[8]==null?o[8]:hn(i[8],o[8])),i[9]==null&&(i[9]=o[9]),i[0]=o[0],i[1]=v,i}function GN(i){var o=[];if(i!=null)for(var u in ut(i))o.push(u);return o}function KN(i){return Kc.call(i)}function Mx(i,o,u){return o=Kt(o===n?i.length-1:o,0),function(){for(var f=arguments,v=-1,k=Kt(f.length-o,0),P=$(k);++v<k;)P[v]=f[o+v];v=-1;for(var O=$(o+1);++v<o;)O[v]=f[v];return O[o]=u(P),tn(i,this,O)}}function Lx(i,o){return o.length<2?i:Va(i,Er(o,0,-1))}function QN(i,o){for(var u=i.length,f=hn(o.length,u),v=Bn(i);f--;){var k=o[f];i[f]=Ai(k,u)?v[k]:n}return i}function jf(i,o){if(!(o==="constructor"&&typeof i[o]=="function")&&o!="__proto__")return i[o]}var Dx=zx(sx),sl=uS||function(i,o){return We.setTimeout(i,o)},Sf=zx(vN);function Fx(i,o,u){var f=o+"";return Sf(i,$N(f,XN(DN(f),u)))}function zx(i){var o=0,u=0;return function(){var f=mS(),v=we-(f-u);if(u=f,v>0){if(++o>=oe)return arguments[0]}else o=0;return i.apply(n,arguments)}}function vu(i,o){var u=-1,f=i.length,v=f-1;for(o=o===n?f:o;++u<o;){var k=sf(u,v),P=i[k];i[k]=i[u],i[u]=P}return i.length=o,i}var $x=qN(function(i){var o=[];return i.charCodeAt(0)===46&&o.push(""),i.replace(Fr,function(u,f,v,k){o.push(v?k.replace(Ss,"$1"):f||u)}),o});function ui(i){if(typeof i=="string"||ur(i))return i;var o=i+"";return o=="0"&&1/i==-le?"-0":o}function Ka(i){if(i!=null){try{return Gc.call(i)}catch{}try{return i+""}catch{}}return""}function XN(i,o){return Sr(tt,function(u){var f="_."+u[0];o&u[1]&&!Bc(i,f)&&i.push(f)}),i.sort()}function Ux(i){if(i instanceof Ue)return i.clone();var o=new kr(i.__wrapped__,i.__chain__);return o.__actions__=Bn(i.__actions__),o.__index__=i.__index__,o.__values__=i.__values__,o}function YN(i,o,u){(u?On(i,o,u):o===n)?o=1:o=Kt(Ie(o),0);var f=i==null?0:i.length;if(!f||o<1)return[];for(var v=0,k=0,P=$(eu(f/o));v<f;)P[k++]=Er(i,v,v+=o);return P}function JN(i){for(var o=-1,u=i==null?0:i.length,f=0,v=[];++o<u;){var k=i[o];k&&(v[f++]=k)}return v}function ZN(){var i=arguments.length;if(!i)return[];for(var o=$(i-1),u=arguments[0],f=i;f--;)o[f-1]=arguments[f];return Yi(Te(u)?Bn(u):[u],ln(o,1))}var ek=De(function(i,o){return zt(i)?el(i,ln(o,1,zt,!0)):[]}),tk=De(function(i,o){var u=Ar(o);return zt(u)&&(u=n),zt(i)?el(i,ln(o,1,zt,!0),_e(u,2)):[]}),nk=De(function(i,o){var u=Ar(o);return zt(u)&&(u=n),zt(i)?el(i,ln(o,1,zt,!0),n,u):[]});function rk(i,o,u){var f=i==null?0:i.length;return f?(o=u||o===n?1:Ie(o),Er(i,o<0?0:o,f)):[]}function ik(i,o,u){var f=i==null?0:i.length;return f?(o=u||o===n?1:Ie(o),o=f-o,Er(i,0,o<0?0:o)):[]}function ak(i,o){return i&&i.length?uu(i,_e(o,3),!0,!0):[]}function sk(i,o){return i&&i.length?uu(i,_e(o,3),!0):[]}function ok(i,o,u,f){var v=i==null?0:i.length;return v?(u&&typeof u!="number"&&On(i,o,u)&&(u=0,f=v),ZS(i,o,u,f)):[]}function Bx(i,o,u){var f=i==null?0:i.length;if(!f)return-1;var v=u==null?0:Ie(u);return v<0&&(v=Kt(f+v,0)),Wc(i,_e(o,3),v)}function Wx(i,o,u){var f=i==null?0:i.length;if(!f)return-1;var v=f-1;return u!==n&&(v=Ie(u),v=u<0?Kt(f+v,0):hn(v,f-1)),Wc(i,_e(o,3),v,!0)}function Hx(i){var o=i==null?0:i.length;return o?ln(i,1):[]}function lk(i){var o=i==null?0:i.length;return o?ln(i,le):[]}function ck(i,o){var u=i==null?0:i.length;return u?(o=o===n?1:Ie(o),ln(i,o)):[]}function uk(i){for(var o=-1,u=i==null?0:i.length,f={};++o<u;){var v=i[o];f[v[0]]=v[1]}return f}function qx(i){return i&&i.length?i[0]:n}function dk(i,o,u){var f=i==null?0:i.length;if(!f)return-1;var v=u==null?0:Ie(u);return v<0&&(v=Kt(f+v,0)),Os(i,o,v)}function pk(i){var o=i==null?0:i.length;return o?Er(i,0,-1):[]}var fk=De(function(i){var o=kt(i,df);return o.length&&o[0]===i[0]?ef(o):[]}),mk=De(function(i){var o=Ar(i),u=kt(i,df);return o===Ar(u)?o=n:u.pop(),u.length&&u[0]===i[0]?ef(u,_e(o,2)):[]}),hk=De(function(i){var o=Ar(i),u=kt(i,df);return o=typeof o=="function"?o:n,o&&u.pop(),u.length&&u[0]===i[0]?ef(u,n,o):[]});function gk(i,o){return i==null?"":pS.call(i,o)}function Ar(i){var o=i==null?0:i.length;return o?i[o-1]:n}function xk(i,o,u){var f=i==null?0:i.length;if(!f)return-1;var v=f;return u!==n&&(v=Ie(u),v=v<0?Kt(f+v,0):hn(v,f-1)),o===o?X2(i,o,v):Wc(i,N0,v,!0)}function vk(i,o){return i&&i.length?nx(i,Ie(o)):n}var yk=De(Vx);function Vx(i,o){return i&&i.length&&o&&o.length?af(i,o):i}function bk(i,o,u){return i&&i.length&&o&&o.length?af(i,o,_e(u,2)):i}function wk(i,o,u){return i&&i.length&&o&&o.length?af(i,o,n,u):i}var _k=Ei(function(i,o){var u=i==null?0:i.length,f=Xp(i,o);return ax(i,kt(o,function(v){return Ai(v,u)?+v:v}).sort(hx)),f});function jk(i,o){var u=[];if(!(i&&i.length))return u;var f=-1,v=[],k=i.length;for(o=_e(o,3);++f<k;){var P=i[f];o(P,f,i)&&(u.push(P),v.push(f))}return ax(i,v),u}function Nf(i){return i==null?i:gS.call(i)}function Sk(i,o,u){var f=i==null?0:i.length;return f?(u&&typeof u!="number"&&On(i,o,u)?(o=0,u=f):(o=o==null?0:Ie(o),u=u===n?f:Ie(u)),Er(i,o,u)):[]}function Nk(i,o){return cu(i,o)}function kk(i,o,u){return lf(i,o,_e(u,2))}function Ck(i,o){var u=i==null?0:i.length;if(u){var f=cu(i,o);if(f<u&&Vr(i[f],o))return f}return-1}function Ek(i,o){return cu(i,o,!0)}function Ak(i,o,u){return lf(i,o,_e(u,2),!0)}function Pk(i,o){var u=i==null?0:i.length;if(u){var f=cu(i,o,!0)-1;if(Vr(i[f],o))return f}return-1}function Tk(i){return i&&i.length?ox(i):[]}function Ok(i,o){return i&&i.length?ox(i,_e(o,2)):[]}function Rk(i){var o=i==null?0:i.length;return o?Er(i,1,o):[]}function Ik(i,o,u){return i&&i.length?(o=u||o===n?1:Ie(o),Er(i,0,o<0?0:o)):[]}function Mk(i,o,u){var f=i==null?0:i.length;return f?(o=u||o===n?1:Ie(o),o=f-o,Er(i,o<0?0:o,f)):[]}function Lk(i,o){return i&&i.length?uu(i,_e(o,3),!1,!0):[]}function Dk(i,o){return i&&i.length?uu(i,_e(o,3)):[]}var Fk=De(function(i){return ta(ln(i,1,zt,!0))}),zk=De(function(i){var o=Ar(i);return zt(o)&&(o=n),ta(ln(i,1,zt,!0),_e(o,2))}),$k=De(function(i){var o=Ar(i);return o=typeof o=="function"?o:n,ta(ln(i,1,zt,!0),n,o)});function Uk(i){return i&&i.length?ta(i):[]}function Bk(i,o){return i&&i.length?ta(i,_e(o,2)):[]}function Wk(i,o){return o=typeof o=="function"?o:n,i&&i.length?ta(i,n,o):[]}function kf(i){if(!(i&&i.length))return[];var o=0;return i=Xi(i,function(u){if(zt(u))return o=Kt(u.length,o),!0}),Bp(o,function(u){return kt(i,zp(u))})}function Gx(i,o){if(!(i&&i.length))return[];var u=kf(i);return o==null?u:kt(u,function(f){return tn(o,n,f)})}var Hk=De(function(i,o){return zt(i)?el(i,o):[]}),qk=De(function(i){return uf(Xi(i,zt))}),Vk=De(function(i){var o=Ar(i);return zt(o)&&(o=n),uf(Xi(i,zt),_e(o,2))}),Gk=De(function(i){var o=Ar(i);return o=typeof o=="function"?o:n,uf(Xi(i,zt),n,o)}),Kk=De(kf);function Qk(i,o){return dx(i||[],o||[],Zo)}function Xk(i,o){return dx(i||[],o||[],rl)}var Yk=De(function(i){var o=i.length,u=o>1?i[o-1]:n;return u=typeof u=="function"?(i.pop(),u):n,Gx(i,u)});function Kx(i){var o=S(i);return o.__chain__=!0,o}function Jk(i,o){return o(i),i}function yu(i,o){return o(i)}var Zk=Ei(function(i){var o=i.length,u=o?i[0]:0,f=this.__wrapped__,v=function(k){return Xp(k,i)};return o>1||this.__actions__.length||!(f instanceof Ue)||!Ai(u)?this.thru(v):(f=f.slice(u,+u+(o?1:0)),f.__actions__.push({func:yu,args:[v],thisArg:n}),new kr(f,this.__chain__).thru(function(k){return o&&!k.length&&k.push(n),k}))});function eC(){return Kx(this)}function tC(){return new kr(this.value(),this.__chain__)}function nC(){this.__values__===n&&(this.__values__=lv(this.value()));var i=this.__index__>=this.__values__.length,o=i?n:this.__values__[this.__index__++];return{done:i,value:o}}function rC(){return this}function iC(i){for(var o,u=this;u instanceof iu;){var f=Ux(u);f.__index__=0,f.__values__=n,o?v.__wrapped__=f:o=f;var v=f;u=u.__wrapped__}return v.__wrapped__=i,o}function aC(){var i=this.__wrapped__;if(i instanceof Ue){var o=i;return this.__actions__.length&&(o=new Ue(this)),o=o.reverse(),o.__actions__.push({func:yu,args:[Nf],thisArg:n}),new kr(o,this.__chain__)}return this.thru(Nf)}function sC(){return ux(this.__wrapped__,this.__actions__)}var oC=du(function(i,o,u){Je.call(i,u)?++i[u]:ki(i,u,1)});function lC(i,o,u){var f=Te(i)?j0:JS;return u&&On(i,o,u)&&(o=n),f(i,_e(o,3))}function cC(i,o){var u=Te(i)?Xi:G0;return u(i,_e(o,3))}var uC=wx(Bx),dC=wx(Wx);function pC(i,o){return ln(bu(i,o),1)}function fC(i,o){return ln(bu(i,o),le)}function mC(i,o,u){return u=u===n?1:Ie(u),ln(bu(i,o),u)}function Qx(i,o){var u=Te(i)?Sr:ea;return u(i,_e(o,3))}function Xx(i,o){var u=Te(i)?R2:V0;return u(i,_e(o,3))}var hC=du(function(i,o,u){Je.call(i,u)?i[u].push(o):ki(i,u,[o])});function gC(i,o,u,f){i=Wn(i)?i:Hs(i),u=u&&!f?Ie(u):0;var v=i.length;return u<0&&(u=Kt(v+u,0)),Nu(i)?u<=v&&i.indexOf(o,u)>-1:!!v&&Os(i,o,u)>-1}var xC=De(function(i,o,u){var f=-1,v=typeof o=="function",k=Wn(i)?$(i.length):[];return ea(i,function(P){k[++f]=v?tn(o,P,u):tl(P,o,u)}),k}),vC=du(function(i,o,u){ki(i,u,o)});function bu(i,o){var u=Te(i)?kt:Z0;return u(i,_e(o,3))}function yC(i,o,u,f){return i==null?[]:(Te(o)||(o=o==null?[]:[o]),u=f?n:u,Te(u)||(u=u==null?[]:[u]),rx(i,o,u))}var bC=du(function(i,o,u){i[u?0:1].push(o)},function(){return[[],[]]});function wC(i,o,u){var f=Te(i)?Dp:C0,v=arguments.length<3;return f(i,_e(o,4),u,v,ea)}function _C(i,o,u){var f=Te(i)?I2:C0,v=arguments.length<3;return f(i,_e(o,4),u,v,V0)}function jC(i,o){var u=Te(i)?Xi:G0;return u(i,ju(_e(o,3)))}function SC(i){var o=Te(i)?B0:gN;return o(i)}function NC(i,o,u){(u?On(i,o,u):o===n)?o=1:o=Ie(o);var f=Te(i)?GS:xN;return f(i,o)}function kC(i){var o=Te(i)?KS:yN;return o(i)}function CC(i){if(i==null)return 0;if(Wn(i))return Nu(i)?Is(i):i.length;var o=gn(i);return o==Ye||o==Lt?i.size:nf(i).length}function EC(i,o,u){var f=Te(i)?Fp:bN;return u&&On(i,o,u)&&(o=n),f(i,_e(o,3))}var AC=De(function(i,o){if(i==null)return[];var u=o.length;return u>1&&On(i,o[0],o[1])?o=[]:u>2&&On(o[0],o[1],o[2])&&(o=[o[0]]),rx(i,ln(o,1),[])}),wu=cS||function(){return We.Date.now()};function PC(i,o){if(typeof o!="function")throw new Nr(c);return i=Ie(i),function(){if(--i<1)return o.apply(this,arguments)}}function Yx(i,o,u){return o=u?n:o,o=i&&o==null?i.length:o,Ci(i,F,n,n,n,n,o)}function Jx(i,o){var u;if(typeof o!="function")throw new Nr(c);return i=Ie(i),function(){return--i>0&&(u=o.apply(this,arguments)),i<=1&&(o=n),u}}var Cf=De(function(i,o,u){var f=N;if(u.length){var v=Ji(u,Bs(Cf));f|=D}return Ci(i,f,o,u,v)}),Zx=De(function(i,o,u){var f=N|y;if(u.length){var v=Ji(u,Bs(Zx));f|=D}return Ci(o,f,i,u,v)});function ev(i,o,u){o=u?n:o;var f=Ci(i,C,n,n,n,n,n,o);return f.placeholder=ev.placeholder,f}function tv(i,o,u){o=u?n:o;var f=Ci(i,R,n,n,n,n,n,o);return f.placeholder=tv.placeholder,f}function nv(i,o,u){var f,v,k,P,O,L,q=0,V=!1,Z=!1,se=!0;if(typeof i!="function")throw new Nr(c);o=Pr(o)||0,Et(u)&&(V=!!u.leading,Z="maxWait"in u,k=Z?Kt(Pr(u.maxWait)||0,o):k,se="trailing"in u?!!u.trailing:se);function ge($t){var Gr=f,Oi=v;return f=v=n,q=$t,P=i.apply(Oi,Gr),P}function Se($t){return q=$t,O=sl(ze,o),V?ge($t):P}function Le($t){var Gr=$t-L,Oi=$t-q,wv=o-Gr;return Z?hn(wv,k-Oi):wv}function Ne($t){var Gr=$t-L,Oi=$t-q;return L===n||Gr>=o||Gr<0||Z&&Oi>=k}function ze(){var $t=wu();if(Ne($t))return He($t);O=sl(ze,Le($t))}function He($t){return O=n,se&&f?ge($t):(f=v=n,P)}function dr(){O!==n&&px(O),q=0,f=L=v=O=n}function Rn(){return O===n?P:He(wu())}function pr(){var $t=wu(),Gr=Ne($t);if(f=arguments,v=this,L=$t,Gr){if(O===n)return Se(L);if(Z)return px(O),O=sl(ze,o),ge(L)}return O===n&&(O=sl(ze,o)),P}return pr.cancel=dr,pr.flush=Rn,pr}var TC=De(function(i,o){return q0(i,1,o)}),OC=De(function(i,o,u){return q0(i,Pr(o)||0,u)});function RC(i){return Ci(i,B)}function _u(i,o){if(typeof i!="function"||o!=null&&typeof o!="function")throw new Nr(c);var u=function(){var f=arguments,v=o?o.apply(this,f):f[0],k=u.cache;if(k.has(v))return k.get(v);var P=i.apply(this,f);return u.cache=k.set(v,P)||k,P};return u.cache=new(_u.Cache||Ni),u}_u.Cache=Ni;function ju(i){if(typeof i!="function")throw new Nr(c);return function(){var o=arguments;switch(o.length){case 0:return!i.call(this);case 1:return!i.call(this,o[0]);case 2:return!i.call(this,o[0],o[1]);case 3:return!i.call(this,o[0],o[1],o[2])}return!i.apply(this,o)}}function IC(i){return Jx(2,i)}var MC=wN(function(i,o){o=o.length==1&&Te(o[0])?kt(o[0],lr(_e())):kt(ln(o,1),lr(_e()));var u=o.length;return De(function(f){for(var v=-1,k=hn(f.length,u);++v<k;)f[v]=o[v].call(this,f[v]);return tn(i,this,f)})}),Ef=De(function(i,o){var u=Ji(o,Bs(Ef));return Ci(i,D,n,o,u)}),rv=De(function(i,o){var u=Ji(o,Bs(rv));return Ci(i,T,n,o,u)}),LC=Ei(function(i,o){return Ci(i,z,n,n,n,o)});function DC(i,o){if(typeof i!="function")throw new Nr(c);return o=o===n?o:Ie(o),De(i,o)}function FC(i,o){if(typeof i!="function")throw new Nr(c);return o=o==null?0:Kt(Ie(o),0),De(function(u){var f=u[o],v=ra(u,0,o);return f&&Yi(v,f),tn(i,this,v)})}function zC(i,o,u){var f=!0,v=!0;if(typeof i!="function")throw new Nr(c);return Et(u)&&(f="leading"in u?!!u.leading:f,v="trailing"in u?!!u.trailing:v),nv(i,o,{leading:f,maxWait:o,trailing:v})}function $C(i){return Yx(i,1)}function UC(i,o){return Ef(pf(o),i)}function BC(){if(!arguments.length)return[];var i=arguments[0];return Te(i)?i:[i]}function WC(i){return Cr(i,j)}function HC(i,o){return o=typeof o=="function"?o:n,Cr(i,j,o)}function qC(i){return Cr(i,g|j)}function VC(i,o){return o=typeof o=="function"?o:n,Cr(i,g|j,o)}function GC(i,o){return o==null||H0(i,o,nn(o))}function Vr(i,o){return i===o||i!==i&&o!==o}var KC=hu(Zp),QC=hu(function(i,o){return i>=o}),Qa=X0(function(){return arguments}())?X0:function(i){return Rt(i)&&Je.call(i,"callee")&&!L0.call(i,"callee")},Te=$.isArray,XC=Pn?lr(Pn):iN;function Wn(i){return i!=null&&Su(i.length)&&!Pi(i)}function zt(i){return Rt(i)&&Wn(i)}function YC(i){return i===!0||i===!1||Rt(i)&&Tn(i)==ke}var ia=dS||zf,JC=Wr?lr(Wr):aN;function ZC(i){return Rt(i)&&i.nodeType===1&&!ol(i)}function eE(i){if(i==null)return!0;if(Wn(i)&&(Te(i)||typeof i=="string"||typeof i.splice=="function"||ia(i)||Ws(i)||Qa(i)))return!i.length;var o=gn(i);if(o==Ye||o==Lt)return!i.size;if(al(i))return!nf(i).length;for(var u in i)if(Je.call(i,u))return!1;return!0}function tE(i,o){return nl(i,o)}function nE(i,o,u){u=typeof u=="function"?u:n;var f=u?u(i,o):n;return f===n?nl(i,o,n,u):!!f}function Af(i){if(!Rt(i))return!1;var o=Tn(i);return o==ve||o==fe||typeof i.message=="string"&&typeof i.name=="string"&&!ol(i)}function rE(i){return typeof i=="number"&&F0(i)}function Pi(i){if(!Et(i))return!1;var o=Tn(i);return o==Ve||o==pn||o==Ae||o==St}function iv(i){return typeof i=="number"&&i==Ie(i)}function Su(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=G}function Et(i){var o=typeof i;return i!=null&&(o=="object"||o=="function")}function Rt(i){return i!=null&&typeof i=="object"}var av=jr?lr(jr):oN;function iE(i,o){return i===o||tf(i,o,yf(o))}function aE(i,o,u){return u=typeof u=="function"?u:n,tf(i,o,yf(o),u)}function sE(i){return sv(i)&&i!=+i}function oE(i){if(HN(i))throw new Ee(l);return Y0(i)}function lE(i){return i===null}function cE(i){return i==null}function sv(i){return typeof i=="number"||Rt(i)&&Tn(i)==Sn}function ol(i){if(!Rt(i)||Tn(i)!=jt)return!1;var o=Yc(i);if(o===null)return!0;var u=Je.call(o,"constructor")&&o.constructor;return typeof u=="function"&&u instanceof u&&Gc.call(u)==aS}var Pf=oi?lr(oi):lN;function uE(i){return iv(i)&&i>=-G&&i<=G}var ov=Vo?lr(Vo):cN;function Nu(i){return typeof i=="string"||!Te(i)&&Rt(i)&&Tn(i)==Nn}function ur(i){return typeof i=="symbol"||Rt(i)&&Tn(i)==Fn}var Ws=Ua?lr(Ua):uN;function dE(i){return i===n}function pE(i){return Rt(i)&&gn(i)==xe}function fE(i){return Rt(i)&&Tn(i)==at}var mE=hu(rf),hE=hu(function(i,o){return i<=o});function lv(i){if(!i)return[];if(Wn(i))return Nu(i)?Hr(i):Bn(i);if(Ko&&i[Ko])return G2(i[Ko]());var o=gn(i),u=o==Ye?Hp:o==Lt?Hc:Hs;return u(i)}function Ti(i){if(!i)return i===0?i:0;if(i=Pr(i),i===le||i===-le){var o=i<0?-1:1;return o*re}return i===i?i:0}function Ie(i){var o=Ti(i),u=o%1;return o===o?u?o-u:o:0}function cv(i){return i?qa(Ie(i),0,me):0}function Pr(i){if(typeof i=="number")return i;if(ur(i))return ne;if(Et(i)){var o=typeof i.valueOf=="function"?i.valueOf():i;i=Et(o)?o+"":o}if(typeof i!="string")return i===0?i:+i;i=E0(i);var u=rt.test(i);return u||$r.test(i)?Pe(i.slice(2),u?2:8):Fe.test(i)?ne:+i}function uv(i){return ci(i,Hn(i))}function gE(i){return i?qa(Ie(i),-G,G):i===0?i:0}function Xe(i){return i==null?"":cr(i)}var xE=$s(function(i,o){if(al(o)||Wn(o)){ci(o,nn(o),i);return}for(var u in o)Je.call(o,u)&&Zo(i,u,o[u])}),dv=$s(function(i,o){ci(o,Hn(o),i)}),ku=$s(function(i,o,u,f){ci(o,Hn(o),i,f)}),vE=$s(function(i,o,u,f){ci(o,nn(o),i,f)}),yE=Ei(Xp);function bE(i,o){var u=zs(i);return o==null?u:W0(u,o)}var wE=De(function(i,o){i=ut(i);var u=-1,f=o.length,v=f>2?o[2]:n;for(v&&On(o[0],o[1],v)&&(f=1);++u<f;)for(var k=o[u],P=Hn(k),O=-1,L=P.length;++O<L;){var q=P[O],V=i[q];(V===n||Vr(V,Ls[q])&&!Je.call(i,q))&&(i[q]=k[q])}return i}),_E=De(function(i){return i.push(n,Ex),tn(pv,n,i)});function jE(i,o){return S0(i,_e(o,3),li)}function SE(i,o){return S0(i,_e(o,3),Jp)}function NE(i,o){return i==null?i:Yp(i,_e(o,3),Hn)}function kE(i,o){return i==null?i:K0(i,_e(o,3),Hn)}function CE(i,o){return i&&li(i,_e(o,3))}function EE(i,o){return i&&Jp(i,_e(o,3))}function AE(i){return i==null?[]:ou(i,nn(i))}function PE(i){return i==null?[]:ou(i,Hn(i))}function Tf(i,o,u){var f=i==null?n:Va(i,o);return f===n?u:f}function TE(i,o){return i!=null&&Tx(i,o,eN)}function Of(i,o){return i!=null&&Tx(i,o,tN)}var OE=jx(function(i,o,u){o!=null&&typeof o.toString!="function"&&(o=Kc.call(o)),i[o]=u},If(qn)),RE=jx(function(i,o,u){o!=null&&typeof o.toString!="function"&&(o=Kc.call(o)),Je.call(i,o)?i[o].push(u):i[o]=[u]},_e),IE=De(tl);function nn(i){return Wn(i)?U0(i):nf(i)}function Hn(i){return Wn(i)?U0(i,!0):dN(i)}function ME(i,o){var u={};return o=_e(o,3),li(i,function(f,v,k){ki(u,o(f,v,k),f)}),u}function LE(i,o){var u={};return o=_e(o,3),li(i,function(f,v,k){ki(u,v,o(f,v,k))}),u}var DE=$s(function(i,o,u){lu(i,o,u)}),pv=$s(function(i,o,u,f){lu(i,o,u,f)}),FE=Ei(function(i,o){var u={};if(i==null)return u;var f=!1;o=kt(o,function(k){return k=na(k,i),f||(f=k.length>1),k}),ci(i,xf(i),u),f&&(u=Cr(u,g|x|j,ON));for(var v=o.length;v--;)cf(u,o[v]);return u});function zE(i,o){return fv(i,ju(_e(o)))}var $E=Ei(function(i,o){return i==null?{}:fN(i,o)});function fv(i,o){if(i==null)return{};var u=kt(xf(i),function(f){return[f]});return o=_e(o),ix(i,u,function(f,v){return o(f,v[0])})}function UE(i,o,u){o=na(o,i);var f=-1,v=o.length;for(v||(v=1,i=n);++f<v;){var k=i==null?n:i[ui(o[f])];k===n&&(f=v,k=u),i=Pi(k)?k.call(i):k}return i}function BE(i,o,u){return i==null?i:rl(i,o,u)}function WE(i,o,u,f){return f=typeof f=="function"?f:n,i==null?i:rl(i,o,u,f)}var mv=kx(nn),hv=kx(Hn);function HE(i,o,u){var f=Te(i),v=f||ia(i)||Ws(i);if(o=_e(o,4),u==null){var k=i&&i.constructor;v?u=f?new k:[]:Et(i)?u=Pi(k)?zs(Yc(i)):{}:u={}}return(v?Sr:li)(i,function(P,O,L){return o(u,P,O,L)}),u}function qE(i,o){return i==null?!0:cf(i,o)}function VE(i,o,u){return i==null?i:cx(i,o,pf(u))}function GE(i,o,u,f){return f=typeof f=="function"?f:n,i==null?i:cx(i,o,pf(u),f)}function Hs(i){return i==null?[]:Wp(i,nn(i))}function KE(i){return i==null?[]:Wp(i,Hn(i))}function QE(i,o,u){return u===n&&(u=o,o=n),u!==n&&(u=Pr(u),u=u===u?u:0),o!==n&&(o=Pr(o),o=o===o?o:0),qa(Pr(i),o,u)}function XE(i,o,u){return o=Ti(o),u===n?(u=o,o=0):u=Ti(u),i=Pr(i),nN(i,o,u)}function YE(i,o,u){if(u&&typeof u!="boolean"&&On(i,o,u)&&(o=u=n),u===n&&(typeof o=="boolean"?(u=o,o=n):typeof i=="boolean"&&(u=i,i=n)),i===n&&o===n?(i=0,o=1):(i=Ti(i),o===n?(o=i,i=0):o=Ti(o)),i>o){var f=i;i=o,o=f}if(u||i%1||o%1){var v=z0();return hn(i+v*(o-i+lt("1e-"+((v+"").length-1))),o)}return sf(i,o)}var JE=Us(function(i,o,u){return o=o.toLowerCase(),i+(u?gv(o):o)});function gv(i){return Rf(Xe(i).toLowerCase())}function xv(i){return i=Xe(i),i&&i.replace(An,B2).replace(Ip,"")}function ZE(i,o,u){i=Xe(i),o=cr(o);var f=i.length;u=u===n?f:qa(Ie(u),0,f);var v=u;return u-=o.length,u>=0&&i.slice(u,v)==o}function e4(i){return i=Xe(i),i&&pt.test(i)?i.replace(nt,W2):i}function t4(i){return i=Xe(i),i&&ai.test(i)?i.replace(fn,"\\$&"):i}var n4=Us(function(i,o,u){return i+(u?"-":"")+o.toLowerCase()}),r4=Us(function(i,o,u){return i+(u?" ":"")+o.toLowerCase()}),i4=bx("toLowerCase");function a4(i,o,u){i=Xe(i),o=Ie(o);var f=o?Is(i):0;if(!o||f>=o)return i;var v=(o-f)/2;return mu(tu(v),u)+i+mu(eu(v),u)}function s4(i,o,u){i=Xe(i),o=Ie(o);var f=o?Is(i):0;return o&&f<o?i+mu(o-f,u):i}function o4(i,o,u){i=Xe(i),o=Ie(o);var f=o?Is(i):0;return o&&f<o?mu(o-f,u)+i:i}function l4(i,o,u){return u||o==null?o=0:o&&(o=+o),hS(Xe(i).replace(mn,""),o||0)}function c4(i,o,u){return(u?On(i,o,u):o===n)?o=1:o=Ie(o),of(Xe(i),o)}function u4(){var i=arguments,o=Xe(i[0]);return i.length<3?o:o.replace(i[1],i[2])}var d4=Us(function(i,o,u){return i+(u?"_":"")+o.toLowerCase()});function p4(i,o,u){return u&&typeof u!="number"&&On(i,o,u)&&(o=u=n),u=u===n?me:u>>>0,u?(i=Xe(i),i&&(typeof o=="string"||o!=null&&!Pf(o))&&(o=cr(o),!o&&Rs(i))?ra(Hr(i),0,u):i.split(o,u)):[]}var f4=Us(function(i,o,u){return i+(u?" ":"")+Rf(o)});function m4(i,o,u){return i=Xe(i),u=u==null?0:qa(Ie(u),0,i.length),o=cr(o),i.slice(u,u+o.length)==o}function h4(i,o,u){var f=S.templateSettings;u&&On(i,o,u)&&(o=n),i=Xe(i),o=ku({},o,f,Cx);var v=ku({},o.imports,f.imports,Cx),k=nn(v),P=Wp(v,k),O,L,q=0,V=o.interpolate||Ki,Z="__p += '",se=qp((o.escape||Ki).source+"|"+V.source+"|"+(V===en?Ns:Ki).source+"|"+(o.evaluate||Ki).source+"|$","g"),ge="//# sourceURL="+(Je.call(o,"sourceURL")?(o.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Mp+"]")+`
|
441
441
|
`;i.replace(se,function(Ne,ze,He,dr,Rn,pr){return He||(He=dr),Z+=i.slice(q,pr).replace(jp,H2),ze&&(O=!0,Z+=`' +
|
@@ -454,7 +454,7 @@ __p += '`),He&&(Z+=`' +
|
|
454
454
|
function print() { __p += __j.call(arguments, '') }
|
455
455
|
`:`;
|
456
456
|
`)+Z+`return __p
|
457
|
-
}`;var Le=yv(function(){return Ke(k,ge+"return "+Z).apply(n,P)});if(Le.source=Z,Af(Le))throw Le;return Le}function g4(i){return Xe(i).toLowerCase()}function x4(i){return Xe(i).toUpperCase()}function v4(i,o,u){if(i=Xe(i),i&&(u||o===n))return E0(i);if(!i||!(o=cr(o)))return i;var f=Hr(i),v=Hr(o),k=A0(f,v),P=P0(f,v)+1;return ra(f,k,P).join("")}function y4(i,o,u){if(i=Xe(i),i&&(u||o===n))return i.slice(0,O0(i)+1);if(!i||!(o=cr(o)))return i;var f=Hr(i),v=P0(f,Hr(o))+1;return ra(f,0,v).join("")}function b4(i,o,u){if(i=Xe(i),i&&(u||o===n))return i.replace(mn,"");if(!i||!(o=cr(o)))return i;var f=Hr(i),v=A0(f,Hr(o));return ra(f,v).join("")}function w4(i,o){var u=W,f=pe;if(Et(o)){var v="separator"in o?o.separator:v;u="length"in o?Ie(o.length):u,f="omission"in o?cr(o.omission):f}i=Xe(i);var k=i.length;if(Rs(i)){var P=Hr(i);k=P.length}if(u>=k)return i;var O=u-Is(f);if(O<1)return f;var L=P?ra(P,0,O).join(""):i.slice(0,O);if(v===n)return L+f;if(P&&(O+=L.length-O),Pf(v)){if(i.slice(O).search(v)){var q,V=L;for(v.global||(v=qp(v.source,Xe(En.exec(v))+"g")),v.lastIndex=0;q=v.exec(V);)var Z=q.index;L=L.slice(0,Z===n?O:Z)}}else if(i.indexOf(cr(v),O)!=O){var se=L.lastIndexOf(v);se>-1&&(L=L.slice(0,se))}return L+f}function _4(i){return i=Xe(i),i&&Ce.test(i)?i.replace(ye,Y2):i}var j4=Us(function(i,o,u){return i+(u?" ":"")+o.toUpperCase()}),Rf=bx("toUpperCase");function vv(i,o,u){return i=Xe(i),o=u?n:o,o===n?V2(i)?eS(i):D2(i):i.match(o)||[]}var yv=De(function(i,o){try{return tn(i,n,o)}catch(u){return Af(u)?u:new Ee(u)}}),S4=Ei(function(i,o){return Sr(o,function(u){u=ui(u),ki(i,u,Cf(i[u],i))}),i});function N4(i){var o=i==null?0:i.length,u=_e();return i=o?kt(i,function(f){if(typeof f[1]!="function")throw new Nr(c);return[u(f[0]),f[1]]}):[],De(function(f){for(var v=-1;++v<o;){var k=i[v];if(tn(k[0],this,f))return tn(k[1],this,f)}})}function k4(i){return YS(Cr(i,g))}function If(i){return function(){return i}}function C4(i,o){return i==null||i!==i?o:i}var E4=_x(),A4=_x(!0);function qn(i){return i}function Mf(i){return J0(typeof i=="function"?i:Cr(i,g))}function P4(i){return ex(Cr(i,g))}function T4(i,o){return tx(i,Cr(o,g))}var O4=De(function(i,o){return function(u){return tl(u,i,o)}}),R4=De(function(i,o){return function(u){return tl(i,u,o)}});function Lf(i,o,u){var f=nn(o),v=ou(o,f);u==null&&!(Et(o)&&(v.length||!f.length))&&(u=o,o=i,i=this,v=ou(o,nn(o)));var k=!(Et(u)&&"chain"in u)||!!u.chain,P=Pi(i);return Sr(v,function(O){var L=o[O];i[O]=L,P&&(i.prototype[O]=function(){var q=this.__chain__;if(k||q){var V=i(this.__wrapped__),Z=V.__actions__=Bn(this.__actions__);return Z.push({func:L,args:arguments,thisArg:i}),V.__chain__=q,V}return L.apply(i,Yi([this.value()],arguments))})}),i}function I4(){return We._===this&&(We._=sS),this}function Df(){}function M4(i){return i=Ie(i),De(function(o){return nx(o,i)})}var L4=mf(kt),D4=mf(j0),F4=mf(Fp);function bv(i){return wf(i)?zp(ui(i)):mN(i)}function z4(i){return function(o){return i==null?n:Va(i,o)}}var $4=Sx(),U4=Sx(!0);function Ff(){return[]}function zf(){return!1}function B4(){return{}}function W4(){return""}function H4(){return!0}function q4(i,o){if(i=Ie(i),i<1||i>G)return[];var u=me,f=hn(i,me);o=_e(o),i-=me;for(var v=Bp(f,o);++u<i;)o(u);return v}function V4(i){return Te(i)?kt(i,ui):ur(i)?[i]:Bn($x(Xe(i)))}function G4(i){var o=++iS;return Xe(i)+o}var K4=fu(function(i,o){return i+o},0),Q4=hf("ceil"),X4=fu(function(i,o){return i/o},1),Y4=hf("floor");function J4(i){return i&&i.length?su(i,qn,Zp):n}function Z4(i,o){return i&&i.length?su(i,_e(o,2),Zp):n}function e3(i){return k0(i,qn)}function t3(i,o){return k0(i,_e(o,2))}function n3(i){return i&&i.length?su(i,qn,rf):n}function r3(i,o){return i&&i.length?su(i,_e(o,2),rf):n}var i3=fu(function(i,o){return i*o},1),a3=hf("round"),s3=fu(function(i,o){return i-o},0);function o3(i){return i&&i.length?Up(i,qn):0}function l3(i,o){return i&&i.length?Up(i,_e(o,2)):0}return S.after=PC,S.ary=Yx,S.assign=xE,S.assignIn=dv,S.assignInWith=ku,S.assignWith=vE,S.at=yE,S.before=Jx,S.bind=Cf,S.bindAll=S4,S.bindKey=Zx,S.castArray=BC,S.chain=Kx,S.chunk=YN,S.compact=JN,S.concat=ZN,S.cond=N4,S.conforms=k4,S.constant=If,S.countBy=oC,S.create=bE,S.curry=ev,S.curryRight=tv,S.debounce=nv,S.defaults=wE,S.defaultsDeep=_E,S.defer=TC,S.delay=OC,S.difference=ek,S.differenceBy=tk,S.differenceWith=nk,S.drop=rk,S.dropRight=ik,S.dropRightWhile=ak,S.dropWhile=sk,S.fill=ok,S.filter=cC,S.flatMap=pC,S.flatMapDeep=fC,S.flatMapDepth=mC,S.flatten=Hx,S.flattenDeep=lk,S.flattenDepth=ck,S.flip=RC,S.flow=E4,S.flowRight=A4,S.fromPairs=uk,S.functions=AE,S.functionsIn=PE,S.groupBy=hC,S.initial=pk,S.intersection=fk,S.intersectionBy=mk,S.intersectionWith=hk,S.invert=OE,S.invertBy=RE,S.invokeMap=xC,S.iteratee=Mf,S.keyBy=vC,S.keys=nn,S.keysIn=Hn,S.map=bu,S.mapKeys=ME,S.mapValues=LE,S.matches=P4,S.matchesProperty=T4,S.memoize=_u,S.merge=DE,S.mergeWith=pv,S.method=O4,S.methodOf=R4,S.mixin=Lf,S.negate=ju,S.nthArg=M4,S.omit=FE,S.omitBy=zE,S.once=IC,S.orderBy=yC,S.over=L4,S.overArgs=MC,S.overEvery=D4,S.overSome=F4,S.partial=Ef,S.partialRight=rv,S.partition=bC,S.pick=$E,S.pickBy=fv,S.property=bv,S.propertyOf=z4,S.pull=yk,S.pullAll=Vx,S.pullAllBy=bk,S.pullAllWith=wk,S.pullAt=_k,S.range=$4,S.rangeRight=U4,S.rearg=LC,S.reject=jC,S.remove=jk,S.rest=DC,S.reverse=Nf,S.sampleSize=NC,S.set=BE,S.setWith=WE,S.shuffle=kC,S.slice=Sk,S.sortBy=AC,S.sortedUniq=Tk,S.sortedUniqBy=Ok,S.split=p4,S.spread=FC,S.tail=Rk,S.take=Ik,S.takeRight=Mk,S.takeRightWhile=Lk,S.takeWhile=Dk,S.tap=Jk,S.throttle=zC,S.thru=yu,S.toArray=lv,S.toPairs=mv,S.toPairsIn=hv,S.toPath=V4,S.toPlainObject=uv,S.transform=HE,S.unary=$C,S.union=Fk,S.unionBy=zk,S.unionWith=$k,S.uniq=Uk,S.uniqBy=Bk,S.uniqWith=Wk,S.unset=qE,S.unzip=kf,S.unzipWith=Gx,S.update=VE,S.updateWith=GE,S.values=Hs,S.valuesIn=KE,S.without=Hk,S.words=vv,S.wrap=UC,S.xor=qk,S.xorBy=Vk,S.xorWith=Gk,S.zip=Kk,S.zipObject=Qk,S.zipObjectDeep=Xk,S.zipWith=Yk,S.entries=mv,S.entriesIn=hv,S.extend=dv,S.extendWith=ku,Lf(S,S),S.add=K4,S.attempt=yv,S.camelCase=JE,S.capitalize=gv,S.ceil=Q4,S.clamp=QE,S.clone=WC,S.cloneDeep=qC,S.cloneDeepWith=VC,S.cloneWith=HC,S.conformsTo=GC,S.deburr=xv,S.defaultTo=C4,S.divide=X4,S.endsWith=ZE,S.eq=Vr,S.escape=e4,S.escapeRegExp=t4,S.every=lC,S.find=uC,S.findIndex=Bx,S.findKey=jE,S.findLast=dC,S.findLastIndex=Wx,S.findLastKey=SE,S.floor=Y4,S.forEach=Qx,S.forEachRight=Xx,S.forIn=NE,S.forInRight=kE,S.forOwn=CE,S.forOwnRight=EE,S.get=Tf,S.gt=KC,S.gte=QC,S.has=TE,S.hasIn=Of,S.head=qx,S.identity=qn,S.includes=gC,S.indexOf=dk,S.inRange=XE,S.invoke=IE,S.isArguments=Qa,S.isArray=Te,S.isArrayBuffer=XC,S.isArrayLike=Wn,S.isArrayLikeObject=zt,S.isBoolean=YC,S.isBuffer=ia,S.isDate=JC,S.isElement=ZC,S.isEmpty=eE,S.isEqual=tE,S.isEqualWith=nE,S.isError=Af,S.isFinite=rE,S.isFunction=Pi,S.isInteger=iv,S.isLength=Su,S.isMap=av,S.isMatch=iE,S.isMatchWith=aE,S.isNaN=sE,S.isNative=oE,S.isNil=cE,S.isNull=lE,S.isNumber=sv,S.isObject=Et,S.isObjectLike=Rt,S.isPlainObject=ol,S.isRegExp=Pf,S.isSafeInteger=uE,S.isSet=ov,S.isString=Nu,S.isSymbol=ur,S.isTypedArray=Ws,S.isUndefined=dE,S.isWeakMap=pE,S.isWeakSet=fE,S.join=gk,S.kebabCase=n4,S.last=Ar,S.lastIndexOf=xk,S.lowerCase=r4,S.lowerFirst=i4,S.lt=mE,S.lte=hE,S.max=J4,S.maxBy=Z4,S.mean=e3,S.meanBy=t3,S.min=n3,S.minBy=r3,S.stubArray=Ff,S.stubFalse=zf,S.stubObject=B4,S.stubString=W4,S.stubTrue=H4,S.multiply=i3,S.nth=vk,S.noConflict=I4,S.noop=Df,S.now=wu,S.pad=a4,S.padEnd=s4,S.padStart=o4,S.parseInt=l4,S.random=YE,S.reduce=wC,S.reduceRight=_C,S.repeat=c4,S.replace=u4,S.result=UE,S.round=a3,S.runInContext=I,S.sample=SC,S.size=CC,S.snakeCase=d4,S.some=EC,S.sortedIndex=Nk,S.sortedIndexBy=kk,S.sortedIndexOf=Ck,S.sortedLastIndex=Ek,S.sortedLastIndexBy=Ak,S.sortedLastIndexOf=Pk,S.startCase=f4,S.startsWith=m4,S.subtract=s3,S.sum=o3,S.sumBy=l3,S.template=h4,S.times=q4,S.toFinite=Ti,S.toInteger=Ie,S.toLength=cv,S.toLower=g4,S.toNumber=Pr,S.toSafeInteger=gE,S.toString=Xe,S.toUpper=x4,S.trim=v4,S.trimEnd=y4,S.trimStart=b4,S.truncate=w4,S.unescape=_4,S.uniqueId=G4,S.upperCase=j4,S.upperFirst=Rf,S.each=Qx,S.eachRight=Xx,S.first=qx,Lf(S,function(){var i={};return li(S,function(o,u){Je.call(S.prototype,u)||(i[u]=o)}),i}(),{chain:!1}),S.VERSION=r,Sr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){S[i].placeholder=S}),Sr(["drop","take"],function(i,o){Ue.prototype[i]=function(u){u=u===n?1:Kt(Ie(u),0);var f=this.__filtered__&&!o?new Ue(this):this.clone();return f.__filtered__?f.__takeCount__=hn(u,f.__takeCount__):f.__views__.push({size:hn(u,me),type:i+(f.__dir__<0?"Right":"")}),f},Ue.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),Sr(["filter","map","takeWhile"],function(i,o){var u=o+1,f=u==be||u==ee;Ue.prototype[i]=function(v){var k=this.clone();return k.__iteratees__.push({iteratee:_e(v,3),type:u}),k.__filtered__=k.__filtered__||f,k}}),Sr(["head","last"],function(i,o){var u="take"+(o?"Right":"");Ue.prototype[i]=function(){return this[u](1).value()[0]}}),Sr(["initial","tail"],function(i,o){var u="drop"+(o?"":"Right");Ue.prototype[i]=function(){return this.__filtered__?new Ue(this):this[u](1)}}),Ue.prototype.compact=function(){return this.filter(qn)},Ue.prototype.find=function(i){return this.filter(i).head()},Ue.prototype.findLast=function(i){return this.reverse().find(i)},Ue.prototype.invokeMap=De(function(i,o){return typeof i=="function"?new Ue(this):this.map(function(u){return tl(u,i,o)})}),Ue.prototype.reject=function(i){return this.filter(ju(_e(i)))},Ue.prototype.slice=function(i,o){i=Ie(i);var u=this;return u.__filtered__&&(i>0||o<0)?new Ue(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),o!==n&&(o=Ie(o),u=o<0?u.dropRight(-o):u.take(o-i)),u)},Ue.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ue.prototype.toArray=function(){return this.take(me)},li(Ue.prototype,function(i,o){var u=/^(?:filter|find|map|reject)|While$/.test(o),f=/^(?:head|last)$/.test(o),v=S[f?"take"+(o=="last"?"Right":""):o],k=f||/^find/.test(o);v&&(S.prototype[o]=function(){var P=this.__wrapped__,O=f?[1]:arguments,L=P instanceof Ue,q=O[0],V=L||Te(P),Z=function(ze){var He=v.apply(S,Yi([ze],O));return f&&se?He[0]:He};V&&u&&typeof q=="function"&&q.length!=1&&(L=V=!1);var se=this.__chain__,ge=!!this.__actions__.length,Se=k&&!se,Le=L&&!ge;if(!k&&V){P=Le?P:new Ue(this);var Ne=i.apply(P,O);return Ne.__actions__.push({func:yu,args:[Z],thisArg:n}),new kr(Ne,se)}return Se&&Le?i.apply(this,O):(Ne=this.thru(Z),Se?f?Ne.value()[0]:Ne.value():Ne)})}),Sr(["pop","push","shift","sort","splice","unshift"],function(i){var o=qc[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",f=/^(?:pop|shift)$/.test(i);S.prototype[i]=function(){var v=arguments;if(f&&!this.__chain__){var k=this.value();return o.apply(Te(k)?k:[],v)}return this[u](function(P){return o.apply(Te(P)?P:[],v)})}}),li(Ue.prototype,function(i,o){var u=S[o];if(u){var f=u.name+"";Je.call(Fs,f)||(Fs[f]=[]),Fs[f].push({name:o,func:u})}}),Fs[pu(n,y).name]=[{name:"wrapper",func:n}],Ue.prototype.clone=_S,Ue.prototype.reverse=jS,Ue.prototype.value=SS,S.prototype.at=Zk,S.prototype.chain=eC,S.prototype.commit=tC,S.prototype.next=nC,S.prototype.plant=iC,S.prototype.reverse=aC,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=sC,S.prototype.first=S.prototype.head,Ko&&(S.prototype[Ko]=rC),S},Ms=tS();Ft?((Ft.exports=Ms)._=Ms,ct._=Ms):We._=Ms}).call(bn)})(wd,wd.exports);var Xt=wd.exports;const pl=6;function RO({dataset:e}){const[t,n]=E.useState(!1),[r,a]=E.useState(1),l=e.sample_data[0]?Object.keys(e.sample_data[0]):[],c=Math.ceil(e.columns.length/pl),d=e.columns.slice((r-1)*pl,r*pl);return s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-start justify-between mb-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e.name})]}),s.jsx("p",{className:"text-gray-600 mt-1",children:e.description}),s.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:[e.num_rows.toLocaleString()," rows • ",s.jsx("span",{className:"font-medium",children:"Raw:"})," ",e.columns.length," columns • ",s.jsx("span",{className:"font-medium",children:"Processed:"})," ",l.length," columns • Last synced"," ",new Date(e.updated_at).toLocaleDateString()]})]}),s.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 text-blue-600 hover:text-blue-800",children:[s.jsx(pO,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:t?"Hide Statistics":"Show Statistics"}),t?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]})]}),s.jsxs("div",{className:"space-y-6",children:[t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(p=>s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[s.jsx("h4",{className:"font-medium text-gray-900 break-normal max-w-[70%] word-break:break-word overflow-wrap:anywhere whitespace-pre-wrap",children:p.name.split("_").join("_")}),s.jsx("span",{className:"text-xs font-medium text-gray-500 px-2 py-1 bg-gray-200 rounded-full flex-shrink-0",children:p.datatype})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:p.description}),p.statistics&&s.jsx("div",{className:"space-y-1",children:Object.entries(p.statistics.raw).map(([m,h])=>{if(m==="counts"||m==="allowed_categories"||m==="value"||m==="label_encoder"||m==="label_decoder"||h===null||h===void 0)return null;let g;return typeof h=="number"?g=h.toLocaleString(void 0,{maximumFractionDigits:2}):typeof h=="object"?g=JSON.stringify(h):typeof h=="boolean"?g=h.toString():g=String(h),g.length>50&&(g=g.slice(0,47)+"..."),s.jsxs("div",{className:"flex justify-between text-sm gap-2",children:[s.jsxs("span",{className:"text-gray-500 flex-shrink-0",children:[m.charAt(0).toUpperCase()+m.slice(1),":"]}),s.jsx("span",{className:"font-medium text-gray-900 text-right break-all",children:g})]},m)})})]},p.name))}),c>1&&s.jsxs("div",{className:"flex items-center justify-between border-t pt-4",children:[s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",(r-1)*pl+1," to ",Math.min(r*pl,e.columns.length)," of ",e.columns.length," columns"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>a(p=>Math.max(1,p-1)),disabled:r===1,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-5 h-5"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:["Page ",r," of ",c]}),s.jsx("button",{onClick:()=>a(p=>Math.min(c,p+1)),disabled:r===c,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-5 h-5"})})]})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsx("div",{className:"inline-block min-w-full align-middle",children:s.jsx("div",{className:"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5 rounded-lg",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-300",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsx("tr",{children:l.map(p=>s.jsx("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",children:p},p))})}),s.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.sample_data.map((p,m)=>s.jsx("tr",{children:l.map(h=>s.jsx("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:p[h]===null||p[h]===void 0?"":typeof p[h]=="object"?JSON.stringify(p[h]):String(p[h])},`${m}-${h}`))},m))})]})})})})]})]})}function jw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=jw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function IO(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=jw(e))&&(r&&(r+=" "),r+=t);return r}const gy=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,xy=IO,MO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xy(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(m=>{const h=n==null?void 0:n[m],g=l==null?void 0:l[m];if(h===null)return null;const x=gy(h)||gy(g);return a[m][x]}),d=n&&Object.entries(n).reduce((m,h)=>{let[g,x]=h;return x===void 0||(m[g]=x),m},{}),p=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,h)=>{let{class:g,className:x,...j}=h;return Object.entries(j).every(b=>{let[_,N]=b;return Array.isArray(N)?N.includes({...l,...d}[_]):{...l,...d}[_]===N})?[...m,g,x]:m},[]);return xy(e,c,p,n==null?void 0:n.class,n==null?void 0:n.className)};function Sw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Sw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function LO(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Sw(e))&&(r&&(r+=" "),r+=t);return r}const wg="-",DO=e=>{const t=zO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(wg);return d[0]===""&&d.length!==1&&d.shift(),Nw(d,t)||FO(c)},getConflictingClassGroupIds:(c,d)=>{const p=n[c]||[];return d&&r[c]?[...p,...r[c]]:p}}},Nw=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Nw(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(wg);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},vy=/^\[(.+)\]$/,FO=e=>{if(vy.test(e)){const t=vy.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},zO=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return UO(Object.entries(e.classGroups),n).forEach(([l,c])=>{th(c,r,l,t)}),r},th=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:yy(t,a);l.classGroupId=n;return}if(typeof a=="function"){if($O(a)){th(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{th(c,yy(t,l),n,r)})})},yy=(e,t)=>{let n=e;return t.split(wg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$O=e=>e.isThemeGetter,UO=(e,t)=>t?e.map(([n,r])=>{const a=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,a]}):e,BO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},kw="!",WO=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],l=t.length,c=d=>{const p=[];let m=0,h=0,g;for(let N=0;N<d.length;N++){let y=d[N];if(m===0){if(y===a&&(r||d.slice(N,N+l)===t)){p.push(d.slice(h,N)),h=N+l;continue}if(y==="/"){g=N;continue}}y==="["?m++:y==="]"&&m--}const x=p.length===0?d:d.substring(h),j=x.startsWith(kw),b=j?x.substring(1):x,_=g&&g>h?g-h:void 0;return{modifiers:p,hasImportantModifier:j,baseClassName:b,maybePostfixModifierPosition:_}};return n?d=>n({className:d,parseClassName:c}):c},HO=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},qO=e=>({cache:BO(e.cacheSize),parseClassName:WO(e),...DO(e)}),VO=/\s+/,GO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(VO);let d="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:j}=n(m);let b=!!j,_=r(b?x.substring(0,j):x);if(!_){if(!b){d=m+(d.length>0?" "+d:d);continue}if(_=r(x),!_){d=m+(d.length>0?" "+d:d);continue}b=!1}const N=HO(h).join(":"),y=g?N+kw:N,w=y+_;if(l.includes(w))continue;l.push(w);const C=a(_,b);for(let R=0;R<C.length;++R){const D=C[R];l.push(y+D)}d=m+(d.length>0?" "+d:d)}return d};function KO(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Cw(t))&&(r&&(r+=" "),r+=n);return r}const Cw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Cw(e[r]))&&(n&&(n+=" "),n+=t);return n};function QO(e,...t){let n,r,a,l=c;function c(p){const m=t.reduce((h,g)=>g(h),e());return n=qO(m),r=n.cache.get,a=n.cache.set,l=d,d(p)}function d(p){const m=r(p);if(m)return m;const h=GO(p,n);return a(p,h),h}return function(){return l(KO.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ew=/^\[(?:([a-z-]+):)?(.+)\]$/i,XO=/^\d+\/\d+$/,YO=new Set(["px","full","screen"]),JO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ii=e=>co(e)||YO.has(e)||XO.test(e),sa=e=>zo(e,"length",uR),co=e=>!!e&&!Number.isNaN(Number(e)),rm=e=>zo(e,"number",co),fl=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&co(e.slice(0,-1)),Me=e=>Ew.test(e),oa=e=>JO.test(e),iR=new Set(["length","size","percentage"]),aR=e=>zo(e,iR,Aw),sR=e=>zo(e,"position",Aw),oR=new Set(["image","url"]),lR=e=>zo(e,oR,pR),cR=e=>zo(e,"",dR),ml=()=>!0,zo=(e,t,n)=>{const r=Ew.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uR=e=>ZO.test(e)&&!eR.test(e),Aw=()=>!1,dR=e=>tR.test(e),pR=e=>nR.test(e),fR=()=>{const e=bt("colors"),t=bt("spacing"),n=bt("blur"),r=bt("brightness"),a=bt("borderColor"),l=bt("borderRadius"),c=bt("borderSpacing"),d=bt("borderWidth"),p=bt("contrast"),m=bt("grayscale"),h=bt("hueRotate"),g=bt("invert"),x=bt("gap"),j=bt("gradientColorStops"),b=bt("gradientColorStopPositions"),_=bt("inset"),N=bt("margin"),y=bt("opacity"),w=bt("padding"),C=bt("saturate"),R=bt("scale"),D=bt("sepia"),T=bt("skew"),F=bt("space"),z=bt("translate"),B=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Me,t],oe=()=>[Me,t],we=()=>["",Ii,sa],be=()=>["auto",co,Me],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],re=()=>["","0",Me],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],me=()=>[co,Me];return{cacheSize:500,separator:":",theme:{colors:[ml],spacing:[Ii,sa],blur:["none","",oa,Me],brightness:me(),borderColor:[e],borderRadius:["none","","full",oa,Me],borderSpacing:oe(),borderWidth:we(),contrast:me(),grayscale:re(),hueRotate:me(),invert:re(),gap:oe(),gradientColorStops:[e],gradientColorStopPositions:[rR,sa],inset:pe(),margin:pe(),opacity:me(),padding:oe(),saturate:me(),scale:me(),sepia:re(),skew:me(),space:oe(),translate:oe()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[oa]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),Me]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fl,Me]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:re()}],shrink:[{shrink:re()}],order:[{order:["first","last","none",fl,Me]}],"grid-cols":[{"grid-cols":[ml]}],"col-start-end":[{col:["auto",{span:["full",fl,Me]},Me]}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":[ml]}],"row-start-end":[{row:["auto",{span:[fl,Me]},Me]}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[oa]},oa]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oa,sa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rm]}],"font-family":[{font:[ml]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",co,rm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ii,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ii,sa]}],"underline-offset":[{"underline-offset":["auto",Ii,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:oe()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),sR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",aR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[j]}],"gradient-via":[{via:[j]}],"gradient-to":[{to:[j]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:ee()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Ii,Me]}],"outline-w":[{outline:[Ii,sa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ii,sa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oa,cR]}],"shadow-color":[{shadow:[ml]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",oa,Me]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[C]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:me()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:me()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[fl,Me]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":oe()}],"scroll-mx":[{"scroll-mx":oe()}],"scroll-my":[{"scroll-my":oe()}],"scroll-ms":[{"scroll-ms":oe()}],"scroll-me":[{"scroll-me":oe()}],"scroll-mt":[{"scroll-mt":oe()}],"scroll-mr":[{"scroll-mr":oe()}],"scroll-mb":[{"scroll-mb":oe()}],"scroll-ml":[{"scroll-ml":oe()}],"scroll-p":[{"scroll-p":oe()}],"scroll-px":[{"scroll-px":oe()}],"scroll-py":[{"scroll-py":oe()}],"scroll-ps":[{"scroll-ps":oe()}],"scroll-pe":[{"scroll-pe":oe()}],"scroll-pt":[{"scroll-pt":oe()}],"scroll-pr":[{"scroll-pr":oe()}],"scroll-pb":[{"scroll-pb":oe()}],"scroll-pl":[{"scroll-pl":oe()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ii,sa,rm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mR=QO(fR);function Jr(...e){return mR(LO(e))}const hR=MO("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",information:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-600",important:"border-transparent bg-red-100 text-red-800 hover:bg-red-600",warning:"border-transparent bg-yellow-100 text-yellow-800 hover:bg-yellow-600",success:"border-transparent bg-green-100 text-green-800 hover:bg-green-600"}},defaultVariants:{variant:"default"}});function ga({className:e,variant:t,...n}){return s.jsx("div",{className:Jr(hR({variant:t}),e),...n})}var Pw={exports:{}},vr={},Tw={exports:{}},Ow={};/**
|
457
|
+
}`;var Le=yv(function(){return Qe(k,ge+"return "+Z).apply(n,P)});if(Le.source=Z,Af(Le))throw Le;return Le}function g4(i){return Xe(i).toLowerCase()}function x4(i){return Xe(i).toUpperCase()}function v4(i,o,u){if(i=Xe(i),i&&(u||o===n))return E0(i);if(!i||!(o=cr(o)))return i;var f=Hr(i),v=Hr(o),k=A0(f,v),P=P0(f,v)+1;return ra(f,k,P).join("")}function y4(i,o,u){if(i=Xe(i),i&&(u||o===n))return i.slice(0,O0(i)+1);if(!i||!(o=cr(o)))return i;var f=Hr(i),v=P0(f,Hr(o))+1;return ra(f,0,v).join("")}function b4(i,o,u){if(i=Xe(i),i&&(u||o===n))return i.replace(mn,"");if(!i||!(o=cr(o)))return i;var f=Hr(i),v=A0(f,Hr(o));return ra(f,v).join("")}function w4(i,o){var u=W,f=pe;if(Et(o)){var v="separator"in o?o.separator:v;u="length"in o?Ie(o.length):u,f="omission"in o?cr(o.omission):f}i=Xe(i);var k=i.length;if(Rs(i)){var P=Hr(i);k=P.length}if(u>=k)return i;var O=u-Is(f);if(O<1)return f;var L=P?ra(P,0,O).join(""):i.slice(0,O);if(v===n)return L+f;if(P&&(O+=L.length-O),Pf(v)){if(i.slice(O).search(v)){var q,V=L;for(v.global||(v=qp(v.source,Xe(En.exec(v))+"g")),v.lastIndex=0;q=v.exec(V);)var Z=q.index;L=L.slice(0,Z===n?O:Z)}}else if(i.indexOf(cr(v),O)!=O){var se=L.lastIndexOf(v);se>-1&&(L=L.slice(0,se))}return L+f}function _4(i){return i=Xe(i),i&&Ce.test(i)?i.replace(ye,Y2):i}var j4=Us(function(i,o,u){return i+(u?" ":"")+o.toUpperCase()}),Rf=bx("toUpperCase");function vv(i,o,u){return i=Xe(i),o=u?n:o,o===n?V2(i)?eS(i):D2(i):i.match(o)||[]}var yv=De(function(i,o){try{return tn(i,n,o)}catch(u){return Af(u)?u:new Ee(u)}}),S4=Ei(function(i,o){return Sr(o,function(u){u=ui(u),ki(i,u,Cf(i[u],i))}),i});function N4(i){var o=i==null?0:i.length,u=_e();return i=o?kt(i,function(f){if(typeof f[1]!="function")throw new Nr(c);return[u(f[0]),f[1]]}):[],De(function(f){for(var v=-1;++v<o;){var k=i[v];if(tn(k[0],this,f))return tn(k[1],this,f)}})}function k4(i){return YS(Cr(i,g))}function If(i){return function(){return i}}function C4(i,o){return i==null||i!==i?o:i}var E4=_x(),A4=_x(!0);function qn(i){return i}function Mf(i){return J0(typeof i=="function"?i:Cr(i,g))}function P4(i){return ex(Cr(i,g))}function T4(i,o){return tx(i,Cr(o,g))}var O4=De(function(i,o){return function(u){return tl(u,i,o)}}),R4=De(function(i,o){return function(u){return tl(i,u,o)}});function Lf(i,o,u){var f=nn(o),v=ou(o,f);u==null&&!(Et(o)&&(v.length||!f.length))&&(u=o,o=i,i=this,v=ou(o,nn(o)));var k=!(Et(u)&&"chain"in u)||!!u.chain,P=Pi(i);return Sr(v,function(O){var L=o[O];i[O]=L,P&&(i.prototype[O]=function(){var q=this.__chain__;if(k||q){var V=i(this.__wrapped__),Z=V.__actions__=Bn(this.__actions__);return Z.push({func:L,args:arguments,thisArg:i}),V.__chain__=q,V}return L.apply(i,Yi([this.value()],arguments))})}),i}function I4(){return We._===this&&(We._=sS),this}function Df(){}function M4(i){return i=Ie(i),De(function(o){return nx(o,i)})}var L4=mf(kt),D4=mf(j0),F4=mf(Fp);function bv(i){return wf(i)?zp(ui(i)):mN(i)}function z4(i){return function(o){return i==null?n:Va(i,o)}}var $4=Sx(),U4=Sx(!0);function Ff(){return[]}function zf(){return!1}function B4(){return{}}function W4(){return""}function H4(){return!0}function q4(i,o){if(i=Ie(i),i<1||i>G)return[];var u=me,f=hn(i,me);o=_e(o),i-=me;for(var v=Bp(f,o);++u<i;)o(u);return v}function V4(i){return Te(i)?kt(i,ui):ur(i)?[i]:Bn($x(Xe(i)))}function G4(i){var o=++iS;return Xe(i)+o}var K4=fu(function(i,o){return i+o},0),Q4=hf("ceil"),X4=fu(function(i,o){return i/o},1),Y4=hf("floor");function J4(i){return i&&i.length?su(i,qn,Zp):n}function Z4(i,o){return i&&i.length?su(i,_e(o,2),Zp):n}function e3(i){return k0(i,qn)}function t3(i,o){return k0(i,_e(o,2))}function n3(i){return i&&i.length?su(i,qn,rf):n}function r3(i,o){return i&&i.length?su(i,_e(o,2),rf):n}var i3=fu(function(i,o){return i*o},1),a3=hf("round"),s3=fu(function(i,o){return i-o},0);function o3(i){return i&&i.length?Up(i,qn):0}function l3(i,o){return i&&i.length?Up(i,_e(o,2)):0}return S.after=PC,S.ary=Yx,S.assign=xE,S.assignIn=dv,S.assignInWith=ku,S.assignWith=vE,S.at=yE,S.before=Jx,S.bind=Cf,S.bindAll=S4,S.bindKey=Zx,S.castArray=BC,S.chain=Kx,S.chunk=YN,S.compact=JN,S.concat=ZN,S.cond=N4,S.conforms=k4,S.constant=If,S.countBy=oC,S.create=bE,S.curry=ev,S.curryRight=tv,S.debounce=nv,S.defaults=wE,S.defaultsDeep=_E,S.defer=TC,S.delay=OC,S.difference=ek,S.differenceBy=tk,S.differenceWith=nk,S.drop=rk,S.dropRight=ik,S.dropRightWhile=ak,S.dropWhile=sk,S.fill=ok,S.filter=cC,S.flatMap=pC,S.flatMapDeep=fC,S.flatMapDepth=mC,S.flatten=Hx,S.flattenDeep=lk,S.flattenDepth=ck,S.flip=RC,S.flow=E4,S.flowRight=A4,S.fromPairs=uk,S.functions=AE,S.functionsIn=PE,S.groupBy=hC,S.initial=pk,S.intersection=fk,S.intersectionBy=mk,S.intersectionWith=hk,S.invert=OE,S.invertBy=RE,S.invokeMap=xC,S.iteratee=Mf,S.keyBy=vC,S.keys=nn,S.keysIn=Hn,S.map=bu,S.mapKeys=ME,S.mapValues=LE,S.matches=P4,S.matchesProperty=T4,S.memoize=_u,S.merge=DE,S.mergeWith=pv,S.method=O4,S.methodOf=R4,S.mixin=Lf,S.negate=ju,S.nthArg=M4,S.omit=FE,S.omitBy=zE,S.once=IC,S.orderBy=yC,S.over=L4,S.overArgs=MC,S.overEvery=D4,S.overSome=F4,S.partial=Ef,S.partialRight=rv,S.partition=bC,S.pick=$E,S.pickBy=fv,S.property=bv,S.propertyOf=z4,S.pull=yk,S.pullAll=Vx,S.pullAllBy=bk,S.pullAllWith=wk,S.pullAt=_k,S.range=$4,S.rangeRight=U4,S.rearg=LC,S.reject=jC,S.remove=jk,S.rest=DC,S.reverse=Nf,S.sampleSize=NC,S.set=BE,S.setWith=WE,S.shuffle=kC,S.slice=Sk,S.sortBy=AC,S.sortedUniq=Tk,S.sortedUniqBy=Ok,S.split=p4,S.spread=FC,S.tail=Rk,S.take=Ik,S.takeRight=Mk,S.takeRightWhile=Lk,S.takeWhile=Dk,S.tap=Jk,S.throttle=zC,S.thru=yu,S.toArray=lv,S.toPairs=mv,S.toPairsIn=hv,S.toPath=V4,S.toPlainObject=uv,S.transform=HE,S.unary=$C,S.union=Fk,S.unionBy=zk,S.unionWith=$k,S.uniq=Uk,S.uniqBy=Bk,S.uniqWith=Wk,S.unset=qE,S.unzip=kf,S.unzipWith=Gx,S.update=VE,S.updateWith=GE,S.values=Hs,S.valuesIn=KE,S.without=Hk,S.words=vv,S.wrap=UC,S.xor=qk,S.xorBy=Vk,S.xorWith=Gk,S.zip=Kk,S.zipObject=Qk,S.zipObjectDeep=Xk,S.zipWith=Yk,S.entries=mv,S.entriesIn=hv,S.extend=dv,S.extendWith=ku,Lf(S,S),S.add=K4,S.attempt=yv,S.camelCase=JE,S.capitalize=gv,S.ceil=Q4,S.clamp=QE,S.clone=WC,S.cloneDeep=qC,S.cloneDeepWith=VC,S.cloneWith=HC,S.conformsTo=GC,S.deburr=xv,S.defaultTo=C4,S.divide=X4,S.endsWith=ZE,S.eq=Vr,S.escape=e4,S.escapeRegExp=t4,S.every=lC,S.find=uC,S.findIndex=Bx,S.findKey=jE,S.findLast=dC,S.findLastIndex=Wx,S.findLastKey=SE,S.floor=Y4,S.forEach=Qx,S.forEachRight=Xx,S.forIn=NE,S.forInRight=kE,S.forOwn=CE,S.forOwnRight=EE,S.get=Tf,S.gt=KC,S.gte=QC,S.has=TE,S.hasIn=Of,S.head=qx,S.identity=qn,S.includes=gC,S.indexOf=dk,S.inRange=XE,S.invoke=IE,S.isArguments=Qa,S.isArray=Te,S.isArrayBuffer=XC,S.isArrayLike=Wn,S.isArrayLikeObject=zt,S.isBoolean=YC,S.isBuffer=ia,S.isDate=JC,S.isElement=ZC,S.isEmpty=eE,S.isEqual=tE,S.isEqualWith=nE,S.isError=Af,S.isFinite=rE,S.isFunction=Pi,S.isInteger=iv,S.isLength=Su,S.isMap=av,S.isMatch=iE,S.isMatchWith=aE,S.isNaN=sE,S.isNative=oE,S.isNil=cE,S.isNull=lE,S.isNumber=sv,S.isObject=Et,S.isObjectLike=Rt,S.isPlainObject=ol,S.isRegExp=Pf,S.isSafeInteger=uE,S.isSet=ov,S.isString=Nu,S.isSymbol=ur,S.isTypedArray=Ws,S.isUndefined=dE,S.isWeakMap=pE,S.isWeakSet=fE,S.join=gk,S.kebabCase=n4,S.last=Ar,S.lastIndexOf=xk,S.lowerCase=r4,S.lowerFirst=i4,S.lt=mE,S.lte=hE,S.max=J4,S.maxBy=Z4,S.mean=e3,S.meanBy=t3,S.min=n3,S.minBy=r3,S.stubArray=Ff,S.stubFalse=zf,S.stubObject=B4,S.stubString=W4,S.stubTrue=H4,S.multiply=i3,S.nth=vk,S.noConflict=I4,S.noop=Df,S.now=wu,S.pad=a4,S.padEnd=s4,S.padStart=o4,S.parseInt=l4,S.random=YE,S.reduce=wC,S.reduceRight=_C,S.repeat=c4,S.replace=u4,S.result=UE,S.round=a3,S.runInContext=I,S.sample=SC,S.size=CC,S.snakeCase=d4,S.some=EC,S.sortedIndex=Nk,S.sortedIndexBy=kk,S.sortedIndexOf=Ck,S.sortedLastIndex=Ek,S.sortedLastIndexBy=Ak,S.sortedLastIndexOf=Pk,S.startCase=f4,S.startsWith=m4,S.subtract=s3,S.sum=o3,S.sumBy=l3,S.template=h4,S.times=q4,S.toFinite=Ti,S.toInteger=Ie,S.toLength=cv,S.toLower=g4,S.toNumber=Pr,S.toSafeInteger=gE,S.toString=Xe,S.toUpper=x4,S.trim=v4,S.trimEnd=y4,S.trimStart=b4,S.truncate=w4,S.unescape=_4,S.uniqueId=G4,S.upperCase=j4,S.upperFirst=Rf,S.each=Qx,S.eachRight=Xx,S.first=qx,Lf(S,function(){var i={};return li(S,function(o,u){Je.call(S.prototype,u)||(i[u]=o)}),i}(),{chain:!1}),S.VERSION=r,Sr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(i){S[i].placeholder=S}),Sr(["drop","take"],function(i,o){Ue.prototype[i]=function(u){u=u===n?1:Kt(Ie(u),0);var f=this.__filtered__&&!o?new Ue(this):this.clone();return f.__filtered__?f.__takeCount__=hn(u,f.__takeCount__):f.__views__.push({size:hn(u,me),type:i+(f.__dir__<0?"Right":"")}),f},Ue.prototype[i+"Right"]=function(u){return this.reverse()[i](u).reverse()}}),Sr(["filter","map","takeWhile"],function(i,o){var u=o+1,f=u==be||u==ee;Ue.prototype[i]=function(v){var k=this.clone();return k.__iteratees__.push({iteratee:_e(v,3),type:u}),k.__filtered__=k.__filtered__||f,k}}),Sr(["head","last"],function(i,o){var u="take"+(o?"Right":"");Ue.prototype[i]=function(){return this[u](1).value()[0]}}),Sr(["initial","tail"],function(i,o){var u="drop"+(o?"":"Right");Ue.prototype[i]=function(){return this.__filtered__?new Ue(this):this[u](1)}}),Ue.prototype.compact=function(){return this.filter(qn)},Ue.prototype.find=function(i){return this.filter(i).head()},Ue.prototype.findLast=function(i){return this.reverse().find(i)},Ue.prototype.invokeMap=De(function(i,o){return typeof i=="function"?new Ue(this):this.map(function(u){return tl(u,i,o)})}),Ue.prototype.reject=function(i){return this.filter(ju(_e(i)))},Ue.prototype.slice=function(i,o){i=Ie(i);var u=this;return u.__filtered__&&(i>0||o<0)?new Ue(u):(i<0?u=u.takeRight(-i):i&&(u=u.drop(i)),o!==n&&(o=Ie(o),u=o<0?u.dropRight(-o):u.take(o-i)),u)},Ue.prototype.takeRightWhile=function(i){return this.reverse().takeWhile(i).reverse()},Ue.prototype.toArray=function(){return this.take(me)},li(Ue.prototype,function(i,o){var u=/^(?:filter|find|map|reject)|While$/.test(o),f=/^(?:head|last)$/.test(o),v=S[f?"take"+(o=="last"?"Right":""):o],k=f||/^find/.test(o);v&&(S.prototype[o]=function(){var P=this.__wrapped__,O=f?[1]:arguments,L=P instanceof Ue,q=O[0],V=L||Te(P),Z=function(ze){var He=v.apply(S,Yi([ze],O));return f&&se?He[0]:He};V&&u&&typeof q=="function"&&q.length!=1&&(L=V=!1);var se=this.__chain__,ge=!!this.__actions__.length,Se=k&&!se,Le=L&&!ge;if(!k&&V){P=Le?P:new Ue(this);var Ne=i.apply(P,O);return Ne.__actions__.push({func:yu,args:[Z],thisArg:n}),new kr(Ne,se)}return Se&&Le?i.apply(this,O):(Ne=this.thru(Z),Se?f?Ne.value()[0]:Ne.value():Ne)})}),Sr(["pop","push","shift","sort","splice","unshift"],function(i){var o=qc[i],u=/^(?:push|sort|unshift)$/.test(i)?"tap":"thru",f=/^(?:pop|shift)$/.test(i);S.prototype[i]=function(){var v=arguments;if(f&&!this.__chain__){var k=this.value();return o.apply(Te(k)?k:[],v)}return this[u](function(P){return o.apply(Te(P)?P:[],v)})}}),li(Ue.prototype,function(i,o){var u=S[o];if(u){var f=u.name+"";Je.call(Fs,f)||(Fs[f]=[]),Fs[f].push({name:o,func:u})}}),Fs[pu(n,y).name]=[{name:"wrapper",func:n}],Ue.prototype.clone=_S,Ue.prototype.reverse=jS,Ue.prototype.value=SS,S.prototype.at=Zk,S.prototype.chain=eC,S.prototype.commit=tC,S.prototype.next=nC,S.prototype.plant=iC,S.prototype.reverse=aC,S.prototype.toJSON=S.prototype.valueOf=S.prototype.value=sC,S.prototype.first=S.prototype.head,Ko&&(S.prototype[Ko]=rC),S},Ms=tS();Ft?((Ft.exports=Ms)._=Ms,ct._=Ms):We._=Ms}).call(bn)})(wd,wd.exports);var Xt=wd.exports;const pl=6;function RO({dataset:e}){const[t,n]=E.useState(!1),[r,a]=E.useState(1),l=e.sample_data[0]?Object.keys(e.sample_data[0]):[],c=Math.ceil(e.columns.length/pl),d=e.columns.slice((r-1)*pl,r*pl);return s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsxs("div",{className:"flex items-start justify-between mb-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:e.name})]}),s.jsx("p",{className:"text-gray-600 mt-1",children:e.description}),s.jsxs("p",{className:"text-sm text-gray-500 mt-2",children:[e.num_rows.toLocaleString()," rows • ",s.jsx("span",{className:"font-medium",children:"Raw:"})," ",e.columns.length," columns • ",s.jsx("span",{className:"font-medium",children:"Processed:"})," ",l.length," columns • Last synced"," ",new Date(e.updated_at).toLocaleDateString()]})]}),s.jsxs("button",{onClick:()=>n(!t),className:"flex items-center gap-1 text-blue-600 hover:text-blue-800",children:[s.jsx(pO,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:t?"Hide Statistics":"Show Statistics"}),t?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]})]}),s.jsxs("div",{className:"space-y-6",children:[t&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(p=>s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2 gap-2",children:[s.jsx("h4",{className:"font-medium text-gray-900 break-normal max-w-[70%] word-break:break-word overflow-wrap:anywhere whitespace-pre-wrap",children:p.name.split("_").join("_")}),s.jsx("span",{className:"text-xs font-medium text-gray-500 px-2 py-1 bg-gray-200 rounded-full flex-shrink-0",children:p.datatype})]}),s.jsx("p",{className:"text-sm text-gray-600 mb-3",children:p.description}),p.statistics&&s.jsx("div",{className:"space-y-1",children:Object.entries(p.statistics.raw).map(([m,h])=>{if(m==="counts"||m==="allowed_categories"||m==="value"||m==="label_encoder"||m==="label_decoder"||h===null||h===void 0)return null;let g;return typeof h=="number"?g=h.toLocaleString(void 0,{maximumFractionDigits:2}):typeof h=="object"?g=JSON.stringify(h):typeof h=="boolean"?g=h.toString():g=String(h),g.length>50&&(g=g.slice(0,47)+"..."),s.jsxs("div",{className:"flex justify-between text-sm gap-2",children:[s.jsxs("span",{className:"text-gray-500 flex-shrink-0",children:[m.charAt(0).toUpperCase()+m.slice(1),":"]}),s.jsx("span",{className:"font-medium text-gray-900 text-right break-all",children:g})]},m)})})]},p.name))}),c>1&&s.jsxs("div",{className:"flex items-center justify-between border-t pt-4",children:[s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",(r-1)*pl+1," to ",Math.min(r*pl,e.columns.length)," of ",e.columns.length," columns"]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>a(p=>Math.max(1,p-1)),disabled:r===1,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-5 h-5"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:["Page ",r," of ",c]}),s.jsx("button",{onClick:()=>a(p=>Math.min(c,p+1)),disabled:r===c,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-5 h-5"})})]})]})]}),s.jsx("div",{className:"overflow-x-auto",children:s.jsx("div",{className:"inline-block min-w-full align-middle",children:s.jsx("div",{className:"overflow-hidden shadow-sm ring-1 ring-black ring-opacity-5 rounded-lg",children:s.jsxs("table",{className:"min-w-full divide-y divide-gray-300",children:[s.jsx("thead",{className:"bg-gray-50",children:s.jsx("tr",{children:l.map(p=>s.jsx("th",{scope:"col",className:"px-3 py-3.5 text-left text-sm font-semibold text-gray-900",children:p},p))})}),s.jsx("tbody",{className:"divide-y divide-gray-200 bg-white",children:e.sample_data.map((p,m)=>s.jsx("tr",{children:l.map(h=>s.jsx("td",{className:"whitespace-nowrap px-3 py-4 text-sm text-gray-500",children:p[h]===null||p[h]===void 0?"":typeof p[h]=="object"?JSON.stringify(p[h]):String(p[h])},`${m}-${h}`))},m))})]})})})})]})]})}function jw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=jw(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function IO(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=jw(e))&&(r&&(r+=" "),r+=t);return r}const gy=e=>typeof e=="boolean"?"".concat(e):e===0?"0":e,xy=IO,MO=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return xy(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:a,defaultVariants:l}=t,c=Object.keys(a).map(m=>{const h=n==null?void 0:n[m],g=l==null?void 0:l[m];if(h===null)return null;const x=gy(h)||gy(g);return a[m][x]}),d=n&&Object.entries(n).reduce((m,h)=>{let[g,x]=h;return x===void 0||(m[g]=x),m},{}),p=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((m,h)=>{let{class:g,className:x,...j}=h;return Object.entries(j).every(b=>{let[_,N]=b;return Array.isArray(N)?N.includes({...l,...d}[_]):{...l,...d}[_]===N})?[...m,g,x]:m},[]);return xy(e,c,p,n==null?void 0:n.class,n==null?void 0:n.className)};function Sw(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=Sw(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function LO(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=Sw(e))&&(r&&(r+=" "),r+=t);return r}const wg="-",DO=e=>{const t=zO(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:c=>{const d=c.split(wg);return d[0]===""&&d.length!==1&&d.shift(),Nw(d,t)||FO(c)},getConflictingClassGroupIds:(c,d)=>{const p=n[c]||[];return d&&r[c]?[...p,...r[c]]:p}}},Nw=(e,t)=>{var c;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),a=r?Nw(e.slice(1),r):void 0;if(a)return a;if(t.validators.length===0)return;const l=e.join(wg);return(c=t.validators.find(({validator:d})=>d(l)))==null?void 0:c.classGroupId},vy=/^\[(.+)\]$/,FO=e=>{if(vy.test(e)){const t=vy.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},zO=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return UO(Object.entries(e.classGroups),n).forEach(([l,c])=>{th(c,r,l,t)}),r},th=(e,t,n,r)=>{e.forEach(a=>{if(typeof a=="string"){const l=a===""?t:yy(t,a);l.classGroupId=n;return}if(typeof a=="function"){if($O(a)){th(a(r),t,n,r);return}t.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([l,c])=>{th(c,yy(t,l),n,r)})})},yy=(e,t)=>{let n=e;return t.split(wg).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},$O=e=>e.isThemeGetter,UO=(e,t)=>t?e.map(([n,r])=>{const a=r.map(l=>typeof l=="string"?t+l:typeof l=="object"?Object.fromEntries(Object.entries(l).map(([c,d])=>[t+c,d])):l);return[n,a]}):e,BO=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const a=(l,c)=>{n.set(l,c),t++,t>e&&(t=0,r=n,n=new Map)};return{get(l){let c=n.get(l);if(c!==void 0)return c;if((c=r.get(l))!==void 0)return a(l,c),c},set(l,c){n.has(l)?n.set(l,c):a(l,c)}}},kw="!",WO=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,a=t[0],l=t.length,c=d=>{const p=[];let m=0,h=0,g;for(let N=0;N<d.length;N++){let y=d[N];if(m===0){if(y===a&&(r||d.slice(N,N+l)===t)){p.push(d.slice(h,N)),h=N+l;continue}if(y==="/"){g=N;continue}}y==="["?m++:y==="]"&&m--}const x=p.length===0?d:d.substring(h),j=x.startsWith(kw),b=j?x.substring(1):x,_=g&&g>h?g-h:void 0;return{modifiers:p,hasImportantModifier:j,baseClassName:b,maybePostfixModifierPosition:_}};return n?d=>n({className:d,parseClassName:c}):c},HO=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},qO=e=>({cache:BO(e.cacheSize),parseClassName:WO(e),...DO(e)}),VO=/\s+/,GO=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a}=t,l=[],c=e.trim().split(VO);let d="";for(let p=c.length-1;p>=0;p-=1){const m=c[p],{modifiers:h,hasImportantModifier:g,baseClassName:x,maybePostfixModifierPosition:j}=n(m);let b=!!j,_=r(b?x.substring(0,j):x);if(!_){if(!b){d=m+(d.length>0?" "+d:d);continue}if(_=r(x),!_){d=m+(d.length>0?" "+d:d);continue}b=!1}const N=HO(h).join(":"),y=g?N+kw:N,w=y+_;if(l.includes(w))continue;l.push(w);const C=a(_,b);for(let R=0;R<C.length;++R){const D=C[R];l.push(y+D)}d=m+(d.length>0?" "+d:d)}return d};function KO(){let e=0,t,n,r="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Cw(t))&&(r&&(r+=" "),r+=n);return r}const Cw=e=>{if(typeof e=="string")return e;let t,n="";for(let r=0;r<e.length;r++)e[r]&&(t=Cw(e[r]))&&(n&&(n+=" "),n+=t);return n};function QO(e,...t){let n,r,a,l=c;function c(p){const m=t.reduce((h,g)=>g(h),e());return n=qO(m),r=n.cache.get,a=n.cache.set,l=d,d(p)}function d(p){const m=r(p);if(m)return m;const h=GO(p,n);return a(p,h),h}return function(){return l(KO.apply(null,arguments))}}const bt=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ew=/^\[(?:([a-z-]+):)?(.+)\]$/i,XO=/^\d+\/\d+$/,YO=new Set(["px","full","screen"]),JO=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ZO=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,eR=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,tR=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,nR=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ii=e=>co(e)||YO.has(e)||XO.test(e),sa=e=>zo(e,"length",uR),co=e=>!!e&&!Number.isNaN(Number(e)),rm=e=>zo(e,"number",co),fl=e=>!!e&&Number.isInteger(Number(e)),rR=e=>e.endsWith("%")&&co(e.slice(0,-1)),Me=e=>Ew.test(e),oa=e=>JO.test(e),iR=new Set(["length","size","percentage"]),aR=e=>zo(e,iR,Aw),sR=e=>zo(e,"position",Aw),oR=new Set(["image","url"]),lR=e=>zo(e,oR,pR),cR=e=>zo(e,"",dR),ml=()=>!0,zo=(e,t,n)=>{const r=Ew.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},uR=e=>ZO.test(e)&&!eR.test(e),Aw=()=>!1,dR=e=>tR.test(e),pR=e=>nR.test(e),fR=()=>{const e=bt("colors"),t=bt("spacing"),n=bt("blur"),r=bt("brightness"),a=bt("borderColor"),l=bt("borderRadius"),c=bt("borderSpacing"),d=bt("borderWidth"),p=bt("contrast"),m=bt("grayscale"),h=bt("hueRotate"),g=bt("invert"),x=bt("gap"),j=bt("gradientColorStops"),b=bt("gradientColorStopPositions"),_=bt("inset"),N=bt("margin"),y=bt("opacity"),w=bt("padding"),C=bt("saturate"),R=bt("scale"),D=bt("sepia"),T=bt("skew"),F=bt("space"),z=bt("translate"),B=()=>["auto","contain","none"],W=()=>["auto","hidden","clip","visible","scroll"],pe=()=>["auto",Me,t],oe=()=>[Me,t],we=()=>["",Ii,sa],be=()=>["auto",co,Me],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],ee=()=>["solid","dashed","dotted","double","none"],le=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],re=()=>["","0",Me],ne=()=>["auto","avoid","all","avoid-page","page","left","right","column"],me=()=>[co,Me];return{cacheSize:500,separator:":",theme:{colors:[ml],spacing:[Ii,sa],blur:["none","",oa,Me],brightness:me(),borderColor:[e],borderRadius:["none","","full",oa,Me],borderSpacing:oe(),borderWidth:we(),contrast:me(),grayscale:re(),hueRotate:me(),invert:re(),gap:oe(),gradientColorStops:[e],gradientColorStopPositions:[rR,sa],inset:pe(),margin:pe(),opacity:me(),padding:oe(),saturate:me(),scale:me(),sepia:re(),skew:me(),space:oe(),translate:oe()},classGroups:{aspect:[{aspect:["auto","square","video",Me]}],container:["container"],columns:[{columns:[oa]}],"break-after":[{"break-after":ne()}],"break-before":[{"break-before":ne()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),Me]}],overflow:[{overflow:W()}],"overflow-x":[{"overflow-x":W()}],"overflow-y":[{"overflow-y":W()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",fl,Me]}],basis:[{basis:pe()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Me]}],grow:[{grow:re()}],shrink:[{shrink:re()}],order:[{order:["first","last","none",fl,Me]}],"grid-cols":[{"grid-cols":[ml]}],"col-start-end":[{col:["auto",{span:["full",fl,Me]},Me]}],"col-start":[{"col-start":be()}],"col-end":[{"col-end":be()}],"grid-rows":[{"grid-rows":[ml]}],"row-start-end":[{row:["auto",{span:[fl,Me]},Me]}],"row-start":[{"row-start":be()}],"row-end":[{"row-end":be()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Me]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Me]}],gap:[{gap:[x]}],"gap-x":[{"gap-x":[x]}],"gap-y":[{"gap-y":[x]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[N]}],mx:[{mx:[N]}],my:[{my:[N]}],ms:[{ms:[N]}],me:[{me:[N]}],mt:[{mt:[N]}],mr:[{mr:[N]}],mb:[{mb:[N]}],ml:[{ml:[N]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Me,t]}],"min-w":[{"min-w":[Me,t,"min","max","fit"]}],"max-w":[{"max-w":[Me,t,"none","full","min","max","fit","prose",{screen:[oa]},oa]}],h:[{h:[Me,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Me,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Me,t,"auto","min","max","fit"]}],"font-size":[{text:["base",oa,sa]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",rm]}],"font-family":[{font:[ml]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Me]}],"line-clamp":[{"line-clamp":["none",co,rm]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ii,Me]}],"list-image":[{"list-image":["none",Me]}],"list-style-type":[{list:["none","disc","decimal",Me]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ee(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ii,sa]}],"underline-offset":[{"underline-offset":["auto",Ii,Me]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:oe()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Me]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Me]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),sR]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",aR]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},lR]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[b]}],"gradient-via-pos":[{via:[b]}],"gradient-to-pos":[{to:[b]}],"gradient-from":[{from:[j]}],"gradient-via":[{via:[j]}],"gradient-to":[{to:[j]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[d]}],"border-w-x":[{"border-x":[d]}],"border-w-y":[{"border-y":[d]}],"border-w-s":[{"border-s":[d]}],"border-w-e":[{"border-e":[d]}],"border-w-t":[{"border-t":[d]}],"border-w-r":[{"border-r":[d]}],"border-w-b":[{"border-b":[d]}],"border-w-l":[{"border-l":[d]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...ee(),"hidden"]}],"divide-x":[{"divide-x":[d]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[d]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:ee()}],"border-color":[{border:[a]}],"border-color-x":[{"border-x":[a]}],"border-color-y":[{"border-y":[a]}],"border-color-s":[{"border-s":[a]}],"border-color-e":[{"border-e":[a]}],"border-color-t":[{"border-t":[a]}],"border-color-r":[{"border-r":[a]}],"border-color-b":[{"border-b":[a]}],"border-color-l":[{"border-l":[a]}],"divide-color":[{divide:[a]}],"outline-style":[{outline:["",...ee()]}],"outline-offset":[{"outline-offset":[Ii,Me]}],"outline-w":[{outline:[Ii,sa]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:we()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ii,sa]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",oa,cR]}],"shadow-color":[{shadow:[ml]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...le(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":le()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[p]}],"drop-shadow":[{"drop-shadow":["","none",oa,Me]}],grayscale:[{grayscale:[m]}],"hue-rotate":[{"hue-rotate":[h]}],invert:[{invert:[g]}],saturate:[{saturate:[C]}],sepia:[{sepia:[D]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[p]}],"backdrop-grayscale":[{"backdrop-grayscale":[m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[h]}],"backdrop-invert":[{"backdrop-invert":[g]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[C]}],"backdrop-sepia":[{"backdrop-sepia":[D]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[c]}],"border-spacing-x":[{"border-spacing-x":[c]}],"border-spacing-y":[{"border-spacing-y":[c]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Me]}],duration:[{duration:me()}],ease:[{ease:["linear","in","out","in-out",Me]}],delay:[{delay:me()}],animate:[{animate:["none","spin","ping","pulse","bounce",Me]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[R]}],"scale-x":[{"scale-x":[R]}],"scale-y":[{"scale-y":[R]}],rotate:[{rotate:[fl,Me]}],"translate-x":[{"translate-x":[z]}],"translate-y":[{"translate-y":[z]}],"skew-x":[{"skew-x":[T]}],"skew-y":[{"skew-y":[T]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Me]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Me]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":oe()}],"scroll-mx":[{"scroll-mx":oe()}],"scroll-my":[{"scroll-my":oe()}],"scroll-ms":[{"scroll-ms":oe()}],"scroll-me":[{"scroll-me":oe()}],"scroll-mt":[{"scroll-mt":oe()}],"scroll-mr":[{"scroll-mr":oe()}],"scroll-mb":[{"scroll-mb":oe()}],"scroll-ml":[{"scroll-ml":oe()}],"scroll-p":[{"scroll-p":oe()}],"scroll-px":[{"scroll-px":oe()}],"scroll-py":[{"scroll-py":oe()}],"scroll-ps":[{"scroll-ps":oe()}],"scroll-pe":[{"scroll-pe":oe()}],"scroll-pt":[{"scroll-pt":oe()}],"scroll-pr":[{"scroll-pr":oe()}],"scroll-pb":[{"scroll-pb":oe()}],"scroll-pl":[{"scroll-pl":oe()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Me]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ii,sa,rm]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},mR=QO(fR);function Jr(...e){return mR(LO(e))}const hR=MO("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground",information:"border-transparent bg-blue-100 text-blue-800 hover:bg-blue-600",important:"border-transparent bg-red-100 text-red-800 hover:bg-red-600",warning:"border-transparent bg-yellow-100 text-yellow-800 hover:bg-yellow-600",success:"border-transparent bg-green-100 text-green-800 hover:bg-green-600"}},defaultVariants:{variant:"default"}});function ga({className:e,variant:t,...n}){return s.jsx("div",{className:Jr(hR({variant:t}),e),...n})}var Pw={exports:{}},vr={},Tw={exports:{}},Ow={};/**
|
458
458
|
* @license React
|
459
459
|
* scheduler.production.min.js
|
460
460
|
*
|
@@ -477,8 +477,8 @@ function print() { __p += __j.call(arguments, '') }
|
|
477
477
|
`+a[c].replace(" at new "," at ");return e.displayName&&p.includes("<anonymous>")&&(p=p.replace("<anonymous>",e.displayName)),p}while(1<=c&&0<=d);break}}}finally{am=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Sl(e):""}function _R(e){switch(e.tag){case 5:return Sl(e.type);case 16:return Sl("Lazy");case 13:return Sl("Suspense");case 19:return Sl("SuspenseList");case 0:case 2:case 15:return e=sm(e.type,!1),e;case 11:return e=sm(e.type.render,!1),e;case 1:return e=sm(e.type,!0),e;default:return""}}function sh(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 Ys:return"Fragment";case Xs:return"Portal";case rh:return"Profiler";case Ng:return"StrictMode";case ih:return"Suspense";case ah:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mw:return(e.displayName||"Context")+".Consumer";case Iw:return(e._context.displayName||"Context")+".Provider";case kg:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Cg:return t=e.displayName||null,t!==null?t:sh(e.type)||"Memo";case da:t=e._payload,e=e._init;try{return sh(e(t))}catch{}}return null}function jR(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return sh(t);case 8:return t===Ng?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Pa(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Dw(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function SR(e){var t=Dw(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 a=n.get,l=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(c){r=""+c,l.call(this,c)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(c){r=""+c},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ou(e){e._valueTracker||(e._valueTracker=SR(e))}function Fw(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Dw(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function _d(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 oh(e,t){var n=t.checked;return Ot({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function jy(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Pa(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 zw(e,t){t=t.checked,t!=null&&Sg(e,"checked",t,!1)}function lh(e,t){zw(e,t);var n=Pa(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")?ch(e,t.type,n):t.hasOwnProperty("defaultValue")&&ch(e,t.type,Pa(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Sy(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 ch(e,t,n){(t!=="number"||_d(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Nl=Array.isArray;function uo(e,t,n,r){if(e=e.options,t){t={};for(var a=0;a<n.length;a++)t["$"+n[a]]=!0;for(n=0;n<e.length;n++)a=t.hasOwnProperty("$"+e[n].value),e[n].selected!==a&&(e[n].selected=a),a&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Pa(n),t=null,a=0;a<e.length;a++){if(e[a].value===n){e[a].selected=!0,r&&(e[a].defaultSelected=!0);return}t!==null||e[a].disabled||(t=e[a])}t!==null&&(t.selected=!0)}}function uh(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(te(91));return Ot({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ny(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(te(92));if(Nl(n)){if(1<n.length)throw Error(te(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Pa(n)}}function $w(e,t){var n=Pa(t.value),r=Pa(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 ky(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Uw(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 dh(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Uw(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Ru,Bw=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,a){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,a)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Ru=Ru||document.createElement("div"),Ru.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Ru.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Tl={animationIterationCount:!0,aspectRatio:!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},NR=["Webkit","ms","Moz","O"];Object.keys(Tl).forEach(function(e){NR.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Tl[t]=Tl[e]})});function Ww(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Tl.hasOwnProperty(e)&&Tl[e]?(""+t).trim():t+"px"}function Hw(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,a=Ww(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,a):e[n]=a}}var kR=Ot({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 ph(e,t){if(t){if(kR[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(te(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(te(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(te(61))}if(t.style!=null&&typeof t.style!="object")throw Error(te(62))}}function fh(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}}var mh=null;function Eg(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hh=null,po=null,fo=null;function Cy(e){if(e=bc(e)){if(typeof hh!="function")throw Error(te(280));var t=e.stateNode;t&&(t=cp(t),hh(e.stateNode,e.type,t))}}function qw(e){po?fo?fo.push(e):fo=[e]:po=e}function Vw(){if(po){var e=po,t=fo;if(fo=po=null,Cy(e),t)for(e=0;e<t.length;e++)Cy(t[e])}}function Gw(e,t){return e(t)}function Kw(){}var om=!1;function Qw(e,t,n){if(om)return e(t,n);om=!0;try{return Gw(e,t,n)}finally{om=!1,(po!==null||fo!==null)&&(Kw(),Vw())}}function ql(e,t){var n=e.stateNode;if(n===null)return null;var r=cp(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(te(231,t,typeof n));return n}var gh=!1;if(Ui)try{var gl={};Object.defineProperty(gl,"passive",{get:function(){gh=!0}}),window.addEventListener("test",gl,gl),window.removeEventListener("test",gl,gl)}catch{gh=!1}function CR(e,t,n,r,a,l,c,d,p){var m=Array.prototype.slice.call(arguments,3);try{t.apply(n,m)}catch(h){this.onError(h)}}var Ol=!1,jd=null,Sd=!1,xh=null,ER={onError:function(e){Ol=!0,jd=e}};function AR(e,t,n,r,a,l,c,d,p){Ol=!1,jd=null,CR.apply(ER,arguments)}function PR(e,t,n,r,a,l,c,d,p){if(AR.apply(this,arguments),Ol){if(Ol){var m=jd;Ol=!1,jd=null}else throw Error(te(198));Sd||(Sd=!0,xh=m)}}function ys(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Xw(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Ey(e){if(ys(e)!==e)throw Error(te(188))}function TR(e){var t=e.alternate;if(!t){if(t=ys(e),t===null)throw Error(te(188));return t!==e?null:e}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var l=a.alternate;if(l===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===l.child){for(l=a.child;l;){if(l===n)return Ey(a),e;if(l===r)return Ey(a),t;l=l.sibling}throw Error(te(188))}if(n.return!==r.return)n=a,r=l;else{for(var c=!1,d=a.child;d;){if(d===n){c=!0,n=a,r=l;break}if(d===r){c=!0,r=a,n=l;break}d=d.sibling}if(!c){for(d=l.child;d;){if(d===n){c=!0,n=l,r=a;break}if(d===r){c=!0,r=l,n=a;break}d=d.sibling}if(!c)throw Error(te(189))}}if(n.alternate!==r)throw Error(te(190))}if(n.tag!==3)throw Error(te(188));return n.stateNode.current===n?e:t}function Yw(e){return e=TR(e),e!==null?Jw(e):null}function Jw(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Jw(e);if(t!==null)return t;e=e.sibling}return null}var Zw=xr.unstable_scheduleCallback,Ay=xr.unstable_cancelCallback,OR=xr.unstable_shouldYield,RR=xr.unstable_requestPaint,Ut=xr.unstable_now,IR=xr.unstable_getCurrentPriorityLevel,Ag=xr.unstable_ImmediatePriority,e_=xr.unstable_UserBlockingPriority,Nd=xr.unstable_NormalPriority,MR=xr.unstable_LowPriority,t_=xr.unstable_IdlePriority,ap=null,bi=null;function LR(e){if(bi&&typeof bi.onCommitFiberRoot=="function")try{bi.onCommitFiberRoot(ap,e,void 0,(e.current.flags&128)===128)}catch{}}var ei=Math.clz32?Math.clz32:zR,DR=Math.log,FR=Math.LN2;function zR(e){return e>>>=0,e===0?32:31-(DR(e)/FR|0)|0}var Iu=64,Mu=4194304;function kl(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function kd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,a=e.suspendedLanes,l=e.pingedLanes,c=n&268435455;if(c!==0){var d=c&~a;d!==0?r=kl(d):(l&=c,l!==0&&(r=kl(l)))}else c=n&~a,c!==0?r=kl(c):l!==0&&(r=kl(l));if(r===0)return 0;if(t!==0&&t!==r&&!(t&a)&&(a=r&-r,l=t&-t,a>=l||a===16&&(l&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-ei(t),a=1<<n,r|=e[n],t&=~a;return r}function $R(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function UR(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,a=e.expirationTimes,l=e.pendingLanes;0<l;){var c=31-ei(l),d=1<<c,p=a[c];p===-1?(!(d&n)||d&r)&&(a[c]=$R(d,t)):p<=t&&(e.expiredLanes|=d),l&=~d}}function vh(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function n_(){var e=Iu;return Iu<<=1,!(Iu&4194240)&&(Iu=64),e}function lm(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function vc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ei(t),e[t]=n}function BR(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var a=31-ei(n),l=1<<a;t[a]=0,r[a]=-1,e[a]=-1,n&=~l}}function Pg(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ei(n),a=1<<r;a&t|e[r]&t&&(e[r]|=t),n&=~a}}var et=0;function r_(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var i_,Tg,a_,s_,o_,yh=!1,Lu=[],ya=null,ba=null,wa=null,Vl=new Map,Gl=new Map,fa=[],WR="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Py(e,t){switch(e){case"focusin":case"focusout":ya=null;break;case"dragenter":case"dragleave":ba=null;break;case"mouseover":case"mouseout":wa=null;break;case"pointerover":case"pointerout":Vl.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(t.pointerId)}}function xl(e,t,n,r,a,l){return e===null||e.nativeEvent!==l?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:l,targetContainers:[a]},t!==null&&(t=bc(t),t!==null&&Tg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,a!==null&&t.indexOf(a)===-1&&t.push(a),e)}function HR(e,t,n,r,a){switch(t){case"focusin":return ya=xl(ya,e,t,n,r,a),!0;case"dragenter":return ba=xl(ba,e,t,n,r,a),!0;case"mouseover":return wa=xl(wa,e,t,n,r,a),!0;case"pointerover":var l=a.pointerId;return Vl.set(l,xl(Vl.get(l)||null,e,t,n,r,a)),!0;case"gotpointercapture":return l=a.pointerId,Gl.set(l,xl(Gl.get(l)||null,e,t,n,r,a)),!0}return!1}function l_(e){var t=ts(e.target);if(t!==null){var n=ys(t);if(n!==null){if(t=n.tag,t===13){if(t=Xw(n),t!==null){e.blockedOn=t,o_(e.priority,function(){a_(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function rd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=bh(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);mh=r,n.target.dispatchEvent(r),mh=null}else return t=bc(n),t!==null&&Tg(t),e.blockedOn=n,!1;t.shift()}return!0}function Ty(e,t,n){rd(e)&&n.delete(t)}function qR(){yh=!1,ya!==null&&rd(ya)&&(ya=null),ba!==null&&rd(ba)&&(ba=null),wa!==null&&rd(wa)&&(wa=null),Vl.forEach(Ty),Gl.forEach(Ty)}function vl(e,t){e.blockedOn===t&&(e.blockedOn=null,yh||(yh=!0,xr.unstable_scheduleCallback(xr.unstable_NormalPriority,qR)))}function Kl(e){function t(a){return vl(a,e)}if(0<Lu.length){vl(Lu[0],e);for(var n=1;n<Lu.length;n++){var r=Lu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ya!==null&&vl(ya,e),ba!==null&&vl(ba,e),wa!==null&&vl(wa,e),Vl.forEach(t),Gl.forEach(t),n=0;n<fa.length;n++)r=fa[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<fa.length&&(n=fa[0],n.blockedOn===null);)l_(n),n.blockedOn===null&&fa.shift()}var mo=Vi.ReactCurrentBatchConfig,Cd=!0;function VR(e,t,n,r){var a=et,l=mo.transition;mo.transition=null;try{et=1,Og(e,t,n,r)}finally{et=a,mo.transition=l}}function GR(e,t,n,r){var a=et,l=mo.transition;mo.transition=null;try{et=4,Og(e,t,n,r)}finally{et=a,mo.transition=l}}function Og(e,t,n,r){if(Cd){var a=bh(e,t,n,r);if(a===null)vm(e,t,r,Ed,n),Py(e,r);else if(HR(a,e,t,n,r))r.stopPropagation();else if(Py(e,r),t&4&&-1<WR.indexOf(e)){for(;a!==null;){var l=bc(a);if(l!==null&&i_(l),l=bh(e,t,n,r),l===null&&vm(e,t,r,Ed,n),l===a)break;a=l}a!==null&&r.stopPropagation()}else vm(e,t,r,null,n)}}var Ed=null;function bh(e,t,n,r){if(Ed=null,e=Eg(r),e=ts(e),e!==null)if(t=ys(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Xw(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Ed=e,null}function c_(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(IR()){case Ag:return 1;case e_:return 4;case Nd:case MR:return 16;case t_:return 536870912;default:return 16}default:return 16}}var xa=null,Rg=null,id=null;function u_(){if(id)return id;var e,t=Rg,n=t.length,r,a="value"in xa?xa.value:xa.textContent,l=a.length;for(e=0;e<n&&t[e]===a[e];e++);var c=n-e;for(r=1;r<=c&&t[n-r]===a[l-r];r++);return id=a.slice(e,1<r?1-r:void 0)}function ad(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Du(){return!0}function Oy(){return!1}function yr(e){function t(n,r,a,l,c){this._reactName=n,this._targetInst=a,this.type=r,this.nativeEvent=l,this.target=c,this.currentTarget=null;for(var d in e)e.hasOwnProperty(d)&&(n=e[d],this[d]=n?n(l):l[d]);return this.isDefaultPrevented=(l.defaultPrevented!=null?l.defaultPrevented:l.returnValue===!1)?Du:Oy,this.isPropagationStopped=Oy,this}return Ot(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Du)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Du)},persist:function(){},isPersistent:Du}),t}var $o={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ig=yr($o),yc=Ot({},$o,{view:0,detail:0}),KR=yr(yc),cm,um,yl,sp=Ot({},yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mg,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yl&&(yl&&e.type==="mousemove"?(cm=e.screenX-yl.screenX,um=e.screenY-yl.screenY):um=cm=0,yl=e),cm)},movementY:function(e){return"movementY"in e?e.movementY:um}}),Ry=yr(sp),QR=Ot({},sp,{dataTransfer:0}),XR=yr(QR),YR=Ot({},yc,{relatedTarget:0}),dm=yr(YR),JR=Ot({},$o,{animationName:0,elapsedTime:0,pseudoElement:0}),ZR=yr(JR),e6=Ot({},$o,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),t6=yr(e6),n6=Ot({},$o,{data:0}),Iy=yr(n6),r6={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},i6={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},a6={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function s6(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=a6[e])?!!t[e]:!1}function Mg(){return s6}var o6=Ot({},yc,{key:function(e){if(e.key){var t=r6[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ad(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?i6[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mg,charCode:function(e){return e.type==="keypress"?ad(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ad(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),l6=yr(o6),c6=Ot({},sp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),My=yr(c6),u6=Ot({},yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mg}),d6=yr(u6),p6=Ot({},$o,{propertyName:0,elapsedTime:0,pseudoElement:0}),f6=yr(p6),m6=Ot({},sp,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),h6=yr(m6),g6=[9,13,27,32],Lg=Ui&&"CompositionEvent"in window,Rl=null;Ui&&"documentMode"in document&&(Rl=document.documentMode);var x6=Ui&&"TextEvent"in window&&!Rl,d_=Ui&&(!Lg||Rl&&8<Rl&&11>=Rl),Ly=" ",Dy=!1;function p_(e,t){switch(e){case"keyup":return g6.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function f_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Js=!1;function v6(e,t){switch(e){case"compositionend":return f_(t);case"keypress":return t.which!==32?null:(Dy=!0,Ly);case"textInput":return e=t.data,e===Ly&&Dy?null:e;default:return null}}function y6(e,t){if(Js)return e==="compositionend"||!Lg&&p_(e,t)?(e=u_(),id=Rg=xa=null,Js=!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.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return d_&&t.locale!=="ko"?null:t.data;default:return null}}var b6={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Fy(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!b6[e.type]:t==="textarea"}function m_(e,t,n,r){qw(r),t=Ad(t,"onChange"),0<t.length&&(n=new Ig("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Il=null,Ql=null;function w6(e){N_(e,0)}function op(e){var t=to(e);if(Fw(t))return e}function _6(e,t){if(e==="change")return t}var h_=!1;if(Ui){var pm;if(Ui){var fm="oninput"in document;if(!fm){var zy=document.createElement("div");zy.setAttribute("oninput","return;"),fm=typeof zy.oninput=="function"}pm=fm}else pm=!1;h_=pm&&(!document.documentMode||9<document.documentMode)}function $y(){Il&&(Il.detachEvent("onpropertychange",g_),Ql=Il=null)}function g_(e){if(e.propertyName==="value"&&op(Ql)){var t=[];m_(t,Ql,e,Eg(e)),Qw(w6,t)}}function j6(e,t,n){e==="focusin"?($y(),Il=t,Ql=n,Il.attachEvent("onpropertychange",g_)):e==="focusout"&&$y()}function S6(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return op(Ql)}function N6(e,t){if(e==="click")return op(t)}function k6(e,t){if(e==="input"||e==="change")return op(t)}function C6(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ni=typeof Object.is=="function"?Object.is:C6;function Xl(e,t){if(ni(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var a=n[r];if(!nh.call(t,a)||!ni(e[a],t[a]))return!1}return!0}function Uy(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function By(e,t){var n=Uy(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=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=Uy(n)}}function x_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?x_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function v_(){for(var e=window,t=_d();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=_d(e.document)}return t}function Dg(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")}function E6(e){var t=v_(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&x_(n.ownerDocument.documentElement,n)){if(r!==null&&Dg(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=n.textContent.length,l=Math.min(r.start,a);r=r.end===void 0?l:Math.min(r.end,a),!e.extend&&l>r&&(a=r,r=l,l=a),a=By(n,l);var c=By(n,r);a&&c&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==c.node||e.focusOffset!==c.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),l>r?(e.addRange(t),e.extend(c.node,c.offset)):(t.setEnd(c.node,c.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var A6=Ui&&"documentMode"in document&&11>=document.documentMode,Zs=null,wh=null,Ml=null,_h=!1;function Wy(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;_h||Zs==null||Zs!==_d(r)||(r=Zs,"selectionStart"in r&&Dg(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}),Ml&&Xl(Ml,r)||(Ml=r,r=Ad(wh,"onSelect"),0<r.length&&(t=new Ig("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Zs)))}function Fu(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var eo={animationend:Fu("Animation","AnimationEnd"),animationiteration:Fu("Animation","AnimationIteration"),animationstart:Fu("Animation","AnimationStart"),transitionend:Fu("Transition","TransitionEnd")},mm={},y_={};Ui&&(y_=document.createElement("div").style,"AnimationEvent"in window||(delete eo.animationend.animation,delete eo.animationiteration.animation,delete eo.animationstart.animation),"TransitionEvent"in window||delete eo.transitionend.transition);function lp(e){if(mm[e])return mm[e];if(!eo[e])return e;var t=eo[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in y_)return mm[e]=t[n];return e}var b_=lp("animationend"),w_=lp("animationiteration"),__=lp("animationstart"),j_=lp("transitionend"),S_=new Map,Hy="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Ra(e,t){S_.set(e,t),vs(t,[e])}for(var hm=0;hm<Hy.length;hm++){var gm=Hy[hm],P6=gm.toLowerCase(),T6=gm[0].toUpperCase()+gm.slice(1);Ra(P6,"on"+T6)}Ra(b_,"onAnimationEnd");Ra(w_,"onAnimationIteration");Ra(__,"onAnimationStart");Ra("dblclick","onDoubleClick");Ra("focusin","onFocus");Ra("focusout","onBlur");Ra(j_,"onTransitionEnd");jo("onMouseEnter",["mouseout","mouseover"]);jo("onMouseLeave",["mouseout","mouseover"]);jo("onPointerEnter",["pointerout","pointerover"]);jo("onPointerLeave",["pointerout","pointerover"]);vs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));vs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));vs("onBeforeInput",["compositionend","keypress","textInput","paste"]);vs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));vs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));vs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cl="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),O6=new Set("cancel close invalid load scroll toggle".split(" ").concat(Cl));function qy(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,PR(r,t,void 0,e),e.currentTarget=null}function N_(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],a=r.event;r=r.listeners;e:{var l=void 0;if(t)for(var c=r.length-1;0<=c;c--){var d=r[c],p=d.instance,m=d.currentTarget;if(d=d.listener,p!==l&&a.isPropagationStopped())break e;qy(a,d,m),l=p}else for(c=0;c<r.length;c++){if(d=r[c],p=d.instance,m=d.currentTarget,d=d.listener,p!==l&&a.isPropagationStopped())break e;qy(a,d,m),l=p}}}if(Sd)throw e=xh,Sd=!1,xh=null,e}function wt(e,t){var n=t[Ch];n===void 0&&(n=t[Ch]=new Set);var r=e+"__bubble";n.has(r)||(k_(t,e,2,!1),n.add(r))}function xm(e,t,n){var r=0;t&&(r|=4),k_(n,e,r,t)}var zu="_reactListening"+Math.random().toString(36).slice(2);function Yl(e){if(!e[zu]){e[zu]=!0,Rw.forEach(function(n){n!=="selectionchange"&&(O6.has(n)||xm(n,!1,e),xm(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[zu]||(t[zu]=!0,xm("selectionchange",!1,t))}}function k_(e,t,n,r){switch(c_(t)){case 1:var a=VR;break;case 4:a=GR;break;default:a=Og}n=a.bind(null,t,n,e),a=void 0,!gh||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(a=!0),r?a!==void 0?e.addEventListener(t,n,{capture:!0,passive:a}):e.addEventListener(t,n,!0):a!==void 0?e.addEventListener(t,n,{passive:a}):e.addEventListener(t,n,!1)}function vm(e,t,n,r,a){var l=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var c=r.tag;if(c===3||c===4){var d=r.stateNode.containerInfo;if(d===a||d.nodeType===8&&d.parentNode===a)break;if(c===4)for(c=r.return;c!==null;){var p=c.tag;if((p===3||p===4)&&(p=c.stateNode.containerInfo,p===a||p.nodeType===8&&p.parentNode===a))return;c=c.return}for(;d!==null;){if(c=ts(d),c===null)return;if(p=c.tag,p===5||p===6){r=l=c;continue e}d=d.parentNode}}r=r.return}Qw(function(){var m=l,h=Eg(n),g=[];e:{var x=S_.get(e);if(x!==void 0){var j=Ig,b=e;switch(e){case"keypress":if(ad(n)===0)break e;case"keydown":case"keyup":j=l6;break;case"focusin":b="focus",j=dm;break;case"focusout":b="blur",j=dm;break;case"beforeblur":case"afterblur":j=dm;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=Ry;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=XR;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=d6;break;case b_:case w_:case __:j=ZR;break;case j_:j=f6;break;case"scroll":j=KR;break;case"wheel":j=h6;break;case"copy":case"cut":case"paste":j=t6;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=My}var _=(t&4)!==0,N=!_&&e==="scroll",y=_?x!==null?x+"Capture":null:x;_=[];for(var w=m,C;w!==null;){C=w;var R=C.stateNode;if(C.tag===5&&R!==null&&(C=R,y!==null&&(R=ql(w,y),R!=null&&_.push(Jl(w,R,C)))),N)break;w=w.return}0<_.length&&(x=new j(x,b,null,n,h),g.push({event:x,listeners:_}))}}if(!(t&7)){e:{if(x=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",x&&n!==mh&&(b=n.relatedTarget||n.fromElement)&&(ts(b)||b[Bi]))break e;if((j||x)&&(x=h.window===h?h:(x=h.ownerDocument)?x.defaultView||x.parentWindow:window,j?(b=n.relatedTarget||n.toElement,j=m,b=b?ts(b):null,b!==null&&(N=ys(b),b!==N||b.tag!==5&&b.tag!==6)&&(b=null)):(j=null,b=m),j!==b)){if(_=Ry,R="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(_=My,R="onPointerLeave",y="onPointerEnter",w="pointer"),N=j==null?x:to(j),C=b==null?x:to(b),x=new _(R,w+"leave",j,n,h),x.target=N,x.relatedTarget=C,R=null,ts(h)===m&&(_=new _(y,w+"enter",b,n,h),_.target=C,_.relatedTarget=N,R=_),N=R,j&&b)t:{for(_=j,y=b,w=0,C=_;C;C=Ks(C))w++;for(C=0,R=y;R;R=Ks(R))C++;for(;0<w-C;)_=Ks(_),w--;for(;0<C-w;)y=Ks(y),C--;for(;w--;){if(_===y||y!==null&&_===y.alternate)break t;_=Ks(_),y=Ks(y)}_=null}else _=null;j!==null&&Vy(g,x,j,_,!1),b!==null&&N!==null&&Vy(g,N,b,_,!0)}}e:{if(x=m?to(m):window,j=x.nodeName&&x.nodeName.toLowerCase(),j==="select"||j==="input"&&x.type==="file")var D=_6;else if(Fy(x))if(h_)D=k6;else{D=S6;var T=j6}else(j=x.nodeName)&&j.toLowerCase()==="input"&&(x.type==="checkbox"||x.type==="radio")&&(D=N6);if(D&&(D=D(e,m))){m_(g,D,n,h);break e}T&&T(e,x,m),e==="focusout"&&(T=x._wrapperState)&&T.controlled&&x.type==="number"&&ch(x,"number",x.value)}switch(T=m?to(m):window,e){case"focusin":(Fy(T)||T.contentEditable==="true")&&(Zs=T,wh=m,Ml=null);break;case"focusout":Ml=wh=Zs=null;break;case"mousedown":_h=!0;break;case"contextmenu":case"mouseup":case"dragend":_h=!1,Wy(g,n,h);break;case"selectionchange":if(A6)break;case"keydown":case"keyup":Wy(g,n,h)}var F;if(Lg)e:{switch(e){case"compositionstart":var z="onCompositionStart";break e;case"compositionend":z="onCompositionEnd";break e;case"compositionupdate":z="onCompositionUpdate";break e}z=void 0}else Js?p_(e,n)&&(z="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(z="onCompositionStart");z&&(d_&&n.locale!=="ko"&&(Js||z!=="onCompositionStart"?z==="onCompositionEnd"&&Js&&(F=u_()):(xa=h,Rg="value"in xa?xa.value:xa.textContent,Js=!0)),T=Ad(m,z),0<T.length&&(z=new Iy(z,e,null,n,h),g.push({event:z,listeners:T}),F?z.data=F:(F=f_(n),F!==null&&(z.data=F)))),(F=x6?v6(e,n):y6(e,n))&&(m=Ad(m,"onBeforeInput"),0<m.length&&(h=new Iy("onBeforeInput","beforeinput",null,n,h),g.push({event:h,listeners:m}),h.data=F))}N_(g,t)})}function Jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ad(e,t){for(var n=t+"Capture",r=[];e!==null;){var a=e,l=a.stateNode;a.tag===5&&l!==null&&(a=l,l=ql(e,n),l!=null&&r.unshift(Jl(e,l,a)),l=ql(e,t),l!=null&&r.push(Jl(e,l,a))),e=e.return}return r}function Ks(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Vy(e,t,n,r,a){for(var l=t._reactName,c=[];n!==null&&n!==r;){var d=n,p=d.alternate,m=d.stateNode;if(p!==null&&p===r)break;d.tag===5&&m!==null&&(d=m,a?(p=ql(n,l),p!=null&&c.unshift(Jl(n,p,d))):a||(p=ql(n,l),p!=null&&c.push(Jl(n,p,d)))),n=n.return}c.length!==0&&e.push({event:t,listeners:c})}var R6=/\r\n?/g,I6=/\u0000|\uFFFD/g;function Gy(e){return(typeof e=="string"?e:""+e).replace(R6,`
|
478
478
|
`).replace(I6,"")}function $u(e,t,n){if(t=Gy(t),Gy(e)!==t&&n)throw Error(te(425))}function Pd(){}var jh=null,Sh=null;function Nh(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var kh=typeof setTimeout=="function"?setTimeout:void 0,M6=typeof clearTimeout=="function"?clearTimeout:void 0,Ky=typeof Promise=="function"?Promise:void 0,L6=typeof queueMicrotask=="function"?queueMicrotask:typeof Ky<"u"?function(e){return Ky.resolve(null).then(e).catch(D6)}:kh;function D6(e){setTimeout(function(){throw e})}function ym(e,t){var n=t,r=0;do{var a=n.nextSibling;if(e.removeChild(n),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(r===0){e.removeChild(a),Kl(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=a}while(n);Kl(t)}function _a(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Qy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Uo=Math.random().toString(36).slice(2),vi="__reactFiber$"+Uo,Zl="__reactProps$"+Uo,Bi="__reactContainer$"+Uo,Ch="__reactEvents$"+Uo,F6="__reactListeners$"+Uo,z6="__reactHandles$"+Uo;function ts(e){var t=e[vi];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Bi]||n[vi]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Qy(e);e!==null;){if(n=e[vi])return n;e=Qy(e)}return t}e=n,n=e.parentNode}return null}function bc(e){return e=e[vi]||e[Bi],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function to(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(te(33))}function cp(e){return e[Zl]||null}var Eh=[],no=-1;function Ia(e){return{current:e}}function _t(e){0>no||(e.current=Eh[no],Eh[no]=null,no--)}function ht(e,t){no++,Eh[no]=e.current,e.current=t}var Ta={},jn=Ia(Ta),Yn=Ia(!1),fs=Ta;function So(e,t){var n=e.type.contextTypes;if(!n)return Ta;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var a={},l;for(l in n)a[l]=t[l];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function Jn(e){return e=e.childContextTypes,e!=null}function Td(){_t(Yn),_t(jn)}function Xy(e,t,n){if(jn.current!==Ta)throw Error(te(168));ht(jn,t),ht(Yn,n)}function C_(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var a in r)if(!(a in t))throw Error(te(108,jR(e)||"Unknown",a));return Ot({},n,r)}function Od(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ta,fs=jn.current,ht(jn,e),ht(Yn,Yn.current),!0}function Yy(e,t,n){var r=e.stateNode;if(!r)throw Error(te(169));n?(e=C_(e,t,fs),r.__reactInternalMemoizedMergedChildContext=e,_t(Yn),_t(jn),ht(jn,e)):_t(Yn),ht(Yn,n)}var Li=null,up=!1,bm=!1;function E_(e){Li===null?Li=[e]:Li.push(e)}function $6(e){up=!0,E_(e)}function Ma(){if(!bm&&Li!==null){bm=!0;var e=0,t=et;try{var n=Li;for(et=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Li=null,up=!1}catch(a){throw Li!==null&&(Li=Li.slice(e+1)),Zw(Ag,Ma),a}finally{et=t,bm=!1}}return null}var ro=[],io=0,Rd=null,Id=0,Tr=[],Or=0,ms=null,Fi=1,zi="";function Xa(e,t){ro[io++]=Id,ro[io++]=Rd,Rd=e,Id=t}function A_(e,t,n){Tr[Or++]=Fi,Tr[Or++]=zi,Tr[Or++]=ms,ms=e;var r=Fi;e=zi;var a=32-ei(r)-1;r&=~(1<<a),n+=1;var l=32-ei(t)+a;if(30<l){var c=a-a%5;l=(r&(1<<c)-1).toString(32),r>>=c,a-=c,Fi=1<<32-ei(t)+a|n<<a|r,zi=l+e}else Fi=1<<l|n<<a|r,zi=e}function Fg(e){e.return!==null&&(Xa(e,1),A_(e,1,0))}function zg(e){for(;e===Rd;)Rd=ro[--io],ro[io]=null,Id=ro[--io],ro[io]=null;for(;e===ms;)ms=Tr[--Or],Tr[Or]=null,zi=Tr[--Or],Tr[Or]=null,Fi=Tr[--Or],Tr[Or]=null}var gr=null,mr=null,Ct=!1,Yr=null;function P_(e,t){var n=Rr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function Jy(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,gr=e,mr=_a(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,gr=e,mr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ms!==null?{id:Fi,overflow:zi}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Rr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,gr=e,mr=null,!0):!1;default:return!1}}function Ah(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ph(e){if(Ct){var t=mr;if(t){var n=t;if(!Jy(e,t)){if(Ah(e))throw Error(te(418));t=_a(n.nextSibling);var r=gr;t&&Jy(e,t)?P_(r,n):(e.flags=e.flags&-4097|2,Ct=!1,gr=e)}}else{if(Ah(e))throw Error(te(418));e.flags=e.flags&-4097|2,Ct=!1,gr=e}}}function Zy(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;gr=e}function Uu(e){if(e!==gr)return!1;if(!Ct)return Zy(e),Ct=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Nh(e.type,e.memoizedProps)),t&&(t=mr)){if(Ah(e))throw T_(),Error(te(418));for(;t;)P_(e,t),t=_a(t.nextSibling)}if(Zy(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(te(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){mr=_a(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}mr=null}}else mr=gr?_a(e.stateNode.nextSibling):null;return!0}function T_(){for(var e=mr;e;)e=_a(e.nextSibling)}function No(){mr=gr=null,Ct=!1}function $g(e){Yr===null?Yr=[e]:Yr.push(e)}var U6=Vi.ReactCurrentBatchConfig;function bl(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(te(309));var r=n.stateNode}if(!r)throw Error(te(147,e));var a=r,l=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===l?t.ref:(t=function(c){var d=a.refs;c===null?delete d[l]:d[l]=c},t._stringRef=l,t)}if(typeof e!="string")throw Error(te(284));if(!n._owner)throw Error(te(290,e))}return e}function Bu(e,t){throw e=Object.prototype.toString.call(t),Error(te(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function eb(e){var t=e._init;return t(e._payload)}function O_(e){function t(y,w){if(e){var C=y.deletions;C===null?(y.deletions=[w],y.flags|=16):C.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function a(y,w){return y=ka(y,w),y.index=0,y.sibling=null,y}function l(y,w,C){return y.index=C,e?(C=y.alternate,C!==null?(C=C.index,C<w?(y.flags|=2,w):C):(y.flags|=2,w)):(y.flags|=1048576,w)}function c(y){return e&&y.alternate===null&&(y.flags|=2),y}function d(y,w,C,R){return w===null||w.tag!==6?(w=Cm(C,y.mode,R),w.return=y,w):(w=a(w,C),w.return=y,w)}function p(y,w,C,R){var D=C.type;return D===Ys?h(y,w,C.props.children,R,C.key):w!==null&&(w.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===da&&eb(D)===w.type)?(R=a(w,C.props),R.ref=bl(y,w,C),R.return=y,R):(R=pd(C.type,C.key,C.props,null,y.mode,R),R.ref=bl(y,w,C),R.return=y,R)}function m(y,w,C,R){return w===null||w.tag!==4||w.stateNode.containerInfo!==C.containerInfo||w.stateNode.implementation!==C.implementation?(w=Em(C,y.mode,R),w.return=y,w):(w=a(w,C.children||[]),w.return=y,w)}function h(y,w,C,R,D){return w===null||w.tag!==7?(w=us(C,y.mode,R,D),w.return=y,w):(w=a(w,C),w.return=y,w)}function g(y,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Cm(""+w,y.mode,C),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Tu:return C=pd(w.type,w.key,w.props,null,y.mode,C),C.ref=bl(y,null,w),C.return=y,C;case Xs:return w=Em(w,y.mode,C),w.return=y,w;case da:var R=w._init;return g(y,R(w._payload),C)}if(Nl(w)||hl(w))return w=us(w,y.mode,C,null),w.return=y,w;Bu(y,w)}return null}function x(y,w,C,R){var D=w!==null?w.key:null;if(typeof C=="string"&&C!==""||typeof C=="number")return D!==null?null:d(y,w,""+C,R);if(typeof C=="object"&&C!==null){switch(C.$$typeof){case Tu:return C.key===D?p(y,w,C,R):null;case Xs:return C.key===D?m(y,w,C,R):null;case da:return D=C._init,x(y,w,D(C._payload),R)}if(Nl(C)||hl(C))return D!==null?null:h(y,w,C,R,null);Bu(y,C)}return null}function j(y,w,C,R,D){if(typeof R=="string"&&R!==""||typeof R=="number")return y=y.get(C)||null,d(w,y,""+R,D);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case Tu:return y=y.get(R.key===null?C:R.key)||null,p(w,y,R,D);case Xs:return y=y.get(R.key===null?C:R.key)||null,m(w,y,R,D);case da:var T=R._init;return j(y,w,C,T(R._payload),D)}if(Nl(R)||hl(R))return y=y.get(C)||null,h(w,y,R,D,null);Bu(w,R)}return null}function b(y,w,C,R){for(var D=null,T=null,F=w,z=w=0,B=null;F!==null&&z<C.length;z++){F.index>z?(B=F,F=null):B=F.sibling;var W=x(y,F,C[z],R);if(W===null){F===null&&(F=B);break}e&&F&&W.alternate===null&&t(y,F),w=l(W,w,z),T===null?D=W:T.sibling=W,T=W,F=B}if(z===C.length)return n(y,F),Ct&&Xa(y,z),D;if(F===null){for(;z<C.length;z++)F=g(y,C[z],R),F!==null&&(w=l(F,w,z),T===null?D=F:T.sibling=F,T=F);return Ct&&Xa(y,z),D}for(F=r(y,F);z<C.length;z++)B=j(F,y,z,C[z],R),B!==null&&(e&&B.alternate!==null&&F.delete(B.key===null?z:B.key),w=l(B,w,z),T===null?D=B:T.sibling=B,T=B);return e&&F.forEach(function(pe){return t(y,pe)}),Ct&&Xa(y,z),D}function _(y,w,C,R){var D=hl(C);if(typeof D!="function")throw Error(te(150));if(C=D.call(C),C==null)throw Error(te(151));for(var T=D=null,F=w,z=w=0,B=null,W=C.next();F!==null&&!W.done;z++,W=C.next()){F.index>z?(B=F,F=null):B=F.sibling;var pe=x(y,F,W.value,R);if(pe===null){F===null&&(F=B);break}e&&F&&pe.alternate===null&&t(y,F),w=l(pe,w,z),T===null?D=pe:T.sibling=pe,T=pe,F=B}if(W.done)return n(y,F),Ct&&Xa(y,z),D;if(F===null){for(;!W.done;z++,W=C.next())W=g(y,W.value,R),W!==null&&(w=l(W,w,z),T===null?D=W:T.sibling=W,T=W);return Ct&&Xa(y,z),D}for(F=r(y,F);!W.done;z++,W=C.next())W=j(F,y,z,W.value,R),W!==null&&(e&&W.alternate!==null&&F.delete(W.key===null?z:W.key),w=l(W,w,z),T===null?D=W:T.sibling=W,T=W);return e&&F.forEach(function(oe){return t(y,oe)}),Ct&&Xa(y,z),D}function N(y,w,C,R){if(typeof C=="object"&&C!==null&&C.type===Ys&&C.key===null&&(C=C.props.children),typeof C=="object"&&C!==null){switch(C.$$typeof){case Tu:e:{for(var D=C.key,T=w;T!==null;){if(T.key===D){if(D=C.type,D===Ys){if(T.tag===7){n(y,T.sibling),w=a(T,C.props.children),w.return=y,y=w;break e}}else if(T.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===da&&eb(D)===T.type){n(y,T.sibling),w=a(T,C.props),w.ref=bl(y,T,C),w.return=y,y=w;break e}n(y,T);break}else t(y,T);T=T.sibling}C.type===Ys?(w=us(C.props.children,y.mode,R,C.key),w.return=y,y=w):(R=pd(C.type,C.key,C.props,null,y.mode,R),R.ref=bl(y,w,C),R.return=y,y=R)}return c(y);case Xs:e:{for(T=C.key;w!==null;){if(w.key===T)if(w.tag===4&&w.stateNode.containerInfo===C.containerInfo&&w.stateNode.implementation===C.implementation){n(y,w.sibling),w=a(w,C.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=Em(C,y.mode,R),w.return=y,y=w}return c(y);case da:return T=C._init,N(y,w,T(C._payload),R)}if(Nl(C))return b(y,w,C,R);if(hl(C))return _(y,w,C,R);Bu(y,C)}return typeof C=="string"&&C!==""||typeof C=="number"?(C=""+C,w!==null&&w.tag===6?(n(y,w.sibling),w=a(w,C),w.return=y,y=w):(n(y,w),w=Cm(C,y.mode,R),w.return=y,y=w),c(y)):n(y,w)}return N}var ko=O_(!0),R_=O_(!1),Md=Ia(null),Ld=null,ao=null,Ug=null;function Bg(){Ug=ao=Ld=null}function Wg(e){var t=Md.current;_t(Md),e._currentValue=t}function Th(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function ho(e,t){Ld=e,Ug=ao=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gn=!0),e.firstContext=null)}function Mr(e){var t=e._currentValue;if(Ug!==e)if(e={context:e,memoizedValue:t,next:null},ao===null){if(Ld===null)throw Error(te(308));ao=e,Ld.dependencies={lanes:0,firstContext:e}}else ao=ao.next=e;return t}var ns=null;function Hg(e){ns===null?ns=[e]:ns.push(e)}function I_(e,t,n,r){var a=t.interleaved;return a===null?(n.next=n,Hg(t)):(n.next=a.next,a.next=n),t.interleaved=n,Wi(e,r)}function Wi(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var pa=!1;function qg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function M_(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function $i(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ja(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,qe&2){var a=r.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),r.pending=t,Wi(e,n)}return a=r.interleaved,a===null?(t.next=t,Hg(r)):(t.next=a.next,a.next=t),r.interleaved=t,Wi(e,n)}function sd(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pg(e,n)}}function tb(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var a=null,l=null;if(n=n.firstBaseUpdate,n!==null){do{var c={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};l===null?a=l=c:l=l.next=c,n=n.next}while(n!==null);l===null?a=l=t:l=l.next=t}else a=l=t;n={baseState:r.baseState,firstBaseUpdate:a,lastBaseUpdate:l,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Dd(e,t,n,r){var a=e.updateQueue;pa=!1;var l=a.firstBaseUpdate,c=a.lastBaseUpdate,d=a.shared.pending;if(d!==null){a.shared.pending=null;var p=d,m=p.next;p.next=null,c===null?l=m:c.next=m,c=p;var h=e.alternate;h!==null&&(h=h.updateQueue,d=h.lastBaseUpdate,d!==c&&(d===null?h.firstBaseUpdate=m:d.next=m,h.lastBaseUpdate=p))}if(l!==null){var g=a.baseState;c=0,h=m=p=null,d=l;do{var x=d.lane,j=d.eventTime;if((r&x)===x){h!==null&&(h=h.next={eventTime:j,lane:0,tag:d.tag,payload:d.payload,callback:d.callback,next:null});e:{var b=e,_=d;switch(x=t,j=n,_.tag){case 1:if(b=_.payload,typeof b=="function"){g=b.call(j,g,x);break e}g=b;break e;case 3:b.flags=b.flags&-65537|128;case 0:if(b=_.payload,x=typeof b=="function"?b.call(j,g,x):b,x==null)break e;g=Ot({},g,x);break e;case 2:pa=!0}}d.callback!==null&&d.lane!==0&&(e.flags|=64,x=a.effects,x===null?a.effects=[d]:x.push(d))}else j={eventTime:j,lane:x,tag:d.tag,payload:d.payload,callback:d.callback,next:null},h===null?(m=h=j,p=g):h=h.next=j,c|=x;if(d=d.next,d===null){if(d=a.shared.pending,d===null)break;x=d,d=x.next,x.next=null,a.lastBaseUpdate=x,a.shared.pending=null}}while(!0);if(h===null&&(p=g),a.baseState=p,a.firstBaseUpdate=m,a.lastBaseUpdate=h,t=a.shared.interleaved,t!==null){a=t;do c|=a.lane,a=a.next;while(a!==t)}else l===null&&(a.shared.lanes=0);gs|=c,e.lanes=c,e.memoizedState=g}}function nb(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],a=r.callback;if(a!==null){if(r.callback=null,r=n,typeof a!="function")throw Error(te(191,a));a.call(r)}}}var wc={},wi=Ia(wc),ec=Ia(wc),tc=Ia(wc);function rs(e){if(e===wc)throw Error(te(174));return e}function Vg(e,t){switch(ht(tc,t),ht(ec,e),ht(wi,wc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:dh(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=dh(t,e)}_t(wi),ht(wi,t)}function Co(){_t(wi),_t(ec),_t(tc)}function L_(e){rs(tc.current);var t=rs(wi.current),n=dh(t,e.type);t!==n&&(ht(ec,e),ht(wi,n))}function Gg(e){ec.current===e&&(_t(wi),_t(ec))}var Pt=Ia(0);function Fd(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&128)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 wm=[];function Kg(){for(var e=0;e<wm.length;e++)wm[e]._workInProgressVersionPrimary=null;wm.length=0}var od=Vi.ReactCurrentDispatcher,_m=Vi.ReactCurrentBatchConfig,hs=0,Tt=null,Yt=null,an=null,zd=!1,Ll=!1,nc=0,B6=0;function xn(){throw Error(te(321))}function Qg(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!ni(e[n],t[n]))return!1;return!0}function Xg(e,t,n,r,a,l){if(hs=l,Tt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,od.current=e===null||e.memoizedState===null?V6:G6,e=n(r,a),Ll){l=0;do{if(Ll=!1,nc=0,25<=l)throw Error(te(301));l+=1,an=Yt=null,t.updateQueue=null,od.current=K6,e=n(r,a)}while(Ll)}if(od.current=$d,t=Yt!==null&&Yt.next!==null,hs=0,an=Yt=Tt=null,zd=!1,t)throw Error(te(300));return e}function Yg(){var e=nc!==0;return nc=0,e}function mi(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return an===null?Tt.memoizedState=an=e:an=an.next=e,an}function Lr(){if(Yt===null){var e=Tt.alternate;e=e!==null?e.memoizedState:null}else e=Yt.next;var t=an===null?Tt.memoizedState:an.next;if(t!==null)an=t,Yt=e;else{if(e===null)throw Error(te(310));Yt=e,e={memoizedState:Yt.memoizedState,baseState:Yt.baseState,baseQueue:Yt.baseQueue,queue:Yt.queue,next:null},an===null?Tt.memoizedState=an=e:an=an.next=e}return an}function rc(e,t){return typeof t=="function"?t(e):t}function jm(e){var t=Lr(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=Yt,a=r.baseQueue,l=n.pending;if(l!==null){if(a!==null){var c=a.next;a.next=l.next,l.next=c}r.baseQueue=a=l,n.pending=null}if(a!==null){l=a.next,r=r.baseState;var d=c=null,p=null,m=l;do{var h=m.lane;if((hs&h)===h)p!==null&&(p=p.next={lane:0,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null}),r=m.hasEagerState?m.eagerState:e(r,m.action);else{var g={lane:h,action:m.action,hasEagerState:m.hasEagerState,eagerState:m.eagerState,next:null};p===null?(d=p=g,c=r):p=p.next=g,Tt.lanes|=h,gs|=h}m=m.next}while(m!==null&&m!==l);p===null?c=r:p.next=d,ni(r,t.memoizedState)||(Gn=!0),t.memoizedState=r,t.baseState=c,t.baseQueue=p,n.lastRenderedState=r}if(e=n.interleaved,e!==null){a=e;do l=a.lane,Tt.lanes|=l,gs|=l,a=a.next;while(a!==e)}else a===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Sm(e){var t=Lr(),n=t.queue;if(n===null)throw Error(te(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,l=t.memoizedState;if(a!==null){n.pending=null;var c=a=a.next;do l=e(l,c.action),c=c.next;while(c!==a);ni(l,t.memoizedState)||(Gn=!0),t.memoizedState=l,t.baseQueue===null&&(t.baseState=l),n.lastRenderedState=l}return[l,r]}function D_(){}function F_(e,t){var n=Tt,r=Lr(),a=t(),l=!ni(r.memoizedState,a);if(l&&(r.memoizedState=a,Gn=!0),r=r.queue,Jg(U_.bind(null,n,r,e),[e]),r.getSnapshot!==t||l||an!==null&&an.memoizedState.tag&1){if(n.flags|=2048,ic(9,$_.bind(null,n,r,a,t),void 0,null),sn===null)throw Error(te(349));hs&30||z_(n,t,a)}return a}function z_(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function $_(e,t,n,r){t.value=n,t.getSnapshot=r,B_(t)&&W_(e)}function U_(e,t,n){return n(function(){B_(t)&&W_(e)})}function B_(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!ni(e,n)}catch{return!0}}function W_(e){var t=Wi(e,1);t!==null&&ti(t,e,1,-1)}function rb(e){var t=mi();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:e},t.queue=e,e=e.dispatch=q6.bind(null,Tt,e),[t.memoizedState,e]}function ic(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Tt.updateQueue,t===null?(t={lastEffect:null,stores:null},Tt.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function H_(){return Lr().memoizedState}function ld(e,t,n,r){var a=mi();Tt.flags|=e,a.memoizedState=ic(1|t,n,void 0,r===void 0?null:r)}function dp(e,t,n,r){var a=Lr();r=r===void 0?null:r;var l=void 0;if(Yt!==null){var c=Yt.memoizedState;if(l=c.destroy,r!==null&&Qg(r,c.deps)){a.memoizedState=ic(t,n,l,r);return}}Tt.flags|=e,a.memoizedState=ic(1|t,n,l,r)}function ib(e,t){return ld(8390656,8,e,t)}function Jg(e,t){return dp(2048,8,e,t)}function q_(e,t){return dp(4,2,e,t)}function V_(e,t){return dp(4,4,e,t)}function G_(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function K_(e,t,n){return n=n!=null?n.concat([e]):null,dp(4,4,G_.bind(null,t,e),n)}function Zg(){}function Q_(e,t){var n=Lr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qg(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function X_(e,t){var n=Lr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Qg(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Y_(e,t,n){return hs&21?(ni(n,t)||(n=n_(),Tt.lanes|=n,gs|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gn=!0),e.memoizedState=n)}function W6(e,t){var n=et;et=n!==0&&4>n?n:4,e(!0);var r=_m.transition;_m.transition={};try{e(!1),t()}finally{et=n,_m.transition=r}}function J_(){return Lr().memoizedState}function H6(e,t,n){var r=Na(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Z_(e))ej(t,n);else if(n=I_(e,t,n,r),n!==null){var a=Mn();ti(n,e,r,a),tj(n,t,r)}}function q6(e,t,n){var r=Na(e),a={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Z_(e))ej(t,a);else{var l=e.alternate;if(e.lanes===0&&(l===null||l.lanes===0)&&(l=t.lastRenderedReducer,l!==null))try{var c=t.lastRenderedState,d=l(c,n);if(a.hasEagerState=!0,a.eagerState=d,ni(d,c)){var p=t.interleaved;p===null?(a.next=a,Hg(t)):(a.next=p.next,p.next=a),t.interleaved=a;return}}catch{}finally{}n=I_(e,t,a,r),n!==null&&(a=Mn(),ti(n,e,r,a),tj(n,t,r))}}function Z_(e){var t=e.alternate;return e===Tt||t!==null&&t===Tt}function ej(e,t){Ll=zd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function tj(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Pg(e,n)}}var $d={readContext:Mr,useCallback:xn,useContext:xn,useEffect:xn,useImperativeHandle:xn,useInsertionEffect:xn,useLayoutEffect:xn,useMemo:xn,useReducer:xn,useRef:xn,useState:xn,useDebugValue:xn,useDeferredValue:xn,useTransition:xn,useMutableSource:xn,useSyncExternalStore:xn,useId:xn,unstable_isNewReconciler:!1},V6={readContext:Mr,useCallback:function(e,t){return mi().memoizedState=[e,t===void 0?null:t],e},useContext:Mr,useEffect:ib,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,ld(4194308,4,G_.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ld(4194308,4,e,t)},useInsertionEffect:function(e,t){return ld(4,2,e,t)},useMemo:function(e,t){var n=mi();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=mi();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=H6.bind(null,Tt,e),[r.memoizedState,e]},useRef:function(e){var t=mi();return e={current:e},t.memoizedState=e},useState:rb,useDebugValue:Zg,useDeferredValue:function(e){return mi().memoizedState=e},useTransition:function(){var e=rb(!1),t=e[0];return e=W6.bind(null,e[1]),mi().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Tt,a=mi();if(Ct){if(n===void 0)throw Error(te(407));n=n()}else{if(n=t(),sn===null)throw Error(te(349));hs&30||z_(r,t,n)}a.memoizedState=n;var l={value:n,getSnapshot:t};return a.queue=l,ib(U_.bind(null,r,l,e),[e]),r.flags|=2048,ic(9,$_.bind(null,r,l,n,t),void 0,null),n},useId:function(){var e=mi(),t=sn.identifierPrefix;if(Ct){var n=zi,r=Fi;n=(r&~(1<<32-ei(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=B6++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},G6={readContext:Mr,useCallback:Q_,useContext:Mr,useEffect:Jg,useImperativeHandle:K_,useInsertionEffect:q_,useLayoutEffect:V_,useMemo:X_,useReducer:jm,useRef:H_,useState:function(){return jm(rc)},useDebugValue:Zg,useDeferredValue:function(e){var t=Lr();return Y_(t,Yt.memoizedState,e)},useTransition:function(){var e=jm(rc)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:D_,useSyncExternalStore:F_,useId:J_,unstable_isNewReconciler:!1},K6={readContext:Mr,useCallback:Q_,useContext:Mr,useEffect:Jg,useImperativeHandle:K_,useInsertionEffect:q_,useLayoutEffect:V_,useMemo:X_,useReducer:Sm,useRef:H_,useState:function(){return Sm(rc)},useDebugValue:Zg,useDeferredValue:function(e){var t=Lr();return Yt===null?t.memoizedState=e:Y_(t,Yt.memoizedState,e)},useTransition:function(){var e=Sm(rc)[0],t=Lr().memoizedState;return[e,t]},useMutableSource:D_,useSyncExternalStore:F_,useId:J_,unstable_isNewReconciler:!1};function Qr(e,t){if(e&&e.defaultProps){t=Ot({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Oh(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Ot({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var pp={isMounted:function(e){return(e=e._reactInternals)?ys(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Mn(),a=Na(e),l=$i(r,a);l.payload=t,n!=null&&(l.callback=n),t=ja(e,l,a),t!==null&&(ti(t,e,a,r),sd(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Mn(),a=Na(e),l=$i(r,a);l.tag=1,l.payload=t,n!=null&&(l.callback=n),t=ja(e,l,a),t!==null&&(ti(t,e,a,r),sd(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Mn(),r=Na(e),a=$i(n,r);a.tag=2,t!=null&&(a.callback=t),t=ja(e,a,r),t!==null&&(ti(t,e,r,n),sd(t,e,r))}};function ab(e,t,n,r,a,l,c){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,l,c):t.prototype&&t.prototype.isPureReactComponent?!Xl(n,r)||!Xl(a,l):!0}function nj(e,t,n){var r=!1,a=Ta,l=t.contextType;return typeof l=="object"&&l!==null?l=Mr(l):(a=Jn(t)?fs:jn.current,r=t.contextTypes,l=(r=r!=null)?So(e,a):Ta),t=new t(n,l),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=pp,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=a,e.__reactInternalMemoizedMaskedChildContext=l),t}function sb(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&pp.enqueueReplaceState(t,t.state,null)}function Rh(e,t,n,r){var a=e.stateNode;a.props=n,a.state=e.memoizedState,a.refs={},qg(e);var l=t.contextType;typeof l=="object"&&l!==null?a.context=Mr(l):(l=Jn(t)?fs:jn.current,a.context=So(e,l)),a.state=e.memoizedState,l=t.getDerivedStateFromProps,typeof l=="function"&&(Oh(e,t,l,n),a.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(t=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),t!==a.state&&pp.enqueueReplaceState(a,a.state,null),Dd(e,n,a,r),a.state=e.memoizedState),typeof a.componentDidMount=="function"&&(e.flags|=4194308)}function Eo(e,t){try{var n="",r=t;do n+=_R(r),r=r.return;while(r);var a=n}catch(l){a=`
|
479
479
|
Error generating stack: `+l.message+`
|
480
|
-
`+l.stack}return{value:e,source:t,stack:a,digest:null}}function Nm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ih(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Q6=typeof WeakMap=="function"?WeakMap:Map;function rj(e,t,n){n=$i(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Bd||(Bd=!0,Hh=r),Ih(e,t)},n}function ij(e,t,n){n=$i(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Ih(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Ih(e,t),typeof r!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),n}function ob(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Q6;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=cI.bind(null,e,t,n),t.then(e,e))}function lb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function cb(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$i(-1,1),t.tag=2,ja(n,t,1))),n.lanes|=1),e)}var X6=Vi.ReactCurrentOwner,Gn=!1;function In(e,t,n,r){t.child=e===null?R_(t,null,n,r):ko(t,e.child,n,r)}function ub(e,t,n,r,a){n=n.render;var l=t.ref;return ho(t,a),r=Xg(e,t,n,r,l,a),n=Yg(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Hi(e,t,a)):(Ct&&n&&Fg(t),t.flags|=1,In(e,t,r,a),t.child)}function db(e,t,n,r,a){if(e===null){var l=n.type;return typeof l=="function"&&!o0(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,aj(e,t,l,r,a)):(e=pd(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&a)){var c=l.memoizedProps;if(n=n.compare,n=n!==null?n:Xl,n(c,r)&&e.ref===t.ref)return Hi(e,t,a)}return t.flags|=1,e=ka(l,r),e.ref=t.ref,e.return=t,t.child=e}function aj(e,t,n,r,a){if(e!==null){var l=e.memoizedProps;if(Xl(l,r)&&e.ref===t.ref)if(Gn=!1,t.pendingProps=r=l,(e.lanes&a)!==0)e.flags&131072&&(Gn=!0);else return t.lanes=e.lanes,Hi(e,t,a)}return Mh(e,t,n,r,a)}function sj(e,t,n){var r=t.pendingProps,a=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(oo,fr),fr|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(oo,fr),fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ht(oo,fr),fr|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ht(oo,fr),fr|=r;return In(e,t,a,n),t.child}function oj(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Mh(e,t,n,r,a){var l=Jn(n)?fs:jn.current;return l=So(t,l),ho(t,a),n=Xg(e,t,n,r,l,a),r=Yg(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Hi(e,t,a)):(Ct&&r&&Fg(t),t.flags|=1,In(e,t,n,a),t.child)}function pb(e,t,n,r,a){if(Jn(n)){var l=!0;Od(t)}else l=!1;if(ho(t,a),t.stateNode===null)cd(e,t),nj(t,n,r),Rh(t,n,r,a),r=!0;else if(e===null){var c=t.stateNode,d=t.memoizedProps;c.props=d;var p=c.context,m=n.contextType;typeof m=="object"&&m!==null?m=Mr(m):(m=Jn(n)?fs:jn.current,m=So(t,m));var h=n.getDerivedStateFromProps,g=typeof h=="function"||typeof c.getSnapshotBeforeUpdate=="function";g||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==r||p!==m)&&sb(t,c,r,m),pa=!1;var x=t.memoizedState;c.state=x,Dd(t,r,c,a),p=t.memoizedState,d!==r||x!==p||Yn.current||pa?(typeof h=="function"&&(Oh(t,n,h,r),p=t.memoizedState),(d=pa||ab(t,n,d,r,x,p,m))?(g||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),c.props=r,c.state=p,c.context=m,r=d):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,M_(e,t),d=t.memoizedProps,m=t.type===t.elementType?d:Qr(t.type,d),c.props=m,g=t.pendingProps,x=c.context,p=n.contextType,typeof p=="object"&&p!==null?p=Mr(p):(p=Jn(n)?fs:jn.current,p=So(t,p));var j=n.getDerivedStateFromProps;(h=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==g||x!==p)&&sb(t,c,r,p),pa=!1,x=t.memoizedState,c.state=x,Dd(t,r,c,a);var b=t.memoizedState;d!==g||x!==b||Yn.current||pa?(typeof j=="function"&&(Oh(t,n,j,r),b=t.memoizedState),(m=pa||ab(t,n,m,r,x,b,p)||!1)?(h||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,b,p),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,b,p)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),c.props=r,c.state=b,c.context=p,r=m):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return Lh(e,t,n,r,l,a)}function Lh(e,t,n,r,a,l){oj(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return a&&Yy(t,n,!1),Hi(e,t,l);r=t.stateNode,X6.current=t;var d=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=ko(t,e.child,null,l),t.child=ko(t,null,d,l)):In(e,t,d,l),t.memoizedState=r.state,a&&Yy(t,n,!0),t.child}function lj(e){var t=e.stateNode;t.pendingContext?Xy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Xy(e,t.context,!1),Vg(e,t.containerInfo)}function fb(e,t,n,r,a){return No(),$g(a),t.flags|=256,In(e,t,n,r),t.child}var Dh={dehydrated:null,treeContext:null,retryLane:0};function Fh(e){return{baseLanes:e,cachePool:null,transitions:null}}function cj(e,t,n){var r=t.pendingProps,a=Pt.current,l=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(a&2)!==0),d?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ht(Pt,a&1),e===null)return Ph(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=r.children,e=r.fallback,l?(r=t.mode,l=t.child,c={mode:"hidden",children:c},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=c):l=hp(c,r,0,null),e=us(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Fh(n),t.memoizedState=Dh,e):e0(t,c));if(a=e.memoizedState,a!==null&&(d=a.dehydrated,d!==null))return Y6(e,t,c,r,d,a,n);if(l){l=r.fallback,c=t.mode,a=e.child,d=a.sibling;var p={mode:"hidden",children:r.children};return!(c&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=p,t.deletions=null):(r=ka(a,p),r.subtreeFlags=a.subtreeFlags&14680064),d!==null?l=ka(d,l):(l=us(l,c,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,c=e.child.memoizedState,c=c===null?Fh(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},l.memoizedState=c,l.childLanes=e.childLanes&~n,t.memoizedState=Dh,r}return l=e.child,e=l.sibling,r=ka(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function e0(e,t){return t=hp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wu(e,t,n,r){return r!==null&&$g(r),ko(t,e.child,null,n),e=e0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Y6(e,t,n,r,a,l,c){if(n)return t.flags&256?(t.flags&=-257,r=Nm(Error(te(422))),Wu(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,a=t.mode,r=hp({mode:"visible",children:r.children},a,0,null),l=us(l,a,c,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&ko(t,e.child,null,c),t.child.memoizedState=Fh(c),t.memoizedState=Dh,l);if(!(t.mode&1))return Wu(e,t,c,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var d=r.dgst;return r=d,l=Error(te(419)),r=Nm(l,r,void 0),Wu(e,t,c,r)}if(d=(c&e.childLanes)!==0,Gn||d){if(r=sn,r!==null){switch(c&-c){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|c)?0:a,a!==0&&a!==l.retryLane&&(l.retryLane=a,Wi(e,a),ti(r,e,a,-1))}return s0(),r=Nm(Error(te(421))),Wu(e,t,c,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=uI.bind(null,e),a._reactRetry=t,null):(e=l.treeContext,mr=_a(a.nextSibling),gr=t,Ct=!0,Yr=null,e!==null&&(Tr[Or++]=Fi,Tr[Or++]=zi,Tr[Or++]=ms,Fi=e.id,zi=e.overflow,ms=t),t=e0(t,r.children),t.flags|=4096,t)}function mb(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Th(e.return,t,n)}function km(e,t,n,r,a){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=a)}function uj(e,t,n){var r=t.pendingProps,a=r.revealOrder,l=r.tail;if(In(e,t,r.children,n),r=Pt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mb(e,n,t);else if(e.tag===19)mb(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ht(Pt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Fd(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),km(t,!1,a,n,l);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Fd(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}km(t,!0,n,null,l);break;case"together":km(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,n=ka(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ka(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function J6(e,t,n){switch(t.tag){case 3:lj(t),No();break;case 5:L_(t);break;case 1:Jn(t.type)&&Od(t);break;case 4:Vg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ht(Md,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ht(Pt,Pt.current&1),t.flags|=128,null):n&t.child.childLanes?cj(e,t,n):(ht(Pt,Pt.current&1),e=Hi(e,t,n),e!==null?e.sibling:null);ht(Pt,Pt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uj(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ht(Pt,Pt.current),r)break;return null;case 22:case 23:return t.lanes=0,sj(e,t,n)}return Hi(e,t,n)}var dj,zh,pj,fj;dj=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};zh=function(){};pj=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,rs(wi.current);var l=null;switch(n){case"input":a=oh(e,a),r=oh(e,r),l=[];break;case"select":a=Ot({},a,{value:void 0}),r=Ot({},r,{value:void 0}),l=[];break;case"textarea":a=uh(e,a),r=uh(e,r),l=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pd)}ph(n,r);var c;n=null;for(m in a)if(!r.hasOwnProperty(m)&&a.hasOwnProperty(m)&&a[m]!=null)if(m==="style"){var d=a[m];for(c in d)d.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else m!=="dangerouslySetInnerHTML"&&m!=="children"&&m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(Wl.hasOwnProperty(m)?l||(l=[]):(l=l||[]).push(m,null));for(m in r){var p=r[m];if(d=a!=null?a[m]:void 0,r.hasOwnProperty(m)&&p!==d&&(p!=null||d!=null))if(m==="style")if(d){for(c in d)!d.hasOwnProperty(c)||p&&p.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in p)p.hasOwnProperty(c)&&d[c]!==p[c]&&(n||(n={}),n[c]=p[c])}else n||(l||(l=[]),l.push(m,n)),n=p;else m==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,d=d?d.__html:void 0,p!=null&&d!==p&&(l=l||[]).push(m,p)):m==="children"?typeof p!="string"&&typeof p!="number"||(l=l||[]).push(m,""+p):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&(Wl.hasOwnProperty(m)?(p!=null&&m==="onScroll"&&wt("scroll",e),l||d===p||(l=[])):(l=l||[]).push(m,p))}n&&(l=l||[]).push("style",n);var m=l;(t.updateQueue=m)&&(t.flags|=4)}};fj=function(e,t,n,r){n!==r&&(t.flags|=4)};function wl(e,t){if(!Ct)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function vn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Z6(e,t,n){var r=t.pendingProps;switch(zg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(t),null;case 1:return Jn(t.type)&&Td(),vn(t),null;case 3:return r=t.stateNode,Co(),_t(Yn),_t(jn),Kg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Uu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yr!==null&&(Gh(Yr),Yr=null))),zh(e,t),vn(t),null;case 5:Gg(t);var a=rs(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)pj(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(te(166));return vn(t),null}if(e=rs(wi.current),Uu(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[vi]=t,r[Zl]=l,e=(t.mode&1)!==0,n){case"dialog":wt("cancel",r),wt("close",r);break;case"iframe":case"object":case"embed":wt("load",r);break;case"video":case"audio":for(a=0;a<Cl.length;a++)wt(Cl[a],r);break;case"source":wt("error",r);break;case"img":case"image":case"link":wt("error",r),wt("load",r);break;case"details":wt("toggle",r);break;case"input":jy(r,l),wt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},wt("invalid",r);break;case"textarea":Ny(r,l),wt("invalid",r)}ph(n,l),a=null;for(var c in l)if(l.hasOwnProperty(c)){var d=l[c];c==="children"?typeof d=="string"?r.textContent!==d&&(l.suppressHydrationWarning!==!0&&$u(r.textContent,d,e),a=["children",d]):typeof d=="number"&&r.textContent!==""+d&&(l.suppressHydrationWarning!==!0&&$u(r.textContent,d,e),a=["children",""+d]):Wl.hasOwnProperty(c)&&d!=null&&c==="onScroll"&&wt("scroll",r)}switch(n){case"input":Ou(r),Sy(r,l,!0);break;case"textarea":Ou(r),ky(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Pd)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Uw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[vi]=t,e[Zl]=r,dj(e,t,!1,!1),t.stateNode=e;e:{switch(c=fh(n,r),n){case"dialog":wt("cancel",e),wt("close",e),a=r;break;case"iframe":case"object":case"embed":wt("load",e),a=r;break;case"video":case"audio":for(a=0;a<Cl.length;a++)wt(Cl[a],e);a=r;break;case"source":wt("error",e),a=r;break;case"img":case"image":case"link":wt("error",e),wt("load",e),a=r;break;case"details":wt("toggle",e),a=r;break;case"input":jy(e,r),a=oh(e,r),wt("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ot({},r,{value:void 0}),wt("invalid",e);break;case"textarea":Ny(e,r),a=uh(e,r),wt("invalid",e);break;default:a=r}ph(n,a),d=a;for(l in d)if(d.hasOwnProperty(l)){var p=d[l];l==="style"?Hw(e,p):l==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,p!=null&&Bw(e,p)):l==="children"?typeof p=="string"?(n!=="textarea"||p!=="")&&Hl(e,p):typeof p=="number"&&Hl(e,""+p):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Wl.hasOwnProperty(l)?p!=null&&l==="onScroll"&&wt("scroll",e):p!=null&&Sg(e,l,p,c))}switch(n){case"input":Ou(e),Sy(e,r,!1);break;case"textarea":Ou(e),ky(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Pa(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?uo(e,!!r.multiple,l,!1):r.defaultValue!=null&&uo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Pd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vn(t),null;case 6:if(e&&t.stateNode!=null)fj(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(te(166));if(n=rs(tc.current),rs(wi.current),Uu(t)){if(r=t.stateNode,n=t.memoizedProps,r[vi]=t,(l=r.nodeValue!==n)&&(e=gr,e!==null))switch(e.tag){case 3:$u(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$u(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vi]=t,t.stateNode=r}return vn(t),null;case 13:if(_t(Pt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ct&&mr!==null&&t.mode&1&&!(t.flags&128))T_(),No(),t.flags|=98560,l=!1;else if(l=Uu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(te(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(te(317));l[vi]=t}else No(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vn(t),l=!1}else Yr!==null&&(Gh(Yr),Yr=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pt.current&1?Jt===0&&(Jt=3):s0())),t.updateQueue!==null&&(t.flags|=4),vn(t),null);case 4:return Co(),zh(e,t),e===null&&Yl(t.stateNode.containerInfo),vn(t),null;case 10:return Wg(t.type._context),vn(t),null;case 17:return Jn(t.type)&&Td(),vn(t),null;case 19:if(_t(Pt),l=t.memoizedState,l===null)return vn(t),null;if(r=(t.flags&128)!==0,c=l.rendering,c===null)if(r)wl(l,!1);else{if(Jt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Fd(e),c!==null){for(t.flags|=128,wl(l,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,c=l.alternate,c===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=c.childLanes,l.lanes=c.lanes,l.child=c.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=c.memoizedProps,l.memoizedState=c.memoizedState,l.updateQueue=c.updateQueue,l.type=c.type,e=c.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ht(Pt,Pt.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ut()>Ao&&(t.flags|=128,r=!0,wl(l,!1),t.lanes=4194304)}else{if(!r)if(e=Fd(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ct)return vn(t),null}else 2*Ut()-l.renderingStartTime>Ao&&n!==1073741824&&(t.flags|=128,r=!0,wl(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(n=l.last,n!==null?n.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,n=Pt.current,ht(Pt,r?n&1|2:n&1),t):(vn(t),null);case 22:case 23:return a0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fr&1073741824&&(vn(t),t.subtreeFlags&6&&(t.flags|=8192)):vn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function eI(e,t){switch(zg(t),t.tag){case 1:return Jn(t.type)&&Td(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),_t(Yn),_t(jn),Kg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gg(t),null;case 13:if(_t(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Pt),null;case 4:return Co(),null;case 10:return Wg(t.type._context),null;case 22:case 23:return a0(),null;case 24:return null;default:return null}}var Hu=!1,yn=!1,tI=typeof WeakSet=="function"?WeakSet:Set,de=null;function so(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Mt(e,t,r)}else n.current=null}function $h(e,t,n){try{n()}catch(r){Mt(e,t,r)}}var hb=!1;function nI(e,t){if(jh=Cd,e=v_(),Dg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var c=0,d=-1,p=-1,m=0,h=0,g=e,x=null;t:for(;;){for(var j;g!==n||a!==0&&g.nodeType!==3||(d=c+a),g!==l||r!==0&&g.nodeType!==3||(p=c+r),g.nodeType===3&&(c+=g.nodeValue.length),(j=g.firstChild)!==null;)x=g,g=j;for(;;){if(g===e)break t;if(x===n&&++m===a&&(d=c),x===l&&++h===r&&(p=c),(j=g.nextSibling)!==null)break;g=x,x=g.parentNode}g=j}n=d===-1||p===-1?null:{start:d,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sh={focusedElem:e,selectionRange:n},Cd=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var _=b.memoizedProps,N=b.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?_:Qr(t.type,_),N);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var C=t.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(R){Mt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return b=hb,hb=!1,b}function Dl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var l=a.destroy;a.destroy=void 0,l!==void 0&&$h(t,n,l)}a=a.next}while(a!==r)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mj(e){var t=e.alternate;t!==null&&(e.alternate=null,mj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[Zl],delete t[Ch],delete t[F6],delete t[z6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hj(e){return e.tag===5||e.tag===3||e.tag===4}function gb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,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=Pd));else if(r!==4&&(e=e.child,e!==null))for(Bh(e,t,n),e=e.sibling;e!==null;)Bh(e,t,n),e=e.sibling}function Wh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wh(e,t,n),e=e.sibling;e!==null;)Wh(e,t,n),e=e.sibling}var cn=null,Xr=!1;function la(e,t,n){for(n=n.child;n!==null;)gj(e,t,n),n=n.sibling}function gj(e,t,n){if(bi&&typeof bi.onCommitFiberUnmount=="function")try{bi.onCommitFiberUnmount(ap,n)}catch{}switch(n.tag){case 5:yn||so(n,t);case 6:var r=cn,a=Xr;cn=null,la(e,t,n),cn=r,Xr=a,cn!==null&&(Xr?(e=cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cn.removeChild(n.stateNode));break;case 18:cn!==null&&(Xr?(e=cn,n=n.stateNode,e.nodeType===8?ym(e.parentNode,n):e.nodeType===1&&ym(e,n),Kl(e)):ym(cn,n.stateNode));break;case 4:r=cn,a=Xr,cn=n.stateNode.containerInfo,Xr=!0,la(e,t,n),cn=r,Xr=a;break;case 0:case 11:case 14:case 15:if(!yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var l=a,c=l.destroy;l=l.tag,c!==void 0&&(l&2||l&4)&&$h(n,t,c),a=a.next}while(a!==r)}la(e,t,n);break;case 1:if(!yn&&(so(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Mt(n,t,d)}la(e,t,n);break;case 21:la(e,t,n);break;case 22:n.mode&1?(yn=(r=yn)||n.memoizedState!==null,la(e,t,n),yn=r):la(e,t,n);break;default:la(e,t,n)}}function xb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tI),t.forEach(function(r){var a=dI.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Kr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var l=e,c=t,d=c;e:for(;d!==null;){switch(d.tag){case 5:cn=d.stateNode,Xr=!1;break e;case 3:cn=d.stateNode.containerInfo,Xr=!0;break e;case 4:cn=d.stateNode.containerInfo,Xr=!0;break e}d=d.return}if(cn===null)throw Error(te(160));gj(l,c,a),cn=null,Xr=!1;var p=a.alternate;p!==null&&(p.return=null),a.return=null}catch(m){Mt(a,t,m)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xj(t,e),t=t.sibling}function xj(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kr(t,e),pi(e),r&4){try{Dl(3,e,e.return),fp(3,e)}catch(_){Mt(e,e.return,_)}try{Dl(5,e,e.return)}catch(_){Mt(e,e.return,_)}}break;case 1:Kr(t,e),pi(e),r&512&&n!==null&&so(n,n.return);break;case 5:if(Kr(t,e),pi(e),r&512&&n!==null&&so(n,n.return),e.flags&32){var a=e.stateNode;try{Hl(a,"")}catch(_){Mt(e,e.return,_)}}if(r&4&&(a=e.stateNode,a!=null)){var l=e.memoizedProps,c=n!==null?n.memoizedProps:l,d=e.type,p=e.updateQueue;if(e.updateQueue=null,p!==null)try{d==="input"&&l.type==="radio"&&l.name!=null&&zw(a,l),fh(d,c);var m=fh(d,l);for(c=0;c<p.length;c+=2){var h=p[c],g=p[c+1];h==="style"?Hw(a,g):h==="dangerouslySetInnerHTML"?Bw(a,g):h==="children"?Hl(a,g):Sg(a,h,g,m)}switch(d){case"input":lh(a,l);break;case"textarea":$w(a,l);break;case"select":var x=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!l.multiple;var j=l.value;j!=null?uo(a,!!l.multiple,j,!1):x!==!!l.multiple&&(l.defaultValue!=null?uo(a,!!l.multiple,l.defaultValue,!0):uo(a,!!l.multiple,l.multiple?[]:"",!1))}a[Zl]=l}catch(_){Mt(e,e.return,_)}}break;case 6:if(Kr(t,e),pi(e),r&4){if(e.stateNode===null)throw Error(te(162));a=e.stateNode,l=e.memoizedProps;try{a.nodeValue=l}catch(_){Mt(e,e.return,_)}}break;case 3:if(Kr(t,e),pi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(_){Mt(e,e.return,_)}break;case 4:Kr(t,e),pi(e);break;case 13:Kr(t,e),pi(e),a=e.child,a.flags&8192&&(l=a.memoizedState!==null,a.stateNode.isHidden=l,!l||a.alternate!==null&&a.alternate.memoizedState!==null||(r0=Ut())),r&4&&xb(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(m=yn)||h,Kr(t,e),yn=m):Kr(t,e),pi(e),r&8192){if(m=e.memoizedState!==null,(e.stateNode.isHidden=m)&&!h&&e.mode&1)for(de=e,h=e.child;h!==null;){for(g=de=h;de!==null;){switch(x=de,j=x.child,x.tag){case 0:case 11:case 14:case 15:Dl(4,x,x.return);break;case 1:so(x,x.return);var b=x.stateNode;if(typeof b.componentWillUnmount=="function"){r=x,n=x.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(_){Mt(r,n,_)}}break;case 5:so(x,x.return);break;case 22:if(x.memoizedState!==null){yb(g);continue}}j!==null?(j.return=x,de=j):yb(g)}h=h.sibling}e:for(h=null,g=e;;){if(g.tag===5){if(h===null){h=g;try{a=g.stateNode,m?(l=a.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(d=g.stateNode,p=g.memoizedProps.style,c=p!=null&&p.hasOwnProperty("display")?p.display:null,d.style.display=Ww("display",c))}catch(_){Mt(e,e.return,_)}}}else if(g.tag===6){if(h===null)try{g.stateNode.nodeValue=m?"":g.memoizedProps}catch(_){Mt(e,e.return,_)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;h===g&&(h=null),g=g.return}h===g&&(h=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:Kr(t,e),pi(e),r&4&&xb(e);break;case 21:break;default:Kr(t,e),pi(e)}}function pi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hj(n)){var r=n;break e}n=n.return}throw Error(te(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Hl(a,""),r.flags&=-33);var l=gb(e);Wh(e,l,a);break;case 3:case 4:var c=r.stateNode.containerInfo,d=gb(e);Bh(e,d,c);break;default:throw Error(te(161))}}catch(p){Mt(e,e.return,p)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rI(e,t,n){de=e,vj(e)}function vj(e,t,n){for(var r=(e.mode&1)!==0;de!==null;){var a=de,l=a.child;if(a.tag===22&&r){var c=a.memoizedState!==null||Hu;if(!c){var d=a.alternate,p=d!==null&&d.memoizedState!==null||yn;d=Hu;var m=yn;if(Hu=c,(yn=p)&&!m)for(de=a;de!==null;)c=de,p=c.child,c.tag===22&&c.memoizedState!==null?bb(a):p!==null?(p.return=c,de=p):bb(a);for(;l!==null;)de=l,vj(l),l=l.sibling;de=a,Hu=d,yn=m}vb(e)}else a.subtreeFlags&8772&&l!==null?(l.return=a,de=l):vb(e)}}function vb(e){for(;de!==null;){var t=de;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||fp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yn)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Qr(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&nb(t,l,r);break;case 3:var c=t.updateQueue;if(c!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nb(t,c,n)}break;case 5:var d=t.stateNode;if(n===null&&t.flags&4){n=d;var p=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":p.autoFocus&&n.focus();break;case"img":p.src&&(n.src=p.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var m=t.alternate;if(m!==null){var h=m.memoizedState;if(h!==null){var g=h.dehydrated;g!==null&&Kl(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}yn||t.flags&512&&Uh(t)}catch(x){Mt(t,t.return,x)}}if(t===e){de=null;break}if(n=t.sibling,n!==null){n.return=t.return,de=n;break}de=t.return}}function yb(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var n=t.sibling;if(n!==null){n.return=t.return,de=n;break}de=t.return}}function bb(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fp(4,t)}catch(p){Mt(t,n,p)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(p){Mt(t,a,p)}}var l=t.return;try{Uh(t)}catch(p){Mt(t,l,p)}break;case 5:var c=t.return;try{Uh(t)}catch(p){Mt(t,c,p)}}}catch(p){Mt(t,t.return,p)}if(t===e){de=null;break}var d=t.sibling;if(d!==null){d.return=t.return,de=d;break}de=t.return}}var iI=Math.ceil,Ud=Vi.ReactCurrentDispatcher,t0=Vi.ReactCurrentOwner,Ir=Vi.ReactCurrentBatchConfig,qe=0,sn=null,qt=null,un=0,fr=0,oo=Ia(0),Jt=0,ac=null,gs=0,mp=0,n0=0,Fl=null,Vn=null,r0=0,Ao=1/0,Mi=null,Bd=!1,Hh=null,Sa=null,qu=!1,va=null,Wd=0,zl=0,qh=null,ud=-1,dd=0;function Mn(){return qe&6?Ut():ud!==-1?ud:ud=Ut()}function Na(e){return e.mode&1?qe&2&&un!==0?un&-un:U6.transition!==null?(dd===0&&(dd=n_()),dd):(e=et,e!==0||(e=window.event,e=e===void 0?16:c_(e.type)),e):1}function ti(e,t,n,r){if(50<zl)throw zl=0,qh=null,Error(te(185));vc(e,n,r),(!(qe&2)||e!==sn)&&(e===sn&&(!(qe&2)&&(mp|=n),Jt===4&&ma(e,un)),Zn(e,r),n===1&&qe===0&&!(t.mode&1)&&(Ao=Ut()+500,up&&Ma()))}function Zn(e,t){var n=e.callbackNode;UR(e,t);var r=kd(e,e===sn?un:0);if(r===0)n!==null&&Ay(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ay(n),t===1)e.tag===0?$6(wb.bind(null,e)):E_(wb.bind(null,e)),L6(function(){!(qe&6)&&Ma()}),n=null;else{switch(r_(r)){case 1:n=Ag;break;case 4:n=e_;break;case 16:n=Nd;break;case 536870912:n=t_;break;default:n=Nd}n=kj(n,yj.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yj(e,t){if(ud=-1,dd=0,qe&6)throw Error(te(327));var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var r=kd(e,e===sn?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Hd(e,r);else{t=r;var a=qe;qe|=2;var l=wj();(sn!==e||un!==t)&&(Mi=null,Ao=Ut()+500,cs(e,t));do try{oI();break}catch(d){bj(e,d)}while(!0);Bg(),Ud.current=l,qe=a,qt!==null?t=0:(sn=null,un=0,t=Jt)}if(t!==0){if(t===2&&(a=vh(e),a!==0&&(r=a,t=Vh(e,a))),t===1)throw n=ac,cs(e,0),ma(e,r),Zn(e,Ut()),n;if(t===6)ma(e,r);else{if(a=e.current.alternate,!(r&30)&&!aI(a)&&(t=Hd(e,r),t===2&&(l=vh(e),l!==0&&(r=l,t=Vh(e,l))),t===1))throw n=ac,cs(e,0),ma(e,r),Zn(e,Ut()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(te(345));case 2:Ya(e,Vn,Mi);break;case 3:if(ma(e,r),(r&130023424)===r&&(t=r0+500-Ut(),10<t)){if(kd(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Mn(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=kh(Ya.bind(null,e,Vn,Mi),t);break}Ya(e,Vn,Mi);break;case 4:if(ma(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var c=31-ei(r);l=1<<c,c=t[c],c>a&&(a=c),r&=~l}if(r=a,r=Ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*iI(r/1960))-r,10<r){e.timeoutHandle=kh(Ya.bind(null,e,Vn,Mi),r);break}Ya(e,Vn,Mi);break;case 5:Ya(e,Vn,Mi);break;default:throw Error(te(329))}}}return Zn(e,Ut()),e.callbackNode===n?yj.bind(null,e):null}function Vh(e,t){var n=Fl;return e.current.memoizedState.isDehydrated&&(cs(e,t).flags|=256),e=Hd(e,t),e!==2&&(t=Vn,Vn=n,t!==null&&Gh(t)),e}function Gh(e){Vn===null?Vn=e:Vn.push.apply(Vn,e)}function aI(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],l=a.getSnapshot;a=a.value;try{if(!ni(l(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ma(e,t){for(t&=~n0,t&=~mp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ei(t),r=1<<n;e[n]=-1,t&=~r}}function wb(e){if(qe&6)throw Error(te(327));go();var t=kd(e,0);if(!(t&1))return Zn(e,Ut()),null;var n=Hd(e,t);if(e.tag!==0&&n===2){var r=vh(e);r!==0&&(t=r,n=Vh(e,r))}if(n===1)throw n=ac,cs(e,0),ma(e,t),Zn(e,Ut()),n;if(n===6)throw Error(te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ya(e,Vn,Mi),Zn(e,Ut()),null}function i0(e,t){var n=qe;qe|=1;try{return e(t)}finally{qe=n,qe===0&&(Ao=Ut()+500,up&&Ma())}}function xs(e){va!==null&&va.tag===0&&!(qe&6)&&go();var t=qe;qe|=1;var n=Ir.transition,r=et;try{if(Ir.transition=null,et=1,e)return e()}finally{et=r,Ir.transition=n,qe=t,!(qe&6)&&Ma()}}function a0(){fr=oo.current,_t(oo)}function cs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,M6(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(zg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Td();break;case 3:Co(),_t(Yn),_t(jn),Kg();break;case 5:Gg(r);break;case 4:Co();break;case 13:_t(Pt);break;case 19:_t(Pt);break;case 10:Wg(r.type._context);break;case 22:case 23:a0()}n=n.return}if(sn=e,qt=e=ka(e.current,null),un=fr=t,Jt=0,ac=null,n0=mp=gs=0,Vn=Fl=null,ns!==null){for(t=0;t<ns.length;t++)if(n=ns[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,l=n.pending;if(l!==null){var c=l.next;l.next=a,r.next=c}n.pending=r}ns=null}return e}function bj(e,t){do{var n=qt;try{if(Bg(),od.current=$d,zd){for(var r=Tt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}zd=!1}if(hs=0,an=Yt=Tt=null,Ll=!1,nc=0,t0.current=null,n===null||n.return===null){Jt=1,ac=t,qt=null;break}e:{var l=e,c=n.return,d=n,p=t;if(t=un,d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){var m=p,h=d,g=h.tag;if(!(h.mode&1)&&(g===0||g===11||g===15)){var x=h.alternate;x?(h.updateQueue=x.updateQueue,h.memoizedState=x.memoizedState,h.lanes=x.lanes):(h.updateQueue=null,h.memoizedState=null)}var j=lb(c);if(j!==null){j.flags&=-257,cb(j,c,d,l,t),j.mode&1&&ob(l,m,t),t=j,p=m;var b=t.updateQueue;if(b===null){var _=new Set;_.add(p),t.updateQueue=_}else b.add(p);break e}else{if(!(t&1)){ob(l,m,t),s0();break e}p=Error(te(426))}}else if(Ct&&d.mode&1){var N=lb(c);if(N!==null){!(N.flags&65536)&&(N.flags|=256),cb(N,c,d,l,t),$g(Eo(p,d));break e}}l=p=Eo(p,d),Jt!==4&&(Jt=2),Fl===null?Fl=[l]:Fl.push(l),l=c;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=rj(l,p,t);tb(l,y);break e;case 1:d=p;var w=l.type,C=l.stateNode;if(!(l.flags&128)&&(typeof w.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Sa===null||!Sa.has(C)))){l.flags|=65536,t&=-t,l.lanes|=t;var R=ij(l,d,t);tb(l,R);break e}}l=l.return}while(l!==null)}jj(n)}catch(D){t=D,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function wj(){var e=Ud.current;return Ud.current=$d,e===null?$d:e}function s0(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),sn===null||!(gs&268435455)&&!(mp&268435455)||ma(sn,un)}function Hd(e,t){var n=qe;qe|=2;var r=wj();(sn!==e||un!==t)&&(Mi=null,cs(e,t));do try{sI();break}catch(a){bj(e,a)}while(!0);if(Bg(),qe=n,Ud.current=r,qt!==null)throw Error(te(261));return sn=null,un=0,Jt}function sI(){for(;qt!==null;)_j(qt)}function oI(){for(;qt!==null&&!OR();)_j(qt)}function _j(e){var t=Nj(e.alternate,e,fr);e.memoizedProps=e.pendingProps,t===null?jj(e):qt=t,t0.current=null}function jj(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=eI(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,qt=null;return}}else if(n=Z6(n,t,fr),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);Jt===0&&(Jt=5)}function Ya(e,t,n){var r=et,a=Ir.transition;try{Ir.transition=null,et=1,lI(e,t,n,r)}finally{Ir.transition=a,et=r}return null}function lI(e,t,n,r){do go();while(va!==null);if(qe&6)throw Error(te(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(te(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(BR(e,l),e===sn&&(qt=sn=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qu||(qu=!0,kj(Nd,function(){return go(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=Ir.transition,Ir.transition=null;var c=et;et=1;var d=qe;qe|=4,t0.current=null,nI(e,n),xj(n,e),E6(Sh),Cd=!!jh,Sh=jh=null,e.current=n,rI(n),RR(),qe=d,et=c,Ir.transition=l}else e.current=n;if(qu&&(qu=!1,va=e,Wd=a),l=e.pendingLanes,l===0&&(Sa=null),LR(n.stateNode),Zn(e,Ut()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Bd)throw Bd=!1,e=Hh,Hh=null,e;return Wd&1&&e.tag!==0&&go(),l=e.pendingLanes,l&1?e===qh?zl++:(zl=0,qh=e):zl=0,Ma(),null}function go(){if(va!==null){var e=r_(Wd),t=Ir.transition,n=et;try{if(Ir.transition=null,et=16>e?16:e,va===null)var r=!1;else{if(e=va,va=null,Wd=0,qe&6)throw Error(te(331));var a=qe;for(qe|=4,de=e.current;de!==null;){var l=de,c=l.child;if(de.flags&16){var d=l.deletions;if(d!==null){for(var p=0;p<d.length;p++){var m=d[p];for(de=m;de!==null;){var h=de;switch(h.tag){case 0:case 11:case 15:Dl(8,h,l)}var g=h.child;if(g!==null)g.return=h,de=g;else for(;de!==null;){h=de;var x=h.sibling,j=h.return;if(mj(h),h===m){de=null;break}if(x!==null){x.return=j,de=x;break}de=j}}}var b=l.alternate;if(b!==null){var _=b.child;if(_!==null){b.child=null;do{var N=_.sibling;_.sibling=null,_=N}while(_!==null)}}de=l}}if(l.subtreeFlags&2064&&c!==null)c.return=l,de=c;else e:for(;de!==null;){if(l=de,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Dl(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,de=y;break e}de=l.return}}var w=e.current;for(de=w;de!==null;){c=de;var C=c.child;if(c.subtreeFlags&2064&&C!==null)C.return=c,de=C;else e:for(c=w;de!==null;){if(d=de,d.flags&2048)try{switch(d.tag){case 0:case 11:case 15:fp(9,d)}}catch(D){Mt(d,d.return,D)}if(d===c){de=null;break e}var R=d.sibling;if(R!==null){R.return=d.return,de=R;break e}de=d.return}}if(qe=a,Ma(),bi&&typeof bi.onPostCommitFiberRoot=="function")try{bi.onPostCommitFiberRoot(ap,e)}catch{}r=!0}return r}finally{et=n,Ir.transition=t}}return!1}function _b(e,t,n){t=Eo(n,t),t=rj(e,t,1),e=ja(e,t,1),t=Mn(),e!==null&&(vc(e,1,t),Zn(e,t))}function Mt(e,t,n){if(e.tag===3)_b(e,e,n);else for(;t!==null;){if(t.tag===3){_b(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sa===null||!Sa.has(r))){e=Eo(n,e),e=ij(t,e,1),t=ja(t,e,1),e=Mn(),t!==null&&(vc(t,1,e),Zn(t,e));break}}t=t.return}}function cI(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Mn(),e.pingedLanes|=e.suspendedLanes&n,sn===e&&(un&n)===n&&(Jt===4||Jt===3&&(un&130023424)===un&&500>Ut()-r0?cs(e,0):n0|=n),Zn(e,t)}function Sj(e,t){t===0&&(e.mode&1?(t=Mu,Mu<<=1,!(Mu&130023424)&&(Mu=4194304)):t=1);var n=Mn();e=Wi(e,t),e!==null&&(vc(e,t,n),Zn(e,n))}function uI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sj(e,n)}function dI(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),Sj(e,n)}var Nj;Nj=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yn.current)Gn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gn=!1,J6(e,t,n);Gn=!!(e.flags&131072)}else Gn=!1,Ct&&t.flags&1048576&&A_(t,Id,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cd(e,t),e=t.pendingProps;var a=So(t,jn.current);ho(t,n),a=Xg(null,t,r,e,a,n);var l=Yg();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(r)?(l=!0,Od(t)):l=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,qg(t),a.updater=pp,t.stateNode=a,a._reactInternals=t,Rh(t,r,e,n),t=Lh(null,t,r,!0,l,n)):(t.tag=0,Ct&&l&&Fg(t),In(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cd(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=fI(r),e=Qr(r,e),a){case 0:t=Mh(null,t,r,e,n);break e;case 1:t=pb(null,t,r,e,n);break e;case 11:t=ub(null,t,r,e,n);break e;case 14:t=db(null,t,r,Qr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),Mh(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),pb(e,t,r,a,n);case 3:e:{if(lj(t),e===null)throw Error(te(387));r=t.pendingProps,l=t.memoizedState,a=l.element,M_(e,t),Dd(t,r,null,n);var c=t.memoizedState;if(r=c.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){a=Eo(Error(te(423)),t),t=fb(e,t,r,n,a);break e}else if(r!==a){a=Eo(Error(te(424)),t),t=fb(e,t,r,n,a);break e}else for(mr=_a(t.stateNode.containerInfo.firstChild),gr=t,Ct=!0,Yr=null,n=R_(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),r===a){t=Hi(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return L_(t),e===null&&Ph(t),r=t.type,a=t.pendingProps,l=e!==null?e.memoizedProps:null,c=a.children,Nh(r,a)?c=null:l!==null&&Nh(r,l)&&(t.flags|=32),oj(e,t),In(e,t,c,n),t.child;case 6:return e===null&&Ph(t),null;case 13:return cj(e,t,n);case 4:return Vg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ko(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),ub(e,t,r,a,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,l=t.memoizedProps,c=a.value,ht(Md,r._currentValue),r._currentValue=c,l!==null)if(ni(l.value,c)){if(l.children===a.children&&!Yn.current){t=Hi(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var d=l.dependencies;if(d!==null){c=l.child;for(var p=d.firstContext;p!==null;){if(p.context===r){if(l.tag===1){p=$i(-1,n&-n),p.tag=2;var m=l.updateQueue;if(m!==null){m=m.shared;var h=m.pending;h===null?p.next=p:(p.next=h.next,h.next=p),m.pending=p}}l.lanes|=n,p=l.alternate,p!==null&&(p.lanes|=n),Th(l.return,n,t),d.lanes|=n;break}p=p.next}}else if(l.tag===10)c=l.type===t.type?null:l.child;else if(l.tag===18){if(c=l.return,c===null)throw Error(te(341));c.lanes|=n,d=c.alternate,d!==null&&(d.lanes|=n),Th(c,n,t),c=l.sibling}else c=l.child;if(c!==null)c.return=l;else for(c=l;c!==null;){if(c===t){c=null;break}if(l=c.sibling,l!==null){l.return=c.return,c=l;break}c=c.return}l=c}In(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,ho(t,n),a=Mr(a),r=r(a),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,a=Qr(r,t.pendingProps),a=Qr(r.type,a),db(e,t,r,a,n);case 15:return aj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),cd(e,t),t.tag=1,Jn(r)?(e=!0,Od(t)):e=!1,ho(t,n),nj(t,r,a),Rh(t,r,a,n),Lh(null,t,r,!0,e,n);case 19:return uj(e,t,n);case 22:return sj(e,t,n)}throw Error(te(156,t.tag))};function kj(e,t){return Zw(e,t)}function pI(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rr(e,t,n,r){return new pI(e,t,n,r)}function o0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fI(e){if(typeof e=="function")return o0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kg)return 11;if(e===Cg)return 14}return 2}function ka(e,t){var n=e.alternate;return n===null?(n=Rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pd(e,t,n,r,a,l){var c=2;if(r=e,typeof e=="function")o0(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Ys:return us(n.children,a,l,t);case Ng:c=8,a|=8;break;case rh:return e=Rr(12,n,t,a|2),e.elementType=rh,e.lanes=l,e;case ih:return e=Rr(13,n,t,a),e.elementType=ih,e.lanes=l,e;case ah:return e=Rr(19,n,t,a),e.elementType=ah,e.lanes=l,e;case Lw:return hp(n,a,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iw:c=10;break e;case Mw:c=9;break e;case kg:c=11;break e;case Cg:c=14;break e;case da:c=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Rr(c,n,t,a),t.elementType=e,t.type=r,t.lanes=l,t}function us(e,t,n,r){return e=Rr(7,e,r,t),e.lanes=n,e}function hp(e,t,n,r){return e=Rr(22,e,r,t),e.elementType=Lw,e.lanes=n,e.stateNode={isHidden:!1},e}function Cm(e,t,n){return e=Rr(6,e,null,t),e.lanes=n,e}function Em(e,t,n){return t=Rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mI(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lm(0),this.expirationTimes=lm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lm(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function l0(e,t,n,r,a,l,c,d,p){return e=new mI(e,t,n,d,p),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Rr(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qg(l),e}function hI(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Cj(e){if(!e)return Ta;e=e._reactInternals;e:{if(ys(e)!==e||e.tag!==1)throw Error(te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(te(171))}if(e.tag===1){var n=e.type;if(Jn(n))return C_(e,n,t)}return t}function Ej(e,t,n,r,a,l,c,d,p){return e=l0(n,r,!0,e,a,l,c,d,p),e.context=Cj(null),n=e.current,r=Mn(),a=Na(n),l=$i(r,a),l.callback=t??null,ja(n,l,a),e.current.lanes=a,vc(e,a,r),Zn(e,r),e}function gp(e,t,n,r){var a=t.current,l=Mn(),c=Na(a);return n=Cj(n),t.context===null?t.context=n:t.pendingContext=n,t=$i(l,c),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ja(a,t,c),e!==null&&(ti(e,a,c,l),sd(e,a,c)),c}function qd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function c0(e,t){jb(e,t),(e=e.alternate)&&jb(e,t)}function gI(){return null}var Aj=typeof reportError=="function"?reportError:function(e){console.error(e)};function u0(e){this._internalRoot=e}xp.prototype.render=u0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));gp(e,t,null,null)};xp.prototype.unmount=u0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xs(function(){gp(null,e,null,null)}),t[Bi]=null}};function xp(e){this._internalRoot=e}xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=s_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fa.length&&t!==0&&t<fa[n].priority;n++);fa.splice(n,0,e),n===0&&l_(e)}};function d0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Sb(){}function xI(e,t,n,r,a){if(a){if(typeof r=="function"){var l=r;r=function(){var m=qd(c);l.call(m)}}var c=Ej(t,r,e,0,null,!1,!1,"",Sb);return e._reactRootContainer=c,e[Bi]=c.current,Yl(e.nodeType===8?e.parentNode:e),xs(),c}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var d=r;r=function(){var m=qd(p);d.call(m)}}var p=l0(e,0,!1,null,null,!1,!1,"",Sb);return e._reactRootContainer=p,e[Bi]=p.current,Yl(e.nodeType===8?e.parentNode:e),xs(function(){gp(t,p,n,r)}),p}function yp(e,t,n,r,a){var l=n._reactRootContainer;if(l){var c=l;if(typeof a=="function"){var d=a;a=function(){var p=qd(c);d.call(p)}}gp(t,c,e,a)}else c=xI(n,t,e,a,r);return qd(c)}i_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=kl(t.pendingLanes);n!==0&&(Pg(t,n|1),Zn(t,Ut()),!(qe&6)&&(Ao=Ut()+500,Ma()))}break;case 13:xs(function(){var r=Wi(e,1);if(r!==null){var a=Mn();ti(r,e,1,a)}}),c0(e,1)}};Tg=function(e){if(e.tag===13){var t=Wi(e,134217728);if(t!==null){var n=Mn();ti(t,e,134217728,n)}c0(e,134217728)}};a_=function(e){if(e.tag===13){var t=Na(e),n=Wi(e,t);if(n!==null){var r=Mn();ti(n,e,t,r)}c0(e,t)}};s_=function(){return et};o_=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};hh=function(e,t,n){switch(t){case"input":if(lh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=cp(r);if(!a)throw Error(te(90));Fw(r),lh(r,a)}}}break;case"textarea":$w(e,n);break;case"select":t=n.value,t!=null&&uo(e,!!n.multiple,t,!1)}};Gw=i0;Kw=xs;var vI={usingClientEntryPoint:!1,Events:[bc,to,cp,qw,Vw,i0]},_l={findFiberByHostInstance:ts,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yI={bundleType:_l.bundleType,version:_l.version,rendererPackageName:_l.rendererPackageName,rendererConfig:_l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yw(e),e===null?null:e.stateNode},findFiberByHostInstance:_l.findFiberByHostInstance||gI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{ap=Vu.inject(yI),bi=Vu}catch{}}vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vI;vr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d0(t))throw Error(te(200));return hI(e,t,null,n)};vr.createRoot=function(e,t){if(!d0(e))throw Error(te(299));var n=!1,r="",a=Aj;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=l0(e,1,!1,null,null,n,!1,r,a),e[Bi]=t.current,Yl(e.nodeType===8?e.parentNode:e),new u0(t)};vr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=Yw(t),e=e===null?null:e.stateNode,e};vr.flushSync=function(e){return xs(e)};vr.hydrate=function(e,t,n){if(!vp(t))throw Error(te(200));return yp(null,e,t,!0,n)};vr.hydrateRoot=function(e,t,n){if(!d0(e))throw Error(te(405));var r=n!=null&&n.hydratedSources||null,a=!1,l="",c=Aj;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=Ej(t,null,e,1,n??null,a,!1,l,c),e[Bi]=t.current,Yl(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new xp(t)};vr.render=function(e,t,n){if(!vp(t))throw Error(te(200));return yp(null,e,t,!1,n)};vr.unmountComponentAtNode=function(e){if(!vp(e))throw Error(te(40));return e._reactRootContainer?(xs(function(){yp(null,null,e,!1,function(){e._reactRootContainer=null,e[Bi]=null})}),!0):!1};vr.unstable_batchedUpdates=i0;vr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vp(n))throw Error(te(200));if(e==null||e._reactInternals===void 0)throw Error(te(38));return yp(e,t,n,!1,r)};vr.version="18.3.1-next-f1338f8080-20240426";function Pj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pj)}catch(e){console.error(e)}}Pj(),Pw.exports=vr;var Tj=Pw.exports;const Qe=E.forwardRef(({options:e,value:t,onChange:n,placeholder:r="Search...",renderOption:a},l)=>{const[c,d]=E.useState(!1),[p,m]=E.useState(""),[h,g]=E.useState({top:0,left:0,width:0}),x=E.useRef(null),j=E.useRef(null),b=e.find(w=>w.value===t),_=e.filter(w=>{var C;return w.label.toLowerCase().includes(p.toLowerCase())||((C=w.description)==null?void 0:C.toLowerCase().includes(p.toLowerCase()))});E.useEffect(()=>{function w(C){x.current&&!x.current.contains(C.target)&&d(!1)}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),E.useEffect(()=>{c&&j.current&&j.current.focus()},[c]),E.useEffect(()=>{if(c&&x.current){const w=x.current.getBoundingClientRect();g({top:w.bottom+window.scrollY,left:w.left+window.scrollX,width:w.width})}},[c]);const N=(w,C)=>{C.preventDefault(),C.stopPropagation(),n(w),d(!1),m("")},y=c&&Tj.createPortal(s.jsxs("div",{className:"fixed bg-white shadow-lg rounded-md overflow-hidden border border-gray-200",style:{top:h.top,left:h.left,width:h.width,zIndex:9999},children:[s.jsx("div",{className:"p-2 border-b",children:s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{ref:j,type:"text",className:"w-full pl-9 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",placeholder:"Search...",value:p,onChange:w=>m(w.target.value),onMouseDown:w=>w.stopPropagation()})]})}),s.jsx("div",{className:"max-h-60 overflow-y-auto",children:_.length===0?s.jsx("div",{className:"text-center py-4 text-sm text-gray-500",children:"No results found"}):s.jsx("ul",{className:"py-1",children:_.map(w=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:`w-full text-left px-4 py-2 hover:bg-gray-100 ${w.value===t?"bg-blue-50":""}`,onMouseDown:C=>N(w.value,C),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"block font-medium",children:w.label}),w.value===t&&s.jsx(mO,{className:"w-4 h-4 text-blue-600"})]}),w.description&&s.jsx("span",{className:"block text-sm text-gray-500",children:w.description})]})},w.value))})})]}),document.body);return s.jsxs("div",{className:"relative",ref:x,children:[s.jsx("button",{type:"button",onMouseDown:w=>{w.preventDefault(),d(!c)},className:"w-full bg-white relative border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",ref:l,children:b?s.jsx("span",{className:"block truncate",children:b.label}):s.jsx("span",{className:"block truncate text-gray-500",children:r})}),y]})}),Nb=e=>e==="float"||e==="integer",kb=e=>e==="text"||e==="string"||e==="categorical",Gu=e=>{var t,n,r,a,l,c,d;return{method:(e==null?void 0:e.method)||"none",encoding:e==null?void 0:e.encoding,params:{categorical_min:((t=e==null?void 0:e.params)==null?void 0:t.categorical_min)??100,clip:(n=e==null?void 0:e.params)==null?void 0:n.clip,constant:(r=e==null?void 0:e.params)==null?void 0:r.constant,llm:(a=e==null?void 0:e.params)==null?void 0:a.llm,model:(l=e==null?void 0:e.params)==null?void 0:l.model,dimensions:(c=e==null?void 0:e.params)==null?void 0:c.dimensions,preset:(d=e==null?void 0:e.params)==null?void 0:d.preset}}};function bI({column:e,dataset:t,setColumnType:n,setDataset:r,constants:a,onUpdate:l}){var ne,me,Re,gt,tt,K,je,Ae,ke,Y,fe,ve,Ve,pn,Ye,Sn,nr,jt,on,St,Zt,Lt,Nn,Fn,ie,xe,at,Ge,st,kn,Nt,rr,ir,br,zn,Cn,ar,sr,ii;const[c,d]=E.useState(!!((me=(ne=e.preprocessing_steps)==null?void 0:ne.inference)!=null&&me.method&&e.preprocessing_steps.inference.method!=="none")),p=e.datatype,[m,h]=E.useState(()=>{var Q;return Gu((Q=e.preprocessing_steps)==null?void 0:Q.training)}),[g,x]=E.useState(()=>{var Q;return Gu((Q=e.preprocessing_steps)==null?void 0:Q.inference)});E.useEffect(()=>{var Q,ae;h(Gu((Q=e.preprocessing_steps)==null?void 0:Q.training)),x(Gu((ae=e.preprocessing_steps)==null?void 0:ae.inference))},[e.id]);const j=(Q,ae)=>{let ye={};const nt=Q==="training"?m:g;let Ce=null;kb(p)&&nt.encoding?Ce=nt.encoding:p==="categorical"&&(ae==="categorical"?(ye={...ye,categorical_min:100},Ce="one_hot"):ae!=="none"&&(Ce="one_hot")),e.is_target&&(Ce="ordinal");const pt={method:ae,encoding:Ce,params:ye};Q==="training"?(h(pt),l(pt,c?g:void 0,c)):(x(pt),l(m,pt,c))},b=(Q,ae)=>{const ye=m,nt=h,Ce={...ye,params:{categorical_min:ye.params.categorical_min,clip:ye.params.clip,constant:ye.params.constant,llm:ye.params.llm,model:ye.params.model,dimensions:ye.params.dimensions,preset:ye.params.preset,...ae}};nt(Ce),l(Ce,c?g:void 0,c)},_=(Q,ae)=>{const ye=m,nt=h,Ce={...ye,params:{...ye.params,clip:{...ye.params.clip,...ae}}};nt(Ce),l(Ce,c?g:void 0,c)},N=(Q,ae)=>{const ye=Q==="training"?m:g,nt=Q==="training"?h:x,Ce={...ye,params:{...ye.params,constant:ae}};nt(Ce),Q==="training"?l(Ce,c?g:void 0,c):l(m,Ce,c)},y=(Q,ae)=>{const ye=Q==="training"?m:g,nt=Q==="training"?h:x,Ce={...ye,params:{...ye.params,...ae}};nt(Ce),Q==="training"?l(Ce,c?g:void 0,c):l(m,Ce,c)},w=(Q,ae)=>{var Dt,ft;const ye=Q==="training"?m:g,nt=Q==="training"?h:x;let Ce={...ye.params};if(ae==="embedding"){const en=a.embedding_constants;if(en){const Vt="openai",$n=(Dt=(en.models[Vt]||[])[0])==null?void 0:Dt.value,Fr=((ft=(en.models[Vt]||[]).find(fn=>fn.value===$n))==null?void 0:ft.dimensions)||1536;Ce={...Ce,llm:Ce.llm||Vt,model:Ce.model||$n,dimensions:Ce.dimensions||Fr,preset:Ce.preset||"high_quality"}}}const pt={...ye,encoding:ae==="none"?null:ae,params:Ce};nt(pt),Q==="training"?l(pt,c?g:void 0,c):l(m,pt,c)},C=Q=>{var ye,nt;const ae=Q==="training"?m:g;return ae.method!=="constant"?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Constant Value"}),Nb(p)?s.jsx("input",{type:"number",value:((ye=ae.params)==null?void 0:ye.constant)??"",onChange:Ce=>N(Q,Ce.target.value),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"Enter a number..."}):s.jsx("input",{type:"text",value:((nt=ae.params)==null?void 0:nt.constant)??"",onChange:Ce=>N(Q,Ce.target.value),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"Enter a value..."})]})},R=Q=>{const ae=Q==="training"?m:g;return!ae||!kb(p)?null:s.jsxs("div",{className:"mt-4 space-y-4 bg-gray-50 rounded-lg p-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Encoding"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"noneEncode",name:"encoding",checked:ae.encoding===null,onChange:()=>w(Q,"none"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"noneEncode",className:"text-sm text-gray-700",children:"No encoding"})]}),p==="categorical"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"oneHotEncode",name:"encoding",checked:ae.encoding==="one_hot",onChange:()=>w(Q,"one_hot"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"oneHotEncode",className:"text-sm text-gray-700",children:"One-hot encode categories"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"ordinalEncode",name:"encoding",checked:ae.encoding==="ordinal",onChange:()=>w(Q,"ordinal"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"ordinalEncode",className:"text-sm text-gray-700",children:"Ordinal encode categories"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"embeddingEncode",name:"encoding",checked:ae.encoding==="embedding",onChange:()=>w(Q,"embedding"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"embeddingEncode",className:"text-sm text-gray-700",children:"Embedding encode"})]})]})},D=Q=>{var fn,ai,mn,zr,wr,_r,ws,_s,js,Ss,Ns,En;const ae=Q==="training"?m:g;if(!ae||ae.encoding!=="embedding"||!a.embedding_constants)return null;const ye=a.embedding_constants,nt=ye.providers||[],Ce=ye.models||{},pt=Object.entries(ye.compression_presets||{}).map(([Fe,rt])=>({value:Fe,label:Fe.split("_").map(xt=>xt.charAt(0).toUpperCase()+xt.slice(1)).join(" "),description:rt.description,variance_target:rt.variance_target})),Dt=Fe=>Ce[Fe]||[],ft=()=>{var $r,Ur,An;const Fe=(($r=ae.params)==null?void 0:$r.llm)||"openai",rt=((Ur=ae.params)==null?void 0:Ur.model)||((An=Dt(Fe)[0])==null?void 0:An.value),xt=Dt(Fe).find(Ki=>Ki.value===rt);return(xt==null?void 0:xt.dimensions)||1536},en=Fe=>{var rt;return((rt=pt.find(xt=>Math.abs(xt.variance_target-Fe)<.05))==null?void 0:rt.value)||null},Vt=Fe=>{var rt;return((rt=pt.find(xt=>xt.value===Fe))==null?void 0:rt.variance_target)||.85},$n=Fe=>{const rt=Fe/ft(),xt=en(rt);y(Q,{dimensions:Fe,preset:xt})},Fr=Fe=>{const rt=Vt(Fe),xt=Math.round(rt*ft());y(Q,{dimensions:xt,preset:Fe})};return s.jsxs("div",{className:"space-y-6 mt-8",children:[s.jsx("div",{className:"bg-blue-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(yi,{className:"w-5 h-5 text-blue-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-blue-900",children:"Text Embeddings"}),s.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Convert text into numerical vectors for machine learning, preserving semantic meaning while optimizing for storage and performance."})]})]})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Embedding Provider"}),s.jsx(Qe,{value:((fn=ae.params)==null?void 0:fn.llm)||"openai",onChange:Fe=>{var Ur,An;const rt=Dt(Fe),xt=(Ur=rt[0])==null?void 0:Ur.value,$r=((An=rt[0])==null?void 0:An.dimensions)||1536;y(Q,{...ae.params,llm:Fe,model:xt,dimensions:$r,preset:"high_quality"})},options:nt,placeholder:"Select a provider"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),s.jsx(Qe,{value:((ai=ae.params)==null?void 0:ai.model)||((zr=Dt(((mn=ae.params)==null?void 0:mn.llm)||"openai")[0])==null?void 0:zr.value),onChange:Fe=>{var $r;const rt=Dt((($r=ae.params)==null?void 0:$r.llm)||"openai").find(Ur=>Ur.value===Fe),xt=(rt==null?void 0:rt.dimensions)||1536;y(Q,{...ae.params,model:Fe,dimensions:xt,preset:"high_quality"})},options:Dt(((wr=ae.params)==null?void 0:wr.llm)||"openai"),placeholder:"Select a model"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Storage & Quality"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[s.jsx(CO,{className:"w-4 h-4"}),s.jsx("span",{children:"Storage"}),s.jsx("span",{className:"mx-2",children:"•"}),s.jsx("span",{children:"Quality"}),s.jsx(NO,{className:"w-4 h-4"})]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm text-gray-600",children:"Target Dimensions"}),s.jsx("span",{className:"text-sm font-medium text-gray-900",children:((_r=ae.params)==null?void 0:_r.dimensions)||ft()})]}),s.jsx("input",{type:"range",min:"2",max:ft(),value:((ws=ae.params)==null?void 0:ws.dimensions)||ft(),onChange:Fe=>$n(parseInt(Fe.target.value)),className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[s.jsx("span",{children:"2"}),s.jsx("span",{children:ft()})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Quality Presets"}),pt.map(Fe=>{var rt,xt;return s.jsxs("div",{onClick:()=>Fr(Fe.value),className:`p-4 rounded-lg border transition-colors cursor-pointer
|
481
|
-
${((rt=ae.params)==null?void 0:rt.preset)===Fe.value?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300 bg-white"}`,children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",checked:((xt=ae.params)==null?void 0:xt.preset)===Fe.value,onChange:()=>Fr(Fe.value),className:"rounded-full border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("span",{className:"font-medium text-gray-900",children:Fe.label})]})}),s.jsx("p",{className:"text-sm text-gray-600 mt-1 ml-6",children:Fe.description})]},Fe.value)})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ls,{className:"w-5 h-5 text-gray-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Storage Efficiency"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-green-600 rounded-full",style:{width:`${100-(((_s=ae.params)==null?void 0:_s.dimensions)||24)/ft()*100}%`}})}),s.jsx("p",{className:"text-sm text-gray-600 mt-2",children:(js=ae.params)!=null&&js.dimensions&&ae.params.dimensions<=ft()*.25?"Optimized for storage. Maintains core meaning while significantly reducing storage requirements.":(Ss=ae.params)!=null&&Ss.dimensions&&ae.params.dimensions<=ft()*.5?"Balanced approach. Good compromise between quality and storage efficiency.":"Prioritizes quality. Preserves more nuanced relationships but requires more storage."})]})]})]})}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(yi,{className:"w-5 h-5 text-gray-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Information Preservation"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full transition-all duration-300",style:{width:`${(((Ns=ae.params)==null?void 0:Ns.dimensions)||24)/ft()*100}%`}})}),s.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Preserves approximately ",Math.round((((En=ae.params)==null?void 0:En.dimensions)||24)/ft()*100),"% of the original information"]})]})]})]})})]})]})]})]})]})};E.useEffect(()=>{var Q,ae,ye,nt,Ce,pt,Dt,ft,en,Vt,$n,Fr;if(m.encoding==="embedding"&&!((Q=m.params)!=null&&Q.dimensions)){const fn=((ae=m.params)==null?void 0:ae.llm)||"openai",ai=((ye=m.params)==null?void 0:ye.model)||((Ce=(((nt=a.embedding_constants)==null?void 0:nt.models[fn])||[])[0])==null?void 0:Ce.value),mn=(((pt=a.embedding_constants)==null?void 0:pt.models[fn])||[]).find(wr=>wr.value===ai),zr=(mn==null?void 0:mn.dimensions)||1536;y("training",{dimensions:zr})}if(c&&g.encoding==="embedding"&&!((Dt=g.params)!=null&&Dt.dimensions)){const fn=((ft=g.params)==null?void 0:ft.llm)||"openai",ai=((en=g.params)==null?void 0:en.model)||(($n=(((Vt=a.embedding_constants)==null?void 0:Vt.models[fn])||[])[0])==null?void 0:$n.value),mn=(((Fr=a.embedding_constants)==null?void 0:Fr.models[fn])||[]).find(wr=>wr.value===ai),zr=(mn==null?void 0:mn.dimensions)||1536;y("inference",{dimensions:zr})}},[m.encoding,g.encoding,e.id]);const[T,F]=E.useState(!1),z=Q=>{const ae=t.columns.map(ye=>({...ye,drop_if_null:ye.name===e.name?Q.target.checked:ye.drop_if_null}));r({...t,columns:ae})},B=Q=>{const ae=t.columns.map(ye=>({...ye,description:ye.name===e.name?Q.target.value:ye.description}));r({...t,columns:ae})},W=()=>{F(!1)},pe=Q=>{Q.key==="Enter"?(Q.preventDefault(),F(!1)):Q.key==="Escape"&&F(!1)},oe=()=>{F(!0)};let we=((gt=(Re=e.statistics)==null?void 0:Re.processed)==null?void 0:gt.null_count)||((K=(tt=e.statistics)==null?void 0:tt.raw)==null?void 0:K.null_count)||0,be=((Ae=(je=e.statistics)==null?void 0:je.processed)==null?void 0:Ae.num_rows)||((Y=(ke=e.statistics)==null?void 0:ke.raw)==null?void 0:Y.num_rows)||0;const J=we&&be?we/be*100:0,ee=(ve=(fe=e.statistics)==null?void 0:fe.processed)!=null&&ve.null_count&&((pn=(Ve=e.statistics)==null?void 0:Ve.processed)!=null&&pn.num_rows)?e.statistics.processed.null_count/e.statistics.processed.num_rows*100:0,le=be,G=Q=>{var nt,Ce,pt,Dt,ft,en,Vt;const ae=m;let ye;if(ae.method==="most_frequent"&&((Ce=(nt=e.statistics)==null?void 0:nt.raw)==null?void 0:Ce.most_frequent_value)!==void 0)ye=`Most Frequent Value: ${e.statistics.raw.most_frequent_value}`;else if(ae.method==="ffill"){const $n=(pt=e.statistics)==null?void 0:pt.raw.last_value;$n!==void 0?ye=`Forward Fill using Last Value: ${$n}`:ye="Set date column & apply preprocessing to see last value"}else if(ae.method==="median"&&((ft=(Dt=e.statistics)==null?void 0:Dt.raw)==null?void 0:ft.median)!==void 0)ye=`Median: ${e.statistics.raw.median}`;else if(ae.method==="mean"&&((Vt=(en=e.statistics)==null?void 0:en.raw)==null?void 0:Vt.mean)!==void 0)ye=`Mean: ${e.statistics.raw.mean}`;else return null;return s.jsx("div",{className:"mt-4 bg-yellow-50 rounded-lg p-4",children:s.jsx("span",{className:"text-sm font-medium text-yellow-700",children:ye})})},re=()=>s.jsx("div",{className:"space-y-4",children:e.lineage.map((Q,ae)=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${Q.key==="raw_dataset"?"bg-gray-100":Q.key==="computed_by_feature"?"bg-purple-100":"bg-blue-100"}`,children:Q.key==="raw_dataset"?s.jsx(wn,{className:"w-4 h-4 text-gray-600"}):Q.key==="computed_by_feature"?s.jsx(bd,{className:"w-4 h-4 text-purple-600"}):s.jsx(Aa,{className:"w-4 h-4 text-blue-600"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900",children:Q.description}),Q.timestamp&&s.jsx("span",{className:"text-xs text-gray-500",children:new Date(Q.timestamp).toLocaleString()})]}),ae<e.lineage.length-1&&s.jsx("div",{className:"ml-4 mt-2 mb-2 w-0.5 h-4 bg-gray-200"})]})]},ae))});return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex-1 max-w-[70%]",children:[s.jsx("h2",{className:"text-2xl font-semibold text-gray-900",children:e.name}),s.jsx("div",{className:"mt-1 flex items-start gap-1",children:T?s.jsxs("div",{className:"flex-1",children:[s.jsx("textarea",{value:e.description||"",onChange:B,onBlur:W,onKeyDown:pe,className:"w-full px-2 py-1 text-sm text-gray-900 border border-blue-500 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",rows:2,autoFocus:!0,placeholder:"Enter column description..."}),s.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Press Enter to save, Escape to cancel"})]}):s.jsxs("div",{className:"flex items-start gap-1 max-w-[100%]",children:[s.jsx("p",{className:"text-sm text-gray-500 cursor-pointer flex-grow line-clamp-3",onClick:oe,children:e.description||"No description provided"}),s.jsx("button",{onClick:oe,className:"p-1 text-gray-400 hover:text-gray-600 rounded-md hover:bg-gray-100 flex-shrink-0",children:s.jsx(EO,{className:"w-4 h-4"})})]})})]}),s.jsx("div",{className:"flex items-center gap-4 flex-shrink-0",children:s.jsxs("div",{className:"relative flex items-center gap-2",children:[s.jsxs("div",{className:"absolute right-0 -top-8 flex items-center gap-2",children:[e.required&&s.jsx(ga,{variant:"secondary",className:"bg-blue-100 text-blue-800",children:"Required"}),e.is_computed&&s.jsxs(ga,{variant:"secondary",className:"bg-purple-100 text-purple-800",children:[s.jsx(bd,{className:"w-3 h-3 mr-1"}),"Computed"]})]}),e.is_target?s.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800",children:"Target Column"}):s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:e.drop_if_null,onChange:z,className:"rounded border-gray-300 text-red-600 focus:ring-red-500"}),s.jsxs("span",{className:"flex items-center gap-1 text-gray-700",children:[s.jsx(Fo,{className:"w-4 h-4 text-gray-400"}),"Drop if null"]})]})})]})})]}),s.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(wn,{className:"w-4 h-4 text-gray-500"}),s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:"Raw Data Statistics"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Values:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(nr=(Sn=(Ye=e.statistics)==null?void 0:Ye.raw)==null?void 0:Sn.null_count)==null?void 0:nr.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Total Rows:"}),s.jsx("span",{className:"font-medium text-gray-900",children:le.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Percentage:"}),s.jsxs("span",{className:"font-medium text-gray-900",children:[J.toFixed(2),"%"]})]}),s.jsx("div",{className:"mt-2",children:s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-blue-600 rounded-full",style:{width:`${J}%`}})})})]})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(eh,{className:"w-4 h-4 text-gray-500"}),s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:"Processed Data Statistics"})]}),(jt=t==null?void 0:t.preprocessing_steps)!=null&&jt.training?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Values:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(Zt=(St=(on=e.statistics)==null?void 0:on.processed)==null?void 0:St.null_count)==null?void 0:Zt.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Total Rows:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(Fn=(Nn=(Lt=e.statistics)==null?void 0:Lt.processed)==null?void 0:Nn.num_rows)==null?void 0:Fn.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Percentage:"}),s.jsxs("span",{className:"font-medium text-gray-900",children:[ee.toFixed(2),"%"]})]}),s.jsx("div",{className:"mt-2",children:s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-blue-600 rounded-full",style:{width:`${ee}%`}})})})]}):s.jsx("div",{className:"text-sm text-gray-500 text-center py-2",children:"No preprocessing configured"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6",children:[s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Type"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:e.datatype})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Unique Values"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:((at=(xe=(ie=e.statistics)==null?void 0:ie.processed)==null?void 0:xe.unique_count)==null?void 0:at.toLocaleString())??"N/A"})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Null Values"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:((kn=(st=(Ge=e.statistics)==null?void 0:Ge.processed)==null?void 0:st.null_count)==null?void 0:kn.toLocaleString())??"0"})]})]}),(Nt=e.statistics)!=null&&Nt.processed.null_count?s.jsxs("div",{className:"mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Null Distribution"}),s.jsxs("span",{className:"text-sm text-gray-500",children:[J.toFixed(2),"% of values are null"]})]}),s.jsx("div",{className:"relative h-2 bg-gray-100 rounded-full overflow-hidden",children:s.jsx("div",{className:"absolute top-0 left-0 h-full bg-yellow-400 rounded-full",style:{width:`${J}%`}})})]}):s.jsx("div",{className:"mt-6 bg-green-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}),s.jsx("span",{className:"text-sm text-green-700",children:"This column has no null values"})]})}),((ir=(rr=e.statistics)==null?void 0:rr.raw)==null?void 0:ir.sample_data)&&s.jsxs("div",{className:"mt-6",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Sample Values"}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Array.isArray(e.sample_values)?e.sample_values.slice(0,3).map((Q,ae)=>s.jsx("span",{className:"m-1 flex-items items-center",children:s.jsx(ga,{children:typeof Q=="string"?Q.split(/\s+/).slice(0,10).join(" ")+(Q.split(/\s+/).length>10?"...":""):String(Q)})},ae)):[]})})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(Aa,{className:"w-5 h-5 text-gray-500"}),"Data Type"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Column Type"}),s.jsx(Qe,{value:p,onChange:Q=>n(e.name,Q),options:a.column_types.map(Q=>({value:Q.value,label:Q.label}))})]}),s.jsxs("div",{className:"bg-gray-50 rounded-md p-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Sample Data"}),s.jsx("div",{className:"space-y-2",children:Array.isArray(e.sample_values)?e.sample_values.slice(0,3).map((Q,ae)=>s.jsx("span",{className:"m-1 flex-items items-center",children:s.jsx(ga,{children:typeof Q=="string"?Q.split(/\s+/).slice(0,10).join(" ")+(Q.split(/\s+/).length>10?"...":""):String(Q)})},ae)):[]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(eh,{className:"w-5 h-5 text-gray-500"}),"Preprocessing Strategy"]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Training Strategy"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",id:"useDistinctInference",checked:c,onChange:Q=>{d(Q.target.checked),l(m,Q.target.checked?g:void 0,Q.target.checked)},className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"useDistinctInference",className:"text-sm text-gray-700",children:"Use different strategy for inference"})]})]}),s.jsxs("div",{className:c?"grid grid-cols-2 gap-6":"",children:[s.jsxs("div",{className:"relative z-50",children:[s.jsx(Qe,{value:m.method,onChange:Q=>j("training",Q),options:[{value:"none",label:"No preprocessing"},...((br=a.preprocessing_strategies[p])==null?void 0:br.map(Q=>({value:Q.value,label:Q.label})))||[]],options:a.preprocessing_strategies[p]}),G(),C("training"),R("training"),D("training"),e.datatype==="categorical"&&m.method==="categorical"&&s.jsx("div",{className:"mt-4 space-y-4 bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Minimum Category Instances"}),s.jsx("input",{type:"number",min:"1",value:m.params.categorical_min,onChange:Q=>b("training",{categorical_min:parseInt(Q.target.value)}),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:'Categories with fewer instances will be grouped as "OTHER"'})]})})]}),c&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(xg,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Inference Strategy"})]}),s.jsx(Qe,{value:g.method,onChange:Q=>j("inference",Q),options:[{value:"none",label:"No preprocessing"},...((zn=a.preprocessing_strategies[p])==null?void 0:zn.map(Q=>({value:Q.value,label:Q.label})))||[]]}),C("inference"),R("inference"),D("inference")]})]})]}),Nb(p)&&m.method!=="none"&&s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Clip Values"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Min Value"}),s.jsx("input",{type:"number",value:((ar=(Cn=m.params)==null?void 0:Cn.clip)==null?void 0:ar.min)??"",onChange:Q=>{_("training",{min:Q.target.value?Number(Q.target.value):void 0})},className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"No minimum"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max Value"}),s.jsx("input",{type:"number",value:((ii=(sr=m.params)==null?void 0:sr.clip)==null?void 0:ii.max)??"",onChange:Q=>{_("training",{max:Q.target.value?Number(Q.target.value):void 0})},className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"No maximum"})]})]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(xw,{className:"w-5 h-5 text-gray-500"}),"Column Lineage"]}),s.jsx("div",{className:"space-y-4",children:re()})]})]})}function wI({columns:e,selectedColumn:t,onColumnSelect:n,onToggleHidden:r}){return tr().props,s.jsx("div",{className:"space-y-2 pb-2",children:e.map(a=>{var l,c,d;return s.jsxs("div",{className:`p-3 rounded-lg border ${t===a.name?"border-blue-500 bg-blue-50":a.is_target?"border-purple-500 bg-purple-50":a.hidden?"border-gray-200 bg-gray-50":"border-gray-200 hover:border-gray-300"} transition-colors duration-150`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[a.is_target&&s.jsx(bg,{className:"w-4 h-4 text-purple-500"}),s.jsx("span",{className:`font-medium ${a.hidden?"text-gray-500":"text-gray-900"}`,children:a.name}),s.jsx("span",{className:"text-xs px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:a.datatype})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[!a.is_target&&s.jsx("button",{onClick:()=>r(a.name),className:`p-1 rounded hover:bg-gray-100 ${a.hidden?"text-gray-500":"text-gray-400 hover:text-gray-600"}`,title:a.hidden?"Show column":"Hide column",children:a.hidden?s.jsx(Zm,{className:"w-4 h-4"}):s.jsx(mw,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>n(a.name),className:"p-1 rounded text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Configure preprocessing",children:s.jsx(Aa,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"text-sm text-gray-500",children:[a.description&&s.jsx("p",{className:`mb-1 line-clamp-1 ${a.drop_if_null?"text-gray-400":""}`,children:a.description}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.required&&s.jsxs("div",{className:"flex items-center gap-1 text-blue-600",children:[s.jsx(PO,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"required"})]}),a.is_computed&&s.jsxs("div",{className:"flex items-center gap-1 text-purple-600",children:[s.jsx(bd,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"computed"})]}),a.preprocessing_steps&&((l=a.preprocessing_steps)==null?void 0:l.training)&&((d=(c=a.preprocessing_steps)==null?void 0:c.training)==null?void 0:d.method)!=="none"&&s.jsxs("div",{className:"flex items-center gap-1 text-blue-600",children:[s.jsx(Xn,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"preprocessing configured"})]}),a.hidden&&s.jsxs("div",{className:"flex items-center gap-1 text-gray-400",children:[s.jsx(Zm,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"Hidden from training"})]})]})]})]},a.name)})})}const Am=5;function _I({types:e,activeFilters:t,onFilterChange:n,columnStats:r,colHasPreprocessingSteps:a,columns:l}){const c=b=>{switch(b){case"training":return`${r.training} columns`;case"hidden":return`${r.hidden} columns`;case"preprocessed":return`${r.withPreprocessing} columns`;case"nulls":return`${r.withNulls} columns`;case"computed":return`${r.computed} columns`;case"required":return`${r.required} columns`;default:return`${r.total} columns`}},d=b=>{var _,N,y,w;return!((N=(_=b.statistics)==null?void 0:_.processed)!=null&&N.null_count)||!((w=(y=b.statistics)==null?void 0:y.processed)!=null&&w.num_rows)?0:b.statistics.processed.null_count/b.statistics.processed.num_rows*100},p=l.filter(b=>{var _,N,y,w;return((N=(_=b.statistics)==null?void 0:_.processed)==null?void 0:N.null_count)&&((w=(y=b.statistics)==null?void 0:y.processed)==null?void 0:w.null_count)>0}).sort((b,_)=>d(_)-d(b)),[m,h]=E.useState(1),g=Math.ceil(p.length/Am),x=p.slice((m-1)*Am,m*Am),j=b=>{n({...t,types:t.types.includes(b)?t.types.filter(_=>_!==b):[...t.types,b]})};return s.jsxs("div",{className:"p-4 border-b space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h3",{className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[s.jsx(_O,{className:"w-4 h-4"}),"Column Views"]}),s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",r.filtered," of ",r.total," columns"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{onClick:()=>n({...t,view:"all"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="all"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(wn,{className:"w-4 h-4"}),"All",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("all"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"training"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="training"?"bg-green-100 text-green-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(mw,{className:"w-4 h-4"}),"Training",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("training"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"hidden"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="hidden"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(Zm,{className:"w-4 h-4"}),"Hidden",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("hidden"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"preprocessed"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="preprocessed"?"bg-blue-100 text-blue-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(eh,{className:"w-4 h-4"}),"Preprocessed",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("preprocessed"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"nulls"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="nulls"?"bg-yellow-100 text-yellow-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(_w,{className:"w-4 h-4"}),"Has Nulls",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("nulls"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"computed"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="computed"?"bg-purple-100 text-purple-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(bd,{className:"w-4 h-4"}),"Computed",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("computed"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"required"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="required"?"bg-blue-100 text-blue-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(bg,{className:"w-4 h-4"}),"Required",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("required"),")"]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-gray-700 mb-2 block",children:"Column Types"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(b=>s.jsx("button",{onClick:()=>j(b),className:`px-2 py-1 rounded-md text-xs font-medium ${t.types.includes(b)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:b},b))})]}),t.view==="preprocessed"&&r.withPreprocessing>0&&s.jsxs("div",{className:"bg-blue-50 rounded-lg p-3",children:[s.jsx("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:"Preprocessing Overview"}),s.jsx("div",{className:"space-y-2",children:l.filter(a).map(b=>{var _;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-blue-800",children:b.name}),s.jsx("span",{className:"text-blue-600",children:(_=b.preprocessing_steps)==null?void 0:_.training.method})]},b.name)})})]}),t.view==="nulls"&&p.length>0&&s.jsxs("div",{className:"bg-yellow-50 rounded-lg p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h4",{className:"text-sm font-medium text-yellow-900",children:"Null Value Distribution"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-700",children:[s.jsx("button",{onClick:()=>h(b=>Math.max(1,b-1)),disabled:m===1,className:"p-1 rounded hover:bg-yellow-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-4 h-4"})}),s.jsxs("span",{children:["Page ",m," of ",g]}),s.jsx("button",{onClick:()=>h(b=>Math.min(g,b+1)),disabled:m===g,className:"p-1 rounded hover:bg-yellow-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"space-y-2",children:x.map(b=>{var _,N,y,w;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-yellow-800 text-sm min-w-[120px]",children:b.name}),s.jsx("div",{className:"flex-1 h-2 bg-yellow-100 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-yellow-400 rounded-full",style:{width:`${d(b)}%`}})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-yellow-800 text-xs",children:[d(b).toFixed(1),"% null"]}),s.jsxs("span",{className:"text-yellow-600 text-xs",children:["(",(N=(_=b.statistics)==null?void 0:_.nullCount)==null?void 0:N.toLocaleString()," / ",(w=(y=b.statistics)==null?void 0:y.rowCount)==null?void 0:w.toLocaleString(),")"]})]})]},b.name)})}),s.jsxs("div",{className:"mt-3 text-sm text-yellow-700",children:[p.length," columns contain null values"]})]})]})]})}function jI({saving:e,saved:t,error:n}){return n?s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:n})]}):e?s.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[s.jsx(ps,{className:"w-4 h-4 animate-spin"}),s.jsx("span",{className:"text-sm font-medium",children:"Saving changes..."})]}):t?s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ww,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Changes saved"})]}):null}function SI(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Oj=SI,NI=typeof bn=="object"&&bn&&bn.Object===Object&&bn,kI=NI,CI=kI,EI=typeof self=="object"&&self&&self.Object===Object&&self,AI=CI||EI||Function("return this")(),Rj=AI,PI=Rj,TI=function(){return PI.Date.now()},OI=TI,RI=/\s/;function II(e){for(var t=e.length;t--&&RI.test(e.charAt(t)););return t}var MI=II,LI=MI,DI=/^\s+/;function FI(e){return e&&e.slice(0,LI(e)+1).replace(DI,"")}var zI=FI,$I=Rj,UI=$I.Symbol,Ij=UI,Cb=Ij,Mj=Object.prototype,BI=Mj.hasOwnProperty,WI=Mj.toString,jl=Cb?Cb.toStringTag:void 0;function HI(e){var t=BI.call(e,jl),n=e[jl];try{e[jl]=void 0;var r=!0}catch{}var a=WI.call(e);return r&&(t?e[jl]=n:delete e[jl]),a}var qI=HI,VI=Object.prototype,GI=VI.toString;function KI(e){return GI.call(e)}var QI=KI,Eb=Ij,XI=qI,YI=QI,JI="[object Null]",ZI="[object Undefined]",Ab=Eb?Eb.toStringTag:void 0;function eM(e){return e==null?e===void 0?ZI:JI:Ab&&Ab in Object(e)?XI(e):YI(e)}var tM=eM;function nM(e){return e!=null&&typeof e=="object"}var rM=nM,iM=tM,aM=rM,sM="[object Symbol]";function oM(e){return typeof e=="symbol"||aM(e)&&iM(e)==sM}var lM=oM,cM=zI,Pb=Oj,uM=lM,Tb=NaN,dM=/^[-+]0x[0-9a-f]+$/i,pM=/^0b[01]+$/i,fM=/^0o[0-7]+$/i,mM=parseInt;function hM(e){if(typeof e=="number")return e;if(uM(e))return Tb;if(Pb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cM(e);var n=pM.test(e);return n||fM.test(e)?mM(e.slice(2),n?2:8):dM.test(e)?Tb:+e}var gM=hM,xM=Oj,Pm=OI,Ob=gM,vM="Expected a function",yM=Math.max,bM=Math.min;function wM(e,t,n){var r,a,l,c,d,p,m=0,h=!1,g=!1,x=!0;if(typeof e!="function")throw new TypeError(vM);t=Ob(t)||0,xM(n)&&(h=!!n.leading,g="maxWait"in n,l=g?yM(Ob(n.maxWait)||0,t):l,x="trailing"in n?!!n.trailing:x);function j(T){var F=r,z=a;return r=a=void 0,m=T,c=e.apply(z,F),c}function b(T){return m=T,d=setTimeout(y,t),h?j(T):c}function _(T){var F=T-p,z=T-m,B=t-F;return g?bM(B,l-z):B}function N(T){var F=T-p,z=T-m;return p===void 0||F>=t||F<0||g&&z>=l}function y(){var T=Pm();if(N(T))return w(T);d=setTimeout(y,_(T))}function w(T){return d=void 0,x&&r?j(T):(r=a=void 0,c)}function C(){d!==void 0&&clearTimeout(d),m=0,r=p=a=d=void 0}function R(){return d===void 0?c:w(Pm())}function D(){var T=Pm(),F=N(T);if(r=arguments,a=this,p=T,F){if(d===void 0)return b(p);if(g)return clearTimeout(d),d=setTimeout(y,t),j(p)}return d===void 0&&(d=setTimeout(y,t)),c}return D.cancel=C,D.flush=R,D}var _M=wM;const jM=lc(_M);function SM(e,t,n=1e3){const[r,a]=E.useState({saving:!1,saved:!1,error:null}),l=E.useRef(JSON.stringify(e)),c=E.useCallback(jM(async d=>{a(p=>({...p,saving:!0,error:null}));try{await t(d),l.current=JSON.stringify(d),a({saving:!1,saved:!0,error:null}),setTimeout(()=>{a(p=>({...p,saved:!1}))},4e3)}catch(p){a({saving:!1,saved:!1,error:p instanceof Error?p.message:"Failed to save changes"})}},n),[t,n]);return E.useEffect(()=>(JSON.stringify(e)!==l.current&&c(e),()=>{c.cancel()}),[e,c]),r}function NM({trigger:e,children:t,className:n=""}){const[r,a]=E.useState(!1),l=E.useRef(null),c=E.useRef(null);return E.useEffect(()=>{const d=p=>{var m;l.current&&!l.current.contains(p.target)&&!((m=c.current)!=null&&m.contains(p.target))&&a(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),s.jsxs("div",{className:"relative",children:[s.jsx("div",{ref:c,onClick:()=>a(!r),children:e}),r&&s.jsxs("div",{ref:l,className:`absolute z-50 right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 ${n}`,children:[s.jsxs("div",{className:"flex justify-between items-center p-3 border-b border-gray-200",children:[s.jsx("h3",{className:"font-medium",children:"Feature Configuration"}),s.jsx("button",{onClick:()=>a(!1),className:"text-gray-400 hover:text-gray-600",children:s.jsx(xc,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"p-4",children:t})]})]})}function kM(){return s.jsx(NM,{trigger:s.jsx("button",{type:"button",className:"p-2 text-gray-400 hover:text-gray-600",title:"Configure features",children:s.jsx(Aa,{className:"w-5 h-5"})}),className:"w-96",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Feature options can be configured in the codebase, and loaded in initializers:"}),s.jsx("div",{className:"bg-gray-50 p-3 rounded-md",children:s.jsx("code",{className:"text-sm text-gray-800",children:"config/initializers/features.rb"})}),s.jsx("p",{className:"text-sm text-gray-600",children:"Example feature implementation:"}),s.jsx("pre",{className:"bg-gray-50 p-3 rounded-md overflow-x-auto",children:s.jsx("code",{className:"text-xs text-gray-800",children:`# lib/features/did_convert.rb
|
480
|
+
`+l.stack}return{value:e,source:t,stack:a,digest:null}}function Nm(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Ih(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Q6=typeof WeakMap=="function"?WeakMap:Map;function rj(e,t,n){n=$i(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Bd||(Bd=!0,Hh=r),Ih(e,t)},n}function ij(e,t,n){n=$i(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var a=t.value;n.payload=function(){return r(a)},n.callback=function(){Ih(e,t)}}var l=e.stateNode;return l!==null&&typeof l.componentDidCatch=="function"&&(n.callback=function(){Ih(e,t),typeof r!="function"&&(Sa===null?Sa=new Set([this]):Sa.add(this));var c=t.stack;this.componentDidCatch(t.value,{componentStack:c!==null?c:""})}),n}function ob(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Q6;var a=new Set;r.set(t,a)}else a=r.get(t),a===void 0&&(a=new Set,r.set(t,a));a.has(n)||(a.add(n),e=cI.bind(null,e,t,n),t.then(e,e))}function lb(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function cb(e,t,n,r,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=$i(-1,1),t.tag=2,ja(n,t,1))),n.lanes|=1),e)}var X6=Vi.ReactCurrentOwner,Gn=!1;function In(e,t,n,r){t.child=e===null?R_(t,null,n,r):ko(t,e.child,n,r)}function ub(e,t,n,r,a){n=n.render;var l=t.ref;return ho(t,a),r=Xg(e,t,n,r,l,a),n=Yg(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Hi(e,t,a)):(Ct&&n&&Fg(t),t.flags|=1,In(e,t,r,a),t.child)}function db(e,t,n,r,a){if(e===null){var l=n.type;return typeof l=="function"&&!o0(l)&&l.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=l,aj(e,t,l,r,a)):(e=pd(n.type,null,r,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(l=e.child,!(e.lanes&a)){var c=l.memoizedProps;if(n=n.compare,n=n!==null?n:Xl,n(c,r)&&e.ref===t.ref)return Hi(e,t,a)}return t.flags|=1,e=ka(l,r),e.ref=t.ref,e.return=t,t.child=e}function aj(e,t,n,r,a){if(e!==null){var l=e.memoizedProps;if(Xl(l,r)&&e.ref===t.ref)if(Gn=!1,t.pendingProps=r=l,(e.lanes&a)!==0)e.flags&131072&&(Gn=!0);else return t.lanes=e.lanes,Hi(e,t,a)}return Mh(e,t,n,r,a)}function sj(e,t,n){var r=t.pendingProps,a=r.children,l=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ht(oo,fr),fr|=n;else{if(!(n&1073741824))return e=l!==null?l.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ht(oo,fr),fr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=l!==null?l.baseLanes:n,ht(oo,fr),fr|=r}else l!==null?(r=l.baseLanes|n,t.memoizedState=null):r=n,ht(oo,fr),fr|=r;return In(e,t,a,n),t.child}function oj(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Mh(e,t,n,r,a){var l=Jn(n)?fs:jn.current;return l=So(t,l),ho(t,a),n=Xg(e,t,n,r,l,a),r=Yg(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Hi(e,t,a)):(Ct&&r&&Fg(t),t.flags|=1,In(e,t,n,a),t.child)}function pb(e,t,n,r,a){if(Jn(n)){var l=!0;Od(t)}else l=!1;if(ho(t,a),t.stateNode===null)cd(e,t),nj(t,n,r),Rh(t,n,r,a),r=!0;else if(e===null){var c=t.stateNode,d=t.memoizedProps;c.props=d;var p=c.context,m=n.contextType;typeof m=="object"&&m!==null?m=Mr(m):(m=Jn(n)?fs:jn.current,m=So(t,m));var h=n.getDerivedStateFromProps,g=typeof h=="function"||typeof c.getSnapshotBeforeUpdate=="function";g||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==r||p!==m)&&sb(t,c,r,m),pa=!1;var x=t.memoizedState;c.state=x,Dd(t,r,c,a),p=t.memoizedState,d!==r||x!==p||Yn.current||pa?(typeof h=="function"&&(Oh(t,n,h,r),p=t.memoizedState),(d=pa||ab(t,n,d,r,x,p,m))?(g||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=p),c.props=r,c.state=p,c.context=m,r=d):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{c=t.stateNode,M_(e,t),d=t.memoizedProps,m=t.type===t.elementType?d:Qr(t.type,d),c.props=m,g=t.pendingProps,x=c.context,p=n.contextType,typeof p=="object"&&p!==null?p=Mr(p):(p=Jn(n)?fs:jn.current,p=So(t,p));var j=n.getDerivedStateFromProps;(h=typeof j=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==g||x!==p)&&sb(t,c,r,p),pa=!1,x=t.memoizedState,c.state=x,Dd(t,r,c,a);var b=t.memoizedState;d!==g||x!==b||Yn.current||pa?(typeof j=="function"&&(Oh(t,n,j,r),b=t.memoizedState),(m=pa||ab(t,n,m,r,x,b,p)||!1)?(h||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(r,b,p),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(r,b,p)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=b),c.props=r,c.state=b,c.context=p,r=m):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&x===e.memoizedState||(t.flags|=1024),r=!1)}return Lh(e,t,n,r,l,a)}function Lh(e,t,n,r,a,l){oj(e,t);var c=(t.flags&128)!==0;if(!r&&!c)return a&&Yy(t,n,!1),Hi(e,t,l);r=t.stateNode,X6.current=t;var d=c&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&c?(t.child=ko(t,e.child,null,l),t.child=ko(t,null,d,l)):In(e,t,d,l),t.memoizedState=r.state,a&&Yy(t,n,!0),t.child}function lj(e){var t=e.stateNode;t.pendingContext?Xy(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Xy(e,t.context,!1),Vg(e,t.containerInfo)}function fb(e,t,n,r,a){return No(),$g(a),t.flags|=256,In(e,t,n,r),t.child}var Dh={dehydrated:null,treeContext:null,retryLane:0};function Fh(e){return{baseLanes:e,cachePool:null,transitions:null}}function cj(e,t,n){var r=t.pendingProps,a=Pt.current,l=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(a&2)!==0),d?(l=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),ht(Pt,a&1),e===null)return Ph(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(c=r.children,e=r.fallback,l?(r=t.mode,l=t.child,c={mode:"hidden",children:c},!(r&1)&&l!==null?(l.childLanes=0,l.pendingProps=c):l=hp(c,r,0,null),e=us(e,r,n,null),l.return=t,e.return=t,l.sibling=e,t.child=l,t.child.memoizedState=Fh(n),t.memoizedState=Dh,e):e0(t,c));if(a=e.memoizedState,a!==null&&(d=a.dehydrated,d!==null))return Y6(e,t,c,r,d,a,n);if(l){l=r.fallback,c=t.mode,a=e.child,d=a.sibling;var p={mode:"hidden",children:r.children};return!(c&1)&&t.child!==a?(r=t.child,r.childLanes=0,r.pendingProps=p,t.deletions=null):(r=ka(a,p),r.subtreeFlags=a.subtreeFlags&14680064),d!==null?l=ka(d,l):(l=us(l,c,n,null),l.flags|=2),l.return=t,r.return=t,r.sibling=l,t.child=r,r=l,l=t.child,c=e.child.memoizedState,c=c===null?Fh(n):{baseLanes:c.baseLanes|n,cachePool:null,transitions:c.transitions},l.memoizedState=c,l.childLanes=e.childLanes&~n,t.memoizedState=Dh,r}return l=e.child,e=l.sibling,r=ka(l,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function e0(e,t){return t=hp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Wu(e,t,n,r){return r!==null&&$g(r),ko(t,e.child,null,n),e=e0(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Y6(e,t,n,r,a,l,c){if(n)return t.flags&256?(t.flags&=-257,r=Nm(Error(te(422))),Wu(e,t,c,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(l=r.fallback,a=t.mode,r=hp({mode:"visible",children:r.children},a,0,null),l=us(l,a,c,null),l.flags|=2,r.return=t,l.return=t,r.sibling=l,t.child=r,t.mode&1&&ko(t,e.child,null,c),t.child.memoizedState=Fh(c),t.memoizedState=Dh,l);if(!(t.mode&1))return Wu(e,t,c,null);if(a.data==="$!"){if(r=a.nextSibling&&a.nextSibling.dataset,r)var d=r.dgst;return r=d,l=Error(te(419)),r=Nm(l,r,void 0),Wu(e,t,c,r)}if(d=(c&e.childLanes)!==0,Gn||d){if(r=sn,r!==null){switch(c&-c){case 4:a=2;break;case 16:a=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(r.suspendedLanes|c)?0:a,a!==0&&a!==l.retryLane&&(l.retryLane=a,Wi(e,a),ti(r,e,a,-1))}return s0(),r=Nm(Error(te(421))),Wu(e,t,c,r)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=uI.bind(null,e),a._reactRetry=t,null):(e=l.treeContext,mr=_a(a.nextSibling),gr=t,Ct=!0,Yr=null,e!==null&&(Tr[Or++]=Fi,Tr[Or++]=zi,Tr[Or++]=ms,Fi=e.id,zi=e.overflow,ms=t),t=e0(t,r.children),t.flags|=4096,t)}function mb(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Th(e.return,t,n)}function km(e,t,n,r,a){var l=e.memoizedState;l===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:a}:(l.isBackwards=t,l.rendering=null,l.renderingStartTime=0,l.last=r,l.tail=n,l.tailMode=a)}function uj(e,t,n){var r=t.pendingProps,a=r.revealOrder,l=r.tail;if(In(e,t,r.children,n),r=Pt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mb(e,n,t);else if(e.tag===19)mb(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ht(Pt,r),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(n=t.child,a=null;n!==null;)e=n.alternate,e!==null&&Fd(e)===null&&(a=n),n=n.sibling;n=a,n===null?(a=t.child,t.child=null):(a=n.sibling,n.sibling=null),km(t,!1,a,n,l);break;case"backwards":for(n=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&Fd(e)===null){t.child=a;break}e=a.sibling,a.sibling=n,n=a,a=e}km(t,!0,n,null,l);break;case"together":km(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function cd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Hi(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),gs|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(te(153));if(t.child!==null){for(e=t.child,n=ka(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ka(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function J6(e,t,n){switch(t.tag){case 3:lj(t),No();break;case 5:L_(t);break;case 1:Jn(t.type)&&Od(t);break;case 4:Vg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,a=t.memoizedProps.value;ht(Md,r._currentValue),r._currentValue=a;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ht(Pt,Pt.current&1),t.flags|=128,null):n&t.child.childLanes?cj(e,t,n):(ht(Pt,Pt.current&1),e=Hi(e,t,n),e!==null?e.sibling:null);ht(Pt,Pt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return uj(e,t,n);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ht(Pt,Pt.current),r)break;return null;case 22:case 23:return t.lanes=0,sj(e,t,n)}return Hi(e,t,n)}var dj,zh,pj,fj;dj=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&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.sibling.return=n.return,n=n.sibling}};zh=function(){};pj=function(e,t,n,r){var a=e.memoizedProps;if(a!==r){e=t.stateNode,rs(wi.current);var l=null;switch(n){case"input":a=oh(e,a),r=oh(e,r),l=[];break;case"select":a=Ot({},a,{value:void 0}),r=Ot({},r,{value:void 0}),l=[];break;case"textarea":a=uh(e,a),r=uh(e,r),l=[];break;default:typeof a.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Pd)}ph(n,r);var c;n=null;for(m in a)if(!r.hasOwnProperty(m)&&a.hasOwnProperty(m)&&a[m]!=null)if(m==="style"){var d=a[m];for(c in d)d.hasOwnProperty(c)&&(n||(n={}),n[c]="")}else m!=="dangerouslySetInnerHTML"&&m!=="children"&&m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(Wl.hasOwnProperty(m)?l||(l=[]):(l=l||[]).push(m,null));for(m in r){var p=r[m];if(d=a!=null?a[m]:void 0,r.hasOwnProperty(m)&&p!==d&&(p!=null||d!=null))if(m==="style")if(d){for(c in d)!d.hasOwnProperty(c)||p&&p.hasOwnProperty(c)||(n||(n={}),n[c]="");for(c in p)p.hasOwnProperty(c)&&d[c]!==p[c]&&(n||(n={}),n[c]=p[c])}else n||(l||(l=[]),l.push(m,n)),n=p;else m==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,d=d?d.__html:void 0,p!=null&&d!==p&&(l=l||[]).push(m,p)):m==="children"?typeof p!="string"&&typeof p!="number"||(l=l||[]).push(m,""+p):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&(Wl.hasOwnProperty(m)?(p!=null&&m==="onScroll"&&wt("scroll",e),l||d===p||(l=[])):(l=l||[]).push(m,p))}n&&(l=l||[]).push("style",n);var m=l;(t.updateQueue=m)&&(t.flags|=4)}};fj=function(e,t,n,r){n!==r&&(t.flags|=4)};function wl(e,t){if(!Ct)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function vn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags&14680064,r|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)n|=a.lanes|a.childLanes,r|=a.subtreeFlags,r|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Z6(e,t,n){var r=t.pendingProps;switch(zg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vn(t),null;case 1:return Jn(t.type)&&Td(),vn(t),null;case 3:return r=t.stateNode,Co(),_t(Yn),_t(jn),Kg(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Uu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Yr!==null&&(Gh(Yr),Yr=null))),zh(e,t),vn(t),null;case 5:Gg(t);var a=rs(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)pj(e,t,n,r,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(te(166));return vn(t),null}if(e=rs(wi.current),Uu(t)){r=t.stateNode,n=t.type;var l=t.memoizedProps;switch(r[vi]=t,r[Zl]=l,e=(t.mode&1)!==0,n){case"dialog":wt("cancel",r),wt("close",r);break;case"iframe":case"object":case"embed":wt("load",r);break;case"video":case"audio":for(a=0;a<Cl.length;a++)wt(Cl[a],r);break;case"source":wt("error",r);break;case"img":case"image":case"link":wt("error",r),wt("load",r);break;case"details":wt("toggle",r);break;case"input":jy(r,l),wt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!l.multiple},wt("invalid",r);break;case"textarea":Ny(r,l),wt("invalid",r)}ph(n,l),a=null;for(var c in l)if(l.hasOwnProperty(c)){var d=l[c];c==="children"?typeof d=="string"?r.textContent!==d&&(l.suppressHydrationWarning!==!0&&$u(r.textContent,d,e),a=["children",d]):typeof d=="number"&&r.textContent!==""+d&&(l.suppressHydrationWarning!==!0&&$u(r.textContent,d,e),a=["children",""+d]):Wl.hasOwnProperty(c)&&d!=null&&c==="onScroll"&&wt("scroll",r)}switch(n){case"input":Ou(r),Sy(r,l,!0);break;case"textarea":Ou(r),ky(r);break;case"select":case"option":break;default:typeof l.onClick=="function"&&(r.onclick=Pd)}r=a,t.updateQueue=r,r!==null&&(t.flags|=4)}else{c=a.nodeType===9?a:a.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Uw(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=c.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=c.createElement(n,{is:r.is}):(e=c.createElement(n),n==="select"&&(c=e,r.multiple?c.multiple=!0:r.size&&(c.size=r.size))):e=c.createElementNS(e,n),e[vi]=t,e[Zl]=r,dj(e,t,!1,!1),t.stateNode=e;e:{switch(c=fh(n,r),n){case"dialog":wt("cancel",e),wt("close",e),a=r;break;case"iframe":case"object":case"embed":wt("load",e),a=r;break;case"video":case"audio":for(a=0;a<Cl.length;a++)wt(Cl[a],e);a=r;break;case"source":wt("error",e),a=r;break;case"img":case"image":case"link":wt("error",e),wt("load",e),a=r;break;case"details":wt("toggle",e),a=r;break;case"input":jy(e,r),a=oh(e,r),wt("invalid",e);break;case"option":a=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},a=Ot({},r,{value:void 0}),wt("invalid",e);break;case"textarea":Ny(e,r),a=uh(e,r),wt("invalid",e);break;default:a=r}ph(n,a),d=a;for(l in d)if(d.hasOwnProperty(l)){var p=d[l];l==="style"?Hw(e,p):l==="dangerouslySetInnerHTML"?(p=p?p.__html:void 0,p!=null&&Bw(e,p)):l==="children"?typeof p=="string"?(n!=="textarea"||p!=="")&&Hl(e,p):typeof p=="number"&&Hl(e,""+p):l!=="suppressContentEditableWarning"&&l!=="suppressHydrationWarning"&&l!=="autoFocus"&&(Wl.hasOwnProperty(l)?p!=null&&l==="onScroll"&&wt("scroll",e):p!=null&&Sg(e,l,p,c))}switch(n){case"input":Ou(e),Sy(e,r,!1);break;case"textarea":Ou(e),ky(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Pa(r.value));break;case"select":e.multiple=!!r.multiple,l=r.value,l!=null?uo(e,!!r.multiple,l,!1):r.defaultValue!=null&&uo(e,!!r.multiple,r.defaultValue,!0);break;default:typeof a.onClick=="function"&&(e.onclick=Pd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vn(t),null;case 6:if(e&&t.stateNode!=null)fj(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(te(166));if(n=rs(tc.current),rs(wi.current),Uu(t)){if(r=t.stateNode,n=t.memoizedProps,r[vi]=t,(l=r.nodeValue!==n)&&(e=gr,e!==null))switch(e.tag){case 3:$u(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&$u(r.nodeValue,n,(e.mode&1)!==0)}l&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[vi]=t,t.stateNode=r}return vn(t),null;case 13:if(_t(Pt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Ct&&mr!==null&&t.mode&1&&!(t.flags&128))T_(),No(),t.flags|=98560,l=!1;else if(l=Uu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!l)throw Error(te(318));if(l=t.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(te(317));l[vi]=t}else No(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;vn(t),l=!1}else Yr!==null&&(Gh(Yr),Yr=null),l=!0;if(!l)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Pt.current&1?Jt===0&&(Jt=3):s0())),t.updateQueue!==null&&(t.flags|=4),vn(t),null);case 4:return Co(),zh(e,t),e===null&&Yl(t.stateNode.containerInfo),vn(t),null;case 10:return Wg(t.type._context),vn(t),null;case 17:return Jn(t.type)&&Td(),vn(t),null;case 19:if(_t(Pt),l=t.memoizedState,l===null)return vn(t),null;if(r=(t.flags&128)!==0,c=l.rendering,c===null)if(r)wl(l,!1);else{if(Jt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(c=Fd(e),c!==null){for(t.flags|=128,wl(l,!1),r=c.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)l=n,e=r,l.flags&=14680066,c=l.alternate,c===null?(l.childLanes=0,l.lanes=e,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=c.childLanes,l.lanes=c.lanes,l.child=c.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=c.memoizedProps,l.memoizedState=c.memoizedState,l.updateQueue=c.updateQueue,l.type=c.type,e=c.dependencies,l.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ht(Pt,Pt.current&1|2),t.child}e=e.sibling}l.tail!==null&&Ut()>Ao&&(t.flags|=128,r=!0,wl(l,!1),t.lanes=4194304)}else{if(!r)if(e=Fd(c),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),wl(l,!0),l.tail===null&&l.tailMode==="hidden"&&!c.alternate&&!Ct)return vn(t),null}else 2*Ut()-l.renderingStartTime>Ao&&n!==1073741824&&(t.flags|=128,r=!0,wl(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(n=l.last,n!==null?n.sibling=c:t.child=c,l.last=c)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Ut(),t.sibling=null,n=Pt.current,ht(Pt,r?n&1|2:n&1),t):(vn(t),null);case 22:case 23:return a0(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?fr&1073741824&&(vn(t),t.subtreeFlags&6&&(t.flags|=8192)):vn(t),null;case 24:return null;case 25:return null}throw Error(te(156,t.tag))}function eI(e,t){switch(zg(t),t.tag){case 1:return Jn(t.type)&&Td(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Co(),_t(Yn),_t(jn),Kg(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Gg(t),null;case 13:if(_t(Pt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(te(340));No()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return _t(Pt),null;case 4:return Co(),null;case 10:return Wg(t.type._context),null;case 22:case 23:return a0(),null;case 24:return null;default:return null}}var Hu=!1,yn=!1,tI=typeof WeakSet=="function"?WeakSet:Set,de=null;function so(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Mt(e,t,r)}else n.current=null}function $h(e,t,n){try{n()}catch(r){Mt(e,t,r)}}var hb=!1;function nI(e,t){if(jh=Cd,e=v_(),Dg(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,l=r.focusNode;r=r.focusOffset;try{n.nodeType,l.nodeType}catch{n=null;break e}var c=0,d=-1,p=-1,m=0,h=0,g=e,x=null;t:for(;;){for(var j;g!==n||a!==0&&g.nodeType!==3||(d=c+a),g!==l||r!==0&&g.nodeType!==3||(p=c+r),g.nodeType===3&&(c+=g.nodeValue.length),(j=g.firstChild)!==null;)x=g,g=j;for(;;){if(g===e)break t;if(x===n&&++m===a&&(d=c),x===l&&++h===r&&(p=c),(j=g.nextSibling)!==null)break;g=x,x=g.parentNode}g=j}n=d===-1||p===-1?null:{start:d,end:p}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sh={focusedElem:e,selectionRange:n},Cd=!1,de=t;de!==null;)if(t=de,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,de=e;else for(;de!==null;){t=de;try{var b=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(b!==null){var _=b.memoizedProps,N=b.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?_:Qr(t.type,_),N);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var C=t.stateNode.containerInfo;C.nodeType===1?C.textContent="":C.nodeType===9&&C.documentElement&&C.removeChild(C.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(te(163))}}catch(R){Mt(t,t.return,R)}if(e=t.sibling,e!==null){e.return=t.return,de=e;break}de=t.return}return b=hb,hb=!1,b}function Dl(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var a=r=r.next;do{if((a.tag&e)===e){var l=a.destroy;a.destroy=void 0,l!==void 0&&$h(t,n,l)}a=a.next}while(a!==r)}}function fp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Uh(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function mj(e){var t=e.alternate;t!==null&&(e.alternate=null,mj(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[vi],delete t[Zl],delete t[Ch],delete t[F6],delete t[z6])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hj(e){return e.tag===5||e.tag===3||e.tag===4}function gb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Bh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,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=Pd));else if(r!==4&&(e=e.child,e!==null))for(Bh(e,t,n),e=e.sibling;e!==null;)Bh(e,t,n),e=e.sibling}function Wh(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Wh(e,t,n),e=e.sibling;e!==null;)Wh(e,t,n),e=e.sibling}var cn=null,Xr=!1;function la(e,t,n){for(n=n.child;n!==null;)gj(e,t,n),n=n.sibling}function gj(e,t,n){if(bi&&typeof bi.onCommitFiberUnmount=="function")try{bi.onCommitFiberUnmount(ap,n)}catch{}switch(n.tag){case 5:yn||so(n,t);case 6:var r=cn,a=Xr;cn=null,la(e,t,n),cn=r,Xr=a,cn!==null&&(Xr?(e=cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cn.removeChild(n.stateNode));break;case 18:cn!==null&&(Xr?(e=cn,n=n.stateNode,e.nodeType===8?ym(e.parentNode,n):e.nodeType===1&&ym(e,n),Kl(e)):ym(cn,n.stateNode));break;case 4:r=cn,a=Xr,cn=n.stateNode.containerInfo,Xr=!0,la(e,t,n),cn=r,Xr=a;break;case 0:case 11:case 14:case 15:if(!yn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){a=r=r.next;do{var l=a,c=l.destroy;l=l.tag,c!==void 0&&(l&2||l&4)&&$h(n,t,c),a=a.next}while(a!==r)}la(e,t,n);break;case 1:if(!yn&&(so(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(d){Mt(n,t,d)}la(e,t,n);break;case 21:la(e,t,n);break;case 22:n.mode&1?(yn=(r=yn)||n.memoizedState!==null,la(e,t,n),yn=r):la(e,t,n);break;default:la(e,t,n)}}function xb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new tI),t.forEach(function(r){var a=dI.bind(null,e,r);n.has(r)||(n.add(r),r.then(a,a))})}}function Kr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r];try{var l=e,c=t,d=c;e:for(;d!==null;){switch(d.tag){case 5:cn=d.stateNode,Xr=!1;break e;case 3:cn=d.stateNode.containerInfo,Xr=!0;break e;case 4:cn=d.stateNode.containerInfo,Xr=!0;break e}d=d.return}if(cn===null)throw Error(te(160));gj(l,c,a),cn=null,Xr=!1;var p=a.alternate;p!==null&&(p.return=null),a.return=null}catch(m){Mt(a,t,m)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)xj(t,e),t=t.sibling}function xj(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Kr(t,e),pi(e),r&4){try{Dl(3,e,e.return),fp(3,e)}catch(_){Mt(e,e.return,_)}try{Dl(5,e,e.return)}catch(_){Mt(e,e.return,_)}}break;case 1:Kr(t,e),pi(e),r&512&&n!==null&&so(n,n.return);break;case 5:if(Kr(t,e),pi(e),r&512&&n!==null&&so(n,n.return),e.flags&32){var a=e.stateNode;try{Hl(a,"")}catch(_){Mt(e,e.return,_)}}if(r&4&&(a=e.stateNode,a!=null)){var l=e.memoizedProps,c=n!==null?n.memoizedProps:l,d=e.type,p=e.updateQueue;if(e.updateQueue=null,p!==null)try{d==="input"&&l.type==="radio"&&l.name!=null&&zw(a,l),fh(d,c);var m=fh(d,l);for(c=0;c<p.length;c+=2){var h=p[c],g=p[c+1];h==="style"?Hw(a,g):h==="dangerouslySetInnerHTML"?Bw(a,g):h==="children"?Hl(a,g):Sg(a,h,g,m)}switch(d){case"input":lh(a,l);break;case"textarea":$w(a,l);break;case"select":var x=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!l.multiple;var j=l.value;j!=null?uo(a,!!l.multiple,j,!1):x!==!!l.multiple&&(l.defaultValue!=null?uo(a,!!l.multiple,l.defaultValue,!0):uo(a,!!l.multiple,l.multiple?[]:"",!1))}a[Zl]=l}catch(_){Mt(e,e.return,_)}}break;case 6:if(Kr(t,e),pi(e),r&4){if(e.stateNode===null)throw Error(te(162));a=e.stateNode,l=e.memoizedProps;try{a.nodeValue=l}catch(_){Mt(e,e.return,_)}}break;case 3:if(Kr(t,e),pi(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Kl(t.containerInfo)}catch(_){Mt(e,e.return,_)}break;case 4:Kr(t,e),pi(e);break;case 13:Kr(t,e),pi(e),a=e.child,a.flags&8192&&(l=a.memoizedState!==null,a.stateNode.isHidden=l,!l||a.alternate!==null&&a.alternate.memoizedState!==null||(r0=Ut())),r&4&&xb(e);break;case 22:if(h=n!==null&&n.memoizedState!==null,e.mode&1?(yn=(m=yn)||h,Kr(t,e),yn=m):Kr(t,e),pi(e),r&8192){if(m=e.memoizedState!==null,(e.stateNode.isHidden=m)&&!h&&e.mode&1)for(de=e,h=e.child;h!==null;){for(g=de=h;de!==null;){switch(x=de,j=x.child,x.tag){case 0:case 11:case 14:case 15:Dl(4,x,x.return);break;case 1:so(x,x.return);var b=x.stateNode;if(typeof b.componentWillUnmount=="function"){r=x,n=x.return;try{t=r,b.props=t.memoizedProps,b.state=t.memoizedState,b.componentWillUnmount()}catch(_){Mt(r,n,_)}}break;case 5:so(x,x.return);break;case 22:if(x.memoizedState!==null){yb(g);continue}}j!==null?(j.return=x,de=j):yb(g)}h=h.sibling}e:for(h=null,g=e;;){if(g.tag===5){if(h===null){h=g;try{a=g.stateNode,m?(l=a.style,typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"):(d=g.stateNode,p=g.memoizedProps.style,c=p!=null&&p.hasOwnProperty("display")?p.display:null,d.style.display=Ww("display",c))}catch(_){Mt(e,e.return,_)}}}else if(g.tag===6){if(h===null)try{g.stateNode.nodeValue=m?"":g.memoizedProps}catch(_){Mt(e,e.return,_)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;h===g&&(h=null),g=g.return}h===g&&(h=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:Kr(t,e),pi(e),r&4&&xb(e);break;case 21:break;default:Kr(t,e),pi(e)}}function pi(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hj(n)){var r=n;break e}n=n.return}throw Error(te(160))}switch(r.tag){case 5:var a=r.stateNode;r.flags&32&&(Hl(a,""),r.flags&=-33);var l=gb(e);Wh(e,l,a);break;case 3:case 4:var c=r.stateNode.containerInfo,d=gb(e);Bh(e,d,c);break;default:throw Error(te(161))}}catch(p){Mt(e,e.return,p)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function rI(e,t,n){de=e,vj(e)}function vj(e,t,n){for(var r=(e.mode&1)!==0;de!==null;){var a=de,l=a.child;if(a.tag===22&&r){var c=a.memoizedState!==null||Hu;if(!c){var d=a.alternate,p=d!==null&&d.memoizedState!==null||yn;d=Hu;var m=yn;if(Hu=c,(yn=p)&&!m)for(de=a;de!==null;)c=de,p=c.child,c.tag===22&&c.memoizedState!==null?bb(a):p!==null?(p.return=c,de=p):bb(a);for(;l!==null;)de=l,vj(l),l=l.sibling;de=a,Hu=d,yn=m}vb(e)}else a.subtreeFlags&8772&&l!==null?(l.return=a,de=l):vb(e)}}function vb(e){for(;de!==null;){var t=de;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:yn||fp(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!yn)if(n===null)r.componentDidMount();else{var a=t.elementType===t.type?n.memoizedProps:Qr(t.type,n.memoizedProps);r.componentDidUpdate(a,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var l=t.updateQueue;l!==null&&nb(t,l,r);break;case 3:var c=t.updateQueue;if(c!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}nb(t,c,n)}break;case 5:var d=t.stateNode;if(n===null&&t.flags&4){n=d;var p=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":p.autoFocus&&n.focus();break;case"img":p.src&&(n.src=p.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var m=t.alternate;if(m!==null){var h=m.memoizedState;if(h!==null){var g=h.dehydrated;g!==null&&Kl(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(te(163))}yn||t.flags&512&&Uh(t)}catch(x){Mt(t,t.return,x)}}if(t===e){de=null;break}if(n=t.sibling,n!==null){n.return=t.return,de=n;break}de=t.return}}function yb(e){for(;de!==null;){var t=de;if(t===e){de=null;break}var n=t.sibling;if(n!==null){n.return=t.return,de=n;break}de=t.return}}function bb(e){for(;de!==null;){var t=de;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fp(4,t)}catch(p){Mt(t,n,p)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var a=t.return;try{r.componentDidMount()}catch(p){Mt(t,a,p)}}var l=t.return;try{Uh(t)}catch(p){Mt(t,l,p)}break;case 5:var c=t.return;try{Uh(t)}catch(p){Mt(t,c,p)}}}catch(p){Mt(t,t.return,p)}if(t===e){de=null;break}var d=t.sibling;if(d!==null){d.return=t.return,de=d;break}de=t.return}}var iI=Math.ceil,Ud=Vi.ReactCurrentDispatcher,t0=Vi.ReactCurrentOwner,Ir=Vi.ReactCurrentBatchConfig,qe=0,sn=null,qt=null,un=0,fr=0,oo=Ia(0),Jt=0,ac=null,gs=0,mp=0,n0=0,Fl=null,Vn=null,r0=0,Ao=1/0,Mi=null,Bd=!1,Hh=null,Sa=null,qu=!1,va=null,Wd=0,zl=0,qh=null,ud=-1,dd=0;function Mn(){return qe&6?Ut():ud!==-1?ud:ud=Ut()}function Na(e){return e.mode&1?qe&2&&un!==0?un&-un:U6.transition!==null?(dd===0&&(dd=n_()),dd):(e=et,e!==0||(e=window.event,e=e===void 0?16:c_(e.type)),e):1}function ti(e,t,n,r){if(50<zl)throw zl=0,qh=null,Error(te(185));vc(e,n,r),(!(qe&2)||e!==sn)&&(e===sn&&(!(qe&2)&&(mp|=n),Jt===4&&ma(e,un)),Zn(e,r),n===1&&qe===0&&!(t.mode&1)&&(Ao=Ut()+500,up&&Ma()))}function Zn(e,t){var n=e.callbackNode;UR(e,t);var r=kd(e,e===sn?un:0);if(r===0)n!==null&&Ay(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Ay(n),t===1)e.tag===0?$6(wb.bind(null,e)):E_(wb.bind(null,e)),L6(function(){!(qe&6)&&Ma()}),n=null;else{switch(r_(r)){case 1:n=Ag;break;case 4:n=e_;break;case 16:n=Nd;break;case 536870912:n=t_;break;default:n=Nd}n=kj(n,yj.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function yj(e,t){if(ud=-1,dd=0,qe&6)throw Error(te(327));var n=e.callbackNode;if(go()&&e.callbackNode!==n)return null;var r=kd(e,e===sn?un:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Hd(e,r);else{t=r;var a=qe;qe|=2;var l=wj();(sn!==e||un!==t)&&(Mi=null,Ao=Ut()+500,cs(e,t));do try{oI();break}catch(d){bj(e,d)}while(!0);Bg(),Ud.current=l,qe=a,qt!==null?t=0:(sn=null,un=0,t=Jt)}if(t!==0){if(t===2&&(a=vh(e),a!==0&&(r=a,t=Vh(e,a))),t===1)throw n=ac,cs(e,0),ma(e,r),Zn(e,Ut()),n;if(t===6)ma(e,r);else{if(a=e.current.alternate,!(r&30)&&!aI(a)&&(t=Hd(e,r),t===2&&(l=vh(e),l!==0&&(r=l,t=Vh(e,l))),t===1))throw n=ac,cs(e,0),ma(e,r),Zn(e,Ut()),n;switch(e.finishedWork=a,e.finishedLanes=r,t){case 0:case 1:throw Error(te(345));case 2:Ya(e,Vn,Mi);break;case 3:if(ma(e,r),(r&130023424)===r&&(t=r0+500-Ut(),10<t)){if(kd(e,0)!==0)break;if(a=e.suspendedLanes,(a&r)!==r){Mn(),e.pingedLanes|=e.suspendedLanes&a;break}e.timeoutHandle=kh(Ya.bind(null,e,Vn,Mi),t);break}Ya(e,Vn,Mi);break;case 4:if(ma(e,r),(r&4194240)===r)break;for(t=e.eventTimes,a=-1;0<r;){var c=31-ei(r);l=1<<c,c=t[c],c>a&&(a=c),r&=~l}if(r=a,r=Ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*iI(r/1960))-r,10<r){e.timeoutHandle=kh(Ya.bind(null,e,Vn,Mi),r);break}Ya(e,Vn,Mi);break;case 5:Ya(e,Vn,Mi);break;default:throw Error(te(329))}}}return Zn(e,Ut()),e.callbackNode===n?yj.bind(null,e):null}function Vh(e,t){var n=Fl;return e.current.memoizedState.isDehydrated&&(cs(e,t).flags|=256),e=Hd(e,t),e!==2&&(t=Vn,Vn=n,t!==null&&Gh(t)),e}function Gh(e){Vn===null?Vn=e:Vn.push.apply(Vn,e)}function aI(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var a=n[r],l=a.getSnapshot;a=a.value;try{if(!ni(l(),a))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function ma(e,t){for(t&=~n0,t&=~mp,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ei(t),r=1<<n;e[n]=-1,t&=~r}}function wb(e){if(qe&6)throw Error(te(327));go();var t=kd(e,0);if(!(t&1))return Zn(e,Ut()),null;var n=Hd(e,t);if(e.tag!==0&&n===2){var r=vh(e);r!==0&&(t=r,n=Vh(e,r))}if(n===1)throw n=ac,cs(e,0),ma(e,t),Zn(e,Ut()),n;if(n===6)throw Error(te(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Ya(e,Vn,Mi),Zn(e,Ut()),null}function i0(e,t){var n=qe;qe|=1;try{return e(t)}finally{qe=n,qe===0&&(Ao=Ut()+500,up&&Ma())}}function xs(e){va!==null&&va.tag===0&&!(qe&6)&&go();var t=qe;qe|=1;var n=Ir.transition,r=et;try{if(Ir.transition=null,et=1,e)return e()}finally{et=r,Ir.transition=n,qe=t,!(qe&6)&&Ma()}}function a0(){fr=oo.current,_t(oo)}function cs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,M6(n)),qt!==null)for(n=qt.return;n!==null;){var r=n;switch(zg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Td();break;case 3:Co(),_t(Yn),_t(jn),Kg();break;case 5:Gg(r);break;case 4:Co();break;case 13:_t(Pt);break;case 19:_t(Pt);break;case 10:Wg(r.type._context);break;case 22:case 23:a0()}n=n.return}if(sn=e,qt=e=ka(e.current,null),un=fr=t,Jt=0,ac=null,n0=mp=gs=0,Vn=Fl=null,ns!==null){for(t=0;t<ns.length;t++)if(n=ns[t],r=n.interleaved,r!==null){n.interleaved=null;var a=r.next,l=n.pending;if(l!==null){var c=l.next;l.next=a,r.next=c}n.pending=r}ns=null}return e}function bj(e,t){do{var n=qt;try{if(Bg(),od.current=$d,zd){for(var r=Tt.memoizedState;r!==null;){var a=r.queue;a!==null&&(a.pending=null),r=r.next}zd=!1}if(hs=0,an=Yt=Tt=null,Ll=!1,nc=0,t0.current=null,n===null||n.return===null){Jt=1,ac=t,qt=null;break}e:{var l=e,c=n.return,d=n,p=t;if(t=un,d.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){var m=p,h=d,g=h.tag;if(!(h.mode&1)&&(g===0||g===11||g===15)){var x=h.alternate;x?(h.updateQueue=x.updateQueue,h.memoizedState=x.memoizedState,h.lanes=x.lanes):(h.updateQueue=null,h.memoizedState=null)}var j=lb(c);if(j!==null){j.flags&=-257,cb(j,c,d,l,t),j.mode&1&&ob(l,m,t),t=j,p=m;var b=t.updateQueue;if(b===null){var _=new Set;_.add(p),t.updateQueue=_}else b.add(p);break e}else{if(!(t&1)){ob(l,m,t),s0();break e}p=Error(te(426))}}else if(Ct&&d.mode&1){var N=lb(c);if(N!==null){!(N.flags&65536)&&(N.flags|=256),cb(N,c,d,l,t),$g(Eo(p,d));break e}}l=p=Eo(p,d),Jt!==4&&(Jt=2),Fl===null?Fl=[l]:Fl.push(l),l=c;do{switch(l.tag){case 3:l.flags|=65536,t&=-t,l.lanes|=t;var y=rj(l,p,t);tb(l,y);break e;case 1:d=p;var w=l.type,C=l.stateNode;if(!(l.flags&128)&&(typeof w.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(Sa===null||!Sa.has(C)))){l.flags|=65536,t&=-t,l.lanes|=t;var R=ij(l,d,t);tb(l,R);break e}}l=l.return}while(l!==null)}jj(n)}catch(D){t=D,qt===n&&n!==null&&(qt=n=n.return);continue}break}while(!0)}function wj(){var e=Ud.current;return Ud.current=$d,e===null?$d:e}function s0(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),sn===null||!(gs&268435455)&&!(mp&268435455)||ma(sn,un)}function Hd(e,t){var n=qe;qe|=2;var r=wj();(sn!==e||un!==t)&&(Mi=null,cs(e,t));do try{sI();break}catch(a){bj(e,a)}while(!0);if(Bg(),qe=n,Ud.current=r,qt!==null)throw Error(te(261));return sn=null,un=0,Jt}function sI(){for(;qt!==null;)_j(qt)}function oI(){for(;qt!==null&&!OR();)_j(qt)}function _j(e){var t=Nj(e.alternate,e,fr);e.memoizedProps=e.pendingProps,t===null?jj(e):qt=t,t0.current=null}function jj(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=eI(n,t),n!==null){n.flags&=32767,qt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,qt=null;return}}else if(n=Z6(n,t,fr),n!==null){qt=n;return}if(t=t.sibling,t!==null){qt=t;return}qt=t=e}while(t!==null);Jt===0&&(Jt=5)}function Ya(e,t,n){var r=et,a=Ir.transition;try{Ir.transition=null,et=1,lI(e,t,n,r)}finally{Ir.transition=a,et=r}return null}function lI(e,t,n,r){do go();while(va!==null);if(qe&6)throw Error(te(327));n=e.finishedWork;var a=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(te(177));e.callbackNode=null,e.callbackPriority=0;var l=n.lanes|n.childLanes;if(BR(e,l),e===sn&&(qt=sn=null,un=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qu||(qu=!0,kj(Nd,function(){return go(),null})),l=(n.flags&15990)!==0,n.subtreeFlags&15990||l){l=Ir.transition,Ir.transition=null;var c=et;et=1;var d=qe;qe|=4,t0.current=null,nI(e,n),xj(n,e),E6(Sh),Cd=!!jh,Sh=jh=null,e.current=n,rI(n),RR(),qe=d,et=c,Ir.transition=l}else e.current=n;if(qu&&(qu=!1,va=e,Wd=a),l=e.pendingLanes,l===0&&(Sa=null),LR(n.stateNode),Zn(e,Ut()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)a=t[n],r(a.value,{componentStack:a.stack,digest:a.digest});if(Bd)throw Bd=!1,e=Hh,Hh=null,e;return Wd&1&&e.tag!==0&&go(),l=e.pendingLanes,l&1?e===qh?zl++:(zl=0,qh=e):zl=0,Ma(),null}function go(){if(va!==null){var e=r_(Wd),t=Ir.transition,n=et;try{if(Ir.transition=null,et=16>e?16:e,va===null)var r=!1;else{if(e=va,va=null,Wd=0,qe&6)throw Error(te(331));var a=qe;for(qe|=4,de=e.current;de!==null;){var l=de,c=l.child;if(de.flags&16){var d=l.deletions;if(d!==null){for(var p=0;p<d.length;p++){var m=d[p];for(de=m;de!==null;){var h=de;switch(h.tag){case 0:case 11:case 15:Dl(8,h,l)}var g=h.child;if(g!==null)g.return=h,de=g;else for(;de!==null;){h=de;var x=h.sibling,j=h.return;if(mj(h),h===m){de=null;break}if(x!==null){x.return=j,de=x;break}de=j}}}var b=l.alternate;if(b!==null){var _=b.child;if(_!==null){b.child=null;do{var N=_.sibling;_.sibling=null,_=N}while(_!==null)}}de=l}}if(l.subtreeFlags&2064&&c!==null)c.return=l,de=c;else e:for(;de!==null;){if(l=de,l.flags&2048)switch(l.tag){case 0:case 11:case 15:Dl(9,l,l.return)}var y=l.sibling;if(y!==null){y.return=l.return,de=y;break e}de=l.return}}var w=e.current;for(de=w;de!==null;){c=de;var C=c.child;if(c.subtreeFlags&2064&&C!==null)C.return=c,de=C;else e:for(c=w;de!==null;){if(d=de,d.flags&2048)try{switch(d.tag){case 0:case 11:case 15:fp(9,d)}}catch(D){Mt(d,d.return,D)}if(d===c){de=null;break e}var R=d.sibling;if(R!==null){R.return=d.return,de=R;break e}de=d.return}}if(qe=a,Ma(),bi&&typeof bi.onPostCommitFiberRoot=="function")try{bi.onPostCommitFiberRoot(ap,e)}catch{}r=!0}return r}finally{et=n,Ir.transition=t}}return!1}function _b(e,t,n){t=Eo(n,t),t=rj(e,t,1),e=ja(e,t,1),t=Mn(),e!==null&&(vc(e,1,t),Zn(e,t))}function Mt(e,t,n){if(e.tag===3)_b(e,e,n);else for(;t!==null;){if(t.tag===3){_b(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Sa===null||!Sa.has(r))){e=Eo(n,e),e=ij(t,e,1),t=ja(t,e,1),e=Mn(),t!==null&&(vc(t,1,e),Zn(t,e));break}}t=t.return}}function cI(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Mn(),e.pingedLanes|=e.suspendedLanes&n,sn===e&&(un&n)===n&&(Jt===4||Jt===3&&(un&130023424)===un&&500>Ut()-r0?cs(e,0):n0|=n),Zn(e,t)}function Sj(e,t){t===0&&(e.mode&1?(t=Mu,Mu<<=1,!(Mu&130023424)&&(Mu=4194304)):t=1);var n=Mn();e=Wi(e,t),e!==null&&(vc(e,t,n),Zn(e,n))}function uI(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Sj(e,n)}function dI(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(te(314))}r!==null&&r.delete(t),Sj(e,n)}var Nj;Nj=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Yn.current)Gn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gn=!1,J6(e,t,n);Gn=!!(e.flags&131072)}else Gn=!1,Ct&&t.flags&1048576&&A_(t,Id,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;cd(e,t),e=t.pendingProps;var a=So(t,jn.current);ho(t,n),a=Xg(null,t,r,e,a,n);var l=Yg();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Jn(r)?(l=!0,Od(t)):l=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,qg(t),a.updater=pp,t.stateNode=a,a._reactInternals=t,Rh(t,r,e,n),t=Lh(null,t,r,!0,l,n)):(t.tag=0,Ct&&l&&Fg(t),In(null,t,a,n),t=t.child),t;case 16:r=t.elementType;e:{switch(cd(e,t),e=t.pendingProps,a=r._init,r=a(r._payload),t.type=r,a=t.tag=fI(r),e=Qr(r,e),a){case 0:t=Mh(null,t,r,e,n);break e;case 1:t=pb(null,t,r,e,n);break e;case 11:t=ub(null,t,r,e,n);break e;case 14:t=db(null,t,r,Qr(r.type,e),n);break e}throw Error(te(306,r,""))}return t;case 0:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),Mh(e,t,r,a,n);case 1:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),pb(e,t,r,a,n);case 3:e:{if(lj(t),e===null)throw Error(te(387));r=t.pendingProps,l=t.memoizedState,a=l.element,M_(e,t),Dd(t,r,null,n);var c=t.memoizedState;if(r=c.element,l.isDehydrated)if(l={element:r,isDehydrated:!1,cache:c.cache,pendingSuspenseBoundaries:c.pendingSuspenseBoundaries,transitions:c.transitions},t.updateQueue.baseState=l,t.memoizedState=l,t.flags&256){a=Eo(Error(te(423)),t),t=fb(e,t,r,n,a);break e}else if(r!==a){a=Eo(Error(te(424)),t),t=fb(e,t,r,n,a);break e}else for(mr=_a(t.stateNode.containerInfo.firstChild),gr=t,Ct=!0,Yr=null,n=R_(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(No(),r===a){t=Hi(e,t,n);break e}In(e,t,r,n)}t=t.child}return t;case 5:return L_(t),e===null&&Ph(t),r=t.type,a=t.pendingProps,l=e!==null?e.memoizedProps:null,c=a.children,Nh(r,a)?c=null:l!==null&&Nh(r,l)&&(t.flags|=32),oj(e,t),In(e,t,c,n),t.child;case 6:return e===null&&Ph(t),null;case 13:return cj(e,t,n);case 4:return Vg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=ko(t,null,r,n):In(e,t,r,n),t.child;case 11:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),ub(e,t,r,a,n);case 7:return In(e,t,t.pendingProps,n),t.child;case 8:return In(e,t,t.pendingProps.children,n),t.child;case 12:return In(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,a=t.pendingProps,l=t.memoizedProps,c=a.value,ht(Md,r._currentValue),r._currentValue=c,l!==null)if(ni(l.value,c)){if(l.children===a.children&&!Yn.current){t=Hi(e,t,n);break e}}else for(l=t.child,l!==null&&(l.return=t);l!==null;){var d=l.dependencies;if(d!==null){c=l.child;for(var p=d.firstContext;p!==null;){if(p.context===r){if(l.tag===1){p=$i(-1,n&-n),p.tag=2;var m=l.updateQueue;if(m!==null){m=m.shared;var h=m.pending;h===null?p.next=p:(p.next=h.next,h.next=p),m.pending=p}}l.lanes|=n,p=l.alternate,p!==null&&(p.lanes|=n),Th(l.return,n,t),d.lanes|=n;break}p=p.next}}else if(l.tag===10)c=l.type===t.type?null:l.child;else if(l.tag===18){if(c=l.return,c===null)throw Error(te(341));c.lanes|=n,d=c.alternate,d!==null&&(d.lanes|=n),Th(c,n,t),c=l.sibling}else c=l.child;if(c!==null)c.return=l;else for(c=l;c!==null;){if(c===t){c=null;break}if(l=c.sibling,l!==null){l.return=c.return,c=l;break}c=c.return}l=c}In(e,t,a.children,n),t=t.child}return t;case 9:return a=t.type,r=t.pendingProps.children,ho(t,n),a=Mr(a),r=r(a),t.flags|=1,In(e,t,r,n),t.child;case 14:return r=t.type,a=Qr(r,t.pendingProps),a=Qr(r.type,a),db(e,t,r,a,n);case 15:return aj(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,a=t.pendingProps,a=t.elementType===r?a:Qr(r,a),cd(e,t),t.tag=1,Jn(r)?(e=!0,Od(t)):e=!1,ho(t,n),nj(t,r,a),Rh(t,r,a,n),Lh(null,t,r,!0,e,n);case 19:return uj(e,t,n);case 22:return sj(e,t,n)}throw Error(te(156,t.tag))};function kj(e,t){return Zw(e,t)}function pI(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rr(e,t,n,r){return new pI(e,t,n,r)}function o0(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fI(e){if(typeof e=="function")return o0(e)?1:0;if(e!=null){if(e=e.$$typeof,e===kg)return 11;if(e===Cg)return 14}return 2}function ka(e,t){var n=e.alternate;return n===null?(n=Rr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function pd(e,t,n,r,a,l){var c=2;if(r=e,typeof e=="function")o0(e)&&(c=1);else if(typeof e=="string")c=5;else e:switch(e){case Ys:return us(n.children,a,l,t);case Ng:c=8,a|=8;break;case rh:return e=Rr(12,n,t,a|2),e.elementType=rh,e.lanes=l,e;case ih:return e=Rr(13,n,t,a),e.elementType=ih,e.lanes=l,e;case ah:return e=Rr(19,n,t,a),e.elementType=ah,e.lanes=l,e;case Lw:return hp(n,a,l,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Iw:c=10;break e;case Mw:c=9;break e;case kg:c=11;break e;case Cg:c=14;break e;case da:c=16,r=null;break e}throw Error(te(130,e==null?e:typeof e,""))}return t=Rr(c,n,t,a),t.elementType=e,t.type=r,t.lanes=l,t}function us(e,t,n,r){return e=Rr(7,e,r,t),e.lanes=n,e}function hp(e,t,n,r){return e=Rr(22,e,r,t),e.elementType=Lw,e.lanes=n,e.stateNode={isHidden:!1},e}function Cm(e,t,n){return e=Rr(6,e,null,t),e.lanes=n,e}function Em(e,t,n){return t=Rr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function mI(e,t,n,r,a){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=lm(0),this.expirationTimes=lm(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lm(0),this.identifierPrefix=r,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function l0(e,t,n,r,a,l,c,d,p){return e=new mI(e,t,n,d,p),t===1?(t=1,l===!0&&(t|=8)):t=0,l=Rr(3,null,null,t),e.current=l,l.stateNode=e,l.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},qg(l),e}function hI(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Cj(e){if(!e)return Ta;e=e._reactInternals;e:{if(ys(e)!==e||e.tag!==1)throw Error(te(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Jn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(te(171))}if(e.tag===1){var n=e.type;if(Jn(n))return C_(e,n,t)}return t}function Ej(e,t,n,r,a,l,c,d,p){return e=l0(n,r,!0,e,a,l,c,d,p),e.context=Cj(null),n=e.current,r=Mn(),a=Na(n),l=$i(r,a),l.callback=t??null,ja(n,l,a),e.current.lanes=a,vc(e,a,r),Zn(e,r),e}function gp(e,t,n,r){var a=t.current,l=Mn(),c=Na(a);return n=Cj(n),t.context===null?t.context=n:t.pendingContext=n,t=$i(l,c),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ja(a,t,c),e!==null&&(ti(e,a,c,l),sd(e,a,c)),c}function qd(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function jb(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function c0(e,t){jb(e,t),(e=e.alternate)&&jb(e,t)}function gI(){return null}var Aj=typeof reportError=="function"?reportError:function(e){console.error(e)};function u0(e){this._internalRoot=e}xp.prototype.render=u0.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(te(409));gp(e,t,null,null)};xp.prototype.unmount=u0.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xs(function(){gp(null,e,null,null)}),t[Bi]=null}};function xp(e){this._internalRoot=e}xp.prototype.unstable_scheduleHydration=function(e){if(e){var t=s_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<fa.length&&t!==0&&t<fa[n].priority;n++);fa.splice(n,0,e),n===0&&l_(e)}};function d0(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function vp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Sb(){}function xI(e,t,n,r,a){if(a){if(typeof r=="function"){var l=r;r=function(){var m=qd(c);l.call(m)}}var c=Ej(t,r,e,0,null,!1,!1,"",Sb);return e._reactRootContainer=c,e[Bi]=c.current,Yl(e.nodeType===8?e.parentNode:e),xs(),c}for(;a=e.lastChild;)e.removeChild(a);if(typeof r=="function"){var d=r;r=function(){var m=qd(p);d.call(m)}}var p=l0(e,0,!1,null,null,!1,!1,"",Sb);return e._reactRootContainer=p,e[Bi]=p.current,Yl(e.nodeType===8?e.parentNode:e),xs(function(){gp(t,p,n,r)}),p}function yp(e,t,n,r,a){var l=n._reactRootContainer;if(l){var c=l;if(typeof a=="function"){var d=a;a=function(){var p=qd(c);d.call(p)}}gp(t,c,e,a)}else c=xI(n,t,e,a,r);return qd(c)}i_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=kl(t.pendingLanes);n!==0&&(Pg(t,n|1),Zn(t,Ut()),!(qe&6)&&(Ao=Ut()+500,Ma()))}break;case 13:xs(function(){var r=Wi(e,1);if(r!==null){var a=Mn();ti(r,e,1,a)}}),c0(e,1)}};Tg=function(e){if(e.tag===13){var t=Wi(e,134217728);if(t!==null){var n=Mn();ti(t,e,134217728,n)}c0(e,134217728)}};a_=function(e){if(e.tag===13){var t=Na(e),n=Wi(e,t);if(n!==null){var r=Mn();ti(n,e,t,r)}c0(e,t)}};s_=function(){return et};o_=function(e,t){var n=et;try{return et=e,t()}finally{et=n}};hh=function(e,t,n){switch(t){case"input":if(lh(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=cp(r);if(!a)throw Error(te(90));Fw(r),lh(r,a)}}}break;case"textarea":$w(e,n);break;case"select":t=n.value,t!=null&&uo(e,!!n.multiple,t,!1)}};Gw=i0;Kw=xs;var vI={usingClientEntryPoint:!1,Events:[bc,to,cp,qw,Vw,i0]},_l={findFiberByHostInstance:ts,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},yI={bundleType:_l.bundleType,version:_l.version,rendererPackageName:_l.rendererPackageName,rendererConfig:_l.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Vi.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Yw(e),e===null?null:e.stateNode},findFiberByHostInstance:_l.findFiberByHostInstance||gI,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Vu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Vu.isDisabled&&Vu.supportsFiber)try{ap=Vu.inject(yI),bi=Vu}catch{}}vr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=vI;vr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d0(t))throw Error(te(200));return hI(e,t,null,n)};vr.createRoot=function(e,t){if(!d0(e))throw Error(te(299));var n=!1,r="",a=Aj;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(a=t.onRecoverableError)),t=l0(e,1,!1,null,null,n,!1,r,a),e[Bi]=t.current,Yl(e.nodeType===8?e.parentNode:e),new u0(t)};vr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(te(188)):(e=Object.keys(e).join(","),Error(te(268,e)));return e=Yw(t),e=e===null?null:e.stateNode,e};vr.flushSync=function(e){return xs(e)};vr.hydrate=function(e,t,n){if(!vp(t))throw Error(te(200));return yp(null,e,t,!0,n)};vr.hydrateRoot=function(e,t,n){if(!d0(e))throw Error(te(405));var r=n!=null&&n.hydratedSources||null,a=!1,l="",c=Aj;if(n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(l=n.identifierPrefix),n.onRecoverableError!==void 0&&(c=n.onRecoverableError)),t=Ej(t,null,e,1,n??null,a,!1,l,c),e[Bi]=t.current,Yl(e),r)for(e=0;e<r.length;e++)n=r[e],a=n._getVersion,a=a(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,a]:t.mutableSourceEagerHydrationData.push(n,a);return new xp(t)};vr.render=function(e,t,n){if(!vp(t))throw Error(te(200));return yp(null,e,t,!1,n)};vr.unmountComponentAtNode=function(e){if(!vp(e))throw Error(te(40));return e._reactRootContainer?(xs(function(){yp(null,null,e,!1,function(){e._reactRootContainer=null,e[Bi]=null})}),!0):!1};vr.unstable_batchedUpdates=i0;vr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!vp(n))throw Error(te(200));if(e==null||e._reactInternals===void 0)throw Error(te(38));return yp(e,t,n,!1,r)};vr.version="18.3.1-next-f1338f8080-20240426";function Pj(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Pj)}catch(e){console.error(e)}}Pj(),Pw.exports=vr;var Tj=Pw.exports;const Ke=E.forwardRef(({options:e,value:t,onChange:n,placeholder:r="Search...",renderOption:a},l)=>{const[c,d]=E.useState(!1),[p,m]=E.useState(""),[h,g]=E.useState({top:0,left:0,width:0}),x=E.useRef(null),j=E.useRef(null),b=e.find(w=>w.value===t),_=e.filter(w=>{var C;return w.label.toLowerCase().includes(p.toLowerCase())||((C=w.description)==null?void 0:C.toLowerCase().includes(p.toLowerCase()))});E.useEffect(()=>{function w(C){x.current&&!x.current.contains(C.target)&&d(!1)}return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[]),E.useEffect(()=>{c&&j.current&&j.current.focus()},[c]),E.useEffect(()=>{if(c&&x.current){const w=x.current.getBoundingClientRect();g({top:w.bottom+window.scrollY,left:w.left+window.scrollX,width:w.width})}},[c]);const N=(w,C)=>{C.preventDefault(),C.stopPropagation(),n(w),d(!1),m("")},y=c&&Tj.createPortal(s.jsxs("div",{className:"fixed bg-white shadow-lg rounded-md overflow-hidden border border-gray-200",style:{top:h.top,left:h.left,width:h.width,zIndex:9999},children:[s.jsx("div",{className:"p-2 border-b",children:s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{ref:j,type:"text",className:"w-full pl-9 pr-4 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",placeholder:"Search...",value:p,onChange:w=>m(w.target.value),onMouseDown:w=>w.stopPropagation()})]})}),s.jsx("div",{className:"max-h-60 overflow-y-auto",children:_.length===0?s.jsx("div",{className:"text-center py-4 text-sm text-gray-500",children:"No results found"}):s.jsx("ul",{className:"py-1",children:_.map(w=>s.jsx("li",{children:s.jsxs("button",{type:"button",className:`w-full text-left px-4 py-2 hover:bg-gray-100 ${w.value===t?"bg-blue-50":""}`,onMouseDown:C=>N(w.value,C),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("span",{className:"block font-medium",children:w.label}),w.value===t&&s.jsx(mO,{className:"w-4 h-4 text-blue-600"})]}),w.description&&s.jsx("span",{className:"block text-sm text-gray-500",children:w.description})]})},w.value))})})]}),document.body);return s.jsxs("div",{className:"relative",ref:x,children:[s.jsx("button",{type:"button",onMouseDown:w=>{w.preventDefault(),d(!c)},className:"w-full bg-white relative border border-gray-300 rounded-md shadow-sm pl-3 pr-10 py-2 text-left cursor-pointer focus:outline-none focus:ring-1 focus:ring-blue-500 focus:border-blue-500",ref:l,children:b?s.jsx("span",{className:"block truncate",children:b.label}):s.jsx("span",{className:"block truncate text-gray-500",children:r})}),y]})}),Nb=e=>e==="float"||e==="integer",kb=e=>e==="text"||e==="string"||e==="categorical",Gu=e=>{var t,n,r,a,l,c,d;return{method:(e==null?void 0:e.method)||"none",encoding:e==null?void 0:e.encoding,params:{categorical_min:((t=e==null?void 0:e.params)==null?void 0:t.categorical_min)??100,clip:(n=e==null?void 0:e.params)==null?void 0:n.clip,constant:(r=e==null?void 0:e.params)==null?void 0:r.constant,llm:(a=e==null?void 0:e.params)==null?void 0:a.llm,model:(l=e==null?void 0:e.params)==null?void 0:l.model,dimensions:(c=e==null?void 0:e.params)==null?void 0:c.dimensions,preset:(d=e==null?void 0:e.params)==null?void 0:d.preset}}};function bI({column:e,dataset:t,setColumnType:n,setDataset:r,constants:a,onUpdate:l}){var ne,me,Re,gt,tt,K,je,Ae,ke,Y,fe,ve,Ve,pn,Ye,Sn,nr,jt,on,St,Zt,Lt,Nn,Fn,ie,xe,at,Ge,st,kn,Nt,rr,ir,br,zn,Cn,ar,sr,ii;const[c,d]=E.useState(!!((me=(ne=e.preprocessing_steps)==null?void 0:ne.inference)!=null&&me.method&&e.preprocessing_steps.inference.method!=="none")),p=e.datatype,[m,h]=E.useState(()=>{var Q;return Gu((Q=e.preprocessing_steps)==null?void 0:Q.training)}),[g,x]=E.useState(()=>{var Q;return Gu((Q=e.preprocessing_steps)==null?void 0:Q.inference)});E.useEffect(()=>{var Q,ae;h(Gu((Q=e.preprocessing_steps)==null?void 0:Q.training)),x(Gu((ae=e.preprocessing_steps)==null?void 0:ae.inference))},[e.id]);const j=(Q,ae)=>{let ye={};const nt=Q==="training"?m:g;let Ce=null;kb(p)&&nt.encoding?Ce=nt.encoding:p==="categorical"&&(ae==="categorical"?(ye={...ye,categorical_min:100},Ce="one_hot"):ae!=="none"&&(Ce="one_hot")),e.is_target&&(Ce="ordinal");const pt={method:ae,encoding:Ce,params:ye};Q==="training"?(h(pt),l(pt,c?g:void 0,c)):(x(pt),l(m,pt,c))},b=(Q,ae)=>{const ye=m,nt=h,Ce={...ye,params:{categorical_min:ye.params.categorical_min,clip:ye.params.clip,constant:ye.params.constant,llm:ye.params.llm,model:ye.params.model,dimensions:ye.params.dimensions,preset:ye.params.preset,...ae}};nt(Ce),l(Ce,c?g:void 0,c)},_=(Q,ae)=>{const ye=m,nt=h,Ce={...ye,params:{...ye.params,clip:{...ye.params.clip,...ae}}};nt(Ce),l(Ce,c?g:void 0,c)},N=(Q,ae)=>{const ye=Q==="training"?m:g,nt=Q==="training"?h:x,Ce={...ye,params:{...ye.params,constant:ae}};nt(Ce),Q==="training"?l(Ce,c?g:void 0,c):l(m,Ce,c)},y=(Q,ae)=>{const ye=Q==="training"?m:g,nt=Q==="training"?h:x,Ce={...ye,params:{...ye.params,...ae}};nt(Ce),Q==="training"?l(Ce,c?g:void 0,c):l(m,Ce,c)},w=(Q,ae)=>{var Dt,ft;const ye=Q==="training"?m:g,nt=Q==="training"?h:x;let Ce={...ye.params};if(ae==="embedding"){const en=a.embedding_constants;if(en){const Vt="openai",$n=(Dt=(en.models[Vt]||[])[0])==null?void 0:Dt.value,Fr=((ft=(en.models[Vt]||[]).find(fn=>fn.value===$n))==null?void 0:ft.dimensions)||1536;Ce={...Ce,llm:Ce.llm||Vt,model:Ce.model||$n,dimensions:Ce.dimensions||Fr,preset:Ce.preset||"high_quality"}}}const pt={...ye,encoding:ae==="none"?null:ae,params:Ce};nt(pt),Q==="training"?l(pt,c?g:void 0,c):l(m,pt,c)},C=Q=>{var ye,nt;const ae=Q==="training"?m:g;return ae.method!=="constant"?null:s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Constant Value"}),Nb(p)?s.jsx("input",{type:"number",value:((ye=ae.params)==null?void 0:ye.constant)??"",onChange:Ce=>N(Q,Ce.target.value),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"Enter a number..."}):s.jsx("input",{type:"text",value:((nt=ae.params)==null?void 0:nt.constant)??"",onChange:Ce=>N(Q,Ce.target.value),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"Enter a value..."})]})},R=Q=>{const ae=Q==="training"?m:g;return!ae||!kb(p)?null:s.jsxs("div",{className:"mt-4 space-y-4 bg-gray-50 rounded-lg p-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Encoding"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"noneEncode",name:"encoding",checked:ae.encoding===null,onChange:()=>w(Q,"none"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"noneEncode",className:"text-sm text-gray-700",children:"No encoding"})]}),p==="categorical"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"oneHotEncode",name:"encoding",checked:ae.encoding==="one_hot",onChange:()=>w(Q,"one_hot"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"oneHotEncode",className:"text-sm text-gray-700",children:"One-hot encode categories"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"ordinalEncode",name:"encoding",checked:ae.encoding==="ordinal",onChange:()=>w(Q,"ordinal"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"ordinalEncode",className:"text-sm text-gray-700",children:"Ordinal encode categories"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",id:"embeddingEncode",name:"encoding",checked:ae.encoding==="embedding",onChange:()=>w(Q,"embedding"),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"embeddingEncode",className:"text-sm text-gray-700",children:"Embedding encode"})]})]})},D=Q=>{var fn,ai,mn,zr,wr,_r,ws,_s,js,Ss,Ns,En;const ae=Q==="training"?m:g;if(!ae||ae.encoding!=="embedding"||!a.embedding_constants)return null;const ye=a.embedding_constants,nt=ye.providers||[],Ce=ye.models||{},pt=Object.entries(ye.compression_presets||{}).map(([Fe,rt])=>({value:Fe,label:Fe.split("_").map(xt=>xt.charAt(0).toUpperCase()+xt.slice(1)).join(" "),description:rt.description,variance_target:rt.variance_target})),Dt=Fe=>Ce[Fe]||[],ft=()=>{var $r,Ur,An;const Fe=(($r=ae.params)==null?void 0:$r.llm)||"openai",rt=((Ur=ae.params)==null?void 0:Ur.model)||((An=Dt(Fe)[0])==null?void 0:An.value),xt=Dt(Fe).find(Ki=>Ki.value===rt);return(xt==null?void 0:xt.dimensions)||1536},en=Fe=>{var rt;return((rt=pt.find(xt=>Math.abs(xt.variance_target-Fe)<.05))==null?void 0:rt.value)||null},Vt=Fe=>{var rt;return((rt=pt.find(xt=>xt.value===Fe))==null?void 0:rt.variance_target)||.85},$n=Fe=>{const rt=Fe/ft(),xt=en(rt);y(Q,{dimensions:Fe,preset:xt})},Fr=Fe=>{const rt=Vt(Fe),xt=Math.round(rt*ft());y(Q,{dimensions:xt,preset:Fe})};return s.jsxs("div",{className:"space-y-6 mt-8",children:[s.jsx("div",{className:"bg-blue-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex gap-2",children:[s.jsx(yi,{className:"w-5 h-5 text-blue-500 flex-shrink-0"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-blue-900",children:"Text Embeddings"}),s.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Convert text into numerical vectors for machine learning, preserving semantic meaning while optimizing for storage and performance."})]})]})}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Embedding Provider"}),s.jsx(Ke,{value:((fn=ae.params)==null?void 0:fn.llm)||"openai",onChange:Fe=>{var Ur,An;const rt=Dt(Fe),xt=(Ur=rt[0])==null?void 0:Ur.value,$r=((An=rt[0])==null?void 0:An.dimensions)||1536;y(Q,{...ae.params,llm:Fe,model:xt,dimensions:$r,preset:"high_quality"})},options:nt,placeholder:"Select a provider"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model"}),s.jsx(Ke,{value:((ai=ae.params)==null?void 0:ai.model)||((zr=Dt(((mn=ae.params)==null?void 0:mn.llm)||"openai")[0])==null?void 0:zr.value),onChange:Fe=>{var $r;const rt=Dt((($r=ae.params)==null?void 0:$r.llm)||"openai").find(Ur=>Ur.value===Fe),xt=(rt==null?void 0:rt.dimensions)||1536;y(Q,{...ae.params,model:Fe,dimensions:xt,preset:"high_quality"})},options:Dt(((wr=ae.params)==null?void 0:wr.llm)||"openai"),placeholder:"Select a model"})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Storage & Quality"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-500",children:[s.jsx(CO,{className:"w-4 h-4"}),s.jsx("span",{children:"Storage"}),s.jsx("span",{className:"mx-2",children:"•"}),s.jsx("span",{children:"Quality"}),s.jsx(NO,{className:"w-4 h-4"})]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm text-gray-600",children:"Target Dimensions"}),s.jsx("span",{className:"text-sm font-medium text-gray-900",children:((_r=ae.params)==null?void 0:_r.dimensions)||ft()})]}),s.jsx("input",{type:"range",min:"2",max:ft(),value:((ws=ae.params)==null?void 0:ws.dimensions)||ft(),onChange:Fe=>$n(parseInt(Fe.target.value)),className:"w-full"}),s.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mt-1",children:[s.jsx("span",{children:"2"}),s.jsx("span",{children:ft()})]})]}),s.jsxs("div",{className:"space-y-3",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Quality Presets"}),pt.map(Fe=>{var rt,xt;return s.jsxs("div",{onClick:()=>Fr(Fe.value),className:`p-4 rounded-lg border transition-colors cursor-pointer
|
481
|
+
${((rt=ae.params)==null?void 0:rt.preset)===Fe.value?"border-blue-500 bg-blue-50":"border-gray-200 hover:border-gray-300 bg-white"}`,children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"radio",checked:((xt=ae.params)==null?void 0:xt.preset)===Fe.value,onChange:()=>Fr(Fe.value),className:"rounded-full border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("span",{className:"font-medium text-gray-900",children:Fe.label})]})}),s.jsx("p",{className:"text-sm text-gray-600 mt-1 ml-6",children:Fe.description})]},Fe.value)})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(ls,{className:"w-5 h-5 text-gray-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Storage Efficiency"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-green-600 rounded-full",style:{width:`${100-(((_s=ae.params)==null?void 0:_s.dimensions)||24)/ft()*100}%`}})}),s.jsx("p",{className:"text-sm text-gray-600 mt-2",children:(js=ae.params)!=null&&js.dimensions&&ae.params.dimensions<=ft()*.25?"Optimized for storage. Maintains core meaning while significantly reducing storage requirements.":(Ss=ae.params)!=null&&Ss.dimensions&&ae.params.dimensions<=ft()*.5?"Balanced approach. Good compromise between quality and storage efficiency.":"Prioritizes quality. Preserves more nuanced relationships but requires more storage."})]})]})]})}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(yi,{className:"w-5 h-5 text-gray-400 flex-shrink-0 mt-0.5"}),s.jsxs("div",{className:"flex-1",children:[s.jsx("h5",{className:"text-sm font-medium text-gray-900",children:"Information Preservation"}),s.jsxs("div",{className:"mt-2",children:[s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"bg-blue-600 h-2.5 rounded-full transition-all duration-300",style:{width:`${(((Ns=ae.params)==null?void 0:Ns.dimensions)||24)/ft()*100}%`}})}),s.jsxs("p",{className:"text-sm text-gray-600 mt-2",children:["Preserves approximately ",Math.round((((En=ae.params)==null?void 0:En.dimensions)||24)/ft()*100),"% of the original information"]})]})]})]})})]})]})]})]})]})};E.useEffect(()=>{var Q,ae,ye,nt,Ce,pt,Dt,ft,en,Vt,$n,Fr;if(m.encoding==="embedding"&&!((Q=m.params)!=null&&Q.dimensions)){const fn=((ae=m.params)==null?void 0:ae.llm)||"openai",ai=((ye=m.params)==null?void 0:ye.model)||((Ce=(((nt=a.embedding_constants)==null?void 0:nt.models[fn])||[])[0])==null?void 0:Ce.value),mn=(((pt=a.embedding_constants)==null?void 0:pt.models[fn])||[]).find(wr=>wr.value===ai),zr=(mn==null?void 0:mn.dimensions)||1536;y("training",{dimensions:zr})}if(c&&g.encoding==="embedding"&&!((Dt=g.params)!=null&&Dt.dimensions)){const fn=((ft=g.params)==null?void 0:ft.llm)||"openai",ai=((en=g.params)==null?void 0:en.model)||(($n=(((Vt=a.embedding_constants)==null?void 0:Vt.models[fn])||[])[0])==null?void 0:$n.value),mn=(((Fr=a.embedding_constants)==null?void 0:Fr.models[fn])||[]).find(wr=>wr.value===ai),zr=(mn==null?void 0:mn.dimensions)||1536;y("inference",{dimensions:zr})}},[m.encoding,g.encoding,e.id]);const[T,F]=E.useState(!1),z=Q=>{const ae=t.columns.map(ye=>({...ye,drop_if_null:ye.name===e.name?Q.target.checked:ye.drop_if_null}));r({...t,columns:ae})},B=Q=>{const ae=t.columns.map(ye=>({...ye,description:ye.name===e.name?Q.target.value:ye.description}));r({...t,columns:ae})},W=()=>{F(!1)},pe=Q=>{Q.key==="Enter"?(Q.preventDefault(),F(!1)):Q.key==="Escape"&&F(!1)},oe=()=>{F(!0)};let we=((gt=(Re=e.statistics)==null?void 0:Re.processed)==null?void 0:gt.null_count)||((K=(tt=e.statistics)==null?void 0:tt.raw)==null?void 0:K.null_count)||0,be=((Ae=(je=e.statistics)==null?void 0:je.processed)==null?void 0:Ae.num_rows)||((Y=(ke=e.statistics)==null?void 0:ke.raw)==null?void 0:Y.num_rows)||0;const J=we&&be?we/be*100:0,ee=(ve=(fe=e.statistics)==null?void 0:fe.processed)!=null&&ve.null_count&&((pn=(Ve=e.statistics)==null?void 0:Ve.processed)!=null&&pn.num_rows)?e.statistics.processed.null_count/e.statistics.processed.num_rows*100:0,le=be,G=Q=>{var nt,Ce,pt,Dt,ft,en,Vt;const ae=m;let ye;if(ae.method==="most_frequent"&&((Ce=(nt=e.statistics)==null?void 0:nt.raw)==null?void 0:Ce.most_frequent_value)!==void 0)ye=`Most Frequent Value: ${e.statistics.raw.most_frequent_value}`;else if(ae.method==="ffill"){const $n=(pt=e.statistics)==null?void 0:pt.raw.last_value;$n!==void 0?ye=`Forward Fill using Last Value: ${$n}`:ye="Set date column & apply preprocessing to see last value"}else if(ae.method==="median"&&((ft=(Dt=e.statistics)==null?void 0:Dt.raw)==null?void 0:ft.median)!==void 0)ye=`Median: ${e.statistics.raw.median}`;else if(ae.method==="mean"&&((Vt=(en=e.statistics)==null?void 0:en.raw)==null?void 0:Vt.mean)!==void 0)ye=`Mean: ${e.statistics.raw.mean}`;else return null;return s.jsx("div",{className:"mt-4 bg-yellow-50 rounded-lg p-4",children:s.jsx("span",{className:"text-sm font-medium text-yellow-700",children:ye})})},re=()=>s.jsx("div",{className:"space-y-4",children:e.lineage.map((Q,ae)=>s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center flex-shrink-0 ${Q.key==="raw_dataset"?"bg-gray-100":Q.key==="computed_by_feature"?"bg-purple-100":"bg-blue-100"}`,children:Q.key==="raw_dataset"?s.jsx(wn,{className:"w-4 h-4 text-gray-600"}):Q.key==="computed_by_feature"?s.jsx(bd,{className:"w-4 h-4 text-purple-600"}):s.jsx(Aa,{className:"w-4 h-4 text-blue-600"})}),s.jsxs("div",{className:"flex-1",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("p",{className:"text-sm font-medium text-gray-900",children:Q.description}),Q.timestamp&&s.jsx("span",{className:"text-xs text-gray-500",children:new Date(Q.timestamp).toLocaleString()})]}),ae<e.lineage.length-1&&s.jsx("div",{className:"ml-4 mt-2 mb-2 w-0.5 h-4 bg-gray-200"})]})]},ae))});return s.jsxs("div",{className:"space-y-8",children:[s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{className:"flex-1 max-w-[70%]",children:[s.jsx("h2",{className:"text-2xl font-semibold text-gray-900",children:e.name}),s.jsx("div",{className:"mt-1 flex items-start gap-1",children:T?s.jsxs("div",{className:"flex-1",children:[s.jsx("textarea",{value:e.description||"",onChange:B,onBlur:W,onKeyDown:pe,className:"w-full px-2 py-1 text-sm text-gray-900 border border-blue-500 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500",rows:2,autoFocus:!0,placeholder:"Enter column description..."}),s.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Press Enter to save, Escape to cancel"})]}):s.jsxs("div",{className:"flex items-start gap-1 max-w-[100%]",children:[s.jsx("p",{className:"text-sm text-gray-500 cursor-pointer flex-grow line-clamp-3",onClick:oe,children:e.description||"No description provided"}),s.jsx("button",{onClick:oe,className:"p-1 text-gray-400 hover:text-gray-600 rounded-md hover:bg-gray-100 flex-shrink-0",children:s.jsx(EO,{className:"w-4 h-4"})})]})})]}),s.jsx("div",{className:"flex items-center gap-4 flex-shrink-0",children:s.jsxs("div",{className:"relative flex items-center gap-2",children:[s.jsxs("div",{className:"absolute right-0 -top-8 flex items-center gap-2",children:[e.required&&s.jsx(ga,{variant:"secondary",className:"bg-blue-100 text-blue-800",children:"Required"}),e.is_computed&&s.jsxs(ga,{variant:"secondary",className:"bg-purple-100 text-purple-800",children:[s.jsx(bd,{className:"w-3 h-3 mr-1"}),"Computed"]})]}),e.is_target?s.jsx("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium bg-purple-100 text-purple-800",children:"Target Column"}):s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[s.jsx("input",{type:"checkbox",checked:e.drop_if_null,onChange:z,className:"rounded border-gray-300 text-red-600 focus:ring-red-500"}),s.jsxs("span",{className:"flex items-center gap-1 text-gray-700",children:[s.jsx(Fo,{className:"w-4 h-4 text-gray-400"}),"Drop if null"]})]})})]})})]}),s.jsxs("div",{className:"mt-6 grid grid-cols-2 gap-6",children:[s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(wn,{className:"w-4 h-4 text-gray-500"}),s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:"Raw Data Statistics"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Values:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(nr=(Sn=(Ye=e.statistics)==null?void 0:Ye.raw)==null?void 0:Sn.null_count)==null?void 0:nr.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Total Rows:"}),s.jsx("span",{className:"font-medium text-gray-900",children:le.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Percentage:"}),s.jsxs("span",{className:"font-medium text-gray-900",children:[J.toFixed(2),"%"]})]}),s.jsx("div",{className:"mt-2",children:s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-blue-600 rounded-full",style:{width:`${J}%`}})})})]})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[s.jsx(eh,{className:"w-4 h-4 text-gray-500"}),s.jsx("h3",{className:"text-sm font-medium text-gray-900",children:"Processed Data Statistics"})]}),(jt=t==null?void 0:t.preprocessing_steps)!=null&&jt.training?s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Values:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(Zt=(St=(on=e.statistics)==null?void 0:on.processed)==null?void 0:St.null_count)==null?void 0:Zt.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Total Rows:"}),s.jsx("span",{className:"font-medium text-gray-900",children:(Fn=(Nn=(Lt=e.statistics)==null?void 0:Lt.processed)==null?void 0:Nn.num_rows)==null?void 0:Fn.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between text-sm",children:[s.jsx("span",{className:"text-gray-600",children:"Null Percentage:"}),s.jsxs("span",{className:"font-medium text-gray-900",children:[ee.toFixed(2),"%"]})]}),s.jsx("div",{className:"mt-2",children:s.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2.5",children:s.jsx("div",{className:"h-full bg-blue-600 rounded-full",style:{width:`${ee}%`}})})})]}):s.jsx("div",{className:"text-sm text-gray-500 text-center py-2",children:"No preprocessing configured"})]})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6",children:[s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Type"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:e.datatype})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Unique Values"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:((at=(xe=(ie=e.statistics)==null?void 0:ie.processed)==null?void 0:xe.unique_count)==null?void 0:at.toLocaleString())??"N/A"})]}),s.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Null Values"}),s.jsx("p",{className:"text-lg font-medium text-gray-900 mt-1",children:((kn=(st=(Ge=e.statistics)==null?void 0:Ge.processed)==null?void 0:st.null_count)==null?void 0:kn.toLocaleString())??"0"})]})]}),(Nt=e.statistics)!=null&&Nt.processed.null_count?s.jsxs("div",{className:"mt-6",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Null Distribution"}),s.jsxs("span",{className:"text-sm text-gray-500",children:[J.toFixed(2),"% of values are null"]})]}),s.jsx("div",{className:"relative h-2 bg-gray-100 rounded-full overflow-hidden",children:s.jsx("div",{className:"absolute top-0 left-0 h-full bg-yellow-400 rounded-full",style:{width:`${J}%`}})})]}):s.jsx("div",{className:"mt-6 bg-green-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full"}),s.jsx("span",{className:"text-sm text-green-700",children:"This column has no null values"})]})}),((ir=(rr=e.statistics)==null?void 0:rr.raw)==null?void 0:ir.sample_data)&&s.jsxs("div",{className:"mt-6",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Sample Values"}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Array.isArray(e.sample_values)?e.sample_values.slice(0,3).map((Q,ae)=>s.jsx("span",{className:"m-1 flex-items items-center",children:s.jsx(ga,{children:typeof Q=="string"?Q.split(/\s+/).slice(0,10).join(" ")+(Q.split(/\s+/).length>10?"...":""):String(Q)})},ae)):[]})})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(Aa,{className:"w-5 h-5 text-gray-500"}),"Data Type"]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Column Type"}),s.jsx(Ke,{value:p,onChange:Q=>n(e.name,Q),options:a.column_types.map(Q=>({value:Q.value,label:Q.label}))})]}),s.jsxs("div",{className:"bg-gray-50 rounded-md p-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Sample Data"}),s.jsx("div",{className:"space-y-2",children:Array.isArray(e.sample_values)?e.sample_values.slice(0,3).map((Q,ae)=>s.jsx("span",{className:"m-1 flex-items items-center",children:s.jsx(ga,{children:typeof Q=="string"?Q.split(/\s+/).slice(0,10).join(" ")+(Q.split(/\s+/).length>10?"...":""):String(Q)})},ae)):[]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(eh,{className:"w-5 h-5 text-gray-500"}),"Preprocessing Strategy"]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Training Strategy"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("input",{type:"checkbox",id:"useDistinctInference",checked:c,onChange:Q=>{d(Q.target.checked),l(m,Q.target.checked?g:void 0,Q.target.checked)},className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"useDistinctInference",className:"text-sm text-gray-700",children:"Use different strategy for inference"})]})]}),s.jsxs("div",{className:c?"grid grid-cols-2 gap-6":"",children:[s.jsxs("div",{className:"relative z-50",children:[s.jsx(Ke,{value:m.method,onChange:Q=>j("training",Q),options:[{value:"none",label:"No preprocessing"},...((br=a.preprocessing_strategies[p])==null?void 0:br.map(Q=>({value:Q.value,label:Q.label})))||[]]}),G(),C("training"),R("training"),D("training"),e.datatype==="categorical"&&m.method==="categorical"&&s.jsx("div",{className:"mt-4 space-y-4 bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Minimum Category Instances"}),s.jsx("input",{type:"number",min:"1",value:m.params.categorical_min,onChange:Q=>b("training",{categorical_min:parseInt(Q.target.value)}),className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:'Categories with fewer instances will be grouped as "OTHER"'})]})})]}),c&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.jsx(xg,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Inference Strategy"})]}),s.jsx(Ke,{value:g.method,onChange:Q=>j("inference",Q),options:[{value:"none",label:"No preprocessing"},...((zn=a.preprocessing_strategies[p])==null?void 0:zn.map(Q=>({value:Q.value,label:Q.label})))||[]]}),C("inference"),R("inference"),D("inference")]})]})]}),Nb(p)&&m.method!=="none"&&s.jsxs("div",{className:"border-t pt-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900 mb-2",children:"Clip Values"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Min Value"}),s.jsx("input",{type:"number",value:((ar=(Cn=m.params)==null?void 0:Cn.clip)==null?void 0:ar.min)??"",onChange:Q=>{_("training",{min:Q.target.value?Number(Q.target.value):void 0})},className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"No minimum"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max Value"}),s.jsx("input",{type:"number",value:((ii=(sr=m.params)==null?void 0:sr.clip)==null?void 0:ii.max)??"",onChange:Q=>{_("training",{max:Q.target.value?Number(Q.target.value):void 0})},className:"w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"No maximum"})]})]})]})]})]}),s.jsxs("div",{className:"bg-white rounded-lg border border-gray-200 p-6",children:[s.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center gap-2",children:[s.jsx(xw,{className:"w-5 h-5 text-gray-500"}),"Column Lineage"]}),s.jsx("div",{className:"space-y-4",children:re()})]})]})}function wI({columns:e,selectedColumn:t,onColumnSelect:n,onToggleHidden:r}){return tr().props,s.jsx("div",{className:"space-y-2 pb-2",children:e.map(a=>{var l,c,d;return s.jsxs("div",{className:`p-3 rounded-lg border ${t===a.name?"border-blue-500 bg-blue-50":a.is_target?"border-purple-500 bg-purple-50":a.hidden?"border-gray-200 bg-gray-50":"border-gray-200 hover:border-gray-300"} transition-colors duration-150`,children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[a.is_target&&s.jsx(bg,{className:"w-4 h-4 text-purple-500"}),s.jsx("span",{className:`font-medium ${a.hidden?"text-gray-500":"text-gray-900"}`,children:a.name}),s.jsx("span",{className:"text-xs px-2 py-0.5 bg-gray-100 text-gray-600 rounded-full",children:a.datatype})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[!a.is_target&&s.jsx("button",{onClick:()=>r(a.name),className:`p-1 rounded hover:bg-gray-100 ${a.hidden?"text-gray-500":"text-gray-400 hover:text-gray-600"}`,title:a.hidden?"Show column":"Hide column",children:a.hidden?s.jsx(Zm,{className:"w-4 h-4"}):s.jsx(mw,{className:"w-4 h-4"})}),s.jsx("button",{onClick:()=>n(a.name),className:"p-1 rounded text-gray-400 hover:text-gray-600 hover:bg-gray-100",title:"Configure preprocessing",children:s.jsx(Aa,{className:"w-4 h-4"})})]})]}),s.jsxs("div",{className:"text-sm text-gray-500",children:[a.description&&s.jsx("p",{className:`mb-1 line-clamp-1 ${a.drop_if_null?"text-gray-400":""}`,children:a.description}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.required&&s.jsxs("div",{className:"flex items-center gap-1 text-blue-600",children:[s.jsx(PO,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"required"})]}),a.is_computed&&s.jsxs("div",{className:"flex items-center gap-1 text-purple-600",children:[s.jsx(bd,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"computed"})]}),a.preprocessing_steps&&((l=a.preprocessing_steps)==null?void 0:l.training)&&((d=(c=a.preprocessing_steps)==null?void 0:c.training)==null?void 0:d.method)!=="none"&&s.jsxs("div",{className:"flex items-center gap-1 text-blue-600",children:[s.jsx(Xn,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"preprocessing configured"})]}),a.hidden&&s.jsxs("div",{className:"flex items-center gap-1 text-gray-400",children:[s.jsx(Zm,{className:"w-3 h-3"}),s.jsx("span",{className:"text-xs",children:"Hidden from training"})]})]})]})]},a.name)})})}const Am=5;function _I({types:e,activeFilters:t,onFilterChange:n,columnStats:r,colHasPreprocessingSteps:a,columns:l}){const c=b=>{switch(b){case"training":return`${r.training} columns`;case"hidden":return`${r.hidden} columns`;case"preprocessed":return`${r.withPreprocessing} columns`;case"nulls":return`${r.withNulls} columns`;case"computed":return`${r.computed} columns`;case"required":return`${r.required} columns`;default:return`${r.total} columns`}},d=b=>{var _,N,y,w;return!((N=(_=b.statistics)==null?void 0:_.processed)!=null&&N.null_count)||!((w=(y=b.statistics)==null?void 0:y.processed)!=null&&w.num_rows)?0:b.statistics.processed.null_count/b.statistics.processed.num_rows*100},p=l.filter(b=>{var _,N,y,w;return((N=(_=b.statistics)==null?void 0:_.processed)==null?void 0:N.null_count)&&((w=(y=b.statistics)==null?void 0:y.processed)==null?void 0:w.null_count)>0}).sort((b,_)=>d(_)-d(b)),[m,h]=E.useState(1),g=Math.ceil(p.length/Am),x=p.slice((m-1)*Am,m*Am),j=b=>{n({...t,types:t.types.includes(b)?t.types.filter(_=>_!==b):[...t.types,b]})};return s.jsxs("div",{className:"p-4 border-b space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("h3",{className:"text-sm font-medium text-gray-900 flex items-center gap-2",children:[s.jsx(_O,{className:"w-4 h-4"}),"Column Views"]}),s.jsxs("div",{className:"text-sm text-gray-500",children:["Showing ",r.filtered," of ",r.total," columns"]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{onClick:()=>n({...t,view:"all"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="all"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(wn,{className:"w-4 h-4"}),"All",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("all"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"training"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="training"?"bg-green-100 text-green-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(mw,{className:"w-4 h-4"}),"Training",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("training"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"hidden"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="hidden"?"bg-gray-100 text-gray-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(Zm,{className:"w-4 h-4"}),"Hidden",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("hidden"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"preprocessed"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="preprocessed"?"bg-blue-100 text-blue-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(eh,{className:"w-4 h-4"}),"Preprocessed",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("preprocessed"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"nulls"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="nulls"?"bg-yellow-100 text-yellow-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(_w,{className:"w-4 h-4"}),"Has Nulls",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("nulls"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"computed"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="computed"?"bg-purple-100 text-purple-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(bd,{className:"w-4 h-4"}),"Computed",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("computed"),")"]})]}),s.jsxs("button",{onClick:()=>n({...t,view:"required"}),className:`inline-flex items-center gap-1 px-3 py-1.5 rounded-md text-sm font-medium ${t.view==="required"?"bg-blue-100 text-blue-900":"text-gray-600 hover:bg-gray-50"}`,children:[s.jsx(bg,{className:"w-4 h-4"}),"Required",s.jsxs("span",{className:"text-xs text-gray-500 ml-1",children:["(",c("required"),")"]})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"text-xs font-medium text-gray-700 mb-2 block",children:"Column Types"}),s.jsx("div",{className:"flex flex-wrap gap-2",children:e.map(b=>s.jsx("button",{onClick:()=>j(b),className:`px-2 py-1 rounded-md text-xs font-medium ${t.types.includes(b)?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:b},b))})]}),t.view==="preprocessed"&&r.withPreprocessing>0&&s.jsxs("div",{className:"bg-blue-50 rounded-lg p-3",children:[s.jsx("h4",{className:"text-sm font-medium text-blue-900 mb-2",children:"Preprocessing Overview"}),s.jsx("div",{className:"space-y-2",children:l.filter(a).map(b=>{var _;return s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsx("span",{className:"text-blue-800",children:b.name}),s.jsx("span",{className:"text-blue-600",children:(_=b.preprocessing_steps)==null?void 0:_.training.method})]},b.name)})})]}),t.view==="nulls"&&p.length>0&&s.jsxs("div",{className:"bg-yellow-50 rounded-lg p-3",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h4",{className:"text-sm font-medium text-yellow-900",children:"Null Value Distribution"}),s.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-700",children:[s.jsx("button",{onClick:()=>h(b=>Math.max(1,b-1)),disabled:m===1,className:"p-1 rounded hover:bg-yellow-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-4 h-4"})}),s.jsxs("span",{children:["Page ",m," of ",g]}),s.jsx("button",{onClick:()=>h(b=>Math.min(g,b+1)),disabled:m===g,className:"p-1 rounded hover:bg-yellow-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-4 h-4"})})]})]}),s.jsx("div",{className:"space-y-2",children:x.map(b=>{var _,N,y,w;return s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-yellow-800 text-sm min-w-[120px]",children:b.name}),s.jsx("div",{className:"flex-1 h-2 bg-yellow-100 rounded-full overflow-hidden",children:s.jsx("div",{className:"h-full bg-yellow-400 rounded-full",style:{width:`${d(b)}%`}})}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("span",{className:"text-yellow-800 text-xs",children:[d(b).toFixed(1),"% null"]}),s.jsxs("span",{className:"text-yellow-600 text-xs",children:["(",(N=(_=b.statistics)==null?void 0:_.nullCount)==null?void 0:N.toLocaleString()," / ",(w=(y=b.statistics)==null?void 0:y.rowCount)==null?void 0:w.toLocaleString(),")"]})]})]},b.name)})}),s.jsxs("div",{className:"mt-3 text-sm text-yellow-700",children:[p.length," columns contain null values"]})]})]})]})}function jI({saving:e,saved:t,error:n}){return n?s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:n})]}):e?s.jsxs("div",{className:"flex items-center gap-2 text-blue-600",children:[s.jsx(ps,{className:"w-4 h-4 animate-spin"}),s.jsx("span",{className:"text-sm font-medium",children:"Saving changes..."})]}):t?s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ww,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Changes saved"})]}):null}function SI(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Oj=SI,NI=typeof bn=="object"&&bn&&bn.Object===Object&&bn,kI=NI,CI=kI,EI=typeof self=="object"&&self&&self.Object===Object&&self,AI=CI||EI||Function("return this")(),Rj=AI,PI=Rj,TI=function(){return PI.Date.now()},OI=TI,RI=/\s/;function II(e){for(var t=e.length;t--&&RI.test(e.charAt(t)););return t}var MI=II,LI=MI,DI=/^\s+/;function FI(e){return e&&e.slice(0,LI(e)+1).replace(DI,"")}var zI=FI,$I=Rj,UI=$I.Symbol,Ij=UI,Cb=Ij,Mj=Object.prototype,BI=Mj.hasOwnProperty,WI=Mj.toString,jl=Cb?Cb.toStringTag:void 0;function HI(e){var t=BI.call(e,jl),n=e[jl];try{e[jl]=void 0;var r=!0}catch{}var a=WI.call(e);return r&&(t?e[jl]=n:delete e[jl]),a}var qI=HI,VI=Object.prototype,GI=VI.toString;function KI(e){return GI.call(e)}var QI=KI,Eb=Ij,XI=qI,YI=QI,JI="[object Null]",ZI="[object Undefined]",Ab=Eb?Eb.toStringTag:void 0;function eM(e){return e==null?e===void 0?ZI:JI:Ab&&Ab in Object(e)?XI(e):YI(e)}var tM=eM;function nM(e){return e!=null&&typeof e=="object"}var rM=nM,iM=tM,aM=rM,sM="[object Symbol]";function oM(e){return typeof e=="symbol"||aM(e)&&iM(e)==sM}var lM=oM,cM=zI,Pb=Oj,uM=lM,Tb=NaN,dM=/^[-+]0x[0-9a-f]+$/i,pM=/^0b[01]+$/i,fM=/^0o[0-7]+$/i,mM=parseInt;function hM(e){if(typeof e=="number")return e;if(uM(e))return Tb;if(Pb(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pb(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=cM(e);var n=pM.test(e);return n||fM.test(e)?mM(e.slice(2),n?2:8):dM.test(e)?Tb:+e}var gM=hM,xM=Oj,Pm=OI,Ob=gM,vM="Expected a function",yM=Math.max,bM=Math.min;function wM(e,t,n){var r,a,l,c,d,p,m=0,h=!1,g=!1,x=!0;if(typeof e!="function")throw new TypeError(vM);t=Ob(t)||0,xM(n)&&(h=!!n.leading,g="maxWait"in n,l=g?yM(Ob(n.maxWait)||0,t):l,x="trailing"in n?!!n.trailing:x);function j(T){var F=r,z=a;return r=a=void 0,m=T,c=e.apply(z,F),c}function b(T){return m=T,d=setTimeout(y,t),h?j(T):c}function _(T){var F=T-p,z=T-m,B=t-F;return g?bM(B,l-z):B}function N(T){var F=T-p,z=T-m;return p===void 0||F>=t||F<0||g&&z>=l}function y(){var T=Pm();if(N(T))return w(T);d=setTimeout(y,_(T))}function w(T){return d=void 0,x&&r?j(T):(r=a=void 0,c)}function C(){d!==void 0&&clearTimeout(d),m=0,r=p=a=d=void 0}function R(){return d===void 0?c:w(Pm())}function D(){var T=Pm(),F=N(T);if(r=arguments,a=this,p=T,F){if(d===void 0)return b(p);if(g)return clearTimeout(d),d=setTimeout(y,t),j(p)}return d===void 0&&(d=setTimeout(y,t)),c}return D.cancel=C,D.flush=R,D}var _M=wM;const jM=lc(_M);function SM(e,t,n=1e3){const[r,a]=E.useState({saving:!1,saved:!1,error:null}),l=E.useRef(JSON.stringify(e)),c=E.useCallback(jM(async d=>{a(p=>({...p,saving:!0,error:null}));try{await t(d),l.current=JSON.stringify(d),a({saving:!1,saved:!0,error:null}),setTimeout(()=>{a(p=>({...p,saved:!1}))},4e3)}catch(p){a({saving:!1,saved:!1,error:p instanceof Error?p.message:"Failed to save changes"})}},n),[t,n]);return E.useEffect(()=>(JSON.stringify(e)!==l.current&&c(e),()=>{c.cancel()}),[e,c]),r}function NM({trigger:e,children:t,className:n=""}){const[r,a]=E.useState(!1),l=E.useRef(null),c=E.useRef(null);return E.useEffect(()=>{const d=p=>{var m;l.current&&!l.current.contains(p.target)&&!((m=c.current)!=null&&m.contains(p.target))&&a(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]),s.jsxs("div",{className:"relative",children:[s.jsx("div",{ref:c,onClick:()=>a(!r),children:e}),r&&s.jsxs("div",{ref:l,className:`absolute z-50 right-0 mt-2 bg-white rounded-lg shadow-lg border border-gray-200 ${n}`,children:[s.jsxs("div",{className:"flex justify-between items-center p-3 border-b border-gray-200",children:[s.jsx("h3",{className:"font-medium",children:"Feature Configuration"}),s.jsx("button",{onClick:()=>a(!1),className:"text-gray-400 hover:text-gray-600",children:s.jsx(xc,{className:"w-4 h-4"})})]}),s.jsx("div",{className:"p-4",children:t})]})]})}function kM(){return s.jsx(NM,{trigger:s.jsx("button",{type:"button",className:"p-2 text-gray-400 hover:text-gray-600",title:"Configure features",children:s.jsx(Aa,{className:"w-5 h-5"})}),className:"w-96",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-sm text-gray-600",children:"Feature options can be configured in the codebase, and loaded in initializers:"}),s.jsx("div",{className:"bg-gray-50 p-3 rounded-md",children:s.jsx("code",{className:"text-sm text-gray-800",children:"config/initializers/features.rb"})}),s.jsx("p",{className:"text-sm text-gray-600",children:"Example feature implementation:"}),s.jsx("pre",{className:"bg-gray-50 p-3 rounded-md overflow-x-auto",children:s.jsx("code",{className:"text-xs text-gray-800",children:`# lib/features/did_convert.rb
|
482
482
|
module Features
|
483
483
|
class DidConvert
|
484
484
|
include EasyML::Features
|
@@ -497,7 +497,7 @@ module Features
|
|
497
497
|
description: "Boolean true/false, did the loan application fund?"
|
498
498
|
|
499
499
|
end
|
500
|
-
end`})})]})})}function CM({options:e,initialFeatures:t=[],onFeaturesChange:n}){const[r,a]=E.useState(t),[l,c]=E.useState(null);console.log(r);const d=e.filter(N=>!r.find(y=>y.name===N.name)),p=N=>{const y=N.map((w,C)=>({...w,feature_position:C}));a(y),n(y)},m=N=>{const y=e.find(w=>w.name===N);if(y){const w={...y,feature_position:r.length};p([...r,w])}},h=N=>{const y=[...r];y.splice(N,1),p(y)},g=N=>{if(N===0)return;const y=[...r];[y[N-1],y[N]]=[y[N],y[N-1]],p(y)},x=N=>{if(N===r.length-1)return;const y=[...r];[y[N],y[N+1]]=[y[N+1],y[N]],p(y)},j=(N,y)=>{c(y)},b=(N,y)=>{if(N.preventDefault(),l===null||l===y)return;const w=[...r],[C]=w.splice(l,1);w.splice(y,0,C),p(w),c(y)},_=()=>{c(null)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex-1",children:s.jsx(Qe,{options:d.map(N=>({value:N.name,label:N.name,description:N.description})),value:"",onChange:N=>m(N),placeholder:"Add a transform..."})}),s.jsx(kM,{})]}),s.jsxs("div",{className:"space-y-2",children:[r.map((N,y)=>s.jsxs("div",{draggable:!0,onDragStart:w=>j(w,y),onDragOver:w=>b(w,y),onDragEnd:_,className:`flex items-center gap-3 p-3 bg-white border rounded-lg ${l===y?"border-blue-500 shadow-lg":"border-gray-200"} ${l!==null?"cursor-grabbing":""}`,children:[s.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 cursor-grab active:cursor-grabbing",children:s.jsx(jO,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-gray-900",children:N.name}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${N.feature_type==="calculation"?"bg-blue-100 text-blue-800":N.feature_type==="lookup"?"bg-purple-100 text-purple-800":"bg-green-100 text-green-800"}`,children:"feature"})]}),s.jsx("p",{className:"text-sm text-gray-500 truncate",children:N.description})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button",onClick:()=>g(y),disabled:y===0,className:"p-1 text-gray-400 hover:text-gray-600 disabled:opacity-50",title:"Move up",children:s.jsx(dO,{className:"w-4 h-4"})}),s.jsx("button",{type:"button",onClick:()=>x(y),disabled:y===r.length-1,className:"p-1 text-gray-400 hover:text-gray-600 disabled:opacity-50",title:"Move down",children:s.jsx(uO,{className:"w-4 h-4"})}),s.jsx("button",{type:"button",onClick:()=>h(y),className:"p-1 text-gray-400 hover:text-red-600",title:"Remove transform",children:s.jsx(xc,{className:"w-4 h-4"})})]})]},N.name)),r.length===0&&s.jsxs("div",{className:"text-center py-8 bg-gray-50 border-2 border-dashed border-gray-200 rounded-lg",children:[s.jsx(Ea,{className:"w-8 h-8 text-gray-400 mx-auto mb-2"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Add features to enrich your dataset"})]})]})]})}function EM({isOpen:e,onClose:t,initialDataset:n,onSave:r,constants:a}){const[l,c]=E.useState(n),[d,p]=E.useState("columns"),[m,h]=E.useState("target"),[g,x]=E.useState(!1),[j,b]=E.useState({targetColumn:l.target,dateColumn:l.date_column}),[_,N]=E.useState(null),[y,w]=E.useState(""),[C,R]=E.useState({view:"all",types:[]}),[D,T]=E.useState(n.needs_refresh||!1),F=E.useCallback(async K=>{await r(K)},[r]),{saving:z,saved:B,error:W}=SM(l,F,2e3),pe=K=>{var je,Ae,ke;return((je=K.preprocessing_steps)==null?void 0:je.training)!=null&&((ke=(Ae=K.preprocessing_steps)==null?void 0:Ae.training)==null?void 0:ke.method)!=="none"},oe=E.useMemo(()=>l.columns.filter(K=>{const je=K.name.toLowerCase().includes(y.toLowerCase()),Ae=C.types.length===0||C.types.includes(K.datatype),ke=(()=>{var Y,fe;switch(C.view){case"training":return!K.hidden&&!K.drop_if_null;case"hidden":return K.hidden;case"preprocessed":return pe(K);case"nulls":return(((fe=(Y=K.statistics)==null?void 0:Y.processed)==null?void 0:fe.null_count)||0)>0;case"computed":return K.is_computed;case"required":return K.required;default:return!0}})();return je&&Ae&&ke}),[l.columns,y,C]),we=E.useMemo(()=>({total:l.columns.length,filtered:oe.length,training:l.columns.filter(K=>!K.hidden&&!K.drop_if_null).length,hidden:l.columns.filter(K=>K.hidden).length,withPreprocessing:l.columns.filter(pe).length,withNulls:l.columns.filter(K=>{var je,Ae;return(((Ae=(je=K.statistics)==null?void 0:je.processed)==null?void 0:Ae.null_count)||0)>0}).length,computed:l.columns.filter(K=>K.is_computed===!0).length,required:l.columns.filter(K=>K.required===!0).length}),[l.columns,oe]),be=E.useMemo(()=>Array.from(new Set(l.columns.map(K=>K.datatype))),[l.columns]),J=E.useMemo(()=>l.columns.filter(K=>K.datatype==="datetime").map(K=>({value:K.name,label:K.name})),[l.columns]),ee=K=>{N(K)},le=K=>{const je=l.columns.map(Ae=>({...Ae,hidden:Ae.name===K?!Ae.hidden:Ae.hidden}));c({...l,columns:je}),T(!0)},G=K=>{const je=String(K);b({...j,targetColumn:K});const Ae=l.columns.map(ke=>({...ke,is_target:ke.name===je}));c({...l,columns:Ae}),T(!0)},re=K=>{const je=String(K);b(ke=>({...ke,dateColumn:K}));const Ae=l.columns.map(ke=>({...ke,is_date_column:ke.name===je}));c({...l,columns:Ae}),T(!0)},ne=(K,je)=>{const Ae=l.columns.map(ke=>({...ke,datatype:ke.name===K?je:ke.datatype}));c({...l,columns:Ae}),T(!0)},me=(K,je,Ae,ke)=>{if(!l.columns.find(ve=>ve.name===K))return;const fe=l.columns.map(ve=>ve.name!==K?ve:{...ve,preprocessing_steps:{training:je,...ke&&Ae?{inference:Ae}:{}}});c({...l,columns:fe}),T(!0)},Re=K=>{const Ae=(l.features||[]).filter(Y=>!K.find(fe=>fe.name===Y.name)).map(Y=>({...Y,_destroy:!0})),ke=[...K,...Ae].map((Y,fe)=>({...Y,dataset_id:l.id,feature_position:fe}));c(Y=>({...Y,features:ke})),T(!0)},gt=async()=>{x(!0);try{await r(l),Ze.post(`/easy_ml/datasets/${l.id}/refresh`,{},{onSuccess:()=>{x(!1)},onError:()=>{console.error("Error refreshing dataset"),x(!1)}})}catch(K){console.error("Error refreshing dataset:",K),x(!1)}};if(!e)return null;const tt=_?l.columns.find(K=>K.name===_):null;return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg w-full max-w-6xl max-h-[90vh] overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center p-4 border-b shrink-0",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Column Configuration"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"min-w-[0px]",children:s.jsx(jI,{saving:z,saved:B,error:W})}),s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",placeholder:"Search columns...",value:y,onChange:K=>w(K.target.value),className:"pl-9 pr-4 py-2 w-64 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700",children:s.jsx(xc,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"flex border-b shrink-0",children:[s.jsxs("button",{onClick:()=>p("columns"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${d==="columns"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(Aa,{className:"w-4 h-4"}),"Preprocessing"]}),s.jsxs("button",{onClick:()=>p("features"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${d==="features"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(OO,{className:"w-4 h-4"}),"Feature Engineering"]}),D&&s.jsx("div",{className:"ml-auto px-4 flex items-center",children:s.jsxs("button",{onClick:gt,disabled:g,className:"group relative inline-flex items-center gap-2 px-6 py-2.5 bg-gradient-to-r from-blue-600 to-indigo-600 text-white text-sm font-medium rounded-md hover:from-blue-700 hover:to-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-all duration-200 shadow-md hover:shadow-lg",children:[s.jsx("div",{className:"absolute inset-0 bg-white/10 rounded-md opacity-0 group-hover:opacity-100 transition-opacity duration-200"}),g?s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"w-4 h-4 animate-spin"}),"Applying Preprocessing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(AO,{className:"w-4 h-4"}),"Apply Preprocessing"]})]})})]}),d==="columns"?s.jsxs(er.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-7 flex-1 min-h-0",children:[s.jsxs("div",{className:"col-span-3 border-r overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b",children:[s.jsxs("div",{className:"flex border-b",children:[s.jsxs("button",{onClick:()=>h("target"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${m==="target"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(bg,{className:"w-4 h-4"}),"Target Column"]}),s.jsxs("button",{onClick:()=>h("date"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${m==="date"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(rp,{className:"w-4 h-4"}),"Date Column"]})]}),m==="target"?s.jsx("div",{className:"mt-4",children:s.jsx(Qe,{value:j.targetColumn||"",onChange:K=>G(K),options:l.columns.map(K=>({value:K.name,label:K.name})),placeholder:"Select target column..."})}):s.jsx("div",{className:"mt-4",children:J.length>0?s.jsx(Qe,{options:J,value:j.dateColumn,onChange:re,placeholder:"Select a date column..."}):s.jsx("div",{className:"text-center py-4 text-gray-500 bg-gray-50 rounded-md",children:"No date columns available"})})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(_I,{types:be,activeFilters:C,onFilterChange:R,columnStats:we,columns:l.columns,colHasPreprocessingSteps:pe})}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4 min-h-0",children:s.jsx(wI,{columns:oe,selectedColumn:_,onColumnSelect:ee,onToggleHidden:le})})]}),s.jsx("div",{className:"col-span-4 overflow-y-auto p-4",children:tt?s.jsx(bI,{column:tt,dataset:l,setColumnType:ne,setDataset:c,constants:a,onUpdate:(K,je,Ae)=>me(tt.name,K,je,Ae)}):s.jsx("div",{className:"h-full flex items-center justify-center text-gray-500",children:"Select a column to configure preprocessing"})})]}),s.jsxs("div",{className:"border-t p-4 flex justify-between items-center shrink-0",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:[l.columns.filter(K=>!K.hidden).length," columns selected for training"]}),s.jsx("div",{className:"flex gap-3",children:s.jsx("button",{onClick:t,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Close"})})]})]}):s.jsx("div",{className:"p-6 h-[calc(90vh-8rem)] overflow-y-auto",children:s.jsx(CM,{options:a.feature_options,initialFeatures:l.features,onFeaturesChange:Re})})]})})}function AM({dataset:e,constants:t}){const[n,r]=E.useState(!1),[a,l]=E.useState(e),{rootPath:c}=tr().props,d=E.useCallback(p=>{var x;const m=Object.entries(p).reduce((j,[b,_])=>(b!=="columns"&&b!=="features"&&!Xt.isEqual(a[b],_)&&(j[b]=_),j),{}),h=p.columns.reduce((j,b)=>{const _=a.columns.find(N=>N.id===b.id);if(!_||!Xt.isEqual(_,b)){const N=Object.entries(b).reduce((y,[w,C])=>((!_||!Xt.isEqual(_[w],C))&&(y[w]=C),y),{});Object.keys(N).length>0&&(j[b.id]={...N,id:b.id})}return j},{}),g=(x=p.features)==null?void 0:x.map((j,b)=>({id:j.id,name:j.name,feature_class:j.feature_class,feature_position:b,_destroy:j._destroy}));(Object.keys(m).length>0||Object.keys(h).length>0||!Xt.isEqual(a.features,p.features))&&Ze.patch(`${c}/datasets/${e.id}`,{dataset:{...m,columns_attributes:h,features_attributes:g}},{preserveState:!0,preserveScroll:!0}),l(p)},[a,e.id,c]);return s.jsxs("div",{className:"p-8 space-y-6",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50",children:[s.jsx(hc,{className:"w-4 h-4"}),"Configure Columns"]})}),s.jsx(RO,{dataset:a}),s.jsx(EM,{isOpen:n,onClose:()=>r(!1),initialDataset:a,constants:t,onSave:d})]})}const PM=Object.freeze(Object.defineProperty({__proto__:null,default:AM},Symbol.toStringTag,{value:"Module"}));function bp({icon:e,title:t,description:n,actionLabel:r,onAction:a}){return s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(e,{className:"w-8 h-8 text-gray-400"})}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:t}),s.jsx("p",{className:"text-gray-500 mb-6 max-w-sm mx-auto",children:n}),s.jsx("button",{onClick:a,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:r})]})}function p0({value:e,onChange:t,placeholder:n="Search..."}){return s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:n,className:"pl-9 pr-4 py-2 w-64 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]})}function f0({currentPage:e,totalPages:t,onPageChange:n}){return s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200",children:[s.jsxs("div",{className:"flex-1 flex justify-between sm:hidden",children:[s.jsx("button",{onClick:()=>n(e-1),disabled:e===1,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:"Previous"}),s.jsx("button",{onClick:()=>n(e+1),disabled:e===t,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:"Next"})]}),s.jsxs("div",{className:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[s.jsx("div",{children:s.jsxs("p",{className:"text-sm text-gray-700",children:["Page ",s.jsx("span",{className:"font-medium",children:e})," of"," ",s.jsx("span",{className:"font-medium",children:t})]})}),s.jsx("div",{children:s.jsxs("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination",children:[s.jsxs("button",{onClick:()=>n(e-1),disabled:e===1,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:[s.jsx("span",{className:"sr-only",children:"Previous"}),s.jsx(ip,{className:"h-5 w-5"})]}),Array.from({length:t},(r,a)=>a+1).map(r=>s.jsx("button",{onClick:()=>n(r),className:`relative inline-flex items-center px-4 py-2 border text-sm font-medium ${r===e?"z-10 bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 text-gray-500 hover:bg-gray-50"}`,children:r},r)),s.jsxs("button",{onClick:()=>n(e+1),disabled:e===t,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:[s.jsx("span",{className:"sr-only",children:"Next"}),s.jsx(_o,{className:"h-5 w-5"})]})]})})]})]})}function Lj({stacktrace:e}){return s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx("pre",{className:"text-xs text-red-700 whitespace-pre-wrap break-words [word-break:break-word] font-mono",children:e})})}const Tm={analyzing:{bg:"bg-blue-100",text:"text-blue-800",icon:s.jsx(ps,{className:"w-4 h-4 animate-spin"})},ready:{bg:"bg-green-100",text:"text-green-800",icon:null},failed:{bg:"bg-red-100",text:"text-red-800",icon:s.jsx(Xn,{className:"w-4 h-4"})}};function TM({dataset:e,rootPath:t,onDelete:n,onRefresh:r,onAbort:a,isErrorExpanded:l,onToggleError:c}){const d=er.useRef(null),p=()=>{window.location.href=`${t}/datasets/${e.id}/download`},m=h=>{var j,b;const g=(j=h.target.files)==null?void 0:j[0];if(!g)return;const x=new FormData;x.append("config",g),fetch(`${t}/datasets/${e.id}/upload`,{method:"POST",body:x,credentials:"same-origin",headers:{"X-CSRF-Token":((b=document.querySelector('meta[name="csrf-token"]'))==null?void 0:b.content)||""}}).then(_=>{_.ok?window.location.reload():console.error("Upload failed")})};return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(wn,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),s.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${Tm[e.workflow_status].bg} ${Tm[e.workflow_status].text}`,children:[Tm[e.workflow_status].icon,s.jsx("span",{children:e.workflow_status.charAt(0).toUpperCase()+e.workflow_status.slice(1)})]})]}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Zr,{href:`${t}/datasets/${e.id}`,className:`transition-colors ${e.workflow_status==="analyzing"?"text-gray-300 cursor-not-allowed pointer-events-none":"text-gray-400 hover:text-blue-600"}`,title:e.workflow_status==="analyzing"?"Dataset is being analyzed":"View details",children:s.jsx(fw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>r(e.id),disabled:e.workflow_status==="analyzing",className:`transition-colors ${e.workflow_status==="analyzing"?"text-gray-300 cursor-not-allowed":"text-gray-400 hover:text-blue-600"}`,title:e.workflow_status==="analyzing"?"Dataset is being analyzed":"Refresh dataset",children:s.jsx(bw,{className:"w-5 h-5"})}),e.workflow_status==="analyzing"&&s.jsx("button",{onClick:()=>a(e.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Abort analysis",children:s.jsx(Bl,{className:"w-5 h-5"})}),s.jsx("button",{onClick:p,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Download dataset configuration",children:s.jsx(pw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>{var h;return(h=d.current)==null?void 0:h.click()},className:"text-gray-400 hover:text-green-600 transition-colors",title:"Upload dataset configuration",children:s.jsx(gc,{className:"w-5 h-5"})}),s.jsx("input",{type:"file",ref:d,onChange:m,accept:".json",className:"hidden"}),s.jsx("button",{className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete dataset",onClick:()=>n(e.id),children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Columns"}),s.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[e.columns.length," columns"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Rows"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:e.num_rows.toLocaleString()})]})]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.columns.slice(0,3).map(h=>s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:h.name},h.name)),e.columns.length>3&&s.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:["+",e.columns.length-3," more"]})]})}),e.workflow_status==="failed"&&e.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>c(e.id),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),l?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),l&&s.jsx(Lj,{stacktrace:e.stacktrace})]})]})}function OM(){const e=E.useRef(null),{rootPath:t}=tr().props,n=r=>{var c,d;const a=(c=r.target.files)==null?void 0:c[0];if(!a)return;const l=new FormData;l.append("config",a),fetch(`${t}/datasets/upload`,{method:"POST",body:l,credentials:"same-origin",headers:{"X-CSRF-Token":((d=document.querySelector('meta[name="csrf-token"]'))==null?void 0:d.content)||""}}).then(p=>{p.ok?window.location.reload():console.error("Upload failed")})};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>{var r;return(r=e.current)==null?void 0:r.click()},className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-50",title:"Import dataset",children:[s.jsx(gc,{className:"w-4 h-4"}),"Import"]}),s.jsx("input",{type:"file",ref:e,onChange:n,accept:".json",className:"hidden"})]})}const Om=6;function RM({datasets:e}){const{rootPath:t}=tr().props,[n,r]=E.useState(""),[a,l]=E.useState(1),[c,d]=E.useState([]),p=E.useMemo(()=>e.filter(_=>_.name.toLowerCase().includes(n.toLowerCase())||_.description.toLowerCase().includes(n.toLowerCase())),[e,n]),m=Math.ceil(p.length/Om),h=p.slice((a-1)*Om,a*Om),g=_=>{confirm("Are you sure you want to delete this dataset?")&&Ze.delete(`${t}/datasets/${_}`)},x=_=>{Ze.post(`${t}/datasets/${_}/refresh`)},j=_=>{Ze.post(`${t}/datasets/${_}/abort`,{},{preserveScroll:!0,preserveState:!0})};E.useEffect(()=>{let _;return e.some(y=>y.workflow_status==="analyzing")&&(_=window.setInterval(()=>{Ze.get(window.location.href,{},{preserveScroll:!0,preserveState:!0,only:["datasets"]})},2e3)),()=>{_&&window.clearInterval(_)}},[e]);const b=_=>{d(N=>N.includes(_)?N.filter(y=>y!==_):[...N,_])};return e.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:wn,title:"Create your first dataset",description:"Create a dataset to start training your machine learning models",actionLabel:"Create Dataset",onAction:()=>{Ze.visit(`${t}/datasets/new`)}})}):s.jsx("div",{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Datasets"}),s.jsx(p0,{value:n,onChange:r,placeholder:"Search datasets..."})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(OM,{}),s.jsxs(Zr,{href:`${t}/datasets/new`,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Dataset"]})]})]}),h.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(wn,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No datasets found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No datasets match your search criteria. Try adjusting your search or create a new dataset."}),s.jsx("div",{className:"mt-6",children:s.jsxs(Zr,{href:`${t}/datasets/new`,className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Dataset"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:h.map(_=>s.jsx(TM,{dataset:_,rootPath:t,onDelete:g,onRefresh:x,onAbort:j,isErrorExpanded:c.includes(_.id),onToggleError:b},_.id))}),m>1&&s.jsx(f0,{currentPage:a,totalPages:m,onPageChange:l})]})]})})}const IM=Object.freeze(Object.defineProperty({__proto__:null,default:RM},Symbol.toStringTag,{value:"Module"})),Dj=()=>{const e=er.createContext(null);return[()=>{const t=er.useContext(e);if(t===null)throw new Error("useContext must be inside a Provider with a value");return t},e.Provider]},Kh=e=>{const t=structuredClone(e??{});for(const n in t)Xt.isPlainObject(t[n])?t[n]=Kh(t[n]):Array.isArray(t[n])?t[n]=t[n].map(r=>Kh(r)):t[n]!==void 0&&t[n]!==null||(t[n]="");return t},Fj=(e,t)=>{Object.entries(e).forEach(([n,r])=>{Xt.isPlainObject(r)?(Rb(e,n,`${n}${t}`),Fj(r,t)):Array.isArray(r)&&Rb(e,n,`${n}${t}`)})},Rb=(e,t,n)=>{t!==n&&(e[n]=e[t],delete e[t])},zj=(e,t)=>{var r;const n=t.replace(/\[\]$/,"");if(n.includes("[]")){const a=n.indexOf("[]"),l=n.slice(0,a),c=n.slice(a+2),d=Xt.get(e,l);if(Array.isArray(d))for(let p=0;p<d.length;p++)zj(e,`${l}[${p}]${c}`)}if(n.charAt(n.length-1)==="]"){const a=n.match(/(?<index>\d*)\]$/),l=Xt.get(e,n.slice(0,n.lastIndexOf("[")));Array.isArray(l)&&((r=a==null?void 0:a.groups)==null?void 0:r.index)!==void 0&&l.splice(Number(a.groups.index),1)}else Xt.unset(e,n)},Ib=e=>Array.isArray(e)?e:[e],[MM,kF]=Dj();function _c(e,t){const n=E.useCallback(()=>{let J=null,ee=e;return typeof e=="string"&&(J=e,ee=t),[J,Kh(ee)]},[e,t]),[r,a]=n(),[l,c]=E.useState(a||{}),[d,p]=r?fy(a,`${r}:data`):E.useState(a),m=E.useMemo(()=>{const J=d?Object.keys(d):[];if(J.length===1)return J[0]},[d]),[h,g]=r?fy({},`${r}:errors`):E.useState({}),[x,j]=E.useState(!1),[b,_]=E.useState(!1),[N,y]=E.useState(),[w,C]=E.useState(!1),[R,D]=E.useState(!1),T=E.useRef(null),F=E.useRef();let z=E.useRef(J=>J);const B=E.useRef();E.useEffect(()=>(B.current=!0,()=>{B.current=!1}),[]);let W=E.useRef(),pe=E.useRef();E.useEffect(()=>{W.current&&pe.current&&W.current(...pe.current)},[d]);let oe=!1;try{oe=MM().railsAttributes}catch{}const we=(J,ee,le={})=>{const G={...le,onCancelToken:ne=>{if(T.current=ne,le.onCancelToken)return le.onCancelToken(ne)},onBefore:ne=>{if(C(!1),D(!1),clearTimeout(F.current),le.onBefore)return le.onBefore(ne)},onStart:ne=>{if(_(!0),le.onStart)return le.onStart(ne)},onProgress:ne=>{if(y(ne),le.onProgress)return le.onProgress(ne)},onSuccess:ne=>{if(B.current&&(_(!1),y(null),g({}),j(!1),C(!0),D(!0),F.current=setTimeout(()=>{B.current&&D(!1)},2e3)),le.onSuccess)return le.onSuccess(ne)},onError:ne=>{if(B.current&&(_(!1),y(null),g((me=>{if(!me||!m)return me;const Re={};return Object.keys(me).forEach(gt=>{Re[`${m}.${gt}`]=me[gt]}),Re})(ne)),j(!0)),le.onError)return le.onError(ne)},onCancel:()=>{if(B.current&&(_(!1),y(null)),le.onCancel)return le.onCancel()},onFinish:ne=>{if(B.current&&(_(!1),y(null)),T.current=null,le.onFinish)return le.onFinish(ne)}};let re=z.current(structuredClone(d));oe&&(re=((ne,me="_attributes")=>{const Re=structuredClone(ne);return Object.values(Re).forEach(gt=>{Xt.isPlainObject(gt)&&Fj(gt,me)}),Re})(re)),J==="delete"?Ze.delete(ee,{...G,data:re}):Ze[J](ee,re,G)},be=J=>{if(!J)return void g({});const ee=Ib(J);g(le=>{const G=Object.keys(le).reduce((re,ne)=>({...re,...ee.length>0&&!ee.includes(String(ne))?{[ne]:le[ne]}:{}}),{});return j(Object.keys(G).length>0),G})};return{data:d,isDirty:!Xt.isEqual(d,l),errors:h,hasErrors:x,processing:b,progress:N,wasSuccessful:w,recentlySuccessful:R,transform:J=>{z.current=J},onChange:J=>{W.current=J},setData:(J,ee)=>{if(typeof J=="string")return p(le=>{const G=structuredClone(le);return W.current&&(pe.current=[J,ee,Xt.get(le,J)]),Xt.set(G,J,ee),G});J instanceof Function?p(le=>{const G=J(structuredClone(le));return W.current&&(pe.current=[void 0,G,le]),G}):(W.current&&(pe.current=[void 0,d,J]),p(J))},getData:J=>Xt.get(d,J),unsetData:J=>{p(ee=>{const le=structuredClone(ee);return W.current&&(pe.current=[J,Xt.get(ee,J),void 0]),zj(le,J),le})},setDefaults:(J,ee)=>{c(J!==void 0?le=>({...le,...typeof J=="string"?{[J]:ee}:J}):()=>d)},reset:J=>{if(!J)return W.current&&(pe.current=[void 0,l,d]),p(l),void g({});const ee=Ib(J),le=structuredClone(d);ee.forEach(G=>{Xt.set(le,G,Xt.get(l,G))}),be(J),W.current&&(pe.current=[void 0,le,d]),p(le)},setError:(J,ee)=>{g(le=>{const G={...le,...typeof J=="string"?{[J]:ee}:J};return j(Object.keys(G).length>0),G})},getError:J=>Xt.get(h,J),clearErrors:be,submit:we,get:(J,ee)=>{we("get",J,ee)},post:(J,ee)=>{we("post",J,ee)},put:(J,ee)=>{we("put",J,ee)},patch:(J,ee)=>{we("patch",J,ee)},delete:(J,ee)=>{we("delete",J,ee)},cancel:()=>{T.current&&T.current.cancel()}}}const[LM,CF]=(()=>{const e=er.createContext(null);return[()=>{const t=er.useContext(e);if(t===null)throw new Error("useContext must be inside a Provider with a value");return t},e.Provider]})();Dj();const DM=er.forwardRef(({children:e,type:t="submit",disabled:n=!1,component:r="button",requiredFields:a,...l},c)=>{const{data:d,getData:p,processing:m}=LM(),h=E.useCallback(()=>!(!a||a.length===0)&&a.some(g=>{return typeof(x=p(g))=="string"?x==="":typeof x=="number"?x!==0&&!x:Xt.isEmpty(x);var x}),[d]);return er.createElement(r,{children:e,type:t,disabled:n||m||a&&h(),ref:c,...l})});er.memo(DM);function FM({datasource:e,constants:t}){var m,h,g,x;const{rootPath:n}=tr().props,r=!!e,{data:a,setData:l,processing:c,errors:d}=_c({datasource:{name:(e==null?void 0:e.name)??"",datasource_type:(e==null?void 0:e.datasource_type)??"s3",s3_bucket:(e==null?void 0:e.s3_bucket)??"",s3_prefix:(e==null?void 0:e.s3_prefix)??"",s3_region:(e==null?void 0:e.s3_region)??"us-east-1"}}),p=j=>{j.preventDefault(),r?Ze.patch(`${n}/datasources/${e.id}`,a):Ze.post(`${n}/datasources`,a)};return s.jsx("div",{className:"max-w-2xl mx-auto py-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:r?"Edit Datasource":"New Datasource"}),s.jsxs("form",{onSubmit:p,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Name"}),s.jsx("input",{type:"text",id:"name",value:a.datasource.name,onChange:j=>l("datasource.name",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0}),((m=d.datasource)==null?void 0:m.name)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.name})]}),!r&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Type"}),s.jsx(Qe,{options:t.DATASOURCE_TYPES,value:a.datasource.datasource_type,onChange:j=>l("datasource.datasource_type",j),placeholder:"Select datasource type"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"s3_bucket",className:"block text-sm font-medium text-gray-700",children:"S3 Bucket"}),s.jsx("input",{type:"text",id:"s3_bucket",value:a.datasource.s3_bucket,onChange:j=>l("datasource.s3_bucket",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0}),((h=d.datasource)==null?void 0:h.s3_bucket)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_bucket})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"s3_prefix",className:"block text-sm font-medium text-gray-700",children:"S3 Prefix"}),s.jsx("input",{type:"text",id:"s3_prefix",value:a.datasource.s3_prefix,onChange:j=>l("datasource.s3_prefix",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",placeholder:"data/raw/"}),((g=d.datasource)==null?void 0:g.s3_prefix)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_prefix})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"S3 Region"}),s.jsx(Qe,{options:t.s3.S3_REGIONS,value:a.datasource.s3_region,onChange:j=>l("datasource.s3_region",j),placeholder:"Select s3 region"}),((x=d.datasource)==null?void 0:x.s3_region)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_region})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{type:"button",onClick:()=>Ze.visit(`${n}/datasources`),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Cancel"}),s.jsx("button",{type:"submit",disabled:c,className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:c?"Saving...":r?"Save Changes":"Create Datasource"})]})]})]})})}const zM=Object.freeze(Object.defineProperty({__proto__:null,default:FM},Symbol.toStringTag,{value:"Module"})),Rm=6;function $M({datasources:e}){const{rootPath:t}=tr().props;console.log(`rootPath: ${t}`);const[n,r]=E.useState(""),[a,l]=E.useState(1),[c,d]=E.useState([]),p=E.useMemo(()=>e.filter(N=>N.name.toLowerCase().includes(n.toLowerCase())||N.s3_bucket.toLowerCase().includes(n.toLowerCase())),[n,e]),m=Math.ceil(p.length/Rm),h=p.slice((a-1)*Rm,a*Rm),g=N=>{confirm("Are you sure you want to delete this datasource? This action cannot be undone.")&&Ze.delete(`${t}/datasources/${N}`)},x=N=>{d(y=>y.includes(N)?y.filter(w=>w!==N):[...y,N])},j=async N=>{try{Ze.post(`${t}/datasources/${N}/sync`,{},{preserveScroll:!0,preserveState:!0,onSuccess:y=>{console.log("SUCCESS")},onError:()=>{console.error("Failed to sync datasource")}})}catch(y){console.error("Failed to sync datasource:",y)}},b=async N=>{try{await Ze.post(`${t}/datasources/${N}/abort`,{},{preserveScroll:!0,preserveState:!0})}catch(y){console.error("Failed to abort datasource sync:",y)}},_=N=>{if(N==="Not Synced")return N;const y=new Date(N);return isNaN(y.getTime())?N:y.toLocaleString()};return E.useEffect(()=>{let N;return e.some(w=>w.is_syncing)&&(N=window.setInterval(()=>{Ze.get(window.location.href,{},{preserveScroll:!0,preserveState:!0,only:["datasources"]})},2e3)),()=>{N&&window.clearInterval(N)}},[e]),e.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:ls,title:"Connect your first data source",description:"Connect to your data sources to start creating datasets and training models",actionLabel:"Add Datasource",onAction:()=>{Ze.visit(`${t}/datasources/new`)}})}):s.jsx("div",{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Datasources"}),s.jsx(p0,{value:n,onChange:r,placeholder:"Search datasources..."})]}),s.jsxs(Zr,{href:`${t}/datasources/new`,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Datasource"]})]}),h.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(ls,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No datasources found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No datasources match your search criteria. Try adjusting your search or add a new datasource."}),s.jsx("div",{className:"mt-6",children:s.jsxs(Zr,{href:`${t}/datasources/new`,className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Datasource"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:h.map(N=>s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ls,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:N.name}),N.is_syncing?s.jsx(ga,{variant:"warning",children:"syncing"}):N.sync_error?s.jsx(ga,{variant:"important",children:"sync error"}):N.last_synced_at!=="Not Synced"?s.jsx(ga,{variant:"success",children:"synced"}):s.jsx(ga,{variant:"warning",children:"not synced"})]}),s.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["s3://",N.s3_bucket,"/",N.s3_prefix]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>j(N.id),disabled:N.is_syncing,className:`text-gray-400 hover:text-blue-600 transition-colors ${N.is_syncing?"animate-spin":""}`,title:"Sync datasource",children:s.jsx(bw,{className:"w-5 h-5"})}),N.is_syncing&&s.jsx("button",{onClick:()=>b(N.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Abort sync",children:s.jsx(Bl,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${t}/datasources/${N.id}/edit`,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Edit datasource",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>g(N.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete datasource",children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Region"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:N.s3_region})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Last Sync"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:_(N.last_synced_at)})]})]}),N.sync_error&&N.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>x(N.id),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),c.includes(N.id)?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),c.includes(N.id)&&s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx("pre",{className:"text-xs text-red-700 whitespace-pre-wrap font-mono",children:N.stacktrace})})]})]},N.id))}),m>1&&s.jsx(f0,{currentPage:a,totalPages:m,onPageChange:l})]})]})})}const UM=Object.freeze(Object.defineProperty({__proto__:null,default:$M},Symbol.toStringTag,{value:"Module"}));function BM({isOpen:e,onClose:t,onSave:n,initialData:r,metrics:a,tunerJobConstants:l,timezone:c,retrainingJobConstants:d}){var D,T,F,z,B,W,pe,oe,we,be,J,ee,le,G,re,ne,me,Re,gt,tt,K,je,Ae,ke;const[p,m]=E.useState(!1);E.useState(null);const h=Object.entries(l).filter(([Y,fe])=>Array.isArray(fe.options)).reduce((Y,[fe,ve])=>({...Y,[fe]:ve.options[0].value}),{}),g=h.booster,x=Object.entries(l.hyperparameters[g]||{}).filter(([Y,fe])=>!Array.isArray(fe.options)).reduce((Y,[fe,ve])=>({...Y,[fe]:{min:ve.min,max:ve.max}}),{}),[j,b]=E.useState({retraining_job_attributes:{id:((D=r.retraining_job)==null?void 0:D.id)||null,active:((T=r.retraining_job)==null?void 0:T.active)??!1,frequency:((F=r.retraining_job)==null?void 0:F.frequency)||d.frequency[0].value,tuning_frequency:((z=r.retraining_job)==null?void 0:z.tuning_frequency)||"month",direction:((B=r.retraining_job)==null?void 0:B.direction)||"maximize",batch_mode:((W=r.retraining_job)==null?void 0:W.batch_mode)||!1,batch_size:((pe=r.retraining_job)==null?void 0:pe.batch_size)||100,batch_overlap:((oe=r.retraining_job)==null?void 0:oe.batch_overlap)||1,batch_key:((we=r.retraining_job)==null?void 0:we.batch_key)||"",at:{hour:((J=(be=r.retraining_job)==null?void 0:be.at)==null?void 0:J.hour)??2,day_of_week:((le=(ee=r.retraining_job)==null?void 0:ee.at)==null?void 0:le.day_of_week)??1,day_of_month:((re=(G=r.retraining_job)==null?void 0:G.at)==null?void 0:re.day_of_month)??1},metric:((ne=r.retraining_job)==null?void 0:ne.metric)||(((Re=(me=a[r.task])==null?void 0:me[0])==null?void 0:Re.value)??""),threshold:((gt=r.retraining_job)==null?void 0:gt.threshold)??(r.task==="classification"?.85:.1),tuner_config:(tt=r.retraining_job)!=null&&tt.tuner_config?{n_trials:r.retraining_job.tuner_config.n_trials||10,config:{...h,...x,...r.retraining_job.tuner_config.config}}:void 0,tuning_enabled:((K=r.retraining_job)==null?void 0:K.tuning_enabled)??!1}});if(E.useEffect(()=>{j.retraining_job_attributes.tuner_config&&Object.keys(j.retraining_job_attributes.tuner_config.config).length===0&&b(Y=>({...Y,retraining_job_attributes:{...Y.retraining_job_attributes,tuner_config:{...Y.retraining_job_attributes.tuner_config,config:{...h,...x}}}}))},[j.retraining_job_attributes.tuner_config]),!e)return null;const _=(Y,fe)=>{b(ve=>({...ve,retraining_job_attributes:{...ve.retraining_job_attributes,tuner_config:{...ve.retraining_job_attributes.tuner_config,config:{...ve.retraining_job_attributes.tuner_config.config,[Y]:fe}}}}))},N=()=>{const Y=Object.entries(l).filter(([ve,Ve])=>Array.isArray(Ve.options)),fe=Y.map(([ve])=>ve);return s.jsxs("div",{className:"space-y-4",children:[Y.map(([ve,Ve])=>{var pn;return s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:Ve.label}),s.jsx(Qe,{options:Ve.options.map(Ye=>({value:Ye.value,label:Ye.label,description:Ye.description})),value:((pn=j.retraining_job_attributes.tuner_config)==null?void 0:pn.config[ve])||Ve.options[0].value,onChange:Ye=>_(ve,Ye)})]},ve)}),fe.map(ve=>{var Ye;const Ve=Object.entries(l).filter(([Sn,nr])=>nr.depends_on===ve),pn=((Ye=j.retraining_job_attributes.tuner_config)==null?void 0:Ye.config[ve])||l[ve].options[0].value;return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Parameter Ranges"}),s.jsx("div",{className:"space-y-4 max-h-[400px] overflow-y-auto pr-2",children:Ve.map(([Sn,nr])=>{const jt=nr[pn];return jt?Object.entries(jt).map(([on,St])=>{var Zt,Lt,Nn,Fn;return St.min!==void 0&&St.max!==void 0?s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium text-gray-900",children:St.label}),s.jsx("span",{className:"text-xs text-gray-500",children:St.description})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Minimum"}),s.jsx("input",{type:"number",min:St.min,max:St.max,step:St.step,value:((Lt=(Zt=j.retraining_job_attributes.tuner_config)==null?void 0:Zt.config[on])==null?void 0:Lt.min)??St.min,onChange:ie=>y(on,"min",parseFloat(ie.target.value)),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Maximum"}),s.jsx("input",{type:"number",min:St.min,max:St.max,step:St.step,value:((Fn=(Nn=j.retraining_job_attributes.tuner_config)==null?void 0:Nn.config[on])==null?void 0:Fn.max)??St.max,onChange:ie=>y(on,"max",parseFloat(ie.target.value)),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})]},on):null}):null})})]},ve)})]})},y=(Y,fe,ve)=>{b(Ve=>({...Ve,retraining_job_attributes:{...Ve.retraining_job_attributes,tuner_config:{...Ve.retraining_job_attributes.tuner_config,config:{...Ve.retraining_job_attributes.tuner_config.config,[Y]:{...Ve.retraining_job_attributes.tuner_config.config[Y],[fe]:ve}}}}}))},w=(Y,fe)=>{b(ve=>Y==="hour"||Y==="day_of_week"||Y==="day_of_month"?{...ve,retraining_job_attributes:{...ve.retraining_job_attributes,at:{...ve.retraining_job_attributes.at,[Y]:fe}}}:{...ve,retraining_job_attributes:{...ve.retraining_job_attributes,[Y]:fe}})},C=(Y,fe)=>{b(ve=>({...ve,retraining_job_attributes:{...ve.retraining_job_attributes,[Y]:fe}}))},R=()=>{const{retraining_job_attributes:Y}=j,fe={hour:Y.at.hour};switch(Y.frequency){case"day":break;case"week":fe.day_of_week=Y.at.day_of_week;break;case"month":fe.day_of_month=Y.at.day_of_month;break}const ve={retraining_job_attributes:{...Y,at:fe}};n(ve),t()};return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center pt-[5vh] z-50",children:s.jsxs("div",{className:"bg-white rounded-lg w-full max-w-6xl flex flex-col",style:{maxHeight:"90vh"},children:[s.jsxs("div",{className:"flex-none flex justify-between items-center p-4 border-b",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Training Configuration"}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700",children:s.jsx(xc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"flex-1 p-6 grid grid-cols-2 gap-8 overflow-y-auto",children:[s.jsx("div",{className:"space-y-8",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Training Schedule"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"scheduleEnabled",checked:j.retraining_job_attributes.active,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,active:Y.target.checked}})),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"scheduleEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable scheduled training"})]})]}),!j.retraining_job_attributes.active&&s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Xn,{className:"w-5 h-5 text-gray-400 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Manual Training Mode"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"The model will only be trained when you manually trigger training. You can do this from the model details page at any time."})]})]})}),j.retraining_job_attributes.active&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"space-y-6",children:s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Frequency"}),s.jsx(Qe,{options:d.frequency.map(Y=>({value:Y.value,label:Y.label,description:Y.description})),value:j.retraining_job_attributes.frequency,onChange:Y=>w("frequency",Y)})]}),j.retraining_job_attributes.frequency==="week"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Day of Week"}),s.jsx(Qe,{options:[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],value:j.retraining_job_attributes.at.day_of_week,onChange:Y=>w("day_of_week",Y)})]}),j.retraining_job_attributes.frequency==="month"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Day of Month"}),s.jsx(Qe,{options:Array.from({length:31},(Y,fe)=>({value:fe+1,label:`Day ${fe+1}`})),value:j.retraining_job_attributes.at.day_of_month,onChange:Y=>w("day_of_month",Y)})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Hour (",c,")"]}),s.jsx(Qe,{options:Array.from({length:24},(Y,fe)=>({value:fe,label:`${fe}:00`})),value:j.retraining_job_attributes.at.hour,onChange:Y=>w("hour",Y)})]})]})})}),s.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("label",{htmlFor:"batchTrainingEnabled",className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:["Enable Batch Training",s.jsx("button",{type:"button",onClick:()=>m(!p),className:"text-gray-400 hover:text-gray-600",children:s.jsx(vw,{className:"w-4 h-4"})})]})}),s.jsx("input",{type:"checkbox",id:"batchMode",checked:j.retraining_job_attributes.batch_mode,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_mode:Y.target.checked}}),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"})]}),p&&s.jsx("div",{className:"bg-blue-50 rounded-lg p-4 text-sm text-blue-700",children:s.jsxs("ul",{className:"space-y-2",children:[s.jsx("li",{children:"• When disabled, the model will train on the entire dataset in a single pass."}),s.jsx("li",{children:"• When enabled, the model will learn from small batches of data iteratively, improving training speed"})]})}),j.retraining_job_attributes.batch_mode&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Size"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.batch_size,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_size:parseInt(Y.target.value)}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Overlap"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.batch_overlap,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_overlap:parseInt(Y.target.value)}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"})]})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Key"}),s.jsx(Qe,{value:j.retraining_job_attributes.batch_key,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_key:Y}}),options:((Ae=(je=r.dataset)==null?void 0:je.columns)==null?void 0:Ae.map(Y=>({value:Y.name,label:Y.name})))||[],placeholder:"Select a column for batch key"})]})]})]}),s.jsxs("div",{className:"border-t border-gray-200 pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(Xn,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Evaluator Configuration"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Metric"}),s.jsx(Qe,{options:a[r.task].map(Y=>({value:Y.value,label:Y.label,description:Y.description})),value:j.retraining_job_attributes.metric,onChange:Y=>C("metric",Y)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Threshold"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.threshold,onChange:Y=>C("threshold",parseFloat(Y.target.value)),step:.01,className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]})]}),s.jsx("div",{className:"bg-blue-50 rounded-md p-4",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx(Xn,{className:"w-5 h-5 text-blue-400 mt-0.5"}),s.jsxs("div",{className:"ml-3",children:[s.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"Deployment Criteria"}),s.jsx("p",{className:"mt-2 text-sm text-blue-700",children:(()=>{const Y=a[r.task].find(ve=>ve.value===j.retraining_job_attributes.metric),fe=(Y==null?void 0:Y.direction)==="minimize"?"below":"above";return`The model will be automatically deployed when the ${Y==null?void 0:Y.label} is ${fe} ${j.retraining_job_attributes.threshold}.`})()})]})]})})]})]})]})}),s.jsx("div",{className:"space-y-8",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Hyperparameter Tuning"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"tuningEnabled",checked:j.retraining_job_attributes.tuning_enabled||!1,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuning_enabled:Y.target.checked,tuner_config:Y.target.checked?{n_trials:10,config:x}:void 0}})),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"tuningEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable tuning"})]})]}),j.retraining_job_attributes.tuning_enabled&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Frequency"}),s.jsx(Qe,{options:[{value:"always",label:"Always",description:"Tune hyperparameters every time"},{value:"week",label:"Weekly",description:"Tune hyperparameters once every week"},{value:"month",label:"Monthly",description:"Tune hyperparameters once every month"}],value:j.retraining_job_attributes.tuning_frequency||"week",onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuning_frequency:Y}}))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Number of Trials"}),s.jsx("input",{type:"number",min:"1",max:"1000",value:((ke=j.retraining_job_attributes.tuner_config)==null?void 0:ke.n_trials)||10,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuner_config:{...fe.retraining_job_attributes.tuner_config,n_trials:parseInt(Y.target.value)}}})),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]})]}),N()]})]})})]}),s.jsxs("div",{className:"flex-none flex justify-end gap-4 p-4 border-t bg-white",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-500",children:"Cancel"}),s.jsx("button",{onClick:R,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md",children:"Save Changes"})]})]})})}const ca=({error:e})=>e?s.jsxs("div",{className:"mt-1 flex items-center gap-1 text-sm text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),e]}):null;function $j({initialData:e,datasets:t,constants:n,isEditing:r,errors:a}){var W,pe,oe,we,be,J;const{rootPath:l}=tr().props,[c,d]=E.useState(!1),[p,m]=E.useState(!1),h=_c({model:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",model_type:(e==null?void 0:e.model_type)||"xgboost",dataset_id:(e==null?void 0:e.dataset_id)||"",task:(e==null?void 0:e.task)||"classification",objective:(e==null?void 0:e.objective)||"binary:logistic",metrics:(e==null?void 0:e.metrics)||["accuracy_score"],weights_column:(e==null?void 0:e.weights_column)||"",retraining_job_attributes:e!=null&&e.retraining_job?{id:e.retraining_job.id,frequency:e.retraining_job.frequency,tuning_frequency:e.retraining_job.tuning_frequency||"month",batch_mode:e.retraining_job.batch_mode,batch_size:e.retraining_job.batch_size,batch_overlap:e.retraining_job.batch_overlap,batch_key:e.retraining_job.batch_key,at:{hour:((W=e.retraining_job.at)==null?void 0:W.hour)??2,day_of_week:((pe=e.retraining_job.at)==null?void 0:pe.day_of_week)??1,day_of_month:((oe=e.retraining_job.at)==null?void 0:oe.day_of_month)??1},active:e.retraining_job.active,metric:e.retraining_job.metric,threshold:e.retraining_job.threshold,tuner_config:e.retraining_job.tuner_config,tuning_enabled:e.retraining_job.tuning_enabled||!1}:void 0}}),{data:g,setData:x,post:j,patch:b,processing:_,errors:N}=h,y={...a,...N},w=((we=n.objectives[g.model.model_type])==null?void 0:we[g.model.task])||[];E.useEffect(()=>{p&&(R(),m(!1))},[p]);const C=ee=>{x({...g,model:{...g.model,retraining_job_attributes:ee.retraining_job_attributes}}),m(!0)},R=()=>{if(g.model.retraining_job_attributes){const ee={hour:g.model.retraining_job_attributes.at.hour};switch(g.model.retraining_job_attributes.frequency){case"day":break;case"week":ee.day_of_week=g.model.retraining_job_attributes.at.day_of_week;break;case"month":ee.day_of_month=g.model.retraining_job_attributes.at.day_of_month;break}x("model.retraining_job_attributes.at",ee)}g.model.id?b(`${l}/models/${g.model.id}`,{onSuccess:()=>{Ze.visit(`${l}/models`)}}):j(`${l}/models`,{onSuccess:()=>{Ze.visit(`${l}/models`)}})},D=ee=>{ee.preventDefault(),R()},T=t.find(ee=>ee.id===g.model.dataset_id),F=(T==null?void 0:T.columns)||[],z=n.tuner_job_constants[g.model.model_type]||{},B=ee=>{x("model.task",ee),x("model.metrics",[]),x("model.objective",ee==="classification"?"binary:logistic":"reg:squarederror")};return s.jsxs("form",{onSubmit:D,className:"space-y-8",children:[s.jsxs("div",{className:"flex justify-between items-center border-b pb-4",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Model Configuration"}),s.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(TO,{className:"w-4 h-4"}),"Configure Training"]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Model Name"}),s.jsx("input",{type:"text",id:"name",value:g.model.name,onChange:ee=>x("model.name",ee.target.value),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"}),s.jsx(ca,{error:y.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model Type"}),s.jsx(Qe,{options:[{value:"xgboost",label:"XGBoost",description:"Gradient boosting framework"}],value:g.model.model_type,onChange:ee=>x("model.model_type",ee),placeholder:"Select model type"}),s.jsx(ca,{error:y.model_type})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Dataset"}),r?s.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-50 rounded-md border border-gray-200",children:[s.jsx(SO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-gray-700",children:T==null?void 0:T.name})]}):s.jsx(Qe,{options:t.map(ee=>({value:ee.id,label:ee.name,description:`${ee.num_rows.toLocaleString()} rows`})),value:g.model.dataset_id,onChange:ee=>x("model.dataset_id",ee),placeholder:"Select dataset"}),s.jsx(ca,{error:y.dataset_id})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Weights Column (Optional)"}),s.jsx(Qe,{value:g.model.weights_column,options:F.map(ee=>({value:ee.name,label:ee.name})),onChange:ee=>x("model.weights_column",ee),isClearable:!0}),s.jsx(ca,{error:y.weights_column})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Task"}),s.jsx(Qe,{options:n.tasks,value:g.model.task,onChange:B}),s.jsx(ca,{error:y.task})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Objective"}),s.jsx(Qe,{options:w||[],value:g.model.objective,onChange:ee=>x("model.objective",ee),placeholder:"Select objective"}),s.jsx(ca,{error:y.objective})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Metrics"}),s.jsx("div",{className:"grid grid-cols-2 gap-4",children:(be=n.metrics[g.model.task])==null?void 0:be.map(ee=>s.jsxs("label",{className:"relative flex items-center px-4 py-3 bg-white border rounded-lg hover:bg-gray-50 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:g.model.metrics.includes(ee.value),onChange:le=>{const G=le.target.checked?[...g.model.metrics,ee.value]:g.model.metrics.filter(re=>re!==ee.value);x("model.metrics",G)},className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),s.jsxs("div",{className:"ml-3",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-900",children:ee.label}),s.jsxs("span",{className:"block text-xs text-gray-500",children:["Direction: ",ee.direction]})]})]},ee.value))}),s.jsx(ca,{error:y.metrics})]})]}),g.model.retraining_job_attributes&&g.model.retraining_job_attributes.batch_mode&&s.jsx(s.Fragment,{children:s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Key"}),s.jsx(Qe,{value:g.model.retraining_job_attributes.batch_key||"",onChange:ee=>x("model",{...g.model,retraining_job_attributes:{...g.model.retraining_job_attributes,batch_key:ee}}),options:((J=T==null?void 0:T.columns)==null?void 0:J.map(ee=>({value:ee.name,label:ee.name})))||[],placeholder:"Select a column for batch key"}),s.jsx(ca,{error:y["model.retraining_job_attributes.batch_key"]})]})}),s.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[s.jsx("button",{type:"button",onClick:()=>Ze.visit(`${l}/models`),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Cancel"}),s.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:r?"Save Changes":"Create Model"})]}),s.jsx(BM,{isOpen:c,onClose:()=>d(!1),onSave:C,initialData:{task:g.model.task,metrics:g.model.metrics,modelType:g.model.model_type,dataset:T,retraining_job:g.model.retraining_job_attributes},metrics:n.metrics,tunerJobConstants:z,timezone:n.timezone,retrainingJobConstants:n.retraining_job_constants})]})}function WM({model:e,datasets:t,constants:n}){return s.jsx("div",{className:"max-w-3xl mx-auto py-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(yi,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Edit Model"})]})}),s.jsx("div",{className:"p-6",children:s.jsx($j,{initialData:e,datasets:t,constants:n,isEditing:!0})})]})})}const HM=Object.freeze(Object.defineProperty({__proto__:null,default:WM},Symbol.toStringTag,{value:"Module"})),mt=e=>{const t=new Date;return t.setDate(t.getDate()-e),t.toISOString()},Uj=[{id:1,name:"Customer Churn Dataset",description:"Historical customer data for churn prediction",columns:[{name:"usage_days",type:"numeric",description:"Number of days customer has used the product",statistics:{mean:145.7,median:130,min:1,max:365,nullCount:0}},{name:"total_spend",type:"numeric",description:"Total customer spend in USD",statistics:{mean:487.32,median:425.5,min:0,max:2500,nullCount:1250}},{name:"support_tickets",type:"numeric",description:"Number of support tickets opened",statistics:{mean:2.3,median:1,min:0,max:15,nullCount:3750}},{name:"subscription_tier",type:"categorical",description:"Customer subscription level",statistics:{uniqueCount:3,nullCount:125}},{name:"last_login",type:"datetime",description:"Last time the customer logged in",statistics:{nullCount:5e3}}],sampleData:[{usage_days:234,total_spend:567.89,support_tickets:1,subscription_tier:"premium",last_login:"2024-03-01"},{usage_days:45,total_spend:null,support_tickets:null,subscription_tier:"basic",last_login:null}],rowCount:25e3,updatedAt:"2024-03-10T12:00:00Z"}];mt(30),mt(0);mt(7),mt(1),mt(30),mt(0);mt(1),mt(1),mt(1),mt(1),mt(2),mt(2),mt(2),mt(2),mt(3),mt(3),mt(3),mt(3),mt(4),mt(4),mt(4),mt(4);const qM=[{id:1,name:"Normalize state",description:"Turn state names into 2 letter state abbreviations",groupId:1,testDatasetId:1,inputColumns:["state"],outputColumns:["state"],code:"",createdAt:mt(30),updatedAt:mt(0)}],is=[{id:1,name:"Customer Churn",description:"Features for customer churn dataset",features:qM,createdAt:mt(30),updatedAt:mt(0)}];function VM({value:e,onChange:t,language:n}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-gray-900 rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-800",children:[s.jsx("span",{className:"text-sm text-gray-400",children:"Ruby Feature"}),s.jsx("span",{className:"text-xs px-2 py-1 bg-gray-700 rounded text-gray-300",children:n})]}),s.jsx("textarea",{value:e,onChange:r=>t(r.target.value),className:"w-full h-64 p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none",placeholder:`def transform(df)
|
500
|
+
end`})})]})})}function CM({options:e,initialFeatures:t=[],onFeaturesChange:n}){const[r,a]=E.useState(t),[l,c]=E.useState(null);console.log(r);const d=e.filter(N=>!r.find(y=>y.name===N.name)),p=N=>{const y=N.map((w,C)=>({...w,feature_position:C}));a(y),n(y)},m=N=>{const y=e.find(w=>w.name===N);if(y){const w={...y,feature_position:r.length};p([...r,w])}},h=N=>{const y=[...r];y.splice(N,1),p(y)},g=N=>{if(N===0)return;const y=[...r];[y[N-1],y[N]]=[y[N],y[N-1]],p(y)},x=N=>{if(N===r.length-1)return;const y=[...r];[y[N],y[N+1]]=[y[N+1],y[N]],p(y)},j=(N,y)=>{c(y)},b=(N,y)=>{if(N.preventDefault(),l===null||l===y)return;const w=[...r],[C]=w.splice(l,1);w.splice(y,0,C),p(w),c(y)},_=()=>{c(null)};return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"flex-1",children:s.jsx(Ke,{options:d.map(N=>({value:N.name,label:N.name,description:N.description})),value:"",onChange:N=>m(N),placeholder:"Add a transform..."})}),s.jsx(kM,{})]}),s.jsxs("div",{className:"space-y-2",children:[r.map((N,y)=>s.jsxs("div",{draggable:!0,onDragStart:w=>j(w,y),onDragOver:w=>b(w,y),onDragEnd:_,className:`flex items-center gap-3 p-3 bg-white border rounded-lg ${l===y?"border-blue-500 shadow-lg":"border-gray-200"} ${l!==null?"cursor-grabbing":""}`,children:[s.jsx("button",{type:"button",className:"p-1 text-gray-400 hover:text-gray-600 cursor-grab active:cursor-grabbing",children:s.jsx(jO,{className:"w-4 h-4"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"font-medium text-gray-900",children:N.name}),s.jsx("span",{className:`text-xs px-2 py-0.5 rounded-full ${N.feature_type==="calculation"?"bg-blue-100 text-blue-800":N.feature_type==="lookup"?"bg-purple-100 text-purple-800":"bg-green-100 text-green-800"}`,children:"feature"})]}),s.jsx("p",{className:"text-sm text-gray-500 truncate",children:N.description})]}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx("button",{type:"button",onClick:()=>g(y),disabled:y===0,className:"p-1 text-gray-400 hover:text-gray-600 disabled:opacity-50",title:"Move up",children:s.jsx(dO,{className:"w-4 h-4"})}),s.jsx("button",{type:"button",onClick:()=>x(y),disabled:y===r.length-1,className:"p-1 text-gray-400 hover:text-gray-600 disabled:opacity-50",title:"Move down",children:s.jsx(uO,{className:"w-4 h-4"})}),s.jsx("button",{type:"button",onClick:()=>h(y),className:"p-1 text-gray-400 hover:text-red-600",title:"Remove transform",children:s.jsx(xc,{className:"w-4 h-4"})})]})]},N.name)),r.length===0&&s.jsxs("div",{className:"text-center py-8 bg-gray-50 border-2 border-dashed border-gray-200 rounded-lg",children:[s.jsx(Ea,{className:"w-8 h-8 text-gray-400 mx-auto mb-2"}),s.jsx("p",{className:"text-sm text-gray-500",children:"Add features to enrich your dataset"})]})]})]})}function EM({isOpen:e,onClose:t,initialDataset:n,onSave:r,constants:a}){const[l,c]=E.useState(n),[d,p]=E.useState("columns"),[m,h]=E.useState("target"),[g,x]=E.useState(!1),[j,b]=E.useState({targetColumn:l.target,dateColumn:l.date_column}),[_,N]=E.useState(null),[y,w]=E.useState(""),[C,R]=E.useState({view:"all",types:[]}),[D,T]=E.useState(n.needs_refresh||!1),F=E.useCallback(async K=>{await r(K)},[r]),{saving:z,saved:B,error:W}=SM(l,F,2e3),pe=K=>{var je,Ae,ke;return((je=K.preprocessing_steps)==null?void 0:je.training)!=null&&((ke=(Ae=K.preprocessing_steps)==null?void 0:Ae.training)==null?void 0:ke.method)!=="none"},oe=E.useMemo(()=>l.columns.filter(K=>{const je=K.name.toLowerCase().includes(y.toLowerCase()),Ae=C.types.length===0||C.types.includes(K.datatype),ke=(()=>{var Y,fe;switch(C.view){case"training":return!K.hidden&&!K.drop_if_null;case"hidden":return K.hidden;case"preprocessed":return pe(K);case"nulls":return(((fe=(Y=K.statistics)==null?void 0:Y.processed)==null?void 0:fe.null_count)||0)>0;case"computed":return K.is_computed;case"required":return K.required;default:return!0}})();return je&&Ae&&ke}),[l.columns,y,C]),we=E.useMemo(()=>({total:l.columns.length,filtered:oe.length,training:l.columns.filter(K=>!K.hidden&&!K.drop_if_null).length,hidden:l.columns.filter(K=>K.hidden).length,withPreprocessing:l.columns.filter(pe).length,withNulls:l.columns.filter(K=>{var je,Ae;return(((Ae=(je=K.statistics)==null?void 0:je.processed)==null?void 0:Ae.null_count)||0)>0}).length,computed:l.columns.filter(K=>K.is_computed===!0).length,required:l.columns.filter(K=>K.required===!0).length}),[l.columns,oe]),be=E.useMemo(()=>Array.from(new Set(l.columns.map(K=>K.datatype))),[l.columns]),J=E.useMemo(()=>l.columns.filter(K=>K.datatype==="datetime").map(K=>({value:K.name,label:K.name})),[l.columns]),ee=K=>{N(K)},le=K=>{const je=l.columns.map(Ae=>({...Ae,hidden:Ae.name===K?!Ae.hidden:Ae.hidden}));c({...l,columns:je}),T(!0)},G=K=>{const je=String(K);b({...j,targetColumn:K});const Ae=l.columns.map(ke=>({...ke,is_target:ke.name===je}));c({...l,columns:Ae}),T(!0)},re=K=>{const je=String(K);b(ke=>({...ke,dateColumn:K}));const Ae=l.columns.map(ke=>({...ke,is_date_column:ke.name===je}));c({...l,columns:Ae}),T(!0)},ne=(K,je)=>{const Ae=l.columns.map(ke=>({...ke,datatype:ke.name===K?je:ke.datatype}));c({...l,columns:Ae}),T(!0)},me=(K,je,Ae,ke)=>{if(!l.columns.find(ve=>ve.name===K))return;const fe=l.columns.map(ve=>ve.name!==K?ve:{...ve,preprocessing_steps:{training:je,...ke&&Ae?{inference:Ae}:{}}});c({...l,columns:fe}),T(!0)},Re=K=>{const Ae=(l.features||[]).filter(Y=>!K.find(fe=>fe.name===Y.name)).map(Y=>({...Y,_destroy:!0})),ke=[...K,...Ae].map((Y,fe)=>({...Y,dataset_id:l.id,feature_position:fe}));c(Y=>({...Y,features:ke})),T(!0)},gt=async()=>{x(!0);try{await r(l),Ze.post(`/easy_ml/datasets/${l.id}/refresh`,{},{onSuccess:()=>{x(!1)},onError:()=>{console.error("Error refreshing dataset"),x(!1)}})}catch(K){console.error("Error refreshing dataset:",K),x(!1)}};if(!e)return null;const tt=_?l.columns.find(K=>K.name===_):null;return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-lg w-full max-w-6xl max-h-[90vh] overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"flex justify-between items-center p-4 border-b shrink-0",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Column Configuration"}),s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"min-w-[0px]",children:s.jsx(jI,{saving:z,saved:B,error:W})}),s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",placeholder:"Search columns...",value:y,onChange:K=>w(K.target.value),className:"pl-9 pr-4 py-2 w-64 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700",children:s.jsx(xc,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"flex border-b shrink-0",children:[s.jsxs("button",{onClick:()=>p("columns"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${d==="columns"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(Aa,{className:"w-4 h-4"}),"Preprocessing"]}),s.jsxs("button",{onClick:()=>p("features"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${d==="features"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(OO,{className:"w-4 h-4"}),"Feature Engineering"]}),D&&s.jsx("div",{className:"ml-auto px-4 flex items-center",children:s.jsxs("button",{onClick:gt,disabled:g,className:"group relative inline-flex items-center gap-2 px-6 py-2.5 bg-gradient-to-r from-blue-600 to-indigo-600 text-white text-sm font-medium rounded-md hover:from-blue-700 hover:to-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:opacity-50 transition-all duration-200 shadow-md hover:shadow-lg",children:[s.jsx("div",{className:"absolute inset-0 bg-white/10 rounded-md opacity-0 group-hover:opacity-100 transition-opacity duration-200"}),g?s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"w-4 h-4 animate-spin"}),"Applying Preprocessing..."]}):s.jsxs(s.Fragment,{children:[s.jsx(AO,{className:"w-4 h-4"}),"Apply Preprocessing"]})]})})]}),d==="columns"?s.jsxs(er.Fragment,{children:[s.jsxs("div",{className:"grid grid-cols-7 flex-1 min-h-0",children:[s.jsxs("div",{className:"col-span-3 border-r overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"p-4 border-b",children:[s.jsxs("div",{className:"flex border-b",children:[s.jsxs("button",{onClick:()=>h("target"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${m==="target"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(bg,{className:"w-4 h-4"}),"Target Column"]}),s.jsxs("button",{onClick:()=>h("date"),className:`flex items-center gap-2 px-4 py-2 border-b-2 ${m==="date"?"border-blue-500 text-blue-600":"border-transparent text-gray-500 hover:text-gray-700"}`,children:[s.jsx(rp,{className:"w-4 h-4"}),"Date Column"]})]}),m==="target"?s.jsx("div",{className:"mt-4",children:s.jsx(Ke,{value:j.targetColumn||"",onChange:K=>G(K),options:l.columns.map(K=>({value:K.name,label:K.name})),placeholder:"Select target column..."})}):s.jsx("div",{className:"mt-4",children:J.length>0?s.jsx(Ke,{options:J,value:j.dateColumn,onChange:re,placeholder:"Select a date column..."}):s.jsx("div",{className:"text-center py-4 text-gray-500 bg-gray-50 rounded-md",children:"No date columns available"})})]}),s.jsx("div",{className:"shrink-0",children:s.jsx(_I,{types:be,activeFilters:C,onFilterChange:R,columnStats:we,columns:l.columns,colHasPreprocessingSteps:pe})}),s.jsx("div",{className:"flex-1 overflow-y-auto p-4 min-h-0",children:s.jsx(wI,{columns:oe,selectedColumn:_,onColumnSelect:ee,onToggleHidden:le})})]}),s.jsx("div",{className:"col-span-4 overflow-y-auto p-4",children:tt?s.jsx(bI,{column:tt,dataset:l,setColumnType:ne,setDataset:c,constants:a,onUpdate:(K,je,Ae)=>me(tt.name,K,je,Ae)}):s.jsx("div",{className:"h-full flex items-center justify-center text-gray-500",children:"Select a column to configure preprocessing"})})]}),s.jsxs("div",{className:"border-t p-4 flex justify-between items-center shrink-0",children:[s.jsxs("div",{className:"text-sm text-gray-600",children:[l.columns.filter(K=>!K.hidden).length," columns selected for training"]}),s.jsx("div",{className:"flex gap-3",children:s.jsx("button",{onClick:t,className:"px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700",children:"Close"})})]})]}):s.jsx("div",{className:"p-6 h-[calc(90vh-8rem)] overflow-y-auto",children:s.jsx(CM,{options:a.feature_options,initialFeatures:l.features,onFeaturesChange:Re})})]})})}function AM({dataset:e,constants:t}){const[n,r]=E.useState(!1),[a,l]=E.useState(e),{rootPath:c}=tr().props,d=E.useCallback(p=>{var x;const m=Object.entries(p).reduce((j,[b,_])=>(b!=="columns"&&b!=="features"&&!Xt.isEqual(a[b],_)&&(j[b]=_),j),{}),h=p.columns.reduce((j,b)=>{const _=a.columns.find(N=>N.id===b.id);if(!_||!Xt.isEqual(_,b)){const N=Object.entries(b).reduce((y,[w,C])=>((!_||!Xt.isEqual(_[w],C))&&(y[w]=C),y),{});Object.keys(N).length>0&&(j[b.id]={...N,id:b.id})}return j},{}),g=(x=p.features)==null?void 0:x.map((j,b)=>({id:j.id,name:j.name,feature_class:j.feature_class,feature_position:b,_destroy:j._destroy}));(Object.keys(m).length>0||Object.keys(h).length>0||!Xt.isEqual(a.features,p.features))&&Ze.patch(`${c}/datasets/${e.id}`,{dataset:{...m,columns_attributes:h,features_attributes:g}},{preserveState:!0,preserveScroll:!0}),l(p)},[a,e.id,c]);return s.jsxs("div",{className:"p-8 space-y-6",children:[s.jsx("div",{className:"flex justify-end",children:s.jsxs("button",{onClick:()=>r(!0),className:"flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 rounded-md text-sm font-medium text-gray-700 hover:bg-gray-50",children:[s.jsx(hc,{className:"w-4 h-4"}),"Configure Columns"]})}),s.jsx(RO,{dataset:a}),s.jsx(EM,{isOpen:n,onClose:()=>r(!1),initialDataset:a,constants:t,onSave:d})]})}const PM=Object.freeze(Object.defineProperty({__proto__:null,default:AM},Symbol.toStringTag,{value:"Module"}));function bp({icon:e,title:t,description:n,actionLabel:r,onAction:a}){return s.jsxs("div",{className:"text-center py-12",children:[s.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:s.jsx(e,{className:"w-8 h-8 text-gray-400"})}),s.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:t}),s.jsx("p",{className:"text-gray-500 mb-6 max-w-sm mx-auto",children:n}),s.jsx("button",{onClick:a,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:r})]})}function p0({value:e,onChange:t,placeholder:n="Search..."}){return s.jsxs("div",{className:"relative",children:[s.jsx(yg,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400"}),s.jsx("input",{type:"text",value:e,onChange:r=>t(r.target.value),placeholder:n,className:"pl-9 pr-4 py-2 w-64 border border-gray-300 rounded-md focus:ring-blue-500 focus:border-blue-500"})]})}function f0({currentPage:e,totalPages:t,onPageChange:n}){return s.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t border-gray-200",children:[s.jsxs("div",{className:"flex-1 flex justify-between sm:hidden",children:[s.jsx("button",{onClick:()=>n(e-1),disabled:e===1,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:"Previous"}),s.jsx("button",{onClick:()=>n(e+1),disabled:e===t,className:"relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:"Next"})]}),s.jsxs("div",{className:"hidden sm:flex-1 sm:flex sm:items-center sm:justify-between",children:[s.jsx("div",{children:s.jsxs("p",{className:"text-sm text-gray-700",children:["Page ",s.jsx("span",{className:"font-medium",children:e})," of"," ",s.jsx("span",{className:"font-medium",children:t})]})}),s.jsx("div",{children:s.jsxs("nav",{className:"relative z-0 inline-flex rounded-md shadow-sm -space-x-px","aria-label":"Pagination",children:[s.jsxs("button",{onClick:()=>n(e-1),disabled:e===1,className:"relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:[s.jsx("span",{className:"sr-only",children:"Previous"}),s.jsx(ip,{className:"h-5 w-5"})]}),Array.from({length:t},(r,a)=>a+1).map(r=>s.jsx("button",{onClick:()=>n(r),className:`relative inline-flex items-center px-4 py-2 border text-sm font-medium ${r===e?"z-10 bg-blue-50 border-blue-500 text-blue-600":"bg-white border-gray-300 text-gray-500 hover:bg-gray-50"}`,children:r},r)),s.jsxs("button",{onClick:()=>n(e+1),disabled:e===t,className:"relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium text-gray-500 hover:bg-gray-50 disabled:bg-gray-100 disabled:text-gray-400",children:[s.jsx("span",{className:"sr-only",children:"Next"}),s.jsx(_o,{className:"h-5 w-5"})]})]})})]})]})}function Lj({stacktrace:e}){return s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx("pre",{className:"text-xs text-red-700 whitespace-pre-wrap break-words [word-break:break-word] font-mono",children:e})})}const Tm={analyzing:{bg:"bg-blue-100",text:"text-blue-800",icon:s.jsx(ps,{className:"w-4 h-4 animate-spin"})},ready:{bg:"bg-green-100",text:"text-green-800",icon:null},failed:{bg:"bg-red-100",text:"text-red-800",icon:s.jsx(Xn,{className:"w-4 h-4"})}};function TM({dataset:e,rootPath:t,onDelete:n,onRefresh:r,onAbort:a,isErrorExpanded:l,onToggleError:c}){const d=er.useRef(null),p=()=>{window.location.href=`${t}/datasets/${e.id}/download`},m=h=>{var j,b;const g=(j=h.target.files)==null?void 0:j[0];if(!g)return;const x=new FormData;x.append("config",g),fetch(`${t}/datasets/${e.id}/upload`,{method:"POST",body:x,credentials:"same-origin",headers:{"X-CSRF-Token":((b=document.querySelector('meta[name="csrf-token"]'))==null?void 0:b.content)||""}}).then(_=>{_.ok?window.location.reload():console.error("Upload failed")})};return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(wn,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),s.jsxs("div",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ${Tm[e.workflow_status].bg} ${Tm[e.workflow_status].text}`,children:[Tm[e.workflow_status].icon,s.jsx("span",{children:e.workflow_status.charAt(0).toUpperCase()+e.workflow_status.slice(1)})]})]}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Zr,{href:`${t}/datasets/${e.id}`,className:`transition-colors ${e.workflow_status==="analyzing"?"text-gray-300 cursor-not-allowed pointer-events-none":"text-gray-400 hover:text-blue-600"}`,title:e.workflow_status==="analyzing"?"Dataset is being analyzed":"View details",children:s.jsx(fw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>r(e.id),disabled:e.workflow_status==="analyzing",className:`transition-colors ${e.workflow_status==="analyzing"?"text-gray-300 cursor-not-allowed":"text-gray-400 hover:text-blue-600"}`,title:e.workflow_status==="analyzing"?"Dataset is being analyzed":"Refresh dataset",children:s.jsx(bw,{className:"w-5 h-5"})}),e.workflow_status==="analyzing"&&s.jsx("button",{onClick:()=>a(e.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Abort analysis",children:s.jsx(Bl,{className:"w-5 h-5"})}),s.jsx("button",{onClick:p,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Download dataset configuration",children:s.jsx(pw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>{var h;return(h=d.current)==null?void 0:h.click()},className:"text-gray-400 hover:text-green-600 transition-colors",title:"Upload dataset configuration",children:s.jsx(gc,{className:"w-5 h-5"})}),s.jsx("input",{type:"file",ref:d,onChange:m,accept:".json",className:"hidden"}),s.jsx("button",{className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete dataset",onClick:()=>n(e.id),children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Columns"}),s.jsxs("p",{className:"text-sm font-medium text-gray-900",children:[e.columns.length," columns"]})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Rows"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:e.num_rows.toLocaleString()})]})]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.columns.slice(0,3).map(h=>s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:h.name},h.name)),e.columns.length>3&&s.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:["+",e.columns.length-3," more"]})]})}),e.workflow_status==="failed"&&e.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>c(e.id),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),l?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),l&&s.jsx(Lj,{stacktrace:e.stacktrace})]})]})}function OM(){const e=E.useRef(null),{rootPath:t}=tr().props,n=r=>{var c,d;const a=(c=r.target.files)==null?void 0:c[0];if(!a)return;const l=new FormData;l.append("config",a),fetch(`${t}/datasets/upload`,{method:"POST",body:l,credentials:"same-origin",headers:{"X-CSRF-Token":((d=document.querySelector('meta[name="csrf-token"]'))==null?void 0:d.content)||""}}).then(p=>{p.ok?window.location.reload():console.error("Upload failed")})};return s.jsxs(s.Fragment,{children:[s.jsxs("button",{onClick:()=>{var r;return(r=e.current)==null?void 0:r.click()},className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-50",title:"Import dataset",children:[s.jsx(gc,{className:"w-4 h-4"}),"Import"]}),s.jsx("input",{type:"file",ref:e,onChange:n,accept:".json",className:"hidden"})]})}const Om=6;function RM({datasets:e}){const{rootPath:t}=tr().props,[n,r]=E.useState(""),[a,l]=E.useState(1),[c,d]=E.useState([]),p=E.useMemo(()=>e.filter(_=>_.name.toLowerCase().includes(n.toLowerCase())||_.description.toLowerCase().includes(n.toLowerCase())),[e,n]),m=Math.ceil(p.length/Om),h=p.slice((a-1)*Om,a*Om),g=_=>{confirm("Are you sure you want to delete this dataset?")&&Ze.delete(`${t}/datasets/${_}`)},x=_=>{Ze.post(`${t}/datasets/${_}/refresh`)},j=_=>{Ze.post(`${t}/datasets/${_}/abort`,{},{preserveScroll:!0,preserveState:!0})};E.useEffect(()=>{let _;return e.some(y=>y.workflow_status==="analyzing")&&(_=window.setInterval(()=>{Ze.get(window.location.href,{},{preserveScroll:!0,preserveState:!0,only:["datasets"]})},2e3)),()=>{_&&window.clearInterval(_)}},[e]);const b=_=>{d(N=>N.includes(_)?N.filter(y=>y!==_):[...N,_])};return e.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:wn,title:"Create your first dataset",description:"Create a dataset to start training your machine learning models",actionLabel:"Create Dataset",onAction:()=>{Ze.visit(`${t}/datasets/new`)}})}):s.jsx("div",{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Datasets"}),s.jsx(p0,{value:n,onChange:r,placeholder:"Search datasets..."})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsx(OM,{}),s.jsxs(Zr,{href:`${t}/datasets/new`,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Dataset"]})]})]}),h.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(wn,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No datasets found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No datasets match your search criteria. Try adjusting your search or create a new dataset."}),s.jsx("div",{className:"mt-6",children:s.jsxs(Zr,{href:`${t}/datasets/new`,className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Dataset"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:h.map(_=>s.jsx(TM,{dataset:_,rootPath:t,onDelete:g,onRefresh:x,onAbort:j,isErrorExpanded:c.includes(_.id),onToggleError:b},_.id))}),m>1&&s.jsx(f0,{currentPage:a,totalPages:m,onPageChange:l})]})]})})}const IM=Object.freeze(Object.defineProperty({__proto__:null,default:RM},Symbol.toStringTag,{value:"Module"})),Dj=()=>{const e=er.createContext(null);return[()=>{const t=er.useContext(e);if(t===null)throw new Error("useContext must be inside a Provider with a value");return t},e.Provider]},Kh=e=>{const t=structuredClone(e??{});for(const n in t)Xt.isPlainObject(t[n])?t[n]=Kh(t[n]):Array.isArray(t[n])?t[n]=t[n].map(r=>Kh(r)):t[n]!==void 0&&t[n]!==null||(t[n]="");return t},Fj=(e,t)=>{Object.entries(e).forEach(([n,r])=>{Xt.isPlainObject(r)?(Rb(e,n,`${n}${t}`),Fj(r,t)):Array.isArray(r)&&Rb(e,n,`${n}${t}`)})},Rb=(e,t,n)=>{t!==n&&(e[n]=e[t],delete e[t])},zj=(e,t)=>{var r;const n=t.replace(/\[\]$/,"");if(n.includes("[]")){const a=n.indexOf("[]"),l=n.slice(0,a),c=n.slice(a+2),d=Xt.get(e,l);if(Array.isArray(d))for(let p=0;p<d.length;p++)zj(e,`${l}[${p}]${c}`)}if(n.charAt(n.length-1)==="]"){const a=n.match(/(?<index>\d*)\]$/),l=Xt.get(e,n.slice(0,n.lastIndexOf("[")));Array.isArray(l)&&((r=a==null?void 0:a.groups)==null?void 0:r.index)!==void 0&&l.splice(Number(a.groups.index),1)}else Xt.unset(e,n)},Ib=e=>Array.isArray(e)?e:[e],[MM,kF]=Dj();function _c(e,t){const n=E.useCallback(()=>{let J=null,ee=e;return typeof e=="string"&&(J=e,ee=t),[J,Kh(ee)]},[e,t]),[r,a]=n(),[l,c]=E.useState(a||{}),[d,p]=r?fy(a,`${r}:data`):E.useState(a),m=E.useMemo(()=>{const J=d?Object.keys(d):[];if(J.length===1)return J[0]},[d]),[h,g]=r?fy({},`${r}:errors`):E.useState({}),[x,j]=E.useState(!1),[b,_]=E.useState(!1),[N,y]=E.useState(),[w,C]=E.useState(!1),[R,D]=E.useState(!1),T=E.useRef(null),F=E.useRef();let z=E.useRef(J=>J);const B=E.useRef();E.useEffect(()=>(B.current=!0,()=>{B.current=!1}),[]);let W=E.useRef(),pe=E.useRef();E.useEffect(()=>{W.current&&pe.current&&W.current(...pe.current)},[d]);let oe=!1;try{oe=MM().railsAttributes}catch{}const we=(J,ee,le={})=>{const G={...le,onCancelToken:ne=>{if(T.current=ne,le.onCancelToken)return le.onCancelToken(ne)},onBefore:ne=>{if(C(!1),D(!1),clearTimeout(F.current),le.onBefore)return le.onBefore(ne)},onStart:ne=>{if(_(!0),le.onStart)return le.onStart(ne)},onProgress:ne=>{if(y(ne),le.onProgress)return le.onProgress(ne)},onSuccess:ne=>{if(B.current&&(_(!1),y(null),g({}),j(!1),C(!0),D(!0),F.current=setTimeout(()=>{B.current&&D(!1)},2e3)),le.onSuccess)return le.onSuccess(ne)},onError:ne=>{if(B.current&&(_(!1),y(null),g((me=>{if(!me||!m)return me;const Re={};return Object.keys(me).forEach(gt=>{Re[`${m}.${gt}`]=me[gt]}),Re})(ne)),j(!0)),le.onError)return le.onError(ne)},onCancel:()=>{if(B.current&&(_(!1),y(null)),le.onCancel)return le.onCancel()},onFinish:ne=>{if(B.current&&(_(!1),y(null)),T.current=null,le.onFinish)return le.onFinish(ne)}};let re=z.current(structuredClone(d));oe&&(re=((ne,me="_attributes")=>{const Re=structuredClone(ne);return Object.values(Re).forEach(gt=>{Xt.isPlainObject(gt)&&Fj(gt,me)}),Re})(re)),J==="delete"?Ze.delete(ee,{...G,data:re}):Ze[J](ee,re,G)},be=J=>{if(!J)return void g({});const ee=Ib(J);g(le=>{const G=Object.keys(le).reduce((re,ne)=>({...re,...ee.length>0&&!ee.includes(String(ne))?{[ne]:le[ne]}:{}}),{});return j(Object.keys(G).length>0),G})};return{data:d,isDirty:!Xt.isEqual(d,l),errors:h,hasErrors:x,processing:b,progress:N,wasSuccessful:w,recentlySuccessful:R,transform:J=>{z.current=J},onChange:J=>{W.current=J},setData:(J,ee)=>{if(typeof J=="string")return p(le=>{const G=structuredClone(le);return W.current&&(pe.current=[J,ee,Xt.get(le,J)]),Xt.set(G,J,ee),G});J instanceof Function?p(le=>{const G=J(structuredClone(le));return W.current&&(pe.current=[void 0,G,le]),G}):(W.current&&(pe.current=[void 0,d,J]),p(J))},getData:J=>Xt.get(d,J),unsetData:J=>{p(ee=>{const le=structuredClone(ee);return W.current&&(pe.current=[J,Xt.get(ee,J),void 0]),zj(le,J),le})},setDefaults:(J,ee)=>{c(J!==void 0?le=>({...le,...typeof J=="string"?{[J]:ee}:J}):()=>d)},reset:J=>{if(!J)return W.current&&(pe.current=[void 0,l,d]),p(l),void g({});const ee=Ib(J),le=structuredClone(d);ee.forEach(G=>{Xt.set(le,G,Xt.get(l,G))}),be(J),W.current&&(pe.current=[void 0,le,d]),p(le)},setError:(J,ee)=>{g(le=>{const G={...le,...typeof J=="string"?{[J]:ee}:J};return j(Object.keys(G).length>0),G})},getError:J=>Xt.get(h,J),clearErrors:be,submit:we,get:(J,ee)=>{we("get",J,ee)},post:(J,ee)=>{we("post",J,ee)},put:(J,ee)=>{we("put",J,ee)},patch:(J,ee)=>{we("patch",J,ee)},delete:(J,ee)=>{we("delete",J,ee)},cancel:()=>{T.current&&T.current.cancel()}}}const[LM,CF]=(()=>{const e=er.createContext(null);return[()=>{const t=er.useContext(e);if(t===null)throw new Error("useContext must be inside a Provider with a value");return t},e.Provider]})();Dj();const DM=er.forwardRef(({children:e,type:t="submit",disabled:n=!1,component:r="button",requiredFields:a,...l},c)=>{const{data:d,getData:p,processing:m}=LM(),h=E.useCallback(()=>!(!a||a.length===0)&&a.some(g=>{return typeof(x=p(g))=="string"?x==="":typeof x=="number"?x!==0&&!x:Xt.isEmpty(x);var x}),[d]);return er.createElement(r,{children:e,type:t,disabled:n||m||a&&h(),ref:c,...l})});er.memo(DM);function FM({datasource:e,constants:t}){var m,h,g,x;const{rootPath:n}=tr().props,r=!!e,{data:a,setData:l,processing:c,errors:d}=_c({datasource:{name:(e==null?void 0:e.name)??"",datasource_type:(e==null?void 0:e.datasource_type)??"s3",s3_bucket:(e==null?void 0:e.s3_bucket)??"",s3_prefix:(e==null?void 0:e.s3_prefix)??"",s3_region:(e==null?void 0:e.s3_region)??"us-east-1"}}),p=j=>{j.preventDefault(),r?Ze.patch(`${n}/datasources/${e.id}`,a):Ze.post(`${n}/datasources`,a)};return s.jsx("div",{className:"max-w-2xl mx-auto py-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:r?"Edit Datasource":"New Datasource"}),s.jsxs("form",{onSubmit:p,className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Name"}),s.jsx("input",{type:"text",id:"name",value:a.datasource.name,onChange:j=>l("datasource.name",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0}),((m=d.datasource)==null?void 0:m.name)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.name})]}),!r&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Type"}),s.jsx(Ke,{options:t.DATASOURCE_TYPES,value:a.datasource.datasource_type,onChange:j=>l("datasource.datasource_type",j),placeholder:"Select datasource type"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"s3_bucket",className:"block text-sm font-medium text-gray-700",children:"S3 Bucket"}),s.jsx("input",{type:"text",id:"s3_bucket",value:a.datasource.s3_bucket,onChange:j=>l("datasource.s3_bucket",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0}),((h=d.datasource)==null?void 0:h.s3_bucket)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_bucket})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"s3_prefix",className:"block text-sm font-medium text-gray-700",children:"S3 Prefix"}),s.jsx("input",{type:"text",id:"s3_prefix",value:a.datasource.s3_prefix,onChange:j=>l("datasource.s3_prefix",j.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",placeholder:"data/raw/"}),((g=d.datasource)==null?void 0:g.s3_prefix)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_prefix})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"S3 Region"}),s.jsx(Ke,{options:t.s3.S3_REGIONS,value:a.datasource.s3_region,onChange:j=>l("datasource.s3_region",j),placeholder:"Select s3 region"}),((x=d.datasource)==null?void 0:x.s3_region)&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:d.datasource.s3_region})]}),s.jsxs("div",{className:"flex justify-end gap-3",children:[s.jsx("button",{type:"button",onClick:()=>Ze.visit(`${n}/datasources`),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Cancel"}),s.jsx("button",{type:"submit",disabled:c,className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:c?"Saving...":r?"Save Changes":"Create Datasource"})]})]})]})})}const zM=Object.freeze(Object.defineProperty({__proto__:null,default:FM},Symbol.toStringTag,{value:"Module"})),Rm=6;function $M({datasources:e}){const{rootPath:t}=tr().props;console.log(`rootPath: ${t}`);const[n,r]=E.useState(""),[a,l]=E.useState(1),[c,d]=E.useState([]),p=E.useMemo(()=>e.filter(N=>N.name.toLowerCase().includes(n.toLowerCase())||N.s3_bucket.toLowerCase().includes(n.toLowerCase())),[n,e]),m=Math.ceil(p.length/Rm),h=p.slice((a-1)*Rm,a*Rm),g=N=>{confirm("Are you sure you want to delete this datasource? This action cannot be undone.")&&Ze.delete(`${t}/datasources/${N}`)},x=N=>{d(y=>y.includes(N)?y.filter(w=>w!==N):[...y,N])},j=async N=>{try{Ze.post(`${t}/datasources/${N}/sync`,{},{preserveScroll:!0,preserveState:!0,onSuccess:y=>{console.log("SUCCESS")},onError:()=>{console.error("Failed to sync datasource")}})}catch(y){console.error("Failed to sync datasource:",y)}},b=async N=>{try{await Ze.post(`${t}/datasources/${N}/abort`,{},{preserveScroll:!0,preserveState:!0})}catch(y){console.error("Failed to abort datasource sync:",y)}},_=N=>{if(N==="Not Synced")return N;const y=new Date(N);return isNaN(y.getTime())?N:y.toLocaleString()};return E.useEffect(()=>{let N;return e.some(w=>w.is_syncing)&&(N=window.setInterval(()=>{Ze.get(window.location.href,{},{preserveScroll:!0,preserveState:!0,only:["datasources"]})},2e3)),()=>{N&&window.clearInterval(N)}},[e]),e.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:ls,title:"Connect your first data source",description:"Connect to your data sources to start creating datasets and training models",actionLabel:"Add Datasource",onAction:()=>{Ze.visit(`${t}/datasources/new`)}})}):s.jsx("div",{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Datasources"}),s.jsx(p0,{value:n,onChange:r,placeholder:"Search datasources..."})]}),s.jsxs(Zr,{href:`${t}/datasources/new`,className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Datasource"]})]}),h.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(ls,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No datasources found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No datasources match your search criteria. Try adjusting your search or add a new datasource."}),s.jsx("div",{className:"mt-6",children:s.jsxs(Zr,{href:`${t}/datasources/new`,className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Datasource"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:h.map(N=>s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(ls,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:N.name}),N.is_syncing?s.jsx(ga,{variant:"warning",children:"syncing"}):N.sync_error?s.jsx(ga,{variant:"important",children:"sync error"}):N.last_synced_at!=="Not Synced"?s.jsx(ga,{variant:"success",children:"synced"}):s.jsx(ga,{variant:"warning",children:"not synced"})]}),s.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:["s3://",N.s3_bucket,"/",N.s3_prefix]})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:()=>j(N.id),disabled:N.is_syncing,className:`text-gray-400 hover:text-blue-600 transition-colors ${N.is_syncing?"animate-spin":""}`,title:"Sync datasource",children:s.jsx(bw,{className:"w-5 h-5"})}),N.is_syncing&&s.jsx("button",{onClick:()=>b(N.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Abort sync",children:s.jsx(Bl,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${t}/datasources/${N.id}/edit`,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Edit datasource",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>g(N.id),className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete datasource",children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Region"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:N.s3_region})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Last Sync"}),s.jsx("p",{className:"text-sm font-medium text-gray-900",children:_(N.last_synced_at)})]})]}),N.sync_error&&N.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>x(N.id),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),c.includes(N.id)?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),c.includes(N.id)&&s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx("pre",{className:"text-xs text-red-700 whitespace-pre-wrap font-mono",children:N.stacktrace})})]})]},N.id))}),m>1&&s.jsx(f0,{currentPage:a,totalPages:m,onPageChange:l})]})]})})}const UM=Object.freeze(Object.defineProperty({__proto__:null,default:$M},Symbol.toStringTag,{value:"Module"}));function BM({isOpen:e,onClose:t,onSave:n,initialData:r,metrics:a,tunerJobConstants:l,timezone:c,retrainingJobConstants:d}){var D,T,F,z,B,W,pe,oe,we,be,J,ee,le,G,re,ne,me,Re,gt,tt,K,je,Ae,ke;const[p,m]=E.useState(!1);E.useState(null);const h=Object.entries(l).filter(([Y,fe])=>Array.isArray(fe.options)).reduce((Y,[fe,ve])=>({...Y,[fe]:ve.options[0].value}),{}),g=h.booster,x=Object.entries(l.hyperparameters[g]||{}).filter(([Y,fe])=>!Array.isArray(fe.options)).reduce((Y,[fe,ve])=>({...Y,[fe]:{min:ve.min,max:ve.max}}),{}),[j,b]=E.useState({retraining_job_attributes:{id:((D=r.retraining_job)==null?void 0:D.id)||null,active:((T=r.retraining_job)==null?void 0:T.active)??!1,frequency:((F=r.retraining_job)==null?void 0:F.frequency)||d.frequency[0].value,tuning_frequency:((z=r.retraining_job)==null?void 0:z.tuning_frequency)||"month",direction:((B=r.retraining_job)==null?void 0:B.direction)||"maximize",batch_mode:((W=r.retraining_job)==null?void 0:W.batch_mode)||!1,batch_size:((pe=r.retraining_job)==null?void 0:pe.batch_size)||100,batch_overlap:((oe=r.retraining_job)==null?void 0:oe.batch_overlap)||1,batch_key:((we=r.retraining_job)==null?void 0:we.batch_key)||"",at:{hour:((J=(be=r.retraining_job)==null?void 0:be.at)==null?void 0:J.hour)??2,day_of_week:((le=(ee=r.retraining_job)==null?void 0:ee.at)==null?void 0:le.day_of_week)??1,day_of_month:((re=(G=r.retraining_job)==null?void 0:G.at)==null?void 0:re.day_of_month)??1},metric:((ne=r.retraining_job)==null?void 0:ne.metric)||(((Re=(me=a[r.task])==null?void 0:me[0])==null?void 0:Re.value)??""),threshold:((gt=r.retraining_job)==null?void 0:gt.threshold)??(r.task==="classification"?.85:.1),tuner_config:(tt=r.retraining_job)!=null&&tt.tuner_config?{n_trials:r.retraining_job.tuner_config.n_trials||10,config:{...h,...x,...r.retraining_job.tuner_config.config}}:void 0,tuning_enabled:((K=r.retraining_job)==null?void 0:K.tuning_enabled)??!1}});if(E.useEffect(()=>{j.retraining_job_attributes.tuner_config&&Object.keys(j.retraining_job_attributes.tuner_config.config).length===0&&b(Y=>({...Y,retraining_job_attributes:{...Y.retraining_job_attributes,tuner_config:{...Y.retraining_job_attributes.tuner_config,config:{...h,...x}}}}))},[j.retraining_job_attributes.tuner_config]),!e)return null;const _=(Y,fe)=>{b(ve=>({...ve,retraining_job_attributes:{...ve.retraining_job_attributes,tuner_config:{...ve.retraining_job_attributes.tuner_config,config:{...ve.retraining_job_attributes.tuner_config.config,[Y]:fe}}}}))},N=()=>{const Y=Object.entries(l).filter(([ve,Ve])=>Array.isArray(Ve.options)),fe=Y.map(([ve])=>ve);return s.jsxs("div",{className:"space-y-4",children:[Y.map(([ve,Ve])=>{var pn;return s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:Ve.label}),s.jsx(Ke,{options:Ve.options.map(Ye=>({value:Ye.value,label:Ye.label,description:Ye.description})),value:((pn=j.retraining_job_attributes.tuner_config)==null?void 0:pn.config[ve])||Ve.options[0].value,onChange:Ye=>_(ve,Ye)})]},ve)}),fe.map(ve=>{var Ye;const Ve=Object.entries(l).filter(([Sn,nr])=>nr.depends_on===ve),pn=((Ye=j.retraining_job_attributes.tuner_config)==null?void 0:Ye.config[ve])||l[ve].options[0].value;return s.jsxs("div",{className:"space-y-4",children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Parameter Ranges"}),s.jsx("div",{className:"space-y-4 max-h-[400px] overflow-y-auto pr-2",children:Ve.map(([Sn,nr])=>{const jt=nr[pn];return jt?Object.entries(jt).map(([on,St])=>{var Zt,Lt,Nn,Fn;return St.min!==void 0&&St.max!==void 0?s.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[s.jsxs("div",{className:"flex items-center justify-between mb-2",children:[s.jsx("label",{className:"text-sm font-medium text-gray-900",children:St.label}),s.jsx("span",{className:"text-xs text-gray-500",children:St.description})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Minimum"}),s.jsx("input",{type:"number",min:St.min,max:St.max,step:St.step,value:((Lt=(Zt=j.retraining_job_attributes.tuner_config)==null?void 0:Zt.config[on])==null?void 0:Lt.min)??St.min,onChange:ie=>y(on,"min",parseFloat(ie.target.value)),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-xs text-gray-500 mb-1",children:"Maximum"}),s.jsx("input",{type:"number",min:St.min,max:St.max,step:St.step,value:((Fn=(Nn=j.retraining_job_attributes.tuner_config)==null?void 0:Nn.config[on])==null?void 0:Fn.max)??St.max,onChange:ie=>y(on,"max",parseFloat(ie.target.value)),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})]},on):null}):null})})]},ve)})]})},y=(Y,fe,ve)=>{b(Ve=>({...Ve,retraining_job_attributes:{...Ve.retraining_job_attributes,tuner_config:{...Ve.retraining_job_attributes.tuner_config,config:{...Ve.retraining_job_attributes.tuner_config.config,[Y]:{...Ve.retraining_job_attributes.tuner_config.config[Y],[fe]:ve}}}}}))},w=(Y,fe)=>{b(ve=>Y==="hour"||Y==="day_of_week"||Y==="day_of_month"?{...ve,retraining_job_attributes:{...ve.retraining_job_attributes,at:{...ve.retraining_job_attributes.at,[Y]:fe}}}:{...ve,retraining_job_attributes:{...ve.retraining_job_attributes,[Y]:fe}})},C=(Y,fe)=>{b(ve=>({...ve,retraining_job_attributes:{...ve.retraining_job_attributes,[Y]:fe}}))},R=()=>{const{retraining_job_attributes:Y}=j,fe={hour:Y.at.hour};switch(Y.frequency){case"day":break;case"week":fe.day_of_week=Y.at.day_of_week;break;case"month":fe.day_of_month=Y.at.day_of_month;break}const ve={retraining_job_attributes:{...Y,at:fe}};n(ve),t()};return s.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-start justify-center pt-[5vh] z-50",children:s.jsxs("div",{className:"bg-white rounded-lg w-full max-w-6xl flex flex-col",style:{maxHeight:"90vh"},children:[s.jsxs("div",{className:"flex-none flex justify-between items-center p-4 border-b",children:[s.jsx("h2",{className:"text-lg font-semibold",children:"Training Configuration"}),s.jsx("button",{onClick:t,className:"text-gray-500 hover:text-gray-700",children:s.jsx(xc,{className:"w-5 h-5"})})]}),s.jsxs("div",{className:"flex-1 p-6 grid grid-cols-2 gap-8 overflow-y-auto",children:[s.jsx("div",{className:"space-y-8",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Training Schedule"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"scheduleEnabled",checked:j.retraining_job_attributes.active,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,active:Y.target.checked}})),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"scheduleEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable scheduled training"})]})]}),!j.retraining_job_attributes.active&&s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(Xn,{className:"w-5 h-5 text-gray-400 mt-0.5"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-900",children:"Manual Training Mode"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"The model will only be trained when you manually trigger training. You can do this from the model details page at any time."})]})]})}),j.retraining_job_attributes.active&&s.jsx(s.Fragment,{children:s.jsx("div",{className:"space-y-6",children:s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Frequency"}),s.jsx(Ke,{options:d.frequency.map(Y=>({value:Y.value,label:Y.label,description:Y.description})),value:j.retraining_job_attributes.frequency,onChange:Y=>w("frequency",Y)})]}),j.retraining_job_attributes.frequency==="week"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Day of Week"}),s.jsx(Ke,{options:[{value:0,label:"Sunday"},{value:1,label:"Monday"},{value:2,label:"Tuesday"},{value:3,label:"Wednesday"},{value:4,label:"Thursday"},{value:5,label:"Friday"},{value:6,label:"Saturday"}],value:j.retraining_job_attributes.at.day_of_week,onChange:Y=>w("day_of_week",Y)})]}),j.retraining_job_attributes.frequency==="month"&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Day of Month"}),s.jsx(Ke,{options:Array.from({length:31},(Y,fe)=>({value:fe+1,label:`Day ${fe+1}`})),value:j.retraining_job_attributes.at.day_of_month,onChange:Y=>w("day_of_month",Y)})]}),s.jsxs("div",{children:[s.jsxs("label",{className:"block text-sm font-medium text-gray-700",children:["Hour (",c,")"]}),s.jsx(Ke,{options:Array.from({length:24},(Y,fe)=>({value:fe,label:`${fe}:00`})),value:j.retraining_job_attributes.at.hour,onChange:Y=>w("hour",Y)})]})]})})}),s.jsxs("div",{className:"space-y-4 pt-4 border-t",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("label",{htmlFor:"batchTrainingEnabled",className:"text-sm font-medium text-gray-700 flex items-center gap-2",children:["Enable Batch Training",s.jsx("button",{type:"button",onClick:()=>m(!p),className:"text-gray-400 hover:text-gray-600",children:s.jsx(vw,{className:"w-4 h-4"})})]})}),s.jsx("input",{type:"checkbox",id:"batchMode",checked:j.retraining_job_attributes.batch_mode,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_mode:Y.target.checked}}),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"})]}),p&&s.jsx("div",{className:"bg-blue-50 rounded-lg p-4 text-sm text-blue-700",children:s.jsxs("ul",{className:"space-y-2",children:[s.jsx("li",{children:"• When disabled, the model will train on the entire dataset in a single pass."}),s.jsx("li",{children:"• When enabled, the model will learn from small batches of data iteratively, improving training speed"})]})}),j.retraining_job_attributes.batch_mode&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Size"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.batch_size,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_size:parseInt(Y.target.value)}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"})]}),s.jsxs("div",{className:"flex-1",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Overlap"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.batch_overlap,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_overlap:parseInt(Y.target.value)}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm"})]})]}),s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Key"}),s.jsx(Ke,{value:j.retraining_job_attributes.batch_key,onChange:Y=>b({...j,retraining_job_attributes:{...j.retraining_job_attributes,batch_key:Y}}),options:((Ae=(je=r.dataset)==null?void 0:je.columns)==null?void 0:Ae.map(Y=>({value:Y.name,label:Y.name})))||[],placeholder:"Select a column for batch key"})]})]})]}),s.jsxs("div",{className:"border-t border-gray-200 pt-6",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(Xn,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Evaluator Configuration"})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Metric"}),s.jsx(Ke,{options:a[r.task].map(Y=>({value:Y.value,label:Y.label,description:Y.description})),value:j.retraining_job_attributes.metric,onChange:Y=>C("metric",Y)})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Threshold"}),s.jsx("input",{type:"number",value:j.retraining_job_attributes.threshold,onChange:Y=>C("threshold",parseFloat(Y.target.value)),step:.01,className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]})]}),s.jsx("div",{className:"bg-blue-50 rounded-md p-4",children:s.jsxs("div",{className:"flex items-start",children:[s.jsx(Xn,{className:"w-5 h-5 text-blue-400 mt-0.5"}),s.jsxs("div",{className:"ml-3",children:[s.jsx("h3",{className:"text-sm font-medium text-blue-800",children:"Deployment Criteria"}),s.jsx("p",{className:"mt-2 text-sm text-blue-700",children:(()=>{const Y=a[r.task].find(ve=>ve.value===j.retraining_job_attributes.metric),fe=(Y==null?void 0:Y.direction)==="minimize"?"below":"above";return`The model will be automatically deployed when the ${Y==null?void 0:Y.label} is ${fe} ${j.retraining_job_attributes.threshold}.`})()})]})]})})]})]})]})}),s.jsx("div",{className:"space-y-8",children:s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Aa,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Hyperparameter Tuning"})]}),s.jsxs("div",{className:"flex items-center",children:[s.jsx("input",{type:"checkbox",id:"tuningEnabled",checked:j.retraining_job_attributes.tuning_enabled||!1,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuning_enabled:Y.target.checked,tuner_config:Y.target.checked?{n_trials:10,config:x}:void 0}})),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s.jsx("label",{htmlFor:"tuningEnabled",className:"ml-2 text-sm text-gray-700",children:"Enable tuning"})]})]}),j.retraining_job_attributes.tuning_enabled&&s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Frequency"}),s.jsx(Ke,{options:[{value:"always",label:"Always",description:"Tune hyperparameters every time"},{value:"week",label:"Weekly",description:"Tune hyperparameters once every week"},{value:"month",label:"Monthly",description:"Tune hyperparameters once every month"}],value:j.retraining_job_attributes.tuning_frequency||"week",onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuning_frequency:Y}}))})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Number of Trials"}),s.jsx("input",{type:"number",min:"1",max:"1000",value:((ke=j.retraining_job_attributes.tuner_config)==null?void 0:ke.n_trials)||10,onChange:Y=>b(fe=>({...fe,retraining_job_attributes:{...fe.retraining_job_attributes,tuner_config:{...fe.retraining_job_attributes.tuner_config,n_trials:parseInt(Y.target.value)}}})),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]})]}),N()]})]})})]}),s.jsxs("div",{className:"flex-none flex justify-end gap-4 p-4 border-t bg-white",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-500",children:"Cancel"}),s.jsx("button",{onClick:R,className:"px-4 py-2 text-sm font-medium text-white bg-blue-600 hover:bg-blue-700 rounded-md",children:"Save Changes"})]})]})})}const ca=({error:e})=>e?s.jsxs("div",{className:"mt-1 flex items-center gap-1 text-sm text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),e]}):null;function $j({initialData:e,datasets:t,constants:n,isEditing:r,errors:a}){var W,pe,oe,we,be,J;const{rootPath:l}=tr().props,[c,d]=E.useState(!1),[p,m]=E.useState(!1),h=_c({model:{id:e==null?void 0:e.id,name:(e==null?void 0:e.name)||"",model_type:(e==null?void 0:e.model_type)||"xgboost",dataset_id:(e==null?void 0:e.dataset_id)||"",task:(e==null?void 0:e.task)||"classification",objective:(e==null?void 0:e.objective)||"binary:logistic",metrics:(e==null?void 0:e.metrics)||["accuracy_score"],weights_column:(e==null?void 0:e.weights_column)||"",retraining_job_attributes:e!=null&&e.retraining_job?{id:e.retraining_job.id,frequency:e.retraining_job.frequency,tuning_frequency:e.retraining_job.tuning_frequency||"month",batch_mode:e.retraining_job.batch_mode,batch_size:e.retraining_job.batch_size,batch_overlap:e.retraining_job.batch_overlap,batch_key:e.retraining_job.batch_key,at:{hour:((W=e.retraining_job.at)==null?void 0:W.hour)??2,day_of_week:((pe=e.retraining_job.at)==null?void 0:pe.day_of_week)??1,day_of_month:((oe=e.retraining_job.at)==null?void 0:oe.day_of_month)??1},active:e.retraining_job.active,metric:e.retraining_job.metric,threshold:e.retraining_job.threshold,tuner_config:e.retraining_job.tuner_config,tuning_enabled:e.retraining_job.tuning_enabled||!1}:void 0}}),{data:g,setData:x,post:j,patch:b,processing:_,errors:N}=h,y={...a,...N},w=((we=n.objectives[g.model.model_type])==null?void 0:we[g.model.task])||[];E.useEffect(()=>{p&&(R(),m(!1))},[p]);const C=ee=>{x({...g,model:{...g.model,retraining_job_attributes:ee.retraining_job_attributes}}),m(!0)},R=()=>{if(g.model.retraining_job_attributes){const ee={hour:g.model.retraining_job_attributes.at.hour};switch(g.model.retraining_job_attributes.frequency){case"day":break;case"week":ee.day_of_week=g.model.retraining_job_attributes.at.day_of_week;break;case"month":ee.day_of_month=g.model.retraining_job_attributes.at.day_of_month;break}x("model.retraining_job_attributes.at",ee)}g.model.id?b(`${l}/models/${g.model.id}`,{onSuccess:()=>{Ze.visit(`${l}/models`)}}):j(`${l}/models`,{onSuccess:()=>{Ze.visit(`${l}/models`)}})},D=ee=>{ee.preventDefault(),R()},T=t.find(ee=>ee.id===g.model.dataset_id),F=(T==null?void 0:T.columns)||[],z=n.tuner_job_constants[g.model.model_type]||{},B=ee=>{x("model.task",ee),x("model.metrics",[]),x("model.objective",ee==="classification"?"binary:logistic":"reg:squarederror")};return s.jsxs("form",{onSubmit:D,className:"space-y-8",children:[s.jsxs("div",{className:"flex justify-between items-center border-b pb-4",children:[s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Model Configuration"}),s.jsxs("button",{type:"button",onClick:()=>d(!0),className:"inline-flex items-center gap-2 px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(TO,{className:"w-4 h-4"}),"Configure Training"]})]}),s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700 mb-1",children:"Model Name"}),s.jsx("input",{type:"text",id:"name",value:g.model.name,onChange:ee=>x("model.name",ee.target.value),className:"block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"}),s.jsx(ca,{error:y.name})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Model Type"}),s.jsx(Ke,{options:[{value:"xgboost",label:"XGBoost",description:"Gradient boosting framework"}],value:g.model.model_type,onChange:ee=>x("model.model_type",ee),placeholder:"Select model type"}),s.jsx(ca,{error:y.model_type})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Dataset"}),r?s.jsxs("div",{className:"flex items-center gap-2 p-2 bg-gray-50 rounded-md border border-gray-200",children:[s.jsx(SO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-gray-700",children:T==null?void 0:T.name})]}):s.jsx(Ke,{options:t.map(ee=>({value:ee.id,label:ee.name,description:`${ee.num_rows.toLocaleString()} rows`})),value:g.model.dataset_id,onChange:ee=>x("model.dataset_id",ee),placeholder:"Select dataset"}),s.jsx(ca,{error:y.dataset_id})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Weights Column (Optional)"}),s.jsx(Ke,{value:g.model.weights_column,options:F.map(ee=>({value:ee.name,label:ee.name})),onChange:ee=>x("model.weights_column",ee),isClearable:!0}),s.jsx(ca,{error:y.weights_column})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Task"}),s.jsx(Ke,{options:n.tasks,value:g.model.task,onChange:B}),s.jsx(ca,{error:y.task})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Objective"}),s.jsx(Ke,{options:w||[],value:g.model.objective,onChange:ee=>x("model.objective",ee),placeholder:"Select objective"}),s.jsx(ca,{error:y.objective})]})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Metrics"}),s.jsx("div",{className:"grid grid-cols-2 gap-4",children:(be=n.metrics[g.model.task])==null?void 0:be.map(ee=>s.jsxs("label",{className:"relative flex items-center px-4 py-3 bg-white border rounded-lg hover:bg-gray-50 cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:g.model.metrics.includes(ee.value),onChange:le=>{const G=le.target.checked?[...g.model.metrics,ee.value]:g.model.metrics.filter(re=>re!==ee.value);x("model.metrics",G)},className:"h-4 w-4 text-blue-600 focus:ring-blue-500 border-gray-300 rounded"}),s.jsxs("div",{className:"ml-3",children:[s.jsx("span",{className:"block text-sm font-medium text-gray-900",children:ee.label}),s.jsxs("span",{className:"block text-xs text-gray-500",children:["Direction: ",ee.direction]})]})]},ee.value))}),s.jsx(ca,{error:y.metrics})]})]}),g.model.retraining_job_attributes&&g.model.retraining_job_attributes.batch_mode&&s.jsx(s.Fragment,{children:s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Batch Key"}),s.jsx(Ke,{value:g.model.retraining_job_attributes.batch_key||"",onChange:ee=>x("model",{...g.model,retraining_job_attributes:{...g.model.retraining_job_attributes,batch_key:ee}}),options:((J=T==null?void 0:T.columns)==null?void 0:J.map(ee=>({value:ee.name,label:ee.name})))||[],placeholder:"Select a column for batch key"}),s.jsx(ca,{error:y["model.retraining_job_attributes.batch_key"]})]})}),s.jsxs("div",{className:"flex justify-end gap-3 pt-4 border-t",children:[s.jsx("button",{type:"button",onClick:()=>Ze.visit(`${l}/models`),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Cancel"}),s.jsx("button",{type:"submit",className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:r?"Save Changes":"Create Model"})]}),s.jsx(BM,{isOpen:c,onClose:()=>d(!1),onSave:C,initialData:{task:g.model.task,metrics:g.model.metrics,modelType:g.model.model_type,dataset:T,retraining_job:g.model.retraining_job_attributes},metrics:n.metrics,tunerJobConstants:z,timezone:n.timezone,retrainingJobConstants:n.retraining_job_constants})]})}function WM({model:e,datasets:t,constants:n}){return s.jsx("div",{className:"max-w-3xl mx-auto py-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(yi,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Edit Model"})]})}),s.jsx("div",{className:"p-6",children:s.jsx($j,{initialData:e,datasets:t,constants:n,isEditing:!0})})]})})}const HM=Object.freeze(Object.defineProperty({__proto__:null,default:WM},Symbol.toStringTag,{value:"Module"})),mt=e=>{const t=new Date;return t.setDate(t.getDate()-e),t.toISOString()},Uj=[{id:1,name:"Customer Churn Dataset",description:"Historical customer data for churn prediction",columns:[{name:"usage_days",type:"numeric",description:"Number of days customer has used the product",statistics:{mean:145.7,median:130,min:1,max:365,nullCount:0}},{name:"total_spend",type:"numeric",description:"Total customer spend in USD",statistics:{mean:487.32,median:425.5,min:0,max:2500,nullCount:1250}},{name:"support_tickets",type:"numeric",description:"Number of support tickets opened",statistics:{mean:2.3,median:1,min:0,max:15,nullCount:3750}},{name:"subscription_tier",type:"categorical",description:"Customer subscription level",statistics:{uniqueCount:3,nullCount:125}},{name:"last_login",type:"datetime",description:"Last time the customer logged in",statistics:{nullCount:5e3}}],sampleData:[{usage_days:234,total_spend:567.89,support_tickets:1,subscription_tier:"premium",last_login:"2024-03-01"},{usage_days:45,total_spend:null,support_tickets:null,subscription_tier:"basic",last_login:null}],rowCount:25e3,updatedAt:"2024-03-10T12:00:00Z"}];mt(30),mt(0);mt(7),mt(1),mt(30),mt(0);mt(1),mt(1),mt(1),mt(1),mt(2),mt(2),mt(2),mt(2),mt(3),mt(3),mt(3),mt(3),mt(4),mt(4),mt(4),mt(4);const qM=[{id:1,name:"Normalize state",description:"Turn state names into 2 letter state abbreviations",groupId:1,testDatasetId:1,inputColumns:["state"],outputColumns:["state"],code:"",createdAt:mt(30),updatedAt:mt(0)}],is=[{id:1,name:"Customer Churn",description:"Features for customer churn dataset",features:qM,createdAt:mt(30),updatedAt:mt(0)}];function VM({value:e,onChange:t,language:n}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"bg-gray-900 rounded-lg overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-800",children:[s.jsx("span",{className:"text-sm text-gray-400",children:"Ruby Feature"}),s.jsx("span",{className:"text-xs px-2 py-1 bg-gray-700 rounded text-gray-300",children:n})]}),s.jsx("textarea",{value:e,onChange:r=>t(r.target.value),className:"w-full h-64 p-4 bg-gray-900 text-gray-100 font-mono text-sm focus:outline-none",placeholder:`def transform(df)
|
501
501
|
# Your feature code here
|
502
502
|
# Example:
|
503
503
|
# df["column"] = df["column"].map { |value| value.upcase }
|
@@ -506,9 +506,9 @@ end`,spellCheck:!1})]}),s.jsx("div",{className:"bg-blue-50 rounded-lg p-4",child
|
|
506
506
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function gL(e){if(Array.isArray(e))return Xh(e)}function zb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function $b(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?zb(Object(n),!0).forEach(function(r){Kj(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):zb(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Kj(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function sc(e,t){return yL(e)||vL(e,t)||Qj(e,t)||xL()}function xL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
507
507
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qj(e,t){if(e){if(typeof e=="string")return Xh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Xh(e,t)}}function Xh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function vL(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,l=!1,c,d;try{for(n=n.call(e);!(a=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));a=!0);}catch(p){l=!0,d=p}finally{try{!a&&n.return!=null&&n.return()}finally{if(l)throw d}}return r}}function yL(e){if(Array.isArray(e))return e}var bL=typeof Im=="function"?Im:Im.default,wL="file-invalid-type",_L="file-too-large",jL="file-too-small",SL="too-many-files",NL=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:wL,message:"File type must be ".concat(r)}},Ub=function(t){return{code:_L,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},Bb=function(t){return{code:jL,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},kL={code:SL,message:"Too many files"};function Xj(e,t){var n=e.type==="application/x-moz-file"||bL(e,t);return[n,n?null:NL(t)]}function Yj(e,t,n){if(Za(e.size))if(Za(t)&&Za(n)){if(e.size>n)return[!1,Ub(n)];if(e.size<t)return[!1,Bb(t)]}else{if(Za(t)&&e.size<t)return[!1,Bb(t)];if(Za(n)&&e.size>n)return[!1,Ub(n)]}return[!0,null]}function Za(e){return e!=null}function CL(e){var t=e.files,n=e.accept,r=e.minSize,a=e.maxSize,l=e.multiple,c=e.maxFiles,d=e.validator;return!l&&t.length>1||l&&c>=1&&t.length>c?!1:t.every(function(p){var m=Xj(p,n),h=sc(m,1),g=h[0],x=Yj(p,r,a),j=sc(x,1),b=j[0],_=d?d(p):null;return g&&b&&!_})}function Gd(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Ku(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function Wb(e){e.preventDefault()}function EL(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function AL(e){return e.indexOf("Edge/")!==-1}function PL(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return EL(e)||AL(e)}function fi(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];return t.some(function(d){return!Gd(r)&&d&&d.apply(void 0,[r].concat(l)),Gd(r)})}}function TL(){return"showOpenFilePicker"in window}function OL(e){if(Za(e)){var t=Object.entries(e).filter(function(n){var r=sc(n,2),a=r[0],l=r[1],c=!0;return Jj(a)||(console.warn('Skipped "'.concat(a,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(l)||!l.every(Zj))&&(console.warn('Skipped "'.concat(a,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var a=sc(r,2),l=a[0],c=a[1];return $b($b({},n),{},Kj({},l,c))},{});return[{description:"Files",accept:t}]}return e}function RL(e){if(Za(e))return Object.entries(e).reduce(function(t,n){var r=sc(n,2),a=r[0],l=r[1];return[].concat(Fb(t),[a],Fb(l))},[]).filter(function(t){return Jj(t)||Zj(t)}).join(",")}function IL(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function ML(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function Jj(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function Zj(e){return/^.*\.[\w]+$/.test(e)}var LL=["children"],DL=["open"],FL=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],zL=["refKey","onChange","onClick"];function $L(e){return WL(e)||BL(e)||e2(e)||UL()}function UL(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
508
508
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BL(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function WL(e){if(Array.isArray(e))return Yh(e)}function Mm(e,t){return VL(e)||qL(e,t)||e2(e,t)||HL()}function HL(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
509
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e2(e,t){if(e){if(typeof e=="string")return Yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(e,t)}}function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qL(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,l=!1,c,d;try{for(n=n.call(e);!(a=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));a=!0);}catch(p){l=!0,d=p}finally{try{!a&&n.return!=null&&n.return()}finally{if(l)throw d}}return r}}function VL(e){if(Array.isArray(e))return e}function Hb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hb(Object(n),!0).forEach(function(r){Jh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hb(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kd(e,t){if(e==null)return{};var n=GL(e,t),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GL(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,l;for(l=0;l<r.length;l++)a=r[l],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var m0=E.forwardRef(function(e,t){var n=e.children,r=Kd(e,LL),a=n2(r),l=a.open,c=Kd(a,DL);return E.useImperativeHandle(t,function(){return{open:l}},[l]),er.createElement(E.Fragment,null,n(At(At({},c),{},{open:l})))});m0.displayName="Dropzone";var t2={disabled:!1,getFilesFromEvent:aL,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};m0.defaultProps=t2;m0.propTypes={children:dt.func,accept:dt.objectOf(dt.arrayOf(dt.string)),multiple:dt.bool,preventDropOnDocument:dt.bool,noClick:dt.bool,noKeyboard:dt.bool,noDrag:dt.bool,noDragEventsBubbling:dt.bool,minSize:dt.number,maxSize:dt.number,maxFiles:dt.number,disabled:dt.bool,getFilesFromEvent:dt.func,onFileDialogCancel:dt.func,onFileDialogOpen:dt.func,useFsAccessApi:dt.bool,autoFocus:dt.bool,onDragEnter:dt.func,onDragLeave:dt.func,onDragOver:dt.func,onDrop:dt.func,onDropAccepted:dt.func,onDropRejected:dt.func,onError:dt.func,validator:dt.func};var Zh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function n2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=At(At({},t2),e),n=t.accept,r=t.disabled,a=t.getFilesFromEvent,l=t.maxSize,c=t.minSize,d=t.multiple,p=t.maxFiles,m=t.onDragEnter,h=t.onDragLeave,g=t.onDragOver,x=t.onDrop,j=t.onDropAccepted,b=t.onDropRejected,_=t.onFileDialogCancel,N=t.onFileDialogOpen,y=t.useFsAccessApi,w=t.autoFocus,C=t.preventDropOnDocument,R=t.noClick,D=t.noKeyboard,T=t.noDrag,F=t.noDragEventsBubbling,z=t.onError,B=t.validator,W=E.useMemo(function(){return RL(n)},[n]),pe=E.useMemo(function(){return OL(n)},[n]),oe=E.useMemo(function(){return typeof N=="function"?N:qb},[N]),we=E.useMemo(function(){return typeof _=="function"?_:qb},[_]),be=E.useRef(null),J=E.useRef(null),ee=E.useReducer(KL,Zh),le=Mm(ee,2),G=le[0],re=le[1],ne=G.isFocused,me=G.isFileDialogActive,Re=E.useRef(typeof window<"u"&&window.isSecureContext&&y&&TL()),gt=function(){!Re.current&&me&&setTimeout(function(){if(J.current){var xe=J.current.files;xe.length||(re({type:"closeDialog"}),we())}},300)};E.useEffect(function(){return window.addEventListener("focus",gt,!1),function(){window.removeEventListener("focus",gt,!1)}},[J,me,we,Re]);var tt=E.useRef([]),K=function(xe){be.current&&be.current.contains(xe.target)||(xe.preventDefault(),tt.current=[])};E.useEffect(function(){return C&&(document.addEventListener("dragover",Wb,!1),document.addEventListener("drop",K,!1)),function(){C&&(document.removeEventListener("dragover",Wb),document.removeEventListener("drop",K))}},[be,C]),E.useEffect(function(){return!r&&w&&be.current&&be.current.focus(),function(){}},[be,w,r]);var je=E.useCallback(function(ie){z?z(ie):console.error(ie)},[z]),Ae=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie),tt.current=[].concat($L(tt.current),[ie.target]),Ku(ie)&&Promise.resolve(a(ie)).then(function(xe){if(!(Gd(ie)&&!F)){var at=xe.length,Ge=at>0&&CL({files:xe,accept:W,minSize:c,maxSize:l,multiple:d,maxFiles:p,validator:B}),st=at>0&&!Ge;re({isDragAccept:Ge,isDragReject:st,isDragActive:!0,type:"setDraggedFiles"}),m&&m(ie)}}).catch(function(xe){return je(xe)})},[a,m,je,F,W,c,l,d,p,B]),ke=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie);var xe=Ku(ie);if(xe&&ie.dataTransfer)try{ie.dataTransfer.dropEffect="copy"}catch{}return xe&&g&&g(ie),!1},[g,F]),Y=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie);var xe=tt.current.filter(function(Ge){return be.current&&be.current.contains(Ge)}),at=xe.indexOf(ie.target);at!==-1&&xe.splice(at,1),tt.current=xe,!(xe.length>0)&&(re({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ku(ie)&&h&&h(ie))},[be,h,F]),fe=E.useCallback(function(ie,xe){var at=[],Ge=[];ie.forEach(function(st){var kn=Xj(st,W),Nt=Mm(kn,2),rr=Nt[0],ir=Nt[1],br=Yj(st,c,l),zn=Mm(br,2),Cn=zn[0],ar=zn[1],sr=B?B(st):null;if(rr&&Cn&&!sr)at.push(st);else{var ii=[ir,ar];sr&&(ii=ii.concat(sr)),Ge.push({file:st,errors:ii.filter(function(Q){return Q})})}}),(!d&&at.length>1||d&&p>=1&&at.length>p)&&(at.forEach(function(st){Ge.push({file:st,errors:[kL]})}),at.splice(0)),re({acceptedFiles:at,fileRejections:Ge,isDragReject:Ge.length>0,type:"setFiles"}),x&&x(at,Ge,xe),Ge.length>0&&b&&b(Ge,xe),at.length>0&&j&&j(at,xe)},[re,d,W,c,l,p,x,j,b,B]),ve=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie),tt.current=[],Ku(ie)&&Promise.resolve(a(ie)).then(function(xe){Gd(ie)&&!F||fe(xe,ie)}).catch(function(xe){return je(xe)}),re({type:"reset"})},[a,fe,je,F]),Ve=E.useCallback(function(){if(Re.current){re({type:"openDialog"}),oe();var ie={multiple:d,types:pe};window.showOpenFilePicker(ie).then(function(xe){return a(xe)}).then(function(xe){fe(xe,null),re({type:"closeDialog"})}).catch(function(xe){IL(xe)?(we(xe),re({type:"closeDialog"})):ML(xe)?(Re.current=!1,J.current?(J.current.value=null,J.current.click()):je(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):je(xe)});return}J.current&&(re({type:"openDialog"}),oe(),J.current.value=null,J.current.click())},[re,oe,we,y,fe,je,pe,d]),pn=E.useCallback(function(ie){!be.current||!be.current.isEqualNode(ie.target)||(ie.key===" "||ie.key==="Enter"||ie.keyCode===32||ie.keyCode===13)&&(ie.preventDefault(),Ve())},[be,Ve]),Ye=E.useCallback(function(){re({type:"focus"})},[]),Sn=E.useCallback(function(){re({type:"blur"})},[]),nr=E.useCallback(function(){R||(PL()?setTimeout(Ve,0):Ve())},[R,Ve]),jt=function(xe){return r?null:xe},on=function(xe){return D?null:jt(xe)},St=function(xe){return T?null:jt(xe)},Zt=function(xe){F&&xe.stopPropagation()},Lt=E.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},xe=ie.refKey,at=xe===void 0?"ref":xe,Ge=ie.role,st=ie.onKeyDown,kn=ie.onFocus,Nt=ie.onBlur,rr=ie.onClick,ir=ie.onDragEnter,br=ie.onDragOver,zn=ie.onDragLeave,Cn=ie.onDrop,ar=Kd(ie,FL);return At(At(Jh({onKeyDown:on(fi(st,pn)),onFocus:on(fi(kn,Ye)),onBlur:on(fi(Nt,Sn)),onClick:jt(fi(rr,nr)),onDragEnter:St(fi(ir,Ae)),onDragOver:St(fi(br,ke)),onDragLeave:St(fi(zn,Y)),onDrop:St(fi(Cn,ve)),role:typeof Ge=="string"&&Ge!==""?Ge:"presentation"},at,be),!r&&!D?{tabIndex:0}:{}),ar)}},[be,pn,Ye,Sn,nr,Ae,ke,Y,ve,D,T,r]),Nn=E.useCallback(function(ie){ie.stopPropagation()},[]),Fn=E.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},xe=ie.refKey,at=xe===void 0?"ref":xe,Ge=ie.onChange,st=ie.onClick,kn=Kd(ie,zL),Nt=Jh({accept:W,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:jt(fi(Ge,ve)),onClick:jt(fi(st,Nn)),tabIndex:-1},at,J);return At(At({},Nt),kn)}},[J,n,d,ve,r]);return At(At({},G),{},{isFocused:ne&&!r,getRootProps:Lt,getInputProps:Fn,rootRef:be,inputRef:J,open:jt(Ve)})}function KL(e,t){switch(t.type){case"focus":return At(At({},e),{},{isFocused:!0});case"blur":return At(At({},e),{},{isFocused:!1});case"openDialog":return At(At({},Zh),{},{isFileDialogActive:!0});case"closeDialog":return At(At({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return At(At({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return At(At({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return At({},Zh);default:return e}}function qb(){}function r2({isOpen:e,onClose:t,modelId:n,dataset_id:r}){const{rootPath:a,datasets:l}=tr().props,[c,d]=E.useState(r?"model":null),{data:p,setData:m,post:h,processing:g,errors:x}=_c({config:null,dataset_id:r?r.toString():""}),j=C=>{const R=C[0];R&&m("config",R)},{getRootProps:b,getInputProps:_,isDragActive:N}=n2({onDrop:j,accept:{"application/json":[".json"]},multiple:!1}),y=p.config&&(r||c&&(c==="both"||c==="model"&&p.dataset_id)),w=()=>{if(!y)return;const C=new FormData;p.config&&C.append("config",p.config),r?(C.append("include_dataset","false"),C.append("dataset_id",r.toString())):(C.append("include_dataset",(c==="both").toString()),c==="model"&&p.dataset_id&&C.append("dataset_id",p.dataset_id)),t();const R=n?`${a}/models/${n}/upload`:`${a}/models/upload`;h(R,C,{preserveScroll:!1,onSuccess:()=>{window.location.href=window.location.href},onError:()=>{t()}})};return e?s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Upload Configuration"}),s.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:s.jsx(wO,{className:"w-5 h-5 text-blue-600"})})]}),!r&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("button",{onClick:()=>{d("model"),m("dataset_id","")},className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 ${c==="model"?"bg-blue-50 border-2 border-blue-500 ring-2 ring-blue-200":"bg-white border-2 border-gray-200 hover:border-blue-200"}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:"Model Only"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Upload model configuration and select a dataset"})]}),s.jsx(hw,{className:`w-5 h-5 ${c==="model"?"text-blue-600":"text-gray-400"}`})]})}),s.jsx("button",{onClick:()=>{d("both"),m("dataset_id","")},className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 ${c==="both"?"bg-blue-50 border-2 border-blue-500 ring-2 ring-blue-200":"bg-white border-2 border-gray-200 hover:border-blue-200"}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:"Model + Dataset"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Upload and validate both model and dataset configurations"})]}),s.jsx(wn,{className:`w-5 h-5 ${c==="both"?"text-blue-600":"text-gray-400"}`})]})})]}),c==="model"&&!r&&s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Select Dataset"}),s.jsx(Qe,{options:l.map(C=>({value:C.id,label:C.name,description:C.num_rows?`${C.num_rows.toLocaleString()} rows`:void 0})),value:p.dataset_id?parseInt(p.dataset_id):null,onChange:C=>m("dataset_id",C?C.toString():""),placeholder:"Select a dataset"}),x.dataset_id&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:x.dataset_id})]}),(c||r)&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{...b(),className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 border-2 border-dashed cursor-pointer
|
509
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e2(e,t){if(e){if(typeof e=="string")return Yh(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Yh(e,t)}}function Yh(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function qL(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],a=!0,l=!1,c,d;try{for(n=n.call(e);!(a=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));a=!0);}catch(p){l=!0,d=p}finally{try{!a&&n.return!=null&&n.return()}finally{if(l)throw d}}return r}}function VL(e){if(Array.isArray(e))return e}function Hb(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function At(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Hb(Object(n),!0).forEach(function(r){Jh(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Hb(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Jh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Kd(e,t){if(e==null)return{};var n=GL(e,t),r,a;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(a=0;a<l.length;a++)r=l[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GL(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,l;for(l=0;l<r.length;l++)a=r[l],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}var m0=E.forwardRef(function(e,t){var n=e.children,r=Kd(e,LL),a=n2(r),l=a.open,c=Kd(a,DL);return E.useImperativeHandle(t,function(){return{open:l}},[l]),er.createElement(E.Fragment,null,n(At(At({},c),{},{open:l})))});m0.displayName="Dropzone";var t2={disabled:!1,getFilesFromEvent:aL,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};m0.defaultProps=t2;m0.propTypes={children:dt.func,accept:dt.objectOf(dt.arrayOf(dt.string)),multiple:dt.bool,preventDropOnDocument:dt.bool,noClick:dt.bool,noKeyboard:dt.bool,noDrag:dt.bool,noDragEventsBubbling:dt.bool,minSize:dt.number,maxSize:dt.number,maxFiles:dt.number,disabled:dt.bool,getFilesFromEvent:dt.func,onFileDialogCancel:dt.func,onFileDialogOpen:dt.func,useFsAccessApi:dt.bool,autoFocus:dt.bool,onDragEnter:dt.func,onDragLeave:dt.func,onDragOver:dt.func,onDrop:dt.func,onDropAccepted:dt.func,onDropRejected:dt.func,onError:dt.func,validator:dt.func};var Zh={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function n2(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=At(At({},t2),e),n=t.accept,r=t.disabled,a=t.getFilesFromEvent,l=t.maxSize,c=t.minSize,d=t.multiple,p=t.maxFiles,m=t.onDragEnter,h=t.onDragLeave,g=t.onDragOver,x=t.onDrop,j=t.onDropAccepted,b=t.onDropRejected,_=t.onFileDialogCancel,N=t.onFileDialogOpen,y=t.useFsAccessApi,w=t.autoFocus,C=t.preventDropOnDocument,R=t.noClick,D=t.noKeyboard,T=t.noDrag,F=t.noDragEventsBubbling,z=t.onError,B=t.validator,W=E.useMemo(function(){return RL(n)},[n]),pe=E.useMemo(function(){return OL(n)},[n]),oe=E.useMemo(function(){return typeof N=="function"?N:qb},[N]),we=E.useMemo(function(){return typeof _=="function"?_:qb},[_]),be=E.useRef(null),J=E.useRef(null),ee=E.useReducer(KL,Zh),le=Mm(ee,2),G=le[0],re=le[1],ne=G.isFocused,me=G.isFileDialogActive,Re=E.useRef(typeof window<"u"&&window.isSecureContext&&y&&TL()),gt=function(){!Re.current&&me&&setTimeout(function(){if(J.current){var xe=J.current.files;xe.length||(re({type:"closeDialog"}),we())}},300)};E.useEffect(function(){return window.addEventListener("focus",gt,!1),function(){window.removeEventListener("focus",gt,!1)}},[J,me,we,Re]);var tt=E.useRef([]),K=function(xe){be.current&&be.current.contains(xe.target)||(xe.preventDefault(),tt.current=[])};E.useEffect(function(){return C&&(document.addEventListener("dragover",Wb,!1),document.addEventListener("drop",K,!1)),function(){C&&(document.removeEventListener("dragover",Wb),document.removeEventListener("drop",K))}},[be,C]),E.useEffect(function(){return!r&&w&&be.current&&be.current.focus(),function(){}},[be,w,r]);var je=E.useCallback(function(ie){z?z(ie):console.error(ie)},[z]),Ae=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie),tt.current=[].concat($L(tt.current),[ie.target]),Ku(ie)&&Promise.resolve(a(ie)).then(function(xe){if(!(Gd(ie)&&!F)){var at=xe.length,Ge=at>0&&CL({files:xe,accept:W,minSize:c,maxSize:l,multiple:d,maxFiles:p,validator:B}),st=at>0&&!Ge;re({isDragAccept:Ge,isDragReject:st,isDragActive:!0,type:"setDraggedFiles"}),m&&m(ie)}}).catch(function(xe){return je(xe)})},[a,m,je,F,W,c,l,d,p,B]),ke=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie);var xe=Ku(ie);if(xe&&ie.dataTransfer)try{ie.dataTransfer.dropEffect="copy"}catch{}return xe&&g&&g(ie),!1},[g,F]),Y=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie);var xe=tt.current.filter(function(Ge){return be.current&&be.current.contains(Ge)}),at=xe.indexOf(ie.target);at!==-1&&xe.splice(at,1),tt.current=xe,!(xe.length>0)&&(re({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Ku(ie)&&h&&h(ie))},[be,h,F]),fe=E.useCallback(function(ie,xe){var at=[],Ge=[];ie.forEach(function(st){var kn=Xj(st,W),Nt=Mm(kn,2),rr=Nt[0],ir=Nt[1],br=Yj(st,c,l),zn=Mm(br,2),Cn=zn[0],ar=zn[1],sr=B?B(st):null;if(rr&&Cn&&!sr)at.push(st);else{var ii=[ir,ar];sr&&(ii=ii.concat(sr)),Ge.push({file:st,errors:ii.filter(function(Q){return Q})})}}),(!d&&at.length>1||d&&p>=1&&at.length>p)&&(at.forEach(function(st){Ge.push({file:st,errors:[kL]})}),at.splice(0)),re({acceptedFiles:at,fileRejections:Ge,isDragReject:Ge.length>0,type:"setFiles"}),x&&x(at,Ge,xe),Ge.length>0&&b&&b(Ge,xe),at.length>0&&j&&j(at,xe)},[re,d,W,c,l,p,x,j,b,B]),ve=E.useCallback(function(ie){ie.preventDefault(),ie.persist(),Zt(ie),tt.current=[],Ku(ie)&&Promise.resolve(a(ie)).then(function(xe){Gd(ie)&&!F||fe(xe,ie)}).catch(function(xe){return je(xe)}),re({type:"reset"})},[a,fe,je,F]),Ve=E.useCallback(function(){if(Re.current){re({type:"openDialog"}),oe();var ie={multiple:d,types:pe};window.showOpenFilePicker(ie).then(function(xe){return a(xe)}).then(function(xe){fe(xe,null),re({type:"closeDialog"})}).catch(function(xe){IL(xe)?(we(xe),re({type:"closeDialog"})):ML(xe)?(Re.current=!1,J.current?(J.current.value=null,J.current.click()):je(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):je(xe)});return}J.current&&(re({type:"openDialog"}),oe(),J.current.value=null,J.current.click())},[re,oe,we,y,fe,je,pe,d]),pn=E.useCallback(function(ie){!be.current||!be.current.isEqualNode(ie.target)||(ie.key===" "||ie.key==="Enter"||ie.keyCode===32||ie.keyCode===13)&&(ie.preventDefault(),Ve())},[be,Ve]),Ye=E.useCallback(function(){re({type:"focus"})},[]),Sn=E.useCallback(function(){re({type:"blur"})},[]),nr=E.useCallback(function(){R||(PL()?setTimeout(Ve,0):Ve())},[R,Ve]),jt=function(xe){return r?null:xe},on=function(xe){return D?null:jt(xe)},St=function(xe){return T?null:jt(xe)},Zt=function(xe){F&&xe.stopPropagation()},Lt=E.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},xe=ie.refKey,at=xe===void 0?"ref":xe,Ge=ie.role,st=ie.onKeyDown,kn=ie.onFocus,Nt=ie.onBlur,rr=ie.onClick,ir=ie.onDragEnter,br=ie.onDragOver,zn=ie.onDragLeave,Cn=ie.onDrop,ar=Kd(ie,FL);return At(At(Jh({onKeyDown:on(fi(st,pn)),onFocus:on(fi(kn,Ye)),onBlur:on(fi(Nt,Sn)),onClick:jt(fi(rr,nr)),onDragEnter:St(fi(ir,Ae)),onDragOver:St(fi(br,ke)),onDragLeave:St(fi(zn,Y)),onDrop:St(fi(Cn,ve)),role:typeof Ge=="string"&&Ge!==""?Ge:"presentation"},at,be),!r&&!D?{tabIndex:0}:{}),ar)}},[be,pn,Ye,Sn,nr,Ae,ke,Y,ve,D,T,r]),Nn=E.useCallback(function(ie){ie.stopPropagation()},[]),Fn=E.useMemo(function(){return function(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},xe=ie.refKey,at=xe===void 0?"ref":xe,Ge=ie.onChange,st=ie.onClick,kn=Kd(ie,zL),Nt=Jh({accept:W,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:jt(fi(Ge,ve)),onClick:jt(fi(st,Nn)),tabIndex:-1},at,J);return At(At({},Nt),kn)}},[J,n,d,ve,r]);return At(At({},G),{},{isFocused:ne&&!r,getRootProps:Lt,getInputProps:Fn,rootRef:be,inputRef:J,open:jt(Ve)})}function KL(e,t){switch(t.type){case"focus":return At(At({},e),{},{isFocused:!0});case"blur":return At(At({},e),{},{isFocused:!1});case"openDialog":return At(At({},Zh),{},{isFileDialogActive:!0});case"closeDialog":return At(At({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return At(At({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return At(At({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return At({},Zh);default:return e}}function qb(){}function r2({isOpen:e,onClose:t,modelId:n,dataset_id:r}){const{rootPath:a,datasets:l}=tr().props,[c,d]=E.useState(r?"model":null),{data:p,setData:m,post:h,processing:g,errors:x}=_c({config:null,dataset_id:r?r.toString():""}),j=C=>{const R=C[0];R&&m("config",R)},{getRootProps:b,getInputProps:_,isDragActive:N}=n2({onDrop:j,accept:{"application/json":[".json"]},multiple:!1}),y=p.config&&(r||c&&(c==="both"||c==="model"&&p.dataset_id)),w=()=>{if(!y)return;const C=new FormData;p.config&&C.append("config",p.config),r?(C.append("include_dataset","false"),C.append("dataset_id",r.toString())):(C.append("include_dataset",(c==="both").toString()),c==="model"&&p.dataset_id&&C.append("dataset_id",p.dataset_id)),t();const R=n?`${a}/models/${n}/upload`:`${a}/models/upload`;h(R,C,{preserveScroll:!1,onSuccess:()=>{window.location.href=window.location.href},onError:()=>{t()}})};return e?s.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center z-50",children:s.jsxs("div",{className:"bg-white rounded-xl p-6 w-full max-w-md shadow-2xl",children:[s.jsxs("div",{className:"flex items-center justify-between mb-6",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Upload Configuration"}),s.jsx("div",{className:"p-2 bg-blue-50 rounded-lg",children:s.jsx(wO,{className:"w-5 h-5 text-blue-600"})})]}),!r&&s.jsxs("div",{className:"space-y-3",children:[s.jsx("button",{onClick:()=>{d("model"),m("dataset_id","")},className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 ${c==="model"?"bg-blue-50 border-2 border-blue-500 ring-2 ring-blue-200":"bg-white border-2 border-gray-200 hover:border-blue-200"}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:"Model Only"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Upload model configuration and select a dataset"})]}),s.jsx(hw,{className:`w-5 h-5 ${c==="model"?"text-blue-600":"text-gray-400"}`})]})}),s.jsx("button",{onClick:()=>{d("both"),m("dataset_id","")},className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 ${c==="both"?"bg-blue-50 border-2 border-blue-500 ring-2 ring-blue-200":"bg-white border-2 border-gray-200 hover:border-blue-200"}`,children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"font-medium text-gray-900",children:"Model + Dataset"}),s.jsx("div",{className:"text-sm text-gray-500",children:"Upload and validate both model and dataset configurations"})]}),s.jsx(wn,{className:`w-5 h-5 ${c==="both"?"text-blue-600":"text-gray-400"}`})]})})]}),c==="model"&&!r&&s.jsxs("div",{className:"mt-4",children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Select Dataset"}),s.jsx(Ke,{options:l.map(C=>({value:C.id,label:C.name,description:C.num_rows?`${C.num_rows.toLocaleString()} rows`:void 0})),value:p.dataset_id?parseInt(p.dataset_id):null,onChange:C=>m("dataset_id",C?C.toString():""),placeholder:"Select a dataset"}),x.dataset_id&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:x.dataset_id})]}),(c||r)&&s.jsxs("div",{className:"mt-4",children:[s.jsxs("div",{...b(),className:`w-full px-4 py-3 rounded-lg text-left transition-all duration-200 border-2 border-dashed cursor-pointer
|
510
510
|
${p.config||N?"border-blue-500 bg-blue-50":"border-gray-300 hover:border-blue-500"}`,children:[s.jsx("input",{..._()}),s.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm",children:[s.jsx(gc,{className:`w-4 h-4 ${p.config||N?"text-blue-600":"text-gray-400"}`}),s.jsx("span",{className:p.config||N?"text-blue-600":"text-gray-500",children:N?"Drop the file here":p.config?p.config.name:"Click or drag to select configuration file"})]})]}),x.config&&s.jsx("p",{className:"mt-1 text-sm text-red-600",children:x.config})]}),s.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[s.jsx("button",{onClick:t,className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Cancel"}),s.jsxs("button",{onClick:w,disabled:!y||g,className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-lg hover:bg-blue-700 disabled:bg-gray-300 disabled:cursor-not-allowed inline-flex items-center gap-2",children:[g?"Uploading...":"Upload",s.jsx(xg,{className:"w-4 h-4"})]})]})]})}):null}function QL({initialModel:e,onViewDetails:t,handleDelete:n,rootPath:r,datasets:a}){const[l,c]=E.useState(e),[d,p]=E.useState(!1),[m,h]=E.useState(!1),[g,x]=E.useState(!1);E.useEffect(()=>{c(e)},[e]),E.useEffect(()=>{let T;return l.is_training&&(T=window.setInterval(async()=>{const z=await(await fetch(`${r}/models/${l.id}`,{headers:{Accept:"application/json"}})).json();c(z.model)},2e3)),()=>{T&&window.clearInterval(T)}},[l.is_training,l.id,r]);const j=async()=>{try{c({...l,is_training:!0}),await Ze.post(`${r}/models/${l.id}/train`,{},{preserveScroll:!0,preserveState:!0})}catch(T){console.error("Failed to start training:",T)}},b=async()=>{try{await Ze.post(`${r}/models/${l.id}/abort`,{},{preserveScroll:!0,preserveState:!0});const F=await(await fetch(`${r}/models/${l.id}`,{headers:{Accept:"application/json"}})).json();c(F.model)}catch(T){console.error("Failed to abort training:",T),p(!0)}},_=l.dataset,N=l.retraining_job,y=l.last_run,w=()=>l.is_training?s.jsx(ps,{className:"w-4 h-4 animate-spin text-yellow-500"}):y?y.status==="failed"?s.jsx(Bl,{className:"w-4 h-4 text-red-500"}):y.status==="success"?s.jsx(gO,{className:"w-4 h-4 text-green-500"}):null:null,C=()=>l.is_training?"Training in progress...":y?y.status==="failed"?"Last run failed":y.status==="aborted"?"Last run aborted":y.status==="success"?y.deployable?"Last run succeeded":"Last run completed (below threshold)":"Unknown status":"Never trained",R=()=>l.is_training?"text-yellow-700":y?y.status==="failed"?"text-red-700":y.status==="success"?y.deployable?"text-green-700":"text-orange-700":"text-gray-700":"text-gray-500",D=()=>l.is_training?s.jsx("div",{className:"flex items-center space-x-2",children:s.jsx("button",{onClick:b,className:"text-gray-400 hover:text-red-600",title:"Abort training",children:s.jsx(Bl,{className:"w-5 h-5"})})}):null;return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium
|
511
|
-
${l.deployment_status==="inference"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:l.deployment_status}),l.is_training&&s.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:[s.jsx(ps,{className:"w-3 h-3 animate-spin"}),"training"]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:l.name}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:j,disabled:l.is_training,className:`text-gray-400 hover:text-green-600 transition-colors ${l.is_training?"opacity-50 cursor-not-allowed":""}`,title:"Train model",children:s.jsx(yw,{className:"w-5 h-5"})}),D(),s.jsx("button",{onClick:()=>h(!0),className:"text-gray-400 hover:text-blue-600",title:"Download configuration",children:s.jsx(pw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>x(!0),className:"text-gray-400 hover:text-green-600",title:"Upload configuration",children:s.jsx(gc,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${r}/models/${l.id}/edit`,className:"text-gray-400 hover:text-gray-600",title:"Edit model",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>n(l.id),className:"text-gray-400 hover:text-gray-600",title:"Delete model",children:s.jsx(Fo,{className:"w-5 h-5"})}),l.metrics_url&&s.jsx("a",{href:l.metrics_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-purple-600 transition-colors",title:"View metrics",children:s.jsx(dw,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${r}/models/${l.id}`,className:"text-gray-400 hover:text-gray-600",title:"View details",children:s.jsx(fw,{className:"w-5 h-5"})})]})]}),s.jsxs("p",{className:"text-sm text-gray-500",children:[s.jsx("span",{className:"font-semibold",children:"Model Type: "}),l.formatted_model_type]}),s.jsxs("p",{className:"text-sm text-gray-500",children:[s.jsx("span",{className:"font-semibold",children:"Version: "}),l.version]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4 text-gray-400"}),_?s.jsx(Zr,{href:`${r}/datasets/${_.id}`,className:"text-sm text-blue-600 hover:text-blue-800",children:_.name}):s.jsx("span",{className:"text-sm text-gray-600",children:"Dataset not found"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:N!=null&&N.active?`Retrains ${l.formatted_frequency}`:"Retrains manually"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(cO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:l.last_run_at?`Last run: ${new Date(l.last_run_at||"").toLocaleDateString()}`:"Never run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[w(),s.jsx("span",{className:Jr("text-sm",R()),children:C()})]})]}),(y==null?void 0:y.metrics)&&s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(y.metrics).map(([T,F])=>s.jsxs("div",{className:`px-2 py-1 rounded-md text-xs font-medium ${y.deployable?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:[T,": ",F.toFixed(4)]},T))})}),!l.is_training&&(y==null?void 0:y.status)==="failed"&&y.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>p(!d),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),d?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),d&&s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx(Lj,{stacktrace:y.stacktrace})})]}),m&&s.jsx(XM,{isOpen:m,onClose:()=>h(!1),modelId:l.id}),g&&s.jsx(r2,{isOpen:g,onClose:()=>x(!1),modelId:l.id,dataset_id:l.dataset_id,datasets:a}),s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("button",{onClick:()=>t(l.id),className:"text-gray-400 hover:text-blue-600"})})]})}const Lm=6;function XL({rootPath:e,models:t,datasets:n}){const[r,a]=E.useState(null),[l,c]=E.useState(""),[d,p]=E.useState(1),[m,h]=E.useState(!1),g=E.useMemo(()=>t.filter(_=>_.name.toLowerCase().includes(l.toLowerCase())||_.model_type.toLowerCase().includes(l.toLowerCase())),[l,t]),x=Math.ceil(g.length/Lm),j=g.slice((d-1)*Lm,d*Lm),b=_=>{confirm("Are you sure you want to delete this model?")&&Ze.delete(`${e}/models/${_}`)};return t.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:yi,title:"Create your first ML model",description:"Get started by creating a machine learning model. You can train models for classification, regression, and more.",actionLabel:"Create Model",onAction:()=>{Ze.visit(`${e}/models/new`)}})}):s.jsxs("div",{className:"p-8",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Models"}),s.jsx(p0,{value:l,onChange:c,placeholder:"Search models..."})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-50",title:"Import model",children:[s.jsx(gc,{className:"w-4 h-4"}),"Import"]}),s.jsxs("button",{onClick:()=>Ze.visit(`${e}/models/new`),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Model"]})]})]}),j.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(yi,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No models found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No models match your search criteria. Try adjusting your search or create a new model."}),s.jsx("div",{className:"mt-6",children:s.jsxs("button",{onClick:()=>Ze.visit(`${e}/models/new`),className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Model"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:j.map(_=>s.jsx(QL,{initialModel:_,onViewDetails:()=>a(_.id),handleDelete:b,rootPath:e,datasets:n},_.id))}),x>1&&s.jsx(f0,{currentPage:d,totalPages:x,onPageChange:p})]})]}),s.jsx(r2,{isOpen:m,onClose:()=>h(!1),datasets:n})]})}const YL=Object.freeze(Object.defineProperty({__proto__:null,default:XL},Symbol.toStringTag,{value:"Module"}));function JL({attributes:e,columns:t,onChange:n}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"date_col",className:"block text-sm font-medium text-gray-700",children:"Date Column"}),s.jsx(Qe,{id:"date_col",value:e.date_col,options:t.map(r=>({value:r,label:r})),onChange:r=>n({...e,date_col:r}),placeholder:"Select date column"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"months_test",className:"block text-sm font-medium text-gray-700",children:"Test Months"}),s.jsx("input",{type:"number",id:"months_test",value:e.months_test,onChange:r=>n({...e,months_test:parseInt(r.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"months_valid",className:"block text-sm font-medium text-gray-700",children:"Validation Months"}),s.jsx("input",{type:"number",id:"months_valid",value:e.months_valid,onChange:r=>n({...e,months_valid:parseInt(r.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"1"})]})]})]})}function ZL({attributes:e,onChange:t}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(vw,{className:"w-5 h-5 text-blue-500 mt-0.5"}),s.jsx("p",{className:"text-sm text-blue-700",children:"Random splitting will automatically split your data into 60% training, 20% test, and 20% validation sets."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"train_ratio",className:"block text-sm font-medium text-gray-700",children:"Training Ratio"}),s.jsx("input",{type:"number",id:"train_ratio",value:e.train_ratio??.6,onChange:n=>t({...e,train_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"test_ratio",className:"block text-sm font-medium text-gray-700",children:"Test Ratio"}),s.jsx("input",{type:"number",id:"test_ratio",value:e.test_ratio??.2,onChange:n=>t({...e,test_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"valid_ratio",className:"block text-sm font-medium text-gray-700",children:"Validation Ratio"}),s.jsx("input",{type:"number",id:"valid_ratio",value:e.valid_ratio??.2,onChange:n=>t({...e,valid_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"seed",className:"block text-sm font-medium text-gray-700",children:"Random Seed (optional)"}),s.jsx("input",{type:"number",id:"seed",value:e.seed??"",onChange:n=>t({...e,seed:n.target.value?parseInt(n.target.value):void 0}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",placeholder:"Enter a random seed"})]})]})}function eD({attributes:e,available_files:t,onChange:n}){const[r,a]=er.useState([]);er.useEffect(()=>{const h=[...e.train_files.map(g=>({path:g,type:"train"})),...e.test_files.map(g=>({path:g,type:"test"})),...e.valid_files.map(g=>({path:g,type:"valid"}))];a(h)},[e.train_files,e.test_files,e.valid_files]);const l=h=>{const g=[...r,{path:h,type:"train"}];a(g),p(g)},c=(h,g)=>{const x=r.map((j,b)=>b===h?{...j,type:g}:j);a(x),p(x)},d=h=>{const g=r.filter((x,j)=>j!==h);a(g),p(g)},p=h=>{n({splitter_type:"predefined",train_files:h.filter(g=>g.type==="train").map(g=>g.path),test_files:h.filter(g=>g.type==="test").map(g=>g.path),valid_files:h.filter(g=>g.type==="valid").map(g=>g.path)})},m=t.filter(h=>!r.find(g=>g.path===h));return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Add File"}),s.jsx(Qe,{options:m.map(h=>({value:h,label:h.split("/").pop()||h,description:h})),value:null,onChange:h=>l(h),placeholder:"Select a file..."})]}),r.length>0?s.jsx("div",{className:"space-y-2",children:r.map((h,g)=>s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(yO,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),s.jsx("span",{className:"text-sm text-gray-900 truncate",children:h.path.split("/").pop()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:h.type,onChange:x=>c(g,x.target.value),className:"text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:[s.jsx("option",{value:"train",children:"Training Set"}),s.jsx("option",{value:"test",children:"Test Set"}),s.jsx("option",{value:"valid",children:"Validation Set"})]}),s.jsx("button",{onClick:()=>d(g),className:"text-sm text-red-600 hover:text-red-700",children:"Remove"})]})]},h.path))}):s.jsx("div",{className:"text-center py-4 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200",children:s.jsx("p",{className:"text-sm text-gray-500",children:"Select files to create your train/test/validation splits"})}),r.length>0&&s.jsxs("div",{className:"space-y-1 text-sm",children:[!r.some(h=>h.type==="train")&&s.jsx("p",{className:"text-yellow-600",children:"• You need at least one training set file"}),!r.some(h=>h.type==="test")&&s.jsx("p",{className:"text-yellow-600",children:"• You need at least one test set file"})]})]})}function Vb({targetColumn:e,testSize:t,validSize:n,columns:r,onChange:a}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Target Column"}),s.jsx(Qe,{options:r.map(l=>({value:l.name,label:l.name,description:`Type: ${l.type}`})),value:e,onChange:l=>a({targetColumn:l,testSize:t,validSize:n}),placeholder:"Select target column..."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Test Set Size (%)"}),s.jsx("input",{type:"number",min:1,max:40,value:t,onChange:l=>a({targetColumn:e,testSize:parseInt(l.target.value)||0,validSize:n}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Validation Set Size (%)"}),s.jsx("input",{type:"number",min:1,max:40,value:n,onChange:l=>a({targetColumn:e,testSize:t,validSize:parseInt(l.target.value)||0}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})]})}function tD({type:e,targetColumn:t,groupColumn:n,nSplits:r,columns:a,onChange:l}){return s.jsxs("div",{className:"space-y-4",children:[(e==="stratified"||e==="group")&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e==="stratified"?"Target Column":"Group Column"}),s.jsx(Qe,{options:a.map(c=>({value:c.name,label:c.name,description:`Type: ${c.type}`})),value:e==="stratified"?t:n,onChange:c=>l({targetColumn:e==="stratified"?c:t,groupColumn:e==="group"?c:n,nSplits:r}),placeholder:`Select ${e==="stratified"?"target":"group"} column...`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Number of Splits"}),s.jsx("input",{type:"number",min:2,max:10,value:r,onChange:c=>l({targetColumn:t,groupColumn:n,nSplits:parseInt(c.target.value)||2}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})}function nD({p:e,onChange:t}){return s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Number of samples to leave out (P)"}),s.jsx("input",{type:"number",min:1,max:100,value:e,onChange:n=>t(parseInt(n.target.value)||1),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Each training set will have P samples removed, which form the test set."})]})})}const rD=[{value:"date",label:"Date Split",description:"Split data based on a date/time column"},{value:"random",label:"Random Split",description:"Randomly split data into train/test/validation sets (70/20/10)"},{value:"predefined",label:"Predefined Splits",description:"Use separate files for train/test/validation sets"}],iD={date:{date_column:"",months_test:2,months_valid:1},random:{},predefined:{train_files:[],test_files:[],valid_files:[]},stratified:{targetColumn:"",testSize:20,validSize:10},stratified_kfold:{targetColumn:"",nSplits:5},group_kfold:{groupColumn:"",nSplits:5},group_shuffle:{groupColumn:"",testSize:20,validSize:10},leave_p_out:{p:1}};function aD({type:e,splitter_attributes:t,columns:n,available_files:r,onSplitterChange:a,onChange:l}){const c=n.filter(h=>h.type==="datetime").map(h=>h.name),d=h=>{l(h,iD[h])},p=(h,g)=>{l(h,g)},m=()=>{switch(e){case"date":return s.jsx(JL,{attributes:t,columns:c,onChange:h=>p(e,h)});case"random":return s.jsx(ZL,{attributes:t,onChange:h=>p(e,h)});case"predefined":return s.jsx(eD,{attributes:t,available_files:r,onChange:h=>p(e,h)});case"stratified":return s.jsx(Vb,{attributes:t,columns:n,onChange:h=>p(e,h)});case"stratified_kfold":case"group_kfold":return s.jsx(tD,{attributes:t,columns:n,onChange:h=>p(e,h)});case"group_shuffle":return s.jsx(Vb,{attributes:t,columns:n,onChange:h=>p(e,{groupColumn:h.targetColumn,testSize:h.testSize,validSize:h.validSize})});case"leave_p_out":return s.jsx(nD,{attributes:t,onChange:h=>p(e,h)});default:return null}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Split Type"}),s.jsx(Qe,{options:rD,value:e,onChange:h=>d(h)})]}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:m()})]})}const sD=e=>e.date_col?!e.months_test||e.months_test<=0?{isValid:!1,error:"Test months must be greater than 0"}:!e.months_valid||e.months_valid<=0?{isValid:!1,error:"Validation months must be greater than 0"}:{isValid:!0}:{isValid:!1,error:"Please select a date column"},oD=e=>{const t=(e.train_ratio??.6)+(e.test_ratio??.2)+(e.valid_ratio??.2);return Math.abs(t-1)>=.001?{isValid:!1,error:`Split ratios must sum to 1.0 (current sum: ${t.toFixed(2)})`}:{isValid:!0}},lD=e=>!e.train_files||e.train_files.length===0?{isValid:!1,error:"Please select at least one file for splitting"}:{isValid:!0},cD=e=>{if(!e.stratify_column)return{isValid:!1,error:"Please select a column to stratify on"};const t=(e.train_ratio??0)+(e.test_ratio??0)+(e.valid_ratio??0);return Math.abs(t-1)>=.001?{isValid:!1,error:`Split ratios must sum to 1.0 (current sum: ${t.toFixed(2)})`}:{isValid:!0}},uD=e=>!e.n_splits||e.n_splits<=1?{isValid:!1,error:"Number of splits must be greater than 1"}:{isValid:!0},dD=e=>!e.p||e.p<=0?{isValid:!1,error:"P value must be greater than 0"}:{isValid:!0},pD=(e,t)=>{switch(e){case"date":return sD(t);case"random":return oD(t);case"predefined":return lD(t);case"stratified":return cD(t);case"stratified_kfold":case"group_kfold":return uD(t);case"leave_p_out":return dD(t);default:return{isValid:!1,error:"Invalid splitter type"}}};function fD({constants:e,datasources:t}){var F;const[n,r]=E.useState(1),[a,l]=E.useState(null),[c,d]=E.useState("random"),{rootPath:p}=tr().props,m=z=>{switch(z){case"date":return{date_col:"",months_test:2,months_valid:2};case"random":return{};case"predefined":return{train_files:[],test_files:[],valid_files:[]};case"stratified":return{stratify_column:"",train_ratio:.6,test_ratio:.2,valid_ratio:.2};case"stratified_kfold":case"group_kfold":return{target_column:"",group_column:"",n_splits:5};case"leave_p_out":return{p:1,shuffle:!0,random_state:42};default:return{}}},h=_c({dataset:{name:"",datasource_id:"",splitter_attributes:{splitter_type:c,...m(c)}}});E.useEffect(()=>{h.setData("dataset.splitter_attributes",{splitter_type:c,...m(c)})},[c]);const g=(z,B)=>{d(z),h.setData("dataset.splitter_attributes",{splitter_type:z,...B})};console.log((F=h.dataset)==null?void 0:F.splitter_attributes);const{data:x,setData:j,post:b}=h,_=x.dataset.datasource_id?t.find(z=>z.id===Number(x.dataset.datasource_id)):null,N=((_==null?void 0:_.columns)||[]).map(z=>({name:z,type:((_==null?void 0:_.schema)||{})[z]||""})),y=_&&!_.is_syncing&&!_.sync_error,w=x.dataset.name&&y,C=()=>{w&&r(2)},R=z=>{z.preventDefault(),b(`${p}/datasets`,{onSuccess:()=>{Ze.visit(`${p}/datasets`)},onError:B=>{console.error("Failed to create dataset:",B)}})},D=()=>x.dataset.name?x.dataset.datasource_id?pD(x.dataset.splitter_attributes.splitter_type,x.dataset.splitter_attributes).error:"Please select a datasource":"Please enter a dataset name",T=()=>!D();return s.jsx("div",{className:"max-w-2xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:"Create New Dataset"}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${n>=1?"bg-blue-600":"bg-gray-200"} text-white font-medium text-sm`,children:"1"}),s.jsx("div",{className:`flex-1 h-0.5 mx-2 ${n>=2?"bg-blue-600":"bg-gray-200"}`}),s.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${n>=2?"bg-blue-600":"bg-gray-200"} text-white font-medium text-sm`,children:"2"})]}),s.jsxs("div",{className:"flex justify-between mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Basic Info"}),s.jsx("span",{className:"text-sm font-medium text-gray-600 mr-4",children:"Configure Split"})]})]}),n===1?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Dataset Name"}),s.jsx("input",{type:"text",id:"name",value:x.dataset.name,onChange:z=>j("dataset.name",z.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Description"}),s.jsx("textarea",{id:"description",value:x.dataset.description,onChange:z=>j("dataset.description",z.target.value),rows:3,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"datasource",className:"block text-sm font-medium text-gray-700 mb-1",children:"Datasource"}),s.jsx(Qe,{value:x.dataset.datasource_id,onChange:z=>j("dataset.datasource_id",z),options:t.map(z=>({value:z.id,label:z.name})),placeholder:"Select a datasource..."})]}),_&&s.jsx("div",{className:`rounded-lg p-4 ${_.sync_error?"bg-red-50":_.is_syncing?"bg-blue-50":"bg-green-50"}`,children:s.jsx("div",{className:"flex items-start gap-2",children:_.is_syncing?s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"w-5 h-5 text-blue-500 animate-spin"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-blue-800",children:"Datasource is syncing"}),s.jsx("p",{className:"mt-1 text-sm text-blue-700",children:"Please wait while we sync your data. This may take a few minutes."})]})]}):_.sync_error?s.jsxs(s.Fragment,{children:[s.jsx(Xn,{className:"w-5 h-5 text-red-500"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-red-800",children:"Sync failed"}),s.jsx("p",{className:"mt-1 text-sm text-red-700",children:"There was an error syncing your datasource."}),s.jsxs("button",{onClick:()=>l(_.id),className:"mt-2 flex items-center gap-1 text-sm text-red-700 hover:text-red-800",children:["View error details",a===_.id?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),a===_.id&&s.jsx("pre",{className:"mt-2 p-2 text-xs text-red-700 bg-red-100 rounded-md whitespace-pre-wrap break-words font-mono max-h-32 overflow-y-auto",children:_.stacktrace})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(wn,{className:"w-5 h-5 text-green-500"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-green-800",children:"Datasource ready"}),s.jsx("p",{className:"mt-1 text-sm text-green-700",children:"Your datasource is synced and ready to use."})]})]})})}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{type:"button",onClick:C,disabled:!w,className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Next"})})]}):s.jsxs("form",{onSubmit:R,className:"space-y-6",children:[s.jsx(aD,{type:c,splitter_attributes:h.data.dataset.splitter_attributes,columns:N,available_files:_.available_files,onChange:g}),D()&&s.jsx("div",{className:"mt-2 text-sm text-red-600",children:D()}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{type:"button",onClick:()=>r(1),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Back"}),s.jsx("button",{type:"submit",disabled:!T(),className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Create Dataset"})]})]})]})})}const mD=Object.freeze(Object.defineProperty({__proto__:null,default:fD},Symbol.toStringTag,{value:"Module"}));function hD({datasets:e,constants:t,errors:n}){return s.jsx("div",{className:"max-w-2xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:"Create New Model"}),s.jsx($j,{datasets:e,constants:t,errors:n})]})})}const gD=Object.freeze(Object.defineProperty({__proto__:null,default:hD},Symbol.toStringTag,{value:"Module"}));function xD(){const e=useNavigate();E.useState({name:"",description:"",groupId:"",testDatasetId:"",inputColumns:[],outputColumns:[],code:""});const t=n=>{console.log("Creating new feature:",n),e("/features")};return s.jsx("div",{className:"max-w-4xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(vg,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"New Feature"})]})}),s.jsx(Bj,{datasets:Uj,groups:is,onSubmit:t,onCancel:()=>e("/features")})]})})}const vD=Object.freeze(Object.defineProperty({__proto__:null,default:xD},Symbol.toStringTag,{value:"Module"})),yD=[{value:"America/New_York",label:"Eastern Time"},{value:"America/Chicago",label:"Central Time"},{value:"America/Denver",label:"Mountain Time"},{value:"America/Los_Angeles",label:"Pacific Time"}];function bD({settings:e}){var x,j,b,_,N;const{rootPath:t}=tr().props,n=_c({settings:{timezone:((x=e==null?void 0:e.settings)==null?void 0:x.timezone)||"America/New_York",s3_bucket:((j=e==null?void 0:e.settings)==null?void 0:j.s3_bucket)||"",s3_region:((b=e==null?void 0:e.settings)==null?void 0:b.s3_region)||"us-east-1"}}),{data:r,setData:a,patch:l,processing:c}=n;E.useState(!1);const[d,p]=E.useState(!1),[m,h]=E.useState(null),g=y=>{y.preventDefault(),p(!1),h(null);const w=setTimeout(()=>{h("Request timed out. Please try again.")},3e3);l(`${t}/settings`,{onSuccess:()=>{clearTimeout(w),p(!0)},onError:()=>{clearTimeout(w),h("Failed to save settings. Please try again.")}})};return s.jsx("div",{className:"max-w-4xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Aa,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Settings"})]})}),s.jsxs("form",{onSubmit:g,className:"p-6 space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(vO,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"General Settings"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Timezone"}),s.jsx("select",{id:"timezone",value:r.settings.timezone,onChange:y=>a({...r,settings:{...r.settings,timezone:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:yD.map(y=>s.jsx("option",{value:y.value,children:y.label},y.value))}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"All dates and times will be displayed in this timezone"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(wn,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"S3 Configuration"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"bucket",className:"block text-sm font-medium text-gray-700 mb-1",children:"Default S3 Bucket"}),s.jsx("input",{type:"text",id:"bucket",value:r.settings.s3_bucket,onChange:y=>a({...r,settings:{...r.settings,s3_bucket:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"my-bucket"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"region",className:"block text-sm font-medium text-gray-700 mb-1",children:"AWS Region"}),s.jsxs("select",{id:"region",value:r.settings.s3_region,onChange:y=>a({...r,settings:{...r.settings,s3_region:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:[s.jsx("option",{value:"us-east-1",children:"US East (N. Virginia)"}),s.jsx("option",{value:"us-east-2",children:"US East (Ohio)"}),s.jsx("option",{value:"us-west-1",children:"US West (N. California)"}),s.jsx("option",{value:"us-west-2",children:"US West (Oregon)"})]})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(xw,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Deployment Information"})]}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Git SHA"}),s.jsx("span",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600",children:((_=e==null?void 0:e.settings)==null?void 0:_.git_sha)||"Not available"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"EasyML Version"}),s.jsx("span",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600",children:((N=e==null?void 0:e.settings)==null?void 0:N.version)||"Not available"})]})]})})]}),s.jsxs("div",{className:"pt-6 border-t flex items-center justify-between",children:[d&&s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ww,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Settings saved successfully"})]}),m&&s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:m})]}),s.jsx("div",{className:"flex gap-3",children:s.jsx("button",{type:"submit",disabled:c,className:`px-4 py-2 text-white text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${c?"bg-blue-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,children:c?"Saving...":"Save Settings"})})]})]})]})})}const wD=Object.freeze(Object.defineProperty({__proto__:null,default:bD},Symbol.toStringTag,{value:"Module"})),Qu=3,_D={root_mean_squared_error:"rmse",mean_absolute_error:"mae",mean_squared_error:"mse",r2_score:"r2",accuracy_score:"accuracy",precision_score:"precision",recall_score:"recall"};function jD({model:e,onBack:t,rootPath:n}){var R,D;const[r,a]=E.useState("overview"),[l,c]=E.useState(((R=e.retraining_runs)==null?void 0:R.runs)||[]);E.useState(!1);const[d,p]=E.useState({offset:0,limit:20,total_count:((D=e.retraining_runs)==null?void 0:D.total_count)||0}),[m,h]=E.useState(1),g=e.dataset,x=e.retraining_job,j=d.offset+d.limit<d.total_count;E.useEffect(()=>{let T;return l.find(z=>z.is_deploying)&&(T=window.setInterval(async()=>{Ze.get(window.location.href,{preserveScroll:!0,preserveState:!0,only:["runs"]})},2e3)),()=>{T&&window.clearInterval(T)}},[l]);const b=async T=>{if(T.is_deploying)return;const F=l.map(z=>z.id===T.id?{...z,is_deploying:!0}:z);c(F);try{await Ze.post(`${n}/models/${e.id}/deploys`,{retraining_run_id:T.id},{preserveScroll:!0,preserveState:!0})}catch(z){console.error("Failed to deploy model:",z);const B=l.map(W=>W.id===T.id?{...W,is_deploying:!1}:W);c(B)}};E.useEffect(()=>{Math.ceil(l.length/Qu)-m<=2&&j&&loadMoreRuns()},[m,l,j]);const _=Math.ceil(l.length/Qu),N=l.slice((m-1)*Qu,m*Qu),y=T=>{h(T),_-T<2&&j&&loadMoreRuns()},w=T=>T.status==="deployed",C=T=>_D[T]||T;return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("div",{className:"flex space-x-4 ml-auto",children:s.jsx("button",{onClick:()=>a("overview"),className:`px-4 py-2 text-sm font-medium rounded-md ${r==="overview"?"bg-blue-100 text-blue-700":"text-gray-500 hover:text-gray-700"}`,children:"Overview"})})}),s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:e.name}),s.jsxs("p",{className:"text-gray-600 mt-1",children:[s.jsx("span",{className:"font-medium",children:"Version:"})," ",e.version," • ",s.jsx("span",{className:"font-medium",children:"Type:"})," ",e.formatted_model_type]})]}),s.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${e.deployment_status==="inference"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:e.deployment_status})]}),x&&s.jsxs("div",{className:"mt-6 bg-gray-50 rounded-lg p-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Training Schedule"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-5 h-5 text-gray-400"}),s.jsx("span",{children:x.active?`Runs ${x.formatted_frequency}`:"None (Triggered Manually)"})]}),x.active&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xO,{className:"w-5 h-5 text-gray-400"}),s.jsxs("span",{children:["at ",x.at.hour,":00"]})]})]})]})]}),r==="overview"?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Retraining Runs"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>y(T=>Math.max(1,T-1)),disabled:m===1,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-5 h-5"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:["Page ",m," of ",_]}),s.jsx("button",{onClick:()=>y(T=>Math.min(_,T+1)),disabled:m===_,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-5 h-5"})})]})]}),s.jsx("div",{className:"space-y-4",children:N.map((T,F)=>s.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-gray-300 transition-colors",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[!w(T)&&s.jsx("span",{className:`px-2 py-1 rounded-md text-sm font-medium ${T.status==="success"?"bg-green-100 text-green-800":T.status==="running"?"bg-blue-100 text-blue-800":"bg-red-100 text-red-800"}`,children:T.status}),w(T)&&s.jsxs("span",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded-md text-sm font-medium flex items-center gap-1",children:[s.jsx(hy,{className:"w-4 h-4"}),"deployed"]}),T.metrics_url&&s.jsxs("a",{href:T.metrics_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",title:"View run metrics",children:[s.jsx(dw,{className:"w-4 h-4"}),"metrics"]})]})}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:new Date(T.started_at).toLocaleString()}),T.status==="success"&&T.deployable&&s.jsx("div",{className:"flex gap-2 items-center",children:w(T)?s.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"deployed"}):s.jsx("button",{onClick:()=>b(T),disabled:T.is_deploying,className:`ml-4 inline-flex items-center gap-2 px-3 py-1 rounded-md text-sm font-medium
|
511
|
+
${l.deployment_status==="inference"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:l.deployment_status}),l.is_training&&s.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-medium bg-yellow-100 text-yellow-800",children:[s.jsx(ps,{className:"w-3 h-3 animate-spin"}),"training"]})]}),s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:l.name}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx("button",{onClick:j,disabled:l.is_training,className:`text-gray-400 hover:text-green-600 transition-colors ${l.is_training?"opacity-50 cursor-not-allowed":""}`,title:"Train model",children:s.jsx(yw,{className:"w-5 h-5"})}),D(),s.jsx("button",{onClick:()=>h(!0),className:"text-gray-400 hover:text-blue-600",title:"Download configuration",children:s.jsx(pw,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>x(!0),className:"text-gray-400 hover:text-green-600",title:"Upload configuration",children:s.jsx(gc,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${r}/models/${l.id}/edit`,className:"text-gray-400 hover:text-gray-600",title:"Edit model",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{onClick:()=>n(l.id),className:"text-gray-400 hover:text-gray-600",title:"Delete model",children:s.jsx(Fo,{className:"w-5 h-5"})}),l.metrics_url&&s.jsx("a",{href:l.metrics_url,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-purple-600 transition-colors",title:"View metrics",children:s.jsx(dw,{className:"w-5 h-5"})}),s.jsx(Zr,{href:`${r}/models/${l.id}`,className:"text-gray-400 hover:text-gray-600",title:"View details",children:s.jsx(fw,{className:"w-5 h-5"})})]})]}),s.jsxs("p",{className:"text-sm text-gray-500",children:[s.jsx("span",{className:"font-semibold",children:"Model Type: "}),l.formatted_model_type]}),s.jsxs("p",{className:"text-sm text-gray-500",children:[s.jsx("span",{className:"font-semibold",children:"Version: "}),l.version]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(wn,{className:"w-4 h-4 text-gray-400"}),_?s.jsx(Zr,{href:`${r}/datasets/${_.id}`,className:"text-sm text-blue-600 hover:text-blue-800",children:_.name}):s.jsx("span",{className:"text-sm text-gray-600",children:"Dataset not found"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:N!=null&&N.active?`Retrains ${l.formatted_frequency}`:"Retrains manually"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(cO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:l.last_run_at?`Last run: ${new Date(l.last_run_at||"").toLocaleDateString()}`:"Never run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[w(),s.jsx("span",{className:Jr("text-sm",R()),children:C()})]})]}),(y==null?void 0:y.metrics)&&s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsx("div",{className:"flex flex-wrap gap-2",children:Object.entries(y.metrics).map(([T,F])=>s.jsxs("div",{className:`px-2 py-1 rounded-md text-xs font-medium ${y.deployable?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:[T,": ",F.toFixed(4)]},T))})}),!l.is_training&&(y==null?void 0:y.status)==="failed"&&y.stacktrace&&s.jsxs("div",{className:"mt-4 pt-4 border-t border-gray-100",children:[s.jsxs("button",{onClick:()=>p(!d),className:"flex items-center gap-2 text-sm text-red-600 hover:text-red-700",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{children:"View Error Details"}),d?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),d&&s.jsx("div",{className:"mt-2 p-3 bg-red-50 rounded-md",children:s.jsx(Lj,{stacktrace:y.stacktrace})})]}),m&&s.jsx(XM,{isOpen:m,onClose:()=>h(!1),modelId:l.id}),g&&s.jsx(r2,{isOpen:g,onClose:()=>x(!1),modelId:l.id,dataset_id:l.dataset_id,datasets:a}),s.jsx("div",{className:"flex items-center space-x-4",children:s.jsx("button",{onClick:()=>t(l.id),className:"text-gray-400 hover:text-blue-600"})})]})}const Lm=6;function XL({rootPath:e,models:t,datasets:n}){const[r,a]=E.useState(null),[l,c]=E.useState(""),[d,p]=E.useState(1),[m,h]=E.useState(!1),g=E.useMemo(()=>t.filter(_=>_.name.toLowerCase().includes(l.toLowerCase())||_.model_type.toLowerCase().includes(l.toLowerCase())),[l,t]),x=Math.ceil(g.length/Lm),j=g.slice((d-1)*Lm,d*Lm),b=_=>{confirm("Are you sure you want to delete this model?")&&Ze.delete(`${e}/models/${_}`)};return t.length===0?s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:yi,title:"Create your first ML model",description:"Get started by creating a machine learning model. You can train models for classification, regression, and more.",actionLabel:"Create Model",onAction:()=>{Ze.visit(`${e}/models/new`)}})}):s.jsxs("div",{className:"p-8",children:[s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Models"}),s.jsx(p0,{value:l,onChange:c,placeholder:"Search models..."})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-50",title:"Import model",children:[s.jsx(gc,{className:"w-4 h-4"}),"Import"]}),s.jsxs("button",{onClick:()=>Ze.visit(`${e}/models/new`),className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Model"]})]})]}),j.length===0?s.jsxs("div",{className:"text-center py-12 bg-white rounded-lg shadow",children:[s.jsx(yi,{className:"mx-auto h-12 w-12 text-gray-400"}),s.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"No models found"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"No models match your search criteria. Try adjusting your search or create a new model."}),s.jsx("div",{className:"mt-6",children:s.jsxs("button",{onClick:()=>Ze.visit(`${e}/models/new`),className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500",children:[s.jsx(Ea,{className:"w-4 h-4 mr-2"}),"New Model"]})})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:j.map(_=>s.jsx(QL,{initialModel:_,onViewDetails:()=>a(_.id),handleDelete:b,rootPath:e,datasets:n},_.id))}),x>1&&s.jsx(f0,{currentPage:d,totalPages:x,onPageChange:p})]})]}),s.jsx(r2,{isOpen:m,onClose:()=>h(!1),datasets:n})]})}const YL=Object.freeze(Object.defineProperty({__proto__:null,default:XL},Symbol.toStringTag,{value:"Module"}));function JL({attributes:e,columns:t,onChange:n}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"date_col",className:"block text-sm font-medium text-gray-700",children:"Date Column"}),s.jsx(Ke,{id:"date_col",value:e.date_col,options:t.map(r=>({value:r,label:r})),onChange:r=>n({...e,date_col:r}),placeholder:"Select date column"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"months_test",className:"block text-sm font-medium text-gray-700",children:"Test Months"}),s.jsx("input",{type:"number",id:"months_test",value:e.months_test,onChange:r=>n({...e,months_test:parseInt(r.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"months_valid",className:"block text-sm font-medium text-gray-700",children:"Validation Months"}),s.jsx("input",{type:"number",id:"months_valid",value:e.months_valid,onChange:r=>n({...e,months_valid:parseInt(r.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"1"})]})]})]})}function ZL({attributes:e,onChange:t}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-start gap-2",children:[s.jsx(vw,{className:"w-5 h-5 text-blue-500 mt-0.5"}),s.jsx("p",{className:"text-sm text-blue-700",children:"Random splitting will automatically split your data into 60% training, 20% test, and 20% validation sets."})]}),s.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"train_ratio",className:"block text-sm font-medium text-gray-700",children:"Training Ratio"}),s.jsx("input",{type:"number",id:"train_ratio",value:e.train_ratio??.6,onChange:n=>t({...e,train_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"test_ratio",className:"block text-sm font-medium text-gray-700",children:"Test Ratio"}),s.jsx("input",{type:"number",id:"test_ratio",value:e.test_ratio??.2,onChange:n=>t({...e,test_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"valid_ratio",className:"block text-sm font-medium text-gray-700",children:"Validation Ratio"}),s.jsx("input",{type:"number",id:"valid_ratio",value:e.valid_ratio??.2,onChange:n=>t({...e,valid_ratio:parseFloat(n.target.value)}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",min:"0",max:"1",step:"0.1"})]})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"seed",className:"block text-sm font-medium text-gray-700",children:"Random Seed (optional)"}),s.jsx("input",{type:"number",id:"seed",value:e.seed??"",onChange:n=>t({...e,seed:n.target.value?parseInt(n.target.value):void 0}),className:"mt-1 p-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm",placeholder:"Enter a random seed"})]})]})}function eD({attributes:e,available_files:t,onChange:n}){const[r,a]=er.useState([]);er.useEffect(()=>{const h=[...e.train_files.map(g=>({path:g,type:"train"})),...e.test_files.map(g=>({path:g,type:"test"})),...e.valid_files.map(g=>({path:g,type:"valid"}))];a(h)},[e.train_files,e.test_files,e.valid_files]);const l=h=>{const g=[...r,{path:h,type:"train"}];a(g),p(g)},c=(h,g)=>{const x=r.map((j,b)=>b===h?{...j,type:g}:j);a(x),p(x)},d=h=>{const g=r.filter((x,j)=>j!==h);a(g),p(g)},p=h=>{n({splitter_type:"predefined",train_files:h.filter(g=>g.type==="train").map(g=>g.path),test_files:h.filter(g=>g.type==="test").map(g=>g.path),valid_files:h.filter(g=>g.type==="valid").map(g=>g.path)})},m=t.filter(h=>!r.find(g=>g.path===h));return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Add File"}),s.jsx(Ke,{options:m.map(h=>({value:h,label:h.split("/").pop()||h,description:h})),value:null,onChange:h=>l(h),placeholder:"Select a file..."})]}),r.length>0?s.jsx("div",{className:"space-y-2",children:r.map((h,g)=>s.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[s.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[s.jsx(yO,{className:"w-4 h-4 text-gray-400 flex-shrink-0"}),s.jsx("span",{className:"text-sm text-gray-900 truncate",children:h.path.split("/").pop()})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("select",{value:h.type,onChange:x=>c(g,x.target.value),className:"text-sm rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:[s.jsx("option",{value:"train",children:"Training Set"}),s.jsx("option",{value:"test",children:"Test Set"}),s.jsx("option",{value:"valid",children:"Validation Set"})]}),s.jsx("button",{onClick:()=>d(g),className:"text-sm text-red-600 hover:text-red-700",children:"Remove"})]})]},h.path))}):s.jsx("div",{className:"text-center py-4 bg-gray-50 rounded-lg border-2 border-dashed border-gray-200",children:s.jsx("p",{className:"text-sm text-gray-500",children:"Select files to create your train/test/validation splits"})}),r.length>0&&s.jsxs("div",{className:"space-y-1 text-sm",children:[!r.some(h=>h.type==="train")&&s.jsx("p",{className:"text-yellow-600",children:"• You need at least one training set file"}),!r.some(h=>h.type==="test")&&s.jsx("p",{className:"text-yellow-600",children:"• You need at least one test set file"})]})]})}function Vb({targetColumn:e,testSize:t,validSize:n,columns:r,onChange:a}){return s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Target Column"}),s.jsx(Ke,{options:r.map(l=>({value:l.name,label:l.name,description:`Type: ${l.type}`})),value:e,onChange:l=>a({targetColumn:l,testSize:t,validSize:n}),placeholder:"Select target column..."})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Test Set Size (%)"}),s.jsx("input",{type:"number",min:1,max:40,value:t,onChange:l=>a({targetColumn:e,testSize:parseInt(l.target.value)||0,validSize:n}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Validation Set Size (%)"}),s.jsx("input",{type:"number",min:1,max:40,value:n,onChange:l=>a({targetColumn:e,testSize:t,validSize:parseInt(l.target.value)||0}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})]})}function tD({type:e,targetColumn:t,groupColumn:n,nSplits:r,columns:a,onChange:l}){return s.jsxs("div",{className:"space-y-4",children:[(e==="stratified"||e==="group")&&s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:e==="stratified"?"Target Column":"Group Column"}),s.jsx(Ke,{options:a.map(c=>({value:c.name,label:c.name,description:`Type: ${c.type}`})),value:e==="stratified"?t:n,onChange:c=>l({targetColumn:e==="stratified"?c:t,groupColumn:e==="group"?c:n,nSplits:r}),placeholder:`Select ${e==="stratified"?"target":"group"} column...`})]}),s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Number of Splits"}),s.jsx("input",{type:"number",min:2,max:10,value:r,onChange:c=>l({targetColumn:t,groupColumn:n,nSplits:parseInt(c.target.value)||2}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"})]})]})}function nD({p:e,onChange:t}){return s.jsx("div",{className:"space-y-4",children:s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Number of samples to leave out (P)"}),s.jsx("input",{type:"number",min:1,max:100,value:e,onChange:n=>t(parseInt(n.target.value)||1),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Each training set will have P samples removed, which form the test set."})]})})}const rD=[{value:"date",label:"Date Split",description:"Split data based on a date/time column"},{value:"random",label:"Random Split",description:"Randomly split data into train/test/validation sets (70/20/10)"},{value:"predefined",label:"Predefined Splits",description:"Use separate files for train/test/validation sets"}],iD={date:{date_column:"",months_test:2,months_valid:1},random:{},predefined:{train_files:[],test_files:[],valid_files:[]},stratified:{targetColumn:"",testSize:20,validSize:10},stratified_kfold:{targetColumn:"",nSplits:5},group_kfold:{groupColumn:"",nSplits:5},group_shuffle:{groupColumn:"",testSize:20,validSize:10},leave_p_out:{p:1}};function aD({type:e,splitter_attributes:t,columns:n,available_files:r,onSplitterChange:a,onChange:l}){const c=n.filter(h=>h.type==="datetime").map(h=>h.name),d=h=>{l(h,iD[h])},p=(h,g)=>{l(h,g)},m=()=>{switch(e){case"date":return s.jsx(JL,{attributes:t,columns:c,onChange:h=>p(e,h)});case"random":return s.jsx(ZL,{attributes:t,onChange:h=>p(e,h)});case"predefined":return s.jsx(eD,{attributes:t,available_files:r,onChange:h=>p(e,h)});case"stratified":return s.jsx(Vb,{attributes:t,columns:n,onChange:h=>p(e,h)});case"stratified_kfold":case"group_kfold":return s.jsx(tD,{attributes:t,columns:n,onChange:h=>p(e,h)});case"group_shuffle":return s.jsx(Vb,{attributes:t,columns:n,onChange:h=>p(e,{groupColumn:h.targetColumn,testSize:h.testSize,validSize:h.validSize})});case"leave_p_out":return s.jsx(nD,{attributes:t,onChange:h=>p(e,h)});default:return null}};return s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Split Type"}),s.jsx(Ke,{options:rD,value:e,onChange:h=>d(h)})]}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:m()})]})}const sD=e=>e.date_col?!e.months_test||e.months_test<=0?{isValid:!1,error:"Test months must be greater than 0"}:!e.months_valid||e.months_valid<=0?{isValid:!1,error:"Validation months must be greater than 0"}:{isValid:!0}:{isValid:!1,error:"Please select a date column"},oD=e=>{const t=(e.train_ratio??.6)+(e.test_ratio??.2)+(e.valid_ratio??.2);return Math.abs(t-1)>=.001?{isValid:!1,error:`Split ratios must sum to 1.0 (current sum: ${t.toFixed(2)})`}:{isValid:!0}},lD=e=>!e.train_files||e.train_files.length===0?{isValid:!1,error:"Please select at least one file for splitting"}:{isValid:!0},cD=e=>{if(!e.stratify_column)return{isValid:!1,error:"Please select a column to stratify on"};const t=(e.train_ratio??0)+(e.test_ratio??0)+(e.valid_ratio??0);return Math.abs(t-1)>=.001?{isValid:!1,error:`Split ratios must sum to 1.0 (current sum: ${t.toFixed(2)})`}:{isValid:!0}},uD=e=>!e.n_splits||e.n_splits<=1?{isValid:!1,error:"Number of splits must be greater than 1"}:{isValid:!0},dD=e=>!e.p||e.p<=0?{isValid:!1,error:"P value must be greater than 0"}:{isValid:!0},pD=(e,t)=>{switch(e){case"date":return sD(t);case"random":return oD(t);case"predefined":return lD(t);case"stratified":return cD(t);case"stratified_kfold":case"group_kfold":return uD(t);case"leave_p_out":return dD(t);default:return{isValid:!1,error:"Invalid splitter type"}}};function fD({constants:e,datasources:t}){var F;const[n,r]=E.useState(1),[a,l]=E.useState(null),[c,d]=E.useState("random"),{rootPath:p}=tr().props,m=z=>{switch(z){case"date":return{date_col:"",months_test:2,months_valid:2};case"random":return{};case"predefined":return{train_files:[],test_files:[],valid_files:[]};case"stratified":return{stratify_column:"",train_ratio:.6,test_ratio:.2,valid_ratio:.2};case"stratified_kfold":case"group_kfold":return{target_column:"",group_column:"",n_splits:5};case"leave_p_out":return{p:1,shuffle:!0,random_state:42};default:return{}}},h=_c({dataset:{name:"",datasource_id:"",view_class:"",splitter_attributes:{splitter_type:c,...m(c)}}});E.useEffect(()=>{h.setData("dataset.splitter_attributes",{splitter_type:c,...m(c)})},[c]);const g=(z,B)=>{d(z),h.setData("dataset.splitter_attributes",{splitter_type:z,...B})};console.log((F=h.dataset)==null?void 0:F.splitter_attributes);const{data:x,setData:j,post:b}=h,_=x.dataset.datasource_id?t.find(z=>z.id===Number(x.dataset.datasource_id)):null,N=((_==null?void 0:_.columns)||[]).map(z=>({name:z,type:((_==null?void 0:_.schema)||{})[z]||""})),y=_&&!_.is_syncing&&!_.sync_error,w=x.dataset.name&&y,C=()=>{w&&r(2)},R=z=>{z.preventDefault(),b(`${p}/datasets`,{onSuccess:()=>{Ze.visit(`${p}/datasets`)},onError:B=>{console.error("Failed to create dataset:",B)}})},D=()=>x.dataset.name?x.dataset.datasource_id?pD(x.dataset.splitter_attributes.splitter_type,x.dataset.splitter_attributes).error:"Please select a datasource":"Please enter a dataset name",T=()=>!D();return s.jsx("div",{className:"max-w-2xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:"Create New Dataset"}),s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex items-center",children:[s.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${n>=1?"bg-blue-600":"bg-gray-200"} text-white font-medium text-sm`,children:"1"}),s.jsx("div",{className:`flex-1 h-0.5 mx-2 ${n>=2?"bg-blue-600":"bg-gray-200"}`}),s.jsx("div",{className:`flex items-center justify-center w-8 h-8 rounded-full ${n>=2?"bg-blue-600":"bg-gray-200"} text-white font-medium text-sm`,children:"2"})]}),s.jsxs("div",{className:"flex justify-between mt-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-600",children:"Basic Info"}),s.jsx("span",{className:"text-sm font-medium text-gray-600 mr-4",children:"Configure Split"})]})]}),n===1?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"name",className:"block text-sm font-medium text-gray-700",children:"Dataset Name"}),s.jsx("input",{type:"text",id:"name",value:x.dataset.name,onChange:z=>j("dataset.name",z.target.value),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border",required:!0})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"description",className:"block text-sm font-medium text-gray-700",children:"Description"}),s.jsx("textarea",{id:"description",value:x.dataset.description,onChange:z=>j("dataset.description",z.target.value),rows:3,className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500 py-2 px-4 shadow-sm border-gray-300 border"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"datasource",className:"block text-sm font-medium text-gray-700 mb-1",children:"Datasource"}),s.jsx(Ke,{value:x.dataset.datasource_id,onChange:z=>j("dataset.datasource_id",z),options:t.map(z=>({value:z.id,label:z.name})),placeholder:"Select a datasource..."})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"view_class",className:"block text-sm font-medium text-gray-700",children:"View Class"}),s.jsx(Ke,{value:x.dataset.view_class,onChange:z=>j("dataset.view_class",z),options:e.available_views,className:"mt-1",placeholder:"Select a view class (optional)..."})]}),_&&s.jsx("div",{className:`rounded-lg p-4 ${_.sync_error?"bg-red-50":_.is_syncing?"bg-blue-50":"bg-green-50"}`,children:s.jsx("div",{className:"flex items-start gap-2",children:_.is_syncing?s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"w-5 h-5 text-blue-500 animate-spin"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-blue-800",children:"Datasource is syncing"}),s.jsx("p",{className:"mt-1 text-sm text-blue-700",children:"Please wait while we sync your data. This may take a few minutes."})]})]}):_.sync_error?s.jsxs(s.Fragment,{children:[s.jsx(Xn,{className:"w-5 h-5 text-red-500"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-red-800",children:"Sync failed"}),s.jsx("p",{className:"mt-1 text-sm text-red-700",children:"There was an error syncing your datasource."}),s.jsxs("button",{onClick:()=>l(_.id),className:"mt-2 flex items-center gap-1 text-sm text-red-700 hover:text-red-800",children:["View error details",a===_.id?s.jsx(mc,{className:"w-4 h-4"}):s.jsx(Do,{className:"w-4 h-4"})]}),a===_.id&&s.jsx("pre",{className:"mt-2 p-2 text-xs text-red-700 bg-red-100 rounded-md whitespace-pre-wrap break-words font-mono max-h-32 overflow-y-auto",children:_.stacktrace})]})]}):s.jsxs(s.Fragment,{children:[s.jsx(wn,{className:"w-5 h-5 text-green-500"}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-green-800",children:"Datasource ready"}),s.jsx("p",{className:"mt-1 text-sm text-green-700",children:"Your datasource is synced and ready to use."})]})]})})}),s.jsx("div",{className:"flex justify-end",children:s.jsx("button",{type:"button",onClick:C,disabled:!w,className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Next"})})]}):s.jsxs("form",{onSubmit:R,className:"space-y-6",children:[s.jsx(aD,{type:c,splitter_attributes:h.data.dataset.splitter_attributes,columns:N,available_files:_.available_files,onChange:g}),D()&&s.jsx("div",{className:"mt-2 text-sm text-red-600",children:D()}),s.jsxs("div",{className:"flex justify-between",children:[s.jsx("button",{type:"button",onClick:()=>r(1),className:"px-4 py-2 text-sm font-medium text-gray-700 hover:text-gray-900",children:"Back"}),s.jsx("button",{type:"submit",disabled:!T(),className:"px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 disabled:bg-gray-300 disabled:cursor-not-allowed",children:"Create Dataset"})]})]})]})})}const mD=Object.freeze(Object.defineProperty({__proto__:null,default:fD},Symbol.toStringTag,{value:"Module"}));function hD({datasets:e,constants:t,errors:n}){return s.jsx("div",{className:"max-w-2xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900 mb-6",children:"Create New Model"}),s.jsx($j,{datasets:e,constants:t,errors:n})]})})}const gD=Object.freeze(Object.defineProperty({__proto__:null,default:hD},Symbol.toStringTag,{value:"Module"}));function xD(){const e=useNavigate();E.useState({name:"",description:"",groupId:"",testDatasetId:"",inputColumns:[],outputColumns:[],code:""});const t=n=>{console.log("Creating new feature:",n),e("/features")};return s.jsx("div",{className:"max-w-4xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(vg,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"New Feature"})]})}),s.jsx(Bj,{datasets:Uj,groups:is,onSubmit:t,onCancel:()=>e("/features")})]})})}const vD=Object.freeze(Object.defineProperty({__proto__:null,default:xD},Symbol.toStringTag,{value:"Module"})),yD=[{value:"America/New_York",label:"Eastern Time"},{value:"America/Chicago",label:"Central Time"},{value:"America/Denver",label:"Mountain Time"},{value:"America/Los_Angeles",label:"Pacific Time"}];function bD({settings:e}){var x,j,b,_,N;const{rootPath:t}=tr().props,n=_c({settings:{timezone:((x=e==null?void 0:e.settings)==null?void 0:x.timezone)||"America/New_York",s3_bucket:((j=e==null?void 0:e.settings)==null?void 0:j.s3_bucket)||"",s3_region:((b=e==null?void 0:e.settings)==null?void 0:b.s3_region)||"us-east-1"}}),{data:r,setData:a,patch:l,processing:c}=n;E.useState(!1);const[d,p]=E.useState(!1),[m,h]=E.useState(null),g=y=>{y.preventDefault(),p(!1),h(null);const w=setTimeout(()=>{h("Request timed out. Please try again.")},3e3);l(`${t}/settings`,{onSuccess:()=>{clearTimeout(w),p(!0)},onError:()=>{clearTimeout(w),h("Failed to save settings. Please try again.")}})};return s.jsx("div",{className:"max-w-4xl mx-auto p-8",children:s.jsxs("div",{className:"bg-white rounded-lg shadow-lg",children:[s.jsx("div",{className:"px-6 py-4 border-b border-gray-200",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Aa,{className:"w-6 h-6 text-blue-600"}),s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Settings"})]})}),s.jsxs("form",{onSubmit:g,className:"p-6 space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(vO,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"General Settings"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"timezone",className:"block text-sm font-medium text-gray-700 mb-1",children:"Timezone"}),s.jsx("select",{id:"timezone",value:r.settings.timezone,onChange:y=>a({...r,settings:{...r.settings,timezone:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:yD.map(y=>s.jsx("option",{value:y.value,children:y.label},y.value))}),s.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"All dates and times will be displayed in this timezone"})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(wn,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"S3 Configuration"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("label",{htmlFor:"bucket",className:"block text-sm font-medium text-gray-700 mb-1",children:"Default S3 Bucket"}),s.jsx("input",{type:"text",id:"bucket",value:r.settings.s3_bucket,onChange:y=>a({...r,settings:{...r.settings,s3_bucket:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",placeholder:"my-bucket"})]}),s.jsxs("div",{children:[s.jsx("label",{htmlFor:"region",className:"block text-sm font-medium text-gray-700 mb-1",children:"AWS Region"}),s.jsxs("select",{id:"region",value:r.settings.s3_region,onChange:y=>a({...r,settings:{...r.settings,s3_region:y.target.value}}),className:"mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500",children:[s.jsx("option",{value:"us-east-1",children:"US East (N. Virginia)"}),s.jsx("option",{value:"us-east-2",children:"US East (Ohio)"}),s.jsx("option",{value:"us-west-1",children:"US West (N. California)"}),s.jsx("option",{value:"us-west-2",children:"US West (Oregon)"})]})]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(xw,{className:"w-5 h-5 text-gray-500"}),s.jsx("h3",{className:"text-lg font-medium text-gray-900",children:"Deployment Information"})]}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"space-y-1",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Git SHA"}),s.jsx("span",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600",children:((_=e==null?void 0:e.settings)==null?void 0:_.git_sha)||"Not available"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-sm font-medium text-gray-700",children:"EasyML Version"}),s.jsx("span",{className:"text-sm font-mono bg-gray-100 px-2 py-1 rounded text-gray-600",children:((N=e==null?void 0:e.settings)==null?void 0:N.version)||"Not available"})]})]})})]}),s.jsxs("div",{className:"pt-6 border-t flex items-center justify-between",children:[d&&s.jsxs("div",{className:"flex items-center gap-2 text-green-600",children:[s.jsx(ww,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:"Settings saved successfully"})]}),m&&s.jsxs("div",{className:"flex items-center gap-2 text-red-600",children:[s.jsx(Xn,{className:"w-4 h-4"}),s.jsx("span",{className:"text-sm font-medium",children:m})]}),s.jsx("div",{className:"flex gap-3",children:s.jsx("button",{type:"submit",disabled:c,className:`px-4 py-2 text-white text-sm font-medium rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${c?"bg-blue-400 cursor-not-allowed":"bg-blue-600 hover:bg-blue-700"}`,children:c?"Saving...":"Save Settings"})})]})]})]})})}const wD=Object.freeze(Object.defineProperty({__proto__:null,default:bD},Symbol.toStringTag,{value:"Module"})),Qu=3,_D={root_mean_squared_error:"rmse",mean_absolute_error:"mae",mean_squared_error:"mse",r2_score:"r2",accuracy_score:"accuracy",precision_score:"precision",recall_score:"recall"};function jD({model:e,onBack:t,rootPath:n}){var R,D;const[r,a]=E.useState("overview"),[l,c]=E.useState(((R=e.retraining_runs)==null?void 0:R.runs)||[]);E.useState(!1);const[d,p]=E.useState({offset:0,limit:20,total_count:((D=e.retraining_runs)==null?void 0:D.total_count)||0}),[m,h]=E.useState(1),g=e.dataset,x=e.retraining_job,j=d.offset+d.limit<d.total_count;E.useEffect(()=>{let T;return l.find(z=>z.is_deploying)&&(T=window.setInterval(async()=>{Ze.get(window.location.href,{preserveScroll:!0,preserveState:!0,only:["runs"]})},2e3)),()=>{T&&window.clearInterval(T)}},[l]);const b=async T=>{if(T.is_deploying)return;const F=l.map(z=>z.id===T.id?{...z,is_deploying:!0}:z);c(F);try{await Ze.post(`${n}/models/${e.id}/deploys`,{retraining_run_id:T.id},{preserveScroll:!0,preserveState:!0})}catch(z){console.error("Failed to deploy model:",z);const B=l.map(W=>W.id===T.id?{...W,is_deploying:!1}:W);c(B)}};E.useEffect(()=>{Math.ceil(l.length/Qu)-m<=2&&j&&loadMoreRuns()},[m,l,j]);const _=Math.ceil(l.length/Qu),N=l.slice((m-1)*Qu,m*Qu),y=T=>{h(T),_-T<2&&j&&loadMoreRuns()},w=T=>T.status==="deployed",C=T=>_D[T]||T;return s.jsxs("div",{className:"space-y-6",children:[s.jsx("div",{className:"flex items-center justify-between",children:s.jsx("div",{className:"flex space-x-4 ml-auto",children:s.jsx("button",{onClick:()=>a("overview"),className:`px-4 py-2 text-sm font-medium rounded-md ${r==="overview"?"bg-blue-100 text-blue-700":"text-gray-500 hover:text-gray-700"}`,children:"Overview"})})}),s.jsxs("div",{className:"bg-white rounded-lg shadow-lg p-6",children:[s.jsxs("div",{className:"mb-8",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:e.name}),s.jsxs("p",{className:"text-gray-600 mt-1",children:[s.jsx("span",{className:"font-medium",children:"Version:"})," ",e.version," • ",s.jsx("span",{className:"font-medium",children:"Type:"})," ",e.formatted_model_type]})]}),s.jsx("span",{className:`px-3 py-1 rounded-full text-sm font-medium ${e.deployment_status==="inference"?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-800"}`,children:e.deployment_status})]}),x&&s.jsxs("div",{className:"mt-6 bg-gray-50 rounded-lg p-4",children:[s.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Training Schedule"}),s.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(rp,{className:"w-5 h-5 text-gray-400"}),s.jsx("span",{children:x.active?`Runs ${x.formatted_frequency}`:"None (Triggered Manually)"})]}),x.active&&s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(xO,{className:"w-5 h-5 text-gray-400"}),s.jsxs("span",{children:["at ",x.at.hour,":00"]})]})]})]})]}),r==="overview"?s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("h3",{className:"text-lg font-semibold",children:"Retraining Runs"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>y(T=>Math.max(1,T-1)),disabled:m===1,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(ip,{className:"w-5 h-5"})}),s.jsxs("span",{className:"text-sm text-gray-600",children:["Page ",m," of ",_]}),s.jsx("button",{onClick:()=>y(T=>Math.min(_,T+1)),disabled:m===_,className:"p-1 rounded-md hover:bg-gray-100 disabled:opacity-50",children:s.jsx(_o,{className:"w-5 h-5"})})]})]}),s.jsx("div",{className:"space-y-4",children:N.map((T,F)=>s.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:border-gray-300 transition-colors",children:[s.jsxs("div",{className:"flex justify-between items-start mb-3",children:[s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[!w(T)&&s.jsx("span",{className:`px-2 py-1 rounded-md text-sm font-medium ${T.status==="success"?"bg-green-100 text-green-800":T.status==="running"?"bg-blue-100 text-blue-800":"bg-red-100 text-red-800"}`,children:T.status}),w(T)&&s.jsxs("span",{className:"px-2 py-1 bg-purple-100 text-purple-800 rounded-md text-sm font-medium flex items-center gap-1",children:[s.jsx(hy,{className:"w-4 h-4"}),"deployed"]}),T.metrics_url&&s.jsxs("a",{href:T.metrics_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 rounded-md text-sm font-medium hover:bg-gray-200 transition-colors",title:"View run metrics",children:[s.jsx(dw,{className:"w-4 h-4"}),"metrics"]})]})}),s.jsxs("div",{className:"flex items-center gap-1",children:[s.jsx(fO,{className:"w-4 h-4 text-gray-400"}),s.jsx("span",{className:"text-sm text-gray-600",children:new Date(T.started_at).toLocaleString()}),T.status==="success"&&T.deployable&&s.jsx("div",{className:"flex gap-2 items-center",children:w(T)?s.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-full text-xs font-medium bg-green-100 text-green-800",children:"deployed"}):s.jsx("button",{onClick:()=>b(T),disabled:T.is_deploying,className:`ml-4 inline-flex items-center gap-2 px-3 py-1 rounded-md text-sm font-medium
|
512
512
|
${T.is_deploying?"bg-yellow-100 text-yellow-800":"bg-blue-600 text-white hover:bg-blue-500"}`,children:T.is_deploying?s.jsxs(s.Fragment,{children:[s.jsx(ps,{className:"w-3 h-3 animate-spin"}),"Deploying..."]}):s.jsxs(s.Fragment,{children:[s.jsx(hy,{className:"w-3 h-3"}),"Deploy"]})})})]})]}),T&&T.metrics&&s.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-4",children:Object.entries(T.metrics).map(([z,B])=>s.jsxs("div",{className:"bg-gray-50 rounded-md p-3",children:[s.jsx("div",{className:"text-sm font-medium text-gray-500",children:C(z)}),s.jsx("div",{className:"mt-1 flex items-center gap-2",children:s.jsx("span",{className:"text-lg font-semibold",children:B.toFixed(4)})})]},z))})]},F))})]}):g&&s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[s.jsx(wn,{className:"w-5 h-5 text-blue-600"}),s.jsx("h3",{className:"text-lg font-semibold",children:g.name})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Columns"}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsx("div",{className:"space-y-2",children:g.columns.map(T=>s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-900",children:T.name}),s.jsx("span",{className:"text-xs text-gray-500",children:T.type})]},T.name))})})]}),s.jsxs("div",{children:[s.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Statistics"}),s.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:s.jsxs("div",{className:"space-y-2",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-900",children:"Total Rows"}),s.jsx("span",{className:"text-sm font-medium",children:g.num_rows.toLocaleString()})]}),s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsx("span",{className:"text-sm text-gray-900",children:"Last Updated"}),s.jsx("span",{className:"text-sm font-medium",children:new Date(g.updated_at).toLocaleDateString()})]})]})})]})]})]})]})]})}function SD({model:e,rootPath:t}){return s.jsx("div",{className:"max-w-3xl mx-auto py-8",children:s.jsx(jD,{model:e,rootPath:t})})}const ND=Object.freeze(Object.defineProperty({__proto__:null,default:SD},Symbol.toStringTag,{value:"Module"}));function kD({feature:e,group:t}){return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(vg,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Link,{to:`/features/${e.id}/edit`,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Edit feature",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete feature",children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-4 mt-4",children:[s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Input Columns"}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:e.inputColumns.map(n=>s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:n},n))})]}),s.jsxs("div",{children:[s.jsx("span",{className:"text-sm text-gray-500",children:"Output Columns"}),s.jsx("div",{className:"flex flex-wrap gap-2 mt-1",children:e.outputColumns.map(n=>s.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-blue-100 text-blue-800",children:n},n))})]})]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs(Link,{to:`/features/groups/${t.id}`,className:"flex items-center gap-2 text-sm text-gray-500 hover:text-gray-700",children:[s.jsx(gw,{className:"w-4 h-4"}),t.name]}),s.jsxs("span",{className:"text-sm text-gray-500",children:["Last updated ",new Date(e.updatedAt).toLocaleDateString()]})]})})]})}function CD({group:e}){return s.jsxs("div",{className:"bg-white rounded-lg shadow-md p-6 hover:shadow-lg transition-shadow",children:[s.jsxs("div",{className:"flex justify-between items-start mb-4",children:[s.jsxs("div",{className:"flex items-start gap-3",children:[s.jsx(gw,{className:"w-5 h-5 text-blue-600 mt-1"}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:e.name}),s.jsx("p",{className:"text-sm text-gray-500 mt-1",children:e.description})]})]}),s.jsxs("div",{className:"flex gap-2",children:[s.jsx(Link,{to:`/features/groups/${e.id}/edit`,className:"text-gray-400 hover:text-blue-600 transition-colors",title:"Edit group",children:s.jsx(hc,{className:"w-5 h-5"})}),s.jsx("button",{className:"text-gray-400 hover:text-red-600 transition-colors",title:"Delete group",children:s.jsx(Fo,{className:"w-5 h-5"})})]})]}),s.jsx("div",{className:"mt-4 pt-4 border-t border-gray-100",children:s.jsxs("div",{className:"flex items-center justify-between text-sm",children:[s.jsxs("span",{className:"text-gray-500",children:[e.features.length," features"]}),s.jsxs("span",{className:"text-gray-500",children:["Last updated ",new Date(e.updatedAt).toLocaleDateString()]})]})})]})}function ED(){const[e,t]=E.useState("groups");if(is.length===0)return s.jsx("div",{className:"p-8",children:s.jsx(bp,{icon:my,title:"Create your first feature group",description:"Create a group to organize your column features",actionLabel:"Create Group",onAction:()=>{}})});const n=is.flatMap(r=>r.features);return s.jsx("div",{className:"p-8",children:s.jsxs("div",{className:"space-y-6",children:[s.jsxs("div",{className:"flex justify-between items-center",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("h2",{className:"text-xl font-semibold text-gray-900",children:"Features"}),s.jsxs("div",{className:"flex rounded-md shadow-sm",children:[s.jsx("button",{onClick:()=>t("groups"),className:`px-4 py-2 text-sm font-medium rounded-l-md ${e==="groups"?"bg-blue-600 text-white":"bg-white text-gray-700 hover:text-gray-900 border border-gray-300"}`,children:"Groups"}),s.jsx("button",{onClick:()=>t("all"),className:`px-4 py-2 text-sm font-medium rounded-r-md ${e==="all"?"bg-blue-600 text-white":"bg-white text-gray-700 hover:text-gray-900 border border-l-0 border-gray-300"}`,children:"All Features"})]})]}),s.jsxs("div",{className:"flex gap-3",children:[s.jsxs(Link,{to:"/features/groups/new",className:"inline-flex items-center gap-2 px-4 py-2 bg-white border border-gray-300 text-sm font-medium rounded-md text-gray-700 hover:bg-gray-50",children:[s.jsx(my,{className:"w-4 h-4"}),"New Group"]}),s.jsxs(Link,{to:"/features/new",className:"inline-flex items-center gap-2 px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700",children:[s.jsx(Ea,{className:"w-4 h-4"}),"New Feature"]})]})]}),e==="groups"?s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:is.map(r=>s.jsx(CD,{group:r},r.id))}):s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:n.map(r=>s.jsx(kD,{feature:r,group:is.find(a=>a.id===r.groupId)},r.id))})]})})}const AD=Object.freeze(Object.defineProperty({__proto__:null,default:ED},Symbol.toStringTag,{value:"Module"}));var i2,Gb=Tj;i2=Gb.createRoot,Gb.hydrateRoot;const a2=E.createContext(void 0);function PD({children:e}){const[t,n]=E.useState([]);let r=1.25;const a=E.useCallback(c=>{n(d=>d.map(p=>p.id===c?{...p,isLeaving:!0}:p)),setTimeout(()=>{n(d=>d.filter(p=>p.id!==c))},300)},[]),l=E.useCallback((c,d)=>{const p=Math.random().toString(36).substring(7);n(m=>[...m,{id:p,type:c,message:d}]),c!=="error"&&setTimeout(()=>{a(p)},r*1e3)},[a]);return s.jsx(a2.Provider,{value:{alerts:t,showAlert:l,removeAlert:a},children:e})}function s2(){const e=E.useContext(a2);if(e===void 0)throw new Error("useAlerts must be used within an AlertProvider");return e}function TD(){const{alerts:e,removeAlert:t}=s2();return e.length===0?null:s.jsx("div",{className:"fixed top-4 right-4 left-4 z-50 flex flex-col gap-2",children:e.map(n=>s.jsxs("div",{className:`flex items-center justify-between p-4 rounded-lg shadow-lg
|
513
513
|
transition-all duration-300 ease-in-out
|
514
514
|
${n.isLeaving?"opacity-0 feature -translate-y-2":"opacity-100"}
|
@@ -530,4 +530,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
530
530
|
flex-grow: 1;
|
531
531
|
}
|
532
532
|
`},nonce:l}),s.jsx(Gi.div,{"data-radix-scroll-area-viewport":"",...c,asChild:a,ref:m,style:{overflowX:d.scrollbarXEnabled?"scroll":"hidden",overflowY:d.scrollbarYEnabled?"scroll":"hidden",...e.style},children:nF({asChild:a,children:r},h=>s.jsx("div",{"data-radix-scroll-area-content":"",ref:d.onContentChange,style:{minWidth:d.scrollbarXEnabled?"fit-content":void 0},children:h}))})]})});f2.displayName=p2;var _i="ScrollAreaScrollbar",g0=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Dr(_i,e.__scopeScrollArea),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=a,d=e.orientation==="horizontal";return E.useEffect(()=>(d?l(!0):c(!0),()=>{d?l(!1):c(!1)}),[d,l,c]),a.type==="hover"?s.jsx(GD,{...r,ref:t,forceMount:n}):a.type==="scroll"?s.jsx(KD,{...r,ref:t,forceMount:n}):a.type==="auto"?s.jsx(m2,{...r,ref:t,forceMount:n}):a.type==="always"?s.jsx(x0,{...r,ref:t}):null});g0.displayName=_i;var GD=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Dr(_i,e.__scopeScrollArea),[l,c]=E.useState(!1);return E.useEffect(()=>{const d=a.scrollArea;let p=0;if(d){const m=()=>{window.clearTimeout(p),c(!0)},h=()=>{p=window.setTimeout(()=>c(!1),a.scrollHideDelay)};return d.addEventListener("pointerenter",m),d.addEventListener("pointerleave",h),()=>{window.clearTimeout(p),d.removeEventListener("pointerenter",m),d.removeEventListener("pointerleave",h)}}},[a.scrollArea,a.scrollHideDelay]),s.jsx(Bo,{present:n||l,children:s.jsx(m2,{"data-state":l?"visible":"hidden",...r,ref:t})})}),KD=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=Dr(_i,e.__scopeScrollArea),l=e.orientation==="horizontal",c=_p(()=>p("SCROLL_END"),100),[d,p]=qD("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return E.useEffect(()=>{if(d==="idle"){const m=window.setTimeout(()=>p("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(m)}},[d,a.scrollHideDelay,p]),E.useEffect(()=>{const m=a.viewport,h=l?"scrollLeft":"scrollTop";if(m){let g=m[h];const x=()=>{const j=m[h];g!==j&&(p("SCROLL"),c()),g=j};return m.addEventListener("scroll",x),()=>m.removeEventListener("scroll",x)}},[a.viewport,l,p,c]),s.jsx(Bo,{present:n||d!=="hidden",children:s.jsx(x0,{"data-state":d==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Ca(e.onPointerEnter,()=>p("POINTER_ENTER")),onPointerLeave:Ca(e.onPointerLeave,()=>p("POINTER_LEAVE"))})})}),m2=E.forwardRef((e,t)=>{const n=Dr(_i,e.__scopeScrollArea),{forceMount:r,...a}=e,[l,c]=E.useState(!1),d=e.orientation==="horizontal",p=_p(()=>{if(n.viewport){const m=n.viewport.offsetWidth<n.viewport.scrollWidth,h=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?m:h)}},10);return To(n.viewport,p),To(n.content,p),s.jsx(Bo,{present:r||l,children:s.jsx(x0,{"data-state":l?"visible":"hidden",...a,ref:t})})}),x0=E.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,a=Dr(_i,e.__scopeScrollArea),l=E.useRef(null),c=E.useRef(0),[d,p]=E.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=y2(d.viewport,d.content),h={...r,sizes:d,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:x=>l.current=x,onThumbPointerUp:()=>c.current=0,onThumbPointerDown:x=>c.current=x};function g(x,j){return eF(x,c.current,d,j)}return n==="horizontal"?s.jsx(QD,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&l.current){const x=a.viewport.scrollLeft,j=Kb(x,d,a.dir);l.current.style.transform=`translate3d(${j}px, 0, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollLeft=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollLeft=g(x,a.dir))}}):n==="vertical"?s.jsx(XD,{...h,ref:t,onThumbPositionChange:()=>{if(a.viewport&&l.current){const x=a.viewport.scrollTop,j=Kb(x,d);l.current.style.transform=`translate3d(0, ${j}px, 0)`}},onWheelScroll:x=>{a.viewport&&(a.viewport.scrollTop=x)},onDragScroll:x=>{a.viewport&&(a.viewport.scrollTop=g(x))}}):null}),QD=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,l=Dr(_i,e.__scopeScrollArea),[c,d]=E.useState(),p=E.useRef(null),m=La(t,p,l.onScrollbarXChange);return E.useEffect(()=>{p.current&&d(getComputedStyle(p.current))},[p]),s.jsx(g2,{"data-orientation":"horizontal",...a,ref:m,sizes:n,style:{bottom:0,left:l.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:l.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":wp(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.x),onDragScroll:h=>e.onDragScroll(h.x),onWheelScroll:(h,g)=>{if(l.viewport){const x=l.viewport.scrollLeft+h.deltaX;e.onWheelScroll(x),w2(x,g)&&h.preventDefault()}},onResize:()=>{p.current&&l.viewport&&c&&r({content:l.viewport.scrollWidth,viewport:l.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:Xd(c.paddingLeft),paddingEnd:Xd(c.paddingRight)}})}})}),XD=E.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,l=Dr(_i,e.__scopeScrollArea),[c,d]=E.useState(),p=E.useRef(null),m=La(t,p,l.onScrollbarYChange);return E.useEffect(()=>{p.current&&d(getComputedStyle(p.current))},[p]),s.jsx(g2,{"data-orientation":"vertical",...a,ref:m,sizes:n,style:{top:0,right:l.dir==="ltr"?0:void 0,left:l.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":wp(n)+"px",...e.style},onThumbPointerDown:h=>e.onThumbPointerDown(h.y),onDragScroll:h=>e.onDragScroll(h.y),onWheelScroll:(h,g)=>{if(l.viewport){const x=l.viewport.scrollTop+h.deltaY;e.onWheelScroll(x),w2(x,g)&&h.preventDefault()}},onResize:()=>{p.current&&l.viewport&&c&&r({content:l.viewport.scrollHeight,viewport:l.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:Xd(c.paddingTop),paddingEnd:Xd(c.paddingBottom)}})}})}),[YD,h2]=u2(_i),g2=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:l,onThumbPointerUp:c,onThumbPointerDown:d,onThumbPositionChange:p,onDragScroll:m,onWheelScroll:h,onResize:g,...x}=e,j=Dr(_i,n),[b,_]=E.useState(null),N=La(t,B=>_(B)),y=E.useRef(null),w=E.useRef(""),C=j.viewport,R=r.content-r.viewport,D=Di(h),T=Di(p),F=_p(g,10);function z(B){if(y.current){const W=B.clientX-y.current.left,pe=B.clientY-y.current.top;m({x:W,y:pe})}}return E.useEffect(()=>{const B=W=>{const pe=W.target;(b==null?void 0:b.contains(pe))&&D(W,R)};return document.addEventListener("wheel",B,{passive:!1}),()=>document.removeEventListener("wheel",B,{passive:!1})},[C,b,R,D]),E.useEffect(T,[r,T]),To(b,F),To(j.content,F),s.jsx(YD,{scope:n,scrollbar:b,hasThumb:a,onThumbChange:Di(l),onThumbPointerUp:Di(c),onThumbPositionChange:T,onThumbPointerDown:Di(d),children:s.jsx(Gi.div,{...x,ref:N,style:{position:"absolute",...x.style},onPointerDown:Ca(e.onPointerDown,B=>{B.button===0&&(B.target.setPointerCapture(B.pointerId),y.current=b.getBoundingClientRect(),w.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",j.viewport&&(j.viewport.style.scrollBehavior="auto"),z(B))}),onPointerMove:Ca(e.onPointerMove,z),onPointerUp:Ca(e.onPointerUp,B=>{const W=B.target;W.hasPointerCapture(B.pointerId)&&W.releasePointerCapture(B.pointerId),document.body.style.webkitUserSelect=w.current,j.viewport&&(j.viewport.style.scrollBehavior=""),y.current=null})})})}),Qd="ScrollAreaThumb",x2=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=h2(Qd,e.__scopeScrollArea);return s.jsx(Bo,{present:n||a.hasThumb,children:s.jsx(JD,{ref:t,...r})})}),JD=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,l=Dr(Qd,n),c=h2(Qd,n),{onThumbPositionChange:d}=c,p=La(t,g=>c.onThumbChange(g)),m=E.useRef(),h=_p(()=>{m.current&&(m.current(),m.current=void 0)},100);return E.useEffect(()=>{const g=l.viewport;if(g){const x=()=>{if(h(),!m.current){const j=tF(g,d);m.current=j,d()}};return d(),g.addEventListener("scroll",x),()=>g.removeEventListener("scroll",x)}},[l.viewport,h,d]),s.jsx(Gi.div,{"data-state":c.hasThumb?"visible":"hidden",...a,ref:p,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Ca(e.onPointerDownCapture,g=>{const j=g.target.getBoundingClientRect(),b=g.clientX-j.left,_=g.clientY-j.top;c.onThumbPointerDown({x:b,y:_})}),onPointerUp:Ca(e.onPointerUp,c.onThumbPointerUp)})});x2.displayName=Qd;var v0="ScrollAreaCorner",v2=E.forwardRef((e,t)=>{const n=Dr(v0,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(ZD,{...e,ref:t}):null});v2.displayName=v0;var ZD=E.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=Dr(v0,n),[l,c]=E.useState(0),[d,p]=E.useState(0),m=!!(l&&d);return To(a.scrollbarX,()=>{var g;const h=((g=a.scrollbarX)==null?void 0:g.offsetHeight)||0;a.onCornerHeightChange(h),p(h)}),To(a.scrollbarY,()=>{var g;const h=((g=a.scrollbarY)==null?void 0:g.offsetWidth)||0;a.onCornerWidthChange(h),c(h)}),m?s.jsx(Gi.div,{...r,ref:t,style:{width:l,height:d,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Xd(e){return e?parseInt(e,10):0}function y2(e,t){const n=e/t;return isNaN(n)?0:n}function wp(e){const t=y2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function eF(e,t,n,r="ltr"){const a=wp(n),l=a/2,c=t||l,d=a-c,p=n.scrollbar.paddingStart+c,m=n.scrollbar.size-n.scrollbar.paddingEnd-d,h=n.content-n.viewport,g=r==="ltr"?[0,h]:[h*-1,0];return b2([p,m],g)(e)}function Kb(e,t,n="ltr"){const r=wp(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-a,c=t.content-t.viewport,d=l-r,p=n==="ltr"?[0,c]:[c*-1,0],m=HD(e,p);return b2([0,c],[0,d])(m)}function b2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function w2(e,t){return e>0&&e<t}var tF=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function a(){const l={left:e.scrollLeft,top:e.scrollTop},c=n.left!==l.left,d=n.top!==l.top;(c||d)&&t(),n=l,r=window.requestAnimationFrame(a)}(),()=>window.cancelAnimationFrame(r)};function _p(e,t){const n=Di(e),r=E.useRef(0);return E.useEffect(()=>()=>window.clearTimeout(r.current),[]),E.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function To(e,t){const n=Di(t);oc(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}function nF(e,t){const{asChild:n,children:r}=e;if(!n)return typeof t=="function"?t(r):t;const a=E.Children.only(r);return E.cloneElement(a,{children:typeof t=="function"?t(a.props.children):t})}var _2=d2,rF=f2,iF=v2;const j2=E.forwardRef(({className:e,children:t,...n},r)=>s.jsxs(_2,{ref:r,className:Jr("relative overflow-hidden",e),...n,children:[s.jsx(rF,{className:"h-full w-full rounded-[inherit]",children:t}),s.jsx(S2,{}),s.jsx(iF,{})]}));j2.displayName=_2.displayName;const S2=E.forwardRef(({className:e,orientation:t="vertical",...n},r)=>s.jsx(g0,{ref:r,orientation:t,className:Jr("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:s.jsx(x2,{className:"relative flex-1 rounded-full bg-border"})}));S2.displayName=g0.displayName;var aF="Separator",Qb="horizontal",sF=["horizontal","vertical"],N2=E.forwardRef((e,t)=>{const{decorative:n,orientation:r=Qb,...a}=e,l=oF(r)?r:Qb,d=n?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return s.jsx(Gi.div,{"data-orientation":l,...d,...a,ref:t})});N2.displayName=aF;function oF(e){return sF.includes(e)}var k2=N2;const C2=E.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},a)=>s.jsx(k2,{ref:a,decorative:n,orientation:t,className:Jr("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));C2.displayName=k2.displayName;function lF({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,a]=cF({defaultProp:t,onChange:n}),l=e!==void 0,c=l?e:r,d=Di(n),p=E.useCallback(m=>{if(l){const g=typeof m=="function"?m(e):m;g!==e&&d(g)}else a(m)},[l,e,a,d]);return[c,p]}function cF({defaultProp:e,onChange:t}){const n=E.useState(e),[r]=n,a=E.useRef(r),l=Di(t);return E.useEffect(()=>{a.current!==r&&(l(r),a.current=r)},[r,a,l]),n}var uF=k3.useId||(()=>{}),dF=0;function pF(e){const[t,n]=E.useState(uF());return oc(()=>{e||n(r=>r??String(dF++))},[e]),e||(t?`radix-${t}`:"")}var y0="Collapsible",[fF,AF]=c2(y0),[mF,b0]=fF(y0),E2=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:l,onOpenChange:c,...d}=e,[p=!1,m]=lF({prop:r,defaultProp:a,onChange:c});return s.jsx(mF,{scope:n,disabled:l,contentId:pF(),open:p,onOpenToggle:E.useCallback(()=>m(h=>!h),[m]),children:s.jsx(Gi.div,{"data-state":_0(p),"data-disabled":l?"":void 0,...d,ref:t})})});E2.displayName=y0;var A2="CollapsibleTrigger",P2=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,a=b0(A2,n);return s.jsx(Gi.button,{type:"button","aria-controls":a.contentId,"aria-expanded":a.open||!1,"data-state":_0(a.open),"data-disabled":a.disabled?"":void 0,disabled:a.disabled,...r,ref:t,onClick:Ca(e.onClick,a.onOpenToggle)})});P2.displayName=A2;var w0="CollapsibleContent",T2=E.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=b0(w0,e.__scopeCollapsible);return s.jsx(Bo,{present:n||a.open,children:({present:l})=>s.jsx(hF,{...r,ref:t,present:l})})});T2.displayName=w0;var hF=E.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:a,...l}=e,c=b0(w0,n),[d,p]=E.useState(r),m=E.useRef(null),h=La(t,m),g=E.useRef(0),x=g.current,j=E.useRef(0),b=j.current,_=c.open||d,N=E.useRef(_),y=E.useRef();return E.useEffect(()=>{const w=requestAnimationFrame(()=>N.current=!1);return()=>cancelAnimationFrame(w)},[]),oc(()=>{const w=m.current;if(w){y.current=y.current||{transitionDuration:w.style.transitionDuration,animationName:w.style.animationName},w.style.transitionDuration="0s",w.style.animationName="none";const C=w.getBoundingClientRect();g.current=C.height,j.current=C.width,N.current||(w.style.transitionDuration=y.current.transitionDuration,w.style.animationName=y.current.animationName),p(r)}},[c.open,r]),s.jsx(Gi.div,{"data-state":_0(c.open),"data-disabled":c.disabled?"":void 0,id:c.contentId,hidden:!_,...l,ref:h,style:{"--radix-collapsible-content-height":x?`${x}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:_&&a})});function _0(e){return e?"open":"closed"}var gF=E2;const xF=gF,vF=P2,yF=T2;function Xb({href:e,className:t=l=>"",activeClassName:n="active",children:r,...a}){const{rootPath:l,url:c}=tr().props,d=c===e;let p=t(d);return s.jsx(Zr,{href:`${l}${e}`,className:Jr(p,d&&n),...a,children:r})}const bF=[{title:"Models",icon:yi,href:"/",children:[{title:"All Models",icon:yi,href:"/models"},{title:"New Model",icon:yi,href:"/models/new"}]},{title:"Datasources",icon:ls,href:"/datasources",children:[{title:"All Datasources",icon:ls,href:"/datasources"},{title:"New Datasource",icon:ls,href:"/datasources/new"}]},{title:"Datasets",icon:wn,href:"/datasets",children:[{title:"All Datasets",icon:wn,href:"/datasets"},{title:"New Dataset",icon:wn,href:"/datasets/new"}]}];function wF(e){const{rootPath:t}=tr().props,n=e.split("/").filter(Boolean),r=[];let a=t;if(n.length===0)return[];let l,c;switch(["datasources","datasets","models","settings"].includes(n[0])?(l=n[0],c=0):(l=n[1],c=1),l){case"models":r.push({title:"Models",href:`${t}/models`});break;case"datasources":r.push({title:"Datasources",href:`${t}/datasources`});break;case"datasets":r.push({title:"Datasets",href:`${t}/datasets`});break;case"settings":r.push({title:"Settings",href:`${t}/settings`});break;default:r.push({title:"Models",href:`${t}/models`})}for(let d=c+1;d<n.length;d++){const p=n[d];if(a+=`/${n[d]}`,n[d-1]==="datasets"&&p!=="new")r.push({title:"Details",href:a});else if(n[d-1]==="models"&&p!=="new")r.push({title:"Details",href:a});else{const m=p==="new"?"New":p==="edit"?"Edit":p.charAt(0).toUpperCase()+p.slice(1);r.push({title:m,href:a})}}return r}function _F({children:e}){const[t,n]=E.useState(!0),[r,a]=E.useState(["Models"]),l=wF(location.pathname),c=d=>{a(p=>p.includes(d)?p.filter(m=>m!==d):[...p,d])};return s.jsxs("div",{className:"min-h-screen bg-gray-50",children:[s.jsxs("div",{className:Jr("fixed left-0 top-0 z-40 h-screen bg-white border-r transition-all duration-300",t?"w-64":"w-16"),children:[s.jsxs("div",{className:"flex h-16 items-center border-b px-4",children:[t?s.jsxs(s.Fragment,{children:[s.jsx(yi,{className:"w-8 h-8 text-blue-600"}),s.jsx("h1",{className:"text-xl font-bold text-gray-900 ml-2",children:"EasyML"})]}):s.jsx(yi,{className:"w-8 h-8 text-blue-600"}),s.jsx("button",{onClick:()=>n(!t),className:"ml-auto p-2 hover:bg-gray-100 rounded-md",children:s.jsx(kO,{className:"w-4 h-4"})})]}),s.jsx(j2,{className:"h-[calc(100vh-4rem)] px-3",children:s.jsxs("div",{className:"space-y-2 py-4",children:[bF.map(d=>{var p;return s.jsxs(xF,{open:r.includes(d.title),onOpenChange:()=>c(d.title),children:[s.jsxs(vF,{className:"flex items-center w-full p-2 hover:bg-gray-100 rounded-md",children:[s.jsx(d.icon,{className:"w-4 h-4"}),t&&s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"ml-2 text-sm font-medium flex-1 text-left",children:d.title}),r.includes(d.title)?s.jsx(Do,{className:"w-4 h-4"}):s.jsx(_o,{className:"w-4 h-4"})]})]}),s.jsx(yF,{children:t&&((p=d.children)==null?void 0:p.map(m=>s.jsxs(Xb,{href:m.href,className:({isActive:h})=>Jr("flex items-center pl-8 pr-2 py-2 text-sm rounded-md",h?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-50"),children:[s.jsx(m.icon,{className:"w-4 h-4"}),s.jsx("span",{className:"ml-2",children:m.title})]},m.href)))})]},d.title)}),s.jsx(C2,{className:"my-4"}),s.jsxs(Xb,{href:"/settings",className:({isActive:d})=>Jr("flex items-center w-full p-2 rounded-md",d?"bg-blue-50 text-blue-600":"text-gray-600 hover:bg-gray-50"),children:[s.jsx(Aa,{className:"w-4 h-4"}),t&&s.jsx("span",{className:"ml-2 text-sm font-medium",children:"Settings"})]})]})})]}),s.jsxs("div",{className:Jr("transition-all duration-300",t?"ml-64":"ml-16"),children:[s.jsx(TD,{}),s.jsx("div",{className:"h-16 border-b bg-white flex items-center px-4",children:s.jsx("nav",{className:"flex","aria-label":"Breadcrumb",children:s.jsx("ol",{className:"flex items-center space-x-2",children:l.map((d,p)=>s.jsxs(er.Fragment,{children:[p>0&&s.jsx(_o,{className:"w-4 h-4 text-gray-400"}),s.jsx("li",{children:s.jsx(Zr,{href:d.href,className:Jr("text-sm",p===l.length-1?"text-blue-600 font-medium":"text-gray-500 hover:text-gray-700"),children:d.title})})]},d.href))})})}),s.jsx("main",{className:"min-h-[calc(100vh-4rem)]",children:e})]})]})}function jF({children:e}){const{showAlert:t}=s2(),{flash:n}=tr().props;return E.useEffect(()=>{n&&n.forEach(({type:r,message:a})=>{t(r,a)})},[n,t]),s.jsx(s.Fragment,{children:e})}function SF({children:e}){return s.jsx(PD,{children:s.jsx(jF,{children:s.jsx(_F,{children:e})})})}document.addEventListener("DOMContentLoaded",()=>{aO({resolve:e=>{let n=Object.assign({"../pages/DatasetDetailsPage.tsx":PM,"../pages/DatasetsPage.tsx":IM,"../pages/DatasourceFormPage.tsx":zM,"../pages/DatasourcesPage.tsx":UM,"../pages/EditModelPage.tsx":HM,"../pages/EditTransformationPage.tsx":QM,"../pages/ModelsPage.tsx":YL,"../pages/NewDatasetPage.tsx":mD,"../pages/NewModelPage.tsx":gD,"../pages/NewTransformationPage.tsx":vD,"../pages/SettingsPage.tsx":wD,"../pages/ShowModelPage.tsx":ND,"../pages/TransformationsPage.tsx":AD})[`../${e}.tsx`];if(!n.default){alert(`The page ${e} could not be found, you probably forgot to export default.`);return}return n.default.layout=n.default.layout||(r=>s.jsx(SF,{children:r})),n},setup({el:e,App:t,props:n}){i2(e).render(s.jsx(t,{...n}))}})});
|
533
|
-
//# sourceMappingURL=Application.tsx-
|
533
|
+
//# sourceMappingURL=Application.tsx-gkZ77wo8.js.map
|