Files
obsidian/.obsidian/plugins/notion-bases/main.js

100 lines
692 KiB
JavaScript

/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var Xb=Object.create;var Zl=Object.defineProperty;var Qb=Object.getOwnPropertyDescriptor;var Zb=Object.getOwnPropertyNames;var Jb=Object.getPrototypeOf,ey=Object.prototype.hasOwnProperty;var Bo=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ty=(e,t)=>{for(var n in t)Zl(e,n,{get:t[n],enumerable:!0})},Gm=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Zb(t))!ey.call(e,r)&&r!==n&&Zl(e,r,{get:()=>t[r],enumerable:!(o=Qb(t,r))||o.enumerable});return e};var Re=(e,t,n)=>(n=e!=null?Xb(Jb(e)):{},Gm(t||!e||!e.__esModule?Zl(n,"default",{value:e,enumerable:!0}):n,e)),ny=e=>Gm(Zl({},"__esModule",{value:!0}),e);var cf=Bo(_t=>{"use strict";var Ma=Symbol.for("react.element"),dy=Symbol.for("react.portal"),py=Symbol.for("react.fragment"),my=Symbol.for("react.strict_mode"),fy=Symbol.for("react.profiler"),gy=Symbol.for("react.provider"),_y=Symbol.for("react.context"),hy=Symbol.for("react.forward_ref"),vy=Symbol.for("react.suspense"),by=Symbol.for("react.memo"),yy=Symbol.for("react.lazy"),Zm=Symbol.iterator;function wy(e){return e===null||typeof e!="object"?null:(e=Zm&&e[Zm]||e["@@iterator"],typeof e=="function"?e:null)}var tf={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},nf=Object.assign,of={};function Ei(e,t,n){this.props=e,this.context=t,this.refs=of,this.updater=n||tf}Ei.prototype.isReactComponent={};Ei.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Ei.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function rf(){}rf.prototype=Ei.prototype;function Nc(e,t,n){this.props=e,this.context=t,this.refs=of,this.updater=n||tf}var xc=Nc.prototype=new rf;xc.constructor=Nc;nf(xc,Ei.prototype);xc.isPureReactComponent=!0;var Jm=Array.isArray,af=Object.prototype.hasOwnProperty,Rc={current:null},lf={key:!0,ref:!0,__self:!0,__source:!0};function sf(e,t,n){var o,r={},i=null,a=null;if(t!=null)for(o in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)af.call(t,o)&&!lf.hasOwnProperty(o)&&(r[o]=t[o]);var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){for(var s=Array(l),d=0;d<l;d++)s[d]=arguments[d+2];r.children=s}if(e&&e.defaultProps)for(o in l=e.defaultProps,l)r[o]===void 0&&(r[o]=l[o]);return{$$typeof:Ma,type:e,key:i,ref:a,props:r,_owner:Rc.current}}function Cy(e,t){return{$$typeof:Ma,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ec(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ma}function ky(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var ef=/\/+/g;function Sc(e,t){return typeof e=="object"&&e!==null&&e.key!=null?ky(""+e.key):t.toString(36)}function es(e,t,n,o,r){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Ma:case dy:a=!0}}if(a)return a=e,r=r(a),e=o===""?"."+Sc(a,0):o,Jm(r)?(n="",e!=null&&(n=e.replace(ef,"$&/")+"/"),es(r,t,n,"",function(d){return d})):r!=null&&(Ec(r)&&(r=Cy(r,n+(!r.key||a&&a.key===r.key?"":(""+r.key).replace(ef,"$&/")+"/")+e)),t.push(r)),1;if(a=0,o=o===""?".":o+":",Jm(e))for(var l=0;l<e.length;l++){i=e[l];var s=o+Sc(i,l);a+=es(i,t,n,s,r)}else if(s=wy(e),typeof s=="function")for(e=s.call(e),l=0;!(i=e.next()).done;)i=i.value,s=o+Sc(i,l++),a+=es(i,t,n,s,r);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function Jl(e,t,n){if(e==null)return e;var o=[],r=0;return es(e,o,"","",function(i){return t.call(n,i,r++)}),o}function Sy(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Nn={current:null},ts={transition:null},Ny={ReactCurrentDispatcher:Nn,ReactCurrentBatchConfig:ts,ReactCurrentOwner:Rc};function uf(){throw Error("act(...) is not supported in production builds of React.")}_t.Children={map:Jl,forEach:function(e,t,n){Jl(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Jl(e,function(){t++}),t},toArray:function(e){return Jl(e,function(t){return t})||[]},only:function(e){if(!Ec(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};_t.Component=Ei;_t.Fragment=py;_t.Profiler=fy;_t.PureComponent=Nc;_t.StrictMode=my;_t.Suspense=vy;_t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ny;_t.act=uf;_t.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var o=nf({},e.props),r=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=Rc.current),t.key!==void 0&&(r=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(s in t)af.call(t,s)&&!lf.hasOwnProperty(s)&&(o[s]=t[s]===void 0&&l!==void 0?l[s]:t[s])}var s=arguments.length-2;if(s===1)o.children=n;else if(1<s){l=Array(s);for(var d=0;d<s;d++)l[d]=arguments[d+2];o.children=l}return{$$typeof:Ma,type:e.type,key:r,ref:i,props:o,_owner:a}};_t.createContext=function(e){return e={$$typeof:_y,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:gy,_context:e},e.Consumer=e};_t.createElement=sf;_t.createFactory=function(e){var t=sf.bind(null,e);return t.type=e,t};_t.createRef=function(){return{current:null}};_t.forwardRef=function(e){return{$$typeof:hy,render:e}};_t.isValidElement=Ec;_t.lazy=function(e){return{$$typeof:yy,_payload:{_status:-1,_result:e},_init:Sy}};_t.memo=function(e,t){return{$$typeof:by,type:e,compare:t===void 0?null:t}};_t.startTransition=function(e){var t=ts.transition;ts.transition={};try{e()}finally{ts.transition=t}};_t.unstable_act=uf;_t.useCallback=function(e,t){return Nn.current.useCallback(e,t)};_t.useContext=function(e){return Nn.current.useContext(e)};_t.useDebugValue=function(){};_t.useDeferredValue=function(e){return Nn.current.useDeferredValue(e)};_t.useEffect=function(e,t){return Nn.current.useEffect(e,t)};_t.useId=function(){return Nn.current.useId()};_t.useImperativeHandle=function(e,t,n){return Nn.current.useImperativeHandle(e,t,n)};_t.useInsertionEffect=function(e,t){return Nn.current.useInsertionEffect(e,t)};_t.useLayoutEffect=function(e,t){return Nn.current.useLayoutEffect(e,t)};_t.useMemo=function(e,t){return Nn.current.useMemo(e,t)};_t.useReducer=function(e,t,n){return Nn.current.useReducer(e,t,n)};_t.useRef=function(e){return Nn.current.useRef(e)};_t.useState=function(e){return Nn.current.useState(e)};_t.useSyncExternalStore=function(e,t,n){return Nn.current.useSyncExternalStore(e,t,n)};_t.useTransition=function(){return Nn.current.useTransition()};_t.version="18.3.1"});var xt=Bo((QN,df)=>{"use strict";df.exports=cf()});var wf=Bo(Pt=>{"use strict";function Mc(e,t){var n=e.length;e.push(t);e:for(;0<n;){var o=n-1>>>1,r=e[o];if(0<ns(r,t))e[o]=t,e[n]=r,n=o;else break e}}function vo(e){return e.length===0?null:e[0]}function rs(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;e:for(var o=0,r=e.length,i=r>>>1;o<i;){var a=2*(o+1)-1,l=e[a],s=a+1,d=e[s];if(0>ns(l,n))s<r&&0>ns(d,l)?(e[o]=d,e[s]=n,o=s):(e[o]=l,e[a]=n,o=a);else if(s<r&&0>ns(d,n))e[o]=d,e[s]=n,o=s;else break e}}return t}function ns(e,t){var n=e.sortIndex-t.sortIndex;return n!==0?n:e.id-t.id}typeof performance=="object"&&typeof performance.now=="function"?(pf=performance,Pt.unstable_now=function(){return pf.now()}):(Fc=Date,mf=Fc.now(),Pt.unstable_now=function(){return Fc.now()-mf});var pf,Fc,mf,Do=[],ar=[],xy=1,no=null,_n=3,is=!1,Gr=!1,La=!1,_f=typeof setTimeout=="function"?setTimeout:null,hf=typeof clearTimeout=="function"?clearTimeout:null,ff=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function Pc(e){for(var t=vo(ar);t!==null;){if(t.callback===null)rs(ar);else if(t.startTime<=e)rs(ar),t.sortIndex=t.expirationTime,Mc(Do,t);else break;t=vo(ar)}}function Lc(e){if(La=!1,Pc(e),!Gr)if(vo(Do)!==null)Gr=!0,Ac(Ic);else{var t=vo(ar);t!==null&&Oc(Lc,t.startTime-e)}}function Ic(e,t){Gr=!1,La&&(La=!1,hf(Ia),Ia=-1),is=!0;var n=_n;try{for(Pc(t),no=vo(Do);no!==null&&(!(no.expirationTime>t)||e&&!yf());){var o=no.callback;if(typeof o=="function"){no.callback=null,_n=no.priorityLevel;var r=o(no.expirationTime<=t);t=Pt.unstable_now(),typeof r=="function"?no.callback=r:no===vo(Do)&&rs(Do),Pc(t)}else rs(Do);no=vo(Do)}if(no!==null)var i=!0;else{var a=vo(ar);a!==null&&Oc(Lc,a.startTime-t),i=!1}return i}finally{no=null,_n=n,is=!1}}var as=!1,os=null,Ia=-1,vf=5,bf=-1;function yf(){return!(Pt.unstable_now()-bf<vf)}function Dc(){if(os!==null){var e=Pt.unstable_now();bf=e;var t=!0;try{t=os(!0,e)}finally{t?Pa():(as=!1,os=null)}}else as=!1}var Pa;typeof ff=="function"?Pa=function(){ff(Dc)}:typeof MessageChannel<"u"?(Tc=new MessageChannel,gf=Tc.port2,Tc.port1.onmessage=Dc,Pa=function(){gf.postMessage(null)}):Pa=function(){_f(Dc,0)};var Tc,gf;function Ac(e){os=e,as||(as=!0,Pa())}function Oc(e,t){Ia=_f(function(){e(Pt.unstable_now())},t)}Pt.unstable_IdlePriority=5;Pt.unstable_ImmediatePriority=1;Pt.unstable_LowPriority=4;Pt.unstable_NormalPriority=3;Pt.unstable_Profiling=null;Pt.unstable_UserBlockingPriority=2;Pt.unstable_cancelCallback=function(e){e.callback=null};Pt.unstable_continueExecution=function(){Gr||is||(Gr=!0,Ac(Ic))};Pt.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):vf=0<e?Math.floor(1e3/e):5};Pt.unstable_getCurrentPriorityLevel=function(){return _n};Pt.unstable_getFirstCallbackNode=function(){return vo(Do)};Pt.unstable_next=function(e){switch(_n){case 1:case 2:case 3:var t=3;break;default:t=_n}var n=_n;_n=t;try{return e()}finally{_n=n}};Pt.unstable_pauseExecution=function(){};Pt.unstable_requestPaint=function(){};Pt.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=_n;_n=e;try{return t()}finally{_n=n}};Pt.unstable_scheduleCallback=function(e,t,n){var o=Pt.unstable_now();switch(typeof n=="object"&&n!==null?(n=n.delay,n=typeof n=="number"&&0<n?o+n:o):n=o,e){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=n+r,e={id:xy++,callback:t,priorityLevel:e,startTime:n,expirationTime:r,sortIndex:-1},n>o?(e.sortIndex=n,Mc(ar,e),vo(Do)===null&&e===vo(ar)&&(La?(hf(Ia),Ia=-1):La=!0,Oc(Lc,n-o))):(e.sortIndex=r,Mc(Do,e),Gr||is||(Gr=!0,Ac(Ic))),e};Pt.unstable_shouldYield=yf;Pt.unstable_wrapCallback=function(e){var t=_n;return function(){var n=_n;_n=t;try{return e.apply(this,arguments)}finally{_n=n}}}});var kf=Bo((JN,Cf)=>{"use strict";Cf.exports=wf()});var Rh=Bo(Zn=>{"use strict";var Ry=xt(),Xn=kf();function pe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Dg=new Set,ol={};function ii(e,t){Yi(e,t),Yi(e+"Capture",t)}function Yi(e,t){for(ol[e]=t,e=0;e<t.length;e++)Dg.add(t[e])}var qo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ad=Object.prototype.hasOwnProperty,Ey=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Sf={},Nf={};function Fy(e){return ad.call(Nf,e)?!0:ad.call(Sf,e)?!1:Ey.test(e)?Nf[e]=!0:(Sf[e]=!0,!1)}function Dy(e,t,n,o){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return o?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Ty(e,t,n,o){if(t===null||typeof t>"u"||Dy(e,t,n,o))return!0;if(o)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function En(e,t,n,o,r,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=o,this.attributeNamespace=r,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var fn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){fn[e]=new En(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];fn[t]=new En(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){fn[e]=new En(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){fn[e]=new En(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){fn[e]=new En(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){fn[e]=new En(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){fn[e]=new En(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){fn[e]=new En(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){fn[e]=new En(e,5,!1,e.toLowerCase(),null,!1,!1)});var Zd=/[\-:]([a-z])/g;function Jd(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Zd,Jd);fn[t]=new En(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Zd,Jd);fn[t]=new En(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Zd,Jd);fn[t]=new En(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){fn[e]=new En(e,1,!1,e.toLowerCase(),null,!1,!1)});fn.xlinkHref=new En("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){fn[e]=new En(e,1,!1,e.toLowerCase(),null,!0,!0)});function ep(e,t,n,o){var r=fn.hasOwnProperty(t)?fn[t]:null;(r!==null?r.type!==0:o||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Ty(t,n,r,o)&&(n=null),o||r===null?Fy(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):r.mustUseProperty?e[r.propertyName]=n===null?r.type===3?!1:"":n:(t=r.attributeName,o=r.attributeNamespace,n===null?e.removeAttribute(t):(r=r.type,n=r===3||r===4&&n===!0?"":""+n,o?e.setAttributeNS(o,t,n):e.setAttribute(t,n))))}var Qo=Ry.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ls=Symbol.for("react.element"),Ti=Symbol.for("react.portal"),Mi=Symbol.for("react.fragment"),tp=Symbol.for("react.strict_mode"),ld=Symbol.for("react.profiler"),Tg=Symbol.for("react.provider"),Mg=Symbol.for("react.context"),np=Symbol.for("react.forward_ref"),sd=Symbol.for("react.suspense"),ud=Symbol.for("react.suspense_list"),op=Symbol.for("react.memo"),sr=Symbol.for("react.lazy"),Pg=Symbol.for("react.offscreen"),xf=Symbol.iterator;function Aa(e){return e===null||typeof e!="object"?null:(e=xf&&e[xf]||e["@@iterator"],typeof e=="function"?e:null)}var Ut=Object.assign,$c;function Ua(e){if($c===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);$c=t&&t[1]||""}return`
`+$c+e}var zc=!1;function Vc(e,t){if(!e||zc)return"";zc=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var o=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){o=d}e.call(t.prototype)}else{try{throw Error()}catch(d){o=d}e()}}catch(d){if(d&&o&&typeof d.stack=="string"){for(var r=d.stack.split(`
`),i=o.stack.split(`
`),a=r.length-1,l=i.length-1;1<=a&&0<=l&&r[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(r[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||r[a]!==i[l]){var s=`
`+r[a].replace(" at new "," at ");return e.displayName&&s.includes("<anonymous>")&&(s=s.replace("<anonymous>",e.displayName)),s}while(1<=a&&0<=l);break}}}finally{zc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Ua(e):""}function My(e){switch(e.tag){case 5:return Ua(e.type);case 16:return Ua("Lazy");case 13:return Ua("Suspense");case 19:return Ua("SuspenseList");case 0:case 2:case 15:return e=Vc(e.type,!1),e;case 11:return e=Vc(e.type.render,!1),e;case 1:return e=Vc(e.type,!0),e;default:return""}}function cd(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 Mi:return"Fragment";case Ti:return"Portal";case ld:return"Profiler";case tp:return"StrictMode";case sd:return"Suspense";case ud:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Mg:return(e.displayName||"Context")+".Consumer";case Tg:return(e._context.displayName||"Context")+".Provider";case np:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case op:return t=e.displayName||null,t!==null?t:cd(e.type)||"Memo";case sr:t=e._payload,e=e._init;try{return cd(e(t))}catch{}}return null}function Py(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 cd(t);case 8:return t===tp?"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 Cr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Lg(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Ly(e){var t=Lg(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),o=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var r=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(a){o=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return o},setValue:function(a){o=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ss(e){e._valueTracker||(e._valueTracker=Ly(e))}function Ig(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),o="";return e&&(o=Lg(e)?e.checked?"true":"false":e.value),e=o,e!==n?(t.setValue(e),!0):!1}function As(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 dd(e,t){var n=t.checked;return Ut({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Rf(e,t){var n=t.defaultValue==null?"":t.defaultValue,o=t.checked!=null?t.checked:t.defaultChecked;n=Cr(t.value!=null?t.value:n),e._wrapperState={initialChecked:o,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Ag(e,t){t=t.checked,t!=null&&ep(e,"checked",t,!1)}function pd(e,t){Ag(e,t);var n=Cr(t.value),o=t.type;if(n!=null)o==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(o==="submit"||o==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?md(e,t.type,n):t.hasOwnProperty("defaultValue")&&md(e,t.type,Cr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ef(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var o=t.type;if(!(o!=="submit"&&o!=="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 md(e,t,n){(t!=="number"||As(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Wa=Array.isArray;function Hi(e,t,n,o){if(e=e.options,t){t={};for(var r=0;r<n.length;r++)t["$"+n[r]]=!0;for(n=0;n<e.length;n++)r=t.hasOwnProperty("$"+e[n].value),e[n].selected!==r&&(e[n].selected=r),r&&o&&(e[n].defaultSelected=!0)}else{for(n=""+Cr(n),t=null,r=0;r<e.length;r++){if(e[r].value===n){e[r].selected=!0,o&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function fd(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(pe(91));return Ut({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Ff(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(pe(92));if(Wa(n)){if(1<n.length)throw Error(pe(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Cr(n)}}function Og(e,t){var n=Cr(t.value),o=Cr(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),o!=null&&(e.defaultValue=""+o)}function Df(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $g(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 gd(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$g(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var us,zg=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,o,r){MSApp.execUnsafeLocalFunction(function(){return e(t,n,o,r)})}:e})(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(us=us||document.createElement("div"),us.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=us.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function rl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ka={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},Iy=["Webkit","ms","Moz","O"];Object.keys(Ka).forEach(function(e){Iy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Ka[t]=Ka[e]})});function Vg(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Ka.hasOwnProperty(e)&&Ka[e]?(""+t).trim():t+"px"}function Bg(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var o=n.indexOf("--")===0,r=Vg(n,t[n],o);n==="float"&&(n="cssFloat"),o?e.setProperty(n,r):e[n]=r}}var Ay=Ut({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 _d(e,t){if(t){if(Ay[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(pe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(pe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(pe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(pe(62))}}function hd(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 vd=null;function rp(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var bd=null,Ui=null,Wi=null;function Tf(e){if(e=Cl(e)){if(typeof bd!="function")throw Error(pe(280));var t=e.stateNode;t&&(t=cu(t),bd(e.stateNode,e.type,t))}}function jg(e){Ui?Wi?Wi.push(e):Wi=[e]:Ui=e}function Hg(){if(Ui){var e=Ui,t=Wi;if(Wi=Ui=null,Tf(e),t)for(e=0;e<t.length;e++)Tf(t[e])}}function Ug(e,t){return e(t)}function Wg(){}var Bc=!1;function Gg(e,t,n){if(Bc)return e(t,n);Bc=!0;try{return Ug(e,t,n)}finally{Bc=!1,(Ui!==null||Wi!==null)&&(Wg(),Hg())}}function il(e,t){var n=e.stateNode;if(n===null)return null;var o=cu(n);if(o===null)return null;n=o[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":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(pe(231,t,typeof n));return n}var yd=!1;if(qo)try{Fi={},Object.defineProperty(Fi,"passive",{get:function(){yd=!0}}),window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch{yd=!1}var Fi;function Oy(e,t,n,o,r,i,a,l,s){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(p){this.onError(p)}}var Ya=!1,Os=null,$s=!1,wd=null,$y={onError:function(e){Ya=!0,Os=e}};function zy(e,t,n,o,r,i,a,l,s){Ya=!1,Os=null,Oy.apply($y,arguments)}function Vy(e,t,n,o,r,i,a,l,s){if(zy.apply(this,arguments),Ya){if(Ya){var d=Os;Ya=!1,Os=null}else throw Error(pe(198));$s||($s=!0,wd=d)}}function ai(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function qg(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 Mf(e){if(ai(e)!==e)throw Error(pe(188))}function By(e){var t=e.alternate;if(!t){if(t=ai(e),t===null)throw Error(pe(188));return t!==e?null:e}for(var n=e,o=t;;){var r=n.return;if(r===null)break;var i=r.alternate;if(i===null){if(o=r.return,o!==null){n=o;continue}break}if(r.child===i.child){for(i=r.child;i;){if(i===n)return Mf(r),e;if(i===o)return Mf(r),t;i=i.sibling}throw Error(pe(188))}if(n.return!==o.return)n=r,o=i;else{for(var a=!1,l=r.child;l;){if(l===n){a=!0,n=r,o=i;break}if(l===o){a=!0,o=r,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,o=r;break}if(l===o){a=!0,o=i,n=r;break}l=l.sibling}if(!a)throw Error(pe(189))}}if(n.alternate!==o)throw Error(pe(190))}if(n.tag!==3)throw Error(pe(188));return n.stateNode.current===n?e:t}function Kg(e){return e=By(e),e!==null?Yg(e):null}function Yg(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yg(e);if(t!==null)return t;e=e.sibling}return null}var Xg=Xn.unstable_scheduleCallback,Pf=Xn.unstable_cancelCallback,jy=Xn.unstable_shouldYield,Hy=Xn.unstable_requestPaint,Gt=Xn.unstable_now,Uy=Xn.unstable_getCurrentPriorityLevel,ip=Xn.unstable_ImmediatePriority,Qg=Xn.unstable_UserBlockingPriority,zs=Xn.unstable_NormalPriority,Wy=Xn.unstable_LowPriority,Zg=Xn.unstable_IdlePriority,au=null,Lo=null;function Gy(e){if(Lo&&typeof Lo.onCommitFiberRoot=="function")try{Lo.onCommitFiberRoot(au,e,void 0,(e.current.flags&128)===128)}catch{}}var ko=Math.clz32?Math.clz32:Yy,qy=Math.log,Ky=Math.LN2;function Yy(e){return e>>>=0,e===0?32:31-(qy(e)/Ky|0)|0}var cs=64,ds=4194304;function Ga(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 Vs(e,t){var n=e.pendingLanes;if(n===0)return 0;var o=0,r=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~r;l!==0?o=Ga(l):(i&=a,i!==0&&(o=Ga(i)))}else a=n&~r,a!==0?o=Ga(a):i!==0&&(o=Ga(i));if(o===0)return 0;if(t!==0&&t!==o&&(t&r)===0&&(r=o&-o,i=t&-t,r>=i||r===16&&(i&4194240)!==0))return t;if((o&4)!==0&&(o|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=o;0<t;)n=31-ko(t),r=1<<n,o|=e[n],t&=~r;return o}function Xy(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 Qy(e,t){for(var n=e.suspendedLanes,o=e.pingedLanes,r=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-ko(i),l=1<<a,s=r[a];s===-1?((l&n)===0||(l&o)!==0)&&(r[a]=Xy(l,t)):s<=t&&(e.expiredLanes|=l),i&=~l}}function Cd(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Jg(){var e=cs;return cs<<=1,(cs&4194240)===0&&(cs=64),e}function jc(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function yl(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ko(t),e[t]=n}function Zy(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 o=e.eventTimes;for(e=e.expirationTimes;0<n;){var r=31-ko(n),i=1<<r;t[r]=0,o[r]=-1,e[r]=-1,n&=~i}}function ap(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var o=31-ko(n),r=1<<o;r&t|e[o]&t&&(e[o]|=t),n&=~r}}var Mt=0;function e_(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var t_,lp,n_,o_,r_,kd=!1,ps=[],fr=null,gr=null,_r=null,al=new Map,ll=new Map,cr=[],Jy="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 Lf(e,t){switch(e){case"focusin":case"focusout":fr=null;break;case"dragenter":case"dragleave":gr=null;break;case"mouseover":case"mouseout":_r=null;break;case"pointerover":case"pointerout":al.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ll.delete(t.pointerId)}}function Oa(e,t,n,o,r,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:o,nativeEvent:i,targetContainers:[r]},t!==null&&(t=Cl(t),t!==null&&lp(t)),e):(e.eventSystemFlags|=o,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function ew(e,t,n,o,r){switch(t){case"focusin":return fr=Oa(fr,e,t,n,o,r),!0;case"dragenter":return gr=Oa(gr,e,t,n,o,r),!0;case"mouseover":return _r=Oa(_r,e,t,n,o,r),!0;case"pointerover":var i=r.pointerId;return al.set(i,Oa(al.get(i)||null,e,t,n,o,r)),!0;case"gotpointercapture":return i=r.pointerId,ll.set(i,Oa(ll.get(i)||null,e,t,n,o,r)),!0}return!1}function i_(e){var t=Yr(e.target);if(t!==null){var n=ai(t);if(n!==null){if(t=n.tag,t===13){if(t=qg(n),t!==null){e.blockedOn=t,r_(e.priority,function(){n_(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 xs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Sd(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var o=new n.constructor(n.type,n);vd=o,n.target.dispatchEvent(o),vd=null}else return t=Cl(n),t!==null&&lp(t),e.blockedOn=n,!1;t.shift()}return!0}function If(e,t,n){xs(e)&&n.delete(t)}function tw(){kd=!1,fr!==null&&xs(fr)&&(fr=null),gr!==null&&xs(gr)&&(gr=null),_r!==null&&xs(_r)&&(_r=null),al.forEach(If),ll.forEach(If)}function $a(e,t){e.blockedOn===t&&(e.blockedOn=null,kd||(kd=!0,Xn.unstable_scheduleCallback(Xn.unstable_NormalPriority,tw)))}function sl(e){function t(r){return $a(r,e)}if(0<ps.length){$a(ps[0],e);for(var n=1;n<ps.length;n++){var o=ps[n];o.blockedOn===e&&(o.blockedOn=null)}}for(fr!==null&&$a(fr,e),gr!==null&&$a(gr,e),_r!==null&&$a(_r,e),al.forEach(t),ll.forEach(t),n=0;n<cr.length;n++)o=cr[n],o.blockedOn===e&&(o.blockedOn=null);for(;0<cr.length&&(n=cr[0],n.blockedOn===null);)i_(n),n.blockedOn===null&&cr.shift()}var Gi=Qo.ReactCurrentBatchConfig,Bs=!0;function nw(e,t,n,o){var r=Mt,i=Gi.transition;Gi.transition=null;try{Mt=1,sp(e,t,n,o)}finally{Mt=r,Gi.transition=i}}function ow(e,t,n,o){var r=Mt,i=Gi.transition;Gi.transition=null;try{Mt=4,sp(e,t,n,o)}finally{Mt=r,Gi.transition=i}}function sp(e,t,n,o){if(Bs){var r=Sd(e,t,n,o);if(r===null)Yc(e,t,o,js,n),Lf(e,o);else if(ew(r,e,t,n,o))o.stopPropagation();else if(Lf(e,o),t&4&&-1<Jy.indexOf(e)){for(;r!==null;){var i=Cl(r);if(i!==null&&t_(i),i=Sd(e,t,n,o),i===null&&Yc(e,t,o,js,n),i===r)break;r=i}r!==null&&o.stopPropagation()}else Yc(e,t,o,null,n)}}var js=null;function Sd(e,t,n,o){if(js=null,e=rp(o),e=Yr(e),e!==null)if(t=ai(e),t===null)e=null;else if(n=t.tag,n===13){if(e=qg(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 js=e,null}function a_(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(Uy()){case ip:return 1;case Qg:return 4;case zs:case Wy:return 16;case Zg:return 536870912;default:return 16}default:return 16}}var pr=null,up=null,Rs=null;function l_(){if(Rs)return Rs;var e,t=up,n=t.length,o,r="value"in pr?pr.value:pr.textContent,i=r.length;for(e=0;e<n&&t[e]===r[e];e++);var a=n-e;for(o=1;o<=a&&t[n-o]===r[i-o];o++);return Rs=r.slice(e,1<o?1-o:void 0)}function Es(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 ms(){return!0}function Af(){return!1}function Qn(e){function t(n,o,r,i,a){this._reactName=n,this._targetInst=r,this.type=o,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?ms:Af,this.isPropagationStopped=Af,this}return Ut(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=ms)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ms)},persist:function(){},isPersistent:ms}),t}var na={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cp=Qn(na),wl=Ut({},na,{view:0,detail:0}),rw=Qn(wl),Hc,Uc,za,lu=Ut({},wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dp,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!==za&&(za&&e.type==="mousemove"?(Hc=e.screenX-za.screenX,Uc=e.screenY-za.screenY):Uc=Hc=0,za=e),Hc)},movementY:function(e){return"movementY"in e?e.movementY:Uc}}),Of=Qn(lu),iw=Ut({},lu,{dataTransfer:0}),aw=Qn(iw),lw=Ut({},wl,{relatedTarget:0}),Wc=Qn(lw),sw=Ut({},na,{animationName:0,elapsedTime:0,pseudoElement:0}),uw=Qn(sw),cw=Ut({},na,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),dw=Qn(cw),pw=Ut({},na,{data:0}),$f=Qn(pw),mw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fw={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"},gw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _w(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=gw[e])?!!t[e]:!1}function dp(){return _w}var hw=Ut({},wl,{key:function(e){if(e.key){var t=mw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Es(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?fw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dp,charCode:function(e){return e.type==="keypress"?Es(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Es(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),vw=Qn(hw),bw=Ut({},lu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),zf=Qn(bw),yw=Ut({},wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dp}),ww=Qn(yw),Cw=Ut({},na,{propertyName:0,elapsedTime:0,pseudoElement:0}),kw=Qn(Cw),Sw=Ut({},lu,{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}),Nw=Qn(Sw),xw=[9,13,27,32],pp=qo&&"CompositionEvent"in window,Xa=null;qo&&"documentMode"in document&&(Xa=document.documentMode);var Rw=qo&&"TextEvent"in window&&!Xa,s_=qo&&(!pp||Xa&&8<Xa&&11>=Xa),Vf=" ",Bf=!1;function u_(e,t){switch(e){case"keyup":return xw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function c_(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pi=!1;function Ew(e,t){switch(e){case"compositionend":return c_(t);case"keypress":return t.which!==32?null:(Bf=!0,Vf);case"textInput":return e=t.data,e===Vf&&Bf?null:e;default:return null}}function Fw(e,t){if(Pi)return e==="compositionend"||!pp&&u_(e,t)?(e=l_(),Rs=up=pr=null,Pi=!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 s_&&t.locale!=="ko"?null:t.data;default:return null}}var Dw={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 jf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Dw[e.type]:t==="textarea"}function d_(e,t,n,o){jg(o),t=Hs(t,"onChange"),0<t.length&&(n=new cp("onChange","change",null,n,o),e.push({event:n,listeners:t}))}var Qa=null,ul=null;function Tw(e){C_(e,0)}function su(e){var t=Ai(e);if(Ig(t))return e}function Mw(e,t){if(e==="change")return t}var p_=!1;qo&&(qo?(gs="oninput"in document,gs||(Gc=document.createElement("div"),Gc.setAttribute("oninput","return;"),gs=typeof Gc.oninput=="function"),fs=gs):fs=!1,p_=fs&&(!document.documentMode||9<document.documentMode));var fs,gs,Gc;function Hf(){Qa&&(Qa.detachEvent("onpropertychange",m_),ul=Qa=null)}function m_(e){if(e.propertyName==="value"&&su(ul)){var t=[];d_(t,ul,e,rp(e)),Gg(Tw,t)}}function Pw(e,t,n){e==="focusin"?(Hf(),Qa=t,ul=n,Qa.attachEvent("onpropertychange",m_)):e==="focusout"&&Hf()}function Lw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return su(ul)}function Iw(e,t){if(e==="click")return su(t)}function Aw(e,t){if(e==="input"||e==="change")return su(t)}function Ow(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var No=typeof Object.is=="function"?Object.is:Ow;function cl(e,t){if(No(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(o=0;o<n.length;o++){var r=n[o];if(!ad.call(t,r)||!No(e[r],t[r]))return!1}return!0}function Uf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wf(e,t){var n=Uf(e);e=0;for(var o;n;){if(n.nodeType===3){if(o=e+n.textContent.length,e<=t&&o>=t)return{node:n,offset:t-e};e=o}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Uf(n)}}function f_(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?f_(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function g_(){for(var e=window,t=As();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=As(e.document)}return t}function mp(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 $w(e){var t=g_(),n=e.focusedElem,o=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&f_(n.ownerDocument.documentElement,n)){if(o!==null&&mp(n)){if(t=o.start,e=o.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 r=n.textContent.length,i=Math.min(o.start,r);o=o.end===void 0?i:Math.min(o.end,r),!e.extend&&i>o&&(r=o,o=i,i=r),r=Wf(n,i);var a=Wf(n,o);r&&a&&(e.rangeCount!==1||e.anchorNode!==r.node||e.anchorOffset!==r.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(r.node,r.offset),e.removeAllRanges(),i>o?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.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 zw=qo&&"documentMode"in document&&11>=document.documentMode,Li=null,Nd=null,Za=null,xd=!1;function Gf(e,t,n){var o=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;xd||Li==null||Li!==As(o)||(o=Li,"selectionStart"in o&&mp(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Za&&cl(Za,o)||(Za=o,o=Hs(Nd,"onSelect"),0<o.length&&(t=new cp("onSelect","select",null,t,n),e.push({event:t,listeners:o}),t.target=Li)))}function _s(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ii={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionend:_s("Transition","TransitionEnd")},qc={},__={};qo&&(__=document.createElement("div").style,"AnimationEvent"in window||(delete Ii.animationend.animation,delete Ii.animationiteration.animation,delete Ii.animationstart.animation),"TransitionEvent"in window||delete Ii.transitionend.transition);function uu(e){if(qc[e])return qc[e];if(!Ii[e])return e;var t=Ii[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in __)return qc[e]=t[n];return e}var h_=uu("animationend"),v_=uu("animationiteration"),b_=uu("animationstart"),y_=uu("transitionend"),w_=new Map,qf="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 Sr(e,t){w_.set(e,t),ii(t,[e])}for(hs=0;hs<qf.length;hs++)vs=qf[hs],Kf=vs.toLowerCase(),Yf=vs[0].toUpperCase()+vs.slice(1),Sr(Kf,"on"+Yf);var vs,Kf,Yf,hs;Sr(h_,"onAnimationEnd");Sr(v_,"onAnimationIteration");Sr(b_,"onAnimationStart");Sr("dblclick","onDoubleClick");Sr("focusin","onFocus");Sr("focusout","onBlur");Sr(y_,"onTransitionEnd");Yi("onMouseEnter",["mouseout","mouseover"]);Yi("onMouseLeave",["mouseout","mouseover"]);Yi("onPointerEnter",["pointerout","pointerover"]);Yi("onPointerLeave",["pointerout","pointerover"]);ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ii("onBeforeInput",["compositionend","keypress","textInput","paste"]);ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qa="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(" "),Vw=new Set("cancel close invalid load scroll toggle".split(" ").concat(qa));function Xf(e,t,n){var o=e.type||"unknown-event";e.currentTarget=n,Vy(o,t,void 0,e),e.currentTarget=null}function C_(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var o=e[n],r=o.event;o=o.listeners;e:{var i=void 0;if(t)for(var a=o.length-1;0<=a;a--){var l=o[a],s=l.instance,d=l.currentTarget;if(l=l.listener,s!==i&&r.isPropagationStopped())break e;Xf(r,l,d),i=s}else for(a=0;a<o.length;a++){if(l=o[a],s=l.instance,d=l.currentTarget,l=l.listener,s!==i&&r.isPropagationStopped())break e;Xf(r,l,d),i=s}}}if($s)throw e=wd,$s=!1,wd=null,e}function It(e,t){var n=t[Td];n===void 0&&(n=t[Td]=new Set);var o=e+"__bubble";n.has(o)||(k_(t,e,2,!1),n.add(o))}function Kc(e,t,n){var o=0;t&&(o|=4),k_(n,e,o,t)}var bs="_reactListening"+Math.random().toString(36).slice(2);function dl(e){if(!e[bs]){e[bs]=!0,Dg.forEach(function(n){n!=="selectionchange"&&(Vw.has(n)||Kc(n,!1,e),Kc(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[bs]||(t[bs]=!0,Kc("selectionchange",!1,t))}}function k_(e,t,n,o){switch(a_(t)){case 1:var r=nw;break;case 4:r=ow;break;default:r=sp}n=r.bind(null,t,n,e),r=void 0,!yd||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),o?r!==void 0?e.addEventListener(t,n,{capture:!0,passive:r}):e.addEventListener(t,n,!0):r!==void 0?e.addEventListener(t,n,{passive:r}):e.addEventListener(t,n,!1)}function Yc(e,t,n,o,r){var i=o;if((t&1)===0&&(t&2)===0&&o!==null)e:for(;;){if(o===null)return;var a=o.tag;if(a===3||a===4){var l=o.stateNode.containerInfo;if(l===r||l.nodeType===8&&l.parentNode===r)break;if(a===4)for(a=o.return;a!==null;){var s=a.tag;if((s===3||s===4)&&(s=a.stateNode.containerInfo,s===r||s.nodeType===8&&s.parentNode===r))return;a=a.return}for(;l!==null;){if(a=Yr(l),a===null)return;if(s=a.tag,s===5||s===6){o=i=a;continue e}l=l.parentNode}}o=o.return}Gg(function(){var d=i,p=rp(n),f=[];e:{var m=w_.get(e);if(m!==void 0){var c=cp,v=e;switch(e){case"keypress":if(Es(n)===0)break e;case"keydown":case"keyup":c=vw;break;case"focusin":v="focus",c=Wc;break;case"focusout":v="blur",c=Wc;break;case"beforeblur":case"afterblur":c=Wc;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":c=Of;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":c=aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":c=ww;break;case h_:case v_:case b_:c=uw;break;case y_:c=kw;break;case"scroll":c=rw;break;case"wheel":c=Nw;break;case"copy":case"cut":case"paste":c=dw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":c=zf}var h=(t&4)!==0,b=!h&&e==="scroll",_=h?m!==null?m+"Capture":null:m;h=[];for(var g=d,y;g!==null;){y=g;var k=y.stateNode;if(y.tag===5&&k!==null&&(y=k,_!==null&&(k=il(g,_),k!=null&&h.push(pl(g,k,y)))),b)break;g=g.return}0<h.length&&(m=new c(m,v,null,n,p),f.push({event:m,listeners:h}))}}if((t&7)===0){e:{if(m=e==="mouseover"||e==="pointerover",c=e==="mouseout"||e==="pointerout",m&&n!==vd&&(v=n.relatedTarget||n.fromElement)&&(Yr(v)||v[Ko]))break e;if((c||m)&&(m=p.window===p?p:(m=p.ownerDocument)?m.defaultView||m.parentWindow:window,c?(v=n.relatedTarget||n.toElement,c=d,v=v?Yr(v):null,v!==null&&(b=ai(v),v!==b||v.tag!==5&&v.tag!==6)&&(v=null)):(c=null,v=d),c!==v)){if(h=Of,k="onMouseLeave",_="onMouseEnter",g="mouse",(e==="pointerout"||e==="pointerover")&&(h=zf,k="onPointerLeave",_="onPointerEnter",g="pointer"),b=c==null?m:Ai(c),y=v==null?m:Ai(v),m=new h(k,g+"leave",c,n,p),m.target=b,m.relatedTarget=y,k=null,Yr(p)===d&&(h=new h(_,g+"enter",v,n,p),h.target=y,h.relatedTarget=b,k=h),b=k,c&&v)t:{for(h=c,_=v,g=0,y=h;y;y=Di(y))g++;for(y=0,k=_;k;k=Di(k))y++;for(;0<g-y;)h=Di(h),g--;for(;0<y-g;)_=Di(_),y--;for(;g--;){if(h===_||_!==null&&h===_.alternate)break t;h=Di(h),_=Di(_)}h=null}else h=null;c!==null&&Qf(f,m,c,h,!1),v!==null&&b!==null&&Qf(f,b,v,h,!0)}}e:{if(m=d?Ai(d):window,c=m.nodeName&&m.nodeName.toLowerCase(),c==="select"||c==="input"&&m.type==="file")var D=Mw;else if(jf(m))if(p_)D=Aw;else{D=Lw;var M=Pw}else(c=m.nodeName)&&c.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(D=Iw);if(D&&(D=D(e,d))){d_(f,D,n,p);break e}M&&M(e,m,d),e==="focusout"&&(M=m._wrapperState)&&M.controlled&&m.type==="number"&&md(m,"number",m.value)}switch(M=d?Ai(d):window,e){case"focusin":(jf(M)||M.contentEditable==="true")&&(Li=M,Nd=d,Za=null);break;case"focusout":Za=Nd=Li=null;break;case"mousedown":xd=!0;break;case"contextmenu":case"mouseup":case"dragend":xd=!1,Gf(f,n,p);break;case"selectionchange":if(zw)break;case"keydown":case"keyup":Gf(f,n,p)}var V;if(pp)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else Pi?u_(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(s_&&n.locale!=="ko"&&(Pi||j!=="onCompositionStart"?j==="onCompositionEnd"&&Pi&&(V=l_()):(pr=p,up="value"in pr?pr.value:pr.textContent,Pi=!0)),M=Hs(d,j),0<M.length&&(j=new $f(j,e,null,n,p),f.push({event:j,listeners:M}),V?j.data=V:(V=c_(n),V!==null&&(j.data=V)))),(V=Rw?Ew(e,n):Fw(e,n))&&(d=Hs(d,"onBeforeInput"),0<d.length&&(p=new $f("onBeforeInput","beforeinput",null,n,p),f.push({event:p,listeners:d}),p.data=V))}C_(f,t)})}function pl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Hs(e,t){for(var n=t+"Capture",o=[];e!==null;){var r=e,i=r.stateNode;r.tag===5&&i!==null&&(r=i,i=il(e,n),i!=null&&o.unshift(pl(e,i,r)),i=il(e,t),i!=null&&o.push(pl(e,i,r))),e=e.return}return o}function Di(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function Qf(e,t,n,o,r){for(var i=t._reactName,a=[];n!==null&&n!==o;){var l=n,s=l.alternate,d=l.stateNode;if(s!==null&&s===o)break;l.tag===5&&d!==null&&(l=d,r?(s=il(n,i),s!=null&&a.unshift(pl(n,s,l))):r||(s=il(n,i),s!=null&&a.push(pl(n,s,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var Bw=/\r\n?/g,jw=/\u0000|\uFFFD/g;function Zf(e){return(typeof e=="string"?e:""+e).replace(Bw,`
`).replace(jw,"")}function ys(e,t,n){if(t=Zf(t),Zf(e)!==t&&n)throw Error(pe(425))}function Us(){}var Rd=null,Ed=null;function Fd(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 Dd=typeof setTimeout=="function"?setTimeout:void 0,Hw=typeof clearTimeout=="function"?clearTimeout:void 0,Jf=typeof Promise=="function"?Promise:void 0,Uw=typeof queueMicrotask=="function"?queueMicrotask:typeof Jf<"u"?function(e){return Jf.resolve(null).then(e).catch(Ww)}:Dd;function Ww(e){setTimeout(function(){throw e})}function Xc(e,t){var n=t,o=0;do{var r=n.nextSibling;if(e.removeChild(n),r&&r.nodeType===8)if(n=r.data,n==="/$"){if(o===0){e.removeChild(r),sl(t);return}o--}else n!=="$"&&n!=="$?"&&n!=="$!"||o++;n=r}while(n);sl(t)}function hr(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 eg(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 oa=Math.random().toString(36).slice(2),Po="__reactFiber$"+oa,ml="__reactProps$"+oa,Ko="__reactContainer$"+oa,Td="__reactEvents$"+oa,Gw="__reactListeners$"+oa,qw="__reactHandles$"+oa;function Yr(e){var t=e[Po];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Ko]||n[Po]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=eg(e);e!==null;){if(n=e[Po])return n;e=eg(e)}return t}e=n,n=e.parentNode}return null}function Cl(e){return e=e[Po]||e[Ko],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ai(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(pe(33))}function cu(e){return e[ml]||null}var Md=[],Oi=-1;function Nr(e){return{current:e}}function At(e){0>Oi||(e.current=Md[Oi],Md[Oi]=null,Oi--)}function Lt(e,t){Oi++,Md[Oi]=e.current,e.current=t}var kr={},yn=Nr(kr),An=Nr(!1),ei=kr;function Xi(e,t){var n=e.type.contextTypes;if(!n)return kr;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===t)return o.__reactInternalMemoizedMaskedChildContext;var r={},i;for(i in n)r[i]=t[i];return o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=r),r}function On(e){return e=e.childContextTypes,e!=null}function Ws(){At(An),At(yn)}function tg(e,t,n){if(yn.current!==kr)throw Error(pe(168));Lt(yn,t),Lt(An,n)}function S_(e,t,n){var o=e.stateNode;if(t=t.childContextTypes,typeof o.getChildContext!="function")return n;o=o.getChildContext();for(var r in o)if(!(r in t))throw Error(pe(108,Py(e)||"Unknown",r));return Ut({},n,o)}function Gs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||kr,ei=yn.current,Lt(yn,e),Lt(An,An.current),!0}function ng(e,t,n){var o=e.stateNode;if(!o)throw Error(pe(169));n?(e=S_(e,t,ei),o.__reactInternalMemoizedMergedChildContext=e,At(An),At(yn),Lt(yn,e)):At(An),Lt(An,n)}var Ho=null,du=!1,Qc=!1;function N_(e){Ho===null?Ho=[e]:Ho.push(e)}function Kw(e){du=!0,N_(e)}function xr(){if(!Qc&&Ho!==null){Qc=!0;var e=0,t=Mt;try{var n=Ho;for(Mt=1;e<n.length;e++){var o=n[e];do o=o(!0);while(o!==null)}Ho=null,du=!1}catch(r){throw Ho!==null&&(Ho=Ho.slice(e+1)),Xg(ip,xr),r}finally{Mt=t,Qc=!1}}return null}var $i=[],zi=0,qs=null,Ks=0,oo=[],ro=0,ti=null,Uo=1,Wo="";function qr(e,t){$i[zi++]=Ks,$i[zi++]=qs,qs=e,Ks=t}function x_(e,t,n){oo[ro++]=Uo,oo[ro++]=Wo,oo[ro++]=ti,ti=e;var o=Uo;e=Wo;var r=32-ko(o)-1;o&=~(1<<r),n+=1;var i=32-ko(t)+r;if(30<i){var a=r-r%5;i=(o&(1<<a)-1).toString(32),o>>=a,r-=a,Uo=1<<32-ko(t)+r|n<<r|o,Wo=i+e}else Uo=1<<i|n<<r|o,Wo=e}function fp(e){e.return!==null&&(qr(e,1),x_(e,1,0))}function gp(e){for(;e===qs;)qs=$i[--zi],$i[zi]=null,Ks=$i[--zi],$i[zi]=null;for(;e===ti;)ti=oo[--ro],oo[ro]=null,Wo=oo[--ro],oo[ro]=null,Uo=oo[--ro],oo[ro]=null}var Yn=null,Kn=null,$t=!1,Co=null;function R_(e,t){var n=io(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 og(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,Yn=e,Kn=hr(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Yn=e,Kn=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=ti!==null?{id:Uo,overflow:Wo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=io(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Yn=e,Kn=null,!0):!1;default:return!1}}function Pd(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Ld(e){if($t){var t=Kn;if(t){var n=t;if(!og(e,t)){if(Pd(e))throw Error(pe(418));t=hr(n.nextSibling);var o=Yn;t&&og(e,t)?R_(o,n):(e.flags=e.flags&-4097|2,$t=!1,Yn=e)}}else{if(Pd(e))throw Error(pe(418));e.flags=e.flags&-4097|2,$t=!1,Yn=e}}}function rg(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Yn=e}function ws(e){if(e!==Yn)return!1;if(!$t)return rg(e),$t=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Fd(e.type,e.memoizedProps)),t&&(t=Kn)){if(Pd(e))throw E_(),Error(pe(418));for(;t;)R_(e,t),t=hr(t.nextSibling)}if(rg(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(pe(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Kn=hr(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Kn=null}}else Kn=Yn?hr(e.stateNode.nextSibling):null;return!0}function E_(){for(var e=Kn;e;)e=hr(e.nextSibling)}function Qi(){Kn=Yn=null,$t=!1}function _p(e){Co===null?Co=[e]:Co.push(e)}var Yw=Qo.ReactCurrentBatchConfig;function Va(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(pe(309));var o=n.stateNode}if(!o)throw Error(pe(147,e));var r=o,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=r.refs;a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(pe(284));if(!n._owner)throw Error(pe(290,e))}return e}function Cs(e,t){throw e=Object.prototype.toString.call(t),Error(pe(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ig(e){var t=e._init;return t(e._payload)}function F_(e){function t(_,g){if(e){var y=_.deletions;y===null?(_.deletions=[g],_.flags|=16):y.push(g)}}function n(_,g){if(!e)return null;for(;g!==null;)t(_,g),g=g.sibling;return null}function o(_,g){for(_=new Map;g!==null;)g.key!==null?_.set(g.key,g):_.set(g.index,g),g=g.sibling;return _}function r(_,g){return _=wr(_,g),_.index=0,_.sibling=null,_}function i(_,g,y){return _.index=y,e?(y=_.alternate,y!==null?(y=y.index,y<g?(_.flags|=2,g):y):(_.flags|=2,g)):(_.flags|=1048576,g)}function a(_){return e&&_.alternate===null&&(_.flags|=2),_}function l(_,g,y,k){return g===null||g.tag!==6?(g=rd(y,_.mode,k),g.return=_,g):(g=r(g,y),g.return=_,g)}function s(_,g,y,k){var D=y.type;return D===Mi?p(_,g,y.props.children,k,y.key):g!==null&&(g.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===sr&&ig(D)===g.type)?(k=r(g,y.props),k.ref=Va(_,g,y),k.return=_,k):(k=Is(y.type,y.key,y.props,null,_.mode,k),k.ref=Va(_,g,y),k.return=_,k)}function d(_,g,y,k){return g===null||g.tag!==4||g.stateNode.containerInfo!==y.containerInfo||g.stateNode.implementation!==y.implementation?(g=id(y,_.mode,k),g.return=_,g):(g=r(g,y.children||[]),g.return=_,g)}function p(_,g,y,k,D){return g===null||g.tag!==7?(g=Jr(y,_.mode,k,D),g.return=_,g):(g=r(g,y),g.return=_,g)}function f(_,g,y){if(typeof g=="string"&&g!==""||typeof g=="number")return g=rd(""+g,_.mode,y),g.return=_,g;if(typeof g=="object"&&g!==null){switch(g.$$typeof){case ls:return y=Is(g.type,g.key,g.props,null,_.mode,y),y.ref=Va(_,null,g),y.return=_,y;case Ti:return g=id(g,_.mode,y),g.return=_,g;case sr:var k=g._init;return f(_,k(g._payload),y)}if(Wa(g)||Aa(g))return g=Jr(g,_.mode,y,null),g.return=_,g;Cs(_,g)}return null}function m(_,g,y,k){var D=g!==null?g.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return D!==null?null:l(_,g,""+y,k);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case ls:return y.key===D?s(_,g,y,k):null;case Ti:return y.key===D?d(_,g,y,k):null;case sr:return D=y._init,m(_,g,D(y._payload),k)}if(Wa(y)||Aa(y))return D!==null?null:p(_,g,y,k,null);Cs(_,y)}return null}function c(_,g,y,k,D){if(typeof k=="string"&&k!==""||typeof k=="number")return _=_.get(y)||null,l(g,_,""+k,D);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ls:return _=_.get(k.key===null?y:k.key)||null,s(g,_,k,D);case Ti:return _=_.get(k.key===null?y:k.key)||null,d(g,_,k,D);case sr:var M=k._init;return c(_,g,y,M(k._payload),D)}if(Wa(k)||Aa(k))return _=_.get(y)||null,p(g,_,k,D,null);Cs(g,k)}return null}function v(_,g,y,k){for(var D=null,M=null,V=g,j=g=0,re=null;V!==null&&j<y.length;j++){V.index>j?(re=V,V=null):re=V.sibling;var ne=m(_,V,y[j],k);if(ne===null){V===null&&(V=re);break}e&&V&&ne.alternate===null&&t(_,V),g=i(ne,g,j),M===null?D=ne:M.sibling=ne,M=ne,V=re}if(j===y.length)return n(_,V),$t&&qr(_,j),D;if(V===null){for(;j<y.length;j++)V=f(_,y[j],k),V!==null&&(g=i(V,g,j),M===null?D=V:M.sibling=V,M=V);return $t&&qr(_,j),D}for(V=o(_,V);j<y.length;j++)re=c(V,_,j,y[j],k),re!==null&&(e&&re.alternate!==null&&V.delete(re.key===null?j:re.key),g=i(re,g,j),M===null?D=re:M.sibling=re,M=re);return e&&V.forEach(function(ce){return t(_,ce)}),$t&&qr(_,j),D}function h(_,g,y,k){var D=Aa(y);if(typeof D!="function")throw Error(pe(150));if(y=D.call(y),y==null)throw Error(pe(151));for(var M=D=null,V=g,j=g=0,re=null,ne=y.next();V!==null&&!ne.done;j++,ne=y.next()){V.index>j?(re=V,V=null):re=V.sibling;var ce=m(_,V,ne.value,k);if(ce===null){V===null&&(V=re);break}e&&V&&ce.alternate===null&&t(_,V),g=i(ce,g,j),M===null?D=ce:M.sibling=ce,M=ce,V=re}if(ne.done)return n(_,V),$t&&qr(_,j),D;if(V===null){for(;!ne.done;j++,ne=y.next())ne=f(_,ne.value,k),ne!==null&&(g=i(ne,g,j),M===null?D=ne:M.sibling=ne,M=ne);return $t&&qr(_,j),D}for(V=o(_,V);!ne.done;j++,ne=y.next())ne=c(V,_,j,ne.value,k),ne!==null&&(e&&ne.alternate!==null&&V.delete(ne.key===null?j:ne.key),g=i(ne,g,j),M===null?D=ne:M.sibling=ne,M=ne);return e&&V.forEach(function(de){return t(_,de)}),$t&&qr(_,j),D}function b(_,g,y,k){if(typeof y=="object"&&y!==null&&y.type===Mi&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ls:e:{for(var D=y.key,M=g;M!==null;){if(M.key===D){if(D=y.type,D===Mi){if(M.tag===7){n(_,M.sibling),g=r(M,y.props.children),g.return=_,_=g;break e}}else if(M.elementType===D||typeof D=="object"&&D!==null&&D.$$typeof===sr&&ig(D)===M.type){n(_,M.sibling),g=r(M,y.props),g.ref=Va(_,M,y),g.return=_,_=g;break e}n(_,M);break}else t(_,M);M=M.sibling}y.type===Mi?(g=Jr(y.props.children,_.mode,k,y.key),g.return=_,_=g):(k=Is(y.type,y.key,y.props,null,_.mode,k),k.ref=Va(_,g,y),k.return=_,_=k)}return a(_);case Ti:e:{for(M=y.key;g!==null;){if(g.key===M)if(g.tag===4&&g.stateNode.containerInfo===y.containerInfo&&g.stateNode.implementation===y.implementation){n(_,g.sibling),g=r(g,y.children||[]),g.return=_,_=g;break e}else{n(_,g);break}else t(_,g);g=g.sibling}g=id(y,_.mode,k),g.return=_,_=g}return a(_);case sr:return M=y._init,b(_,g,M(y._payload),k)}if(Wa(y))return v(_,g,y,k);if(Aa(y))return h(_,g,y,k);Cs(_,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,g!==null&&g.tag===6?(n(_,g.sibling),g=r(g,y),g.return=_,_=g):(n(_,g),g=rd(y,_.mode,k),g.return=_,_=g),a(_)):n(_,g)}return b}var Zi=F_(!0),D_=F_(!1),Ys=Nr(null),Xs=null,Vi=null,hp=null;function vp(){hp=Vi=Xs=null}function bp(e){var t=Ys.current;At(Ys),e._currentValue=t}function Id(e,t,n){for(;e!==null;){var o=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,o!==null&&(o.childLanes|=t)):o!==null&&(o.childLanes&t)!==t&&(o.childLanes|=t),e===n)break;e=e.return}}function qi(e,t){Xs=e,hp=Vi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&t)!==0&&(In=!0),e.firstContext=null)}function lo(e){var t=e._currentValue;if(hp!==e)if(e={context:e,memoizedValue:t,next:null},Vi===null){if(Xs===null)throw Error(pe(308));Vi=e,Xs.dependencies={lanes:0,firstContext:e}}else Vi=Vi.next=e;return t}var Xr=null;function yp(e){Xr===null?Xr=[e]:Xr.push(e)}function T_(e,t,n,o){var r=t.interleaved;return r===null?(n.next=n,yp(t)):(n.next=r.next,r.next=n),t.interleaved=n,Yo(e,o)}function Yo(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 ur=!1;function wp(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 Go(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function vr(e,t,n){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(kt&2)!==0){var r=o.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),o.pending=t,Yo(e,n)}return r=o.interleaved,r===null?(t.next=t,yp(o)):(t.next=r.next,r.next=t),o.interleaved=t,Yo(e,n)}function Fs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,ap(e,n)}}function ag(e,t){var n=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,n===o)){var r=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?r=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?r=i=t:i=i.next=t}else r=i=t;n={baseState:o.baseState,firstBaseUpdate:r,lastBaseUpdate:i,shared:o.shared,effects:o.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Qs(e,t,n,o){var r=e.updateQueue;ur=!1;var i=r.firstBaseUpdate,a=r.lastBaseUpdate,l=r.shared.pending;if(l!==null){r.shared.pending=null;var s=l,d=s.next;s.next=null,a===null?i=d:a.next=d,a=s;var p=e.alternate;p!==null&&(p=p.updateQueue,l=p.lastBaseUpdate,l!==a&&(l===null?p.firstBaseUpdate=d:l.next=d,p.lastBaseUpdate=s))}if(i!==null){var f=r.baseState;a=0,p=d=s=null,l=i;do{var m=l.lane,c=l.eventTime;if((o&m)===m){p!==null&&(p=p.next={eventTime:c,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var v=e,h=l;switch(m=t,c=n,h.tag){case 1:if(v=h.payload,typeof v=="function"){f=v.call(c,f,m);break e}f=v;break e;case 3:v.flags=v.flags&-65537|128;case 0:if(v=h.payload,m=typeof v=="function"?v.call(c,f,m):v,m==null)break e;f=Ut({},f,m);break e;case 2:ur=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,m=r.effects,m===null?r.effects=[l]:m.push(l))}else c={eventTime:c,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},p===null?(d=p=c,s=f):p=p.next=c,a|=m;if(l=l.next,l===null){if(l=r.shared.pending,l===null)break;m=l,l=m.next,m.next=null,r.lastBaseUpdate=m,r.shared.pending=null}}while(!0);if(p===null&&(s=f),r.baseState=s,r.firstBaseUpdate=d,r.lastBaseUpdate=p,t=r.shared.interleaved,t!==null){r=t;do a|=r.lane,r=r.next;while(r!==t)}else i===null&&(r.shared.lanes=0);oi|=a,e.lanes=a,e.memoizedState=f}}function lg(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var o=e[t],r=o.callback;if(r!==null){if(o.callback=null,o=n,typeof r!="function")throw Error(pe(191,r));r.call(o)}}}var kl={},Io=Nr(kl),fl=Nr(kl),gl=Nr(kl);function Qr(e){if(e===kl)throw Error(pe(174));return e}function Cp(e,t){switch(Lt(gl,t),Lt(fl,e),Lt(Io,kl),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:gd(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=gd(t,e)}At(Io),Lt(Io,t)}function Ji(){At(Io),At(fl),At(gl)}function P_(e){Qr(gl.current);var t=Qr(Io.current),n=gd(t,e.type);t!==n&&(Lt(fl,e),Lt(Io,n))}function kp(e){fl.current===e&&(At(Io),At(fl))}var jt=Nr(0);function Zs(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)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Zc=[];function Sp(){for(var e=0;e<Zc.length;e++)Zc[e]._workInProgressVersionPrimary=null;Zc.length=0}var Ds=Qo.ReactCurrentDispatcher,Jc=Qo.ReactCurrentBatchConfig,ni=0,Ht=null,nn=null,ln=null,Js=!1,Ja=!1,_l=0,Xw=0;function hn(){throw Error(pe(321))}function Np(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!No(e[n],t[n]))return!1;return!0}function xp(e,t,n,o,r,i){if(ni=i,Ht=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ds.current=e===null||e.memoizedState===null?eC:tC,e=n(o,r),Ja){i=0;do{if(Ja=!1,_l=0,25<=i)throw Error(pe(301));i+=1,ln=nn=null,t.updateQueue=null,Ds.current=nC,e=n(o,r)}while(Ja)}if(Ds.current=eu,t=nn!==null&&nn.next!==null,ni=0,ln=nn=Ht=null,Js=!1,t)throw Error(pe(300));return e}function Rp(){var e=_l!==0;return _l=0,e}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ln===null?Ht.memoizedState=ln=e:ln=ln.next=e,ln}function so(){if(nn===null){var e=Ht.alternate;e=e!==null?e.memoizedState:null}else e=nn.next;var t=ln===null?Ht.memoizedState:ln.next;if(t!==null)ln=t,nn=e;else{if(e===null)throw Error(pe(310));nn=e,e={memoizedState:nn.memoizedState,baseState:nn.baseState,baseQueue:nn.baseQueue,queue:nn.queue,next:null},ln===null?Ht.memoizedState=ln=e:ln=ln.next=e}return ln}function hl(e,t){return typeof t=="function"?t(e):t}function ed(e){var t=so(),n=t.queue;if(n===null)throw Error(pe(311));n.lastRenderedReducer=e;var o=nn,r=o.baseQueue,i=n.pending;if(i!==null){if(r!==null){var a=r.next;r.next=i.next,i.next=a}o.baseQueue=r=i,n.pending=null}if(r!==null){i=r.next,o=o.baseState;var l=a=null,s=null,d=i;do{var p=d.lane;if((ni&p)===p)s!==null&&(s=s.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),o=d.hasEagerState?d.eagerState:e(o,d.action);else{var f={lane:p,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};s===null?(l=s=f,a=o):s=s.next=f,Ht.lanes|=p,oi|=p}d=d.next}while(d!==null&&d!==i);s===null?a=o:s.next=l,No(o,t.memoizedState)||(In=!0),t.memoizedState=o,t.baseState=a,t.baseQueue=s,n.lastRenderedState=o}if(e=n.interleaved,e!==null){r=e;do i=r.lane,Ht.lanes|=i,oi|=i,r=r.next;while(r!==e)}else r===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function td(e){var t=so(),n=t.queue;if(n===null)throw Error(pe(311));n.lastRenderedReducer=e;var o=n.dispatch,r=n.pending,i=t.memoizedState;if(r!==null){n.pending=null;var a=r=r.next;do i=e(i,a.action),a=a.next;while(a!==r);No(i,t.memoizedState)||(In=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,o]}function L_(){}function I_(e,t){var n=Ht,o=so(),r=t(),i=!No(o.memoizedState,r);if(i&&(o.memoizedState=r,In=!0),o=o.queue,Ep($_.bind(null,n,o,e),[e]),o.getSnapshot!==t||i||ln!==null&&ln.memoizedState.tag&1){if(n.flags|=2048,vl(9,O_.bind(null,n,o,r,t),void 0,null),sn===null)throw Error(pe(349));(ni&30)!==0||A_(n,t,r)}return r}function A_(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function O_(e,t,n,o){t.value=n,t.getSnapshot=o,z_(t)&&V_(e)}function $_(e,t,n){return n(function(){z_(t)&&V_(e)})}function z_(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!No(e,n)}catch{return!0}}function V_(e){var t=Yo(e,1);t!==null&&So(t,e,1,-1)}function sg(e){var t=Mo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hl,lastRenderedState:e},t.queue=e,e=e.dispatch=Jw.bind(null,Ht,e),[t.memoizedState,e]}function vl(e,t,n,o){return e={tag:e,create:t,destroy:n,deps:o,next:null},t=Ht.updateQueue,t===null?(t={lastEffect:null,stores:null},Ht.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(o=n.next,n.next=e,e.next=o,t.lastEffect=e)),e}function B_(){return so().memoizedState}function Ts(e,t,n,o){var r=Mo();Ht.flags|=e,r.memoizedState=vl(1|t,n,void 0,o===void 0?null:o)}function pu(e,t,n,o){var r=so();o=o===void 0?null:o;var i=void 0;if(nn!==null){var a=nn.memoizedState;if(i=a.destroy,o!==null&&Np(o,a.deps)){r.memoizedState=vl(t,n,i,o);return}}Ht.flags|=e,r.memoizedState=vl(1|t,n,i,o)}function ug(e,t){return Ts(8390656,8,e,t)}function Ep(e,t){return pu(2048,8,e,t)}function j_(e,t){return pu(4,2,e,t)}function H_(e,t){return pu(4,4,e,t)}function U_(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 W_(e,t,n){return n=n!=null?n.concat([e]):null,pu(4,4,U_.bind(null,t,e),n)}function Fp(){}function G_(e,t){var n=so();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Np(t,o[1])?o[0]:(n.memoizedState=[e,t],e)}function q_(e,t){var n=so();t=t===void 0?null:t;var o=n.memoizedState;return o!==null&&t!==null&&Np(t,o[1])?o[0]:(e=e(),n.memoizedState=[e,t],e)}function K_(e,t,n){return(ni&21)===0?(e.baseState&&(e.baseState=!1,In=!0),e.memoizedState=n):(No(n,t)||(n=Jg(),Ht.lanes|=n,oi|=n,e.baseState=!0),t)}function Qw(e,t){var n=Mt;Mt=n!==0&&4>n?n:4,e(!0);var o=Jc.transition;Jc.transition={};try{e(!1),t()}finally{Mt=n,Jc.transition=o}}function Y_(){return so().memoizedState}function Zw(e,t,n){var o=yr(e);if(n={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null},X_(e))Q_(t,n);else if(n=T_(e,t,n,o),n!==null){var r=Rn();So(n,e,o,r),Z_(n,t,o)}}function Jw(e,t,n){var o=yr(e),r={lane:o,action:n,hasEagerState:!1,eagerState:null,next:null};if(X_(e))Q_(t,r);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(r.hasEagerState=!0,r.eagerState=l,No(l,a)){var s=t.interleaved;s===null?(r.next=r,yp(t)):(r.next=s.next,s.next=r),t.interleaved=r;return}}catch{}n=T_(e,t,r,o),n!==null&&(r=Rn(),So(n,e,o,r),Z_(n,t,o))}}function X_(e){var t=e.alternate;return e===Ht||t!==null&&t===Ht}function Q_(e,t){Ja=Js=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Z_(e,t,n){if((n&4194240)!==0){var o=t.lanes;o&=e.pendingLanes,n|=o,t.lanes=n,ap(e,n)}}var eu={readContext:lo,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useInsertionEffect:hn,useLayoutEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useMutableSource:hn,useSyncExternalStore:hn,useId:hn,unstable_isNewReconciler:!1},eC={readContext:lo,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:lo,useEffect:ug,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ts(4194308,4,U_.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ts(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ts(4,2,e,t)},useMemo:function(e,t){var n=Mo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var o=Mo();return t=n!==void 0?n(t):t,o.memoizedState=o.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},o.queue=e,e=e.dispatch=Zw.bind(null,Ht,e),[o.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:sg,useDebugValue:Fp,useDeferredValue:function(e){return Mo().memoizedState=e},useTransition:function(){var e=sg(!1),t=e[0];return e=Qw.bind(null,e[1]),Mo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var o=Ht,r=Mo();if($t){if(n===void 0)throw Error(pe(407));n=n()}else{if(n=t(),sn===null)throw Error(pe(349));(ni&30)!==0||A_(o,t,n)}r.memoizedState=n;var i={value:n,getSnapshot:t};return r.queue=i,ug($_.bind(null,o,i,e),[e]),o.flags|=2048,vl(9,O_.bind(null,o,i,n,t),void 0,null),n},useId:function(){var e=Mo(),t=sn.identifierPrefix;if($t){var n=Wo,o=Uo;n=(o&~(1<<32-ko(o)-1)).toString(32)+n,t=":"+t+"R"+n,n=_l++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=Xw++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},tC={readContext:lo,useCallback:G_,useContext:lo,useEffect:Ep,useImperativeHandle:W_,useInsertionEffect:j_,useLayoutEffect:H_,useMemo:q_,useReducer:ed,useRef:B_,useState:function(){return ed(hl)},useDebugValue:Fp,useDeferredValue:function(e){var t=so();return K_(t,nn.memoizedState,e)},useTransition:function(){var e=ed(hl)[0],t=so().memoizedState;return[e,t]},useMutableSource:L_,useSyncExternalStore:I_,useId:Y_,unstable_isNewReconciler:!1},nC={readContext:lo,useCallback:G_,useContext:lo,useEffect:Ep,useImperativeHandle:W_,useInsertionEffect:j_,useLayoutEffect:H_,useMemo:q_,useReducer:td,useRef:B_,useState:function(){return td(hl)},useDebugValue:Fp,useDeferredValue:function(e){var t=so();return nn===null?t.memoizedState=e:K_(t,nn.memoizedState,e)},useTransition:function(){var e=td(hl)[0],t=so().memoizedState;return[e,t]},useMutableSource:L_,useSyncExternalStore:I_,useId:Y_,unstable_isNewReconciler:!1};function yo(e,t){if(e&&e.defaultProps){t=Ut({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function Ad(e,t,n,o){t=e.memoizedState,n=n(o,t),n=n==null?t:Ut({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mu={isMounted:function(e){return(e=e._reactInternals)?ai(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var o=Rn(),r=yr(e),i=Go(o,r);i.payload=t,n!=null&&(i.callback=n),t=vr(e,i,r),t!==null&&(So(t,e,r,o),Fs(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var o=Rn(),r=yr(e),i=Go(o,r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vr(e,i,r),t!==null&&(So(t,e,r,o),Fs(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Rn(),o=yr(e),r=Go(n,o);r.tag=2,t!=null&&(r.callback=t),t=vr(e,r,o),t!==null&&(So(t,e,o,n),Fs(t,e,o))}};function cg(e,t,n,o,r,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,i,a):t.prototype&&t.prototype.isPureReactComponent?!cl(n,o)||!cl(r,i):!0}function J_(e,t,n){var o=!1,r=kr,i=t.contextType;return typeof i=="object"&&i!==null?i=lo(i):(r=On(t)?ei:yn.current,o=t.contextTypes,i=(o=o!=null)?Xi(e,r):kr),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=mu,e.stateNode=t,t._reactInternals=e,o&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=i),t}function dg(e,t,n,o){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,o),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,o),t.state!==e&&mu.enqueueReplaceState(t,t.state,null)}function Od(e,t,n,o){var r=e.stateNode;r.props=n,r.state=e.memoizedState,r.refs={},wp(e);var i=t.contextType;typeof i=="object"&&i!==null?r.context=lo(i):(i=On(t)?ei:yn.current,r.context=Xi(e,i)),r.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Ad(e,t,i,n),r.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(t=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),t!==r.state&&mu.enqueueReplaceState(r,r.state,null),Qs(e,n,r,o),r.state=e.memoizedState),typeof r.componentDidMount=="function"&&(e.flags|=4194308)}function ea(e,t){try{var n="",o=t;do n+=My(o),o=o.return;while(o);var r=n}catch(i){r=`
Error generating stack: `+i.message+`
`+i.stack}return{value:e,source:t,stack:r,digest:null}}function nd(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function $d(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var oC=typeof WeakMap=="function"?WeakMap:Map;function eh(e,t,n){n=Go(-1,n),n.tag=3,n.payload={element:null};var o=t.value;return n.callback=function(){nu||(nu=!0,Kd=o),$d(e,t)},n}function th(e,t,n){n=Go(-1,n),n.tag=3;var o=e.type.getDerivedStateFromError;if(typeof o=="function"){var r=t.value;n.payload=function(){return o(r)},n.callback=function(){$d(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){$d(e,t),typeof o!="function"&&(br===null?br=new Set([this]):br.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function pg(e,t,n){var o=e.pingCache;if(o===null){o=e.pingCache=new oC;var r=new Set;o.set(t,r)}else r=o.get(t),r===void 0&&(r=new Set,o.set(t,r));r.has(n)||(r.add(n),e=hC.bind(null,e,t,n),t.then(e,e))}function mg(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 fg(e,t,n,o,r){return(e.mode&1)===0?(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Go(-1,1),t.tag=2,vr(n,t,1))),n.lanes|=1),e):(e.flags|=65536,e.lanes=r,e)}var rC=Qo.ReactCurrentOwner,In=!1;function xn(e,t,n,o){t.child=e===null?D_(t,null,n,o):Zi(t,e.child,n,o)}function gg(e,t,n,o,r){n=n.render;var i=t.ref;return qi(t,r),o=xp(e,t,n,o,i,r),n=Rp(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Xo(e,t,r)):($t&&n&&fp(t),t.flags|=1,xn(e,t,o,r),t.child)}function _g(e,t,n,o,r){if(e===null){var i=n.type;return typeof i=="function"&&!Op(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,nh(e,t,i,o,r)):(e=Is(n.type,null,o,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,(e.lanes&r)===0){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:cl,n(a,o)&&e.ref===t.ref)return Xo(e,t,r)}return t.flags|=1,e=wr(i,o),e.ref=t.ref,e.return=t,t.child=e}function nh(e,t,n,o,r){if(e!==null){var i=e.memoizedProps;if(cl(i,o)&&e.ref===t.ref)if(In=!1,t.pendingProps=o=i,(e.lanes&r)!==0)(e.flags&131072)!==0&&(In=!0);else return t.lanes=e.lanes,Xo(e,t,r)}return zd(e,t,n,o,r)}function oh(e,t,n){var o=t.pendingProps,r=o.children,i=e!==null?e.memoizedState:null;if(o.mode==="hidden")if((t.mode&1)===0)t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Lt(ji,qn),qn|=n;else{if((n&1073741824)===0)return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Lt(ji,qn),qn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},o=i!==null?i.baseLanes:n,Lt(ji,qn),qn|=o}else i!==null?(o=i.baseLanes|n,t.memoizedState=null):o=n,Lt(ji,qn),qn|=o;return xn(e,t,r,n),t.child}function rh(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function zd(e,t,n,o,r){var i=On(n)?ei:yn.current;return i=Xi(t,i),qi(t,r),n=xp(e,t,n,o,i,r),o=Rp(),e!==null&&!In?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~r,Xo(e,t,r)):($t&&o&&fp(t),t.flags|=1,xn(e,t,n,r),t.child)}function hg(e,t,n,o,r){if(On(n)){var i=!0;Gs(t)}else i=!1;if(qi(t,r),t.stateNode===null)Ms(e,t),J_(t,n,o),Od(t,n,o,r),o=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var s=a.context,d=n.contextType;typeof d=="object"&&d!==null?d=lo(d):(d=On(n)?ei:yn.current,d=Xi(t,d));var p=n.getDerivedStateFromProps,f=typeof p=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==o||s!==d)&&dg(t,a,o,d),ur=!1;var m=t.memoizedState;a.state=m,Qs(t,o,a,r),s=t.memoizedState,l!==o||m!==s||An.current||ur?(typeof p=="function"&&(Ad(t,n,p,o),s=t.memoizedState),(l=ur||cg(t,n,l,o,m,s,d))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=o,t.memoizedState=s),a.props=o,a.state=s,a.context=d,o=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),o=!1)}else{a=t.stateNode,M_(e,t),l=t.memoizedProps,d=t.type===t.elementType?l:yo(t.type,l),a.props=d,f=t.pendingProps,m=a.context,s=n.contextType,typeof s=="object"&&s!==null?s=lo(s):(s=On(n)?ei:yn.current,s=Xi(t,s));var c=n.getDerivedStateFromProps;(p=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||m!==s)&&dg(t,a,o,s),ur=!1,m=t.memoizedState,a.state=m,Qs(t,o,a,r);var v=t.memoizedState;l!==f||m!==v||An.current||ur?(typeof c=="function"&&(Ad(t,n,c,o),v=t.memoizedState),(d=ur||cg(t,n,d,o,m,v,s)||!1)?(p||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(o,v,s),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(o,v,s)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),t.memoizedProps=o,t.memoizedState=v),a.props=o,a.state=v,a.context=s,o=d):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&m===e.memoizedState||(t.flags|=1024),o=!1)}return Vd(e,t,n,o,i,r)}function Vd(e,t,n,o,r,i){rh(e,t);var a=(t.flags&128)!==0;if(!o&&!a)return r&&ng(t,n,!1),Xo(e,t,i);o=t.stateNode,rC.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:o.render();return t.flags|=1,e!==null&&a?(t.child=Zi(t,e.child,null,i),t.child=Zi(t,null,l,i)):xn(e,t,l,i),t.memoizedState=o.state,r&&ng(t,n,!0),t.child}function ih(e){var t=e.stateNode;t.pendingContext?tg(e,t.pendingContext,t.pendingContext!==t.context):t.context&&tg(e,t.context,!1),Cp(e,t.containerInfo)}function vg(e,t,n,o,r){return Qi(),_p(r),t.flags|=256,xn(e,t,n,o),t.child}var Bd={dehydrated:null,treeContext:null,retryLane:0};function jd(e){return{baseLanes:e,cachePool:null,transitions:null}}function ah(e,t,n){var o=t.pendingProps,r=jt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(r&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(r|=1),Lt(jt,r&1),e===null)return Ld(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((t.mode&1)===0?t.lanes=1:e.data==="$!"?t.lanes=8:t.lanes=1073741824,null):(a=o.children,e=o.fallback,i?(o=t.mode,i=t.child,a={mode:"hidden",children:a},(o&1)===0&&i!==null?(i.childLanes=0,i.pendingProps=a):i=_u(a,o,0,null),e=Jr(e,o,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=jd(n),t.memoizedState=Bd,e):Dp(t,a));if(r=e.memoizedState,r!==null&&(l=r.dehydrated,l!==null))return iC(e,t,a,o,l,r,n);if(i){i=o.fallback,a=t.mode,r=e.child,l=r.sibling;var s={mode:"hidden",children:o.children};return(a&1)===0&&t.child!==r?(o=t.child,o.childLanes=0,o.pendingProps=s,t.deletions=null):(o=wr(r,s),o.subtreeFlags=r.subtreeFlags&14680064),l!==null?i=wr(l,i):(i=Jr(i,a,n,null),i.flags|=2),i.return=t,o.return=t,o.sibling=i,t.child=o,o=i,i=t.child,a=e.child.memoizedState,a=a===null?jd(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=Bd,o}return i=e.child,e=i.sibling,o=wr(i,{mode:"visible",children:o.children}),(t.mode&1)===0&&(o.lanes=n),o.return=t,o.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=o,t.memoizedState=null,o}function Dp(e,t){return t=_u({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function ks(e,t,n,o){return o!==null&&_p(o),Zi(t,e.child,null,n),e=Dp(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function iC(e,t,n,o,r,i,a){if(n)return t.flags&256?(t.flags&=-257,o=nd(Error(pe(422))),ks(e,t,a,o)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=o.fallback,r=t.mode,o=_u({mode:"visible",children:o.children},r,0,null),i=Jr(i,r,a,null),i.flags|=2,o.return=t,i.return=t,o.sibling=i,t.child=o,(t.mode&1)!==0&&Zi(t,e.child,null,a),t.child.memoizedState=jd(a),t.memoizedState=Bd,i);if((t.mode&1)===0)return ks(e,t,a,null);if(r.data==="$!"){if(o=r.nextSibling&&r.nextSibling.dataset,o)var l=o.dgst;return o=l,i=Error(pe(419)),o=nd(i,o,void 0),ks(e,t,a,o)}if(l=(a&e.childLanes)!==0,In||l){if(o=sn,o!==null){switch(a&-a){case 4:r=2;break;case 16:r=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:r=32;break;case 536870912:r=268435456;break;default:r=0}r=(r&(o.suspendedLanes|a))!==0?0:r,r!==0&&r!==i.retryLane&&(i.retryLane=r,Yo(e,r),So(o,e,r,-1))}return Ap(),o=nd(Error(pe(421))),ks(e,t,a,o)}return r.data==="$?"?(t.flags|=128,t.child=e.child,t=vC.bind(null,e),r._reactRetry=t,null):(e=i.treeContext,Kn=hr(r.nextSibling),Yn=t,$t=!0,Co=null,e!==null&&(oo[ro++]=Uo,oo[ro++]=Wo,oo[ro++]=ti,Uo=e.id,Wo=e.overflow,ti=t),t=Dp(t,o.children),t.flags|=4096,t)}function bg(e,t,n){e.lanes|=t;var o=e.alternate;o!==null&&(o.lanes|=t),Id(e.return,t,n)}function od(e,t,n,o,r){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:o,tail:n,tailMode:r}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=o,i.tail=n,i.tailMode=r)}function lh(e,t,n){var o=t.pendingProps,r=o.revealOrder,i=o.tail;if(xn(e,t,o.children,n),o=jt.current,(o&2)!==0)o=o&1|2,t.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&bg(e,n,t);else if(e.tag===19)bg(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}o&=1}if(Lt(jt,o),(t.mode&1)===0)t.memoizedState=null;else switch(r){case"forwards":for(n=t.child,r=null;n!==null;)e=n.alternate,e!==null&&Zs(e)===null&&(r=n),n=n.sibling;n=r,n===null?(r=t.child,t.child=null):(r=n.sibling,n.sibling=null),od(t,!1,r,n,i);break;case"backwards":for(n=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Zs(e)===null){t.child=r;break}e=r.sibling,r.sibling=n,n=r,r=e}od(t,!0,n,null,i);break;case"together":od(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ms(e,t){(t.mode&1)===0&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Xo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),oi|=t.lanes,(n&t.childLanes)===0)return null;if(e!==null&&t.child!==e.child)throw Error(pe(153));if(t.child!==null){for(e=t.child,n=wr(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=wr(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function aC(e,t,n){switch(t.tag){case 3:ih(t),Qi();break;case 5:P_(t);break;case 1:On(t.type)&&Gs(t);break;case 4:Cp(t,t.stateNode.containerInfo);break;case 10:var o=t.type._context,r=t.memoizedProps.value;Lt(Ys,o._currentValue),o._currentValue=r;break;case 13:if(o=t.memoizedState,o!==null)return o.dehydrated!==null?(Lt(jt,jt.current&1),t.flags|=128,null):(n&t.child.childLanes)!==0?ah(e,t,n):(Lt(jt,jt.current&1),e=Xo(e,t,n),e!==null?e.sibling:null);Lt(jt,jt.current&1);break;case 19:if(o=(n&t.childLanes)!==0,(e.flags&128)!==0){if(o)return lh(e,t,n);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),Lt(jt,jt.current),o)break;return null;case 22:case 23:return t.lanes=0,oh(e,t,n)}return Xo(e,t,n)}var sh,Hd,uh,ch;sh=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}};Hd=function(){};uh=function(e,t,n,o){var r=e.memoizedProps;if(r!==o){e=t.stateNode,Qr(Io.current);var i=null;switch(n){case"input":r=dd(e,r),o=dd(e,o),i=[];break;case"select":r=Ut({},r,{value:void 0}),o=Ut({},o,{value:void 0}),i=[];break;case"textarea":r=fd(e,r),o=fd(e,o),i=[];break;default:typeof r.onClick!="function"&&typeof o.onClick=="function"&&(e.onclick=Us)}_d(n,o);var a;n=null;for(d in r)if(!o.hasOwnProperty(d)&&r.hasOwnProperty(d)&&r[d]!=null)if(d==="style"){var l=r[d];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(ol.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in o){var s=o[d];if(l=r?.[d],o.hasOwnProperty(d)&&s!==l&&(s!=null||l!=null))if(d==="style")if(l){for(a in l)!l.hasOwnProperty(a)||s&&s.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in s)s.hasOwnProperty(a)&&l[a]!==s[a]&&(n||(n={}),n[a]=s[a])}else n||(i||(i=[]),i.push(d,n)),n=s;else d==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,l=l?l.__html:void 0,s!=null&&l!==s&&(i=i||[]).push(d,s)):d==="children"?typeof s!="string"&&typeof s!="number"||(i=i||[]).push(d,""+s):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(ol.hasOwnProperty(d)?(s!=null&&d==="onScroll"&&It("scroll",e),i||l===s||(i=[])):(i=i||[]).push(d,s))}n&&(i=i||[]).push("style",n);var d=i;(t.updateQueue=d)&&(t.flags|=4)}};ch=function(e,t,n,o){n!==o&&(t.flags|=4)};function Ba(e,t){if(!$t)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 o=null;n!==null;)n.alternate!==null&&(o=n),n=n.sibling;o===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function vn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,o=0;if(t)for(var r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags&14680064,o|=r.flags&14680064,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)n|=r.lanes|r.childLanes,o|=r.subtreeFlags,o|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=o,e.childLanes=n,t}function lC(e,t,n){var o=t.pendingProps;switch(gp(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 On(t.type)&&Ws(),vn(t),null;case 3:return o=t.stateNode,Ji(),At(An),At(yn),Sp(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(e===null||e.child===null)&&(ws(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Co!==null&&(Qd(Co),Co=null))),Hd(e,t),vn(t),null;case 5:kp(t);var r=Qr(gl.current);if(n=t.type,e!==null&&t.stateNode!=null)uh(e,t,n,o,r),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!o){if(t.stateNode===null)throw Error(pe(166));return vn(t),null}if(e=Qr(Io.current),ws(t)){o=t.stateNode,n=t.type;var i=t.memoizedProps;switch(o[Po]=t,o[ml]=i,e=(t.mode&1)!==0,n){case"dialog":It("cancel",o),It("close",o);break;case"iframe":case"object":case"embed":It("load",o);break;case"video":case"audio":for(r=0;r<qa.length;r++)It(qa[r],o);break;case"source":It("error",o);break;case"img":case"image":case"link":It("error",o),It("load",o);break;case"details":It("toggle",o);break;case"input":Rf(o,i),It("invalid",o);break;case"select":o._wrapperState={wasMultiple:!!i.multiple},It("invalid",o);break;case"textarea":Ff(o,i),It("invalid",o)}_d(n,i),r=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?o.textContent!==l&&(i.suppressHydrationWarning!==!0&&ys(o.textContent,l,e),r=["children",l]):typeof l=="number"&&o.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ys(o.textContent,l,e),r=["children",""+l]):ol.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&It("scroll",o)}switch(n){case"input":ss(o),Ef(o,i,!0);break;case"textarea":ss(o),Df(o);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(o.onclick=Us)}o=r,t.updateQueue=o,o!==null&&(t.flags|=4)}else{a=r.nodeType===9?r:r.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$g(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof o.is=="string"?e=a.createElement(n,{is:o.is}):(e=a.createElement(n),n==="select"&&(a=e,o.multiple?a.multiple=!0:o.size&&(a.size=o.size))):e=a.createElementNS(e,n),e[Po]=t,e[ml]=o,sh(e,t,!1,!1),t.stateNode=e;e:{switch(a=hd(n,o),n){case"dialog":It("cancel",e),It("close",e),r=o;break;case"iframe":case"object":case"embed":It("load",e),r=o;break;case"video":case"audio":for(r=0;r<qa.length;r++)It(qa[r],e);r=o;break;case"source":It("error",e),r=o;break;case"img":case"image":case"link":It("error",e),It("load",e),r=o;break;case"details":It("toggle",e),r=o;break;case"input":Rf(e,o),r=dd(e,o),It("invalid",e);break;case"option":r=o;break;case"select":e._wrapperState={wasMultiple:!!o.multiple},r=Ut({},o,{value:void 0}),It("invalid",e);break;case"textarea":Ff(e,o),r=fd(e,o),It("invalid",e);break;default:r=o}_d(n,r),l=r;for(i in l)if(l.hasOwnProperty(i)){var s=l[i];i==="style"?Bg(e,s):i==="dangerouslySetInnerHTML"?(s=s?s.__html:void 0,s!=null&&zg(e,s)):i==="children"?typeof s=="string"?(n!=="textarea"||s!=="")&&rl(e,s):typeof s=="number"&&rl(e,""+s):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ol.hasOwnProperty(i)?s!=null&&i==="onScroll"&&It("scroll",e):s!=null&&ep(e,i,s,a))}switch(n){case"input":ss(e),Ef(e,o,!1);break;case"textarea":ss(e),Df(e);break;case"option":o.value!=null&&e.setAttribute("value",""+Cr(o.value));break;case"select":e.multiple=!!o.multiple,i=o.value,i!=null?Hi(e,!!o.multiple,i,!1):o.defaultValue!=null&&Hi(e,!!o.multiple,o.defaultValue,!0);break;default:typeof r.onClick=="function"&&(e.onclick=Us)}switch(n){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}}o&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return vn(t),null;case 6:if(e&&t.stateNode!=null)ch(e,t,e.memoizedProps,o);else{if(typeof o!="string"&&t.stateNode===null)throw Error(pe(166));if(n=Qr(gl.current),Qr(Io.current),ws(t)){if(o=t.stateNode,n=t.memoizedProps,o[Po]=t,(i=o.nodeValue!==n)&&(e=Yn,e!==null))switch(e.tag){case 3:ys(o.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ys(o.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else o=(n.nodeType===9?n:n.ownerDocument).createTextNode(o),o[Po]=t,t.stateNode=o}return vn(t),null;case 13:if(At(jt),o=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if($t&&Kn!==null&&(t.mode&1)!==0&&(t.flags&128)===0)E_(),Qi(),t.flags|=98560,i=!1;else if(i=ws(t),o!==null&&o.dehydrated!==null){if(e===null){if(!i)throw Error(pe(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(pe(317));i[Po]=t}else Qi(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vn(t),i=!1}else Co!==null&&(Qd(Co),Co=null),i=!0;if(!i)return t.flags&65536?t:null}return(t.flags&128)!==0?(t.lanes=n,t):(o=o!==null,o!==(e!==null&&e.memoizedState!==null)&&o&&(t.child.flags|=8192,(t.mode&1)!==0&&(e===null||(jt.current&1)!==0?on===0&&(on=3):Ap())),t.updateQueue!==null&&(t.flags|=4),vn(t),null);case 4:return Ji(),Hd(e,t),e===null&&dl(t.stateNode.containerInfo),vn(t),null;case 10:return bp(t.type._context),vn(t),null;case 17:return On(t.type)&&Ws(),vn(t),null;case 19:if(At(jt),i=t.memoizedState,i===null)return vn(t),null;if(o=(t.flags&128)!==0,a=i.rendering,a===null)if(o)Ba(i,!1);else{if(on!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(a=Zs(e),a!==null){for(t.flags|=128,Ba(i,!1),o=a.updateQueue,o!==null&&(t.updateQueue=o,t.flags|=4),t.subtreeFlags=0,o=n,n=t.child;n!==null;)i=n,e=o,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Lt(jt,jt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Gt()>ta&&(t.flags|=128,o=!0,Ba(i,!1),t.lanes=4194304)}else{if(!o)if(e=Zs(a),e!==null){if(t.flags|=128,o=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Ba(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!$t)return vn(t),null}else 2*Gt()-i.renderingStartTime>ta&&n!==1073741824&&(t.flags|=128,o=!0,Ba(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Gt(),t.sibling=null,n=jt.current,Lt(jt,o?n&1|2:n&1),t):(vn(t),null);case 22:case 23:return Ip(),o=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==o&&(t.flags|=8192),o&&(t.mode&1)!==0?(qn&1073741824)!==0&&(vn(t),t.subtreeFlags&6&&(t.flags|=8192)):vn(t),null;case 24:return null;case 25:return null}throw Error(pe(156,t.tag))}function sC(e,t){switch(gp(t),t.tag){case 1:return On(t.type)&&Ws(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ji(),At(An),At(yn),Sp(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 5:return kp(t),null;case 13:if(At(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(pe(340));Qi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return At(jt),null;case 4:return Ji(),null;case 10:return bp(t.type._context),null;case 22:case 23:return Ip(),null;case 24:return null;default:return null}}var Ss=!1,bn=!1,uC=typeof WeakSet=="function"?WeakSet:Set,Pe=null;function Bi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(o){Wt(e,t,o)}else n.current=null}function Ud(e,t,n){try{n()}catch(o){Wt(e,t,o)}}var yg=!1;function cC(e,t){if(Rd=Bs,e=g_(),mp(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var o=n.getSelection&&n.getSelection();if(o&&o.rangeCount!==0){n=o.anchorNode;var r=o.anchorOffset,i=o.focusNode;o=o.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,s=-1,d=0,p=0,f=e,m=null;t:for(;;){for(var c;f!==n||r!==0&&f.nodeType!==3||(l=a+r),f!==i||o!==0&&f.nodeType!==3||(s=a+o),f.nodeType===3&&(a+=f.nodeValue.length),(c=f.firstChild)!==null;)m=f,f=c;for(;;){if(f===e)break t;if(m===n&&++d===r&&(l=a),m===i&&++p===o&&(s=a),(c=f.nextSibling)!==null)break;f=m,m=f.parentNode}f=c}n=l===-1||s===-1?null:{start:l,end:s}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ed={focusedElem:e,selectionRange:n},Bs=!1,Pe=t;Pe!==null;)if(t=Pe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Pe=e;else for(;Pe!==null;){t=Pe;try{var v=t.alternate;if((t.flags&1024)!==0)switch(t.tag){case 0:case 11:case 15:break;case 1:if(v!==null){var h=v.memoizedProps,b=v.memoizedState,_=t.stateNode,g=_.getSnapshotBeforeUpdate(t.elementType===t.type?h:yo(t.type,h),b);_.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(pe(163))}}catch(k){Wt(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,Pe=e;break}Pe=t.return}return v=yg,yg=!1,v}function el(e,t,n){var o=t.updateQueue;if(o=o!==null?o.lastEffect:null,o!==null){var r=o=o.next;do{if((r.tag&e)===e){var i=r.destroy;r.destroy=void 0,i!==void 0&&Ud(t,n,i)}r=r.next}while(r!==o)}}function fu(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 o=n.create;n.destroy=o()}n=n.next}while(n!==t)}}function Wd(e){var t=e.ref;if(t!==null){var n=e.stateNode;e.tag,e=n,typeof t=="function"?t(e):t.current=e}}function dh(e){var t=e.alternate;t!==null&&(e.alternate=null,dh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Po],delete t[ml],delete t[Td],delete t[Gw],delete t[qw])),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 ph(e){return e.tag===5||e.tag===3||e.tag===4}function wg(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ph(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 Gd(e,t,n){var o=e.tag;if(o===5||o===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=Us));else if(o!==4&&(e=e.child,e!==null))for(Gd(e,t,n),e=e.sibling;e!==null;)Gd(e,t,n),e=e.sibling}function qd(e,t,n){var o=e.tag;if(o===5||o===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(o!==4&&(e=e.child,e!==null))for(qd(e,t,n),e=e.sibling;e!==null;)qd(e,t,n),e=e.sibling}var pn=null,wo=!1;function lr(e,t,n){for(n=n.child;n!==null;)mh(e,t,n),n=n.sibling}function mh(e,t,n){if(Lo&&typeof Lo.onCommitFiberUnmount=="function")try{Lo.onCommitFiberUnmount(au,n)}catch{}switch(n.tag){case 5:bn||Bi(n,t);case 6:var o=pn,r=wo;pn=null,lr(e,t,n),pn=o,wo=r,pn!==null&&(wo?(e=pn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):pn.removeChild(n.stateNode));break;case 18:pn!==null&&(wo?(e=pn,n=n.stateNode,e.nodeType===8?Xc(e.parentNode,n):e.nodeType===1&&Xc(e,n),sl(e)):Xc(pn,n.stateNode));break;case 4:o=pn,r=wo,pn=n.stateNode.containerInfo,wo=!0,lr(e,t,n),pn=o,wo=r;break;case 0:case 11:case 14:case 15:if(!bn&&(o=n.updateQueue,o!==null&&(o=o.lastEffect,o!==null))){r=o=o.next;do{var i=r,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&Ud(n,t,a),r=r.next}while(r!==o)}lr(e,t,n);break;case 1:if(!bn&&(Bi(n,t),o=n.stateNode,typeof o.componentWillUnmount=="function"))try{o.props=n.memoizedProps,o.state=n.memoizedState,o.componentWillUnmount()}catch(l){Wt(n,t,l)}lr(e,t,n);break;case 21:lr(e,t,n);break;case 22:n.mode&1?(bn=(o=bn)||n.memoizedState!==null,lr(e,t,n),bn=o):lr(e,t,n);break;default:lr(e,t,n)}}function Cg(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new uC),t.forEach(function(o){var r=bC.bind(null,e,o);n.has(o)||(n.add(o),o.then(r,r))})}}function bo(e,t){var n=t.deletions;if(n!==null)for(var o=0;o<n.length;o++){var r=n[o];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:pn=l.stateNode,wo=!1;break e;case 3:pn=l.stateNode.containerInfo,wo=!0;break e;case 4:pn=l.stateNode.containerInfo,wo=!0;break e}l=l.return}if(pn===null)throw Error(pe(160));mh(i,a,r),pn=null,wo=!1;var s=r.alternate;s!==null&&(s.return=null),r.return=null}catch(d){Wt(r,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fh(t,e),t=t.sibling}function fh(e,t){var n=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(bo(t,e),To(e),o&4){try{el(3,e,e.return),fu(3,e)}catch(h){Wt(e,e.return,h)}try{el(5,e,e.return)}catch(h){Wt(e,e.return,h)}}break;case 1:bo(t,e),To(e),o&512&&n!==null&&Bi(n,n.return);break;case 5:if(bo(t,e),To(e),o&512&&n!==null&&Bi(n,n.return),e.flags&32){var r=e.stateNode;try{rl(r,"")}catch(h){Wt(e,e.return,h)}}if(o&4&&(r=e.stateNode,r!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,s=e.updateQueue;if(e.updateQueue=null,s!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Ag(r,i),hd(l,a);var d=hd(l,i);for(a=0;a<s.length;a+=2){var p=s[a],f=s[a+1];p==="style"?Bg(r,f):p==="dangerouslySetInnerHTML"?zg(r,f):p==="children"?rl(r,f):ep(r,p,f,d)}switch(l){case"input":pd(r,i);break;case"textarea":Og(r,i);break;case"select":var m=r._wrapperState.wasMultiple;r._wrapperState.wasMultiple=!!i.multiple;var c=i.value;c!=null?Hi(r,!!i.multiple,c,!1):m!==!!i.multiple&&(i.defaultValue!=null?Hi(r,!!i.multiple,i.defaultValue,!0):Hi(r,!!i.multiple,i.multiple?[]:"",!1))}r[ml]=i}catch(h){Wt(e,e.return,h)}}break;case 6:if(bo(t,e),To(e),o&4){if(e.stateNode===null)throw Error(pe(162));r=e.stateNode,i=e.memoizedProps;try{r.nodeValue=i}catch(h){Wt(e,e.return,h)}}break;case 3:if(bo(t,e),To(e),o&4&&n!==null&&n.memoizedState.isDehydrated)try{sl(t.containerInfo)}catch(h){Wt(e,e.return,h)}break;case 4:bo(t,e),To(e);break;case 13:bo(t,e),To(e),r=e.child,r.flags&8192&&(i=r.memoizedState!==null,r.stateNode.isHidden=i,!i||r.alternate!==null&&r.alternate.memoizedState!==null||(Pp=Gt())),o&4&&Cg(e);break;case 22:if(p=n!==null&&n.memoizedState!==null,e.mode&1?(bn=(d=bn)||p,bo(t,e),bn=d):bo(t,e),To(e),o&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!p&&(e.mode&1)!==0)for(Pe=e,p=e.child;p!==null;){for(f=Pe=p;Pe!==null;){switch(m=Pe,c=m.child,m.tag){case 0:case 11:case 14:case 15:el(4,m,m.return);break;case 1:Bi(m,m.return);var v=m.stateNode;if(typeof v.componentWillUnmount=="function"){o=m,n=m.return;try{t=o,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(h){Wt(o,n,h)}}break;case 5:Bi(m,m.return);break;case 22:if(m.memoizedState!==null){Sg(f);continue}}c!==null?(c.return=m,Pe=c):Sg(f)}p=p.sibling}e:for(p=null,f=e;;){if(f.tag===5){if(p===null){p=f;try{r=f.stateNode,d?(i=r.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,s=f.memoizedProps.style,a=s!=null&&s.hasOwnProperty("display")?s.display:null,l.style.display=Vg("display",a))}catch(h){Wt(e,e.return,h)}}}else if(f.tag===6){if(p===null)try{f.stateNode.nodeValue=d?"":f.memoizedProps}catch(h){Wt(e,e.return,h)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;p===f&&(p=null),f=f.return}p===f&&(p=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:bo(t,e),To(e),o&4&&Cg(e);break;case 21:break;default:bo(t,e),To(e)}}function To(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(ph(n)){var o=n;break e}n=n.return}throw Error(pe(160))}switch(o.tag){case 5:var r=o.stateNode;o.flags&32&&(rl(r,""),o.flags&=-33);var i=wg(e);qd(e,i,r);break;case 3:case 4:var a=o.stateNode.containerInfo,l=wg(e);Gd(e,l,a);break;default:throw Error(pe(161))}}catch(s){Wt(e,e.return,s)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function dC(e,t,n){Pe=e,gh(e,t,n)}function gh(e,t,n){for(var o=(e.mode&1)!==0;Pe!==null;){var r=Pe,i=r.child;if(r.tag===22&&o){var a=r.memoizedState!==null||Ss;if(!a){var l=r.alternate,s=l!==null&&l.memoizedState!==null||bn;l=Ss;var d=bn;if(Ss=a,(bn=s)&&!d)for(Pe=r;Pe!==null;)a=Pe,s=a.child,a.tag===22&&a.memoizedState!==null?Ng(r):s!==null?(s.return=a,Pe=s):Ng(r);for(;i!==null;)Pe=i,gh(i,t,n),i=i.sibling;Pe=r,Ss=l,bn=d}kg(e,t,n)}else(r.subtreeFlags&8772)!==0&&i!==null?(i.return=r,Pe=i):kg(e,t,n)}}function kg(e){for(;Pe!==null;){var t=Pe;if((t.flags&8772)!==0){var n=t.alternate;try{if((t.flags&8772)!==0)switch(t.tag){case 0:case 11:case 15:bn||fu(5,t);break;case 1:var o=t.stateNode;if(t.flags&4&&!bn)if(n===null)o.componentDidMount();else{var r=t.elementType===t.type?n.memoizedProps:yo(t.type,n.memoizedProps);o.componentDidUpdate(r,n.memoizedState,o.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&lg(t,i,o);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}lg(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var s=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":s.autoFocus&&n.focus();break;case"img":s.src&&(n.src=s.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var p=d.memoizedState;if(p!==null){var f=p.dehydrated;f!==null&&sl(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(pe(163))}bn||t.flags&512&&Wd(t)}catch(m){Wt(t,t.return,m)}}if(t===e){Pe=null;break}if(n=t.sibling,n!==null){n.return=t.return,Pe=n;break}Pe=t.return}}function Sg(e){for(;Pe!==null;){var t=Pe;if(t===e){Pe=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Pe=n;break}Pe=t.return}}function Ng(e){for(;Pe!==null;){var t=Pe;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{fu(4,t)}catch(s){Wt(t,n,s)}break;case 1:var o=t.stateNode;if(typeof o.componentDidMount=="function"){var r=t.return;try{o.componentDidMount()}catch(s){Wt(t,r,s)}}var i=t.return;try{Wd(t)}catch(s){Wt(t,i,s)}break;case 5:var a=t.return;try{Wd(t)}catch(s){Wt(t,a,s)}}}catch(s){Wt(t,t.return,s)}if(t===e){Pe=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Pe=l;break}Pe=t.return}}var pC=Math.ceil,tu=Qo.ReactCurrentDispatcher,Tp=Qo.ReactCurrentOwner,ao=Qo.ReactCurrentBatchConfig,kt=0,sn=null,Xt=null,mn=0,qn=0,ji=Nr(0),on=0,bl=null,oi=0,gu=0,Mp=0,tl=null,Ln=null,Pp=0,ta=1/0,jo=null,nu=!1,Kd=null,br=null,Ns=!1,mr=null,ou=0,nl=0,Yd=null,Ps=-1,Ls=0;function Rn(){return(kt&6)!==0?Gt():Ps!==-1?Ps:Ps=Gt()}function yr(e){return(e.mode&1)===0?1:(kt&2)!==0&&mn!==0?mn&-mn:Yw.transition!==null?(Ls===0&&(Ls=Jg()),Ls):(e=Mt,e!==0||(e=window.event,e=e===void 0?16:a_(e.type)),e)}function So(e,t,n,o){if(50<nl)throw nl=0,Yd=null,Error(pe(185));yl(e,n,o),((kt&2)===0||e!==sn)&&(e===sn&&((kt&2)===0&&(gu|=n),on===4&&dr(e,mn)),$n(e,o),n===1&&kt===0&&(t.mode&1)===0&&(ta=Gt()+500,du&&xr()))}function $n(e,t){var n=e.callbackNode;Qy(e,t);var o=Vs(e,e===sn?mn:0);if(o===0)n!==null&&Pf(n),e.callbackNode=null,e.callbackPriority=0;else if(t=o&-o,e.callbackPriority!==t){if(n!=null&&Pf(n),t===1)e.tag===0?Kw(xg.bind(null,e)):N_(xg.bind(null,e)),Uw(function(){(kt&6)===0&&xr()}),n=null;else{switch(e_(o)){case 1:n=ip;break;case 4:n=Qg;break;case 16:n=zs;break;case 536870912:n=Zg;break;default:n=zs}n=kh(n,_h.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function _h(e,t){if(Ps=-1,Ls=0,(kt&6)!==0)throw Error(pe(327));var n=e.callbackNode;if(Ki()&&e.callbackNode!==n)return null;var o=Vs(e,e===sn?mn:0);if(o===0)return null;if((o&30)!==0||(o&e.expiredLanes)!==0||t)t=ru(e,o);else{t=o;var r=kt;kt|=2;var i=vh();(sn!==e||mn!==t)&&(jo=null,ta=Gt()+500,Zr(e,t));do try{gC();break}catch(l){hh(e,l)}while(!0);vp(),tu.current=i,kt=r,Xt!==null?t=0:(sn=null,mn=0,t=on)}if(t!==0){if(t===2&&(r=Cd(e),r!==0&&(o=r,t=Xd(e,r))),t===1)throw n=bl,Zr(e,0),dr(e,o),$n(e,Gt()),n;if(t===6)dr(e,o);else{if(r=e.current.alternate,(o&30)===0&&!mC(r)&&(t=ru(e,o),t===2&&(i=Cd(e),i!==0&&(o=i,t=Xd(e,i))),t===1))throw n=bl,Zr(e,0),dr(e,o),$n(e,Gt()),n;switch(e.finishedWork=r,e.finishedLanes=o,t){case 0:case 1:throw Error(pe(345));case 2:Kr(e,Ln,jo);break;case 3:if(dr(e,o),(o&130023424)===o&&(t=Pp+500-Gt(),10<t)){if(Vs(e,0)!==0)break;if(r=e.suspendedLanes,(r&o)!==o){Rn(),e.pingedLanes|=e.suspendedLanes&r;break}e.timeoutHandle=Dd(Kr.bind(null,e,Ln,jo),t);break}Kr(e,Ln,jo);break;case 4:if(dr(e,o),(o&4194240)===o)break;for(t=e.eventTimes,r=-1;0<o;){var a=31-ko(o);i=1<<a,a=t[a],a>r&&(r=a),o&=~i}if(o=r,o=Gt()-o,o=(120>o?120:480>o?480:1080>o?1080:1920>o?1920:3e3>o?3e3:4320>o?4320:1960*pC(o/1960))-o,10<o){e.timeoutHandle=Dd(Kr.bind(null,e,Ln,jo),o);break}Kr(e,Ln,jo);break;case 5:Kr(e,Ln,jo);break;default:throw Error(pe(329))}}}return $n(e,Gt()),e.callbackNode===n?_h.bind(null,e):null}function Xd(e,t){var n=tl;return e.current.memoizedState.isDehydrated&&(Zr(e,t).flags|=256),e=ru(e,t),e!==2&&(t=Ln,Ln=n,t!==null&&Qd(t)),e}function Qd(e){Ln===null?Ln=e:Ln.push.apply(Ln,e)}function mC(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var o=0;o<n.length;o++){var r=n[o],i=r.getSnapshot;r=r.value;try{if(!No(i(),r))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 dr(e,t){for(t&=~Mp,t&=~gu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-ko(t),o=1<<n;e[n]=-1,t&=~o}}function xg(e){if((kt&6)!==0)throw Error(pe(327));Ki();var t=Vs(e,0);if((t&1)===0)return $n(e,Gt()),null;var n=ru(e,t);if(e.tag!==0&&n===2){var o=Cd(e);o!==0&&(t=o,n=Xd(e,o))}if(n===1)throw n=bl,Zr(e,0),dr(e,t),$n(e,Gt()),n;if(n===6)throw Error(pe(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Kr(e,Ln,jo),$n(e,Gt()),null}function Lp(e,t){var n=kt;kt|=1;try{return e(t)}finally{kt=n,kt===0&&(ta=Gt()+500,du&&xr())}}function ri(e){mr!==null&&mr.tag===0&&(kt&6)===0&&Ki();var t=kt;kt|=1;var n=ao.transition,o=Mt;try{if(ao.transition=null,Mt=1,e)return e()}finally{Mt=o,ao.transition=n,kt=t,(kt&6)===0&&xr()}}function Ip(){qn=ji.current,At(ji)}function Zr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Hw(n)),Xt!==null)for(n=Xt.return;n!==null;){var o=n;switch(gp(o),o.tag){case 1:o=o.type.childContextTypes,o!=null&&Ws();break;case 3:Ji(),At(An),At(yn),Sp();break;case 5:kp(o);break;case 4:Ji();break;case 13:At(jt);break;case 19:At(jt);break;case 10:bp(o.type._context);break;case 22:case 23:Ip()}n=n.return}if(sn=e,Xt=e=wr(e.current,null),mn=qn=t,on=0,bl=null,Mp=gu=oi=0,Ln=tl=null,Xr!==null){for(t=0;t<Xr.length;t++)if(n=Xr[t],o=n.interleaved,o!==null){n.interleaved=null;var r=o.next,i=n.pending;if(i!==null){var a=i.next;i.next=r,o.next=a}n.pending=o}Xr=null}return e}function hh(e,t){do{var n=Xt;try{if(vp(),Ds.current=eu,Js){for(var o=Ht.memoizedState;o!==null;){var r=o.queue;r!==null&&(r.pending=null),o=o.next}Js=!1}if(ni=0,ln=nn=Ht=null,Ja=!1,_l=0,Tp.current=null,n===null||n.return===null){on=1,bl=t,Xt=null;break}e:{var i=e,a=n.return,l=n,s=t;if(t=mn,l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){var d=s,p=l,f=p.tag;if((p.mode&1)===0&&(f===0||f===11||f===15)){var m=p.alternate;m?(p.updateQueue=m.updateQueue,p.memoizedState=m.memoizedState,p.lanes=m.lanes):(p.updateQueue=null,p.memoizedState=null)}var c=mg(a);if(c!==null){c.flags&=-257,fg(c,a,l,i,t),c.mode&1&&pg(i,d,t),t=c,s=d;var v=t.updateQueue;if(v===null){var h=new Set;h.add(s),t.updateQueue=h}else v.add(s);break e}else{if((t&1)===0){pg(i,d,t),Ap();break e}s=Error(pe(426))}}else if($t&&l.mode&1){var b=mg(a);if(b!==null){(b.flags&65536)===0&&(b.flags|=256),fg(b,a,l,i,t),_p(ea(s,l));break e}}i=s=ea(s,l),on!==4&&(on=2),tl===null?tl=[i]:tl.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var _=eh(i,s,t);ag(i,_);break e;case 1:l=s;var g=i.type,y=i.stateNode;if((i.flags&128)===0&&(typeof g.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(br===null||!br.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=th(i,l,t);ag(i,k);break e}}i=i.return}while(i!==null)}yh(n)}catch(D){t=D,Xt===n&&n!==null&&(Xt=n=n.return);continue}break}while(!0)}function vh(){var e=tu.current;return tu.current=eu,e===null?eu:e}function Ap(){(on===0||on===3||on===2)&&(on=4),sn===null||(oi&268435455)===0&&(gu&268435455)===0||dr(sn,mn)}function ru(e,t){var n=kt;kt|=2;var o=vh();(sn!==e||mn!==t)&&(jo=null,Zr(e,t));do try{fC();break}catch(r){hh(e,r)}while(!0);if(vp(),kt=n,tu.current=o,Xt!==null)throw Error(pe(261));return sn=null,mn=0,on}function fC(){for(;Xt!==null;)bh(Xt)}function gC(){for(;Xt!==null&&!jy();)bh(Xt)}function bh(e){var t=Ch(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?yh(e):Xt=t,Tp.current=null}function yh(e){var t=e;do{var n=t.alternate;if(e=t.return,(t.flags&32768)===0){if(n=lC(n,t,qn),n!==null){Xt=n;return}}else{if(n=sC(n,t),n!==null){n.flags&=32767,Xt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{on=6,Xt=null;return}}if(t=t.sibling,t!==null){Xt=t;return}Xt=t=e}while(t!==null);on===0&&(on=5)}function Kr(e,t,n){var o=Mt,r=ao.transition;try{ao.transition=null,Mt=1,_C(e,t,n,o)}finally{ao.transition=r,Mt=o}return null}function _C(e,t,n,o){do Ki();while(mr!==null);if((kt&6)!==0)throw Error(pe(327));n=e.finishedWork;var r=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(pe(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(Zy(e,i),e===sn&&(Xt=sn=null,mn=0),(n.subtreeFlags&2064)===0&&(n.flags&2064)===0||Ns||(Ns=!0,kh(zs,function(){return Ki(),null})),i=(n.flags&15990)!==0,(n.subtreeFlags&15990)!==0||i){i=ao.transition,ao.transition=null;var a=Mt;Mt=1;var l=kt;kt|=4,Tp.current=null,cC(e,n),fh(n,e),$w(Ed),Bs=!!Rd,Ed=Rd=null,e.current=n,dC(n,e,r),Hy(),kt=l,Mt=a,ao.transition=i}else e.current=n;if(Ns&&(Ns=!1,mr=e,ou=r),i=e.pendingLanes,i===0&&(br=null),Gy(n.stateNode,o),$n(e,Gt()),t!==null)for(o=e.onRecoverableError,n=0;n<t.length;n++)r=t[n],o(r.value,{componentStack:r.stack,digest:r.digest});if(nu)throw nu=!1,e=Kd,Kd=null,e;return(ou&1)!==0&&e.tag!==0&&Ki(),i=e.pendingLanes,(i&1)!==0?e===Yd?nl++:(nl=0,Yd=e):nl=0,xr(),null}function Ki(){if(mr!==null){var e=e_(ou),t=ao.transition,n=Mt;try{if(ao.transition=null,Mt=16>e?16:e,mr===null)var o=!1;else{if(e=mr,mr=null,ou=0,(kt&6)!==0)throw Error(pe(331));var r=kt;for(kt|=4,Pe=e.current;Pe!==null;){var i=Pe,a=i.child;if((Pe.flags&16)!==0){var l=i.deletions;if(l!==null){for(var s=0;s<l.length;s++){var d=l[s];for(Pe=d;Pe!==null;){var p=Pe;switch(p.tag){case 0:case 11:case 15:el(8,p,i)}var f=p.child;if(f!==null)f.return=p,Pe=f;else for(;Pe!==null;){p=Pe;var m=p.sibling,c=p.return;if(dh(p),p===d){Pe=null;break}if(m!==null){m.return=c,Pe=m;break}Pe=c}}}var v=i.alternate;if(v!==null){var h=v.child;if(h!==null){v.child=null;do{var b=h.sibling;h.sibling=null,h=b}while(h!==null)}}Pe=i}}if((i.subtreeFlags&2064)!==0&&a!==null)a.return=i,Pe=a;else e:for(;Pe!==null;){if(i=Pe,(i.flags&2048)!==0)switch(i.tag){case 0:case 11:case 15:el(9,i,i.return)}var _=i.sibling;if(_!==null){_.return=i.return,Pe=_;break e}Pe=i.return}}var g=e.current;for(Pe=g;Pe!==null;){a=Pe;var y=a.child;if((a.subtreeFlags&2064)!==0&&y!==null)y.return=a,Pe=y;else e:for(a=g;Pe!==null;){if(l=Pe,(l.flags&2048)!==0)try{switch(l.tag){case 0:case 11:case 15:fu(9,l)}}catch(D){Wt(l,l.return,D)}if(l===a){Pe=null;break e}var k=l.sibling;if(k!==null){k.return=l.return,Pe=k;break e}Pe=l.return}}if(kt=r,xr(),Lo&&typeof Lo.onPostCommitFiberRoot=="function")try{Lo.onPostCommitFiberRoot(au,e)}catch{}o=!0}return o}finally{Mt=n,ao.transition=t}}return!1}function Rg(e,t,n){t=ea(n,t),t=eh(e,t,1),e=vr(e,t,1),t=Rn(),e!==null&&(yl(e,1,t),$n(e,t))}function Wt(e,t,n){if(e.tag===3)Rg(e,e,n);else for(;t!==null;){if(t.tag===3){Rg(t,e,n);break}else if(t.tag===1){var o=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(br===null||!br.has(o))){e=ea(n,e),e=th(t,e,1),t=vr(t,e,1),e=Rn(),t!==null&&(yl(t,1,e),$n(t,e));break}}t=t.return}}function hC(e,t,n){var o=e.pingCache;o!==null&&o.delete(t),t=Rn(),e.pingedLanes|=e.suspendedLanes&n,sn===e&&(mn&n)===n&&(on===4||on===3&&(mn&130023424)===mn&&500>Gt()-Pp?Zr(e,0):Mp|=n),$n(e,t)}function wh(e,t){t===0&&((e.mode&1)===0?t=1:(t=ds,ds<<=1,(ds&130023424)===0&&(ds=4194304)));var n=Rn();e=Yo(e,t),e!==null&&(yl(e,t,n),$n(e,n))}function vC(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wh(e,n)}function bC(e,t){var n=0;switch(e.tag){case 13:var o=e.stateNode,r=e.memoizedState;r!==null&&(n=r.retryLane);break;case 19:o=e.stateNode;break;default:throw Error(pe(314))}o!==null&&o.delete(t),wh(e,n)}var Ch;Ch=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||An.current)In=!0;else{if((e.lanes&n)===0&&(t.flags&128)===0)return In=!1,aC(e,t,n);In=(e.flags&131072)!==0}else In=!1,$t&&(t.flags&1048576)!==0&&x_(t,Ks,t.index);switch(t.lanes=0,t.tag){case 2:var o=t.type;Ms(e,t),e=t.pendingProps;var r=Xi(t,yn.current);qi(t,n),r=xp(null,t,o,e,r,n);var i=Rp();return t.flags|=1,typeof r=="object"&&r!==null&&typeof r.render=="function"&&r.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,On(o)?(i=!0,Gs(t)):i=!1,t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,wp(t),r.updater=mu,t.stateNode=r,r._reactInternals=t,Od(t,o,e,n),t=Vd(null,t,o,!0,i,n)):(t.tag=0,$t&&i&&fp(t),xn(null,t,r,n),t=t.child),t;case 16:o=t.elementType;e:{switch(Ms(e,t),e=t.pendingProps,r=o._init,o=r(o._payload),t.type=o,r=t.tag=wC(o),e=yo(o,e),r){case 0:t=zd(null,t,o,e,n);break e;case 1:t=hg(null,t,o,e,n);break e;case 11:t=gg(null,t,o,e,n);break e;case 14:t=_g(null,t,o,yo(o.type,e),n);break e}throw Error(pe(306,o,""))}return t;case 0:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:yo(o,r),zd(e,t,o,r,n);case 1:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:yo(o,r),hg(e,t,o,r,n);case 3:e:{if(ih(t),e===null)throw Error(pe(387));o=t.pendingProps,i=t.memoizedState,r=i.element,M_(e,t),Qs(t,o,null,n);var a=t.memoizedState;if(o=a.element,i.isDehydrated)if(i={element:o,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){r=ea(Error(pe(423)),t),t=vg(e,t,o,n,r);break e}else if(o!==r){r=ea(Error(pe(424)),t),t=vg(e,t,o,n,r);break e}else for(Kn=hr(t.stateNode.containerInfo.firstChild),Yn=t,$t=!0,Co=null,n=D_(t,null,o,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qi(),o===r){t=Xo(e,t,n);break e}xn(e,t,o,n)}t=t.child}return t;case 5:return P_(t),e===null&&Ld(t),o=t.type,r=t.pendingProps,i=e!==null?e.memoizedProps:null,a=r.children,Fd(o,r)?a=null:i!==null&&Fd(o,i)&&(t.flags|=32),rh(e,t),xn(e,t,a,n),t.child;case 6:return e===null&&Ld(t),null;case 13:return ah(e,t,n);case 4:return Cp(t,t.stateNode.containerInfo),o=t.pendingProps,e===null?t.child=Zi(t,null,o,n):xn(e,t,o,n),t.child;case 11:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:yo(o,r),gg(e,t,o,r,n);case 7:return xn(e,t,t.pendingProps,n),t.child;case 8:return xn(e,t,t.pendingProps.children,n),t.child;case 12:return xn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(o=t.type._context,r=t.pendingProps,i=t.memoizedProps,a=r.value,Lt(Ys,o._currentValue),o._currentValue=a,i!==null)if(No(i.value,a)){if(i.children===r.children&&!An.current){t=Xo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var s=l.firstContext;s!==null;){if(s.context===o){if(i.tag===1){s=Go(-1,n&-n),s.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var p=d.pending;p===null?s.next=s:(s.next=p.next,p.next=s),d.pending=s}}i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Id(i.return,n,t),l.lanes|=n;break}s=s.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(pe(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Id(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}xn(e,t,r.children,n),t=t.child}return t;case 9:return r=t.type,o=t.pendingProps.children,qi(t,n),r=lo(r),o=o(r),t.flags|=1,xn(e,t,o,n),t.child;case 14:return o=t.type,r=yo(o,t.pendingProps),r=yo(o.type,r),_g(e,t,o,r,n);case 15:return nh(e,t,t.type,t.pendingProps,n);case 17:return o=t.type,r=t.pendingProps,r=t.elementType===o?r:yo(o,r),Ms(e,t),t.tag=1,On(o)?(e=!0,Gs(t)):e=!1,qi(t,n),J_(t,o,r),Od(t,o,r,n),Vd(null,t,o,!0,e,n);case 19:return lh(e,t,n);case 22:return oh(e,t,n)}throw Error(pe(156,t.tag))};function kh(e,t){return Xg(e,t)}function yC(e,t,n,o){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=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function io(e,t,n,o){return new yC(e,t,n,o)}function Op(e){return e=e.prototype,!(!e||!e.isReactComponent)}function wC(e){if(typeof e=="function")return Op(e)?1:0;if(e!=null){if(e=e.$$typeof,e===np)return 11;if(e===op)return 14}return 2}function wr(e,t){var n=e.alternate;return n===null?(n=io(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 Is(e,t,n,o,r,i){var a=2;if(o=e,typeof e=="function")Op(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Mi:return Jr(n.children,r,i,t);case tp:a=8,r|=8;break;case ld:return e=io(12,n,t,r|2),e.elementType=ld,e.lanes=i,e;case sd:return e=io(13,n,t,r),e.elementType=sd,e.lanes=i,e;case ud:return e=io(19,n,t,r),e.elementType=ud,e.lanes=i,e;case Pg:return _u(n,r,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Tg:a=10;break e;case Mg:a=9;break e;case np:a=11;break e;case op:a=14;break e;case sr:a=16,o=null;break e}throw Error(pe(130,e==null?e:typeof e,""))}return t=io(a,n,t,r),t.elementType=e,t.type=o,t.lanes=i,t}function Jr(e,t,n,o){return e=io(7,e,o,t),e.lanes=n,e}function _u(e,t,n,o){return e=io(22,e,o,t),e.elementType=Pg,e.lanes=n,e.stateNode={isHidden:!1},e}function rd(e,t,n){return e=io(6,e,null,t),e.lanes=n,e}function id(e,t,n){return t=io(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function CC(e,t,n,o,r){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=jc(0),this.expirationTimes=jc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jc(0),this.identifierPrefix=o,this.onRecoverableError=r,this.mutableSourceEagerHydrationData=null}function $p(e,t,n,o,r,i,a,l,s){return e=new CC(e,t,n,l,s),t===1?(t=1,i===!0&&(t|=8)):t=0,i=io(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:o,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wp(i),e}function kC(e,t,n){var o=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ti,key:o==null?null:""+o,children:e,containerInfo:t,implementation:n}}function Sh(e){if(!e)return kr;e=e._reactInternals;e:{if(ai(e)!==e||e.tag!==1)throw Error(pe(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(On(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(pe(171))}if(e.tag===1){var n=e.type;if(On(n))return S_(e,n,t)}return t}function Nh(e,t,n,o,r,i,a,l,s){return e=$p(n,o,!0,e,r,i,a,l,s),e.context=Sh(null),n=e.current,o=Rn(),r=yr(n),i=Go(o,r),i.callback=t??null,vr(n,i,r),e.current.lanes=r,yl(e,r,o),$n(e,o),e}function hu(e,t,n,o){var r=t.current,i=Rn(),a=yr(r);return n=Sh(n),t.context===null?t.context=n:t.pendingContext=n,t=Go(i,a),t.payload={element:e},o=o===void 0?null:o,o!==null&&(t.callback=o),e=vr(r,t,a),e!==null&&(So(e,r,a,i),Fs(e,r,a)),a}function iu(e){return e=e.current,e.child?(e.child.tag===5,e.child.stateNode):null}function Eg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function zp(e,t){Eg(e,t),(e=e.alternate)&&Eg(e,t)}function SC(){return null}var xh=typeof reportError=="function"?reportError:function(e){console.error(e)};function Vp(e){this._internalRoot=e}vu.prototype.render=Vp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(pe(409));hu(e,t,null,null)};vu.prototype.unmount=Vp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ri(function(){hu(null,e,null,null)}),t[Ko]=null}};function vu(e){this._internalRoot=e}vu.prototype.unstable_scheduleHydration=function(e){if(e){var t=o_();e={blockedOn:null,target:e,priority:t};for(var n=0;n<cr.length&&t!==0&&t<cr[n].priority;n++);cr.splice(n,0,e),n===0&&i_(e)}};function Bp(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function bu(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Fg(){}function NC(e,t,n,o,r){if(r){if(typeof o=="function"){var i=o;o=function(){var d=iu(a);i.call(d)}}var a=Nh(t,o,e,0,null,!1,!1,"",Fg);return e._reactRootContainer=a,e[Ko]=a.current,dl(e.nodeType===8?e.parentNode:e),ri(),a}for(;r=e.lastChild;)e.removeChild(r);if(typeof o=="function"){var l=o;o=function(){var d=iu(s);l.call(d)}}var s=$p(e,0,!1,null,null,!1,!1,"",Fg);return e._reactRootContainer=s,e[Ko]=s.current,dl(e.nodeType===8?e.parentNode:e),ri(function(){hu(t,s,n,o)}),s}function yu(e,t,n,o,r){var i=n._reactRootContainer;if(i){var a=i;if(typeof r=="function"){var l=r;r=function(){var s=iu(a);l.call(s)}}hu(t,a,e,r)}else a=NC(n,t,e,r,o);return iu(a)}t_=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ga(t.pendingLanes);n!==0&&(ap(t,n|1),$n(t,Gt()),(kt&6)===0&&(ta=Gt()+500,xr()))}break;case 13:ri(function(){var o=Yo(e,1);if(o!==null){var r=Rn();So(o,e,1,r)}}),zp(e,1)}};lp=function(e){if(e.tag===13){var t=Yo(e,134217728);if(t!==null){var n=Rn();So(t,e,134217728,n)}zp(e,134217728)}};n_=function(e){if(e.tag===13){var t=yr(e),n=Yo(e,t);if(n!==null){var o=Rn();So(n,e,t,o)}zp(e,t)}};o_=function(){return Mt};r_=function(e,t){var n=Mt;try{return Mt=e,t()}finally{Mt=n}};bd=function(e,t,n){switch(t){case"input":if(pd(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 o=n[t];if(o!==e&&o.form===e.form){var r=cu(o);if(!r)throw Error(pe(90));Ig(o),pd(o,r)}}}break;case"textarea":Og(e,n);break;case"select":t=n.value,t!=null&&Hi(e,!!n.multiple,t,!1)}};Ug=Lp;Wg=ri;var xC={usingClientEntryPoint:!1,Events:[Cl,Ai,cu,jg,Hg,Lp]},ja={findFiberByHostInstance:Yr,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},RC={bundleType:ja.bundleType,version:ja.version,rendererPackageName:ja.rendererPackageName,rendererConfig:ja.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Qo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Kg(e),e===null?null:e.stateNode},findFiberByHostInstance:ja.findFiberByHostInstance||SC,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&(Ha=__REACT_DEVTOOLS_GLOBAL_HOOK__,!Ha.isDisabled&&Ha.supportsFiber))try{au=Ha.inject(RC),Lo=Ha}catch{}var Ha;Zn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=xC;Zn.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Bp(t))throw Error(pe(200));return kC(e,t,null,n)};Zn.createRoot=function(e,t){if(!Bp(e))throw Error(pe(299));var n=!1,o="",r=xh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(o=t.identifierPrefix),t.onRecoverableError!==void 0&&(r=t.onRecoverableError)),t=$p(e,1,!1,null,null,n,!1,o,r),e[Ko]=t.current,dl(e.nodeType===8?e.parentNode:e),new Vp(t)};Zn.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(pe(188)):(e=Object.keys(e).join(","),Error(pe(268,e)));return e=Kg(t),e=e===null?null:e.stateNode,e};Zn.flushSync=function(e){return ri(e)};Zn.hydrate=function(e,t,n){if(!bu(t))throw Error(pe(200));return yu(null,e,t,!0,n)};Zn.hydrateRoot=function(e,t,n){if(!Bp(e))throw Error(pe(405));var o=n!=null&&n.hydratedSources||null,r=!1,i="",a=xh;if(n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=Nh(t,null,e,1,n??null,r,!1,i,a),e[Ko]=t.current,dl(e),o)for(e=0;e<o.length;e++)n=o[e],r=n._getVersion,r=r(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,r]:t.mutableSourceEagerHydrationData.push(n,r);return new vu(t)};Zn.render=function(e,t,n){if(!bu(t))throw Error(pe(200));return yu(null,e,t,!1,n)};Zn.unmountComponentAtNode=function(e){if(!bu(e))throw Error(pe(40));return e._reactRootContainer?(ri(function(){yu(null,null,e,!1,function(){e._reactRootContainer=null,e[Ko]=null})}),!0):!1};Zn.unstable_batchedUpdates=Lp;Zn.unstable_renderSubtreeIntoContainer=function(e,t,n,o){if(!bu(n))throw Error(pe(200));if(e==null||e._reactInternals===void 0)throw Error(pe(38));return yu(e,t,n,!1,o)};Zn.version="18.3.1-next-f1338f8080-20240426"});var uo=Bo((tx,Fh)=>{"use strict";function Eh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Eh)}catch(e){console.error(e)}}Eh(),Fh.exports=Rh()});var Hp=Bo(jp=>{"use strict";var Dh=uo();jp.createRoot=Dh.createRoot,jp.hydrateRoot=Dh.hydrateRoot;var nx});var Hv=Bo(Gu=>{"use strict";var Zk=xt(),Jk=Symbol.for("react.element"),eS=Symbol.for("react.fragment"),tS=Object.prototype.hasOwnProperty,nS=Zk.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,oS={key:!0,ref:!0,__self:!0,__source:!0};function jv(e,t,n){var o,r={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(o in t)tS.call(t,o)&&!oS.hasOwnProperty(o)&&(r[o]=t[o]);if(e&&e.defaultProps)for(o in t=e.defaultProps,t)r[o]===void 0&&(r[o]=t[o]);return{$$typeof:Jk,type:e,key:i,ref:a,props:r,_owner:nS.current}}Gu.Fragment=eS;Gu.jsx=jv;Gu.jsxs=jv});var St=Bo((Jx,Uv)=>{"use strict";Uv.exports=Hv()});var PN={};ty(PN,{default:()=>sc});module.exports=ny(PN);var $o=require("obsidian");var Qm=require("obsidian");var oy={view_table:"Table",view_list:"List",view_board:"Board",view_gallery:"Gallery",view_calendar:"Calendar",view_timeline:"Timeline",view_chart:"Chart",add_view:"Add view",remove_view:"Remove view",rename_view_hint:"Double-click to rename",fields:"Fields",filter:"Filter",filters:"Filters",sort:"Sort",actions:"Actions",group_by:"Group by",cover:"Cover",date_field:"Date",start_field:"Start",end_field:"End",group_field:"Group",fields_in_card:"Fields in card",fields_label:"Fields",fields_on_bars:"Fields on bars",filter_by:"Filter by",sort_by:"Sort by",group_by_label:"Group by",date_field_label:"Date field",cover_field_label:"Cover field",card_size_label:"Card size",row_height_label:"Row height",none_value:"None",no_value:"No value",no_cover:"None",size_small:"Small",size_medium:"Medium",size_large:"Large",height_compact:"Compact",height_medium:"Medium",height_tall:"Tall",add_filter_advanced:"Add advanced filter",add_sort:"Add sort",no_active_sorts:"No active sorts",name_column:"Name",conjunction_and:"AND",conjunction_or:"OR",filter_number_placeholder:"Number...",filter_value_placeholder:"Value...",delete_selected:"Delete all selected",move_selected:"Move all selected",duplicate_selected:"Duplicate all selected",export_csv:"Export CSV",import_csv:"Import CSV",open_note:"Open note",delete_note:"Delete note",duplicate_note:"Duplicate note",sort_asc:"Ascending",sort_desc:"Descending",sort_asc_title:"Sort descending",sort_desc_title:"Remove sort",sort_none_title:"Sort ascending",rename_column:"Rename",edit_formula:"Edit formula",configure_lookup:"Configure lookup",configure_relation:"Configure relation",format_number:"Format number",configure_image_folder:"Configure image folder",field_type_label:"Field type",hide_field:"Hide field",enable_wrap_text:"Wrap text",disable_wrap_text:"Unwrap text",delete_field:"Delete field",type_title:"Title",type_text:"Text",type_number:"Number",type_select:"Select",type_multiselect:"Multi-select",type_date:"Date",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Phone",type_status:"Status",type_formula:"Formula",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configure rollup",rollup_select_relation:"1. Relation column",rollup_select_relation_placeholder:"Select relation...",rollup_select_target:"2. Target column",rollup_select_target_placeholder:"Select column...",rollup_select_function:"3. Aggregation",rollup_no_relations:"No relation columns found. Add a relation column first.",rollup_fn_sum:"Sum",rollup_fn_count:"Count",rollup_fn_avg:"Average",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Count unique",rollup_fn_list:"List all",type_image:"Image",type_audio:"Audio",audio_path_placeholder:"Path to audio file...",audio_select_placeholder:"Select audio...",audio_picker_title:"Select audio",audio_picker_clear:"Clear",audio_picker_empty_folder:"No audio files in folder",audio_picker_empty_vault:"No audio files in vault",audio_panel_title:"Audio settings",audio_folder_label:"Source folder (leave empty for entire vault)",audio_folder_placeholder:"Ex: audio/music",configure_audio_folder:"Configure audio folder",type_video:"Video",video_select_placeholder:"Select video...",video_picker_clear:"Clear",video_picker_empty_folder:"No video files in folder",video_picker_empty_vault:"No video files in vault",video_panel_title:"Video settings",video_folder_label:"Source folder (leave empty for entire vault)",video_folder_placeholder:"Ex: video/clips",configure_video_folder:"Configure video folder",formula_panel_title:"Formula",formula_placeholder:'Example: if(status = "done", 1, 0)',formula_valid:"Valid syntax",formula_available_cols:"Available columns:",formula_ref_toggle:"Function reference",formula_save:"Save",formula_cancel:"Cancel",formula_save_hint:"Save (Ctrl+Enter)",formula_group_logic:"Logic",formula_group_comparators:"Comparators",formula_group_aggregators:"Aggregators",formula_group_text:"Text",formula_group_math:"Math",formula_group_utils:"Utilities",number_format_title:"Format",number_decimals_label:"Decimal places",number_thousands_label:"Thousands separator",number_prefix_label:"Prefix",number_suffix_label:"Suffix",number_prefix_placeholder:"Ex: $, \u20AC",number_suffix_placeholder:"Ex: %, kg, km",number_remove_format:"Remove formatting",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Reference table",lookup_select_table:"Select table...",lookup_col_to_display:"2. Column to display",lookup_origin_col:"2. Source field for values",lookup_select_col:"Select column...",lookup_file_name:"File name",lookup_join_col:"3. Join column (this table)",lookup_join_col_title:"File name (join by title)",lookup_select_join_col:"Select column...",lookup_hint:"The value of this column must match the file name in the referenced table",image_panel_title:"Image",image_folder_label:"Source folder (optional)",image_folder_placeholder:"Ex: images/covers",image_picker_title:"Select image",image_picker_clear:"Clear",image_picker_empty_vault:"No images found in vault",image_picker_empty_folder:"No images found in",image_select_placeholder:"Select image\u2026",agg_none:"None",agg_count:"Count",agg_count_values:"Count values",agg_sum:"Sum",agg_avg:"Average",agg_min:"Min",agg_max:"Max",no_database_open:"No database open.",no_database_hint:'Use the ribbon button or the "create new database" command.',loading:"Loading...",no_results:"No items found",item_singular:"Item",item_plural:"Items",row_singular:"Row",row_plural:"Rows",record_singular:"Record",record_plural:"Records",add_row:"New row",add_entry:"New entry",add_card:"New card",new_field:"New field",add_field:"Add field",board_no_select_col:"The board requires a select or status column to group cards.",board_add_select_hint:"Add a column of that type in the table view and come back here.",board_drag_reorder:"Drag to reorder",board_set_limit:"Click to set card limit",board_limit_placeholder:"Limit (0 = none)",board_show_more:"More",board_show_less:"Show less",hide_empty_cols:"Hide empty",hide_no_value_cols:"Hide no-value",calendar_no_date_field:"Select a date field in the toolbar to show the calendar.",calendar_no_date_section:"No date",calendar_click_to_create:"Click to create note",calendar_today:"Today",calendar_prev_month:"Previous month",calendar_next_month:"Next month",calendar_view_month:"Month",calendar_view_week:"Week",calendar_prev_week:"Previous week",calendar_next_week:"Next week",calendar_add_time:"Add time",calendar_remove_time:"Remove time",calendar_all_day:"All day",day_sun:"Sun",day_mon:"Mon",day_tue:"Tue",day_wed:"Wed",day_thu:"Thu",day_fri:"Fri",day_sat:"Sat",month_january:"January",month_february:"February",month_march:"March",month_april:"April",month_may:"May",month_june:"June",month_july:"July",month_august:"August",month_september:"September",month_october:"October",month_november:"November",month_december:"December",timeline_no_start_field:"Select a start field in the toolbar to show the timeline.",timeline_no_interval:"No interval",timeline_scroll_prev:"Scroll back",timeline_scroll_next:"Scroll forward",zoom_days:"Days",zoom_weeks:"Weeks",zoom_months:"Months",month_short_jan:"Jan",month_short_feb:"Feb",month_short_mar:"Mar",month_short_apr:"Apr",month_short_may:"May",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Aug",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"Dec",hierarchy_toggle:"Use as hierarchy",hierarchy_toggle_hint:"Enables parent-child relationships between rows in this database",add_subrow:"Add sub-row",collapse_all:"Collapse all",expand_all:"Expand all",max_depth_reached:"Maximum depth reached (3 levels)",chart_configure:"Configure",chart_type:"Chart type",chart_type_bar:"Bar",chart_type_line:"Line",chart_type_pie:"Pie",chart_x_axis:"Categories (X axis)",chart_y_axis:"Values (y axis)",chart_aggregation:"Aggregation",chart_select_column:"Select column...",chart_count_records:"Count",chart_no_config:"Configure the chart to get started.",chart_no_config_hint:"Select a column for categories in the toolbar above.",tooltip_pin_column:"Pin columns up to here",tooltip_unpin_column:"Unpin columns",tooltip_resize_column:"Drag to resize; double-click to fit content",tooltip_wrap_text:"Wrap text",tooltip_include_subfolders:"Include subfolders",folder_column:"Folder",tooltip_manage_fields:"Manage fields",tooltip_batch_actions:"Batch actions",tooltip_remove_filter:"Remove filter",hide_filters:"Hide filters",show_filters:"Show filters",filters_count_one:"1 filter",filters_count_other:"{n} filters",tooltip_close:"Close",tooltip_remove:"Remove",tooltip_move_up:"Move up",tooltip_move_down:"Move down",tooltip_change_color:"Change color",tooltip_delete_status:"Delete status",status_not_started:"Not started",status_in_progress:"In progress",status_done:"Done",status_cancelled:"Cancelled",relation_search_placeholder:"Search...",relation_clear:"Clear",relation_no_results:"No results",relation_two_way:"Two-way relation",relation_two_way_hint:"Automatically creates a reverse relation in the target database",select_clear:"Clear",select_create_placeholder:"Create new option...",status_new_placeholder:"New status...",color_custom:"Custom",validate_non_numeric:'Cell(s) contain non-numeric values (e.g.: "',validate_invalid_dates:'Cell(s) contain values that are not valid dates (e.g.: "',validate_invalid_checkbox:'Cell(s) contain values incompatible with checkbox (e.g.: "',validate_multiselect_to_select:"Row(s) have multiple values selected. Remove extras before changing to single select.",validate_invalid_email:'Cell(s) contain values that are not valid emails (e.g.: "',validate_invalid_url:'Cell(s) contain values that are not valid URLs (e.g.: "',validate_invalid_phone:'Cell(s) contain values that are not valid phone numbers (e.g.: "',validate_type_change_prefix:"Cannot change type: ",email_invalid:"Invalid email",op_is:"Is",op_is_not:"Is not",op_contains:"Contains",op_not_contains:"Does not contain",op_starts_with:"Starts with",op_ends_with:"Ends with",op_is_empty:"Is empty",op_is_not_empty:"Is not empty",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Is checked",op_is_unchecked:"Is unchecked",settings_db_filename_name:"Database file name",settings_db_filename_desc:"Name of the special file that identifies a database in a folder.",settings_row_height_name:"Default row height",settings_row_height_desc:"Height in pixels of each table row.",settings_inline_fields_name:"Read dataview inline fields",settings_inline_fields_desc:"Parse key:: value fields from note body and display as column values (read-only)",db_untitled_note:"Untitled",db_copy_suffix:"(copy)",db_copy_suffix_n:"(copy $n)",db_already_exists:'A database already exists in "$folder"',db_tip_body:"This file is a database. Open it to see the table view.",formula_err_unclosed_string:"Unclosed string at position $pos",formula_err_unclosed_bracket:"Unclosed bracket at position $pos",formula_err_unexpected_bang:"Unexpected character '!' at position $pos",formula_err_unexpected_char:"Unexpected character '$char' at position $pos",formula_err_expected_token:"Expected $expected, found '$found' at position $pos",formula_err_unexpected_token:"Unexpected token '$token' at position $pos",formula_err_circular_ref:'Circular reference: "$name" is a formula column',formula_err_unknown_fn:"Unknown function: $fn()",formula_err_if_args:"Expected if(condition, if_true, [if_false])",formula_err_avg_args:"Expected avg(column) \u2014 requires a column reference as argument",formula_err_count_args:"Expected count(column) \u2014 requires a column reference as argument",formula_err_mid_args:"Expected mid(text, start, length)",formula_err_mod_args:"Expected mod(number, divisor)",formula_err_sqrt_args:"Expected sqrt(number)",formula_err_not_implemented:"Function not implemented: $fn()",plugin_display_name:"Notion bases",no_databases_found:'No databases found. Use the "create new database" command to create one.',cmd_open_database:"Open database for this folder",cmd_create_database:"Create new database in current folder",ctx_create_database:"Create database here",arr_settings_title:"Folder arrangement",arr_settings_desc:"Automatically move row files into nested subfolders based on the values of the selected properties, in order.",arr_settings_enabled_name:"Enable folder arrangement",arr_settings_enabled_desc:"When on, rows are moved as soon as one of the selected properties changes. Off by default.",arr_settings_no_props:"No properties selected. Add one below to define the folder hierarchy.",arr_settings_no_candidates:"No eligible columns. Folder arrangement supports text, select, status, and date columns.",arr_settings_add_placeholder:"Select a property...",arr_settings_add_btn:"Add",arr_settings_preview_btn:"Preview & apply to existing rows",arr_preview_title:"Folder arrangement preview",arr_preview_empty:"No rows need to be moved.",arr_preview_desc:"$count row(s) will be moved:",arr_preview_apply:"Apply",arr_preview_cancel:"Cancel",arr_preview_applied:"Moved $count row(s).",cmd_quick_add:"Quick add row to database",quick_add_title:"Quick add",quick_add_note_title:"Title",quick_add_note_title_placeholder:"Note title...",quick_add_create:"Create",quick_add_create_and_open:"Create and open",quick_add_no_visible_fields:"No editable fields in this database",picker_placeholder:"Select database...",picker_root:"/ (root)",view_fallback_name:"Database",saving:"Saving",saved:"Saved",save_error:"Save error",settings_page_size_name:"Rows per page",settings_page_size_desc:'Number of rows to display per page. Set to "all" for continuous scrolling',settings_page_size_all:"All (continuous scroll)",page_of:"Page {current} of {total}",first_page:"First page",last_page:"Last page",prev_page:"Previous page",next_page:"Next page",conditional_formatting:"Conditional formatting",no_conditional_formats:"No rules yet",add_rule:"Add rule",select_value:"Select a value",style:"Style",background:"Background",text_color:"Text color",save:"Save",cancel:"Cancel",value:"Value",db_settings_open:"Database settings",db_settings_title:"Database settings",db_settings_template_name:"Row template",db_settings_template_desc:"Apply this template to the body of every new row created in this database.",db_settings_template_choose:"Choose template",db_settings_template_clear:"Clear template",db_settings_template_none:"No template selected",db_settings_ask_name:"Ask for template on create",db_settings_ask_desc:"Prompt for a template each time a new row is added instead of applying the default.",template_picker_placeholder:"Choose a template...",template_picker_none:"No template (empty body)"},wc=oy;var ry={view_table:"Tabela",view_list:"Lista",view_board:"Board",view_gallery:"Galeria",view_calendar:"Calend\xE1rio",view_timeline:"Timeline",view_chart:"Gr\xE1fico",add_view:"Adicionar view",remove_view:"Remover view",rename_view_hint:"Duplo clique para renomear",fields:"Campos",filter:"Filtro",filters:"Filtros",sort:"Ordenar",actions:"A\xE7\xF5es",group_by:"Agrupar por",cover:"Capa",date_field:"Data",start_field:"In\xEDcio",end_field:"Fim",group_field:"Agrupar",fields_in_card:"Campos no card",fields_label:"Campos",fields_on_bars:"Campos nas barras",filter_by:"Filtrar por",sort_by:"Ordenar por",group_by_label:"Agrupar por",date_field_label:"Campo de data",cover_field_label:"Campo de capa",card_size_label:"Tamanho dos cards",row_height_label:"Altura das linhas",none_value:"Nenhum",no_value:"Sem valor",no_cover:"Nenhuma",size_small:"Pequeno",size_medium:"M\xE9dio",size_large:"Grande",height_compact:"Compacto",height_medium:"M\xE9dio",height_tall:"Alto",add_filter_advanced:"Adicionar filtro avan\xE7ado",add_sort:"Adicionar ordena\xE7\xE3o",no_active_sorts:"Nenhuma ordena\xE7\xE3o ativa",name_column:"Nome",conjunction_and:"E",conjunction_or:"OU",filter_number_placeholder:"N\xFAmero...",filter_value_placeholder:"Valor...",delete_selected:"Apagar todos selecionados",move_selected:"Mover todos selecionados",duplicate_selected:"Duplicar todos selecionados",export_csv:"Exportar CSV",import_csv:"Importar CSV",open_note:"Abrir nota",delete_note:"Excluir nota",duplicate_note:"Duplicar nota",sort_asc:"Ascendente",sort_desc:"Descendente",sort_asc_title:"Ordenar descendente",sort_desc_title:"Remover ordena\xE7\xE3o",sort_none_title:"Ordenar ascendente",rename_column:"Renomear",edit_formula:"Editar f\xF3rmula",configure_lookup:"Configurar lookup",configure_relation:"Configurar rela\xE7\xE3o",format_number:"Formatar n\xFAmero",configure_image_folder:"Configurar pasta de imagens",field_type_label:"Tipo de campo",hide_field:"Ocultar campo",enable_wrap_text:"Quebrar texto",disable_wrap_text:"N\xE3o quebrar texto",delete_field:"Excluir campo",type_title:"T\xEDtulo",type_text:"Texto",type_number:"N\xFAmero",type_select:"Sele\xE7\xE3o",type_multiselect:"Multi-sele\xE7\xE3o",type_date:"Data",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Telefone",type_status:"Status",type_formula:"F\xF3rmula",type_relation:"Rela\xE7\xE3o",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurar rollup",rollup_select_relation:"1. Coluna de rela\xE7\xE3o",rollup_select_relation_placeholder:"Selecionar rela\xE7\xE3o...",rollup_select_target:"2. Coluna de destino",rollup_select_target_placeholder:"Selecionar coluna...",rollup_select_function:"3. Agrega\xE7\xE3o",rollup_no_relations:"Nenhuma coluna de rela\xE7\xE3o encontrada. Adicione uma coluna de rela\xE7\xE3o primeiro.",rollup_fn_sum:"Soma",rollup_fn_count:"Contar",rollup_fn_avg:"M\xE9dia",rollup_fn_min:"M\xEDn",rollup_fn_max:"M\xE1x",rollup_fn_count_values:"Contar \xFAnicos",rollup_fn_list:"Listar tudo",type_image:"Imagem",type_audio:"\xC1udio",audio_path_placeholder:"Caminho para o arquivo de \xE1udio...",audio_select_placeholder:"Selecionar \xE1udio...",audio_picker_title:"Selecionar \xE1udio",audio_picker_clear:"Limpar",audio_picker_empty_folder:"Nenhum arquivo de \xE1udio na pasta",audio_picker_empty_vault:"Nenhum arquivo de \xE1udio no vault",audio_panel_title:"Configura\xE7\xF5es de \xE1udio",audio_folder_label:"Pasta de origem (deixe vazio para o vault inteiro)",audio_folder_placeholder:"Ex: audio/musica",configure_audio_folder:"Configurar pasta de \xE1udio",type_video:"V\xEDdeo",video_select_placeholder:"Selecionar v\xEDdeo...",video_picker_clear:"Limpar",video_picker_empty_folder:"Nenhum arquivo de v\xEDdeo na pasta",video_picker_empty_vault:"Nenhum arquivo de v\xEDdeo no vault",video_panel_title:"Configura\xE7\xF5es de v\xEDdeo",video_folder_label:"Pasta de origem (deixe vazio para o vault inteiro)",video_folder_placeholder:"Ex: video/clipes",configure_video_folder:"Configurar pasta de v\xEDdeo",formula_panel_title:"F\xF3rmula",formula_placeholder:'Ex: if(status = "feito", 1, 0)',formula_valid:"Sintaxe v\xE1lida",formula_available_cols:"Colunas dispon\xEDveis:",formula_ref_toggle:"Refer\xEAncia de fun\xE7\xF5es",formula_save:"Salvar",formula_cancel:"Cancelar",formula_save_hint:"Salvar (Ctrl+Enter)",formula_group_logic:"L\xF3gica",formula_group_comparators:"Comparadores",formula_group_aggregators:"Agregadores",formula_group_text:"Texto",formula_group_math:"Matem\xE1tica",formula_group_utils:"Utilit\xE1rios",number_format_title:"Formatar",number_decimals_label:"Casas decimais",number_thousands_label:"Separador de milhar",number_prefix_label:"Prefixo",number_suffix_label:"Sufixo",number_prefix_placeholder:"Ex: R$, $, \u20AC",number_suffix_placeholder:"Ex: %, kg, km",number_remove_format:"Remover formata\xE7\xE3o",relation_panel_title:"Rela\xE7\xE3o",lookup_panel_title:"Lookup",lookup_ref_table:"1. Tabela de refer\xEAncia",lookup_select_table:"Selecionar tabela...",lookup_col_to_display:"2. Coluna a exibir",lookup_origin_col:"2. Campo de origem dos valores",lookup_select_col:"Selecionar coluna...",lookup_file_name:"Nome do arquivo",lookup_join_col:"3. Coluna de jun\xE7\xE3o (nesta tabela)",lookup_join_col_title:"Nome do arquivo (jun\xE7\xE3o por t\xEDtulo)",lookup_select_join_col:"Selecionar coluna...",lookup_hint:"O valor desta coluna deve ser igual ao nome do arquivo da nota na tabela referenciada",image_panel_title:"Imagem",image_folder_label:"Pasta de origem (opcional)",image_folder_placeholder:"Ex: imagens/capas",image_picker_title:"Selecionar imagem",image_picker_clear:"Limpar",image_picker_empty_vault:"Nenhuma imagem encontrada no vault",image_picker_empty_folder:"Nenhuma imagem encontrada em",image_select_placeholder:"Selecionar imagem\u2026",agg_none:"Nenhum",agg_count:"Contar",agg_count_values:"Contar valores",agg_sum:"Soma",agg_avg:"M\xE9dia",agg_min:"M\xEDn",agg_max:"M\xE1x",no_database_open:"Nenhum banco de dados aberto.",no_database_hint:'Use o bot\xE3o na ribbon ou o comando "criar novo banco de dados".',loading:"Carregando...",no_results:"Nenhum item encontrado",item_singular:"Item",item_plural:"Itens",row_singular:"Linha",row_plural:"Linhas",record_singular:"Registro",record_plural:"Registros",add_row:"Nova linha",add_entry:"Nova entrada",add_card:"Novo card",new_field:"Novo campo",add_field:"Adicionar campo",board_no_select_col:"O board precisa de uma coluna do tipo select ou status para agrupar os cards.",board_add_select_hint:"Adicione uma coluna desse tipo na view de tabela e volte aqui.",board_drag_reorder:"Arraste para reordenar",board_set_limit:"Clique para definir limite de cards",board_limit_placeholder:"Limite (0 = nenhum)",board_show_more:"Mais",board_show_less:"Mostrar menos",hide_empty_cols:"Ocultar vazias",hide_no_value_cols:"Ocultar sem valor",calendar_no_date_field:"Selecione um campo de data no toolbar para exibir o calend\xE1rio.",calendar_no_date_section:"Sem data",calendar_click_to_create:"Clique para criar nota",calendar_today:"Hoje",calendar_prev_month:"M\xEAs anterior",calendar_next_month:"Pr\xF3ximo m\xEAs",calendar_view_month:"M\xEAs",calendar_view_week:"Semana",calendar_prev_week:"Semana anterior",calendar_next_week:"Pr\xF3xima semana",calendar_add_time:"Adicionar hor\xE1rio",calendar_remove_time:"Remover hor\xE1rio",calendar_all_day:"Dia inteiro",day_sun:"Dom",day_mon:"Seg",day_tue:"Ter",day_wed:"Qua",day_thu:"Qui",day_fri:"Sex",day_sat:"S\xE1b",month_january:"Janeiro",month_february:"Fevereiro",month_march:"Mar\xE7o",month_april:"Abril",month_may:"Maio",month_june:"Junho",month_july:"Julho",month_august:"Agosto",month_september:"Setembro",month_october:"Outubro",month_november:"Novembro",month_december:"Dezembro",timeline_no_start_field:"Selecione um campo de in\xEDcio no toolbar para exibir a timeline.",timeline_no_interval:"Sem intervalo",timeline_scroll_prev:"Scroll anterior",timeline_scroll_next:"Scroll pr\xF3ximo",zoom_days:"Dias",zoom_weeks:"Semanas",zoom_months:"Meses",month_short_jan:"Jan",month_short_feb:"Fev",month_short_mar:"Mar",month_short_apr:"Abr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ago",month_short_sep:"Set",month_short_oct:"Out",month_short_nov:"Nov",month_short_dec:"Dez",hierarchy_toggle:"Usar como hierarquia",hierarchy_toggle_hint:"Habilita relacionamentos pai-filho entre linhas neste banco de dados",add_subrow:"Adicionar sublinha",collapse_all:"Recolher tudo",expand_all:"Expandir tudo",max_depth_reached:"Profundidade m\xE1xima atingida (3 n\xEDveis)",chart_configure:"Configurar",chart_type:"Tipo de gr\xE1fico",chart_type_bar:"Barras",chart_type_line:"Linhas",chart_type_pie:"Pizza",chart_x_axis:"Categorias (eixo X)",chart_y_axis:"Valores (eixo Y)",chart_aggregation:"Agrega\xE7\xE3o",chart_select_column:"Selecionar coluna...",chart_count_records:"Contagem",chart_no_config:"Configure o gr\xE1fico para come\xE7ar.",chart_no_config_hint:"Selecione uma coluna para categorias na barra de ferramentas acima.",tooltip_pin_column:"Fixar colunas at\xE9 aqui",tooltip_unpin_column:"Desafixar colunas",tooltip_resize_column:"Arrastar para redimensionar; clique duplo para ajustar ao conte\xFAdo",tooltip_wrap_text:"Wrap de texto",tooltip_include_subfolders:"Incluir subpastas",folder_column:"Pasta",tooltip_manage_fields:"Gerenciar campos",tooltip_batch_actions:"A\xE7\xF5es em lote",tooltip_remove_filter:"Remover filtro",hide_filters:"Ocultar filtros",show_filters:"Exibir filtros",filters_count_one:"1 filtro",filters_count_other:"{n} filtros",tooltip_close:"Fechar",tooltip_remove:"Remover",tooltip_move_up:"Mover para cima",tooltip_move_down:"Mover para baixo",tooltip_change_color:"Trocar cor",tooltip_delete_status:"Excluir status",status_not_started:"N\xE3o iniciado",status_in_progress:"Em andamento",status_done:"Conclu\xEDdo",status_cancelled:"Cancelado",relation_search_placeholder:"Buscar...",relation_clear:"Limpar",relation_no_results:"Nenhum resultado",relation_two_way:"Rela\xE7\xE3o bidirecional",relation_two_way_hint:"Cria automaticamente uma rela\xE7\xE3o inversa no banco de dados de destino",select_clear:"Limpar",select_create_placeholder:"Criar nova op\xE7\xE3o...",status_new_placeholder:"Novo status...",color_custom:"Personalizada",validate_non_numeric:'C\xE9lula(s) cont\xEAm valores n\xE3o num\xE9ricos (ex: "',validate_invalid_dates:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o datas v\xE1lidas (ex: "',validate_invalid_checkbox:'C\xE9lula(s) cont\xEAm valores incompat\xEDveis com checkbox (ex: "',validate_multiselect_to_select:"Linha(s) t\xEAm m\xFAltiplos valores selecionados. Remova os extras antes de mudar para sele\xE7\xE3o \xFAnica.",validate_invalid_email:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o e-mails v\xE1lidos (ex: "',validate_invalid_url:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o URLs v\xE1lidas (ex: "',validate_invalid_phone:'C\xE9lula(s) cont\xEAm valores que n\xE3o s\xE3o telefones v\xE1lidos (ex: "',validate_type_change_prefix:"N\xE3o \xE9 poss\xEDvel mudar o tipo: ",email_invalid:"E-mail inv\xE1lido",op_is:"\xC9",op_is_not:"N\xE3o \xE9",op_contains:"Cont\xE9m",op_not_contains:"N\xE3o cont\xE9m",op_starts_with:"Come\xE7a com",op_ends_with:"Termina com",op_is_empty:"Est\xE1 vazio",op_is_not_empty:"N\xE3o est\xE1 vazio",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est\xE1 marcado",op_is_unchecked:"N\xE3o est\xE1 marcado",settings_db_filename_name:"Nome do arquivo de banco de dados",settings_db_filename_desc:"Nome do arquivo especial que identifica um banco de dados na pasta.",settings_row_height_name:"Altura padr\xE3o das linhas",settings_row_height_desc:"Altura em pixels de cada linha da tabela.",settings_inline_fields_name:"Ler campos inline do dataview",settings_inline_fields_desc:"Interpreta campos key:: value no corpo da nota e os exibe como valores de coluna (somente leitura)",db_untitled_note:"Sem t\xEDtulo",db_copy_suffix:"(c\xF3pia)",db_copy_suffix_n:"(c\xF3pia $n)",db_already_exists:'J\xE1 existe um banco de dados em "$folder"',db_tip_body:"Este arquivo \xE9 um banco de dados. Abra-o para ver a visualiza\xE7\xE3o de tabela.",formula_err_unclosed_string:"String n\xE3o fechada na posi\xE7\xE3o $pos",formula_err_unclosed_bracket:"Colchete n\xE3o fechado na posi\xE7\xE3o $pos",formula_err_unexpected_bang:"Caractere inesperado '!' na posi\xE7\xE3o $pos",formula_err_unexpected_char:"Caractere inesperado '$char' na posi\xE7\xE3o $pos",formula_err_expected_token:"Esperado $expected, encontrado '$found' na posi\xE7\xE3o $pos",formula_err_unexpected_token:"Token inesperado '$token' na posi\xE7\xE3o $pos",formula_err_circular_ref:'Refer\xEAncia circular: "$name" \xE9 uma coluna f\xF3rmula',formula_err_unknown_fn:"Fun\xE7\xE3o desconhecida: $fn()",formula_err_if_args:"Esperado if(condi\xE7\xE3o, se_verdadeiro, [se_falso])",formula_err_avg_args:"Esperado avg(coluna) \u2014 requer refer\xEAncia de coluna como argumento",formula_err_count_args:"Esperado count(coluna) \u2014 requer refer\xEAncia de coluna como argumento",formula_err_mid_args:"Esperado mid(texto, in\xEDcio, comprimento)",formula_err_mod_args:"Esperado mod(n\xFAmero, divisor)",formula_err_sqrt_args:"Esperado sqrt(n\xFAmero)",formula_err_not_implemented:"Fun\xE7\xE3o n\xE3o implementada: $fn()",plugin_display_name:"Notion bases",no_databases_found:'Nenhum banco de dados encontrado. Use o comando "Criar novo banco de dados" para criar um.',cmd_open_database:"Abrir banco de dados desta pasta",cmd_create_database:"Criar novo banco de dados na pasta atual",ctx_create_database:"Criar banco de dados aqui",arr_settings_title:"Organiza\xE7\xE3o por pastas",arr_settings_desc:"Move automaticamente os arquivos de linha para subpastas aninhadas com base nos valores das propriedades selecionadas, na ordem definida.",arr_settings_enabled_name:"Ativar organiza\xE7\xE3o por pastas",arr_settings_enabled_desc:"Quando ativado, as linhas s\xE3o movidas assim que uma das propriedades selecionadas \xE9 alterada. Desativado por padr\xE3o.",arr_settings_no_props:"Nenhuma propriedade selecionada. Adicione uma abaixo para definir a hierarquia de pastas.",arr_settings_no_candidates:"Nenhuma coluna eleg\xEDvel. A organiza\xE7\xE3o por pastas suporta colunas de texto, sele\xE7\xE3o, status e data.",arr_settings_add_placeholder:"Selecionar uma propriedade...",arr_settings_add_btn:"Adicionar",arr_settings_preview_btn:"Pr\xE9-visualizar e aplicar \xE0s linhas existentes",arr_preview_title:"Pr\xE9-visualiza\xE7\xE3o da organiza\xE7\xE3o por pastas",arr_preview_empty:"Nenhuma linha precisa ser movida.",arr_preview_desc:"$count linha(s) ser\xE1(\xE3o) movida(s):",arr_preview_apply:"Aplicar",arr_preview_cancel:"Cancelar",arr_preview_applied:"$count linha(s) movida(s).",cmd_quick_add:"Adicionar linha rapidamente ao banco de dados",quick_add_title:"Adi\xE7\xE3o r\xE1pida",quick_add_note_title:"T\xEDtulo",quick_add_note_title_placeholder:"T\xEDtulo da nota...",quick_add_create:"Criar",quick_add_create_and_open:"Criar e abrir",quick_add_no_visible_fields:"Nenhum campo edit\xE1vel neste banco de dados",picker_placeholder:"Selecionar banco de dados...",picker_root:"/ (Raiz)",view_fallback_name:"Banco de dados",saving:"Salvando",saved:"Salvo",save_error:"Erro ao salvar",settings_page_size_name:"Linhas por p\xE1gina",settings_page_size_desc:'N\xFAmero de linhas a exibir por p\xE1gina. Defina como "Todas" para rolagem cont\xEDnua',settings_page_size_all:"Todas (rolagem cont\xEDnua)",page_of:"P\xE1gina {current} de {total}",first_page:"Primeira p\xE1gina",last_page:"\xDAltima p\xE1gina",prev_page:"P\xE1gina anterior",next_page:"Pr\xF3xima p\xE1gina",conditional_formatting:"Formata\xE7\xE3o condicional",no_conditional_formats:"Nenhuma regra ainda",add_rule:"Adicionar regra",select_value:"Selecione um valor",style:"Estilo",background:"Plano de fundo",text_color:"Cor do texto",save:"Salvar",cancel:"Cancelar",value:"Valor",db_settings_open:"Configura\xE7\xF5es do banco de dados",db_settings_title:"Configura\xE7\xF5es do banco de dados",db_settings_template_name:"Modelo de linha",db_settings_template_desc:"Aplica este modelo ao corpo de cada nova linha criada neste banco de dados.",db_settings_template_choose:"Escolher modelo",db_settings_template_clear:"Remover modelo",db_settings_template_none:"Nenhum modelo selecionado",db_settings_ask_name:"Perguntar pelo modelo ao criar",db_settings_ask_desc:"Solicitar um modelo toda vez que uma nova linha for adicionada, em vez de usar o padr\xE3o.",template_picker_placeholder:"Escolha um modelo...",template_picker_none:"Sem modelo (corpo vazio)"},Cc=ry;var iy={view_table:"Tabla",view_list:"Lista",view_board:"Tablero",view_gallery:"Galer\xEDa",view_calendar:"Calendario",view_timeline:"L\xEDnea de tiempo",view_chart:"Gr\xE1fico",add_view:"A\xF1adir vista",remove_view:"Eliminar vista",rename_view_hint:"Doble clic para renombrar",fields:"Campos",filter:"Filtro",filters:"Filtros",sort:"Ordenar",actions:"Acciones",group_by:"Agrupar por",cover:"Portada",date_field:"Fecha",start_field:"Inicio",end_field:"Fin",group_field:"Grupo",fields_in_card:"Campos en tarjeta",fields_label:"Campos",fields_on_bars:"Campos en barras",filter_by:"Filtrar por",sort_by:"Ordenar por",group_by_label:"Agrupar por",date_field_label:"Campo de fecha",cover_field_label:"Campo de portada",card_size_label:"Tama\xF1o de tarjeta",row_height_label:"Altura de fila",none_value:"Ninguno",no_value:"Sin valor",no_cover:"Ninguna",size_small:"Peque\xF1o",size_medium:"Mediano",size_large:"Grande",height_compact:"Compacto",height_medium:"Mediano",height_tall:"Alto",add_filter_advanced:"A\xF1adir filtro avanzado",add_sort:"A\xF1adir ordenaci\xF3n",no_active_sorts:"Sin ordenaciones activas",name_column:"Nombre",conjunction_and:"Y",conjunction_or:"O",filter_number_placeholder:"N\xFAmero...",filter_value_placeholder:"Valor...",delete_selected:"Eliminar todos los seleccionados",move_selected:"Mover todos los seleccionados",duplicate_selected:"Duplicar todos los seleccionados",export_csv:"Exportar CSV",import_csv:"Importar CSV",open_note:"Abrir nota",delete_note:"Eliminar nota",duplicate_note:"Duplicar nota",sort_asc:"Ascendente",sort_desc:"Descendente",sort_asc_title:"Ordenar descendente",sort_desc_title:"Eliminar ordenaci\xF3n",sort_none_title:"Ordenar ascendente",rename_column:"Renombrar",edit_formula:"Editar f\xF3rmula",configure_lookup:"Configurar lookup",configure_relation:"Configurar relaci\xF3n",format_number:"Formatear n\xFAmero",configure_image_folder:"Configurar carpeta de im\xE1genes",field_type_label:"Tipo de campo",hide_field:"Ocultar campo",enable_wrap_text:"Ajustar texto",disable_wrap_text:"No ajustar texto",delete_field:"Eliminar campo",type_title:"T\xEDtulo",type_text:"Texto",type_number:"N\xFAmero",type_select:"Selecci\xF3n",type_multiselect:"Multi-selecci\xF3n",type_date:"Fecha",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"Tel\xE9fono",type_status:"Estado",type_formula:"F\xF3rmula",type_relation:"Relaci\xF3n",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurar rollup",rollup_select_relation:"1. Columna de relaci\xF3n",rollup_select_relation_placeholder:"Seleccionar relaci\xF3n...",rollup_select_target:"2. Columna de destino",rollup_select_target_placeholder:"Seleccionar columna...",rollup_select_function:"3. Agregaci\xF3n",rollup_no_relations:"No se encontraron columnas de relaci\xF3n. A\xF1ade una columna de relaci\xF3n primero.",rollup_fn_sum:"Suma",rollup_fn_count:"Contar",rollup_fn_avg:"Promedio",rollup_fn_min:"M\xEDn",rollup_fn_max:"M\xE1x",rollup_fn_count_values:"Contar \xFAnicos",rollup_fn_list:"Listar todo",type_image:"Imagen",type_audio:"Audio",audio_path_placeholder:"Ruta al archivo de audio...",audio_select_placeholder:"Seleccionar audio...",audio_picker_title:"Seleccionar audio",audio_picker_clear:"Limpiar",audio_picker_empty_folder:"No hay archivos de audio en la carpeta",audio_picker_empty_vault:"No hay archivos de audio en el vault",audio_panel_title:"Configuraci\xF3n de audio",audio_folder_label:"Carpeta de origen (dejar vac\xEDo para todo el vault)",audio_folder_placeholder:"Ej: audio/musica",configure_audio_folder:"Configurar carpeta de audio",type_video:"V\xEDdeo",video_select_placeholder:"Seleccionar v\xEDdeo...",video_picker_clear:"Limpiar",video_picker_empty_folder:"No hay archivos de v\xEDdeo en la carpeta",video_picker_empty_vault:"No hay archivos de v\xEDdeo en el vault",video_panel_title:"Configuraci\xF3n de v\xEDdeo",video_folder_label:"Carpeta de origen (dejar vac\xEDo para todo el vault)",video_folder_placeholder:"Ej: video/clips",configure_video_folder:"Configurar carpeta de v\xEDdeo",formula_panel_title:"F\xF3rmula",formula_placeholder:'Ejemplo: if(status = "done", 1, 0)',formula_valid:"Sintaxis v\xE1lida",formula_available_cols:"Columnas disponibles:",formula_ref_toggle:"Referencia de funciones",formula_save:"Guardar",formula_cancel:"Cancelar",formula_save_hint:"Guardar (Ctrl+Enter)",formula_group_logic:"L\xF3gica",formula_group_comparators:"Comparadores",formula_group_aggregators:"Agregadores",formula_group_text:"Texto",formula_group_math:"Matem\xE1ticas",formula_group_utils:"Utilidades",number_format_title:"Formato",number_decimals_label:"Decimales",number_thousands_label:"Separador de miles",number_prefix_label:"Prefijo",number_suffix_label:"Sufijo",number_prefix_placeholder:"Ej: $, \u20AC",number_suffix_placeholder:"Ej: %, kg, km",number_remove_format:"Eliminar formato",relation_panel_title:"Relaci\xF3n",lookup_panel_title:"Lookup",lookup_ref_table:"1. Tabla de referencia",lookup_select_table:"Seleccionar tabla...",lookup_col_to_display:"2. Columna a mostrar",lookup_origin_col:"2. Campo de origen de valores",lookup_select_col:"Seleccionar columna...",lookup_file_name:"Nombre de archivo",lookup_join_col:"3. Columna de uni\xF3n (esta tabla)",lookup_join_col_title:"Nombre de archivo (unir por t\xEDtulo)",lookup_select_join_col:"Seleccionar columna...",lookup_hint:"El valor de esta columna debe coincidir con el nombre de archivo en la tabla referenciada",image_panel_title:"Imagen",image_folder_label:"Carpeta de origen (opcional)",image_folder_placeholder:"Ej: images/covers",image_picker_title:"Seleccionar imagen",image_picker_clear:"Limpiar",image_picker_empty_vault:"No se encontraron im\xE1genes en el vault",image_picker_empty_folder:"No se encontraron im\xE1genes en",image_select_placeholder:"Seleccionar imagen\u2026",agg_none:"Ninguno",agg_count:"Contar",agg_count_values:"Contar valores",agg_sum:"Suma",agg_avg:"Promedio",agg_min:"M\xEDn",agg_max:"M\xE1x",no_database_open:"No hay base de datos abierta.",no_database_hint:'Usa el bot\xF3n de la barra lateral o el comando "crear nueva base de datos".',loading:"Cargando...",no_results:"No se encontraron elementos",item_singular:"Elemento",item_plural:"Elementos",row_singular:"Fila",row_plural:"Filas",record_singular:"Registro",record_plural:"Registros",add_row:"Nueva fila",add_entry:"Nueva entrada",add_card:"Nueva tarjeta",new_field:"Nuevo campo",add_field:"A\xF1adir campo",board_no_select_col:"El tablero requiere una columna de selecci\xF3n o estado para agrupar tarjetas.",board_add_select_hint:"A\xF1ade una columna de ese tipo en la vista de tabla y vuelve aqu\xED.",board_drag_reorder:"Arrastra para reordenar",board_set_limit:"Clic para definir limite de tarjetas",board_limit_placeholder:"Limite (0 = ninguno)",board_show_more:"Mas",board_show_less:"Mostrar menos",hide_empty_cols:"Ocultar vac\xEDas",hide_no_value_cols:"Ocultar sin valor",calendar_no_date_field:"Selecciona un campo de fecha en la barra de herramientas para mostrar el calendario.",calendar_no_date_section:"Sin fecha",calendar_click_to_create:"Clic para crear nota",calendar_today:"Hoy",calendar_prev_month:"Mes anterior",calendar_next_month:"Mes siguiente",calendar_view_month:"Mes",calendar_view_week:"Semana",calendar_prev_week:"Semana anterior",calendar_next_week:"Semana siguiente",calendar_add_time:"A\xF1adir hora",calendar_remove_time:"Quitar hora",calendar_all_day:"Todo el d\xEDa",day_sun:"Dom",day_mon:"Lun",day_tue:"Mar",day_wed:"Mi\xE9",day_thu:"Jue",day_fri:"Vie",day_sat:"S\xE1b",month_january:"Enero",month_february:"Febrero",month_march:"Marzo",month_april:"Abril",month_may:"Mayo",month_june:"Junio",month_july:"Julio",month_august:"Agosto",month_september:"Septiembre",month_october:"Octubre",month_november:"Noviembre",month_december:"Diciembre",timeline_no_start_field:"Selecciona un campo de inicio en la barra de herramientas para mostrar la l\xEDnea de tiempo.",timeline_no_interval:"Sin intervalo",timeline_scroll_prev:"Desplazar atr\xE1s",timeline_scroll_next:"Desplazar adelante",zoom_days:"D\xEDas",zoom_weeks:"Semanas",zoom_months:"Meses",month_short_jan:"Ene",month_short_feb:"Feb",month_short_mar:"Mar",month_short_apr:"Abr",month_short_may:"May",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ago",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"Dic",hierarchy_toggle:"Usar como jerarqu\xEDa",hierarchy_toggle_hint:"Habilita relaciones padre-hijo entre filas de esta base de datos",add_subrow:"A\xF1adir subfila",collapse_all:"Contraer todo",expand_all:"Expandir todo",max_depth_reached:"Profundidad m\xE1xima alcanzada (3 niveles)",chart_configure:"Configurar",chart_type:"Tipo de gr\xE1fico",chart_type_bar:"Barras",chart_type_line:"L\xEDneas",chart_type_pie:"Circular",chart_x_axis:"Categor\xEDas (eje X)",chart_y_axis:"Valores (eje Y)",chart_aggregation:"Agregaci\xF3n",chart_select_column:"Seleccionar columna...",chart_count_records:"Contar",chart_no_config:"Configura el gr\xE1fico para empezar.",chart_no_config_hint:"Selecciona una columna para categor\xEDas en la barra de herramientas de arriba.",tooltip_pin_column:"Fijar columnas hasta aqu\xED",tooltip_unpin_column:"Desfijar columnas",tooltip_resize_column:"Arrastra para redimensionar; doble clic para ajustar al contenido",tooltip_wrap_text:"Ajuste de texto",tooltip_include_subfolders:"Incluir subcarpetas",folder_column:"Carpeta",tooltip_manage_fields:"Gestionar campos",tooltip_batch_actions:"Acciones en lote",tooltip_remove_filter:"Eliminar filtro",hide_filters:"Ocultar filtros",show_filters:"Mostrar filtros",filters_count_one:"1 filtro",filters_count_other:"{n} filtros",tooltip_close:"Cerrar",tooltip_remove:"Eliminar",tooltip_move_up:"Mover arriba",tooltip_move_down:"Mover abajo",tooltip_change_color:"Cambiar color",tooltip_delete_status:"Eliminar estado",status_not_started:"No iniciado",status_in_progress:"En progreso",status_done:"Hecho",status_cancelled:"Cancelado",relation_search_placeholder:"Buscar...",relation_clear:"Limpiar",relation_no_results:"Sin resultados",relation_two_way:"Relaci\xF3n bidireccional",relation_two_way_hint:"Crea autom\xE1ticamente una relaci\xF3n inversa en la base de datos de destino",select_clear:"Limpiar",select_create_placeholder:"Crear nueva opci\xF3n...",status_new_placeholder:"Nuevo estado...",color_custom:"Personalizado",validate_non_numeric:'Celda(s) contienen valores no num\xE9ricos (ej: "',validate_invalid_dates:'Celda(s) contienen valores que no son fechas v\xE1lidas (ej: "',validate_invalid_checkbox:'Celda(s) contienen valores incompatibles con checkbox (ej: "',validate_multiselect_to_select:"Fila(s) tienen m\xFAltiples valores seleccionados. Elimina los extras antes de cambiar a selecci\xF3n \xFAnica.",validate_invalid_email:'Celda(s) contienen valores que no son emails v\xE1lidos (ej: "',validate_invalid_url:'Celda(s) contienen valores que no son URLs v\xE1lidas (ej: "',validate_invalid_phone:'Celda(s) contienen valores que no son tel\xE9fonos v\xE1lidos (ej: "',validate_type_change_prefix:"No se puede cambiar el tipo: ",email_invalid:"Email inv\xE1lido",op_is:"Es",op_is_not:"No es",op_contains:"Contiene",op_not_contains:"No contiene",op_starts_with:"Empieza con",op_ends_with:"Termina con",op_is_empty:"Est\xE1 vac\xEDo",op_is_not_empty:"No est\xE1 vac\xEDo",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est\xE1 marcado",op_is_unchecked:"No est\xE1 marcado",settings_db_filename_name:"Nombre del archivo de base de datos",settings_db_filename_desc:"Nombre del archivo especial que identifica una base de datos en una carpeta.",settings_row_height_name:"Altura de fila predeterminada",settings_row_height_desc:"Altura en p\xEDxeles de cada fila de la tabla.",settings_inline_fields_name:"Leer campos inline de dataview",settings_inline_fields_desc:"Interpreta campos key:: value del cuerpo de la nota y los muestra como valores de columna (solo lectura)",db_untitled_note:"Sin t\xEDtulo",db_copy_suffix:"(copia)",db_copy_suffix_n:"(copia $n)",db_already_exists:'Ya existe una base de datos en "$folder"',db_tip_body:"Este archivo es una base de datos. \xC1brelo para ver la vista de tabla.",formula_err_unclosed_string:"Cadena sin cerrar en posici\xF3n $pos",formula_err_unclosed_bracket:"Corchete sin cerrar en posici\xF3n $pos",formula_err_unexpected_bang:"Car\xE1cter inesperado '!' en posici\xF3n $pos",formula_err_unexpected_char:"Car\xE1cter inesperado '$char' en posici\xF3n $pos",formula_err_expected_token:"Se esperaba $expected, se encontr\xF3 '$found' en posici\xF3n $pos",formula_err_unexpected_token:"Token inesperado '$token' en posici\xF3n $pos",formula_err_circular_ref:'Referencia circular: "$name" es una columna f\xF3rmula',formula_err_unknown_fn:"Funci\xF3n desconocida: $fn()",formula_err_if_args:"Expected if(condition, if_true, [if_false])",formula_err_avg_args:"Se espera avg(columna) \u2014 requiere referencia de columna como argumento",formula_err_count_args:"Se espera count(columna) \u2014 requiere referencia de columna como argumento",formula_err_mid_args:"Se espera mid(texto, inicio, longitud)",formula_err_mod_args:"Se espera mod(n\xFAmero, divisor)",formula_err_sqrt_args:"Se espera sqrt(n\xFAmero)",formula_err_not_implemented:"Funci\xF3n no implementada: $fn()",plugin_display_name:"Notion bases",no_databases_found:'No se encontraron bases de datos. Usa el comando "crear nueva base de datos" para crear una.',cmd_open_database:"Abrir base de datos de esta carpeta",cmd_create_database:"Crear nueva base de datos en la carpeta actual",ctx_create_database:"Crear base de datos aqu\xED",arr_settings_title:"Organizaci\xF3n por carpetas",arr_settings_desc:"Mueve autom\xE1ticamente los archivos de fila a subcarpetas anidadas seg\xFAn los valores de las propiedades seleccionadas, en orden.",arr_settings_enabled_name:"Activar organizaci\xF3n por carpetas",arr_settings_enabled_desc:"Cuando est\xE1 activado, las filas se mueven en cuanto cambia una de las propiedades seleccionadas. Desactivado por defecto.",arr_settings_no_props:"No hay propiedades seleccionadas. A\xF1ade una a continuaci\xF3n para definir la jerarqu\xEDa de carpetas.",arr_settings_no_candidates:"No hay columnas elegibles. La organizaci\xF3n por carpetas admite columnas de texto, selecci\xF3n, estado y fecha.",arr_settings_add_placeholder:"Seleccionar una propiedad...",arr_settings_add_btn:"A\xF1adir",arr_settings_preview_btn:"Previsualizar y aplicar a filas existentes",arr_preview_title:"Previsualizaci\xF3n de la organizaci\xF3n por carpetas",arr_preview_empty:"No hay filas que mover.",arr_preview_desc:"$count fila(s) ser\xE1n movidas:",arr_preview_apply:"Aplicar",arr_preview_cancel:"Cancelar",arr_preview_applied:"$count fila(s) movida(s).",cmd_quick_add:"A\xF1adir fila r\xE1pidamente a la base de datos",quick_add_title:"A\xF1adir r\xE1pido",quick_add_note_title:"T\xEDtulo",quick_add_note_title_placeholder:"T\xEDtulo de la nota...",quick_add_create:"Crear",quick_add_create_and_open:"Crear y abrir",quick_add_no_visible_fields:"No hay campos editables en esta base de datos",picker_placeholder:"Seleccionar base de datos...",picker_root:"/ (Ra\xEDz)",view_fallback_name:"Base de datos",saving:"Guardando",saved:"Guardado",save_error:"Error al guardar",settings_page_size_name:"Filas por p\xE1gina",settings_page_size_desc:'N\xFAmero de filas a mostrar por p\xE1gina. Establece "Todas" para desplazamiento continuo',settings_page_size_all:"Todas (desplazamiento continuo)",page_of:"P\xE1gina {current} de {total}",first_page:"Primera p\xE1gina",last_page:"\xDAltima p\xE1gina",prev_page:"P\xE1gina anterior",next_page:"P\xE1gina siguiente",conditional_formatting:"Formato condicional",no_conditional_formats:"Sin reglas todav\xEDa",add_rule:"A\xF1adir regla",select_value:"Selecciona un valor",style:"Estilo",background:"Fondo",text_color:"Color de texto",save:"Guardar",cancel:"Cancelar",value:"Valor",db_settings_open:"Configuraci\xF3n de la base de datos",db_settings_title:"Configuraci\xF3n de la base de datos",db_settings_template_name:"Plantilla de fila",db_settings_template_desc:"Aplica esta plantilla al cuerpo de cada nueva fila creada en esta base de datos.",db_settings_template_choose:"Elegir plantilla",db_settings_template_clear:"Quitar plantilla",db_settings_template_none:"Sin plantilla seleccionada",db_settings_ask_name:"Pedir plantilla al crear",db_settings_ask_desc:"Solicitar una plantilla cada vez que se a\xF1ada una nueva fila en lugar de aplicar la predeterminada.",template_picker_placeholder:"Elige una plantilla...",template_picker_none:"Sin plantilla (cuerpo vac\xEDo)"},qm=iy;var ay={view_table:"Tableau",view_list:"Liste",view_board:"Tableau Kanban",view_gallery:"Galerie",view_calendar:"Calendrier",view_timeline:"Chronologie",view_chart:"Graphique",add_view:"Ajouter une vue",remove_view:"Supprimer la vue",rename_view_hint:"Double-cliquez pour renommer",fields:"Champs",filter:"Filtre",filters:"Filtres",sort:"Trier",actions:"Actions",group_by:"Grouper par",cover:"Couverture",date_field:"Date",start_field:"D\xE9but",end_field:"Fin",group_field:"Groupe",fields_in_card:"Champs dans la carte",fields_label:"Champs",fields_on_bars:"Champs sur les barres",filter_by:"Filtrer par",sort_by:"Trier par",group_by_label:"Grouper par",date_field_label:"Champ de date",cover_field_label:"Champ de couverture",card_size_label:"Taille de carte",row_height_label:"Hauteur de ligne",none_value:"Aucun",no_value:"Sans valeur",no_cover:"Aucune",size_small:"Petit",size_medium:"Moyen",size_large:"Grand",height_compact:"Compact",height_medium:"Moyen",height_tall:"Grand",add_filter_advanced:"Ajouter un filtre avanc\xE9",add_sort:"Ajouter un tri",no_active_sorts:"Aucun tri actif",name_column:"Nom",conjunction_and:"ET",conjunction_or:"OU",filter_number_placeholder:"Nombre...",filter_value_placeholder:"Valeur...",delete_selected:"Supprimer tous les s\xE9lectionn\xE9s",move_selected:"D\xE9placer tous les s\xE9lectionn\xE9s",duplicate_selected:"Dupliquer tous les s\xE9lectionn\xE9s",export_csv:"Exporter CSV",import_csv:"Importer CSV",open_note:"Ouvrir la note",delete_note:"Supprimer la note",duplicate_note:"Dupliquer la note",sort_asc:"Croissant",sort_desc:"D\xE9croissant",sort_asc_title:"Trier d\xE9croissant",sort_desc_title:"Supprimer le tri",sort_none_title:"Trier croissant",rename_column:"Renommer",edit_formula:"Modifier la formule",configure_lookup:"Configurer le lookup",configure_relation:"Configurer la relation",format_number:"Formater le nombre",configure_image_folder:"Configurer le dossier d'images",field_type_label:"Type de champ",hide_field:"Masquer le champ",enable_wrap_text:"Retour \xE0 la ligne",disable_wrap_text:"D\xE9sactiver le retour \xE0 la ligne",delete_field:"Supprimer le champ",type_title:"Titre",type_text:"Texte",type_number:"Nombre",type_select:"S\xE9lection",type_multiselect:"Multi-s\xE9lection",type_date:"Date",type_checkbox:"Checkbox",type_url:"URL",type_email:"Email",type_phone:"T\xE9l\xE9phone",type_status:"Statut",type_formula:"Formule",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Configurer le rollup",rollup_select_relation:"1. Colonne de relation",rollup_select_relation_placeholder:"S\xE9lectionner une relation...",rollup_select_target:"2. Colonne cible",rollup_select_target_placeholder:"S\xE9lectionner une colonne...",rollup_select_function:"3. Agr\xE9gation",rollup_no_relations:"Aucune colonne de relation trouv\xE9e. Ajoutez d'abord une colonne de relation.",rollup_fn_sum:"Somme",rollup_fn_count:"Compter",rollup_fn_avg:"Moyenne",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Compter les uniques",rollup_fn_list:"Tout lister",type_image:"Image",type_audio:"Audio",audio_path_placeholder:"Chemin vers le fichier audio...",audio_select_placeholder:"S\xE9lectionner un audio...",audio_picker_title:"S\xE9lectionner un audio",audio_picker_clear:"Effacer",audio_picker_empty_folder:"Aucun fichier audio dans le dossier",audio_picker_empty_vault:"Aucun fichier audio dans le vault",audio_panel_title:"Param\xE8tres audio",audio_folder_label:"Dossier source (laisser vide pour tout le vault)",audio_folder_placeholder:"Ex : audio/musique",configure_audio_folder:"Configurer le dossier audio",type_video:"Vid\xE9o",video_select_placeholder:"S\xE9lectionner une vid\xE9o...",video_picker_clear:"Effacer",video_picker_empty_folder:"Aucun fichier vid\xE9o dans le dossier",video_picker_empty_vault:"Aucun fichier vid\xE9o dans le vault",video_panel_title:"Param\xE8tres vid\xE9o",video_folder_label:"Dossier source (laisser vide pour tout le vault)",video_folder_placeholder:"Ex : video/clips",configure_video_folder:"Configurer le dossier vid\xE9o",formula_panel_title:"Formule",formula_placeholder:'Exemple : if(status = "done", 1, 0)',formula_valid:"Syntaxe valide",formula_available_cols:"Colonnes disponibles :",formula_ref_toggle:"R\xE9f\xE9rence des fonctions",formula_save:"Enregistrer",formula_cancel:"Annuler",formula_save_hint:"Enregistrer (Ctrl+Entr\xE9e)",formula_group_logic:"Logique",formula_group_comparators:"Comparateurs",formula_group_aggregators:"Agr\xE9gateurs",formula_group_text:"Texte",formula_group_math:"Math\xE9matiques",formula_group_utils:"Utilitaires",number_format_title:"Format",number_decimals_label:"D\xE9cimales",number_thousands_label:"S\xE9parateur de milliers",number_prefix_label:"Pr\xE9fixe",number_suffix_label:"Suffixe",number_prefix_placeholder:"Ex : $, \u20AC",number_suffix_placeholder:"Ex : %, kg, km",number_remove_format:"Supprimer le format",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Table de r\xE9f\xE9rence",lookup_select_table:"S\xE9lectionner une table...",lookup_col_to_display:"2. Colonne \xE0 afficher",lookup_origin_col:"2. Champ source des valeurs",lookup_select_col:"S\xE9lectionner une colonne...",lookup_file_name:"Nom du fichier",lookup_join_col:"3. Colonne de jointure (cette table)",lookup_join_col_title:"Nom du fichier (jointure par titre)",lookup_select_join_col:"S\xE9lectionner une colonne...",lookup_hint:"La valeur de cette colonne doit correspondre au nom du fichier dans la table r\xE9f\xE9renc\xE9e",image_panel_title:"Image",image_folder_label:"Dossier source (optionnel)",image_folder_placeholder:"Ex : images/covers",image_picker_title:"S\xE9lectionner une image",image_picker_clear:"Effacer",image_picker_empty_vault:"Aucune image trouv\xE9e dans le vault",image_picker_empty_folder:"Aucune image trouv\xE9e dans",image_select_placeholder:"S\xE9lectionner une image\u2026",agg_none:"Aucun",agg_count:"Compter",agg_count_values:"Compter les valeurs",agg_sum:"Somme",agg_avg:"Moyenne",agg_min:"Min",agg_max:"Max",no_database_open:"Aucune base de donn\xE9es ouverte.",no_database_hint:'Utilisez le bouton du ruban ou la commande "cr\xE9er une nouvelle base de donn\xE9es".',loading:"Chargement...",no_results:"Aucun \xE9l\xE9ment trouv\xE9",item_singular:"\xC9l\xE9ment",item_plural:"\xC9l\xE9ments",row_singular:"Ligne",row_plural:"Lignes",record_singular:"Enregistrement",record_plural:"Enregistrements",add_row:"Nouvelle ligne",add_entry:"Nouvelle entr\xE9e",add_card:"Nouvelle carte",new_field:"Nouveau champ",add_field:"Ajouter un champ",board_no_select_col:"Le tableau n\xE9cessite une colonne de s\xE9lection ou de statut pour grouper les cartes.",board_add_select_hint:"Ajoutez une colonne de ce type dans la vue tableau et revenez ici.",board_drag_reorder:"Glisser pour r\xE9organiser",board_set_limit:"Cliquer pour definir la limite de cartes",board_limit_placeholder:"Limite (0 = aucune)",board_show_more:"De plus",board_show_less:"Afficher moins",hide_empty_cols:"Masquer vides",hide_no_value_cols:"Masquer sans valeur",calendar_no_date_field:"S\xE9lectionnez un champ de date dans la barre d'outils pour afficher le calendrier.",calendar_no_date_section:"Sans date",calendar_click_to_create:"Cliquez pour cr\xE9er une note",calendar_today:"Aujourd'hui",calendar_prev_month:"Mois pr\xE9c\xE9dent",calendar_next_month:"Mois suivant",calendar_view_month:"Mois",calendar_view_week:"Semaine",calendar_prev_week:"Semaine pr\xE9c\xE9dente",calendar_next_week:"Semaine suivante",calendar_add_time:"Ajouter une heure",calendar_remove_time:"Supprimer l'heure",calendar_all_day:"Toute la journ\xE9e",day_sun:"Dim",day_mon:"Lun",day_tue:"Mar",day_wed:"Mer",day_thu:"Jeu",day_fri:"Ven",day_sat:"Sam",month_january:"Janvier",month_february:"F\xE9vrier",month_march:"Mars",month_april:"Avril",month_may:"Mai",month_june:"Juin",month_july:"Juillet",month_august:"Ao\xFBt",month_september:"Septembre",month_october:"Octobre",month_november:"Novembre",month_december:"D\xE9cembre",timeline_no_start_field:"S\xE9lectionnez un champ de d\xE9but dans la barre d'outils pour afficher la chronologie.",timeline_no_interval:"Sans intervalle",timeline_scroll_prev:"D\xE9filer en arri\xE8re",timeline_scroll_next:"D\xE9filer en avant",zoom_days:"Jours",zoom_weeks:"Semaines",zoom_months:"Mois",month_short_jan:"Jan",month_short_feb:"F\xE9v",month_short_mar:"Mar",month_short_apr:"Avr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Ao\xFB",month_short_sep:"Sep",month_short_oct:"Oct",month_short_nov:"Nov",month_short_dec:"D\xE9c",hierarchy_toggle:"Utiliser comme hi\xE9rarchie",hierarchy_toggle_hint:"Active les relations parent-enfant entre les lignes de cette base de donn\xE9es",add_subrow:"Ajouter une sous-ligne",collapse_all:"Tout r\xE9duire",expand_all:"Tout d\xE9velopper",max_depth_reached:"Profondeur maximale atteinte (3 niveaux)",chart_configure:"Configurer",chart_type:"Type de graphique",chart_type_bar:"Barres",chart_type_line:"Courbes",chart_type_pie:"Camembert",chart_x_axis:"Cat\xE9gories (axe X)",chart_y_axis:"Valeurs (axe Y)",chart_aggregation:"Agr\xE9gation",chart_select_column:"S\xE9lectionner une colonne...",chart_count_records:"Compter",chart_no_config:"Configurez le graphique pour commencer.",chart_no_config_hint:"S\xE9lectionnez une colonne pour les cat\xE9gories dans la barre d'outils ci-dessus.",tooltip_pin_column:"Fixer les colonnes jusqu'ici",tooltip_unpin_column:"D\xE9tacher les colonnes",tooltip_resize_column:"Glisser pour redimensionner ; double-clic pour ajuster au contenu",tooltip_wrap_text:"Retour \xE0 la ligne",tooltip_include_subfolders:"Inclure les sous-dossiers",folder_column:"Dossier",tooltip_manage_fields:"G\xE9rer les champs",tooltip_batch_actions:"Actions group\xE9es",tooltip_remove_filter:"Supprimer le filtre",hide_filters:"Masquer les filtres",show_filters:"Afficher les filtres",filters_count_one:"1 filtre",filters_count_other:"{n} filtres",tooltip_close:"Fermer",tooltip_remove:"Supprimer",tooltip_move_up:"Monter",tooltip_move_down:"Descendre",tooltip_change_color:"Changer la couleur",tooltip_delete_status:"Supprimer le statut",status_not_started:"Non commenc\xE9",status_in_progress:"En cours",status_done:"Termin\xE9",status_cancelled:"Annul\xE9",relation_search_placeholder:"Rechercher...",relation_clear:"Effacer",relation_no_results:"Aucun r\xE9sultat",relation_two_way:"Relation bidirectionnelle",relation_two_way_hint:"Cr\xE9e automatiquement une relation inverse dans la base de donn\xE9es cible",select_clear:"Effacer",select_create_placeholder:"Cr\xE9er une nouvelle option...",status_new_placeholder:"Nouveau statut...",color_custom:"Personnalis\xE9e",validate_non_numeric:'Cellule(s) contiennent des valeurs non num\xE9riques (ex : "',validate_invalid_dates:'Cellule(s) contiennent des valeurs qui ne sont pas des dates valides (ex : "',validate_invalid_checkbox:'Cellule(s) contiennent des valeurs incompatibles avec checkbox (ex : "',validate_multiselect_to_select:"Ligne(s) ont plusieurs valeurs s\xE9lectionn\xE9es. Supprimez les extras avant de passer en s\xE9lection unique.",validate_invalid_email:'Cellule(s) contiennent des valeurs qui ne sont pas des emails valides (ex : "',validate_invalid_url:'Cellule(s) contiennent des valeurs qui ne sont pas des URLs valides (ex : "',validate_invalid_phone:'Cellule(s) contiennent des valeurs qui ne sont pas des num\xE9ros de t\xE9l\xE9phone valides (ex : "',validate_type_change_prefix:"Impossible de changer le type : ",email_invalid:"Email invalide",op_is:"Est",op_is_not:"N'est pas",op_contains:"Contient",op_not_contains:"Ne contient pas",op_starts_with:"Commence par",op_ends_with:"Finit par",op_is_empty:"Est vide",op_is_not_empty:"N'est pas vide",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Est coch\xE9",op_is_unchecked:"N'est pas coch\xE9",settings_db_filename_name:"Nom du fichier de base de donn\xE9es",settings_db_filename_desc:"Nom du fichier sp\xE9cial qui identifie une base de donn\xE9es dans un dossier.",settings_row_height_name:"Hauteur de ligne par d\xE9faut",settings_row_height_desc:"Hauteur en pixels de chaque ligne du tableau.",settings_inline_fields_name:"Lire les champs inline dataview",settings_inline_fields_desc:"Analyse les champs key:: value dans le corps de la note et les affiche comme valeurs de colonne (lecture seule)",db_untitled_note:"Sans titre",db_copy_suffix:"(copie)",db_copy_suffix_n:"(copie $n)",db_already_exists:'Une base de donn\xE9es existe d\xE9j\xE0 dans "$folder"',db_tip_body:"Ce fichier est une base de donn\xE9es. Ouvrez-le pour voir la vue tableau.",formula_err_unclosed_string:"Cha\xEEne non ferm\xE9e \xE0 la position $pos",formula_err_unclosed_bracket:"Crochet non ferm\xE9 \xE0 la position $pos",formula_err_unexpected_bang:"Caract\xE8re inattendu '!' \xE0 la position $pos",formula_err_unexpected_char:"Caract\xE8re inattendu '$char' \xE0 la position $pos",formula_err_expected_token:"Attendu $expected, trouv\xE9 '$found' \xE0 la position $pos",formula_err_unexpected_token:"Token inattendu '$token' \xE0 la position $pos",formula_err_circular_ref:'R\xE9f\xE9rence circulaire : "$name" est une colonne formule',formula_err_unknown_fn:"Fonction inconnue : $fn()",formula_err_if_args:"Attendu if(condition, si_vrai, [si_faux])",formula_err_avg_args:"Attendu avg(colonne) \u2014 n\xE9cessite une r\xE9f\xE9rence de colonne",formula_err_count_args:"Attendu count(colonne) \u2014 n\xE9cessite une r\xE9f\xE9rence de colonne",formula_err_mid_args:"Attendu mid(texte, d\xE9but, longueur)",formula_err_mod_args:"Attendu mod(nombre, diviseur)",formula_err_sqrt_args:"Attendu sqrt(nombre)",formula_err_not_implemented:"Fonction non impl\xE9ment\xE9e : $fn()",plugin_display_name:"Notion bases",no_databases_found:'Aucune base de donn\xE9es trouv\xE9e. Utilisez la commande "cr\xE9er une nouvelle base de donn\xE9es" pour en cr\xE9er une.',cmd_open_database:"Ouvrir la base de donn\xE9es de ce dossier",cmd_create_database:"Cr\xE9er une nouvelle base de donn\xE9es dans le dossier actuel",ctx_create_database:"Cr\xE9er une base de donn\xE9es ici",arr_settings_title:"Organisation par dossiers",arr_settings_desc:"D\xE9place automatiquement les fichiers de ligne dans des sous-dossiers imbriqu\xE9s selon les valeurs des propri\xE9t\xE9s s\xE9lectionn\xE9es, dans l'ordre.",arr_settings_enabled_name:"Activer l'organisation par dossiers",arr_settings_enabled_desc:"Quand activ\xE9, les lignes sont d\xE9plac\xE9es d\xE8s qu'une des propri\xE9t\xE9s s\xE9lectionn\xE9es change. D\xE9sactiv\xE9 par d\xE9faut.",arr_settings_no_props:"Aucune propri\xE9t\xE9 s\xE9lectionn\xE9e. Ajoutez-en une ci-dessous pour d\xE9finir la hi\xE9rarchie de dossiers.",arr_settings_no_candidates:"Aucune colonne \xE9ligible. L'organisation par dossiers prend en charge les colonnes de texte, s\xE9lection, statut et date.",arr_settings_add_placeholder:"S\xE9lectionner une propri\xE9t\xE9...",arr_settings_add_btn:"Ajouter",arr_settings_preview_btn:"Aper\xE7u et application aux lignes existantes",arr_preview_title:"Aper\xE7u de l'organisation par dossiers",arr_preview_empty:"Aucune ligne ne doit \xEAtre d\xE9plac\xE9e.",arr_preview_desc:"$count ligne(s) seront d\xE9plac\xE9es :",arr_preview_apply:"Appliquer",arr_preview_cancel:"Annuler",arr_preview_applied:"$count ligne(s) d\xE9plac\xE9e(s).",cmd_quick_add:"Ajouter rapidement une ligne \xE0 la base de donn\xE9es",quick_add_title:"Ajout rapide",quick_add_note_title:"Titre",quick_add_note_title_placeholder:"Titre de la note...",quick_add_create:"Cr\xE9er",quick_add_create_and_open:"Cr\xE9er et ouvrir",quick_add_no_visible_fields:"Aucun champ modifiable dans cette base de donn\xE9es",picker_placeholder:"S\xE9lectionner une base de donn\xE9es...",picker_root:"/ (Racine)",view_fallback_name:"Base de donn\xE9es",saving:"Enregistrement",saved:"Enregistr\xE9",save_error:"Erreur de sauvegarde",settings_page_size_name:"Lignes par page",settings_page_size_desc:'Nombre de lignes \xE0 afficher par page. D\xE9finissez "Toutes" pour le d\xE9filement continu',settings_page_size_all:"Toutes (d\xE9filement continu)",page_of:"Page {current} sur {total}",first_page:"Premi\xE8re page",last_page:"Derni\xE8re page",prev_page:"Page pr\xE9c\xE9dente",next_page:"Page suivante",conditional_formatting:"Mise en forme conditionnelle",no_conditional_formats:"Aucune r\xE8gle pour l'instant",add_rule:"Ajouter une r\xE8gle",select_value:"S\xE9lectionner une valeur",style:"Style",background:"Arri\xE8re-plan",text_color:"Couleur du texte",save:"Enregistrer",cancel:"Annuler",value:"Valeur",db_settings_open:"Param\xE8tres de la base de donn\xE9es",db_settings_title:"Param\xE8tres de la base de donn\xE9es",db_settings_template_name:"Mod\xE8le de ligne",db_settings_template_desc:"Applique ce mod\xE8le au corps de chaque nouvelle ligne cr\xE9\xE9e dans cette base de donn\xE9es.",db_settings_template_choose:"Choisir un mod\xE8le",db_settings_template_clear:"Effacer le mod\xE8le",db_settings_template_none:"Aucun mod\xE8le s\xE9lectionn\xE9",db_settings_ask_name:"Demander un mod\xE8le \xE0 la cr\xE9ation",db_settings_ask_desc:"Demander un mod\xE8le \xE0 chaque ajout de ligne au lieu d'appliquer celui par d\xE9faut.",template_picker_placeholder:"Choisir un mod\xE8le...",template_picker_none:"Aucun mod\xE8le (corps vide)"},Km=ay;var ly={view_table:"Tabelle",view_list:"Liste",view_board:"Board",view_gallery:"Galerie",view_calendar:"Kalender",view_timeline:"Zeitleiste",view_chart:"Diagramm",add_view:"Ansicht hinzuf\xFCgen",remove_view:"Ansicht entfernen",rename_view_hint:"Doppelklick zum Umbenennen",fields:"Felder",filter:"Filter",filters:"Filter",sort:"Sortieren",actions:"Aktionen",group_by:"Gruppieren nach",cover:"Titelbild",date_field:"Datum",start_field:"Start",end_field:"Ende",group_field:"Gruppe",fields_in_card:"Felder in der Karte",fields_label:"Felder",fields_on_bars:"Felder auf Balken",filter_by:"Filtern nach",sort_by:"Sortieren nach",group_by_label:"Gruppieren nach",date_field_label:"Datumsfeld",cover_field_label:"Titelbildfeld",card_size_label:"Kartengr\xF6\xDFe",row_height_label:"Zeilenh\xF6he",none_value:"Keine",no_value:"Kein Wert",no_cover:"Keine",size_small:"Klein",size_medium:"Mittel",size_large:"Gro\xDF",height_compact:"Kompakt",height_medium:"Mittel",height_tall:"Gro\xDF",add_filter_advanced:"Erweiterten Filter hinzuf\xFCgen",add_sort:"Sortierung hinzuf\xFCgen",no_active_sorts:"Keine aktiven Sortierungen",name_column:"Name",conjunction_and:"UND",conjunction_or:"ODER",filter_number_placeholder:"Zahl...",filter_value_placeholder:"Wert...",delete_selected:"Alle ausgew\xE4hlten l\xF6schen",move_selected:"Alle ausgew\xE4hlten verschieben",duplicate_selected:"Alle ausgew\xE4hlten duplizieren",export_csv:"CSV exportieren",import_csv:"CSV importieren",open_note:"Notiz \xF6ffnen",delete_note:"Notiz l\xF6schen",duplicate_note:"Notiz duplizieren",sort_asc:"Aufsteigend",sort_desc:"Absteigend",sort_asc_title:"Absteigend sortieren",sort_desc_title:"Sortierung entfernen",sort_none_title:"Aufsteigend sortieren",rename_column:"Umbenennen",edit_formula:"Formel bearbeiten",configure_lookup:"Lookup konfigurieren",configure_relation:"Relation konfigurieren",format_number:"Zahl formatieren",configure_image_folder:"Bildordner konfigurieren",field_type_label:"Feldtyp",hide_field:"Feld ausblenden",enable_wrap_text:"Text umbrechen",disable_wrap_text:"Umbruch deaktivieren",delete_field:"Feld l\xF6schen",type_title:"Titel",type_text:"Text",type_number:"Zahl",type_select:"Auswahl",type_multiselect:"Mehrfachauswahl",type_date:"Datum",type_checkbox:"Checkbox",type_url:"URL",type_email:"E-Mail",type_phone:"Telefon",type_status:"Status",type_formula:"Formel",type_relation:"Relation",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Rollup konfigurieren",rollup_select_relation:"1. Relationsspalte",rollup_select_relation_placeholder:"Relation ausw\xE4hlen...",rollup_select_target:"2. Zielspalte",rollup_select_target_placeholder:"Spalte ausw\xE4hlen...",rollup_select_function:"3. Aggregation",rollup_no_relations:"Keine Relationsspalten gefunden. F\xFCgen Sie zuerst eine Relationsspalte hinzu.",rollup_fn_sum:"Summe",rollup_fn_count:"Anzahl",rollup_fn_avg:"Durchschnitt",rollup_fn_min:"Min",rollup_fn_max:"Max",rollup_fn_count_values:"Eindeutige z\xE4hlen",rollup_fn_list:"Alle auflisten",type_image:"Bild",type_audio:"Audio",audio_path_placeholder:"Pfad zur Audiodatei...",audio_select_placeholder:"Audio ausw\xE4hlen...",audio_picker_title:"Audio ausw\xE4hlen",audio_picker_clear:"L\xF6schen",audio_picker_empty_folder:"Keine Audiodateien im Ordner",audio_picker_empty_vault:"Keine Audiodateien im Vault",audio_panel_title:"Audioeinstellungen",audio_folder_label:"Quellordner (leer lassen f\xFCr den gesamten Vault)",audio_folder_placeholder:"Z.B.: audio/musik",configure_audio_folder:"Audioordner konfigurieren",type_video:"Video",video_select_placeholder:"Video ausw\xE4hlen...",video_picker_clear:"L\xF6schen",video_picker_empty_folder:"Keine Videodateien im Ordner",video_picker_empty_vault:"Keine Videodateien im Vault",video_panel_title:"Videoeinstellungen",video_folder_label:"Quellordner (leer lassen f\xFCr den gesamten Vault)",video_folder_placeholder:"Z.B.: video/clips",configure_video_folder:"Videoordner konfigurieren",formula_panel_title:"Formel",formula_placeholder:'Beispiel: if(status = "done", 1, 0)',formula_valid:"G\xFCltige Syntax",formula_available_cols:"Verf\xFCgbare Spalten:",formula_ref_toggle:"Funktionsreferenz",formula_save:"Speichern",formula_cancel:"Abbrechen",formula_save_hint:"Speichern (Strg+Eingabe)",formula_group_logic:"Logik",formula_group_comparators:"Vergleiche",formula_group_aggregators:"Aggregatoren",formula_group_text:"Text",formula_group_math:"Mathematik",formula_group_utils:"Hilfsfunktionen",number_format_title:"Format",number_decimals_label:"Dezimalstellen",number_thousands_label:"Tausendertrennzeichen",number_prefix_label:"Pr\xE4fix",number_suffix_label:"Suffix",number_prefix_placeholder:"Z.B.: $, \u20AC",number_suffix_placeholder:"Z.B.: %, kg, km",number_remove_format:"Formatierung entfernen",relation_panel_title:"Relation",lookup_panel_title:"Lookup",lookup_ref_table:"1. Referenztabelle",lookup_select_table:"Tabelle ausw\xE4hlen...",lookup_col_to_display:"2. Anzuzeigende Spalte",lookup_origin_col:"2. Quellfeld f\xFCr Werte",lookup_select_col:"Spalte ausw\xE4hlen...",lookup_file_name:"Dateiname",lookup_join_col:"3. Verkn\xFCpfungsspalte (diese Tabelle)",lookup_join_col_title:"Dateiname (Verkn\xFCpfung nach Titel)",lookup_select_join_col:"Spalte ausw\xE4hlen...",lookup_hint:"Der Wert dieser Spalte muss mit dem Dateinamen in der referenzierten Tabelle \xFCbereinstimmen",image_panel_title:"Bild",image_folder_label:"Quellordner (optional)",image_folder_placeholder:"Z.B.: images/covers",image_picker_title:"Bild ausw\xE4hlen",image_picker_clear:"L\xF6schen",image_picker_empty_vault:"Keine Bilder im Vault gefunden",image_picker_empty_folder:"Keine Bilder gefunden in",image_select_placeholder:"Bild ausw\xE4hlen\u2026",agg_none:"Keine",agg_count:"Anzahl",agg_count_values:"Werte z\xE4hlen",agg_sum:"Summe",agg_avg:"Durchschnitt",agg_min:"Min",agg_max:"Max",no_database_open:"Keine Datenbank ge\xF6ffnet.",no_database_hint:'Verwenden Sie die Schaltfl\xE4che in der Leiste oder den Befehl "Neue Datenbank erstellen".',loading:"Laden...",no_results:"Keine Eintr\xE4ge gefunden",item_singular:"Element",item_plural:"Elemente",row_singular:"Zeile",row_plural:"Zeilen",record_singular:"Datensatz",record_plural:"Datens\xE4tze",add_row:"Neue Zeile",add_entry:"Neuer Eintrag",add_card:"Neue Karte",new_field:"Neues Feld",add_field:"Feld hinzuf\xFCgen",board_no_select_col:"Das Board ben\xF6tigt eine Auswahl- oder Statusspalte zum Gruppieren der Karten.",board_add_select_hint:"F\xFCgen Sie eine Spalte dieses Typs in der Tabellenansicht hinzu und kehren Sie hierher zur\xFCck.",board_drag_reorder:"Ziehen zum Neuordnen",board_set_limit:"Klicken um Kartenlimit zu setzen",board_limit_placeholder:"Limit (0 = kein)",board_show_more:"Mehr",board_show_less:"Weniger anzeigen",hide_empty_cols:"Leere ausblenden",hide_no_value_cols:"Ohne Wert ausblenden",calendar_no_date_field:"W\xE4hlen Sie ein Datumsfeld in der Symbolleiste aus, um den Kalender anzuzeigen.",calendar_no_date_section:"Ohne Datum",calendar_click_to_create:"Klicken zum Erstellen einer Notiz",calendar_today:"Heute",calendar_prev_month:"Vorheriger Monat",calendar_next_month:"N\xE4chster Monat",calendar_view_month:"Monat",calendar_view_week:"Woche",calendar_prev_week:"Vorherige Woche",calendar_next_week:"N\xE4chste Woche",calendar_add_time:"Uhrzeit hinzuf\xFCgen",calendar_remove_time:"Uhrzeit entfernen",calendar_all_day:"Ganzt\xE4gig",day_sun:"So",day_mon:"Mo",day_tue:"Di",day_wed:"Mi",day_thu:"Do",day_fri:"Fr",day_sat:"Sa",month_january:"Januar",month_february:"Februar",month_march:"M\xE4rz",month_april:"April",month_may:"Mai",month_june:"Juni",month_july:"Juli",month_august:"August",month_september:"September",month_october:"Oktober",month_november:"November",month_december:"Dezember",timeline_no_start_field:"W\xE4hlen Sie ein Startfeld in der Symbolleiste aus, um die Zeitleiste anzuzeigen.",timeline_no_interval:"Kein Intervall",timeline_scroll_prev:"Zur\xFCck scrollen",timeline_scroll_next:"Vorw\xE4rts scrollen",zoom_days:"Tage",zoom_weeks:"Wochen",zoom_months:"Monate",month_short_jan:"Jan",month_short_feb:"Feb",month_short_mar:"M\xE4r",month_short_apr:"Apr",month_short_may:"Mai",month_short_jun:"Jun",month_short_jul:"Jul",month_short_aug:"Aug",month_short_sep:"Sep",month_short_oct:"Okt",month_short_nov:"Nov",month_short_dec:"Dez",hierarchy_toggle:"Als hierarchie verwenden",hierarchy_toggle_hint:"Erm\xF6glicht Eltern-Kind-Beziehungen zwischen Zeilen in dieser Datenbank",add_subrow:"Unterzeile hinzuf\xFCgen",collapse_all:"Alle einklappen",expand_all:"Alle ausklappen",max_depth_reached:"Maximale tiefe erreicht (3 Ebenen)",chart_configure:"Konfigurieren",chart_type:"Diagrammtyp",chart_type_bar:"Balken",chart_type_line:"Linie",chart_type_pie:"Kreis",chart_x_axis:"Kategorien (X-Achse)",chart_y_axis:"Werte (Y-Achse)",chart_aggregation:"Aggregation",chart_select_column:"Spalte ausw\xE4hlen...",chart_count_records:"Anzahl",chart_no_config:"Konfigurieren Sie das Diagramm, um zu beginnen.",chart_no_config_hint:"W\xE4hlen Sie oben in der Symbolleiste eine Spalte f\xFCr Kategorien aus.",tooltip_pin_column:"Spalten bis hier fixieren",tooltip_unpin_column:"Spalten l\xF6sen",tooltip_resize_column:"Ziehen zum \xC4ndern der Gr\xF6\xDFe; Doppelklick zum Anpassen",tooltip_wrap_text:"Textumbruch",tooltip_include_subfolders:"Unterordner einbeziehen",folder_column:"Ordner",tooltip_manage_fields:"Felder verwalten",tooltip_batch_actions:"Stapelaktionen",tooltip_remove_filter:"Filter entfernen",hide_filters:"Filter ausblenden",show_filters:"Filter anzeigen",filters_count_one:"1 filter",filters_count_other:"{n} filter",tooltip_close:"Schlie\xDFen",tooltip_remove:"Entfernen",tooltip_move_up:"Nach oben",tooltip_move_down:"Nach unten",tooltip_change_color:"Farbe \xE4ndern",tooltip_delete_status:"Status l\xF6schen",status_not_started:"Nicht begonnen",status_in_progress:"In Bearbeitung",status_done:"Erledigt",status_cancelled:"Abgebrochen",relation_search_placeholder:"Suchen...",relation_clear:"L\xF6schen",relation_no_results:"Keine Ergebnisse",relation_two_way:"Bidirektionale relation",relation_two_way_hint:"Erstellt automatisch eine umgekehrte Relation in der Zieldatenbank",select_clear:"L\xF6schen",select_create_placeholder:"Neue Option erstellen...",status_new_placeholder:"Neuer Status...",color_custom:"Benutzerdefiniert",validate_non_numeric:'Zelle(n) enthalten nicht-numerische Werte (z.B.: "',validate_invalid_dates:'Zelle(n) enthalten Werte, die keine g\xFCltigen Daten sind (z.B.: "',validate_invalid_checkbox:'Zelle(n) enthalten Werte, die mit Checkbox inkompatibel sind (z.B.: "',validate_multiselect_to_select:"Zeile(n) haben mehrere Werte ausgew\xE4hlt. Entfernen Sie die Extras, bevor Sie zur Einzelauswahl wechseln.",validate_invalid_email:'Zelle(n) enthalten Werte, die keine g\xFCltigen E-Mails sind (z.B.: "',validate_invalid_url:'Zelle(n) enthalten Werte, die keine g\xFCltigen URLs sind (z.B.: "',validate_invalid_phone:'Zelle(n) enthalten Werte, die keine g\xFCltigen Telefonnummern sind (z.B.: "',validate_type_change_prefix:"Typ\xE4nderung nicht m\xF6glich: ",email_invalid:"Ung\xFCltige E-Mail",op_is:"Ist",op_is_not:"Ist nicht",op_contains:"Enth\xE4lt",op_not_contains:"Enth\xE4lt nicht",op_starts_with:"Beginnt mit",op_ends_with:"Endet mit",op_is_empty:"Ist leer",op_is_not_empty:"Ist nicht leer",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"Ist aktiviert",op_is_unchecked:"Ist nicht aktiviert",settings_db_filename_name:"Datenbankdateiname",settings_db_filename_desc:"Name der speziellen Datei, die eine Datenbank in einem Ordner identifiziert.",settings_row_height_name:"Standard-Zeilenh\xF6he",settings_row_height_desc:"H\xF6he in Pixeln jeder Tabellenzeile.",settings_inline_fields_name:"Dataview-Inline-Felder lesen",settings_inline_fields_desc:"Liest key:: value-Felder aus dem Notiztext und zeigt sie als Spaltenwerte an (schreibgesch\xFCtzt)",db_untitled_note:"Unbenannt",db_copy_suffix:"(Kopie)",db_copy_suffix_n:"(Kopie $n)",db_already_exists:'Eine Datenbank existiert bereits in "$folder"',db_tip_body:"Diese Datei ist eine Datenbank. \xD6ffnen Sie sie, um die Tabellenansicht zu sehen.",formula_err_unclosed_string:"Nicht geschlossene Zeichenkette an Position $pos",formula_err_unclosed_bracket:"Nicht geschlossene Klammer an Position $pos",formula_err_unexpected_bang:"Unerwartetes Zeichen '!' an Position $pos",formula_err_unexpected_char:"Unerwartetes Zeichen '$char' an Position $pos",formula_err_expected_token:"Erwartet $expected, gefunden '$found' an Position $pos",formula_err_unexpected_token:"Unerwartetes Token '$token' an Position $pos",formula_err_circular_ref:'Zirkul\xE4re Referenz: "$name" ist eine Formelspalte',formula_err_unknown_fn:"Unbekannte Funktion: $fn()",formula_err_if_args:"Erwartet if(Bedingung, wenn_wahr, [wenn_falsch])",formula_err_avg_args:"Erwartet avg(Spalte) \u2014 ben\xF6tigt eine Spaltenreferenz als Argument",formula_err_count_args:"Erwartet count(Spalte) \u2014 ben\xF6tigt eine Spaltenreferenz als Argument",formula_err_mid_args:"Erwartet mid(Text, Start, L\xE4nge)",formula_err_mod_args:"Erwartet mod(Zahl, Divisor)",formula_err_sqrt_args:"Erwartet sqrt(Zahl)",formula_err_not_implemented:"Funktion nicht implementiert: $fn()",plugin_display_name:"Notion bases",no_databases_found:'Keine Datenbanken gefunden. Verwenden Sie den Befehl "Neue Datenbank erstellen", um eine zu erstellen.',cmd_open_database:"Datenbank f\xFCr diesen Ordner \xF6ffnen",cmd_create_database:"Neue Datenbank im aktuellen Ordner erstellen",ctx_create_database:"Datenbank hier erstellen",arr_settings_title:"Ordnerorganisation",arr_settings_desc:"Verschiebt Zeilendateien automatisch in verschachtelte Unterordner basierend auf den Werten der ausgew\xE4hlten Eigenschaften, in der angegebenen Reihenfolge.",arr_settings_enabled_name:"Ordnerorganisation aktivieren",arr_settings_enabled_desc:"Wenn aktiviert, werden Zeilen verschoben, sobald sich eine der ausgew\xE4hlten Eigenschaften \xE4ndert. Standardm\xE4\xDFig deaktiviert.",arr_settings_no_props:"Keine Eigenschaften ausgew\xE4hlt. F\xFCgen Sie unten eine hinzu, um die Ordnerhierarchie zu definieren.",arr_settings_no_candidates:"Keine geeigneten Spalten. Die Ordnerorganisation unterst\xFCtzt Text-, Auswahl-, Status- und Datumsspalten.",arr_settings_add_placeholder:"Eigenschaft ausw\xE4hlen...",arr_settings_add_btn:"Hinzuf\xFCgen",arr_settings_preview_btn:"Vorschau und auf bestehende Zeilen anwenden",arr_preview_title:"Vorschau der Ordnerorganisation",arr_preview_empty:"Keine Zeilen m\xFCssen verschoben werden.",arr_preview_desc:"$count Zeile(n) werden verschoben:",arr_preview_apply:"Anwenden",arr_preview_cancel:"Abbrechen",arr_preview_applied:"$count Zeile(n) verschoben.",cmd_quick_add:"Zeile schnell zur Datenbank hinzuf\xFCgen",quick_add_title:"Schnell hinzuf\xFCgen",quick_add_note_title:"Titel",quick_add_note_title_placeholder:"Notiztitel...",quick_add_create:"Erstellen",quick_add_create_and_open:"Erstellen und \xF6ffnen",quick_add_no_visible_fields:"Keine bearbeitbaren Felder in dieser Datenbank",picker_placeholder:"Datenbank ausw\xE4hlen...",picker_root:"/ (Stammverzeichnis)",view_fallback_name:"Datenbank",saving:"Speichern",saved:"Gespeichert",save_error:"Speicherfehler",settings_page_size_name:"Zeilen pro Seite",settings_page_size_desc:'Anzahl der Zeilen pro Seite. Auf "Alle" setzen f\xFCr kontinuierliches Scrollen',settings_page_size_all:"Alle (kontinuierliches Scrollen)",page_of:"Seite {current} von {total}",first_page:"Erste Seite",last_page:"Letzte Seite",prev_page:"Vorherige Seite",next_page:"N\xE4chste Seite",conditional_formatting:"Bedingte formatierung",no_conditional_formats:"Noch keine regeln",add_rule:"Regel hinzuf\xFCgen",select_value:"Wert ausw\xE4hlen",style:"Stil",background:"Hintergrund",text_color:"Textfarbe",save:"Speichern",cancel:"Abbrechen",value:"Wert",db_settings_open:"Datenbankeinstellungen",db_settings_title:"Datenbankeinstellungen",db_settings_template_name:"Zeilenvorlage",db_settings_template_desc:"Wendet diese Vorlage auf den Inhalt jeder neuen Zeile in dieser Datenbank an.",db_settings_template_choose:"Vorlage w\xE4hlen",db_settings_template_clear:"Vorlage entfernen",db_settings_template_none:"Keine Vorlage ausgew\xE4hlt",db_settings_ask_name:"Vorlage beim Erstellen abfragen",db_settings_ask_desc:"Bei jeder neuen Zeile nach einer Vorlage fragen, anstatt die Standardvorlage anzuwenden.",template_picker_placeholder:"Vorlage ausw\xE4hlen...",template_picker_none:"Keine Vorlage (leerer Inhalt)"},Ym=ly;var sy={view_table:"\u8868\u683C",view_list:"\u5217\u8868",view_board:"\u770B\u677F",view_gallery:"\u753B\u5ECA",view_calendar:"\u65E5\u5386",view_timeline:"\u65F6\u95F4\u7EBF",view_chart:"\u56FE\u8868",add_view:"\u6DFB\u52A0\u89C6\u56FE",remove_view:"\u5220\u9664\u89C6\u56FE",rename_view_hint:"\u53CC\u51FB\u91CD\u547D\u540D",fields:"\u5B57\u6BB5",filter:"\u7B5B\u9009",filters:"\u7B5B\u9009",sort:"\u6392\u5E8F",actions:"\u64CD\u4F5C",group_by:"\u5206\u7EC4",cover:"\u5C01\u9762",date_field:"\u65E5\u671F",start_field:"\u5F00\u59CB",end_field:"\u7ED3\u675F",group_field:"\u5206\u7EC4",fields_in_card:"\u5361\u7247\u4E2D\u7684\u5B57\u6BB5",fields_label:"\u5B57\u6BB5",fields_on_bars:"\u6761\u5F62\u4E0A\u7684\u5B57\u6BB5",filter_by:"\u7B5B\u9009\u6761\u4EF6",sort_by:"\u6392\u5E8F\u6761\u4EF6",group_by_label:"\u5206\u7EC4\u6761\u4EF6",date_field_label:"\u65E5\u671F\u5B57\u6BB5",cover_field_label:"\u5C01\u9762\u5B57\u6BB5",card_size_label:"\u5361\u7247\u5927\u5C0F",row_height_label:"\u884C\u9AD8",none_value:"\u65E0",no_value:"\u65E0\u503C",no_cover:"\u65E0",size_small:"\u5C0F",size_medium:"\u4E2D",size_large:"\u5927",height_compact:"\u7D27\u51D1",height_medium:"\u4E2D\u7B49",height_tall:"\u9AD8",add_filter_advanced:"\u6DFB\u52A0\u9AD8\u7EA7\u7B5B\u9009",add_sort:"\u6DFB\u52A0\u6392\u5E8F",no_active_sorts:"\u65E0\u6D3B\u8DC3\u6392\u5E8F",name_column:"\u540D\u79F0",conjunction_and:"\u4E14",conjunction_or:"\u6216",filter_number_placeholder:"\u6570\u5B57...",filter_value_placeholder:"\u503C...",delete_selected:"\u5220\u9664\u6240\u6709\u9009\u4E2D\u9879",move_selected:"\u79FB\u52A8\u6240\u6709\u9009\u4E2D\u9879",duplicate_selected:"\u590D\u5236\u6240\u6709\u9009\u4E2D\u9879",export_csv:"\u5BFC\u51FA CSV",import_csv:"\u5BFC\u5165 CSV",open_note:"\u6253\u5F00\u7B14\u8BB0",delete_note:"\u5220\u9664\u7B14\u8BB0",duplicate_note:"\u590D\u5236\u7B14\u8BB0",sort_asc:"\u5347\u5E8F",sort_desc:"\u964D\u5E8F",sort_asc_title:"\u964D\u5E8F\u6392\u5217",sort_desc_title:"\u79FB\u9664\u6392\u5E8F",sort_none_title:"\u5347\u5E8F\u6392\u5217",rename_column:"\u91CD\u547D\u540D",edit_formula:"\u7F16\u8F91\u516C\u5F0F",configure_lookup:"\u914D\u7F6E lookup",configure_relation:"\u914D\u7F6E\u5173\u8054",format_number:"\u6570\u5B57\u683C\u5F0F",configure_image_folder:"\u914D\u7F6E\u56FE\u7247\u6587\u4EF6\u5939",field_type_label:"\u5B57\u6BB5\u7C7B\u578B",hide_field:"\u9690\u85CF\u5B57\u6BB5",enable_wrap_text:"\u81EA\u52A8\u6362\u884C",disable_wrap_text:"\u53D6\u6D88\u6362\u884C",delete_field:"\u5220\u9664\u5B57\u6BB5",type_title:"\u6807\u9898",type_text:"\u6587\u672C",type_number:"\u6570\u5B57",type_select:"\u5355\u9009",type_multiselect:"\u591A\u9009",type_date:"\u65E5\u671F",type_checkbox:"\u590D\u9009\u6846",type_url:"URL",type_email:"\u90AE\u7BB1",type_phone:"\u7535\u8BDD",type_status:"\u72B6\u6001",type_formula:"\u516C\u5F0F",type_relation:"\u5173\u8054",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"\u914D\u7F6E rollup",rollup_select_relation:"1. \u5173\u8054\u5217",rollup_select_relation_placeholder:"\u9009\u62E9\u5173\u8054...",rollup_select_target:"2. \u76EE\u6807\u5217",rollup_select_target_placeholder:"\u9009\u62E9\u5217...",rollup_select_function:"3. \u805A\u5408\u51FD\u6570",rollup_no_relations:"\u672A\u627E\u5230\u5173\u8054\u5217\u3002\u8BF7\u5148\u6DFB\u52A0\u4E00\u4E2A\u5173\u8054\u5217\u3002",rollup_fn_sum:"\u6C42\u548C",rollup_fn_count:"\u8BA1\u6570",rollup_fn_avg:"\u5E73\u5747\u503C",rollup_fn_min:"\u6700\u5C0F\u503C",rollup_fn_max:"\u6700\u5927\u503C",rollup_fn_count_values:"\u8BA1\u552F\u4E00\u503C",rollup_fn_list:"\u5217\u51FA\u5168\u90E8",type_image:"\u56FE\u7247",type_audio:"\u97F3\u9891",audio_path_placeholder:"\u97F3\u9891\u6587\u4EF6\u8DEF\u5F84...",audio_select_placeholder:"\u9009\u62E9\u97F3\u9891...",audio_picker_title:"\u9009\u62E9\u97F3\u9891",audio_picker_clear:"\u6E05\u9664",audio_picker_empty_folder:"\u6587\u4EF6\u5939\u4E2D\u6CA1\u6709\u97F3\u9891\u6587\u4EF6",audio_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u6CA1\u6709\u97F3\u9891\u6587\u4EF6",audio_panel_title:"\u97F3\u9891\u8BBE\u7F6E",audio_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u7559\u7A7A\u5219\u4F7F\u7528\u6574\u4E2A\u4ED3\u5E93\uFF09",audio_folder_placeholder:"\u4F8B\uFF1Aaudio/music",configure_audio_folder:"\u914D\u7F6E\u97F3\u9891\u6587\u4EF6\u5939",type_video:"\u89C6\u9891",video_select_placeholder:"\u9009\u62E9\u89C6\u9891...",video_picker_clear:"\u6E05\u9664",video_picker_empty_folder:"\u6587\u4EF6\u5939\u4E2D\u6CA1\u6709\u89C6\u9891\u6587\u4EF6",video_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u6CA1\u6709\u89C6\u9891\u6587\u4EF6",video_panel_title:"\u89C6\u9891\u8BBE\u7F6E",video_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u7559\u7A7A\u5219\u4F7F\u7528\u6574\u4E2A\u4ED3\u5E93\uFF09",video_folder_placeholder:"\u4F8B\uFF1Avideo/clips",configure_video_folder:"\u914D\u7F6E\u89C6\u9891\u6587\u4EF6\u5939",formula_panel_title:"\u516C\u5F0F",formula_placeholder:'\u793A\u4F8B\uFF1Aif(status = "done", 1, 0)',formula_valid:"\u8BED\u6CD5\u6B63\u786E",formula_available_cols:"\u53EF\u7528\u5217\uFF1A",formula_ref_toggle:"\u51FD\u6570\u53C2\u8003",formula_save:"\u4FDD\u5B58",formula_cancel:"\u53D6\u6D88",formula_save_hint:"\u4FDD\u5B58 (Ctrl+Enter)",formula_group_logic:"\u903B\u8F91",formula_group_comparators:"\u6BD4\u8F83",formula_group_aggregators:"\u805A\u5408",formula_group_text:"\u6587\u672C",formula_group_math:"\u6570\u5B66",formula_group_utils:"\u5DE5\u5177",number_format_title:"\u683C\u5F0F",number_decimals_label:"\u5C0F\u6570\u4F4D\u6570",number_thousands_label:"\u5343\u4F4D\u5206\u9694\u7B26",number_prefix_label:"\u524D\u7F00",number_suffix_label:"\u540E\u7F00",number_prefix_placeholder:"\u4F8B\uFF1A$\u3001\xA5",number_suffix_placeholder:"\u4F8B\uFF1A%\u3001kg\u3001km",number_remove_format:"\u79FB\u9664\u683C\u5F0F",relation_panel_title:"\u5173\u8054",lookup_panel_title:"Lookup",lookup_ref_table:"1. \u5F15\u7528\u8868",lookup_select_table:"\u9009\u62E9\u8868...",lookup_col_to_display:"2. \u663E\u793A\u5217",lookup_origin_col:"2. \u503C\u7684\u6765\u6E90\u5B57\u6BB5",lookup_select_col:"\u9009\u62E9\u5217...",lookup_file_name:"\u6587\u4EF6\u540D",lookup_join_col:"3. \u8FDE\u63A5\u5217\uFF08\u672C\u8868\uFF09",lookup_join_col_title:"\u6587\u4EF6\u540D\uFF08\u6309\u6807\u9898\u8FDE\u63A5\uFF09",lookup_select_join_col:"\u9009\u62E9\u5217...",lookup_hint:"\u6B64\u5217\u7684\u503C\u5FC5\u987B\u4E0E\u5F15\u7528\u8868\u4E2D\u7684\u6587\u4EF6\u540D\u5339\u914D",image_panel_title:"\u56FE\u7247",image_folder_label:"\u6765\u6E90\u6587\u4EF6\u5939\uFF08\u53EF\u9009\uFF09",image_folder_placeholder:"\u4F8B\uFF1Aimages/covers",image_picker_title:"\u9009\u62E9\u56FE\u7247",image_picker_clear:"\u6E05\u9664",image_picker_empty_vault:"\u4ED3\u5E93\u4E2D\u672A\u627E\u5230\u56FE\u7247",image_picker_empty_folder:"\u672A\u627E\u5230\u56FE\u7247\u4E8E",image_select_placeholder:"\u9009\u62E9\u56FE\u7247\u2026",agg_none:"\u65E0",agg_count:"\u8BA1\u6570",agg_count_values:"\u8BA1\u6570\u503C",agg_sum:"\u6C42\u548C",agg_avg:"\u5E73\u5747\u503C",agg_min:"\u6700\u5C0F\u503C",agg_max:"\u6700\u5927\u503C",no_database_open:"\u672A\u6253\u5F00\u6570\u636E\u5E93\u3002",no_database_hint:'\u4F7F\u7528\u5DE5\u5177\u680F\u6309\u94AE\u6216"\u521B\u5EFA\u65B0\u6570\u636E\u5E93"\u547D\u4EE4\u3002',loading:"\u52A0\u8F7D\u4E2D...",no_results:"\u672A\u627E\u5230\u9879\u76EE",item_singular:"\u9879",item_plural:"\u9879",row_singular:"\u884C",row_plural:"\u884C",record_singular:"\u8BB0\u5F55",record_plural:"\u8BB0\u5F55",add_row:"\u65B0\u5EFA\u884C",add_entry:"\u65B0\u5EFA\u6761\u76EE",add_card:"\u65B0\u5EFA\u5361\u7247",new_field:"\u65B0\u5B57\u6BB5",add_field:"\u6DFB\u52A0\u5B57\u6BB5",board_no_select_col:"\u770B\u677F\u9700\u8981\u4E00\u4E2A\u5355\u9009\u6216\u72B6\u6001\u5217\u6765\u5206\u7EC4\u5361\u7247\u3002",board_add_select_hint:"\u5728\u8868\u683C\u89C6\u56FE\u4E2D\u6DFB\u52A0\u8BE5\u7C7B\u578B\u7684\u5217\uFF0C\u7136\u540E\u56DE\u5230\u8FD9\u91CC\u3002",board_drag_reorder:"\u62D6\u52A8\u4EE5\u91CD\u65B0\u6392\u5E8F",board_set_limit:"\u70B9\u51FB\u8BBE\u7F6E\u5361\u7247\u9650\u5236",board_limit_placeholder:"\u9650\u5236 (0 = \u65E0)",board_show_more:"\u66F4\u591A",board_show_less:"\u6536\u8D77",hide_empty_cols:"\u9690\u85CF\u7A7A\u5217",hide_no_value_cols:"\u9690\u85CF\u65E0\u503C\u5217",calendar_no_date_field:"\u5728\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u65E5\u671F\u5B57\u6BB5\u4EE5\u663E\u793A\u65E5\u5386\u3002",calendar_no_date_section:"\u65E0\u65E5\u671F",calendar_click_to_create:"\u70B9\u51FB\u521B\u5EFA\u7B14\u8BB0",calendar_today:"\u4ECA\u5929",calendar_prev_month:"\u4E0A\u4E2A\u6708",calendar_next_month:"\u4E0B\u4E2A\u6708",calendar_view_month:"\u6708",calendar_view_week:"\u5468",calendar_prev_week:"\u4E0A\u4E00\u5468",calendar_next_week:"\u4E0B\u4E00\u5468",calendar_add_time:"\u6DFB\u52A0\u65F6\u95F4",calendar_remove_time:"\u79FB\u9664\u65F6\u95F4",calendar_all_day:"\u5168\u5929",day_sun:"\u65E5",day_mon:"\u4E00",day_tue:"\u4E8C",day_wed:"\u4E09",day_thu:"\u56DB",day_fri:"\u4E94",day_sat:"\u516D",month_january:"\u4E00\u6708",month_february:"\u4E8C\u6708",month_march:"\u4E09\u6708",month_april:"\u56DB\u6708",month_may:"\u4E94\u6708",month_june:"\u516D\u6708",month_july:"\u4E03\u6708",month_august:"\u516B\u6708",month_september:"\u4E5D\u6708",month_october:"\u5341\u6708",month_november:"\u5341\u4E00\u6708",month_december:"\u5341\u4E8C\u6708",timeline_no_start_field:"\u5728\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u5F00\u59CB\u5B57\u6BB5\u4EE5\u663E\u793A\u65F6\u95F4\u7EBF\u3002",timeline_no_interval:"\u65E0\u95F4\u9694",timeline_scroll_prev:"\u5411\u524D\u6EDA\u52A8",timeline_scroll_next:"\u5411\u540E\u6EDA\u52A8",zoom_days:"\u5929",zoom_weeks:"\u5468",zoom_months:"\u6708",month_short_jan:"1\u6708",month_short_feb:"2\u6708",month_short_mar:"3\u6708",month_short_apr:"4\u6708",month_short_may:"5\u6708",month_short_jun:"6\u6708",month_short_jul:"7\u6708",month_short_aug:"8\u6708",month_short_sep:"9\u6708",month_short_oct:"10\u6708",month_short_nov:"11\u6708",month_short_dec:"12\u6708",hierarchy_toggle:"\u7528\u4F5C\u5C42\u7EA7",hierarchy_toggle_hint:"\u542F\u7528\u6B64\u6570\u636E\u5E93\u4E2D\u884C\u4E4B\u95F4\u7684\u7236\u5B50\u5173\u7CFB",add_subrow:"\u6DFB\u52A0\u5B50\u884C",collapse_all:"\u5168\u90E8\u6298\u53E0",expand_all:"\u5168\u90E8\u5C55\u5F00",max_depth_reached:"\u5DF2\u8FBE\u5230\u6700\u5927\u6DF1\u5EA6\uFF083 \u5C42\uFF09",chart_configure:"\u914D\u7F6E",chart_type:"\u56FE\u8868\u7C7B\u578B",chart_type_bar:"\u67F1\u72B6\u56FE",chart_type_line:"\u6298\u7EBF\u56FE",chart_type_pie:"\u997C\u56FE",chart_x_axis:"\u5206\u7C7B (X \u8F74)",chart_y_axis:"\u6570\u503C (Y \u8F74)",chart_aggregation:"\u805A\u5408",chart_select_column:"\u9009\u62E9\u5217...",chart_count_records:"\u8BA1\u6570",chart_no_config:"\u8BF7\u914D\u7F6E\u56FE\u8868\u4EE5\u5F00\u59CB\u4F7F\u7528\u3002",chart_no_config_hint:"\u5728\u4E0A\u65B9\u5DE5\u5177\u680F\u4E2D\u9009\u62E9\u4E00\u4E2A\u5206\u7C7B\u5217\u3002",tooltip_pin_column:"\u56FA\u5B9A\u5230\u6B64\u5217",tooltip_unpin_column:"\u53D6\u6D88\u56FA\u5B9A\u5217",tooltip_resize_column:"\u62D6\u52A8\u8C03\u6574\u5927\u5C0F\uFF1B\u53CC\u51FB\u9002\u5E94\u5185\u5BB9",tooltip_wrap_text:"\u6587\u5B57\u6362\u884C",tooltip_include_subfolders:"\u5305\u542B\u5B50\u6587\u4EF6\u5939",folder_column:"\u6587\u4EF6\u5939",tooltip_manage_fields:"\u7BA1\u7406\u5B57\u6BB5",tooltip_batch_actions:"\u6279\u91CF\u64CD\u4F5C",tooltip_remove_filter:"\u79FB\u9664\u7B5B\u9009",hide_filters:"\u9690\u85CF\u7B5B\u9009",show_filters:"\u663E\u793A\u7B5B\u9009",filters_count_one:"1 \u4E2A\u7B5B\u9009",filters_count_other:"{n} \u4E2A\u7B5B\u9009",tooltip_close:"\u5173\u95ED",tooltip_remove:"\u79FB\u9664",tooltip_move_up:"\u4E0A\u79FB",tooltip_move_down:"\u4E0B\u79FB",tooltip_change_color:"\u66F4\u6539\u989C\u8272",tooltip_delete_status:"\u5220\u9664\u72B6\u6001",status_not_started:"\u672A\u5F00\u59CB",status_in_progress:"\u8FDB\u884C\u4E2D",status_done:"\u5DF2\u5B8C\u6210",status_cancelled:"\u5DF2\u53D6\u6D88",relation_search_placeholder:"\u641C\u7D22...",relation_clear:"\u6E05\u9664",relation_no_results:"\u65E0\u7ED3\u679C",relation_two_way:"\u53CC\u5411\u5173\u8054",relation_two_way_hint:"\u81EA\u52A8\u5728\u76EE\u6807\u6570\u636E\u5E93\u4E2D\u521B\u5EFA\u53CD\u5411\u5173\u8054",select_clear:"\u6E05\u9664",select_create_placeholder:"\u521B\u5EFA\u65B0\u9009\u9879...",status_new_placeholder:"\u65B0\u72B6\u6001...",color_custom:"\u81EA\u5B9A\u4E49",validate_non_numeric:'\u5355\u5143\u683C\u5305\u542B\u975E\u6570\u5B57\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_dates:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u65E5\u671F\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_checkbox:'\u5355\u5143\u683C\u5305\u542B\u4E0E\u590D\u9009\u6846\u4E0D\u517C\u5BB9\u7684\u503C\uFF08\u4F8B\uFF1A"',validate_multiselect_to_select:"\u884C\u6709\u591A\u4E2A\u9009\u4E2D\u503C\u3002\u8BF7\u5728\u5207\u6362\u5230\u5355\u9009\u524D\u79FB\u9664\u591A\u4F59\u7684\u503C\u3002",validate_invalid_email:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u90AE\u7BB1\u503C\uFF08\u4F8B\uFF1A"',validate_invalid_url:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548 URL \u503C\uFF08\u4F8B\uFF1A"',validate_invalid_phone:'\u5355\u5143\u683C\u5305\u542B\u65E0\u6548\u7535\u8BDD\u53F7\u7801\uFF08\u4F8B\uFF1A"',validate_type_change_prefix:"\u65E0\u6CD5\u66F4\u6539\u7C7B\u578B\uFF1A",email_invalid:"\u65E0\u6548\u90AE\u7BB1",op_is:"\u7B49\u4E8E",op_is_not:"\u4E0D\u7B49\u4E8E",op_contains:"\u5305\u542B",op_not_contains:"\u4E0D\u5305\u542B",op_starts_with:"\u5F00\u5934\u662F",op_ends_with:"\u7ED3\u5C3E\u662F",op_is_empty:"\u4E3A\u7A7A",op_is_not_empty:"\u4E0D\u4E3A\u7A7A",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"\u5DF2\u52FE\u9009",op_is_unchecked:"\u672A\u52FE\u9009",settings_db_filename_name:"\u6570\u636E\u5E93\u6587\u4EF6\u540D",settings_db_filename_desc:"\u7528\u4E8E\u6807\u8BC6\u6587\u4EF6\u5939\u4E2D\u6570\u636E\u5E93\u7684\u7279\u6B8A\u6587\u4EF6\u540D\u3002",settings_row_height_name:"\u9ED8\u8BA4\u884C\u9AD8",settings_row_height_desc:"\u6BCF\u4E2A\u8868\u683C\u884C\u7684\u50CF\u7D20\u9AD8\u5EA6\u3002",settings_inline_fields_name:"\u8BFB\u53D6 dataview \u5185\u8054\u5B57\u6BB5",settings_inline_fields_desc:"\u89E3\u6790\u7B14\u8BB0\u6B63\u6587\u4E2D\u7684 key:: value \u5B57\u6BB5\u5E76\u5C06\u5176\u663E\u793A\u4E3A\u5217\u503C\uFF08\u53EA\u8BFB\uFF09",db_untitled_note:"\u672A\u547D\u540D",db_copy_suffix:"(\u526F\u672C)",db_copy_suffix_n:"(\u526F\u672C $n)",db_already_exists:'"$folder" \u4E2D\u5DF2\u5B58\u5728\u6570\u636E\u5E93',db_tip_body:"\u6B64\u6587\u4EF6\u662F\u4E00\u4E2A\u6570\u636E\u5E93\u3002\u6253\u5F00\u5B83\u4EE5\u67E5\u770B\u8868\u683C\u89C6\u56FE\u3002",formula_err_unclosed_string:"\u4F4D\u7F6E $pos \u5904\u5B57\u7B26\u4E32\u672A\u5173\u95ED",formula_err_unclosed_bracket:"\u4F4D\u7F6E $pos \u5904\u62EC\u53F7\u672A\u5173\u95ED",formula_err_unexpected_bang:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u5B57\u7B26 '!'",formula_err_unexpected_char:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u5B57\u7B26 '$char'",formula_err_expected_token:"\u4F4D\u7F6E $pos \u5904\u671F\u671B $expected\uFF0C\u627E\u5230 '$found'",formula_err_unexpected_token:"\u4F4D\u7F6E $pos \u5904\u51FA\u73B0\u610F\u5916\u6807\u8BB0 '$token'",formula_err_circular_ref:'\u5FAA\u73AF\u5F15\u7528\uFF1A"$name" \u662F\u4E00\u4E2A\u516C\u5F0F\u5217',formula_err_unknown_fn:"\u672A\u77E5\u51FD\u6570\uFF1A$fn()",formula_err_if_args:"\u671F\u671B if(\u6761\u4EF6, \u771F\u503C, [\u5047\u503C])",formula_err_avg_args:"\u671F\u671B avg(\u5217) \u2014 \u9700\u8981\u5217\u5F15\u7528\u4F5C\u4E3A\u53C2\u6570",formula_err_count_args:"\u671F\u671B count(\u5217) \u2014 \u9700\u8981\u5217\u5F15\u7528\u4F5C\u4E3A\u53C2\u6570",formula_err_mid_args:"\u671F\u671B mid(\u6587\u672C, \u8D77\u59CB, \u957F\u5EA6)",formula_err_mod_args:"\u671F\u671B mod(\u6570\u5B57, \u9664\u6570)",formula_err_sqrt_args:"\u671F\u671B sqrt(\u6570\u5B57)",formula_err_not_implemented:"\u51FD\u6570\u672A\u5B9E\u73B0\uFF1A$fn()",plugin_display_name:"Notion bases",no_databases_found:'\u672A\u627E\u5230\u6570\u636E\u5E93\u3002\u4F7F\u7528"\u521B\u5EFA\u65B0\u6570\u636E\u5E93"\u547D\u4EE4\u6765\u521B\u5EFA\u4E00\u4E2A\u3002',cmd_open_database:"\u6253\u5F00\u6B64\u6587\u4EF6\u5939\u7684\u6570\u636E\u5E93",cmd_create_database:"\u5728\u5F53\u524D\u6587\u4EF6\u5939\u521B\u5EFA\u65B0\u6570\u636E\u5E93",ctx_create_database:"\u5728\u6B64\u5904\u521B\u5EFA\u6570\u636E\u5E93",arr_settings_title:"\u6587\u4EF6\u5939\u6392\u5217",arr_settings_desc:"\u6839\u636E\u6240\u9009\u5C5E\u6027\u7684\u503C\uFF0C\u6309\u987A\u5E8F\u81EA\u52A8\u5C06\u884C\u6587\u4EF6\u79FB\u52A8\u5230\u5D4C\u5957\u5B50\u6587\u4EF6\u5939\u4E2D\u3002",arr_settings_enabled_name:"\u542F\u7528\u6587\u4EF6\u5939\u6392\u5217",arr_settings_enabled_desc:"\u542F\u7528\u540E\uFF0C\u6240\u9009\u5C5E\u6027\u4E4B\u4E00\u53D1\u751F\u66F4\u6539\u65F6\u7ACB\u5373\u79FB\u52A8\u884C\u3002\u9ED8\u8BA4\u5173\u95ED\u3002",arr_settings_no_props:"\u672A\u9009\u62E9\u4EFB\u4F55\u5C5E\u6027\u3002\u8BF7\u5728\u4E0B\u65B9\u6DFB\u52A0\u4E00\u4E2A\u4EE5\u5B9A\u4E49\u6587\u4EF6\u5939\u5C42\u7EA7\u3002",arr_settings_no_candidates:"\u6CA1\u6709\u53EF\u7528\u5217\u3002\u6587\u4EF6\u5939\u6392\u5217\u652F\u6301\u6587\u672C\u3001\u9009\u62E9\u3001\u72B6\u6001\u548C\u65E5\u671F\u5217\u3002",arr_settings_add_placeholder:"\u9009\u62E9\u4E00\u4E2A\u5C5E\u6027...",arr_settings_add_btn:"\u6DFB\u52A0",arr_settings_preview_btn:"\u9884\u89C8\u5E76\u5E94\u7528\u5230\u73B0\u6709\u884C",arr_preview_title:"\u6587\u4EF6\u5939\u6392\u5217\u9884\u89C8",arr_preview_empty:"\u6CA1\u6709\u9700\u8981\u79FB\u52A8\u7684\u884C\u3002",arr_preview_desc:"\u5C06\u79FB\u52A8 $count \u884C\uFF1A",arr_preview_apply:"\u5E94\u7528",arr_preview_cancel:"\u53D6\u6D88",arr_preview_applied:"\u5DF2\u79FB\u52A8 $count \u884C\u3002",cmd_quick_add:"\u5FEB\u901F\u5411\u6570\u636E\u5E93\u6DFB\u52A0\u884C",quick_add_title:"\u5FEB\u901F\u6DFB\u52A0",quick_add_note_title:"\u6807\u9898",quick_add_note_title_placeholder:"\u7B14\u8BB0\u6807\u9898...",quick_add_create:"\u521B\u5EFA",quick_add_create_and_open:"\u521B\u5EFA\u5E76\u6253\u5F00",quick_add_no_visible_fields:"\u6B64\u6570\u636E\u5E93\u4E2D\u6CA1\u6709\u53EF\u7F16\u8F91\u5B57\u6BB5",picker_placeholder:"\u9009\u62E9\u6570\u636E\u5E93...",picker_root:"/\uFF08\u6839\u76EE\u5F55\uFF09",view_fallback_name:"\u6570\u636E\u5E93",saving:"\u4FDD\u5B58\u4E2D",saved:"\u5DF2\u4FDD\u5B58",save_error:"\u4FDD\u5B58\u5931\u8D25",settings_page_size_name:"\u6BCF\u9875\u884C\u6570",settings_page_size_desc:'\u6BCF\u9875\u663E\u793A\u7684\u884C\u6570\u3002\u8BBE\u7F6E\u4E3A"\u5168\u90E8"\u4EE5\u542F\u7528\u8FDE\u7EED\u6EDA\u52A8',settings_page_size_all:"\u5168\u90E8\uFF08\u8FDE\u7EED\u6EDA\u52A8\uFF09",page_of:"\u7B2C {current} \u9875\uFF0C\u5171 {total} \u9875",first_page:"\u7B2C\u4E00\u9875",last_page:"\u6700\u540E\u4E00\u9875",prev_page:"\u4E0A\u4E00\u9875",next_page:"\u4E0B\u4E00\u9875",conditional_formatting:"\u6761\u4EF6\u683C\u5F0F",no_conditional_formats:"\u6682\u65E0\u89C4\u5219",add_rule:"\u6DFB\u52A0\u89C4\u5219",select_value:"\u9009\u62E9\u4E00\u4E2A\u503C",style:"\u6837\u5F0F",background:"\u80CC\u666F",text_color:"\u6587\u5B57\u989C\u8272",save:"\u4FDD\u5B58",cancel:"\u53D6\u6D88",value:"\u503C",db_settings_open:"\u6570\u636E\u5E93\u8BBE\u7F6E",db_settings_title:"\u6570\u636E\u5E93\u8BBE\u7F6E",db_settings_template_name:"\u884C\u6A21\u677F",db_settings_template_desc:"\u5C06\u6B64\u6A21\u677F\u5E94\u7528\u4E8E\u5728\u6B64\u6570\u636E\u5E93\u4E2D\u521B\u5EFA\u7684\u6BCF\u4E00\u65B0\u884C\u7684\u6B63\u6587\u3002",db_settings_template_choose:"\u9009\u62E9\u6A21\u677F",db_settings_template_clear:"\u6E05\u9664\u6A21\u677F",db_settings_template_none:"\u672A\u9009\u62E9\u6A21\u677F",db_settings_ask_name:"\u521B\u5EFA\u65F6\u8BE2\u95EE\u6A21\u677F",db_settings_ask_desc:"\u6BCF\u6B21\u6DFB\u52A0\u65B0\u884C\u65F6\u63D0\u793A\u9009\u62E9\u6A21\u677F\uFF0C\u800C\u4E0D\u662F\u5E94\u7528\u9ED8\u8BA4\u6A21\u677F\u3002",template_picker_placeholder:"\u9009\u62E9\u4E00\u4E2A\u6A21\u677F...",template_picker_none:"\u65E0\u6A21\u677F\uFF08\u7A7A\u6B63\u6587\uFF09"},kc=sy;var uy={view_table:"\u30C6\u30FC\u30D6\u30EB",view_list:"\u30EA\u30B9\u30C8",view_board:"\u30DC\u30FC\u30C9",view_gallery:"\u30AE\u30E3\u30E9\u30EA\u30FC",view_calendar:"\u30AB\u30EC\u30F3\u30C0\u30FC",view_timeline:"\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3",view_chart:"\u30C1\u30E3\u30FC\u30C8",add_view:"\u30D3\u30E5\u30FC\u3092\u8FFD\u52A0",remove_view:"\u30D3\u30E5\u30FC\u3092\u524A\u9664",rename_view_hint:"\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u540D\u524D\u5909\u66F4",fields:"\u30D5\u30A3\u30FC\u30EB\u30C9",filter:"\u30D5\u30A3\u30EB\u30BF\u30FC",filters:"\u30D5\u30A3\u30EB\u30BF\u30FC",sort:"\u4E26\u3079\u66FF\u3048",actions:"\u30A2\u30AF\u30B7\u30E7\u30F3",group_by:"\u30B0\u30EB\u30FC\u30D7\u5316",cover:"\u30AB\u30D0\u30FC",date_field:"\u65E5\u4ED8",start_field:"\u958B\u59CB",end_field:"\u7D42\u4E86",group_field:"\u30B0\u30EB\u30FC\u30D7",fields_in_card:"\u30AB\u30FC\u30C9\u306E\u30D5\u30A3\u30FC\u30EB\u30C9",fields_label:"\u30D5\u30A3\u30FC\u30EB\u30C9",fields_on_bars:"\u30D0\u30FC\u306E\u30D5\u30A3\u30FC\u30EB\u30C9",filter_by:"\u30D5\u30A3\u30EB\u30BF\u30FC\u6761\u4EF6",sort_by:"\u4E26\u3079\u66FF\u3048\u6761\u4EF6",group_by_label:"\u30B0\u30EB\u30FC\u30D7\u5316\u6761\u4EF6",date_field_label:"\u65E5\u4ED8\u30D5\u30A3\u30FC\u30EB\u30C9",cover_field_label:"\u30AB\u30D0\u30FC\u30D5\u30A3\u30FC\u30EB\u30C9",card_size_label:"\u30AB\u30FC\u30C9\u30B5\u30A4\u30BA",row_height_label:"\u884C\u306E\u9AD8\u3055",none_value:"\u306A\u3057",no_value:"\u5024\u306A\u3057",no_cover:"\u306A\u3057",size_small:"\u5C0F",size_medium:"\u4E2D",size_large:"\u5927",height_compact:"\u30B3\u30F3\u30D1\u30AF\u30C8",height_medium:"\u6A19\u6E96",height_tall:"\u9AD8\u3044",add_filter_advanced:"\u8A73\u7D30\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8FFD\u52A0",add_sort:"\u4E26\u3079\u66FF\u3048\u3092\u8FFD\u52A0",no_active_sorts:"\u30A2\u30AF\u30C6\u30A3\u30D6\u306A\u4E26\u3079\u66FF\u3048\u306A\u3057",name_column:"\u540D\u524D",conjunction_and:"\u304B\u3064",conjunction_or:"\u307E\u305F\u306F",filter_number_placeholder:"\u6570\u5024...",filter_value_placeholder:"\u5024...",delete_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u524A\u9664",move_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u79FB\u52D5",duplicate_selected:"\u9078\u629E\u9805\u76EE\u3092\u3059\u3079\u3066\u8907\u88FD",export_csv:"CSV \u30A8\u30AF\u30B9\u30DD\u30FC\u30C8",import_csv:"CSV \u30A4\u30F3\u30DD\u30FC\u30C8",open_note:"\u30CE\u30FC\u30C8\u3092\u958B\u304F",delete_note:"\u30CE\u30FC\u30C8\u3092\u524A\u9664",duplicate_note:"\u30CE\u30FC\u30C8\u3092\u8907\u88FD",sort_asc:"\u6607\u9806",sort_desc:"\u964D\u9806",sort_asc_title:"\u964D\u9806\u3067\u4E26\u3079\u66FF\u3048",sort_desc_title:"\u4E26\u3079\u66FF\u3048\u3092\u89E3\u9664",sort_none_title:"\u6607\u9806\u3067\u4E26\u3079\u66FF\u3048",rename_column:"\u540D\u524D\u5909\u66F4",edit_formula:"\u6570\u5F0F\u3092\u7DE8\u96C6",configure_lookup:"Lookup \u3092\u8A2D\u5B9A",configure_relation:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u8A2D\u5B9A",format_number:"\u6570\u5024\u306E\u66F8\u5F0F",configure_image_folder:"\u753B\u50CF\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",field_type_label:"\u30D5\u30A3\u30FC\u30EB\u30C9\u30BF\u30A4\u30D7",hide_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u975E\u8868\u793A",enable_wrap_text:"\u30C6\u30AD\u30B9\u30C8\u3092\u6298\u308A\u8FD4\u3059",disable_wrap_text:"\u6298\u308A\u8FD4\u3057\u3092\u89E3\u9664",delete_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u524A\u9664",type_title:"\u30BF\u30A4\u30C8\u30EB",type_text:"\u30C6\u30AD\u30B9\u30C8",type_number:"\u6570\u5024",type_select:"\u9078\u629E",type_multiselect:"\u8907\u6570\u9078\u629E",type_date:"\u65E5\u4ED8",type_checkbox:"\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9",type_url:"URL",type_email:"\u30E1\u30FC\u30EB",type_phone:"\u96FB\u8A71",type_status:"\u30B9\u30C6\u30FC\u30BF\u30B9",type_formula:"\u6570\u5F0F",type_relation:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",type_lookup:"Lookup",type_rollup:"Rollup",rollup_panel_title:"Rollup",configure_rollup:"Rollup \u3092\u8A2D\u5B9A",rollup_select_relation:"1. \u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217",rollup_select_relation_placeholder:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u9078\u629E...",rollup_select_target:"2. \u30BF\u30FC\u30B2\u30C3\u30C8\u5217",rollup_select_target_placeholder:"\u5217\u3092\u9078\u629E...",rollup_select_function:"3. \u96C6\u8A08",rollup_no_relations:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u5148\u306B\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u5217\u3092\u8FFD\u52A0\u3057\u3066\u304F\u3060\u3055\u3044\u3002",rollup_fn_sum:"\u5408\u8A08",rollup_fn_count:"\u30AB\u30A6\u30F3\u30C8",rollup_fn_avg:"\u5E73\u5747",rollup_fn_min:"\u6700\u5C0F",rollup_fn_max:"\u6700\u5927",rollup_fn_count_values:"\u4E00\u610F\u3092\u30AB\u30A6\u30F3\u30C8",rollup_fn_list:"\u3059\u3079\u3066\u5217\u6319",type_image:"\u753B\u50CF",type_audio:"\u30AA\u30FC\u30C7\u30A3\u30AA",audio_path_placeholder:"\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u306E\u30D1\u30B9...",audio_select_placeholder:"\u97F3\u58F0\u3092\u9078\u629E...",audio_picker_title:"\u97F3\u58F0\u3092\u9078\u629E",audio_picker_clear:"\u30AF\u30EA\u30A2",audio_picker_empty_folder:"\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",audio_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u97F3\u58F0\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",audio_panel_title:"\u97F3\u58F0\u8A2D\u5B9A",audio_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u7A7A\u306B\u3059\u308B\u3068\u4FDD\u7BA1\u5EAB\u5168\u4F53\u3092\u5BFE\u8C61\uFF09",audio_folder_placeholder:"\u4F8B\uFF1Aaudio/music",configure_audio_folder:"\u97F3\u58F0\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",type_video:"\u52D5\u753B",video_select_placeholder:"\u52D5\u753B\u3092\u9078\u629E...",video_picker_clear:"\u30AF\u30EA\u30A2",video_picker_empty_folder:"\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u52D5\u753B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",video_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u52D5\u753B\u30D5\u30A1\u30A4\u30EB\u304C\u3042\u308A\u307E\u305B\u3093",video_panel_title:"\u52D5\u753B\u8A2D\u5B9A",video_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u7A7A\u306B\u3059\u308B\u3068\u4FDD\u7BA1\u5EAB\u5168\u4F53\u3092\u5BFE\u8C61\uFF09",video_folder_placeholder:"\u4F8B\uFF1Avideo/clips",configure_video_folder:"\u52D5\u753B\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u8A2D\u5B9A",formula_panel_title:"\u6570\u5F0F",formula_placeholder:'\u4F8B\uFF1Aif(status = "done", 1, 0)',formula_valid:"\u69CB\u6587\u306F\u6B63\u3057\u3044\u3067\u3059",formula_available_cols:"\u5229\u7528\u53EF\u80FD\u306A\u5217\uFF1A",formula_ref_toggle:"\u95A2\u6570\u30EA\u30D5\u30A1\u30EC\u30F3\u30B9",formula_save:"\u4FDD\u5B58",formula_cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",formula_save_hint:"\u4FDD\u5B58 (Ctrl+Enter)",formula_group_logic:"\u8AD6\u7406",formula_group_comparators:"\u6BD4\u8F03",formula_group_aggregators:"\u96C6\u8A08",formula_group_text:"\u30C6\u30AD\u30B9\u30C8",formula_group_math:"\u6570\u5B66",formula_group_utils:"\u30E6\u30FC\u30C6\u30A3\u30EA\u30C6\u30A3",number_format_title:"\u66F8\u5F0F",number_decimals_label:"\u5C0F\u6570\u70B9\u4EE5\u4E0B\u306E\u6841\u6570",number_thousands_label:"\u6841\u533A\u5207\u308A",number_prefix_label:"\u63A5\u982D\u8F9E",number_suffix_label:"\u63A5\u5C3E\u8F9E",number_prefix_placeholder:"\u4F8B\uFF1A$\u3001\xA5",number_suffix_placeholder:"\u4F8B\uFF1A%\u3001kg\u3001km",number_remove_format:"\u66F8\u5F0F\u3092\u524A\u9664",relation_panel_title:"\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",lookup_panel_title:"Lookup",lookup_ref_table:"1. \u53C2\u7167\u30C6\u30FC\u30D6\u30EB",lookup_select_table:"\u30C6\u30FC\u30D6\u30EB\u3092\u9078\u629E...",lookup_col_to_display:"2. \u8868\u793A\u3059\u308B\u5217",lookup_origin_col:"2. \u5024\u306E\u30BD\u30FC\u30B9\u30D5\u30A3\u30FC\u30EB\u30C9",lookup_select_col:"\u5217\u3092\u9078\u629E...",lookup_file_name:"\u30D5\u30A1\u30A4\u30EB\u540D",lookup_join_col:"3. \u7D50\u5408\u5217\uFF08\u3053\u306E\u30C6\u30FC\u30D6\u30EB\uFF09",lookup_join_col_title:"\u30D5\u30A1\u30A4\u30EB\u540D\uFF08\u30BF\u30A4\u30C8\u30EB\u3067\u7D50\u5408\uFF09",lookup_select_join_col:"\u5217\u3092\u9078\u629E...",lookup_hint:"\u3053\u306E\u5217\u306E\u5024\u306F\u53C2\u7167\u30C6\u30FC\u30D6\u30EB\u306E\u30D5\u30A1\u30A4\u30EB\u540D\u3068\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059",image_panel_title:"\u753B\u50CF",image_folder_label:"\u30BD\u30FC\u30B9\u30D5\u30A9\u30EB\u30C0\u30FC\uFF08\u4EFB\u610F\uFF09",image_folder_placeholder:"\u4F8B\uFF1Aimages/covers",image_picker_title:"\u753B\u50CF\u3092\u9078\u629E",image_picker_clear:"\u30AF\u30EA\u30A2",image_picker_empty_vault:"\u4FDD\u7BA1\u5EAB\u306B\u753B\u50CF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",image_picker_empty_folder:"\u753B\u50CF\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\uFF1A",image_select_placeholder:"\u753B\u50CF\u3092\u9078\u629E\u2026",agg_none:"\u306A\u3057",agg_count:"\u30AB\u30A6\u30F3\u30C8",agg_count_values:"\u5024\u3092\u30AB\u30A6\u30F3\u30C8",agg_sum:"\u5408\u8A08",agg_avg:"\u5E73\u5747",agg_min:"\u6700\u5C0F",agg_max:"\u6700\u5927",no_database_open:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u958B\u304B\u308C\u3066\u3044\u307E\u305B\u3093\u3002",no_database_hint:"\u30EA\u30DC\u30F3\u30DC\u30BF\u30F3\u307E\u305F\u306F\u300C\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210\u300D\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u304F\u3060\u3055\u3044\u3002",loading:"\u8AAD\u307F\u8FBC\u307F\u4E2D...",no_results:"\u9805\u76EE\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093",item_singular:"\u4EF6",item_plural:"\u4EF6",row_singular:"\u884C",row_plural:"\u884C",record_singular:"\u30EC\u30B3\u30FC\u30C9",record_plural:"\u30EC\u30B3\u30FC\u30C9",add_row:"\u65B0\u3057\u3044\u884C",add_entry:"\u65B0\u3057\u3044\u30A8\u30F3\u30C8\u30EA\u30FC",add_card:"\u65B0\u3057\u3044\u30AB\u30FC\u30C9",new_field:"\u65B0\u3057\u3044\u30D5\u30A3\u30FC\u30EB\u30C9",add_field:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8FFD\u52A0",board_no_select_col:"\u30DC\u30FC\u30C9\u306B\u306F\u30AB\u30FC\u30C9\u3092\u30B0\u30EB\u30FC\u30D7\u5316\u3059\u308B\u305F\u3081\u306E\u9078\u629E\u307E\u305F\u306F\u30B9\u30C6\u30FC\u30BF\u30B9\u5217\u304C\u5FC5\u8981\u3067\u3059\u3002",board_add_select_hint:"\u30C6\u30FC\u30D6\u30EB\u30D3\u30E5\u30FC\u3067\u305D\u306E\u30BF\u30A4\u30D7\u306E\u5217\u3092\u8FFD\u52A0\u3057\u3066\u304B\u3089\u3001\u3053\u3053\u306B\u623B\u3063\u3066\u304F\u3060\u3055\u3044\u3002",board_drag_reorder:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u4E26\u3079\u66FF\u3048",board_set_limit:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30AB\u30FC\u30C9\u5236\u9650\u3092\u8A2D\u5B9A",board_limit_placeholder:"\u5236\u9650 (0 = \u306A\u3057)",board_show_more:"\u4EF6\u4EE5\u4E0A",board_show_less:"\u6298\u308A\u305F\u305F\u3080",hide_empty_cols:"\u7A7A\u3092\u975E\u8868\u793A",hide_no_value_cols:"\u5024\u306A\u3057\u3092\u975E\u8868\u793A",calendar_no_date_field:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u65E5\u4ED8\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30AB\u30EC\u30F3\u30C0\u30FC\u3092\u8868\u793A\u3057\u307E\u3059\u3002",calendar_no_date_section:"\u65E5\u4ED8\u306A\u3057",calendar_click_to_create:"\u30AF\u30EA\u30C3\u30AF\u3057\u3066\u30CE\u30FC\u30C8\u3092\u4F5C\u6210",calendar_today:"\u4ECA\u65E5",calendar_prev_month:"\u524D\u6708",calendar_next_month:"\u7FCC\u6708",calendar_view_month:"\u6708",calendar_view_week:"\u9031",calendar_prev_week:"\u524D\u9031",calendar_next_week:"\u7FCC\u9031",calendar_add_time:"\u6642\u523B\u3092\u8FFD\u52A0",calendar_remove_time:"\u6642\u523B\u3092\u524A\u9664",calendar_all_day:"\u7D42\u65E5",day_sun:"\u65E5",day_mon:"\u6708",day_tue:"\u706B",day_wed:"\u6C34",day_thu:"\u6728",day_fri:"\u91D1",day_sat:"\u571F",month_january:"1\u6708",month_february:"2\u6708",month_march:"3\u6708",month_april:"4\u6708",month_may:"5\u6708",month_june:"6\u6708",month_july:"7\u6708",month_august:"8\u6708",month_september:"9\u6708",month_october:"10\u6708",month_november:"11\u6708",month_december:"12\u6708",timeline_no_start_field:"\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u958B\u59CB\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u9078\u629E\u3057\u3066\u30BF\u30A4\u30E0\u30E9\u30A4\u30F3\u3092\u8868\u793A\u3057\u307E\u3059\u3002",timeline_no_interval:"\u9593\u9694\u306A\u3057",timeline_scroll_prev:"\u524D\u306B\u30B9\u30AF\u30ED\u30FC\u30EB",timeline_scroll_next:"\u6B21\u306B\u30B9\u30AF\u30ED\u30FC\u30EB",zoom_days:"\u65E5",zoom_weeks:"\u9031",zoom_months:"\u6708",month_short_jan:"1\u6708",month_short_feb:"2\u6708",month_short_mar:"3\u6708",month_short_apr:"4\u6708",month_short_may:"5\u6708",month_short_jun:"6\u6708",month_short_jul:"7\u6708",month_short_aug:"8\u6708",month_short_sep:"9\u6708",month_short_oct:"10\u6708",month_short_nov:"11\u6708",month_short_dec:"12\u6708",hierarchy_toggle:"\u968E\u5C64\u3068\u3057\u3066\u4F7F\u7528",hierarchy_toggle_hint:"\u3053\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306E\u884C\u9593\u306B\u89AA\u5B50\u95A2\u4FC2\u3092\u6709\u52B9\u306B\u3057\u307E\u3059",add_subrow:"\u30B5\u30D6\u884C\u3092\u8FFD\u52A0",collapse_all:"\u3059\u3079\u3066\u6298\u308A\u305F\u305F\u3080",expand_all:"\u3059\u3079\u3066\u5C55\u958B",max_depth_reached:"\u6700\u5927\u306E\u6DF1\u3055\u306B\u9054\u3057\u307E\u3057\u305F\uFF083 \u30EC\u30D9\u30EB\uFF09",chart_configure:"\u8A2D\u5B9A",chart_type:"\u30B0\u30E9\u30D5\u306E\u7A2E\u985E",chart_type_bar:"\u68D2\u30B0\u30E9\u30D5",chart_type_line:"\u6298\u308C\u7DDA\u30B0\u30E9\u30D5",chart_type_pie:"\u5186\u30B0\u30E9\u30D5",chart_x_axis:"\u30AB\u30C6\u30B4\u30EA\u30FC (X \u8EF8)",chart_y_axis:"\u5024 (Y \u8EF8)",chart_aggregation:"\u96C6\u8A08",chart_select_column:"\u5217\u3092\u9078\u629E...",chart_count_records:"\u30AB\u30A6\u30F3\u30C8",chart_no_config:"\u30B0\u30E9\u30D5\u3092\u8A2D\u5B9A\u3057\u3066\u59CB\u3081\u307E\u3057\u3087\u3046\u3002",chart_no_config_hint:"\u4E0A\u306E\u30C4\u30FC\u30EB\u30D0\u30FC\u3067\u30AB\u30C6\u30B4\u30EA\u30FC\u7528\u306E\u5217\u3092\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044\u3002",tooltip_pin_column:"\u3053\u3053\u307E\u3067\u306E\u5217\u3092\u56FA\u5B9A",tooltip_unpin_column:"\u5217\u306E\u56FA\u5B9A\u3092\u89E3\u9664",tooltip_resize_column:"\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u30B5\u30A4\u30BA\u5909\u66F4\uFF1B\u30C0\u30D6\u30EB\u30AF\u30EA\u30C3\u30AF\u3067\u5185\u5BB9\u306B\u5408\u308F\u305B\u308B",tooltip_wrap_text:"\u30C6\u30AD\u30B9\u30C8\u306E\u6298\u308A\u8FD4\u3057",tooltip_include_subfolders:"\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u30FC\u3092\u542B\u3081\u308B",folder_column:"\u30D5\u30A9\u30EB\u30C0\u30FC",tooltip_manage_fields:"\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u7BA1\u7406",tooltip_batch_actions:"\u4E00\u62EC\u64CD\u4F5C",tooltip_remove_filter:"\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u524A\u9664",hide_filters:"\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u975E\u8868\u793A",show_filters:"\u30D5\u30A3\u30EB\u30BF\u30FC\u3092\u8868\u793A",filters_count_one:"1 \u4EF6\u306E\u30D5\u30A3\u30EB\u30BF\u30FC",filters_count_other:"{n} \u4EF6\u306E\u30D5\u30A3\u30EB\u30BF\u30FC",tooltip_close:"\u9589\u3058\u308B",tooltip_remove:"\u524A\u9664",tooltip_move_up:"\u4E0A\u306B\u79FB\u52D5",tooltip_move_down:"\u4E0B\u306B\u79FB\u52D5",tooltip_change_color:"\u8272\u3092\u5909\u66F4",tooltip_delete_status:"\u30B9\u30C6\u30FC\u30BF\u30B9\u3092\u524A\u9664",status_not_started:"\u672A\u7740\u624B",status_in_progress:"\u9032\u884C\u4E2D",status_done:"\u5B8C\u4E86",status_cancelled:"\u30AD\u30E3\u30F3\u30BB\u30EB\u6E08\u307F",relation_search_placeholder:"\u691C\u7D22...",relation_clear:"\u30AF\u30EA\u30A2",relation_no_results:"\u7D50\u679C\u306A\u3057",relation_two_way:"\u53CC\u65B9\u5411\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3",relation_two_way_hint:"\u5BFE\u8C61\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u9006\u65B9\u5411\u306E\u30EA\u30EC\u30FC\u30B7\u30E7\u30F3\u3092\u81EA\u52D5\u7684\u306B\u4F5C\u6210\u3057\u307E\u3059",select_clear:"\u30AF\u30EA\u30A2",select_create_placeholder:"\u65B0\u3057\u3044\u30AA\u30D7\u30B7\u30E7\u30F3\u3092\u4F5C\u6210...",status_new_placeholder:"\u65B0\u3057\u3044\u30B9\u30C6\u30FC\u30BF\u30B9...",color_custom:"\u30AB\u30B9\u30BF\u30E0",validate_non_numeric:'\u30BB\u30EB\u306B\u6570\u5024\u3067\u306A\u3044\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_dates:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u65E5\u4ED8\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_checkbox:'\u30BB\u30EB\u306B\u30C1\u30A7\u30C3\u30AF\u30DC\u30C3\u30AF\u30B9\u3068\u4E92\u63DB\u6027\u306E\u306A\u3044\u5024\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_multiselect_to_select:"\u884C\u306B\u8907\u6570\u306E\u5024\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u3059\u3002\u5358\u4E00\u9078\u629E\u306B\u5909\u66F4\u3059\u308B\u524D\u306B\u4F59\u5206\u306A\u5024\u3092\u524A\u9664\u3057\u3066\u304F\u3060\u3055\u3044\u3002",validate_invalid_email:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_url:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044 URL \u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_invalid_phone:'\u30BB\u30EB\u306B\u6709\u52B9\u3067\u306A\u3044\u96FB\u8A71\u756A\u53F7\u304C\u542B\u307E\u308C\u3066\u3044\u307E\u3059\uFF08\u4F8B\uFF1A"',validate_type_change_prefix:"\u30BF\u30A4\u30D7\u3092\u5909\u66F4\u3067\u304D\u307E\u305B\u3093\uFF1A",email_invalid:"\u7121\u52B9\u306A\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",op_is:"\u7B49\u3057\u3044",op_is_not:"\u7B49\u3057\u304F\u306A\u3044",op_contains:"\u542B\u3080",op_not_contains:"\u542B\u307E\u306A\u3044",op_starts_with:"\u3067\u59CB\u307E\u308B",op_ends_with:"\u3067\u7D42\u308F\u308B",op_is_empty:"\u7A7A\u3067\u3042\u308B",op_is_not_empty:"\u7A7A\u3067\u306A\u3044",op_gt:">",op_gte:">=",op_lt:"<",op_lte:"<=",op_is_checked:"\u30C1\u30A7\u30C3\u30AF\u6E08\u307F",op_is_unchecked:"\u672A\u30C1\u30A7\u30C3\u30AF",settings_db_filename_name:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u30D5\u30A1\u30A4\u30EB\u540D",settings_db_filename_desc:"\u30D5\u30A9\u30EB\u30C0\u30FC\u5185\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u8B58\u5225\u3059\u308B\u7279\u5225\u306A\u30D5\u30A1\u30A4\u30EB\u306E\u540D\u524D\u3002",settings_row_height_name:"\u30C7\u30D5\u30A9\u30EB\u30C8\u306E\u884C\u306E\u9AD8\u3055",settings_row_height_desc:"\u5404\u30C6\u30FC\u30D6\u30EB\u884C\u306E\u30D4\u30AF\u30BB\u30EB\u9AD8\u3055\u3002",settings_inline_fields_name:"Dataview \u30A4\u30F3\u30E9\u30A4\u30F3\u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u8AAD\u307F\u53D6\u308B",settings_inline_fields_desc:"\u30CE\u30FC\u30C8\u672C\u6587\u306E key:: value \u30D5\u30A3\u30FC\u30EB\u30C9\u3092\u89E3\u6790\u3057\u3001\u5217\u306E\u5024\u3068\u3057\u3066\u8868\u793A\u3057\u307E\u3059\uFF08\u8AAD\u307F\u53D6\u308A\u5C02\u7528\uFF09",db_untitled_note:"\u7121\u984C",db_copy_suffix:"(\u30B3\u30D4\u30FC)",db_copy_suffix_n:"(\u30B3\u30D4\u30FC $n)",db_already_exists:'"$folder" \u306B\u306F\u3059\u3067\u306B\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u5B58\u5728\u3057\u307E\u3059',db_tip_body:"\u3053\u306E\u30D5\u30A1\u30A4\u30EB\u306F\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3067\u3059\u3002\u30C6\u30FC\u30D6\u30EB\u30D3\u30E5\u30FC\u3092\u8868\u793A\u3059\u308B\u306B\u306F\u958B\u3044\u3066\u304F\u3060\u3055\u3044\u3002",formula_err_unclosed_string:"\u4F4D\u7F6E $pos \u3067\u6587\u5B57\u5217\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093",formula_err_unclosed_bracket:"\u4F4D\u7F6E $pos \u3067\u62EC\u5F27\u304C\u9589\u3058\u3089\u308C\u3066\u3044\u307E\u305B\u3093",formula_err_unexpected_bang:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57 '!'",formula_err_unexpected_char:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u6587\u5B57 '$char'",formula_err_expected_token:"\u4F4D\u7F6E $pos \u3067 $expected \u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001'$found' \u304C\u898B\u3064\u304B\u308A\u307E\u3057\u305F",formula_err_unexpected_token:"\u4F4D\u7F6E $pos \u3067\u4E88\u671F\u3057\u306A\u3044\u30C8\u30FC\u30AF\u30F3 '$token'",formula_err_circular_ref:'\u5FAA\u74B0\u53C2\u7167\uFF1A"$name" \u306F\u6570\u5F0F\u5217\u3067\u3059',formula_err_unknown_fn:"\u4E0D\u660E\u306A\u95A2\u6570\uFF1A$fn()",formula_err_if_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Aif(\u6761\u4EF6, \u771F\u306E\u5024, [\u507D\u306E\u5024])",formula_err_avg_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Aavg(\u5217) \u2014 \u5217\u53C2\u7167\u304C\u5F15\u6570\u3068\u3057\u3066\u5FC5\u8981",formula_err_count_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Acount(\u5217) \u2014 \u5217\u53C2\u7167\u304C\u5F15\u6570\u3068\u3057\u3066\u5FC5\u8981",formula_err_mid_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Amid(\u30C6\u30AD\u30B9\u30C8, \u958B\u59CB, \u9577\u3055)",formula_err_mod_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Amod(\u6570\u5024, \u9664\u6570)",formula_err_sqrt_args:"\u671F\u5F85\u3055\u308C\u308B\u5F62\u5F0F\uFF1Asqrt(\u6570\u5024)",formula_err_not_implemented:"\u672A\u5B9F\u88C5\u306E\u95A2\u6570\uFF1A$fn()",plugin_display_name:"Notion bases",no_databases_found:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u304C\u898B\u3064\u304B\u308A\u307E\u305B\u3093\u3002\u300C\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210\u300D\u30B3\u30DE\u30F3\u30C9\u3092\u4F7F\u7528\u3057\u3066\u4F5C\u6210\u3057\u3066\u304F\u3060\u3055\u3044\u3002",cmd_open_database:"\u3053\u306E\u30D5\u30A9\u30EB\u30C0\u30FC\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u958B\u304F",cmd_create_database:"\u73FE\u5728\u306E\u30D5\u30A9\u30EB\u30C0\u30FC\u306B\u65B0\u3057\u3044\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210",ctx_create_database:"\u3053\u3053\u306B\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u4F5C\u6210",arr_settings_title:"\u30D5\u30A9\u30EB\u30C0\u30FC\u6574\u7406",arr_settings_desc:"\u9078\u629E\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u5024\u306B\u57FA\u3065\u3044\u3066\u3001\u884C\u30D5\u30A1\u30A4\u30EB\u3092\u9806\u756A\u306B\u30CD\u30B9\u30C8\u3055\u308C\u305F\u30B5\u30D6\u30D5\u30A9\u30EB\u30C0\u30FC\u3078\u81EA\u52D5\u7684\u306B\u79FB\u52D5\u3057\u307E\u3059\u3002",arr_settings_enabled_name:"\u30D5\u30A9\u30EB\u30C0\u30FC\u6574\u7406\u3092\u6709\u52B9\u306B\u3059\u308B",arr_settings_enabled_desc:"\u6709\u52B9\u306B\u3059\u308B\u3068\u3001\u9078\u629E\u3057\u305F\u30D7\u30ED\u30D1\u30C6\u30A3\u306E\u3044\u305A\u308C\u304B\u304C\u5909\u66F4\u3055\u308C\u308B\u3068\u3059\u3050\u306B\u884C\u304C\u79FB\u52D5\u3055\u308C\u307E\u3059\u3002\u30C7\u30D5\u30A9\u30EB\u30C8\u306F\u30AA\u30D5\u3067\u3059\u3002",arr_settings_no_props:"\u30D7\u30ED\u30D1\u30C6\u30A3\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093\u3002\u4E0B\u306B\u8FFD\u52A0\u3057\u3066\u30D5\u30A9\u30EB\u30C0\u30FC\u968E\u5C64\u3092\u5B9A\u7FA9\u3057\u3066\u304F\u3060\u3055\u3044\u3002",arr_settings_no_candidates:"\u5BFE\u8C61\u3068\u306A\u308B\u5217\u304C\u3042\u308A\u307E\u305B\u3093\u3002\u30D5\u30A9\u30EB\u30C0\u30FC\u6574\u7406\u306F\u30C6\u30AD\u30B9\u30C8\u3001\u9078\u629E\u3001\u30B9\u30C6\u30FC\u30BF\u30B9\u3001\u65E5\u4ED8\u5217\u306B\u5BFE\u5FDC\u3057\u3066\u3044\u307E\u3059\u3002",arr_settings_add_placeholder:"\u30D7\u30ED\u30D1\u30C6\u30A3\u3092\u9078\u629E...",arr_settings_add_btn:"\u8FFD\u52A0",arr_settings_preview_btn:"\u30D7\u30EC\u30D3\u30E5\u30FC\u3057\u3066\u65E2\u5B58\u306E\u884C\u306B\u9069\u7528",arr_preview_title:"\u30D5\u30A9\u30EB\u30C0\u30FC\u6574\u7406\u306E\u30D7\u30EC\u30D3\u30E5\u30FC",arr_preview_empty:"\u79FB\u52D5\u304C\u5FC5\u8981\u306A\u884C\u306F\u3042\u308A\u307E\u305B\u3093\u3002",arr_preview_desc:"$count \u884C\u304C\u79FB\u52D5\u3055\u308C\u307E\u3059\uFF1A",arr_preview_apply:"\u9069\u7528",arr_preview_cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",arr_preview_applied:"$count \u884C\u3092\u79FB\u52D5\u3057\u307E\u3057\u305F\u3002",cmd_quick_add:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u884C\u3092\u3059\u3070\u3084\u304F\u8FFD\u52A0",quick_add_title:"\u30AF\u30A4\u30C3\u30AF\u8FFD\u52A0",quick_add_note_title:"\u30BF\u30A4\u30C8\u30EB",quick_add_note_title_placeholder:"\u30CE\u30FC\u30C8\u306E\u30BF\u30A4\u30C8\u30EB...",quick_add_create:"\u4F5C\u6210",quick_add_create_and_open:"\u4F5C\u6210\u3057\u3066\u958B\u304F",quick_add_no_visible_fields:"\u3053\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u7DE8\u96C6\u53EF\u80FD\u306A\u30D5\u30A3\u30FC\u30EB\u30C9\u304C\u3042\u308A\u307E\u305B\u3093",picker_placeholder:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u3092\u9078\u629E...",picker_root:"/\uFF08\u30EB\u30FC\u30C8\uFF09",view_fallback_name:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9",saving:"\u4FDD\u5B58\u4E2D",saved:"\u4FDD\u5B58\u6E08\u307F",save_error:"\u4FDD\u5B58\u30A8\u30E9\u30FC",settings_page_size_name:"1\u30DA\u30FC\u30B8\u3042\u305F\u308A\u306E\u884C\u6570",settings_page_size_desc:"1\u30DA\u30FC\u30B8\u306B\u8868\u793A\u3059\u308B\u884C\u6570\u3002\u300C\u3059\u3079\u3066\u300D\u306B\u8A2D\u5B9A\u3059\u308B\u3068\u9023\u7D9A\u30B9\u30AF\u30ED\u30FC\u30EB\u306B\u306A\u308A\u307E\u3059",settings_page_size_all:"\u3059\u3079\u3066\uFF08\u9023\u7D9A\u30B9\u30AF\u30ED\u30FC\u30EB\uFF09",page_of:"{current} / {total} \u30DA\u30FC\u30B8",first_page:"\u6700\u521D\u306E\u30DA\u30FC\u30B8",last_page:"\u6700\u5F8C\u306E\u30DA\u30FC\u30B8",prev_page:"\u524D\u306E\u30DA\u30FC\u30B8",next_page:"\u6B21\u306E\u30DA\u30FC\u30B8",conditional_formatting:"\u6761\u4EF6\u4ED8\u304D\u66F8\u5F0F",no_conditional_formats:"\u30EB\u30FC\u30EB\u306F\u307E\u3060\u3042\u308A\u307E\u305B\u3093",add_rule:"\u30EB\u30FC\u30EB\u3092\u8FFD\u52A0",select_value:"\u5024\u3092\u9078\u629E",style:"\u30B9\u30BF\u30A4\u30EB",background:"\u80CC\u666F",text_color:"\u30C6\u30AD\u30B9\u30C8\u306E\u8272",save:"\u4FDD\u5B58",cancel:"\u30AD\u30E3\u30F3\u30BB\u30EB",value:"\u5024",db_settings_open:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u8A2D\u5B9A",db_settings_title:"\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u8A2D\u5B9A",db_settings_template_name:"\u884C\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8",db_settings_template_desc:"\u3053\u306E\u30C7\u30FC\u30BF\u30D9\u30FC\u30B9\u306B\u65B0\u3057\u304F\u4F5C\u6210\u3055\u308C\u308B\u3059\u3079\u3066\u306E\u884C\u306E\u672C\u6587\u306B\u3053\u306E\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9069\u7528\u3057\u307E\u3059\u3002",db_settings_template_choose:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9078\u629E",db_settings_template_clear:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u524A\u9664",db_settings_template_none:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u304C\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093",db_settings_ask_name:"\u4F5C\u6210\u6642\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u78BA\u8A8D\u3059\u308B",db_settings_ask_desc:"\u30C7\u30D5\u30A9\u30EB\u30C8\u3092\u9069\u7528\u3059\u308B\u4EE3\u308F\u308A\u306B\u3001\u65B0\u3057\u3044\u884C\u3092\u8FFD\u52A0\u3059\u308B\u305F\u3073\u306B\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9078\u629E\u3059\u308B\u3088\u3046\u4FC3\u3057\u307E\u3059\u3002",template_picker_placeholder:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u3092\u9078\u629E...",template_picker_none:"\u30C6\u30F3\u30D7\u30EC\u30FC\u30C8\u306A\u3057\uFF08\u672C\u6587\u3092\u7A7A\u306B\u3059\u308B\uFF09"},Xm=uy;var cy={en:wc,"pt-BR":Cc,pt:Cc,es:qm,fr:Km,de:Ym,zh:kc,"zh-TW":kc,ja:Xm};function u(e){let t=(0,Qm.getLanguage)()??"en";return(cy[t]??{})[e]??wc[e]??e}var Eb=require("obsidian");var zm=Re(xt(),1),Fb=Re(Hp(),1);var wu=Re(xt(),1),Sl=(0,wu.createContext)(null);function zt(){let e=(0,wu.useContext)(Sl);if(!e)throw new Error("useApp deve ser usado dentro de AppContext.Provider");return e}var Et=Re(xt(),1);var ia=require("obsidian");var Th=require("obsidian");var ra=class extends Th.FuzzySuggestModal{constructor(t,n,o){super(t),this.onChoose=n,this.preferredFolder=o??this.getCoreTemplatesFolder(),this.setPlaceholder(u("template_picker_placeholder"))}getCoreTemplatesFolder(){let n=this.app.internalPlugins?.plugins?.templates?.instance?.options?.folder;return typeof n=="string"&&n?n:null}getItems(){let t={file:null,label:u("template_picker_none")},n=this.app.vault.getMarkdownFiles().filter(a=>this.app.metadataCache.getFileCache(a)?.frontmatter?.["notion-bases"]!==!0),o=this.preferredFolder?n.filter(a=>a.path.startsWith(`${this.preferredFolder}/`)):[],r=o.length>0?n.filter(a=>!o.includes(a)):n,i=[...o.sort((a,l)=>a.path.localeCompare(l.path)),...r.sort((a,l)=>a.path.localeCompare(l.path))];return[t,...i.map(a=>({file:a,label:a.path}))]}getItemText(t){return t.label}onChooseItem(t){this.onChoose(t.file?.path??null)}};var ku=require("obsidian");var Cu=class extends ku.Modal{constructor(n,o,r,i){super(n);this.manager=o;this.dbFile=r;this.config=i}onOpen(){let{contentEl:n}=this;n.empty(),n.createEl("h2",{text:u("arr_preview_title")});let o=this.manager.previewArrangement(this.dbFile,this.config).filter(l=>l.to!==null);if(o.length===0)n.createEl("p",{text:u("arr_preview_empty")});else{n.createEl("p",{text:u("arr_preview_desc").replace("$count",String(o.length))});let l=n.createEl("div",{cls:"nb-arr-preview-list"});for(let s of o){let d=l.createEl("div",{cls:"nb-arr-preview-row"});d.createSpan({cls:"nb-arr-preview-from",text:s.from}),d.createSpan({cls:"nb-arr-preview-arrow",text:"\u2192"}),d.createSpan({cls:"nb-arr-preview-to",text:s.to??""})}}let r=n.createEl("div",{cls:"nb-arr-preview-actions"}),i=r.createEl("button",{text:u("arr_preview_cancel")});i.onclick=()=>this.close();let a=r.createEl("button",{text:u("arr_preview_apply"),cls:"mod-cta"});a.disabled=o.length===0,a.onclick=async()=>{a.disabled=!0,i.disabled=!0;let l=await this.manager.applyArrangementToAll(this.dbFile,this.config);new ku.Notice(u("arr_preview_applied").replace("$count",String(l.length))),this.close()}}onClose(){this.contentEl.empty()}};var Mh=["text","select","status","date"],Su=class extends ia.Modal{constructor(t,n,o,r,i){super(t),this.config=n,this.onSave=o,this.manager=r??null,this.dbFile=i??null}onOpen(){let{contentEl:t}=this;t.empty(),t.createEl("h2",{text:u("db_settings_title")});let n=new ia.Setting(t).setName(u("db_settings_template_name")).setDesc(u("db_settings_template_desc")),o=t.createDiv({cls:"nb-db-settings-template-path"}),r=()=>{o.empty(),o.setText(this.config.templatePath??u("db_settings_template_none"))};r(),n.addButton(i=>i.setButtonText(u("db_settings_template_choose")).onClick(()=>{new ra(this.app,a=>{this.config={...this.config,templatePath:a??void 0},r(),this.onSave({templatePath:this.config.templatePath})}).open()})),this.config.templatePath&&n.addExtraButton(i=>i.setIcon("x").setTooltip(u("db_settings_template_clear")).onClick(async()=>{this.config={...this.config,templatePath:void 0},r(),await this.onSave({templatePath:void 0}),this.onOpen()})),new ia.Setting(t).setName(u("db_settings_ask_name")).setDesc(u("db_settings_ask_desc")).addToggle(i=>i.setValue(!!this.config.askTemplateOnCreate).onChange(async a=>{this.config={...this.config,askTemplateOnCreate:a},await this.onSave({askTemplateOnCreate:a})})),this.renderArrangementSection(t)}renderArrangementSection(t){let n=t.createDiv({cls:"nb-db-settings-arrangement"});n.createEl("h3",{text:u("arr_settings_title")}),n.createEl("p",{text:u("arr_settings_desc"),cls:"nb-db-settings-arrangement-desc"});let o=this.config.folderArrangement?{enabled:!!this.config.folderArrangement.enabled,propertyIds:[...this.config.folderArrangement.propertyIds]}:{enabled:!1,propertyIds:[]},r=async()=>{this.config={...this.config,folderArrangement:o},await this.onSave({folderArrangement:o})};new ia.Setting(n).setName(u("arr_settings_enabled_name")).setDesc(u("arr_settings_enabled_desc")).addToggle(p=>p.setValue(o.enabled).onChange(async f=>{o.enabled=f,await r()}));let i=this.config.schema.filter(p=>Mh.includes(p.type)&&!o.propertyIds.includes(p.id)),a=n.createDiv({cls:"nb-arr-property-list"}),l=()=>{if(a.empty(),o.propertyIds.length===0){a.createEl("p",{text:u("arr_settings_no_props"),cls:"nb-arr-empty"});return}o.propertyIds.forEach((p,f)=>{let m=this.config.schema.find(_=>_.id===p),c=a.createDiv({cls:"nb-arr-property-row"});c.createSpan({cls:"nb-arr-property-index",text:String(f+1)}),c.createSpan({cls:"nb-arr-property-name",text:m?.name??p});let v=c.createEl("button",{text:"\u2191",cls:"nb-arr-btn"});v.disabled=f===0,v.onclick=async()=>{[o.propertyIds[f-1],o.propertyIds[f]]=[o.propertyIds[f],o.propertyIds[f-1]],await r(),l()};let h=c.createEl("button",{text:"\u2193",cls:"nb-arr-btn"});h.disabled=f===o.propertyIds.length-1,h.onclick=async()=>{[o.propertyIds[f+1],o.propertyIds[f]]=[o.propertyIds[f],o.propertyIds[f+1]],await r(),l()};let b=c.createEl("button",{text:"\xD7",cls:"nb-arr-btn nb-arr-btn-remove"});b.onclick=async()=>{o.propertyIds.splice(f,1),await r(),l(),d()}})},s=n.createDiv({cls:"nb-arr-add-row"}),d=()=>{s.empty();let p=this.config.schema.filter(c=>Mh.includes(c.type)&&!o.propertyIds.includes(c.id));if(p.length===0&&i.length===0){s.createEl("p",{text:u("arr_settings_no_candidates"),cls:"nb-arr-empty"});return}if(p.length===0)return;let f=s.createEl("select",{cls:"nb-arr-select"});f.createEl("option",{text:u("arr_settings_add_placeholder"),value:""});for(let c of p)f.createEl("option",{text:c.name,value:c.id});let m=s.createEl("button",{text:u("arr_settings_add_btn"),cls:"mod-cta nb-arr-add-btn"});m.onclick=async()=>{let c=f.value;c&&(o.propertyIds.push(c),await r(),l(),d())}};if(l(),d(),this.manager&&this.dbFile){let p=n.createEl("button",{text:u("arr_settings_preview_btn"),cls:"nb-arr-preview-btn"});p.onclick=()=>{!this.manager||!this.dbFile||new Cu(this.app,this.manager,this.dbFile,{...this.config,folderArrangement:o}).open()}}}onClose(){this.contentEl.empty()}};var Jn={id:"default",type:"table",filters:[],sorts:[],hiddenColumns:[],columnWidths:{},pinnedColumnId:null},Rr={schema:[],views:[Jn]};var Rl=Re(xt(),1);function Er(e,t){return typeof e=="function"?e(t):e}function eo(e,t){return n=>{t.setState(o=>({...o,[e]:Er(n,o[e])}))}}function Eu(e){return e instanceof Function}function EC(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function FC(e,t){let n=[],o=r=>{r.forEach(i=>{n.push(i);let a=t(i);a!=null&&a.length&&o(a)})};return o(e),n}function Ke(e,t,n){let o=[],r;return i=>{let a;n.key&&n.debug&&(a=Date.now());let l=e(i);if(!(l.length!==o.length||l.some((p,f)=>o[f]!==p)))return r;o=l;let d;if(n.key&&n.debug&&(d=Date.now()),r=t(...l),n==null||n.onChange==null||n.onChange(r),n.key&&n.debug&&n!=null&&n.debug()){let p=Math.round((Date.now()-a)*100)/100,f=Math.round((Date.now()-d)*100)/100,m=f/16,c=(v,h)=>{for(v=String(v);v.length<h;)v=" "+v;return v};console.info(`%c\u23F1 ${c(f,5)} /${c(p,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*m,120))}deg 100% 31%);`,n?.key)}return r}}function Ye(e,t,n,o){return{debug:()=>{var r;return(r=e?.debugAll)!=null?r:e[t]},key:!1,onChange:o}}function DC(e,t,n,o){let r=()=>{var a;return(a=i.getValue())!=null?a:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(o),renderValue:r,getContext:Ke(()=>[e,n,t,i],(a,l,s,d)=>({table:a,column:l,row:s,cell:d,getValue:d.getValue,renderValue:d.renderValue}),Ye(e.options,"debugCells","cell.getContext"))};return e._features.forEach(a=>{a.createCell==null||a.createCell(i,n,t,e)},{}),i}function TC(e,t,n,o){var r,i;let l={...e._getDefaultColumnDef(),...t},s=l.accessorKey,d=(r=(i=l.id)!=null?i:s?typeof String.prototype.replaceAll=="function"?s.replaceAll(".","_"):s.replace(/\./g,"_"):void 0)!=null?r:typeof l.header=="string"?l.header:void 0,p;if(l.accessorFn?p=l.accessorFn:s&&(s.includes(".")?p=m=>{let c=m;for(let h of s.split(".")){var v;c=(v=c)==null?void 0:v[h]}return c}:p=m=>m[l.accessorKey]),!d)throw new Error;let f={id:`${String(d)}`,accessorFn:p,parent:o,depth:n,columnDef:l,columns:[],getFlatColumns:Ke(()=>[!0],()=>{var m;return[f,...(m=f.columns)==null?void 0:m.flatMap(c=>c.getFlatColumns())]},Ye(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:Ke(()=>[e._getOrderColumnsFn()],m=>{var c;if((c=f.columns)!=null&&c.length){let v=f.columns.flatMap(h=>h.getLeafColumns());return m(v)}return[f]},Ye(e.options,"debugColumns","column.getLeafColumns"))};for(let m of e._features)m.createColumn==null||m.createColumn(f,e);return f}var wn="debugHeaders";function Ph(e,t,n){var o;let i={id:(o=n.id)!=null?o:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let a=[],l=s=>{s.subHeaders&&s.subHeaders.length&&s.subHeaders.map(l),a.push(s)};return l(i),a},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(a=>{a.createHeader==null||a.createHeader(i,e)}),i}var MC={createTable:e=>{e.getHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>{var i,a;let l=(i=o?.map(f=>n.find(m=>m.id===f)).filter(Boolean))!=null?i:[],s=(a=r?.map(f=>n.find(m=>m.id===f)).filter(Boolean))!=null?a:[],d=n.filter(f=>!(o!=null&&o.includes(f.id))&&!(r!=null&&r.includes(f.id)));return Nu(t,[...l,...d,...s],e)},Ye(e.options,wn,"getHeaderGroups")),e.getCenterHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o,r)=>(n=n.filter(i=>!(o!=null&&o.includes(i.id))&&!(r!=null&&r.includes(i.id))),Nu(t,n,e,"center")),Ye(e.options,wn,"getCenterHeaderGroups")),e.getLeftHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,o)=>{var r;let i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Nu(t,i,e,"left")},Ye(e.options,wn,"getLeftHeaderGroups")),e.getRightHeaderGroups=Ke(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,o)=>{var r;let i=(r=o?.map(a=>n.find(l=>l.id===a)).filter(Boolean))!=null?r:[];return Nu(t,i,e,"right")},Ye(e.options,wn,"getRightHeaderGroups")),e.getFooterGroups=Ke(()=>[e.getHeaderGroups()],t=>[...t].reverse(),Ye(e.options,wn,"getFooterGroups")),e.getLeftFooterGroups=Ke(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),Ye(e.options,wn,"getLeftFooterGroups")),e.getCenterFooterGroups=Ke(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),Ye(e.options,wn,"getCenterFooterGroups")),e.getRightFooterGroups=Ke(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),Ye(e.options,wn,"getRightFooterGroups")),e.getFlatHeaders=Ke(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ye(e.options,wn,"getFlatHeaders")),e.getLeftFlatHeaders=Ke(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ye(e.options,wn,"getLeftFlatHeaders")),e.getCenterFlatHeaders=Ke(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ye(e.options,wn,"getCenterFlatHeaders")),e.getRightFlatHeaders=Ke(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),Ye(e.options,wn,"getRightFlatHeaders")),e.getCenterLeafHeaders=Ke(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ye(e.options,wn,"getCenterLeafHeaders")),e.getLeftLeafHeaders=Ke(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ye(e.options,wn,"getLeftLeafHeaders")),e.getRightLeafHeaders=Ke(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var o;return!((o=n.subHeaders)!=null&&o.length)}),Ye(e.options,wn,"getRightLeafHeaders")),e.getLeafHeaders=Ke(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,o)=>{var r,i,a,l,s,d;return[...(r=(i=t[0])==null?void 0:i.headers)!=null?r:[],...(a=(l=n[0])==null?void 0:l.headers)!=null?a:[],...(s=(d=o[0])==null?void 0:d.headers)!=null?s:[]].map(p=>p.getLeafHeaders()).flat()},Ye(e.options,wn,"getLeafHeaders"))}};function Nu(e,t,n,o){var r,i;let a=0,l=function(m,c){c===void 0&&(c=1),a=Math.max(a,c),m.filter(v=>v.getIsVisible()).forEach(v=>{var h;(h=v.columns)!=null&&h.length&&l(v.columns,c+1)},0)};l(e);let s=[],d=(m,c)=>{let v={depth:c,id:[o,`${c}`].filter(Boolean).join("_"),headers:[]},h=[];m.forEach(b=>{let _=[...h].reverse()[0],g=b.column.depth===v.depth,y,k=!1;if(g&&b.column.parent?y=b.column.parent:(y=b.column,k=!0),_&&_?.column===y)_.subHeaders.push(b);else{let D=Ph(n,y,{id:[o,c,y.id,b?.id].filter(Boolean).join("_"),isPlaceholder:k,placeholderId:k?`${h.filter(M=>M.column===y).length}`:void 0,depth:c,index:h.length});D.subHeaders.push(b),h.push(D)}v.headers.push(b),b.headerGroup=v}),s.push(v),c>0&&d(h,c-1)},p=t.map((m,c)=>Ph(n,m,{depth:a,index:c}));d(p,a-1),s.reverse();let f=m=>m.filter(v=>v.column.getIsVisible()).map(v=>{let h=0,b=0,_=[0];v.subHeaders&&v.subHeaders.length?(_=[],f(v.subHeaders).forEach(y=>{let{colSpan:k,rowSpan:D}=y;h+=k,_.push(D)})):h=1;let g=Math.min(..._);return b=b+g,v.colSpan=h,v.rowSpan=b,{colSpan:h,rowSpan:b}});return f((r=(i=s[0])==null?void 0:i.headers)!=null?r:[]),s}var nm=(e,t,n,o,r,i,a)=>{let l={id:t,index:o,original:n,depth:r,parentId:a,_valuesCache:{},_uniqueValuesCache:{},getValue:s=>{if(l._valuesCache.hasOwnProperty(s))return l._valuesCache[s];let d=e.getColumn(s);if(d!=null&&d.accessorFn)return l._valuesCache[s]=d.accessorFn(l.original,o),l._valuesCache[s]},getUniqueValues:s=>{if(l._uniqueValuesCache.hasOwnProperty(s))return l._uniqueValuesCache[s];let d=e.getColumn(s);if(d!=null&&d.accessorFn)return d.columnDef.getUniqueValues?(l._uniqueValuesCache[s]=d.columnDef.getUniqueValues(l.original,o),l._uniqueValuesCache[s]):(l._uniqueValuesCache[s]=[l.getValue(s)],l._uniqueValuesCache[s])},renderValue:s=>{var d;return(d=l.getValue(s))!=null?d:e.options.renderFallbackValue},subRows:i??[],getLeafRows:()=>FC(l.subRows,s=>s.subRows),getParentRow:()=>l.parentId?e.getRow(l.parentId,!0):void 0,getParentRows:()=>{let s=[],d=l;for(;;){let p=d.getParentRow();if(!p)break;s.push(p),d=p}return s.reverse()},getAllCells:Ke(()=>[e.getAllLeafColumns()],s=>s.map(d=>DC(e,l,d,d.id)),Ye(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:Ke(()=>[l.getAllCells()],s=>s.reduce((d,p)=>(d[p.column.id]=p,d),{}),Ye(e.options,"debugRows","getAllCellsByColumnId"))};for(let s=0;s<e._features.length;s++){let d=e._features[s];d==null||d.createRow==null||d.createRow(l,e)}return l},PC={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},Ih=(e,t,n)=>{var o,r;let i=n==null||(o=n.toString())==null?void 0:o.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(i))};Ih.autoRemove=e=>xo(e);var Ah=(e,t,n)=>{var o;return!!(!((o=e.getValue(t))==null||(o=o.toString())==null)&&o.includes(n))};Ah.autoRemove=e=>xo(e);var Oh=(e,t,n)=>{var o;return((o=e.getValue(t))==null||(o=o.toString())==null?void 0:o.toLowerCase())===n?.toLowerCase()};Oh.autoRemove=e=>xo(e);var $h=(e,t,n)=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(n)};$h.autoRemove=e=>xo(e);var zh=(e,t,n)=>!n.some(o=>{var r;return!((r=e.getValue(t))!=null&&r.includes(o))});zh.autoRemove=e=>xo(e)||!(e!=null&&e.length);var Vh=(e,t,n)=>n.some(o=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(o)});Vh.autoRemove=e=>xo(e)||!(e!=null&&e.length);var Bh=(e,t,n)=>e.getValue(t)===n;Bh.autoRemove=e=>xo(e);var jh=(e,t,n)=>e.getValue(t)==n;jh.autoRemove=e=>xo(e);var om=(e,t,n)=>{let[o,r]=n,i=e.getValue(t);return i>=o&&i<=r};om.resolveFilterValue=e=>{let[t,n]=e,o=typeof t!="number"?parseFloat(t):t,r=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(o)?-1/0:o,a=n===null||Number.isNaN(r)?1/0:r;if(i>a){let l=i;i=a,a=l}return[i,a]};om.autoRemove=e=>xo(e)||xo(e[0])&&xo(e[1]);var Zo={includesString:Ih,includesStringSensitive:Ah,equalsString:Oh,arrIncludes:$h,arrIncludesAll:zh,arrIncludesSome:Vh,equals:Bh,weakEquals:jh,inNumberRange:om};function xo(e){return e==null||e===""}var LC={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:eo("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);return typeof o=="string"?Zo.includesString:typeof o=="number"?Zo.inNumberRange:typeof o=="boolean"||o!==null&&typeof o=="object"?Zo.equals:Array.isArray(o)?Zo.arrIncludes:Zo.weakEquals},e.getFilterFn=()=>{var n,o;return Eu(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(o=t.options.filterFns)==null?void 0:o[e.columnDef.filterFn])!=null?n:Zo[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,o,r;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((o=t.options.enableColumnFilters)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(o=>o.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,o;return(n=(o=t.getState().columnFilters)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(o=>{let r=e.getFilterFn(),i=o?.find(p=>p.id===e.id),a=Er(n,i?i.value:void 0);if(Lh(r,a,e)){var l;return(l=o?.filter(p=>p.id!==e.id))!=null?l:[]}let s={id:e.id,value:a};if(i){var d;return(d=o?.map(p=>p.id===e.id?s:p))!=null?d:[]}return o!=null&&o.length?[...o,s]:[s]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns(),o=r=>{var i;return(i=Er(t,r))==null?void 0:i.filter(a=>{let l=n.find(s=>s.id===a.id);if(l){let s=l.getFilterFn();if(Lh(s,a.value,l))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(o)},e.resetColumnFilters=t=>{var n,o;e.setColumnFilters(t?[]:(n=(o=e.initialState)==null?void 0:o.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Lh(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}var IC=(e,t,n)=>n.reduce((o,r)=>{let i=r.getValue(e);return o+(typeof i=="number"?i:0)},0),AC=(e,t,n)=>{let o;return n.forEach(r=>{let i=r.getValue(e);i!=null&&(o>i||o===void 0&&i>=i)&&(o=i)}),o},OC=(e,t,n)=>{let o;return n.forEach(r=>{let i=r.getValue(e);i!=null&&(o<i||o===void 0&&i>=i)&&(o=i)}),o},$C=(e,t,n)=>{let o,r;return n.forEach(i=>{let a=i.getValue(e);a!=null&&(o===void 0?a>=a&&(o=r=a):(o>a&&(o=a),r<a&&(r=a)))}),[o,r]},zC=(e,t)=>{let n=0,o=0;if(t.forEach(r=>{let i=r.getValue(e);i!=null&&(i=+i)>=i&&(++n,o+=i)}),n)return o/n},VC=(e,t)=>{if(!t.length)return;let n=t.map(i=>i.getValue(e));if(!EC(n))return;if(n.length===1)return n[0];let o=Math.floor(n.length/2),r=n.sort((i,a)=>i-a);return n.length%2!==0?r[o]:(r[o-1]+r[o])/2},BC=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),jC=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,HC=(e,t)=>t.length,Up={sum:IC,min:AC,max:OC,extent:$C,mean:zC,median:VC,unique:BC,uniqueCount:jC,count:HC},UC={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:eo("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(o=>o!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,o;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((o=t.options.enableGrouping)!=null?o:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{let n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0],o=n?.getValue(e.id);if(typeof o=="number")return Up.sum;if(Object.prototype.toString.call(o)==="[object Date]")return Up.extent},e.getAggregationFn=()=>{var n,o;if(!e)throw new Error;return Eu(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(o=t.options.aggregationFns)==null?void 0:o[e.columnDef.aggregationFn])!=null?n:Up[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,o;e.setGrouping(t?[]:(n=(o=e.initialState)==null?void 0:o.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let o=t.getColumn(n);return o!=null&&o.columnDef.getGroupingValue?(e._groupingValuesCache[n]=o.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,o)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var r;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((r=n.subRows)!=null&&r.length)}}};function WC(e,t,n){if(!(t!=null&&t.length)||!n)return e;let o=e.filter(i=>!t.includes(i.id));return n==="remove"?o:[...t.map(i=>e.find(a=>a.id===i)).filter(Boolean),...o]}var GC={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:eo("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=Ke(n=>[xl(t,n)],n=>n.findIndex(o=>o.id===e.id),Ye(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var o;return((o=xl(t,n)[0])==null?void 0:o.id)===e.id},e.getIsLastColumn=n=>{var o;let r=xl(t,n);return((o=r[r.length-1])==null?void 0:o.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=Ke(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,o)=>r=>{let i=[];if(!(t!=null&&t.length))i=r;else{let a=[...t],l=[...r];for(;l.length&&a.length;){let s=a.shift(),d=l.findIndex(p=>p.id===s);d>-1&&i.push(l.splice(d,1)[0])}i=[...i,...l]}return WC(i,n,o)},Ye(e.options,"debugTable","_getOrderColumnsFn"))}},Wp=()=>({left:[],right:[]}),qC={getInitialState:e=>({columnPinning:Wp(),...e}),getDefaultOptions:e=>({onColumnPinningChange:eo("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{let o=e.getLeafColumns().map(r=>r.id).filter(Boolean);t.setColumnPinning(r=>{var i,a;if(n==="right"){var l,s;return{left:((l=r?.left)!=null?l:[]).filter(f=>!(o!=null&&o.includes(f))),right:[...((s=r?.right)!=null?s:[]).filter(f=>!(o!=null&&o.includes(f))),...o]}}if(n==="left"){var d,p;return{left:[...((d=r?.left)!=null?d:[]).filter(f=>!(o!=null&&o.includes(f))),...o],right:((p=r?.right)!=null?p:[]).filter(f=>!(o!=null&&o.includes(f)))}}return{left:((i=r?.left)!=null?i:[]).filter(f=>!(o!=null&&o.includes(f))),right:((a=r?.right)!=null?a:[]).filter(f=>!(o!=null&&o.includes(f)))}})},e.getCanPin=()=>e.getLeafColumns().some(o=>{var r,i,a;return((r=o.columnDef.enablePinning)!=null?r:!0)&&((i=(a=t.options.enableColumnPinning)!=null?a:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{let n=e.getLeafColumns().map(l=>l.id),{left:o,right:r}=t.getState().columnPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"left":a?"right":!1},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();return r?(n=(o=t.getState().columnPinning)==null||(o=o[r])==null?void 0:o.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,o,r)=>{let i=[...o??[],...r??[]];return n.filter(a=>!i.includes(a.column.id))},Ye(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),Ye(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=Ke(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,o)=>(o??[]).map(i=>n.find(a=>a.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),Ye(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,o;return e.setColumnPinning(t?Wp():(n=(o=e.initialState)==null?void 0:o.columnPinning)!=null?n:Wp())},e.getIsSomeColumnsPinned=t=>{var n;let o=e.getState().columnPinning;if(!t){var r,i;return!!((r=o.left)!=null&&r.length||(i=o.right)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e.getLeftLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),Ye(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(o=>t.find(r=>r.id===o)).filter(Boolean),Ye(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=Ke(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,o)=>{let r=[...n??[],...o??[]];return t.filter(i=>!r.includes(i.id))},Ye(e.options,"debugColumns","getCenterLeafColumns"))}};function KC(e){return e||(typeof document<"u"?document:null)}var xu={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Gp=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),YC={getDefaultColumnDef:()=>xu,getInitialState:e=>({columnSizing:{},columnSizingInfo:Gp(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:eo("columnSizing",e),onColumnSizingInfoChange:eo("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,o,r;let i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:xu.minSize,(o=i??e.columnDef.size)!=null?o:xu.size),(r=e.columnDef.maxSize)!=null?r:xu.maxSize)},e.getStart=Ke(n=>[n,xl(t,n),t.getState().columnSizing],(n,o)=>o.slice(0,e.getIndex(n)).reduce((r,i)=>r+i.getSize(),0),Ye(t.options,"debugColumns","getStart")),e.getAfter=Ke(n=>[n,xl(t,n),t.getState().columnSizing],(n,o)=>o.slice(e.getIndex(n)+1).reduce((r,i)=>r+i.getSize(),0),Ye(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:o,...r}=n;return r})},e.getCanResize=()=>{var n,o;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((o=t.options.enableColumnResizing)!=null?o:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0,o=r=>{if(r.subHeaders.length)r.subHeaders.forEach(o);else{var i;n+=(i=r.column.getSize())!=null?i:0}};return o(e),n},e.getStart=()=>{if(e.index>0){let n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{let o=t.getColumn(e.column.id),r=o?.getCanResize();return i=>{if(!o||!r||(i.persist==null||i.persist(),qp(i)&&i.touches&&i.touches.length>1))return;let a=e.getSize(),l=e?e.getLeafHeaders().map(_=>[_.column.id,_.column.getSize()]):[[o.id,o.getSize()]],s=qp(i)?Math.round(i.touches[0].clientX):i.clientX,d={},p=(_,g)=>{typeof g=="number"&&(t.setColumnSizingInfo(y=>{var k,D;let M=t.options.columnResizeDirection==="rtl"?-1:1,V=(g-((k=y?.startOffset)!=null?k:0))*M,j=Math.max(V/((D=y?.startSize)!=null?D:0),-.999999);return y.columnSizingStart.forEach(re=>{let[ne,ce]=re;d[ne]=Math.round(Math.max(ce+ce*j,0)*100)/100}),{...y,deltaOffset:V,deltaPercentage:j}}),(t.options.columnResizeMode==="onChange"||_==="end")&&t.setColumnSizing(y=>({...y,...d})))},f=_=>p("move",_),m=_=>{p("end",_),t.setColumnSizingInfo(g=>({...g,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},c=KC(n),v={moveHandler:_=>f(_.clientX),upHandler:_=>{c?.removeEventListener("mousemove",v.moveHandler),c?.removeEventListener("mouseup",v.upHandler),m(_.clientX)}},h={moveHandler:_=>(_.cancelable&&(_.preventDefault(),_.stopPropagation()),f(_.touches[0].clientX),!1),upHandler:_=>{var g;c?.removeEventListener("touchmove",h.moveHandler),c?.removeEventListener("touchend",h.upHandler),_.cancelable&&(_.preventDefault(),_.stopPropagation()),m((g=_.touches[0])==null?void 0:g.clientX)}},b=XC()?{passive:!1}:!1;qp(i)?(c?.addEventListener("touchmove",h.moveHandler,b),c?.addEventListener("touchend",h.upHandler,b)):(c?.addEventListener("mousemove",v.moveHandler,b),c?.addEventListener("mouseup",v.upHandler,b)),t.setColumnSizingInfo(_=>({..._,startOffset:s,startSize:a,deltaOffset:0,deltaPercentage:0,columnSizingStart:l,isResizingColumn:o.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Gp():(n=e.initialState.columnSizingInfo)!=null?n:Gp())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((o,r)=>o+r.getSize(),0))!=null?t:0}}},Ru=null;function XC(){if(typeof Ru=="boolean")return Ru;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Ru=e,Ru}function qp(e){return e.type==="touchstart"}var QC={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:eo("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(o=>({...o,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,o;let r=e.columns;return(n=r.length?r.some(i=>i.getIsVisible()):(o=t.getState().columnVisibility)==null?void 0:o[e.id])!=null?n:!0},e.getCanHide=()=>{var n,o;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((o=t.options.enableHiding)!=null?o:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=Ke(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(o=>o.column.getIsVisible()),Ye(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=Ke(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,o,r)=>[...n,...o,...r],Ye(t.options,"debugRows","getVisibleCells"))},createTable:e=>{let t=(n,o)=>Ke(()=>[o(),o().filter(r=>r.getIsVisible()).map(r=>r.id).join("_")],r=>r.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),Ye(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var o;e.setColumnVisibility(n?{}:(o=e.initialState.columnVisibility)!=null?o:{})},e.toggleAllColumnsVisible=n=>{var o;n=(o=n)!=null?o:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((r,i)=>({...r,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var o;e.toggleAllColumnsVisible((o=n.target)==null?void 0:o.checked)}}};function xl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var ZC={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},JC={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:eo("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;let o=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof o=="string"||typeof o=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,o,r,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((o=t.options.enableGlobalFilter)!=null?o:!0)&&((r=t.options.enableFilters)!=null?r:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Zo.includesString,e.getGlobalFilterFn=()=>{var t,n;let{globalFilterFn:o}=e.options;return Eu(o)?o:o==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[o])!=null?t:Zo[o]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},e0={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:eo("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetExpanded)!=null?o:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=o=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(o),e.toggleAllRowsExpanded=o=>{o??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=o=>{var r,i;e.setExpanded(o?{}:(r=(i=e.initialState)==null?void 0:i.expanded)!=null?r:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(o=>o.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>o=>{o.persist==null||o.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let o=e.getState().expanded;return o===!0||Object.values(o).some(Boolean)},e.getIsAllRowsExpanded=()=>{let o=e.getState().expanded;return typeof o=="boolean"?o===!0:!(!Object.keys(o).length||e.getRowModel().flatRows.some(r=>!r.getIsExpanded()))},e.getExpandedDepth=()=>{let o=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{let a=i.split(".");o=Math.max(o,a.length)}),o},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(o=>{var r;let i=o===!0?!0:!!(o!=null&&o[e.id]),a={};if(o===!0?Object.keys(t.getRowModel().rowsById).forEach(l=>{a[l]=!0}):a=o,n=(r=n)!=null?r:!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:l,...s}=a;return s}return o})},e.getIsExpanded=()=>{var n;let o=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:o===!0||o?.[e.id])},e.getCanExpand=()=>{var n,o,r;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((o=t.options.enableExpanding)!=null?o:!0)&&!!((r=e.subRows)!=null&&r.length)},e.getIsAllParentsExpanded=()=>{let n=!0,o=e;for(;n&&o.parentId;)o=t.getRow(o.parentId,!0),n=o.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Qp=0,Zp=10,Kp=()=>({pageIndex:Qp,pageSize:Zp}),t0={getInitialState:e=>({...e,pagination:{...Kp(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:eo("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var o,r;if(!t){e._queue(()=>{t=!0});return}if((o=(r=e.options.autoResetAll)!=null?r:e.options.autoResetPageIndex)!=null?o:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=o=>{let r=i=>Er(o,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(r)},e.resetPagination=o=>{var r;e.setPagination(o?Kp():(r=e.initialState.pagination)!=null?r:Kp())},e.setPageIndex=o=>{e.setPagination(r=>{let i=Er(o,r.pageIndex),a=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,a)),{...r,pageIndex:i}})},e.resetPageIndex=o=>{var r,i;e.setPageIndex(o?Qp:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?r:Qp)},e.resetPageSize=o=>{var r,i;e.setPageSize(o?Zp:(r=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?r:Zp)},e.setPageSize=o=>{e.setPagination(r=>{let i=Math.max(1,Er(o,r.pageSize)),a=r.pageSize*r.pageIndex,l=Math.floor(a/i);return{...r,pageIndex:l,pageSize:i}})},e.setPageCount=o=>e.setPagination(r=>{var i;let a=Er(o,(i=e.options.pageCount)!=null?i:-1);return typeof a=="number"&&(a=Math.max(-1,a)),{...r,pageCount:a}}),e.getPageOptions=Ke(()=>[e.getPageCount()],o=>{let r=[];return o&&o>0&&(r=[...new Array(o)].fill(null).map((i,a)=>a)),r},Ye(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:o}=e.getState().pagination,r=e.getPageCount();return r===-1?!0:r===0?!1:o<r-1},e.previousPage=()=>e.setPageIndex(o=>o-1),e.nextPage=()=>e.setPageIndex(o=>o+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var o;return(o=e.options.pageCount)!=null?o:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var o;return(o=e.options.rowCount)!=null?o:e.getPrePaginationRowModel().rows.length}}},Yp=()=>({top:[],bottom:[]}),n0={getInitialState:e=>({rowPinning:Yp(),...e}),getDefaultOptions:e=>({onRowPinningChange:eo("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,o,r)=>{let i=o?e.getLeafRows().map(s=>{let{id:d}=s;return d}):[],a=r?e.getParentRows().map(s=>{let{id:d}=s;return d}):[],l=new Set([...a,e.id,...i]);t.setRowPinning(s=>{var d,p;if(n==="bottom"){var f,m;return{top:((f=s?.top)!=null?f:[]).filter(h=>!(l!=null&&l.has(h))),bottom:[...((m=s?.bottom)!=null?m:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)]}}if(n==="top"){var c,v;return{top:[...((c=s?.top)!=null?c:[]).filter(h=>!(l!=null&&l.has(h))),...Array.from(l)],bottom:((v=s?.bottom)!=null?v:[]).filter(h=>!(l!=null&&l.has(h)))}}return{top:((d=s?.top)!=null?d:[]).filter(h=>!(l!=null&&l.has(h))),bottom:((p=s?.bottom)!=null?p:[]).filter(h=>!(l!=null&&l.has(h)))}})},e.getCanPin=()=>{var n;let{enableRowPinning:o,enablePinning:r}=t.options;return typeof o=="function"?o(e):(n=o??r)!=null?n:!0},e.getIsPinned=()=>{let n=[e.id],{top:o,bottom:r}=t.getState().rowPinning,i=n.some(l=>o?.includes(l)),a=n.some(l=>r?.includes(l));return i?"top":a?"bottom":!1},e.getPinnedIndex=()=>{var n,o;let r=e.getIsPinned();if(!r)return-1;let i=(n=r==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(a=>{let{id:l}=a;return l});return(o=i?.indexOf(e.id))!=null?o:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,o;return e.setRowPinning(t?Yp():(n=(o=e.initialState)==null?void 0:o.rowPinning)!=null?n:Yp())},e.getIsSomeRowsPinned=t=>{var n;let o=e.getState().rowPinning;if(!t){var r,i;return!!((r=o.top)!=null&&r.length||(i=o.bottom)!=null&&i.length)}return!!((n=o[t])!=null&&n.length)},e._getPinnedRows=(t,n,o)=>{var r;return((r=e.options.keepPinnedRows)==null||r?(n??[]).map(a=>{let l=e.getRow(a,!0);return l.getIsAllParentsExpanded()?l:null}):(n??[]).map(a=>t.find(l=>l.id===a))).filter(Boolean).map(a=>({...a,position:o}))},e.getTopRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),Ye(e.options,"debugRows","getTopRows")),e.getBottomRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),Ye(e.options,"debugRows","getBottomRows")),e.getCenterRows=Ke(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,o)=>{let r=new Set([...n??[],...o??[]]);return t.filter(i=>!r.has(i.id))},Ye(e.options,"debugRows","getCenterRows"))}},o0={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:eo("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();let o={...n},r=e.getPreGroupedRowModel().flatRows;return t?r.forEach(i=>{i.getCanSelect()&&(o[i.id]=!0)}):r.forEach(i=>{delete o[i.id]}),o})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let o=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),r={...n};return e.getRowModel().rows.forEach(i=>{Jp(r,i.id,o,!0,e)}),r}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Xp(e,n):{rows:[],flatRows:[],rowsById:{}},Ye(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Xp(e,n):{rows:[],flatRows:[],rowsById:{}},Ye(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=Ke(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Xp(e,n):{rows:[],flatRows:[],rowsById:{}},Ye(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),o=!!(t.length&&Object.keys(n).length);return o&&t.some(r=>r.getCanSelect()&&!n[r.id])&&(o=!1),o},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(r=>r.getCanSelect()),{rowSelection:n}=e.getState(),o=!!t.length;return o&&t.some(r=>!n[r.id])&&(o=!1),o},e.getIsSomeRowsSelected=()=>{var t;let n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,o)=>{let r=e.getIsSelected();t.setRowSelection(i=>{var a;if(n=typeof n<"u"?n:!r,e.getCanSelect()&&r===n)return i;let l={...i};return Jp(l,e.id,n,(a=o?.selectChildren)!=null?a:!0,t),l})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return rm(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return em(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return em(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{let n=e.getCanSelect();return o=>{var r;n&&e.toggleSelected((r=o.target)==null?void 0:r.checked)}}}},Jp=(e,t,n,o,r)=>{var i;let a=r.getRow(t,!0);n?(a.getCanMultiSelect()||Object.keys(e).forEach(l=>delete e[l]),a.getCanSelect()&&(e[t]=!0)):delete e[t],o&&(i=a.subRows)!=null&&i.length&&a.getCanSelectSubRows()&&a.subRows.forEach(l=>Jp(e,l.id,n,o,r))};function Xp(e,t){let n=e.getState().rowSelection,o=[],r={},i=function(a,l){return a.map(s=>{var d;let p=rm(s,n);if(p&&(o.push(s),r[s.id]=s),(d=s.subRows)!=null&&d.length&&(s={...s,subRows:i(s.subRows)}),p)return s}).filter(Boolean)};return{rows:i(t.rows),flatRows:o,rowsById:r}}function rm(e,t){var n;return(n=t[e.id])!=null?n:!1}function em(e,t,n){var o;if(!((o=e.subRows)!=null&&o.length))return!1;let r=!0,i=!1;return e.subRows.forEach(a=>{if(!(i&&!r)&&(a.getCanSelect()&&(rm(a,t)?i=!0:r=!1),a.subRows&&a.subRows.length)){let l=em(a,t);l==="all"?i=!0:(l==="some"&&(i=!0),r=!1)}}),r?"all":i?"some":!1}var tm=/([0-9]+)/gm,r0=(e,t,n)=>Hh(Fr(e.getValue(n)).toLowerCase(),Fr(t.getValue(n)).toLowerCase()),i0=(e,t,n)=>Hh(Fr(e.getValue(n)),Fr(t.getValue(n))),a0=(e,t,n)=>im(Fr(e.getValue(n)).toLowerCase(),Fr(t.getValue(n)).toLowerCase()),l0=(e,t,n)=>im(Fr(e.getValue(n)),Fr(t.getValue(n))),s0=(e,t,n)=>{let o=e.getValue(n),r=t.getValue(n);return o>r?1:o<r?-1:0},u0=(e,t,n)=>im(e.getValue(n),t.getValue(n));function im(e,t){return e===t?0:e>t?1:-1}function Fr(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function Hh(e,t){let n=e.split(tm).filter(Boolean),o=t.split(tm).filter(Boolean);for(;n.length&&o.length;){let r=n.shift(),i=o.shift(),a=parseInt(r,10),l=parseInt(i,10),s=[a,l].sort();if(isNaN(s[0])){if(r>i)return 1;if(i>r)return-1;continue}if(isNaN(s[1]))return isNaN(a)?-1:1;if(a>l)return 1;if(l>a)return-1}return n.length-o.length}var Nl={alphanumeric:r0,alphanumericCaseSensitive:i0,text:a0,textCaseSensitive:l0,datetime:s0,basic:u0},c0={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:eo("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),o=!1;for(let r of n){let i=r?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Nl.datetime;if(typeof i=="string"&&(o=!0,i.split(tm).length>1))return Nl.alphanumeric}return o?Nl.text:Nl.basic},e.getAutoSortDir=()=>{let n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,o;if(!e)throw new Error;return Eu(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(o=t.options.sortingFns)==null?void 0:o[e.columnDef.sortingFn])!=null?n:Nl[e.columnDef.sortingFn]},e.toggleSorting=(n,o)=>{let r=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(a=>{let l=a?.find(c=>c.id===e.id),s=a?.findIndex(c=>c.id===e.id),d=[],p,f=i?n:r==="desc";if(a!=null&&a.length&&e.getCanMultiSort()&&o?l?p="toggle":p="add":a!=null&&a.length&&s!==a.length-1?p="replace":l?p="toggle":p="replace",p==="toggle"&&(i||r||(p="remove")),p==="add"){var m;d=[...a,{id:e.id,desc:f}],d.splice(0,d.length-((m=t.options.maxMultiSortColCount)!=null?m:Number.MAX_SAFE_INTEGER))}else p==="toggle"?d=a.map(c=>c.id===e.id?{...c,desc:f}:c):p==="remove"?d=a.filter(c=>c.id!==e.id):d=[{id:e.id,desc:f}];return d})},e.getFirstSortDir=()=>{var n,o;return((n=(o=e.columnDef.sortDescFirst)!=null?o:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var o,r;let i=e.getFirstSortDir(),a=e.getIsSorted();return a?a!==i&&((o=t.options.enableSortingRemoval)==null||o)&&(!(n&&(r=t.options.enableMultiRemove)!=null)||r)?!1:a==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,o;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((o=t.options.enableSorting)!=null?o:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,o;return(n=(o=e.columnDef.enableMultiSort)!=null?o:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;let o=(n=t.getState().sorting)==null?void 0:n.find(r=>r.id===e.id);return o?o.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,o;return(n=(o=t.getState().sorting)==null?void 0:o.findIndex(r=>r.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(o=>o.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return o=>{n&&(o.persist==null||o.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(o):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,o;e.setSorting(t?[]:(n=(o=e.initialState)==null?void 0:o.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},d0=[MC,QC,GC,qC,PC,LC,ZC,JC,c0,UC,e0,t0,n0,o0,YC];function Uh(e){var t,n;let o=[...d0,...(t=e._features)!=null?t:[]],r={_features:o},i=r._features.reduce((m,c)=>Object.assign(m,c.getDefaultOptions==null?void 0:c.getDefaultOptions(r)),{}),a=m=>r.options.mergeOptions?r.options.mergeOptions(i,m):{...i,...m},s={...{},...(n=e.initialState)!=null?n:{}};r._features.forEach(m=>{var c;s=(c=m.getInitialState==null?void 0:m.getInitialState(s))!=null?c:s});let d=[],p=!1,f={_features:o,options:{...i,...e},initialState:s,_queue:m=>{d.push(m),p||(p=!0,Promise.resolve().then(()=>{for(;d.length;)d.shift()();p=!1}).catch(c=>setTimeout(()=>{throw c})))},reset:()=>{r.setState(r.initialState)},setOptions:m=>{let c=Er(m,r.options);r.options=a(c)},getState:()=>r.options.state,setState:m=>{r.options.onStateChange==null||r.options.onStateChange(m)},_getRowId:(m,c,v)=>{var h;return(h=r.options.getRowId==null?void 0:r.options.getRowId(m,c,v))!=null?h:`${v?[v.id,c].join("."):c}`},getCoreRowModel:()=>(r._getCoreRowModel||(r._getCoreRowModel=r.options.getCoreRowModel(r)),r._getCoreRowModel()),getRowModel:()=>r.getPaginationRowModel(),getRow:(m,c)=>{let v=(c?r.getPrePaginationRowModel():r.getRowModel()).rowsById[m];if(!v&&(v=r.getCoreRowModel().rowsById[m],!v))throw new Error;return v},_getDefaultColumnDef:Ke(()=>[r.options.defaultColumn],m=>{var c;return m=(c=m)!=null?c:{},{header:v=>{let h=v.header.column.columnDef;return h.accessorKey?h.accessorKey:h.accessorFn?h.id:null},cell:v=>{var h,b;return(h=(b=v.renderValue())==null||b.toString==null?void 0:b.toString())!=null?h:null},...r._features.reduce((v,h)=>Object.assign(v,h.getDefaultColumnDef==null?void 0:h.getDefaultColumnDef()),{}),...m}},Ye(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>r.options.columns,getAllColumns:Ke(()=>[r._getColumnDefs()],m=>{let c=function(v,h,b){return b===void 0&&(b=0),v.map(_=>{let g=TC(r,_,b,h),y=_;return g.columns=y.columns?c(y.columns,g,b+1):[],g})};return c(m)},Ye(e,"debugColumns","getAllColumns")),getAllFlatColumns:Ke(()=>[r.getAllColumns()],m=>m.flatMap(c=>c.getFlatColumns()),Ye(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:Ke(()=>[r.getAllFlatColumns()],m=>m.reduce((c,v)=>(c[v.id]=v,c),{}),Ye(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:Ke(()=>[r.getAllColumns(),r._getOrderColumnsFn()],(m,c)=>{let v=m.flatMap(h=>h.getLeafColumns());return c(v)},Ye(e,"debugColumns","getAllLeafColumns")),getColumn:m=>r._getAllFlatColumnsById()[m]};Object.assign(r,f);for(let m=0;m<r._features.length;m++){let c=r._features[m];c==null||c.createTable==null||c.createTable(r)}return r}function Wh(){return e=>Ke(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},o=function(r,i,a){i===void 0&&(i=0);let l=[];for(let d=0;d<r.length;d++){let p=nm(e,e._getRowId(r[d],d,a),r[d],d,i,void 0,a?.id);if(n.flatRows.push(p),n.rowsById[p.id]=p,l.push(p),e.options.getSubRows){var s;p.originalSubRows=e.options.getSubRows(r[d],d),(s=p.originalSubRows)!=null&&s.length&&(p.subRows=o(p.originalSubRows,i+1,p))}}return l};return n.rows=o(t),n},Ye(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function p0(e,t,n){return n.options.filterFromLeafRows?m0(e,t,n):f0(e,t,n)}function m0(e,t,n){var o;let r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(s,d){d===void 0&&(d=0);let p=[];for(let m=0;m<s.length;m++){var f;let c=s[m],v=nm(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);if(v.columnFilters=c.columnFilters,(f=c.subRows)!=null&&f.length&&d<a){if(v.subRows=l(c.subRows,d+1),c=v,t(c)&&!v.subRows.length){p.push(c),i[c.id]=c,r.push(c);continue}if(t(c)||v.subRows.length){p.push(c),i[c.id]=c,r.push(c);continue}}else c=v,t(c)&&(p.push(c),i[c.id]=c,r.push(c))}return p};return{rows:l(e),flatRows:r,rowsById:i}}function f0(e,t,n){var o;let r=[],i={},a=(o=n.options.maxLeafRowFilterDepth)!=null?o:100,l=function(s,d){d===void 0&&(d=0);let p=[];for(let m=0;m<s.length;m++){let c=s[m];if(t(c)){var f;if((f=c.subRows)!=null&&f.length&&d<a){let h=nm(n,c.id,c.original,c.index,c.depth,void 0,c.parentId);h.subRows=l(c.subRows,d+1),c=h}p.push(c),r.push(c),i[c.id]=c}}return p};return{rows:l(e),flatRows:r,rowsById:i}}function Gh(){return e=>Ke(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,o)=>{if(!t.rows.length||!(n!=null&&n.length)&&!o){for(let m=0;m<t.flatRows.length;m++)t.flatRows[m].columnFilters={},t.flatRows[m].columnFiltersMeta={};return t}let r=[],i=[];(n??[]).forEach(m=>{var c;let v=e.getColumn(m.id);if(!v)return;let h=v.getFilterFn();h&&r.push({id:m.id,filterFn:h,resolvedValue:(c=h.resolveFilterValue==null?void 0:h.resolveFilterValue(m.value))!=null?c:m.value})});let a=(n??[]).map(m=>m.id),l=e.getGlobalFilterFn(),s=e.getAllLeafColumns().filter(m=>m.getCanGlobalFilter());o&&l&&s.length&&(a.push("__global__"),s.forEach(m=>{var c;i.push({id:m.id,filterFn:l,resolvedValue:(c=l.resolveFilterValue==null?void 0:l.resolveFilterValue(o))!=null?c:o})}));let d,p;for(let m=0;m<t.flatRows.length;m++){let c=t.flatRows[m];if(c.columnFilters={},r.length)for(let v=0;v<r.length;v++){d=r[v];let h=d.id;c.columnFilters[h]=d.filterFn(c,h,d.resolvedValue,b=>{c.columnFiltersMeta[h]=b})}if(i.length){for(let v=0;v<i.length;v++){p=i[v];let h=p.id;if(p.filterFn(c,h,p.resolvedValue,b=>{c.columnFiltersMeta[h]=b})){c.columnFilters.__global__=!0;break}}c.columnFilters.__global__!==!0&&(c.columnFilters.__global__=!1)}}let f=m=>{for(let c=0;c<a.length;c++)if(m.columnFilters[a[c]]===!1)return!1;return!0};return p0(t.rows,f,e)},Ye(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function qh(){return e=>Ke(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let o=e.getState().sorting,r=[],i=o.filter(s=>{var d;return(d=e.getColumn(s.id))==null?void 0:d.getCanSort()}),a={};i.forEach(s=>{let d=e.getColumn(s.id);d&&(a[s.id]={sortUndefined:d.columnDef.sortUndefined,invertSorting:d.columnDef.invertSorting,sortingFn:d.getSortingFn()})});let l=s=>{let d=s.map(p=>({...p}));return d.sort((p,f)=>{for(let c=0;c<i.length;c+=1){var m;let v=i[c],h=a[v.id],b=h.sortUndefined,_=(m=v?.desc)!=null?m:!1,g=0;if(b){let y=p.getValue(v.id),k=f.getValue(v.id),D=y===void 0,M=k===void 0;if(D||M){if(b==="first")return D?-1:1;if(b==="last")return D?1:-1;g=D&&M?0:D?b:-b}}if(g===0&&(g=h.sortingFn(p,f,v.id)),g!==0)return _&&(g*=-1),h.invertSorting&&(g*=-1),g}return p.index-f.index}),d.forEach(p=>{var f;r.push(p),(f=p.subRows)!=null&&f.length&&(p.subRows=l(p.subRows))}),d};return{rows:l(n.rows),flatRows:r,rowsById:n.rowsById}},Ye(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function aa(e,t){return e?g0(e)?Rl.createElement(e,t):e:null}function g0(e){return _0(e)||typeof e=="function"||h0(e)}function _0(e){return typeof e=="function"&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function h0(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Kh(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=Rl.useState(()=>({current:Uh(t)})),[o,r]=Rl.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...o,...e.state},onStateChange:a=>{r(a),e.onStateChange==null||e.onStateChange(a)}})),n.current}var ie=Re(xt()),pi=Re(uo());var qt=Re(xt());function Xh(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,qt.useMemo)(()=>o=>{t.forEach(r=>r(o))},t)}var El=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function li(e){let t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Fu(e){return"nodeType"in e}function Fn(e){var t,n;return e?li(e)?e:Fu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Du(e){let{Document:t}=Fn(e);return e instanceof t}function la(e){return li(e)?!1:e instanceof Fn(e).HTMLElement}function lm(e){return e instanceof Fn(e).SVGElement}function si(e){return e?li(e)?e.document:Fu(e)?Du(e)?e:la(e)||lm(e)?e.ownerDocument:document:document:document}var co=El?qt.useLayoutEffect:qt.useEffect;function Tu(e){let t=(0,qt.useRef)(e);return co(()=>{t.current=e}),(0,qt.useCallback)(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Qh(){let e=(0,qt.useRef)(null),t=(0,qt.useCallback)((o,r)=>{e.current=setInterval(o,r)},[]),n=(0,qt.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function sa(e,t){t===void 0&&(t=[e]);let n=(0,qt.useRef)(e);return co(()=>{n.current!==e&&(n.current=e)},t),n}function ua(e,t){let n=(0,qt.useRef)();return(0,qt.useMemo)(()=>{let o=e(n.current);return n.current=o,o},[...t])}function Fl(e){let t=Tu(e),n=(0,qt.useRef)(null),o=(0,qt.useCallback)(r=>{r!==n.current&&t?.(r,n.current),n.current=r},[]);return[n,o]}function Mu(e){let t=(0,qt.useRef)();return(0,qt.useEffect)(()=>{t.current=e},[e]),t.current}var am={};function ui(e,t){return(0,qt.useMemo)(()=>{if(t)return t;let n=am[e]==null?0:am[e]+1;return am[e]=n,e+"-"+n},[e,t])}function Zh(e){return function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;r<n;r++)o[r-1]=arguments[r];return o.reduce((i,a)=>{let l=Object.entries(a);for(let[s,d]of l){let p=i[s];p!=null&&(i[s]=p+e*d)}return i},{...t})}}var ci=Zh(1),ca=Zh(-1);function v0(e){return"clientX"in e&&"clientY"in e}function Dl(e){if(!e)return!1;let{KeyboardEvent:t}=Fn(e.target);return t&&e instanceof t}function b0(e){if(!e)return!1;let{TouchEvent:t}=Fn(e.target);return t&&e instanceof t}function Pu(e){if(b0(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return v0(e)?{x:e.clientX,y:e.clientY}:null}var Jo=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Jo.Translate.toString(e),Jo.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:o}=e;return t+" "+n+"ms "+o}}}),Yh="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Jh(e){return e.matches(Yh)?e:e.querySelector(Yh)}var di=Re(xt()),y0={display:"none"};function ev(e){let{id:t,value:n}=e;return di.default.createElement("div",{id:t,style:y0},n)}function tv(e){let{id:t,announcement:n,ariaLiveType:o="assertive"}=e,r={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return di.default.createElement("div",{id:t,style:r,role:"status","aria-live":o,"aria-atomic":!0},n)}function nv(){let[e,t]=(0,di.useState)("");return{announce:(0,di.useCallback)(o=>{o!=null&&t(o)},[]),announcement:e}}var fv=(0,ie.createContext)(null);function w0(e){let t=(0,ie.useContext)(fv);(0,ie.useEffect)(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function C0(){let[e]=(0,ie.useState)(()=>new Set),t=(0,ie.useCallback)(o=>(e.add(o),()=>e.delete(o)),[e]);return[(0,ie.useCallback)(o=>{let{type:r,event:i}=o;e.forEach(a=>{var l;return(l=a[r])==null?void 0:l.call(a,i)})},[e]),t]}var k0={draggable:`
To pick up a draggable item, press the space bar.
While dragging, use the arrow keys to move the item.
Press space again to drop the item in its new position, or press escape to cancel.
`},S0={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function N0(e){let{announcements:t=S0,container:n,hiddenTextDescribedById:o,screenReaderInstructions:r=k0}=e,{announce:i,announcement:a}=nv(),l=ui("DndLiveRegion"),[s,d]=(0,ie.useState)(!1);if((0,ie.useEffect)(()=>{d(!0)},[]),w0((0,ie.useMemo)(()=>({onDragStart(f){let{active:m}=f;i(t.onDragStart({active:m}))},onDragMove(f){let{active:m,over:c}=f;t.onDragMove&&i(t.onDragMove({active:m,over:c}))},onDragOver(f){let{active:m,over:c}=f;i(t.onDragOver({active:m,over:c}))},onDragEnd(f){let{active:m,over:c}=f;i(t.onDragEnd({active:m,over:c}))},onDragCancel(f){let{active:m,over:c}=f;i(t.onDragCancel({active:m,over:c}))}}),[i,t])),!s)return null;let p=ie.default.createElement(ie.default.Fragment,null,ie.default.createElement(ev,{id:o,value:r.draggable}),ie.default.createElement(tv,{id:l,announcement:a}));return n?(0,pi.createPortal)(p,n):p}var rn;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(rn||(rn={}));function Iu(){}function gm(e,t){return(0,ie.useMemo)(()=>({sensor:e,options:t??{}}),[e,t])}function gv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,ie.useMemo)(()=>[...t].filter(o=>o!=null),[...t])}var Ro=Object.freeze({x:0,y:0});function x0(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function R0(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return n-o}function E0(e,t){let{data:{value:n}}=e,{data:{value:o}}=t;return o-n}function _v(e,t){if(!e||e.length===0)return null;let[n]=e;return t?n[t]:n}function ov(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}var _m=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=ov(t,t.left,t.top),i=[];for(let a of o){let{id:l}=a,s=n.get(l);if(s){let d=x0(ov(s),r);i.push({id:l,data:{droppableContainer:a,value:d}})}}return i.sort(R0)};function F0(e,t){let n=Math.max(t.top,e.top),o=Math.max(t.left,e.left),r=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),a=r-o,l=i-n;if(o<r&&n<i){let s=t.width*t.height,d=e.width*e.height,p=a*l,f=p/(s+d-p);return Number(f.toFixed(4))}return 0}var D0=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:o}=e,r=[];for(let i of o){let{id:a}=i,l=n.get(a);if(l){let s=F0(l,t);s>0&&r.push({id:a,data:{droppableContainer:i,value:s}})}}return r.sort(E0)};function T0(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function hv(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ro}function M0(e){return function(n){for(var o=arguments.length,r=new Array(o>1?o-1:0),i=1;i<o;i++)r[i-1]=arguments[i];return r.reduce((a,l)=>({...a,top:a.top+e*l.y,bottom:a.bottom+e*l.y,left:a.left+e*l.x,right:a.right+e*l.x}),{...n})}}var P0=M0(1);function L0(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function I0(e,t,n){let o=L0(t);if(!o)return e;let{scaleX:r,scaleY:i,x:a,y:l}=o,s=e.left-a-(1-r)*parseFloat(n),d=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),p=r?e.width/r:e.width,f=i?e.height/i:e.height;return{width:p,height:f,top:d,right:s+p,bottom:d+f,left:s}}var A0={ignoreTransform:!1};function gi(e,t){t===void 0&&(t=A0);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:d,transformOrigin:p}=Fn(e).getComputedStyle(e);d&&(n=I0(n,d,p))}let{top:o,left:r,width:i,height:a,bottom:l,right:s}=n;return{top:o,left:r,width:i,height:a,bottom:l,right:s}}function rv(e){return gi(e,{ignoreTransform:!0})}function O0(e){let t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function $0(e,t){return t===void 0&&(t=Fn(e).getComputedStyle(e)),t.position==="fixed"}function z0(e,t){t===void 0&&(t=Fn(e).getComputedStyle(e));let n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(r=>{let i=t[r];return typeof i=="string"?n.test(i):!1})}function $u(e,t){let n=[];function o(r){if(t!=null&&n.length>=t||!r)return n;if(Du(r)&&r.scrollingElement!=null&&!n.includes(r.scrollingElement))return n.push(r.scrollingElement),n;if(!la(r)||lm(r)||n.includes(r))return n;let i=Fn(e).getComputedStyle(r);return r!==e&&z0(r,i)&&n.push(r),$0(r,i)?n:o(r.parentNode)}return e?o(e):n}function vv(e){let[t]=$u(e,1);return t??null}function sm(e){return!El||!e?null:li(e)?e:Fu(e)?Du(e)||e===si(e).scrollingElement?window:la(e)?e:null:null}function bv(e){return li(e)?e.scrollX:e.scrollLeft}function yv(e){return li(e)?e.scrollY:e.scrollTop}function dm(e){return{x:bv(e),y:yv(e)}}var un;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(un||(un={}));function wv(e){return!El||!e?!1:e===document.scrollingElement}function Cv(e){let t={x:0,y:0},n=wv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},o={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},r=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,a=e.scrollTop>=o.y,l=e.scrollLeft>=o.x;return{isTop:r,isLeft:i,isBottom:a,isRight:l,maxScroll:o,minScroll:t}}var V0={x:.2,y:.2};function B0(e,t,n,o,r){let{top:i,left:a,right:l,bottom:s}=n;o===void 0&&(o=10),r===void 0&&(r=V0);let{isTop:d,isBottom:p,isLeft:f,isRight:m}=Cv(e),c={x:0,y:0},v={x:0,y:0},h={height:t.height*r.y,width:t.width*r.x};return!d&&i<=t.top+h.height?(c.y=un.Backward,v.y=o*Math.abs((t.top+h.height-i)/h.height)):!p&&s>=t.bottom-h.height&&(c.y=un.Forward,v.y=o*Math.abs((t.bottom-h.height-s)/h.height)),!m&&l>=t.right-h.width?(c.x=un.Forward,v.x=o*Math.abs((t.right-h.width-l)/h.width)):!f&&a<=t.left+h.width&&(c.x=un.Backward,v.x=o*Math.abs((t.left+h.width-a)/h.width)),{direction:c,speed:v}}function j0(e){if(e===document.scrollingElement){let{innerWidth:i,innerHeight:a}=window;return{top:0,left:0,right:i,bottom:a,width:i,height:a}}let{top:t,left:n,right:o,bottom:r}=e.getBoundingClientRect();return{top:t,left:n,right:o,bottom:r,width:e.clientWidth,height:e.clientHeight}}function kv(e){return e.reduce((t,n)=>ci(t,dm(n)),Ro)}function H0(e){return e.reduce((t,n)=>t+bv(n),0)}function U0(e){return e.reduce((t,n)=>t+yv(n),0)}function W0(e,t){if(t===void 0&&(t=gi),!e)return;let{top:n,left:o,bottom:r,right:i}=t(e);vv(e)&&(r<=0||i<=0||n>=window.innerHeight||o>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}var G0=[["x",["left","right"],H0],["y",["top","bottom"],U0]],Ml=class{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;let o=$u(n),r=kv(o);this.rect={...t},this.width=t.width,this.height=t.height;for(let[i,a,l]of G0)for(let s of a)Object.defineProperty(this,s,{get:()=>{let d=l(o),p=r[i]-d;return this.rect[s]+p},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}},mi=class{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var o;return(o=this.target)==null?void 0:o.removeEventListener(...n)})},this.target=t}add(t,n,o){var r;(r=this.target)==null||r.addEventListener(t,n,o),this.listeners.push([t,n,o])}};function q0(e){let{EventTarget:t}=Fn(e);return e instanceof t?e:si(e)}function um(e,t){let n=Math.abs(e.x),o=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+o**2)>t:"x"in t&&"y"in t?n>t.x&&o>t.y:"x"in t?n>t.x:"y"in t?o>t.y:!1}var po;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(po||(po={}));function iv(e){e.preventDefault()}function K0(e){e.stopPropagation()}var Rt;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Rt||(Rt={}));var Sv={start:[Rt.Space,Rt.Enter],cancel:[Rt.Esc],end:[Rt.Space,Rt.Enter,Rt.Tab]},Y0=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Rt.Right:return{...n,x:n.x+25};case Rt.Left:return{...n,x:n.x-25};case Rt.Down:return{...n,y:n.y+25};case Rt.Up:return{...n,y:n.y-25}}},Au=class{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;let{event:{target:n}}=t;this.props=t,this.listeners=new mi(si(n)),this.windowListeners=new mi(Fn(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(po.Resize,this.handleCancel),this.windowListeners.add(po.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(po.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:t,onStart:n}=this.props,o=t.node.current;o&&W0(o),n(Ro)}handleKeyDown(t){if(Dl(t)){let{active:n,context:o,options:r}=this.props,{keyboardCodes:i=Sv,coordinateGetter:a=Y0,scrollBehavior:l="smooth"}=r,{code:s}=t;if(i.end.includes(s)){this.handleEnd(t);return}if(i.cancel.includes(s)){this.handleCancel(t);return}let{collisionRect:d}=o.current,p=d?{x:d.left,y:d.top}:Ro;this.referenceCoordinates||(this.referenceCoordinates=p);let f=a(t,{active:n,context:o.current,currentCoordinates:p});if(f){let m=ca(f,p),c={x:0,y:0},{scrollableAncestors:v}=o.current;for(let h of v){let b=t.code,{isTop:_,isRight:g,isLeft:y,isBottom:k,maxScroll:D,minScroll:M}=Cv(h),V=j0(h),j={x:Math.min(b===Rt.Right?V.right-V.width/2:V.right,Math.max(b===Rt.Right?V.left:V.left+V.width/2,f.x)),y:Math.min(b===Rt.Down?V.bottom-V.height/2:V.bottom,Math.max(b===Rt.Down?V.top:V.top+V.height/2,f.y))},re=b===Rt.Right&&!g||b===Rt.Left&&!y,ne=b===Rt.Down&&!k||b===Rt.Up&&!_;if(re&&j.x!==f.x){let ce=h.scrollLeft+m.x,de=b===Rt.Right&&ce<=D.x||b===Rt.Left&&ce>=M.x;if(de&&!m.y){h.scrollTo({left:ce,behavior:l});return}de?c.x=h.scrollLeft-ce:c.x=b===Rt.Right?h.scrollLeft-D.x:h.scrollLeft-M.x,c.x&&h.scrollBy({left:-c.x,behavior:l});break}else if(ne&&j.y!==f.y){let ce=h.scrollTop+m.y,de=b===Rt.Down&&ce<=D.y||b===Rt.Up&&ce>=M.y;if(de&&!m.x){h.scrollTo({top:ce,behavior:l});return}de?c.y=h.scrollTop-ce:c.y=b===Rt.Down?h.scrollTop-D.y:h.scrollTop-M.y,c.y&&h.scrollBy({top:-c.y,behavior:l});break}}this.handleMove(t,ci(ca(f,this.referenceCoordinates),c))}}}handleMove(t,n){let{onMove:o}=this.props;t.preventDefault(),o(n)}handleEnd(t){let{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){let{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}};Au.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:o=Sv,onActivation:r}=t,{active:i}=n,{code:a}=e.nativeEvent;if(o.start.includes(a)){let l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),r?.({event:e.nativeEvent}),!0)}return!1}}];function av(e){return!!(e&&"distance"in e)}function lv(e){return!!(e&&"delay"in e)}var Pl=class{constructor(t,n,o){var r;o===void 0&&(o=q0(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;let{event:i}=t,{target:a}=i;this.props=t,this.events=n,this.document=si(a),this.documentListeners=new mi(this.document),this.listeners=new mi(o),this.windowListeners=new mi(Fn(a)),this.initialCoordinates=(r=Pu(i))!=null?r:Ro,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:o}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(po.Resize,this.handleCancel),this.windowListeners.add(po.DragStart,iv),this.windowListeners.add(po.VisibilityChange,this.handleCancel),this.windowListeners.add(po.ContextMenu,iv),this.documentListeners.add(po.Keydown,this.handleKeydown),n){if(o!=null&&o({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(lv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(av(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){let{active:o,onPending:r}=this.props;r(o,t,this.initialCoordinates,n)}handleStart(){let{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(po.Click,K0,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(po.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;let{activated:o,initialCoordinates:r,props:i}=this,{onMove:a,options:{activationConstraint:l}}=i;if(!r)return;let s=(n=Pu(t))!=null?n:Ro,d=ca(r,s);if(!o&&l){if(av(l)){if(l.tolerance!=null&&um(d,l.tolerance))return this.handleCancel();if(um(d,l.distance))return this.handleStart()}if(lv(l)&&um(d,l.tolerance))return this.handleCancel();this.handlePending(l,d);return}t.cancelable&&t.preventDefault(),a(s)}handleEnd(){let{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){let{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Rt.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}},X0={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}},da=class extends Pl{constructor(t){let{event:n}=t,o=si(n.target);super(t,X0,o)}};da.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return!n.isPrimary||n.button!==0?!1:(o?.({event:n}),!0)}}];var Q0={move:{name:"mousemove"},end:{name:"mouseup"}},pm;(function(e){e[e.RightClick=2]="RightClick"})(pm||(pm={}));var mm=class extends Pl{constructor(t){super(t,Q0,si(t.event.target))}};mm.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t;return n.button===pm.RightClick?!1:(o?.({event:n}),!0)}}];var cm={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}},Ll=class extends Pl{constructor(t){super(t,cm)}static setup(){return window.addEventListener(cm.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(cm.move.name,t)};function t(){}}};Ll.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:o}=t,{touches:r}=n;return r.length>1?!1:(o?.({event:n}),!0)}}];var Tl;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Tl||(Tl={}));var Ou;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ou||(Ou={}));function Z0(e){let{acceleration:t,activator:n=Tl.Pointer,canScroll:o,draggingRect:r,enabled:i,interval:a=5,order:l=Ou.TreeOrder,pointerCoordinates:s,scrollableAncestors:d,scrollableAncestorRects:p,delta:f,threshold:m}=e,c=ek({delta:f,disabled:!i}),[v,h]=Qh(),b=(0,ie.useRef)({x:0,y:0}),_=(0,ie.useRef)({x:0,y:0}),g=(0,ie.useMemo)(()=>{switch(n){case Tl.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case Tl.DraggableRect:return r}},[n,r,s]),y=(0,ie.useRef)(null),k=(0,ie.useCallback)(()=>{let M=y.current;if(!M)return;let V=b.current.x*_.current.x,j=b.current.y*_.current.y;M.scrollBy(V,j)},[]),D=(0,ie.useMemo)(()=>l===Ou.TreeOrder?[...d].reverse():d,[l,d]);(0,ie.useEffect)(()=>{if(!i||!d.length||!g){h();return}for(let M of D){if(o?.(M)===!1)continue;let V=d.indexOf(M),j=p[V];if(!j)continue;let{direction:re,speed:ne}=B0(M,j,g,t,m);for(let ce of["x","y"])c[ce][re[ce]]||(ne[ce]=0,re[ce]=0);if(ne.x>0||ne.y>0){h(),y.current=M,v(k,a),b.current=ne,_.current=re;return}}b.current={x:0,y:0},_.current={x:0,y:0},h()},[t,k,o,h,i,a,JSON.stringify(g),JSON.stringify(c),v,d,D,p,JSON.stringify(m)])}var J0={x:{[un.Backward]:!1,[un.Forward]:!1},y:{[un.Backward]:!1,[un.Forward]:!1}};function ek(e){let{delta:t,disabled:n}=e,o=Mu(t);return ua(r=>{if(n||!o||!r)return J0;let i={x:Math.sign(t.x-o.x),y:Math.sign(t.y-o.y)};return{x:{[un.Backward]:r.x[un.Backward]||i.x===-1,[un.Forward]:r.x[un.Forward]||i.x===1},y:{[un.Backward]:r.y[un.Backward]||i.y===-1,[un.Forward]:r.y[un.Forward]||i.y===1}}},[n,t,o])}function tk(e,t){let n=t!=null?e.get(t):void 0,o=n?n.node.current:null;return ua(r=>{var i;return t==null?null:(i=o??r)!=null?i:null},[o,t])}function nk(e,t){return(0,ie.useMemo)(()=>e.reduce((n,o)=>{let{sensor:r}=o,i=r.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,o)}));return[...n,...i]},[]),[e,t])}var Il;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Il||(Il={}));var fm;(function(e){e.Optimized="optimized"})(fm||(fm={}));var sv=new Map;function ok(e,t){let{dragging:n,dependencies:o,config:r}=t,[i,a]=(0,ie.useState)(null),{frequency:l,measure:s,strategy:d}=r,p=(0,ie.useRef)(e),f=b(),m=sa(f),c=(0,ie.useCallback)(function(_){_===void 0&&(_=[]),!m.current&&a(g=>g===null?_:g.concat(_.filter(y=>!g.includes(y))))},[m]),v=(0,ie.useRef)(null),h=ua(_=>{if(f&&!n)return sv;if(!_||_===sv||p.current!==e||i!=null){let g=new Map;for(let y of e){if(!y)continue;if(i&&i.length>0&&!i.includes(y.id)&&y.rect.current){g.set(y.id,y.rect.current);continue}let k=y.node.current,D=k?new Ml(s(k),k):null;y.rect.current=D,D&&g.set(y.id,D)}return g}return _},[e,i,n,f,s]);return(0,ie.useEffect)(()=>{p.current=e},[e]),(0,ie.useEffect)(()=>{f||c()},[n,f]),(0,ie.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,ie.useEffect)(()=>{f||typeof l!="number"||v.current!==null||(v.current=setTimeout(()=>{c(),v.current=null},l))},[l,f,c,...o]),{droppableRects:h,measureDroppableContainers:c,measuringScheduled:i!=null};function b(){switch(d){case Il.Always:return!1;case Il.BeforeDragging:return n;default:return!n}}}function Nv(e,t){return ua(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rk(e,t){return Nv(e,t)}function ik(e){let{callback:t,disabled:n}=e,o=Tu(t),r=(0,ie.useMemo)(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;let{MutationObserver:i}=window;return new i(o)},[o,n]);return(0,ie.useEffect)(()=>()=>r?.disconnect(),[r]),r}function zu(e){let{callback:t,disabled:n}=e,o=Tu(t),r=(0,ie.useMemo)(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;let{ResizeObserver:i}=window;return new i(o)},[n]);return(0,ie.useEffect)(()=>()=>r?.disconnect(),[r]),r}function ak(e){return new Ml(gi(e),e)}function uv(e,t,n){t===void 0&&(t=ak);let[o,r]=(0,ie.useState)(null);function i(){r(s=>{if(!e)return null;if(e.isConnected===!1){var d;return(d=s??n)!=null?d:null}let p=t(e);return JSON.stringify(s)===JSON.stringify(p)?s:p})}let a=ik({callback(s){if(e)for(let d of s){let{type:p,target:f}=d;if(p==="childList"&&f instanceof HTMLElement&&f.contains(e)){i();break}}}}),l=zu({callback:i});return co(()=>{i(),e?(l?.observe(e),a?.observe(document.body,{childList:!0,subtree:!0})):(l?.disconnect(),a?.disconnect())},[e]),o}function lk(e){let t=Nv(e);return hv(e,t)}var cv=[];function sk(e){let t=(0,ie.useRef)(e),n=ua(o=>e?o&&o!==cv&&e&&t.current&&e.parentNode===t.current.parentNode?o:$u(e):cv,[e]);return(0,ie.useEffect)(()=>{t.current=e},[e]),n}function uk(e){let[t,n]=(0,ie.useState)(null),o=(0,ie.useRef)(e),r=(0,ie.useCallback)(i=>{let a=sm(i.target);a&&n(l=>l?(l.set(a,dm(a)),new Map(l)):null)},[]);return(0,ie.useEffect)(()=>{let i=o.current;if(e!==i){a(i);let l=e.map(s=>{let d=sm(s);return d?(d.addEventListener("scroll",r,{passive:!0}),[d,dm(d)]):null}).filter(s=>s!=null);n(l.length?new Map(l):null),o.current=e}return()=>{a(e),a(i)};function a(l){l.forEach(s=>{let d=sm(s);d?.removeEventListener("scroll",r)})}},[r,e]),(0,ie.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((i,a)=>ci(i,a),Ro):kv(e):Ro,[e,t])}function dv(e,t){t===void 0&&(t=[]);let n=(0,ie.useRef)(null);return(0,ie.useEffect)(()=>{n.current=null},t),(0,ie.useEffect)(()=>{let o=e!==Ro;o&&!n.current&&(n.current=e),!o&&n.current&&(n.current=null)},[e]),n.current?ca(e,n.current):Ro}function ck(e){(0,ie.useEffect)(()=>{if(!El)return;let t=e.map(n=>{let{sensor:o}=n;return o.setup==null?void 0:o.setup()});return()=>{for(let n of t)n?.()}},e.map(t=>{let{sensor:n}=t;return n}))}function dk(e,t){return(0,ie.useMemo)(()=>e.reduce((n,o)=>{let{eventName:r,handler:i}=o;return n[r]=a=>{i(a,t)},n},{}),[e,t])}function xv(e){return(0,ie.useMemo)(()=>e?O0(e):null,[e])}var pv=[];function pk(e,t){t===void 0&&(t=gi);let[n]=e,o=xv(n?Fn(n):null),[r,i]=(0,ie.useState)(pv);function a(){i(()=>e.length?e.map(s=>wv(s)?o:new Ml(t(s),s)):pv)}let l=zu({callback:a});return co(()=>{l?.disconnect(),a(),e.forEach(s=>l?.observe(s))},[e]),r}function mk(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return la(t)?t:e}function fk(e){let{measure:t}=e,[n,o]=(0,ie.useState)(null),r=(0,ie.useCallback)(d=>{for(let{target:p}of d)if(la(p)){o(f=>{let m=t(p);return f?{...f,width:m.width,height:m.height}:m});break}},[t]),i=zu({callback:r}),a=(0,ie.useCallback)(d=>{let p=mk(d);i?.disconnect(),p&&i?.observe(p),o(p?t(p):null)},[t,i]),[l,s]=Fl(a);return(0,ie.useMemo)(()=>({nodeRef:l,rect:n,setRef:s}),[n,l,s])}var gk=[{sensor:da,options:{}},{sensor:Au,options:{}}],_k={current:{}},Lu={draggable:{measure:rv},droppable:{measure:rv,strategy:Il.WhileDragging,frequency:fm.Optimized},dragOverlay:{measure:gi}},fi=class extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,o;return(n=(o=this.get(t))==null?void 0:o.node.current)!=null?n:void 0}},hk={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new fi,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Iu},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Lu,measureDroppableContainers:Iu,windowRect:null,measuringScheduled:!1},vk={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Iu,draggableNodes:new Map,over:null,measureDroppableContainers:Iu},Vu=(0,ie.createContext)(vk),Rv=(0,ie.createContext)(hk);function bk(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new fi}}}function yk(e,t){switch(t.type){case rn.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case rn.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case rn.DragEnd:case rn.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case rn.RegisterDroppable:{let{element:n}=t,{id:o}=n,r=new fi(e.droppable.containers);return r.set(o,n),{...e,droppable:{...e.droppable,containers:r}}}case rn.SetDroppableDisabled:{let{id:n,key:o,disabled:r}=t,i=e.droppable.containers.get(n);if(!i||o!==i.key)return e;let a=new fi(e.droppable.containers);return a.set(n,{...i,disabled:r}),{...e,droppable:{...e.droppable,containers:a}}}case rn.UnregisterDroppable:{let{id:n,key:o}=t,r=e.droppable.containers.get(n);if(!r||o!==r.key)return e;let i=new fi(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function wk(e){let{disabled:t}=e,{active:n,activatorEvent:o,draggableNodes:r}=(0,ie.useContext)(Vu),i=Mu(o),a=Mu(n?.id);return(0,ie.useEffect)(()=>{if(!t&&!o&&i&&a!=null){if(!Dl(i)||document.activeElement===i.target)return;let l=r.get(a);if(!l)return;let{activatorNode:s,node:d}=l;if(!s.current&&!d.current)return;requestAnimationFrame(()=>{for(let p of[s.current,d.current]){if(!p)continue;let f=Jh(p);if(f){f.focus();break}}})}},[o,t,r,a,i]),null}function Ck(e,t){let{transform:n,...o}=t;return e!=null&&e.length?e.reduce((r,i)=>i({transform:r,...o}),n):n}function kk(e){return(0,ie.useMemo)(()=>({draggable:{...Lu.draggable,...e?.draggable},droppable:{...Lu.droppable,...e?.droppable},dragOverlay:{...Lu.dragOverlay,...e?.dragOverlay}}),[e?.draggable,e?.droppable,e?.dragOverlay])}function Sk(e){let{activeNode:t,measure:n,initialRect:o,config:r=!0}=e,i=(0,ie.useRef)(!1),{x:a,y:l}=typeof r=="boolean"?{x:r,y:r}:r;co(()=>{if(!a&&!l||!t){i.current=!1;return}if(i.current||!o)return;let d=t?.node.current;if(!d||d.isConnected===!1)return;let p=n(d),f=hv(p,o);if(a||(f.x=0),l||(f.y=0),i.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){let m=vv(d);m&&m.scrollBy({top:f.y,left:f.x})}},[t,a,l,o,n])}var Ev=(0,ie.createContext)({...Ro,scaleX:1,scaleY:1}),Dr;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(Dr||(Dr={}));var hm=(0,ie.memo)(function(t){var n,o,r,i;let{id:a,accessibility:l,autoScroll:s=!0,children:d,sensors:p=gk,collisionDetection:f=D0,measuring:m,modifiers:c,...v}=t,h=(0,ie.useReducer)(yk,void 0,bk),[b,_]=h,[g,y]=C0(),[k,D]=(0,ie.useState)(Dr.Uninitialized),M=k===Dr.Initialized,{draggable:{active:V,nodes:j,translate:re},droppable:{containers:ne}}=b,ce=V!=null?j.get(V):null,de=(0,ie.useRef)({initial:null,translated:null}),De=(0,ie.useMemo)(()=>{var Q;return V!=null?{id:V,data:(Q=ce?.data)!=null?Q:_k,rect:de}:null},[V,ce]),Ve=(0,ie.useRef)(null),[H,X]=(0,ie.useState)(null),[O,J]=(0,ie.useState)(null),ue=sa(v,Object.values(v)),Se=ui("DndDescribedBy",a),$e=(0,ie.useMemo)(()=>ne.getEnabled(),[ne]),Ie=kk(m),{droppableRects:ot,measureDroppableContainers:Ge,measuringScheduled:ye}=ok($e,{dragging:M,dependencies:[re.x,re.y],config:Ie.droppable}),Ee=tk(j,V),Le=(0,ie.useMemo)(()=>O?Pu(O):null,[O]),Be=S(),Ae=rk(Ee,Ie.draggable.measure);Sk({activeNode:V!=null?j.get(V):null,config:Be.layoutShiftCompensation,initialRect:Ae,measure:Ie.draggable.measure});let Ne=uv(Ee,Ie.draggable.measure,Ae),it=uv(Ee?Ee.parentElement:null),Je=(0,ie.useRef)({activatorEvent:null,active:null,activeNode:Ee,collisionRect:null,collisions:null,droppableRects:ot,draggableNodes:j,draggingNode:null,draggingNodeRect:null,droppableContainers:ne,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),R=ne.getNodeFor((n=Je.current.over)==null?void 0:n.id),G=fk({measure:Ie.dragOverlay.measure}),me=(o=G.nodeRef.current)!=null?o:Ee,ae=M?(r=G.rect)!=null?r:Ne:null,je=!!(G.nodeRef.current&&G.rect),qe=lk(je?null:Ne),_e=xv(me?Fn(me):null),Oe=sk(M?R??Ee:null),vt=pk(Oe),Ft=Ck(c,{transform:{x:re.x-qe.x,y:re.y-qe.y,scaleX:1,scaleY:1},activatorEvent:O,active:De,activeNodeRect:Ne,containerNodeRect:it,draggingNodeRect:ae,over:Je.current.over,overlayNodeRect:G.rect,scrollableAncestors:Oe,scrollableAncestorRects:vt,windowRect:_e}),P=Le?ci(Le,re):null,we=uk(Oe),A=dv(we),ee=dv(we,[Ne]),Me=ci(Ft,A),Fe=ae?P0(ae,Ft):null,bt=De&&Fe?f({active:De,collisionRect:Fe,droppableRects:ot,droppableContainers:$e,pointerCoordinates:P}):null,cn=_v(bt,"id"),[mt,dn]=(0,ie.useState)(null),Jt=je?Ft:ci(Ft,ee),en=T0(Jt,(i=mt?.rect)!=null?i:null,Ne),x=(0,ie.useRef)(null),N=(0,ie.useCallback)((Q,he)=>{let{sensor:be,options:xe}=he;if(Ve.current==null)return;let Xe=j.get(Ve.current);if(!Xe)return;let Ue=Q.nativeEvent,U=new be({active:Ve.current,activeNode:Xe,event:Ue,options:xe,context:Je,onAbort(Te){if(!j.get(Te))return;let{onDragAbort:st}=ue.current,yt={id:Te};st?.(yt),g({type:"onDragAbort",event:yt})},onPending(Te,ft,st,yt){if(!j.get(Te))return;let{onDragPending:Vt}=ue.current,Dt={id:Te,constraint:ft,initialCoordinates:st,offset:yt};Vt?.(Dt),g({type:"onDragPending",event:Dt})},onStart(Te){let ft=Ve.current;if(ft==null)return;let st=j.get(ft);if(!st)return;let{onDragStart:yt}=ue.current,Ot={activatorEvent:Ue,active:{id:ft,data:st.data,rect:de}};(0,pi.unstable_batchedUpdates)(()=>{yt?.(Ot),D(Dr.Initializing),_({type:rn.DragStart,initialCoordinates:Te,active:ft}),g({type:"onDragStart",event:Ot}),X(x.current),J(Ue)})},onMove(Te){_({type:rn.DragMove,coordinates:Te})},onEnd:ze(rn.DragEnd),onCancel:ze(rn.DragCancel)});x.current=U;function ze(Te){return async function(){let{active:st,collisions:yt,over:Ot,scrollAdjustedTranslate:Vt}=Je.current,Dt=null;if(st&&Vt){let{cancelDrop:an}=ue.current;Dt={activatorEvent:Ue,active:st,collisions:yt,delta:Vt,over:Ot},Te===rn.DragEnd&&typeof an=="function"&&await Promise.resolve(an(Dt))&&(Te=rn.DragCancel)}Ve.current=null,(0,pi.unstable_batchedUpdates)(()=>{_({type:Te}),D(Dr.Uninitialized),dn(null),X(null),J(null),x.current=null;let an=Te===rn.DragEnd?"onDragEnd":"onDragCancel";if(Dt){let Wn=ue.current[an];Wn?.(Dt),g({type:an,event:Dt})}})}}},[j]),Y=(0,ie.useCallback)((Q,he)=>(be,xe)=>{let Xe=be.nativeEvent,Ue=j.get(xe);if(Ve.current!==null||!Ue||Xe.dndKit||Xe.defaultPrevented)return;let U={active:Ue};Q(be,he.options,U)===!0&&(Xe.dndKit={capturedBy:he.sensor},Ve.current=xe,N(be,he))},[j,N]),se=nk(p,Y);ck(p),co(()=>{Ne&&k===Dr.Initializing&&D(Dr.Initialized)},[Ne,k]),(0,ie.useEffect)(()=>{let{onDragMove:Q}=ue.current,{active:he,activatorEvent:be,collisions:xe,over:Xe}=Je.current;if(!he||!be)return;let Ue={active:he,activatorEvent:be,collisions:xe,delta:{x:Me.x,y:Me.y},over:Xe};(0,pi.unstable_batchedUpdates)(()=>{Q?.(Ue),g({type:"onDragMove",event:Ue})})},[Me.x,Me.y]),(0,ie.useEffect)(()=>{let{active:Q,activatorEvent:he,collisions:be,droppableContainers:xe,scrollAdjustedTranslate:Xe}=Je.current;if(!Q||Ve.current==null||!he||!Xe)return;let{onDragOver:Ue}=ue.current,U=xe.get(cn),ze=U&&U.rect.current?{id:U.id,rect:U.rect.current,data:U.data,disabled:U.disabled}:null,Te={active:Q,activatorEvent:he,collisions:be,delta:{x:Xe.x,y:Xe.y},over:ze};(0,pi.unstable_batchedUpdates)(()=>{dn(ze),Ue?.(Te),g({type:"onDragOver",event:Te})})},[cn]),co(()=>{Je.current={activatorEvent:O,active:De,activeNode:Ee,collisionRect:Fe,collisions:bt,droppableRects:ot,draggableNodes:j,draggingNode:me,draggingNodeRect:ae,droppableContainers:ne,over:mt,scrollableAncestors:Oe,scrollAdjustedTranslate:Me},de.current={initial:ae,translated:Fe}},[De,Ee,bt,Fe,j,me,ae,ot,ne,mt,Oe,Me]),Z0({...Be,delta:re,draggingRect:Fe,pointerCoordinates:P,scrollableAncestors:Oe,scrollableAncestorRects:vt});let oe=(0,ie.useMemo)(()=>({active:De,activeNode:Ee,activeNodeRect:Ne,activatorEvent:O,collisions:bt,containerNodeRect:it,dragOverlay:G,draggableNodes:j,droppableContainers:ne,droppableRects:ot,over:mt,measureDroppableContainers:Ge,scrollableAncestors:Oe,scrollableAncestorRects:vt,measuringConfiguration:Ie,measuringScheduled:ye,windowRect:_e}),[De,Ee,Ne,O,bt,it,G,j,ne,ot,mt,Ge,Oe,vt,Ie,ye,_e]),te=(0,ie.useMemo)(()=>({activatorEvent:O,activators:se,active:De,activeNodeRect:Ne,ariaDescribedById:{draggable:Se},dispatch:_,draggableNodes:j,over:mt,measureDroppableContainers:Ge}),[O,se,De,Ne,_,Se,j,mt,Ge]);return ie.default.createElement(fv.Provider,{value:y},ie.default.createElement(Vu.Provider,{value:te},ie.default.createElement(Rv.Provider,{value:oe},ie.default.createElement(Ev.Provider,{value:en},d)),ie.default.createElement(wk,{disabled:l?.restoreFocus===!1})),ie.default.createElement(N0,{...l,hiddenTextDescribedById:Se}));function S(){let Q=H?.autoScrollEnabled===!1,he=typeof s=="object"?s.enabled===!1:s===!1,be=M&&!Q&&!he;return typeof s=="object"?{...s,enabled:be}:{enabled:be}}}),Nk=(0,ie.createContext)(null),mv="button",xk="Draggable";function Fv(e){let{id:t,data:n,disabled:o=!1,attributes:r}=e,i=ui(xk),{activators:a,activatorEvent:l,active:s,activeNodeRect:d,ariaDescribedById:p,draggableNodes:f,over:m}=(0,ie.useContext)(Vu),{role:c=mv,roleDescription:v="draggable",tabIndex:h=0}=r??{},b=s?.id===t,_=(0,ie.useContext)(b?Ev:Nk),[g,y]=Fl(),[k,D]=Fl(),M=dk(a,t),V=sa(n);co(()=>(f.set(t,{id:t,key:i,node:g,activatorNode:k,data:V}),()=>{let re=f.get(t);re&&re.key===i&&f.delete(t)}),[f,t]);let j=(0,ie.useMemo)(()=>({role:c,tabIndex:h,"aria-disabled":o,"aria-pressed":b&&c===mv?!0:void 0,"aria-roledescription":v,"aria-describedby":p.draggable}),[o,c,h,b,v,p.draggable]);return{active:s,activatorEvent:l,activeNodeRect:d,attributes:j,isDragging:b,listeners:o?void 0:M,node:g,over:m,setNodeRef:y,setActivatorNodeRef:D,transform:_}}function Dv(){return(0,ie.useContext)(Rv)}var Rk="Droppable",Ek={timeout:25};function Tv(e){let{data:t,disabled:n=!1,id:o,resizeObserverConfig:r}=e,i=ui(Rk),{active:a,dispatch:l,over:s,measureDroppableContainers:d}=(0,ie.useContext)(Vu),p=(0,ie.useRef)({disabled:n}),f=(0,ie.useRef)(!1),m=(0,ie.useRef)(null),c=(0,ie.useRef)(null),{disabled:v,updateMeasurementsFor:h,timeout:b}={...Ek,...r},_=sa(h??o),g=(0,ie.useCallback)(()=>{if(!f.current){f.current=!0;return}c.current!=null&&clearTimeout(c.current),c.current=setTimeout(()=>{d(Array.isArray(_.current)?_.current:[_.current]),c.current=null},b)},[b]),y=zu({callback:g,disabled:v||!a}),k=(0,ie.useCallback)((j,re)=>{y&&(re&&(y.unobserve(re),f.current=!1),j&&y.observe(j))},[y]),[D,M]=Fl(k),V=sa(t);return(0,ie.useEffect)(()=>{!y||!D.current||(y.disconnect(),f.current=!1,y.observe(D.current))},[D,y]),(0,ie.useEffect)(()=>(l({type:rn.RegisterDroppable,element:{id:o,key:i,disabled:n,node:D,rect:m,data:V}}),()=>l({type:rn.UnregisterDroppable,key:i,id:o})),[o]),(0,ie.useEffect)(()=>{n!==p.current.disabled&&(l({type:rn.SetDroppableDisabled,id:o,key:i,disabled:n}),p.current.disabled=n)},[o,i,n,l]),{active:a,rect:m,isOver:s?.id===o,node:D,over:s,setNodeRef:M}}var Kt=Re(xt());function pa(e,t,n){let o=e.slice();return o.splice(n<0?o.length+n:n,0,o.splice(t,1)[0]),o}function Fk(e,t){return e.reduce((n,o,r)=>{let i=t.get(o);return i&&(n[r]=i),n},Array(e.length))}function Bu(e){return e!==null&&e>=0}function Dk(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Tk(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}var ju={scaleX:1,scaleY:1},vm=e=>{var t;let{rects:n,activeNodeRect:o,activeIndex:r,overIndex:i,index:a}=e,l=(t=n[r])!=null?t:o;if(!l)return null;let s=Mk(n,a,r);if(a===r){let d=n[i];return d?{x:r<i?d.left+d.width-(l.left+l.width):d.left-l.left,y:0,...ju}:null}return a>r&&a<=i?{x:-l.width-s,y:0,...ju}:a<r&&a>=i?{x:l.width+s,y:0,...ju}:{x:0,y:0,...ju}};function Mk(e,t,n){let o=e[t],r=e[t-1],i=e[t+1];return!o||!r&&!i?0:n<t?r?o.left-(r.left+r.width):i.left-(o.left+o.width):i?i.left-(o.left+o.width):o.left-(r.left+r.width)}var Mv=e=>{let{rects:t,activeIndex:n,overIndex:o,index:r}=e,i=pa(t,o,n),a=t[r],l=i[r];return!l||!a?null:{x:l.left-a.left,y:l.top-a.top,scaleX:l.width/a.width,scaleY:l.height/a.height}};var Pv="Sortable",Lv=Kt.default.createContext({activeIndex:-1,containerId:Pv,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Mv,disabled:{draggable:!1,droppable:!1}});function bm(e){let{children:t,id:n,items:o,strategy:r=Mv,disabled:i=!1}=e,{active:a,dragOverlay:l,droppableRects:s,over:d,measureDroppableContainers:p}=Dv(),f=ui(Pv,n),m=l.rect!==null,c=(0,Kt.useMemo)(()=>o.map(M=>typeof M=="object"&&"id"in M?M.id:M),[o]),v=a!=null,h=a?c.indexOf(a.id):-1,b=d?c.indexOf(d.id):-1,_=(0,Kt.useRef)(c),g=!Dk(c,_.current),y=b!==-1&&h===-1||g,k=Tk(i);co(()=>{g&&v&&p(c)},[g,c,v,p]),(0,Kt.useEffect)(()=>{_.current=c},[c]);let D=(0,Kt.useMemo)(()=>({activeIndex:h,containerId:f,disabled:k,disableTransforms:y,items:c,overIndex:b,useDragOverlay:m,sortedRects:Fk(c,s),strategy:r}),[h,f,k.draggable,k.droppable,y,c,b,s,m,r]);return Kt.default.createElement(Lv.Provider,{value:D},t)}var Pk=e=>{let{id:t,items:n,activeIndex:o,overIndex:r}=e;return pa(n,o,r).indexOf(t)},Lk=e=>{let{containerId:t,isSorting:n,wasDragging:o,index:r,items:i,newIndex:a,previousItems:l,previousContainerId:s,transition:d}=e;return!d||!o||l!==i&&r===a?!1:n?!0:a!==r&&t===s},Ik={duration:200,easing:"ease"},Iv="transform",Ak=Jo.Transition.toString({property:Iv,duration:0,easing:"linear"}),Ok={roleDescription:"sortable"};function $k(e){let{disabled:t,index:n,node:o,rect:r}=e,[i,a]=(0,Kt.useState)(null),l=(0,Kt.useRef)(n);return co(()=>{if(!t&&n!==l.current&&o.current){let s=r.current;if(s){let d=gi(o.current,{ignoreTransform:!0}),p={x:s.left-d.left,y:s.top-d.top,scaleX:s.width/d.width,scaleY:s.height/d.height};(p.x||p.y)&&a(p)}}n!==l.current&&(l.current=n)},[t,n,o,r]),(0,Kt.useEffect)(()=>{i&&a(null)},[i]),i}function ym(e){let{animateLayoutChanges:t=Lk,attributes:n,disabled:o,data:r,getNewIndex:i=Pk,id:a,strategy:l,resizeObserverConfig:s,transition:d=Ik}=e,{items:p,containerId:f,activeIndex:m,disabled:c,disableTransforms:v,sortedRects:h,overIndex:b,useDragOverlay:_,strategy:g}=(0,Kt.useContext)(Lv),y=zk(o,c),k=p.indexOf(a),D=(0,Kt.useMemo)(()=>({sortable:{containerId:f,index:k,items:p},...r}),[f,r,k,p]),M=(0,Kt.useMemo)(()=>p.slice(p.indexOf(a)),[p,a]),{rect:V,node:j,isOver:re,setNodeRef:ne}=Tv({id:a,data:D,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:M,...s}}),{active:ce,activatorEvent:de,activeNodeRect:De,attributes:Ve,setNodeRef:H,listeners:X,isDragging:O,over:J,setActivatorNodeRef:ue,transform:Se}=Fv({id:a,data:D,attributes:{...Ok,...n},disabled:y.draggable}),$e=Xh(ne,H),Ie=!!ce,ot=Ie&&!v&&Bu(m)&&Bu(b),Ge=!_&&O,ye=Ge&&ot?Se:null,Le=ot?ye??(l??g)({rects:h,activeNodeRect:De,activeIndex:m,overIndex:b,index:k}):null,Be=Bu(m)&&Bu(b)?i({id:a,items:p,activeIndex:m,overIndex:b}):k,Ae=ce?.id,Ne=(0,Kt.useRef)({activeId:Ae,items:p,newIndex:Be,containerId:f}),it=p!==Ne.current.items,Je=t({active:ce,containerId:f,isDragging:O,isSorting:Ie,id:a,index:k,items:p,newIndex:Ne.current.newIndex,previousItems:Ne.current.items,previousContainerId:Ne.current.containerId,transition:d,wasDragging:Ne.current.activeId!=null}),R=$k({disabled:!Je,index:k,node:j,rect:V});return(0,Kt.useEffect)(()=>{Ie&&Ne.current.newIndex!==Be&&(Ne.current.newIndex=Be),f!==Ne.current.containerId&&(Ne.current.containerId=f),p!==Ne.current.items&&(Ne.current.items=p)},[Ie,Be,f,p]),(0,Kt.useEffect)(()=>{if(Ae===Ne.current.activeId)return;if(Ae!=null&&Ne.current.activeId==null){Ne.current.activeId=Ae;return}let me=setTimeout(()=>{Ne.current.activeId=Ae},50);return()=>clearTimeout(me)},[Ae]),{active:ce,activeIndex:m,attributes:Ve,data:D,rect:V,index:k,newIndex:Be,items:p,isOver:re,isSorting:Ie,isDragging:O,listeners:X,node:j,overIndex:b,over:J,setNodeRef:$e,setActivatorNodeRef:ue,setDroppableNodeRef:ne,setDraggableNodeRef:H,transform:R??Le,transition:G()};function G(){if(R||it&&Ne.current.newIndex===k)return Ak;if(!(Ge&&!Dl(de)||!d)&&(Ie||Je))return Jo.Transition.toString({...d,property:Iv})}}function zk(e,t){var n,o;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e?.draggable)!=null?n:t.draggable,droppable:(o=e?.droppable)!=null?o:t.droppable}}var Mx=[Rt.Down,Rt.Right,Rt.Up,Rt.Left];var rb=require("obsidian"),le=Re(xt(),1),Ju=Re(uo(),1);var zn=Re(xt(),1);var ht=class extends Error{constructor(t){super(t),this.name="FormulaError"}};function wm(e){let t=[],n=0;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}let o=n;if(/[0-9]/.test(e[n])||e[n]==="."&&/[0-9]/.test(e[n+1]??"")){for(;n<e.length&&/[0-9.]/.test(e[n]);)n++;t.push({type:"NUM",val:e.slice(o,n),pos:o});continue}if(e[n]==='"'||e[n]==="'"){let r=e[n++];for(;n<e.length&&e[n]!==r;)e[n]==="\\"&&n++,n++;if(n>=e.length)throw new ht(u("formula_err_unclosed_string").replace("$pos",String(o)));n++,t.push({type:"STR",val:e.slice(o+1,n-1),pos:o});continue}if(e[n]==="["){n++;let r=n;for(;n<e.length&&e[n]!=="]";)n++;if(n>=e.length)throw new ht(u("formula_err_unclosed_bracket").replace("$pos",String(o)));let i=e.slice(r,n++);t.push({type:"BRACKET_IDENT",val:i,pos:o});continue}if(/[a-zA-Z_]/.test(e[n])){for(;n<e.length&&/[a-zA-Z0-9_]/.test(e[n]);)n++;let r=e.slice(o,n),i=r.toUpperCase();i==="TRUE"||i==="FALSE"?t.push({type:"BOOL",val:i,pos:o}):t.push({type:"IDENT",val:r,pos:o});continue}switch(e[n]){case"(":t.push({type:"LPAREN",val:"(",pos:n++});break;case")":t.push({type:"RPAREN",val:")",pos:n++});break;case",":t.push({type:"COMMA",val:",",pos:n++});break;case"+":t.push({type:"PLUS",val:"+",pos:n++});break;case"-":t.push({type:"MINUS",val:"-",pos:n++});break;case"*":t.push({type:"STAR",val:"*",pos:n++});break;case"/":t.push({type:"SLASH",val:"/",pos:n++});break;case"&":t.push({type:"AMP",val:"&",pos:n++});break;case"=":e[n+1]==="="?(t.push({type:"EQ",val:"==",pos:n}),n+=2):t.push({type:"EQ",val:"=",pos:n++});break;case"!":if(e[n+1]==="=")t.push({type:"NEQ",val:"!=",pos:n}),n+=2;else throw new ht(u("formula_err_unexpected_bang").replace("$pos",String(n)));break;case"<":e[n+1]===">"?(t.push({type:"NEQ",val:"<>",pos:n}),n+=2):e[n+1]==="="?(t.push({type:"LTE",val:"<=",pos:n}),n+=2):t.push({type:"LT",val:"<",pos:n++});break;case">":e[n+1]==="="?(t.push({type:"GTE",val:">=",pos:n}),n+=2):t.push({type:"GT",val:">",pos:n++});break;default:throw new ht(u("formula_err_unexpected_char").replace("$char",e[n]).replace("$pos",String(n)))}}return t.push({type:"EOF",val:"",pos:n}),t}var Hu=class{constructor(t){this.toks=t;this.p=0}cur(){return this.toks[this.p]}eat(){return this.toks[this.p++]}expect(t){let n=this.eat();if(n.type!==t)throw new ht(u("formula_err_expected_token").replace("$expected",String(t)).replace("$found",n.val).replace("$pos",String(n.pos)));return n}is(t){return this.cur().type===t}parse(){let t=this.expr();if(!this.is("EOF"))throw new ht(u("formula_err_unexpected_token").replace("$token",this.cur().val).replace("$pos",String(this.cur().pos)));return t}expr(){return this.cmp()}cmp(){let t=this.add();for(;["EQ","NEQ","GT","LT","GTE","LTE"].includes(this.cur().type);)t={k:"bin",op:this.eat().val,l:t,r:this.add()};return t}add(){let t=this.mul();for(;this.is("PLUS")||this.is("MINUS")||this.is("AMP");)t={k:"bin",op:this.eat().val,l:t,r:this.mul()};return t}mul(){let t=this.unary();for(;this.is("STAR")||this.is("SLASH");)t={k:"bin",op:this.eat().val,l:t,r:this.unary()};return t}unary(){return this.is("MINUS")?(this.eat(),{k:"neg",x:this.unary()}):this.primary()}primary(){let t=this.cur();if(t.type==="NUM")return this.eat(),{k:"num",v:parseFloat(t.val)};if(t.type==="STR")return this.eat(),{k:"str",v:t.val};if(t.type==="BOOL")return this.eat(),{k:"bool",v:t.val==="TRUE"};if(t.type==="BRACKET_IDENT")return this.eat(),{k:"col",name:t.val};if(t.type==="IDENT"){if(this.eat(),this.is("LPAREN")){this.eat();let n=[];if(!this.is("RPAREN"))for(n.push(this.expr());this.is("COMMA");)this.eat(),n.push(this.expr());return this.expect("RPAREN"),{k:"call",fn:t.val.toUpperCase(),args:n}}return{k:"col",name:t.val}}if(t.type==="LPAREN"){this.eat();let n=this.expr();return this.expect("RPAREN"),n}throw new ht(u("formula_err_unexpected_token").replace("$token",t.val).replace("$pos",String(t.pos)))}};function ut(e){if(typeof e=="number")return isNaN(e)?0:e;if(typeof e=="string"){let t=parseFloat(e);return isNaN(t)?0:t}return typeof e=="boolean"&&e?1:0}function Dn(e){return e==null?"":Array.isArray(e)?e.map(Dn).join(", "):String(e)}function Al(e){return e!=null&&e!==!1&&e!==""&&e!==0}function Av(e,t){let n=typeof e=="string"?e.toLowerCase():e,o=typeof t=="string"?t.toLowerCase():t;return n==o}function ma(e,t){if(e==="_title")return"_title";let n=t.schema.find(r=>r.id===e&&r.type!=="formula");if(n)return n.id;let o=t.schema.find(r=>r.name.toLowerCase()===e.toLowerCase()&&r.type!=="formula");return o?o.id:null}function fa(e,t){return e==="_title"?t._title:t[e]}function Vk(e,t){let n=ma(e,t);if(n===null)throw t.schema.some(r=>(r.id===e||r.name.toLowerCase()===e.toLowerCase())&&r.type==="formula")?new ht(u("formula_err_circular_ref").replace("$name",e)):new ht(`Coluna desconhecida: "${e}"`);return fa(n,t.row)}var Bk=new Set(["IF","IFS","AND","OR","NOT","SUM","AVG","AVERAGE","COUNT","COUNTA","MIN","MAX","CONCAT","LEN","UPPER","LOWER","TRIM","LEFT","RIGHT","MID","SUBSTITUTE","ROUND","FLOOR","CEIL","ABS","MOD","POWER","SQRT","ISNULL","ISEMPTY","COALESCE","TEXT","VALUE"]);function tt(e,t){switch(e.k){case"num":return e.v;case"str":return e.v;case"bool":return e.v;case"col":return Vk(e.name,t);case"neg":return-ut(tt(e.x,t));case"bin":{let{op:n,l:o,r}=e,i=tt(o,t),a=tt(r,t);switch(n){case"+":return ut(i)+ut(a);case"-":return ut(i)-ut(a);case"*":return ut(i)*ut(a);case"/":{let l=ut(a);return l===0?null:ut(i)/l}case"&":return Dn(i)+Dn(a);case"=":case"==":return Av(i,a);case"<>":case"!=":return!Av(i,a);case">":return ut(i)>ut(a);case"<":return ut(i)<ut(a);case">=":return ut(i)>=ut(a);case"<=":return ut(i)<=ut(a);default:throw new ht(`Operador desconhecido: ${n}`)}}case"call":{let{fn:n,args:o}=e;if(!Bk.has(n))throw new ht(u("formula_err_unknown_fn").replace("$fn",n));if(n==="IF"){if(o.length<2||o.length>3)throw new ht(u("formula_err_if_args"));return Al(tt(o[0],t))?tt(o[1],t):o[2]?tt(o[2],t):null}if(n==="IFS"){if(o.length<2||o.length%2!==0)throw new ht("IFS(cond1, val1, cond2, val2, ...)");for(let r=0;r<o.length;r+=2)if(Al(tt(o[r],t)))return tt(o[r+1],t);return null}if(n==="AND"){if(o.length===0)throw new ht("AND requer ao menos 1 argumento");return o.every(r=>Al(tt(r,t)))}if(n==="OR"){if(o.length===0)throw new ht("OR requer ao menos 1 argumento");return o.some(r=>Al(tt(r,t)))}if(n==="NOT"){if(o.length!==1)throw new ht("NOT(valor)");return!Al(tt(o[0],t))}if(n==="SUM"){if(o.length===0)throw new ht("SUM requer ao menos 1 argumento");if(o.length===1&&o[0].k==="col"){let r=ma(o[0].name,t);if(r)return t.allRows.reduce((i,a)=>i+ut(fa(r,a)),0)}return o.reduce((r,i)=>r+ut(tt(i,t)),0)}if(n==="AVG"||n==="AVERAGE"){if(o.length!==1||o[0].k!=="col")throw new ht(u("formula_err_avg_args"));let r=ma(o[0].name,t);if(!r)throw new ht("Coluna desconhecida em AVG");let i=t.allRows.map(a=>ut(fa(r,a)));return i.length?i.reduce((a,l)=>a+l,0)/i.length:0}if(n==="COUNT"||n==="COUNTA"){if(o.length!==1||o[0].k!=="col")throw new ht(u("formula_err_count_args"));let r=ma(o[0].name,t);if(!r)throw new ht("Coluna desconhecida em COUNT");return t.allRows.filter(i=>{let a=fa(r,i);return a!=null&&a!==""}).length}if(n==="MIN"){if(o.length===1&&o[0].k==="col"){let r=ma(o[0].name,t);if(r)return Math.min(...t.allRows.map(i=>ut(fa(r,i))))}return Math.min(...o.map(r=>ut(tt(r,t))))}if(n==="MAX"){if(o.length===1&&o[0].k==="col"){let r=ma(o[0].name,t);if(r)return Math.max(...t.allRows.map(i=>ut(fa(r,i))))}return Math.max(...o.map(r=>ut(tt(r,t))))}if(n==="CONCAT")return o.map(r=>Dn(tt(r,t))).join("");if(n==="LEN"){if(o.length!==1)throw new ht("LEN(texto)");return Dn(tt(o[0],t)).length}if(n==="UPPER"){if(o.length!==1)throw new ht("UPPER(texto)");return Dn(tt(o[0],t)).toUpperCase()}if(n==="LOWER"){if(o.length!==1)throw new ht("LOWER(texto)");return Dn(tt(o[0],t)).toLowerCase()}if(n==="TRIM"){if(o.length!==1)throw new ht("TRIM(texto)");return Dn(tt(o[0],t)).trim()}if(n==="LEFT"){if(o.length!==2)throw new ht("LEFT(texto, n)");return Dn(tt(o[0],t)).slice(0,ut(tt(o[1],t)))}if(n==="RIGHT"){if(o.length!==2)throw new ht("RIGHT(texto, n)");let r=Dn(tt(o[0],t)),i=ut(tt(o[1],t));return r.slice(Math.max(0,r.length-i))}if(n==="MID"){if(o.length!==3)throw new ht(u("formula_err_mid_args"));let r=Dn(tt(o[0],t)),i=ut(tt(o[1],t))-1;return r.slice(i,i+ut(tt(o[2],t)))}if(n==="SUBSTITUTE"){if(o.length<3)throw new ht("SUBSTITUTE(texto, de, para)");return Dn(tt(o[0],t)).split(Dn(tt(o[1],t))).join(Dn(tt(o[2],t)))}if(n==="ROUND"){let r=ut(tt(o[0],t)),i=o[1]?ut(tt(o[1],t)):0;return Math.round(r*10**i)/10**i}if(n==="FLOOR")return Math.floor(ut(tt(o[0],t)));if(n==="CEIL")return Math.ceil(ut(tt(o[0],t)));if(n==="ABS")return Math.abs(ut(tt(o[0],t)));if(n==="MOD"){if(o.length!==2)throw new ht(u("formula_err_mod_args"));return ut(tt(o[0],t))%ut(tt(o[1],t))}if(n==="POWER"){if(o.length!==2)throw new ht("POWER(base, expoente)");return Math.pow(ut(tt(o[0],t)),ut(tt(o[1],t)))}if(n==="SQRT"){if(o.length!==1)throw new ht(u("formula_err_sqrt_args"));return Math.sqrt(ut(tt(o[0],t)))}if(n==="ISNULL"||n==="ISEMPTY"){if(o.length!==1)throw new ht(`${n}(valor)`);let r=tt(o[0],t);return r==null||r===""}if(n==="COALESCE"){for(let r of o){let i=tt(r,t);if(i!=null&&i!=="")return i}return null}if(n==="TEXT")return o.length===1?Dn(tt(o[0],t)):null;if(n==="VALUE")return o.length===1?ut(tt(o[0],t)):null;throw new ht(u("formula_err_not_implemented").replace("$fn",n))}}}function Ov(e){if(!e.trim())return null;try{wm(e);let t=wm(e);return new Hu(t).parse(),null}catch(t){return t instanceof ht?t.message:String(t)}}function jk(e,t,n,o){if(!e.trim())return null;try{let r=new Hu(wm(e)).parse(),i=new Set(o.filter(a=>a.type==="formula").map(a=>a.id));return tt(r,{row:t,allRows:n,schema:o,formulaColIds:i})}catch{return"#ERRO"}}function $v(e,t){let n=t.filter(o=>o.type==="formula"&&o.formula);return n.length===0?e:e.map(o=>{let r={...o};for(let i of n)r[i.id]=jk(i.formula,o,e,t);return r})}var Hk=["contains","not_contains","starts_with","ends_with","is","is_not","is_empty","is_not_empty"],Uk=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],Wk=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],Cm=["is","is_not","contains","not_contains","is_empty","is_not_empty"],Gk=["is_checked","is_unchecked","is_empty","is_not_empty"];function ga(e){switch(e){case"number":return Uk;case"date":return Wk;case"select":return Cm;case"multiselect":return Cm;case"status":return Cm;case"checkbox":return Gk;default:return Hk}}function Tn(e){switch(e){case"number":case"date":return"is";case"checkbox":return"is_checked";case"select":case"multiselect":case"status":return"is";default:return"contains"}}function qk(){return{is:u("op_is"),is_not:u("op_is_not"),contains:u("op_contains"),not_contains:u("op_not_contains"),starts_with:u("op_starts_with"),ends_with:u("op_ends_with"),gt:u("op_gt"),gte:u("op_gte"),lt:u("op_lt"),lte:u("op_lte"),is_checked:u("op_is_checked"),is_unchecked:u("op_is_unchecked"),is_empty:u("op_is_empty"),is_not_empty:u("op_is_not_empty")}}var Tr=new Proxy({},{get:(e,t)=>qk()[t]??t}),Mr=new Set(["is_empty","is_not_empty","is_checked","is_unchecked"]),zv="|||";function _a(e){return(e.columnType==="select"||e.columnType==="multiselect"||e.columnType==="status")&&(e.operator==="is"||e.operator==="is_not")}function _i(e){return e.split(zv).filter(t=>t!=="")}function Uu(e,t){let n=_i(e),o=n.indexOf(t);return o>=0?n.splice(o,1):n.push(t),n.join(zv)}function Qe(e){return{title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197",image:"\u{1F5BC}",audio:"\u{1F3B5}",video:"\u{1F3AC}"}[e]??"\xB7"}function km(e,t){if(!Mr.has(t.operator)&&t.value==="")return!0;let o=t.columnId==="_title"?e._title:e[t.columnId];if(t.operator==="is_empty")return o==null||String(o??"").trim()==="";if(t.operator==="is_not_empty")return o!=null&&String(o??"").trim()!=="";if(t.operator==="is_checked")return o===!0||o==="true";if(t.operator==="is_unchecked")return o!==!0&&o!=="true";if(t.columnType==="number"){let a=parseFloat(String(o??"")),l=parseFloat(t.value);if(isNaN(a)||isNaN(l))return!1;switch(t.operator){case"is":return a===l;case"is_not":return a!==l;case"gt":return a>l;case"gte":return a>=l;case"lt":return a<l;case"lte":return a<=l;default:return!0}}if(t.columnType==="date"){let a=new Date(String(o??"")).getTime(),l=new Date(t.value).getTime();if(isNaN(a)||isNaN(l))return!1;switch(t.operator){case"is":return a===l;case"is_not":return a!==l;case"gt":return a>l;case"gte":return a>=l;case"lt":return a<l;case"lte":return a<=l;default:return!0}}if(_a(t)){let a=_i(t.value).map(s=>s.toLowerCase());if(a.length===0)return!0;let l=Array.isArray(o)?o.map(s=>s.toLowerCase()):[String(o??"").toLowerCase()];return t.operator==="is"?l.some(s=>a.includes(s)):l.every(s=>!a.includes(s))}let r=Array.isArray(o)?o.join(", ").toLowerCase():String(o??"").toLowerCase(),i=t.value.toLowerCase();switch(t.operator){case"is":return r===i;case"is_not":return r!==i;case"contains":return r.includes(i);case"not_contains":return!r.includes(i);case"starts_with":return r.startsWith(i);case"ends_with":return r.endsWith(i);default:return!0}}function mo(e,t){if(t.length===0)return e;let n=[],o=[];for(let r of t)r.conjunction==="or"&&o.length>0&&(n.push(o),o=[]),o.push(r);return o.length>0&&n.push(o),e.filter(r=>n.some(i=>i.every(a=>km(r,a))))}function Vv(e,t){if(!t||t.length===0)return e;let n=new Map(t.map((o,r)=>[o,r]));return[...e].sort((o,r)=>{let i=n.get(o._file.path)??1/0,a=n.get(r._file.path)??1/0;return i-a})}function to(e,t){return t.length===0?e:[...e].sort((n,o)=>{for(let r of t){let i=r.columnId==="_title"?n._title:n[r.columnId],a=r.columnId==="_title"?o._title:o[r.columnId],l=0;if(i==null)l=-1;else if(a==null)l=1;else{let s=parseFloat(String(i)),d=parseFloat(String(a));!isNaN(s)&&!isNaN(d)?l=s-d:l=String(i??"").toLowerCase().localeCompare(String(a??"").toLowerCase())}if(l!==0)return r.direction==="asc"?l:-l}return 0})}function Bv(e,t,n,o){for(let r of n){if(r.columnId!==t)continue;let i=o.find(s=>s.id===r.columnId),a=i?.type??"text",l={id:r.id,columnId:r.columnId,columnName:i?.name??r.columnId,columnType:a,icon:"",operator:r.operator,value:r.value,conjunction:"and"};if(km(e,l)){let s={};return r.bgColor&&(s.backgroundColor=r.bgColor),r.textColor&&(s.color=r.textColor),s}}}function ha(e,t,n){for(let o of t){let r=n.find(l=>l.id===o.columnId),i=r?.type??"text",a={id:o.id,columnId:o.columnId,columnName:r?.name??o.columnId,columnType:i,icon:"",operator:o.operator,value:o.value,conjunction:"and"};if(km(e,a)){let l={};return o.bgColor&&(l.borderLeft=`4px solid ${o.bgColor}`),o.textColor&&(l.color=o.textColor),l}}}var Sm=200,Kk=100,Yk=50;async function Xk(e,t,n,o,r){if(e.length<=Kk)return Promise.all(e.map(a=>n.getNoteData(a,t)));let i=[];for(let a=0;a<e.length;a+=Sm){if(o.current!==r)return null;let l=e.slice(a,a+Sm),s=await Promise.all(l.map(d=>n.getNoteData(d,t)));i.push(...s),a+Sm<e.length&&await new Promise(d=>setTimeout(d,0))}return o.current===r?i:null}function Qk(e,t){return!e||e.length===0?[]:e.flatMap(n=>{if(n.columnId==="_title")return[{id:n.id??crypto.randomUUID(),columnId:"_title",columnName:u("name_column"),columnType:"title",icon:"\u{1F4C4}",operator:n.operator,value:n.value,conjunction:n.conjunction??"and"}];let o=t.find(r=>r.id===n.columnId);return o?[{id:n.id??crypto.randomUUID(),columnId:o.id,columnName:o.name,columnType:o.type,icon:Qe(o.type),operator:n.operator,value:n.value,conjunction:n.conjunction??"and"}]:[]})}function Vn(e){let{app:t,dbFile:n,manager:o,includeSubfolders:r,externalView:i,onLoaded:a}=e,[l,s]=(0,zn.useState)([]),[d,p]=(0,zn.useState)(Rr),[f,m]=(0,zn.useState)(!0),[c,v]=(0,zn.useState)([]),h=(0,zn.useRef)(0),b=(0,zn.useRef)(!1),_=(0,zn.useCallback)(async()=>{if(!n){m(!1);return}m(!0);let g=++h.current,y=o.readConfig(n),k=o.getNotesInDatabase(n,r);y.schema.length===0&&k.length>0&&(y.schema=await o.inferSchema(k),await o.writeConfig(n,y));let D=await Xk(k,y.schema,o,h,g);if(!D)return;let M=o.resolveRollupsForRows(o.resolveLookupsForRows($v(D,y.schema),y.schema),y.schema);if(h.current===g){if(!b.current){b.current=!0;let V=i.activePills??[];v(Qk(V,y.schema))}p({schema:y.schema,views:y.views}),s(M),a?.(y,M),m(!1)}},[n,o,r,t,i,a]);return(0,zn.useEffect)(()=>{b.current=!1},[n]),(0,zn.useEffect)(()=>{_()},[_]),(0,zn.useEffect)(()=>{let g=null,y=()=>{g&&clearTimeout(g),g=setTimeout(()=>{_()},Yk)};return t.vault.on("create",y),t.vault.on("delete",y),t.vault.on("rename",y),t.metadataCache.on("changed",y),()=>{g&&clearTimeout(g),t.vault.off("create",y),t.vault.off("delete",y),t.vault.off("rename",y),t.metadataCache.off("changed",y)}},[t,_]),{rows:l,config:d,loading:f,activeFilters:c,setActiveFilters:v,reload:_}}var Wu=Re(xt(),1);function Bn(e,t){let[n,o]=(0,Wu.useState)(e);return(0,Wu.useEffect)(()=>{let r=setTimeout(()=>o(e),t);return()=>clearTimeout(r)},[e,t]),n}var ve=Re(xt(),1),Pr=Re(uo(),1);var F=Re(St(),1),Wv={title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",url:"\u2197",email:"\u2709",phone:"\u{1F4DE}",status:"\u25CE",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197",rollup:"\u03A3",image:"\u{1F5BC}",audio:"\u{1F3B5}",video:"\u{1F3AC}"},rS=()=>({title:u("type_title"),text:u("type_text"),number:u("type_number"),select:u("type_select"),multiselect:u("type_multiselect"),date:u("type_date"),checkbox:u("type_checkbox"),url:u("type_url"),email:u("type_email"),phone:u("type_phone"),status:u("type_status"),formula:u("type_formula"),relation:u("type_relation"),lookup:u("type_lookup"),rollup:u("type_rollup"),image:u("type_image"),audio:u("type_audio"),video:u("type_video")});function Gv({col:e,schema:t,onUpdateSchema:n,onRenameColumn:o,onChangeType:r,manager:i,dbFile:a}){let l=zt(),[s,d]=(0,ve.useState)(!1),[p,f]=(0,ve.useState)(!1),[m,c]=(0,ve.useState)(e.name),[v,h]=(0,ve.useState)(!1),[b,_]=(0,ve.useState)(e.formula??""),[g,y]=(0,ve.useState)(null),[k,D]=(0,ve.useState)(null),M=(0,ve.useRef)(null),V=(0,ve.useRef)(null),j=(0,ve.useRef)(null),re=(0,ve.useRef)(null),ne=(0,ve.useRef)(null),[ce,de]=(0,ve.useState)(!1),[De,Ve]=(0,ve.useState)(null),[H,X]=(0,ve.useState)(e.refDatabasePath??""),[O,J]=(0,ve.useState)(e.refColumnId??""),[ue,Se]=(0,ve.useState)(e.refMatchColumnId??""),[$e,Ie]=(0,ve.useState)(!!e.pairedColumnId),[ot,Ge]=(0,ve.useState)(!!e.isHierarchical),[ye,Ee]=(0,ve.useState)([]),[Le,Be]=(0,ve.useState)([]),Ae=(0,ve.useRef)(null),Ne=(0,ve.useRef)(null),[it,Je]=(0,ve.useState)(!1),[R,G]=(0,ve.useState)(null),[me,ae]=(0,ve.useState)(e.rollupRelationColumnId??""),[je,qe]=(0,ve.useState)(e.rollupTargetColumnId??""),[_e,Oe]=(0,ve.useState)(e.rollupFunction??"count"),[vt,Ft]=(0,ve.useState)([]),P=(0,ve.useRef)(null),we=(0,ve.useRef)(null),[A,ee]=(0,ve.useState)(!1),[Me,Fe]=(0,ve.useState)(null),[bt,cn]=(0,ve.useState)(e.numberFormat?.decimals??2),[mt,dn]=(0,ve.useState)(e.numberFormat?.thousandsSeparator??!1),[Jt,en]=(0,ve.useState)(e.numberFormat?.prefix??""),[x,N]=(0,ve.useState)(e.numberFormat?.suffix??""),Y=(0,ve.useRef)(null),se=(0,ve.useRef)(null),[oe,te]=(0,ve.useState)(!1),[S,Q]=(0,ve.useState)(null),[he,be]=(0,ve.useState)(e.imageSourceFolder??""),xe=(0,ve.useRef)(null),Xe=(0,ve.useRef)(null),[Ue,U]=(0,ve.useState)(!1),[ze,Te]=(0,ve.useState)(null),[ft,st]=(0,ve.useState)(e.audioSourceFolder??""),yt=(0,ve.useRef)(null),Ot=(0,ve.useRef)(null),[Vt,Dt]=(0,ve.useState)(!1),[an,Wn]=(0,ve.useState)(null),[ka,Si]=(0,ve.useState)(e.videoSourceFolder??""),Sa=(0,ve.useRef)(null),er=(0,ve.useRef)(null);(0,ve.useEffect)(()=>{if(!s)return;let E=ke=>{let Ce=ke.target,gt=M.current?.contains(Ce),wt=ne.current?.contains(Ce)||Ae.current?.contains(Ce)||P.current?.contains(Ce)||Y.current?.contains(Ce)||xe.current?.contains(Ce)||yt.current?.contains(Ce)||Sa.current?.contains(Ce);!gt&&!wt&&(d(!1),h(!1),de(!1),ee(!1))};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[s]),(0,ve.useEffect)(()=>{p||c(e.name)},[e.name,p]),(0,ve.useEffect)(()=>{v||_(e.formula??"")},[e.formula,v]),(0,ve.useEffect)(()=>{if(!p)return;let E=V.current;E&&(E.focus(),E.select())},[p]),(0,ve.useEffect)(()=>{if(v){if(M.current){let E=M.current.getBoundingClientRect(),ke=320,Ce=420,gt=E.left,wt=E.bottom+4;gt+ke>window.innerWidth&&(gt=window.innerWidth-ke-8),wt+Ce>window.innerHeight&&(wt=E.top-Ce-4),D({x:gt,y:wt})}setTimeout(()=>j.current?.focus(),50)}},[v]),(0,ve.useEffect)(()=>{if(!v)return;let E=Ce=>{re.current&&D({x:Ce.clientX-re.current.x,y:Ce.clientY-re.current.y})},ke=()=>{re.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[v]),(0,ve.useEffect)(()=>{y(Ov(b))},[b]),(0,ve.useEffect)(()=>{if(!ce)return;let E=i.getAllDatabases().map(ke=>({path:ke.path,name:ke.parent?.name||u("picker_root")}));if(Ee(E),M.current){let ke=M.current.getBoundingClientRect(),Ce=320,gt=380,wt=ke.left,ir=ke.bottom+4;wt+Ce>window.innerWidth&&(wt=window.innerWidth-Ce-8),ir+gt>window.innerHeight&&(ir=ke.top-gt-4),Ve({x:wt,y:ir})}},[ce,i,a]),(0,ve.useEffect)(()=>{if(!H){Be([]);return}let E=l.vault.getFileByPath(H);if(!E){Be([]);return}Be(i.readConfig(E).schema)},[H,l,i]),(0,ve.useEffect)(()=>{ce||(X(e.refDatabasePath??""),J(e.refColumnId??""),Se(e.refMatchColumnId??""))},[e.refDatabasePath,e.refColumnId,e.refMatchColumnId,ce]),(0,ve.useEffect)(()=>{if(!ce)return;let E=Ce=>{Ne.current&&Ve({x:Ce.clientX-Ne.current.x,y:Ce.clientY-Ne.current.y})},ke=()=>{Ne.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[ce]),(0,ve.useEffect)(()=>{if(!it||!me){Ft([]);return}let E=t.find(gt=>gt.id===me);if(!E?.refDatabasePath){Ft([]);return}let ke=l.vault.getFileByPath(E.refDatabasePath);if(!ke){Ft([]);return}let Ce=i.readConfig(ke);Ft(Ce.schema)},[it,me,t,l,i]),(0,ve.useEffect)(()=>{it||(ae(e.rollupRelationColumnId??""),qe(e.rollupTargetColumnId??""),Oe(e.rollupFunction??"count"))},[e.rollupRelationColumnId,e.rollupTargetColumnId,e.rollupFunction,it]),(0,ve.useEffect)(()=>{if(!it)return;if(M.current){let Ce=M.current.getBoundingClientRect(),gt=Ce.left,wt=Ce.bottom+4;gt+340>window.innerWidth&&(gt=window.innerWidth-348),wt+300>window.innerHeight&&(wt=Ce.top-304),G({x:gt,y:wt})}let E=Ce=>{we.current&&G({x:Ce.clientX-we.current.x,y:Ce.clientY-we.current.y})},ke=()=>{we.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[it]),(0,ve.useEffect)(()=>{if(A&&M.current){let E=M.current.getBoundingClientRect(),ke=300,Ce=300,gt=E.left,wt=E.bottom+4;gt+ke>window.innerWidth&&(gt=window.innerWidth-ke-8),wt+Ce>window.innerHeight&&(wt=E.top-Ce-4),Fe({x:gt,y:wt})}},[A]),(0,ve.useEffect)(()=>{A||(cn(e.numberFormat?.decimals??2),dn(e.numberFormat?.thousandsSeparator??!1),en(e.numberFormat?.prefix??""),N(e.numberFormat?.suffix??""))},[e.numberFormat,A]),(0,ve.useEffect)(()=>{oe||be(e.imageSourceFolder??"")},[e.imageSourceFolder,oe]),(0,ve.useEffect)(()=>{if(oe&&M.current){let E=M.current.getBoundingClientRect(),ke=280,Ce=160,gt=E.left,wt=E.bottom+4;gt+ke>window.innerWidth&&(gt=window.innerWidth-ke-8),wt+Ce>window.innerHeight&&(wt=E.top-Ce-4),Q({x:gt,y:wt})}},[oe]),(0,ve.useEffect)(()=>{if(!oe)return;let E=Ce=>{Xe.current&&Q({x:Ce.clientX-Xe.current.x,y:Ce.clientY-Xe.current.y})},ke=()=>{Xe.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[oe]),(0,ve.useEffect)(()=>{Ue||st(e.audioSourceFolder??"")},[e.audioSourceFolder,Ue]),(0,ve.useEffect)(()=>{if(Ue&&M.current){let E=M.current.getBoundingClientRect(),ke=280,Ce=160,gt=E.left,wt=E.bottom+4;gt+ke>window.innerWidth&&(gt=window.innerWidth-ke-8),wt+Ce>window.innerHeight&&(wt=E.top-Ce-4),Te({x:gt,y:wt})}},[Ue]),(0,ve.useEffect)(()=>{if(!Ue)return;let E=Ce=>{Ot.current&&Te({x:Ce.clientX-Ot.current.x,y:Ce.clientY-Ot.current.y})},ke=()=>{Ot.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[Ue]),(0,ve.useEffect)(()=>{Vt||Si(e.videoSourceFolder??"")},[e.videoSourceFolder,Vt]),(0,ve.useEffect)(()=>{if(Vt&&M.current){let E=M.current.getBoundingClientRect(),ke=280,Ce=160,gt=E.left,wt=E.bottom+4;gt+ke>window.innerWidth&&(gt=window.innerWidth-ke-8),wt+Ce>window.innerHeight&&(wt=E.top-Ce-4),Wn({x:gt,y:wt})}},[Vt]),(0,ve.useEffect)(()=>{if(!Vt)return;let E=Ce=>{er.current&&Wn({x:Ce.clientX-er.current.x,y:Ce.clientY-er.current.y})},ke=()=>{er.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[Vt]),(0,ve.useEffect)(()=>{if(!A)return;let E=Ce=>{se.current&&Fe({x:Ce.clientX-se.current.x,y:Ce.clientY-se.current.y})},ke=()=>{se.current=null};return document.addEventListener("mousemove",E),document.addEventListener("mouseup",ke),()=>{document.removeEventListener("mousemove",E),document.removeEventListener("mouseup",ke)}},[A]);let ho=async()=>{await Gn({imageSourceFolder:he.trim()||void 0}),te(!1),d(!1)},Mn=()=>{te(!1),d(!1)},tr=E=>{S&&(Xe.current={x:E.clientX-S.x,y:E.clientY-S.y},E.preventDefault())},Ni=async()=>{await Gn({audioSourceFolder:ft.trim()||void 0}),U(!1),d(!1)},nr=()=>{U(!1),d(!1)},Vl=E=>{ze&&(Ot.current={x:E.clientX-ze.x,y:E.clientY-ze.y},E.preventDefault())},xi=async()=>{await Gn({videoSourceFolder:ka.trim()||void 0}),Dt(!1),d(!1)},Na=()=>{Dt(!1),d(!1)},Bl=E=>{an&&(er.current={x:E.clientX-an.x,y:E.clientY-an.y},E.preventDefault())},Gn=async E=>{let ke=t.map(Ce=>Ce.id===e.id?{...Ce,...E}:Ce);await n(ke)},jl=async()=>{let E=m.trim();E&&E!==e.name&&await o(e.id,E),f(!1),d(!1)},uc=async()=>{await Gn({visible:!1}),d(!1)},Bt=async()=>{let E=t.filter(ke=>ke.id!==e.id);await n(E),d(!1)},cc=async E=>{await r(E)&&(await Gn({type:E}),E==="formula"?h(!0):E==="lookup"||E==="relation"?de(!0):E==="rollup"?Je(!0):E==="image"?te(!0):d(!1))},Hl=async()=>{g||(await Gn({formula:b.trim()||void 0}),h(!1),d(!1))},xa=()=>{h(!1),d(!1)},dc=E=>{k&&(re.current={x:E.clientX-k.x,y:E.clientY-k.y},E.preventDefault())},pc=async()=>{let E=e.pairedColumnId;if(e.type==="relation"&&$e&&H&&!e.pairedColumnId){let ke=l.vault.getFileByPath(H);if(ke){let Ce=i.readConfig(ke),gt=`rel_${e.id}_${Date.now()}`,wt=a?.parent?.name||l.vault.getName(),ir={id:gt,name:wt,type:"relation",visible:!0,refDatabasePath:a?.path.replace(/\/[^/]+$/,"/_database.md")??"",refColumnId:"_title",pairedColumnId:e.id};Ce.schema.push(ir),await i.writeConfig(ke,Ce),E=gt}}else if(e.type==="relation"&&!$e&&e.pairedColumnId){let ke=l.vault.getFileByPath(H||e.refDatabasePath||"");if(ke){let Ce=i.readConfig(ke);Ce.schema=Ce.schema.filter(gt=>gt.id!==e.pairedColumnId),await i.writeConfig(ke,Ce)}E=void 0}await Gn({refDatabasePath:H,refColumnId:e.type==="relation"?"_title":O,...e.type==="lookup"?{refMatchColumnId:ue}:{},...e.type==="relation"?{pairedColumnId:E,isHierarchical:ot||void 0}:{}}),de(!1),d(!1)},Ul=()=>{de(!1),d(!1)},Wl=E=>{De&&(Ne.current={x:E.clientX-De.x,y:E.clientY-De.y},E.preventDefault())},mc=async()=>{await Gn({rollupRelationColumnId:me,rollupTargetColumnId:je,rollupFunction:_e}),Je(!1),d(!1)},or=E=>{R&&(we.current={x:E.clientX-R.x,y:E.clientY-R.y},E.preventDefault())},Gl=[{value:"count",label:u("rollup_fn_count")},{value:"sum",label:u("rollup_fn_sum")},{value:"avg",label:u("rollup_fn_avg")},{value:"min",label:u("rollup_fn_min")},{value:"max",label:u("rollup_fn_max")},{value:"count_values",label:u("rollup_fn_count_values")},{value:"list",label:u("rollup_fn_list")}],Ra=t.filter(E=>E.type==="relation"),ql=async()=>{let E={decimals:bt,thousandsSeparator:mt,...Jt.trim()?{prefix:Jt.trim()}:{},...x.trim()?{suffix:x.trim()}:{}};await Gn({numberFormat:E}),ee(!1),d(!1)},Ea=()=>{ee(!1),d(!1)},Kl=async()=>{await Gn({numberFormat:void 0}),ee(!1),d(!1)},Hr=E=>{Me&&(se.current={x:E.clientX-Me.x,y:E.clientY-Me.y},E.preventDefault())},[rr,fc]=(0,ve.useState)(!1),Ur=t.filter(E=>E.id!==e.id&&E.type!=="formula"),Fa=[{group:u("formula_group_logic"),items:[{fn:"IF(cond, a, b)",desc:"Se cond for verdadeiro retorna a, sen\xE3o b"},{fn:"IFS(c1, v1, c2, v2\u2026)",desc:"Testa condi\xE7\xF5es em sequ\xEAncia"},{fn:"AND(a, b, \u2026)",desc:"Verdadeiro se todos forem verdadeiros"},{fn:"OR(a, b, \u2026)",desc:"Verdadeiro se algum for verdadeiro"},{fn:"NOT(a)",desc:"Inverte o valor l\xF3gico"}]},{group:u("formula_group_comparators"),items:[{fn:"= <> != > < >= <=",desc:"Compara dois valores; use com IF"}]},{group:u("formula_group_aggregators"),items:[{fn:"SUM(col)",desc:"Soma todos os valores da coluna"},{fn:"AVG(col)",desc:"M\xE9dia dos valores da coluna"},{fn:"COUNT(col)",desc:"Conta valores n\xE3o vazios da coluna"},{fn:"MIN(col)",desc:"Menor valor da coluna"},{fn:"MAX(col)",desc:"Maior valor da coluna"}]},{group:u("formula_group_text"),items:[{fn:"CONCAT(a, b, \u2026)",desc:"Concatena textos (ou use &)"},{fn:"LEN(texto)",desc:"N\xFAmero de caracteres"},{fn:"UPPER / LOWER(texto)",desc:"Mai\xFAsculas / min\xFAsculas"},{fn:"TRIM(texto)",desc:"Remove espa\xE7os nas bordas"},{fn:"LEFT(texto, n)",desc:"Primeiros n caracteres"},{fn:"RIGHT(texto, n)",desc:"\xDAltimos n caracteres"},{fn:"MID(texto, in\xEDcio, n)",desc:"Substring a partir de in\xEDcio"},{fn:"SUBSTITUTE(t, de, para)",desc:"Substitui ocorr\xEAncias"}]},{group:u("formula_group_math"),items:[{fn:"ROUND(n, d)",desc:"Arredonda n com d casas decimais"},{fn:"FLOOR / CEIL(n)",desc:"Arredonda para baixo / cima"},{fn:"ABS(n)",desc:"Valor absoluto"},{fn:"MOD(n, d)",desc:"Resto da divis\xE3o"},{fn:"POWER(b, e)",desc:"Base elevado ao expoente"},{fn:"SQRT(n)",desc:"Raiz quadrada"}]},{group:u("formula_group_utils"),items:[{fn:"ISNULL(v)",desc:"Verdadeiro se v for vazio ou nulo"},{fn:"COALESCE(a, b, \u2026)",desc:"Primeiro valor n\xE3o vazio"},{fn:"TEXT(v)",desc:"Converte para texto"},{fn:"VALUE(v)",desc:"Converte para n\xFAmero"}]}],gc=(()=>{let E=1234.5678,ke={minimumFractionDigits:bt,maximumFractionDigits:bt,useGrouping:mt},Ce=new Intl.NumberFormat("pt-BR",ke).format(E);return Jt.trim()&&(Ce=`${Jt.trim()} ${Ce}`),x.trim()&&(Ce=`${Ce} ${x.trim()}`),Ce})(),_c=v&&k?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:ne,className:"nb-formula-floating-panel",style:{top:k.y,left:k.x},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:dc,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u0192"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("formula_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:xa,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",children:[(0,F.jsx)("textarea",{ref:j,className:`nb-formula-textarea${g?" nb-formula-textarea--error":b.trim()?" nb-formula-textarea--ok":""}`,value:b,onChange:E=>_(E.target.value),placeholder:u("formula_placeholder"),rows:3,spellCheck:!1,onKeyDown:E=>{E.key==="Enter"&&(E.ctrlKey||E.metaKey)&&(E.preventDefault(),Hl()),E.key==="Escape"&&xa()}}),g&&(0,F.jsxs)("div",{className:"nb-formula-feedback nb-formula-feedback--error",children:[(0,F.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:[(0,F.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,F.jsx)("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),(0,F.jsx)("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]}),g]}),!g&&b.trim()&&(0,F.jsxs)("div",{className:"nb-formula-feedback nb-formula-feedback--ok",children:[(0,F.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,F.jsx)("polyline",{points:"20 6 9 17 4 12"})}),u("formula_valid")]}),Ur.length>0&&(0,F.jsxs)("div",{className:"nb-formula-cols-hint",children:[(0,F.jsx)("span",{className:"nb-formula-cols-label",children:u("formula_available_cols")}),(0,F.jsx)("div",{className:"nb-formula-cols-list",children:Ur.map(E=>(0,F.jsx)("code",{className:"nb-formula-col-chip",title:`ID: ${E.id}`,onClick:()=>{let ke=/\s/.test(E.name)?`[${E.name}]`:E.name;_(Ce=>Ce+ke),j.current?.focus()},children:E.name},E.id))})]}),(0,F.jsxs)("div",{className:"nb-formula-ref",children:[(0,F.jsxs)("button",{className:"nb-formula-ref-toggle",onClick:()=>fc(E=>!E),children:[(0,F.jsx)("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{transform:rr?"rotate(90deg)":"none",transition:"transform 150ms"},children:(0,F.jsx)("polyline",{points:"9 18 15 12 9 6"})}),u("formula_ref_toggle")]}),rr&&(0,F.jsx)("div",{className:"nb-formula-ref-body",children:Fa.map(E=>(0,F.jsxs)("div",{className:"nb-formula-ref-group",children:[(0,F.jsx)("div",{className:"nb-formula-ref-group-title",children:E.group}),(0,F.jsx)("table",{className:"nb-formula-ref-table",children:(0,F.jsx)("tbody",{children:E.items.map(ke=>(0,F.jsxs)("tr",{children:[(0,F.jsx)("td",{className:"nb-formula-ref-fn",children:(0,F.jsx)("code",{children:ke.fn})}),(0,F.jsx)("td",{className:"nb-formula-ref-desc",children:ke.desc})]},ke.fn))})})]},E.group))})]}),(0,F.jsxs)("div",{className:"nb-formula-actions",children:[(0,F.jsx)("button",{className:"nb-formula-save",disabled:!!g,onClick:()=>{Hl()},title:u("formula_save_hint"),children:u("formula_save")}),(0,F.jsx)("button",{className:"nb-formula-cancel",onClick:xa,children:u("formula_cancel")})]})]})]}),document.body):null,Yl=A&&Me?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:Y,className:"nb-formula-floating-panel",style:{top:Me.y,left:Me.x},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Hr,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"#"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("number_format_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:Ea,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",children:[(0,F.jsx)("div",{className:"nb-numfmt-preview",children:gc}),(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("number_decimals_label")}),(0,F.jsx)("select",{className:"nb-lookup-select",value:bt,onChange:E=>cn(Number(E.target.value)),children:[0,1,2,3,4,5,6].map(E=>(0,F.jsx)("option",{value:E,children:E},E))})]}),(0,F.jsxs)("div",{className:"nb-numfmt-checkbox-row",children:[(0,F.jsx)("input",{type:"checkbox",id:"nb-fmt-thousands",checked:mt,onChange:E=>dn(E.target.checked),className:"nb-cell-checkbox"}),(0,F.jsx)("label",{htmlFor:"nb-fmt-thousands",className:"nb-lookup-label",style:{cursor:"pointer"},children:u("number_thousands_label")})]}),(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("number_prefix_label")}),(0,F.jsx)("input",{type:"text",className:"nb-numfmt-text-input",value:Jt,onChange:E=>en(E.target.value),placeholder:u("number_prefix_placeholder")})]}),(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("number_suffix_label")}),(0,F.jsx)("input",{type:"text",className:"nb-numfmt-text-input",value:x,onChange:E=>N(E.target.value),placeholder:u("number_suffix_placeholder")})]}),(0,F.jsxs)("div",{className:"nb-formula-actions",children:[(0,F.jsx)("button",{className:"nb-formula-save",onClick:()=>{ql()},children:u("formula_save")}),(0,F.jsx)("button",{className:"nb-formula-cancel",onClick:Ea,children:u("formula_cancel")})]}),e.numberFormat&&(0,F.jsx)("div",{style:{marginTop:"8px",textAlign:"center"},children:(0,F.jsx)("button",{className:"nb-formula-cancel",onClick:()=>{Kl()},style:{color:"var(--text-error)",width:"100%"},children:u("number_remove_format")})})]})]}),document.body):null,hc=it&&R?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:P,className:"nb-formula-floating-panel",style:{top:R.y,left:R.x},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:or,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u03A3"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("rollup_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:()=>{Je(!1),d(!1)},title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsx)("div",{className:"nb-formula-body",style:{padding:"12px"},children:Ra.length===0?(0,F.jsx)("div",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:u("rollup_no_relations")}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_relation")}),(0,F.jsxs)("select",{className:"nb-lookup-select",value:me,onChange:E=>{ae(E.target.value),qe("")},children:[(0,F.jsx)("option",{value:"",children:u("rollup_select_relation_placeholder")}),Ra.map(E=>(0,F.jsx)("option",{value:E.id,children:E.name},E.id))]})]}),me&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_target")}),(0,F.jsxs)("select",{className:"nb-lookup-select",value:je,onChange:E=>qe(E.target.value),children:[(0,F.jsx)("option",{value:"",children:u("rollup_select_target_placeholder")}),(0,F.jsx)("option",{value:"_title",children:u("lookup_file_name")}),vt.map(E=>(0,F.jsx)("option",{value:E.id,children:E.name},E.id))]})]}),je&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("rollup_select_function")}),(0,F.jsx)("select",{className:"nb-lookup-select",value:_e,onChange:E=>Oe(E.target.value),children:Gl.map(E=>(0,F.jsx)("option",{value:E.value,children:E.label},E.value))})]}),(0,F.jsx)("button",{className:"nb-formula-save",disabled:!me||!je,onClick:()=>{mc()},children:u("formula_save")})]})})]}),document.body):null,vc=ce&&De?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:Ae,className:"nb-formula-floating-panel",style:{top:De.y,left:De.x},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Wl,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:e.type==="relation"?"\u{1F517}":"\u2197"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[e.type==="relation"?u("relation_panel_title"):u("lookup_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:Ul,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",children:[(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("lookup_ref_table")}),(0,F.jsxs)("select",{className:"nb-lookup-select",value:H,onChange:E=>{X(E.target.value),J("")},children:[(0,F.jsx)("option",{value:"",children:u("lookup_select_table")}),ye.map(E=>(0,F.jsx)("option",{value:E.path,children:E.name},E.path))]})]}),e.type!=="relation"&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("lookup_col_to_display")}),(0,F.jsxs)("select",{className:"nb-lookup-select",value:O,onChange:E=>J(E.target.value),disabled:!H,children:[(0,F.jsx)("option",{value:"",children:u("lookup_select_col")}),(0,F.jsx)("option",{value:"_title",children:"\u{1F4C4} "+u("lookup_file_name")}),Le.map(E=>(0,F.jsx)("option",{value:E.id,children:E.name},E.id))]})]}),e.type==="lookup"&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsx)("label",{className:"nb-lookup-label",children:u("lookup_join_col")}),(0,F.jsxs)("select",{className:"nb-lookup-select",value:ue,onChange:E=>Se(E.target.value),children:[(0,F.jsx)("option",{value:"",children:u("lookup_select_col")}),(0,F.jsx)("option",{value:"_title",children:"\u{1F4C4} "+u("lookup_join_col_title")}),t.filter(E=>E.id!==e.id&&E.type!=="formula"&&E.type!=="lookup").map(E=>(0,F.jsx)("option",{value:E.id,children:E.name},E.id))]}),(0,F.jsx)("p",{className:"nb-lookup-hint",children:u("lookup_hint")})]}),e.type==="relation"&&H&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsxs)("label",{className:"nb-lookup-checkbox",children:[(0,F.jsx)("input",{type:"checkbox",checked:$e,onChange:E=>Ie(E.target.checked)}),u("relation_two_way")]}),(0,F.jsx)("p",{className:"nb-lookup-hint",children:u("relation_two_way_hint")})]}),e.type==="relation"&&H&&H===a?.path&&(0,F.jsxs)("div",{className:"nb-lookup-section",children:[(0,F.jsxs)("label",{className:"nb-lookup-checkbox",children:[(0,F.jsx)("input",{type:"checkbox",checked:ot,onChange:E=>{E.target.checked&&t.some(ke=>ke.id!==e.id&&ke.isHierarchical)||Ge(E.target.checked)}}),u("hierarchy_toggle")]}),(0,F.jsx)("p",{className:"nb-lookup-hint",children:u("hierarchy_toggle_hint")})]}),(0,F.jsxs)("div",{className:"nb-formula-actions",children:[(0,F.jsx)("button",{className:"nb-formula-save",disabled:!H||e.type==="lookup"&&(!O||!ue),onClick:()=>{pc()},children:u("formula_save")}),(0,F.jsx)("button",{className:"nb-formula-cancel",onClick:Ul,children:u("formula_cancel")})]})]})]}),document.body):null,bc=oe&&S?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:xe,className:"nb-formula-floating-panel",style:{top:S.y,left:S.x,minWidth:280},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:tr,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F5BC}"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("image_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:Mn,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,F.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("image_folder_label")}),(0,F.jsx)("input",{type:"text",className:"nb-header-rename-input",value:he,onChange:E=>be(E.target.value),placeholder:u("image_folder_placeholder")}),(0,F.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,F.jsx)("button",{className:"nb-menu-item",onClick:Mn,style:{flex:1},children:u("formula_cancel")}),(0,F.jsx)("button",{className:"nb-menu-item",onClick:()=>{ho()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null,Wr=Ue&&ze?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:yt,className:"nb-formula-floating-panel",style:{top:ze.y,left:ze.x,minWidth:280},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Vl,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F3B5}"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("audio_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:nr,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,F.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("audio_folder_label")}),(0,F.jsx)("input",{type:"text",className:"nb-header-rename-input",value:ft,onChange:E=>st(E.target.value),placeholder:u("audio_folder_placeholder")}),(0,F.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,F.jsx)("button",{className:"nb-menu-item",onClick:nr,style:{flex:1},children:u("formula_cancel")}),(0,F.jsx)("button",{className:"nb-menu-item",onClick:()=>{Ni()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null,Xl=Vt&&an?(0,Pr.createPortal)((0,F.jsxs)("div",{ref:Sa,className:"nb-formula-floating-panel",style:{top:an.y,left:an.x,minWidth:280},children:[(0,F.jsxs)("div",{className:"nb-formula-titlebar",onMouseDown:Bl,children:[(0,F.jsx)("span",{className:"nb-formula-titlebar-icon",children:"\u{1F3AC}"}),(0,F.jsxs)("span",{className:"nb-formula-titlebar-title",children:[u("video_panel_title"),": ",e.name]}),(0,F.jsx)("button",{className:"nb-formula-close",onClick:Na,title:u("tooltip_close"),children:"\xD7"})]}),(0,F.jsxs)("div",{className:"nb-formula-body",style:{padding:12,display:"flex",flexDirection:"column",gap:10},children:[(0,F.jsx)("label",{style:{fontSize:"var(--font-ui-small)",color:"var(--text-muted)"},children:u("video_folder_label")}),(0,F.jsx)("input",{type:"text",className:"nb-header-rename-input",value:ka,onChange:E=>Si(E.target.value),placeholder:u("video_folder_placeholder")}),(0,F.jsxs)("div",{style:{display:"flex",gap:8,justifyContent:"flex-end"},children:[(0,F.jsx)("button",{className:"nb-menu-item",onClick:Na,style:{flex:1},children:u("formula_cancel")}),(0,F.jsx)("button",{className:"nb-menu-item",onClick:()=>{xi()},style:{flex:1,color:"var(--interactive-accent)"},children:u("formula_save")})]})]})]}),document.body):null;return(0,F.jsxs)("div",{className:"nb-column-header",ref:M,children:[p?(0,F.jsx)("input",{ref:V,className:"nb-header-rename-input",value:m,onChange:E=>c(E.target.value),onBlur:()=>{jl()},onKeyDown:E=>{E.key==="Enter"&&jl(),E.key==="Escape"&&(f(!1),d(!1))},onClick:E=>E.stopPropagation()}):(0,F.jsxs)("button",{className:"nb-header-label",onClick:()=>{d(E=>!E),h(!1),de(!1),ee(!1),te(!1)},title:e.name,children:[(0,F.jsx)("span",{className:"nb-header-icon",children:Wv[e.type]}),(0,F.jsx)("span",{className:"nb-header-name",children:e.name})]}),s&&!v&&!ce&&!it&&!A&&!oe&&(0,F.jsxs)("div",{className:"nb-column-menu",children:[(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>{d(!1),f(!0)},children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u270F\uFE0F"}),(0,F.jsx)("span",{children:u("rename_column")})]}),e.type==="formula"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>h(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u0192"}),(0,F.jsx)("span",{children:u("edit_formula")})]}),e.type==="lookup"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>de(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u2197"}),(0,F.jsx)("span",{children:u("configure_lookup")})]}),e.type==="relation"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>de(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F517}"}),(0,F.jsx)("span",{children:u("configure_relation")})]}),e.type==="rollup"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>Je(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u03A3"}),(0,F.jsx)("span",{children:u("configure_rollup")})]}),e.type==="number"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>ee(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"#"}),(0,F.jsx)("span",{children:u("format_number")})]}),e.type==="image"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>te(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5BC}"}),(0,F.jsx)("span",{children:u("configure_image_folder")})]}),e.type==="audio"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>U(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F3B5}"}),(0,F.jsx)("span",{children:u("configure_audio_folder")})]}),e.type==="video"&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>Dt(!0),children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F3AC}"}),(0,F.jsx)("span",{children:u("configure_video_folder")})]}),(0,F.jsx)("div",{className:"nb-menu-separator"}),(0,F.jsx)("div",{className:"nb-menu-label",children:u("field_type_label")}),["text","number","select","multiselect","date","checkbox","url","email","phone","status","formula","relation","lookup","rollup","image","audio","video"].map(E=>(0,F.jsxs)("button",{className:`nb-menu-item nb-menu-type-item ${e.type===E?"nb-menu-item--active":""}`,onClick:()=>{cc(E)},children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:Wv[E]}),(0,F.jsx)("span",{children:rS()[E]})]},E)),(e.type==="text"||e.type==="title"||e.type==="url"||e.type==="email"||e.type==="phone")&&(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Gn({wrap:!e.wrap}),d(!1)},children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u21B5"}),(0,F.jsx)("span",{children:e.wrap?u("disable_wrap_text"):u("enable_wrap_text")})]}),(0,F.jsx)("div",{className:"nb-menu-separator"}),(0,F.jsxs)("button",{className:"nb-menu-item",onClick:()=>{uc()},children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F441}"}),(0,F.jsx)("span",{children:u("hide_field")})]}),(0,F.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{Bt()},children:[(0,F.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,F.jsx)("span",{children:u("delete_field")})]})]}),_c,vc,hc,Yl,bc,Wr,Xl]})}var fe=Re(xt(),1),fo=Re(uo(),1);var qu=Re(xt(),1),I=Re(St(),1),xm=(0,qu.createContext)(null);function Ku(){let e=(0,qu.useContext)(xm);if(!e)throw new Error("CellContext n\xE3o encontrado");return e}function iS(e,t){if(!t)return String(e);let n={minimumFractionDigits:t.decimals,maximumFractionDigits:t.decimals,useGrouping:t.thousandsSeparator},o=new Intl.NumberFormat("pt-BR",n).format(e);return t.prefix&&(o=`${t.prefix} ${o}`),t.suffix&&(o=`${o} ${t.suffix}`),o}var aS=[{value:u("status_not_started"),color:"#9E9E9E"},{value:u("status_in_progress"),color:"#2196F3"},{value:u("status_done"),color:"#4CAF50"},{value:u("status_cancelled"),color:"#F44336"}];function Nm(e){let t=e.replace(/\D/g,"").slice(0,11);return t.length<=2?`(${t}`:t.length<=6?`(${t.slice(0,2)}) ${t.slice(2)}`:t.length<=10?`(${t.slice(0,2)}) ${t.slice(2,6)}-${t.slice(6)}`:`(${t.slice(0,2)}) ${t.slice(2,7)}-${t.slice(7)}`}function qv({value:e,href:t,isEditing:n,inputType:o,onStartEdit:r,onCommit:i,onCancel:a,validate:l}){let[s,d]=(0,fe.useState)(null),p=m=>{m.stopPropagation(),t&&window.open(t,"_blank")},f=m=>{if(m&&l){let c=l(m);if(c){d(c);return}}d(null),i(m)};return n?(0,I.jsxs)("div",{className:"nb-link-edit-wrapper",children:[(0,I.jsx)("input",{className:`nb-cell-input${s?" nb-cell-input--error":""}`,autoFocus:!0,type:o,defaultValue:e??"",onBlur:m=>f(m.target.value||null),onKeyDown:m=>{m.key==="Enter"&&f(m.target.value||null),m.key==="Escape"&&(d(null),a())}}),s&&(0,I.jsx)("span",{className:"nb-cell-error-msg",children:s})]}):(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:r,children:e?(0,I.jsxs)("span",{className:"nb-cell-link-wrapper",children:[(0,I.jsx)("span",{className:"nb-cell-link",onClick:p,children:e}),(0,I.jsx)("span",{className:"nb-cell-link-icon",onClick:p,children:"\u2197"})]}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}var Rm=fe.default.memo(function({col:t,value:n,rowIndex:o,columnId:r,file:i}){let{editingCell:a,setEditingCell:l,updateCell:s,relationOptions:d}=Ku(),p=zt(),f=a?.rowIndex===o&&a?.columnId===r,m=()=>{t.type==="formula"||t.type==="lookup"||t.type==="rollup"||t.type==="checkbox"||l({rowIndex:o,columnId:r})};switch(t.type){case"title":return(0,I.jsx)(Kv,{value:String(n??""),isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c)},onCancel:()=>l(null),onOpen:i?()=>{p.workspace.getLeaf(!1).openFile(i)}:void 0});case"text":return(0,I.jsx)(Kv,{value:String(n??""),isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c)},onCancel:()=>l(null)});case"number":return(0,I.jsx)(lS,{value:n,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c)},onCancel:()=>l(null),format:t.numberFormat});case"select":return(0,I.jsx)(uS,{value:n,col:t,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"multiselect":return(0,I.jsx)(dS,{value:Array.isArray(n)?n:[],col:t,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"date":return(0,I.jsx)(mS,{value:n,isEditing:f,onStartEdit:m,onSave:c=>{s(o,r,c)},onClose:()=>l(null)});case"checkbox":return(0,I.jsx)(fS,{value:!!n,onCommit:c=>{s(o,r,c)}});case"relation":{let c=n,v=Array.isArray(c)?c.filter(h=>typeof h=="string"):typeof c=="string"&&c?[c]:[];return(0,I.jsx)(vS,{value:v,options:d.get(r)??[],isEditing:f,onStartEdit:m,onCommit:h=>{s(o,r,h.length>0?h:null),l(null)},onCancel:()=>l(null)})}case"url":return(0,I.jsx)(qv,{value:n,href:n?String(n):null,inputType:"url",isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"email":return(0,I.jsx)(qv,{value:n,href:n?`mailto:${n}`:null,inputType:"email",isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null),validate:c=>/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(c)?null:u("email_invalid")});case"phone":return(0,I.jsx)(sS,{value:n,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"status":return(0,I.jsx)(cS,{value:n,col:t,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"formula":return(0,I.jsx)(gS,{value:n,col:t});case"lookup":return(0,I.jsx)(_S,{value:n,col:t});case"rollup":return(0,I.jsx)(hS,{value:n,col:t});case"image":return(0,I.jsx)(bS,{col:t,value:n,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"audio":return(0,I.jsx)(yS,{col:t,value:n,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});case"video":return(0,I.jsx)(wS,{col:t,value:n,isEditing:f,onStartEdit:m,onCommit:c=>{s(o,r,c),l(null)},onCancel:()=>l(null)});default:return(0,I.jsx)("span",{className:"nb-cell-text",children:String(n??"")})}});function Kv({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r,onOpen:i}){let a=(0,fe.useRef)(null),[l,s]=(0,fe.useState)(e),d=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{t&&(s(e),requestAnimationFrame(()=>a.current?.select()))},[t,e]),(0,fe.useEffect)(()=>()=>{d.current&&clearTimeout(d.current)},[]);let p=()=>{if(i){if(d.current!==null){clearTimeout(d.current),d.current=null;return}d.current=setTimeout(()=>{d.current=null,i()},250)}},f=()=>{d.current&&(clearTimeout(d.current),d.current=null),n()};return t?(0,I.jsx)("input",{ref:a,className:"nb-cell-input",value:l,onChange:m=>s(m.target.value),onBlur:()=>{o(l),r()},onKeyDown:m=>{m.key==="Enter"&&(o(l),r()),m.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-text nb-cell-clickable nb-cell-editable",onDoubleClick:f,children:i?(0,I.jsx)("span",{className:"nb-cell-title-link",onClick:p,children:e||(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}):e||(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}function lS({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r,format:i}){let a=(0,fe.useRef)(null),[l,s]=(0,fe.useState)(e?.toString()??"");return(0,fe.useEffect)(()=>{t&&(s(e?.toString()??""),requestAnimationFrame(()=>a.current?.select()))},[t,e]),t?(0,I.jsx)("input",{ref:a,type:"number",className:"nb-cell-input nb-cell-input--number",value:l,onChange:d=>s(d.target.value),onBlur:()=>{let d=l===""?null:Number(l);o(isNaN(d)?null:d),r()},onKeyDown:d=>{if(d.key==="Enter"){let p=l===""?null:Number(l);o(isNaN(p)?null:p),r()}d.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-text nb-cell-clickable nb-cell-number",onDoubleClick:n,children:e!=null?iS(e,i):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}function sS({value:e,isEditing:t,onStartEdit:n,onCommit:o,onCancel:r}){let[i,a]=(0,fe.useState)("");(0,fe.useEffect)(()=>{t&&a(Nm(e??""))},[t,e]);let l=s=>{s.stopPropagation(),e&&window.open(`tel:${e}`,"_blank")};return t?(0,I.jsx)("input",{className:"nb-cell-input",autoFocus:!0,type:"tel",value:i,onChange:s=>a(Nm(s.target.value)),onBlur:()=>o(i||null),onKeyDown:s=>{s.key==="Enter"&&o(i||null),s.key==="Escape"&&r()}}):(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:n,children:e?(0,I.jsxs)("span",{className:"nb-cell-link-wrapper",children:[(0,I.jsx)("span",{className:"nb-cell-link",onClick:l,children:Nm(e)}),(0,I.jsx)("span",{className:"nb-cell-link-icon",onClick:l,children:"\u{1F4DE}"})]}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})})}var Ir=["#e2d9f3","#d1e8ff","#d4f1c0","#fde8c8","#ffd6d6","#d6f0f0","#f0d6f0","#f0f0d6"];function Qt(e,t){let n=e.find(r=>r.value===t);if(n?.color)return n.color;let o=e.findIndex(r=>r.value===t);return Ir[o%Ir.length]??"#e8e8e8"}function Lr(e){let t=e.replace("#",""),n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16);return(.299*n+.587*o+.114*r)/255>.5?"rgba(0,0,0,0.75)":"rgba(255,255,255,0.9)"}function uS({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:a,schema:l}=Ku(),s=(0,fe.useRef)(null),d=(0,fe.useRef)(null),p=(0,fe.useRef)(null),[f,m]=(0,fe.useState)(null),[c,v]=(0,fe.useState)(""),[h,b]=(0,fe.useState)(null),[_,g]=(0,fe.useState)(null),[y,k]=(0,fe.useState)({}),D=t.options??[],M=D.map(X=>y[X.value]?{...X,color:y[X.value]}:X),V=(0,fe.useRef)({}),j=176,re=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],ne=(X,O)=>{k(J=>({...J,[X]:O})),V.current[X]=O},ce=(0,fe.useCallback)(()=>{let X=V.current;if(Object.keys(X).length===0)return;let O=D.map(ue=>X[ue.value]?{...ue,color:X[ue.value]}:ue),J=l.map(ue=>ue.id===t.id?{...ue,options:O}:ue);V.current={},k({}),a(J)},[D,l,t.id,a]);(0,fe.useEffect)(()=>{if(!n)return;let X=O=>{let J=s.current?.contains(O.target),ue=d.current?.contains(O.target),Se=p.current?.contains(O.target);!J&&!ue&&!Se&&(ce(),i())};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[n,i,ce]),(0,fe.useEffect)(()=>{if(!n){b(null);return}if(v(""),k({}),V.current={},s.current){let X=s.current.getBoundingClientRect();m({top:X.bottom,left:X.left,width:X.width})}},[n]),(0,fe.useEffect)(()=>{if(!h)return;let X=O=>{p.current?.contains(O.target)||b(null)};return document.addEventListener("mousedown",X),()=>document.removeEventListener("mousedown",X)},[h]);let de=async X=>{let O=X.trim();if(!O||M.some($e=>$e.value===O))return;let J=Ir[M.length%Ir.length],ue=[...M,{value:O,color:J}],Se=l.map($e=>$e.id===t.id?{...$e,options:ue}:$e);await a(Se),r(O),v("")},De=async(X,O)=>{O.stopPropagation();let J=M.filter(Se=>Se.value!==X),ue=l.map(Se=>Se.id===t.id?{...Se,options:J}:Se);await a(ue),e===X&&r(null)},Ve=n&&f?(0,fo.createPortal)((0,I.jsxs)("div",{ref:d,className:"nb-select-dropdown",style:{position:"fixed",top:f.top,left:f.left,minWidth:f.width,zIndex:9999},children:[(0,I.jsx)("input",{className:"nb-select-new-input",type:"text",placeholder:u("select_create_placeholder"),value:c,autoFocus:!0,onChange:X=>v(X.target.value),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),de(c))}}),(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>r(null),children:u("select_clear")}),M.map(X=>(0,I.jsxs)("div",{className:"nb-select-option-row",children:[(0,I.jsx)("button",{className:`nb-select-option ${e===X.value?"nb-select-option--active":""}`,onClick:()=>r(X.value),children:(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(M,X.value),color:Lr(Qt(M,X.value))},children:X.value})}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${h===X.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Qt(M,X.value)},onClick:O=>{O.stopPropagation();let J=O.currentTarget.getBoundingClientRect();g({top:J.bottom+4,left:Math.min(J.right-j,window.innerWidth-j-8)}),b(ue=>ue===X.value?null:X.value)}}),(0,I.jsx)("button",{className:"nb-select-option-delete",onClick:O=>{De(X.value,O)},title:u("select_clear"),children:"\xD7"})]},X.value))]}),document.body):null,H=h&&_?(0,fo.createPortal)((0,I.jsxs)("div",{ref:p,className:"nb-status-color-picker",style:{position:"fixed",top:_.top,left:_.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:re.map(X=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:X},title:X,onClick:O=>{O.stopPropagation(),ne(h,X)}},X))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Qt(M,h),onChange:X=>{ne(h,X.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e?(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(M,e),color:Lr(Qt(M,e))},children:e}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),Ve,H]})}function cS({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:a,schema:l}=Ku(),s=(0,fe.useRef)(null),d=(0,fe.useRef)(null),[p,f]=(0,fe.useState)(null),[m,c]=(0,fe.useState)(""),[v,h]=(0,fe.useState)(null),[b,_]=(0,fe.useState)(null),g=(0,fe.useRef)(null),[y,k]=(0,fe.useState)({}),D=(0,fe.useRef)({}),M=176,V=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],j=t.options?.length?t.options:aS,re=j.map(H=>y[H.value]?{...H,color:y[H.value]}:H),ne=(H,X)=>{k(O=>({...O,[H]:X})),D.current[H]=X},ce=(0,fe.useCallback)(()=>{let H=D.current;if(Object.keys(H).length===0)return;let X=j.map(J=>H[J.value]?{...J,color:H[J.value]}:J),O=l.map(J=>J.id===t.id?{...J,options:X}:J);D.current={},k({}),a(O)},[j,l,t.id,a]);(0,fe.useEffect)(()=>{if(!n)return;let H=X=>{let O=s.current?.contains(X.target),J=d.current?.contains(X.target),ue=g.current?.contains(X.target);!O&&!J&&!ue&&(ce(),i())};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[n,i,ce]),(0,fe.useEffect)(()=>{if(!n){h(null);return}if(c(""),k({}),D.current={},s.current){let H=s.current.getBoundingClientRect();f({top:H.bottom,left:H.left,width:H.width})}},[n]),(0,fe.useEffect)(()=>{if(!v)return;let H=X=>{g.current?.contains(X.target)||h(null)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[v]);let de=async()=>{let H=m.trim();if(!H)return;let X=Ir[re.length%Ir.length],O={value:H,color:X},J=[...re,O],ue=l.map(Se=>Se.id===t.id?{...Se,options:J}:Se);await a(ue),c(""),r(H)},De=n&&p?(0,fo.createPortal)((0,I.jsxs)("div",{ref:d,className:"nb-select-dropdown",style:{position:"fixed",top:p.top,left:p.left,minWidth:p.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>r(null),children:"Limpar"}),re.map(H=>(0,I.jsxs)("div",{className:"nb-status-option-row",children:[(0,I.jsx)("button",{className:`nb-select-option nb-status-option-btn ${e===H.value?"nb-select-option--active":""}`,onClick:()=>r(H.value),children:(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(re,H.value),color:Lr(Qt(re,H.value))},children:H.value})}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${v===H.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Qt(re,H.value),color:Lr(Qt(re,H.value))},onClick:X=>{X.stopPropagation();let O=X.currentTarget.getBoundingClientRect();_({top:O.bottom+4,left:Math.min(O.right-M,window.innerWidth-M-8)}),h(J=>J===H.value?null:H.value)}}),(0,I.jsx)("button",{className:"nb-status-delete-btn",title:u("tooltip_delete_status"),onClick:X=>{X.stopPropagation();let O=re.filter(ue=>ue.value!==H.value),J=l.map(ue=>ue.id===t.id?{...ue,options:O}:ue);a(J),e===H.value&&r(null)},children:"\xD7"})]},H.value)),(0,I.jsxs)("div",{className:"nb-status-new-row",children:[(0,I.jsx)("input",{className:"nb-status-new-input",placeholder:u("status_new_placeholder"),value:m,onChange:H=>c(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.preventDefault(),de()),H.key==="Escape"&&i(),H.stopPropagation()}}),(0,I.jsx)("button",{className:"nb-status-new-btn",onClick:()=>{de()},disabled:!m.trim(),children:"+"})]})]}),document.body):null,Ve=v&&b?(0,fo.createPortal)((0,I.jsxs)("div",{ref:g,className:"nb-status-color-picker",style:{position:"fixed",top:b.top,left:b.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:V.map(H=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:H},title:H,onClick:X=>{X.stopPropagation(),ne(v,H)}},H))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Qt(re,v),onChange:H=>{ne(v,H.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e?(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(re,e),color:Lr(Qt(re,e))},children:e}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),De,Ve]})}function dS({value:e,col:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let{updateSchema:a,schema:l}=Ku(),s=(0,fe.useRef)(null),d=(0,fe.useRef)(null),p=(0,fe.useRef)(null),[f,m]=(0,fe.useState)(null),[c,v]=(0,fe.useState)(""),[h,b]=(0,fe.useState)(null),[_,g]=(0,fe.useState)(null),[y,k]=(0,fe.useState)({}),D=(0,fe.useRef)({}),M=t.options??[],V=M.map(O=>y[O.value]?{...O,color:y[O.value]}:O),j=176,re=["#9E9E9E","#F44336","#E91E63","#9C27B0","#673AB7","#3F51B5","#2196F3","#03A9F4","#00BCD4","#009688","#4CAF50","#8BC34A","#FFEB3B","#FF9800","#FF5722","#795548"],ne=(O,J)=>{k(ue=>({...ue,[O]:J})),D.current[O]=J},ce=(0,fe.useCallback)(()=>{let O=D.current;if(Object.keys(O).length===0)return;let J=M.map(Se=>O[Se.value]?{...Se,color:O[Se.value]}:Se),ue=l.map(Se=>Se.id===t.id?{...Se,options:J}:Se);D.current={},k({}),a(ue)},[M,l,t.id,a]);(0,fe.useEffect)(()=>{if(!n)return;let O=J=>{let ue=s.current?.contains(J.target),Se=d.current?.contains(J.target),$e=p.current?.contains(J.target);!ue&&!Se&&!$e&&(ce(),i())};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[n,i,ce]),(0,fe.useEffect)(()=>{if(!n){b(null);return}if(v(""),k({}),D.current={},s.current){let O=s.current.getBoundingClientRect();m({top:O.bottom,left:O.left,width:O.width})}},[n]),(0,fe.useEffect)(()=>{if(!h)return;let O=J=>{p.current?.contains(J.target)||b(null)};return document.addEventListener("mousedown",O),()=>document.removeEventListener("mousedown",O)},[h]);let de=O=>{let J=e.includes(O)?e.filter(ue=>ue!==O):[...e,O];r(J)},De=async O=>{let J=O.trim();if(!J||V.some(Ie=>Ie.value===J))return;let ue=Ir[V.length%Ir.length],Se=[...V,{value:J,color:ue}],$e=l.map(Ie=>Ie.id===t.id?{...Ie,options:Se}:Ie);await a($e),r([...e,J]),v("")},Ve=async(O,J)=>{J.stopPropagation();let ue=V.filter($e=>$e.value!==O),Se=l.map($e=>$e.id===t.id?{...$e,options:ue}:$e);await a(Se),e.includes(O)&&r(e.filter($e=>$e!==O))},H=n&&f?(0,fo.createPortal)((0,I.jsxs)("div",{ref:d,className:"nb-select-dropdown",style:{position:"fixed",top:f.top,left:f.left,minWidth:f.width,zIndex:9999},children:[(0,I.jsx)("input",{className:"nb-select-new-input",type:"text",placeholder:u("select_create_placeholder"),value:c,autoFocus:!0,onChange:O=>v(O.target.value),onKeyDown:O=>{O.key==="Enter"&&(O.preventDefault(),De(c))}}),V.map(O=>(0,I.jsxs)("div",{className:"nb-select-option-row",children:[(0,I.jsxs)("button",{className:`nb-select-option ${e.includes(O.value)?"nb-select-option--active":""}`,onClick:()=>de(O.value),children:[(0,I.jsx)("span",{className:`nb-checkbox-indicator ${e.includes(O.value)?"nb-checkbox-indicator--checked":""}`}),(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(V,O.value),color:Lr(Qt(V,O.value))},children:O.value})]}),(0,I.jsx)("button",{className:`nb-status-color-swatch ${h===O.value?"nb-status-color-swatch--active":""}`,title:u("tooltip_change_color"),style:{background:Qt(V,O.value),color:Lr(Qt(V,O.value))},onClick:J=>{J.stopPropagation();let ue=J.currentTarget.getBoundingClientRect();g({top:ue.bottom+4,left:Math.min(ue.right-j,window.innerWidth-j-8)}),b(Se=>Se===O.value?null:O.value)}}),(0,I.jsx)("button",{className:"nb-select-option-delete",onClick:J=>{Ve(O.value,J)},title:u("select_clear"),children:"\xD7"})]},O.value))]}),document.body):null,X=h&&_?(0,fo.createPortal)((0,I.jsxs)("div",{ref:p,className:"nb-status-color-picker",style:{position:"fixed",top:_.top,left:_.left,zIndex:1e4},children:[(0,I.jsx)("div",{className:"nb-status-color-grid",children:re.map(O=>(0,I.jsx)("button",{className:"nb-status-color-dot",style:{background:O},title:O,onClick:J=>{J.stopPropagation(),ne(h,O)}},O))}),(0,I.jsx)("div",{className:"nb-status-color-custom",children:(0,I.jsxs)("label",{className:"nb-status-color-custom-label",children:[u("color_custom"),(0,I.jsx)("input",{type:"color",className:"nb-status-color-input",defaultValue:Qt(V,h),onChange:O=>{ne(h,O.target.value)}})]})})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:s,children:[(0,I.jsx)("div",{className:"nb-cell-clickable nb-cell-multiselect",onClick:o,children:e.length>0?e.map(O=>(0,I.jsx)("span",{className:"nb-select-badge",style:{background:Qt(V,O),color:Lr(Qt(V,O))},children:O},O)):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),H,X]})}function pS({defaultValue:e,onChange:t,onEscape:n}){let[o,r]=(0,fe.useState)(e),i=l=>{let s=l.replace(/\D/g,"").slice(0,4);return s.length<=2?s:`${s.slice(0,2)}:${s.slice(2)}`},a=l=>{let s=l.match(/^(\d{1,2}):(\d{2})$/);if(!s)return;let d=Math.min(23,parseInt(s[1])),p=Math.min(59,parseInt(s[2])),f=`${String(d).padStart(2,"0")}:${String(p).padStart(2,"0")}`;r(f),t(f)};return(0,I.jsx)("input",{type:"text",inputMode:"numeric",className:"nb-cell-input nb-cell-input--time",value:o,placeholder:"HH:mm",onChange:l=>{let s=i(l.target.value);r(s),/^\d{2}:\d{2}$/.test(s)&&a(s)},onBlur:()=>a(o),onKeyDown:l=>{l.key==="Enter"&&a(o),l.key==="Escape"&&n()}})}function mS({value:e,isEditing:t,onStartEdit:n,onSave:o,onClose:r}){let i=(0,fe.useRef)(null),a=e?e.includes("T"):!1,l=e?e.split("T")[0]:null,s=e&&a?e.split("T")[1]:null,[d,p]=(0,fe.useState)(a);(0,fe.useEffect)(()=>{t&&p(a)},[t]),(0,fe.useEffect)(()=>{if(!t)return;let h=b=>{i.current&&!i.current.contains(b.target)&&r()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[t,r]);let f=(()=>{if(!l)return null;let[h,b,_]=l.split("-"),g=new Date(+h,+b-1,+_).toLocaleDateString("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"});return a&&s?`${g} ${s}`:g})();if(!t)return(0,I.jsx)("div",{className:"nb-cell-clickable nb-cell-date",onClick:n,children:f??(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})});let m=h=>{if(!h){o(null);return}o(d&&s?`${h}T${s}`:d?`${h}T00:00`:h)},c=h=>{let b=l??new Date().toISOString().slice(0,10);o(h?`${b}T${h}`:b)},v=()=>{let h=!d;p(h),!h&&l?o(l):h&&l&&o(`${l}T${s??"00:00"}`)};return(0,I.jsxs)("div",{ref:i,className:"nb-cell-date-editor",children:[(0,I.jsx)("input",{type:"date",className:"nb-cell-input nb-cell-input--date",defaultValue:l??"",onChange:h=>m(h.target.value),onKeyDown:h=>{h.key==="Escape"&&r()}}),d&&(0,I.jsx)(pS,{defaultValue:s??"00:00",onChange:c,onEscape:r}),(0,I.jsx)("button",{className:`nb-cell-time-toggle${d?" nb-cell-time-toggle--active":""}`,onClick:h=>{h.stopPropagation(),v()},title:d?u("calendar_remove_time"):u("calendar_add_time"),children:"\u{1F550}"})]})}function fS({value:e,onCommit:t}){return(0,I.jsx)("div",{className:"nb-cell-checkbox-wrapper",children:(0,I.jsx)("input",{type:"checkbox",className:"nb-cell-checkbox",checked:e,onChange:n=>t(n.target.checked)})})}function gS({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula",title:u("formula_panel_title")+": "+(t.formula??""),children:n})}function _S({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula nb-cell-lookup",title:u("lookup_panel_title")+" de "+(t.refDatabasePath??""),children:n})}function hS({value:e,col:t}){let n=e==null?"\u2014":String(e);return(0,I.jsx)("div",{className:"nb-cell-formula nb-cell-rollup",title:u("rollup_panel_title")+": "+(t.rollupFunction??""),children:n})}function vS({value:e,options:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let a=(0,fe.useRef)(null),l=(0,fe.useRef)(null),[s,d]=(0,fe.useState)(""),p=(0,fe.useRef)(null),[f,m]=(0,fe.useState)(null),[c,v]=(0,fe.useState)(e);(0,fe.useEffect)(()=>{v(e)},[e]),(0,fe.useEffect)(()=>{if(!n)return;let g=y=>{let k=a.current?.contains(y.target),D=l.current?.contains(y.target);!k&&!D&&r(c)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[n,r,c]),(0,fe.useEffect)(()=>{if(n){if(d(""),v(e),a.current){let g=a.current.getBoundingClientRect();m({top:g.bottom,left:g.left,width:g.width})}setTimeout(()=>p.current?.focus(),0)}},[n]);let h=g=>{v(y=>y.includes(g)?y.filter(k=>k!==g):[...y,g])},b=t.filter(g=>g.toLowerCase().includes(s.toLowerCase())),_=n&&f?(0,fo.createPortal)((0,I.jsxs)("div",{ref:l,className:"nb-select-dropdown nb-relation-dropdown",style:{position:"fixed",top:f.top,left:f.left,minWidth:f.width,zIndex:9999},children:[(0,I.jsx)("input",{ref:p,className:"nb-relation-search",placeholder:u("relation_search_placeholder"),value:s,onChange:g=>d(g.target.value),onKeyDown:g=>{g.key==="Escape"&&r(c)}}),c.length>0&&(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:()=>v([]),children:u("relation_clear")}),b.map(g=>(0,I.jsxs)("button",{className:`nb-select-option ${c.includes(g)?"nb-select-option--active":""}`,onClick:()=>h(g),children:[c.includes(g)&&(0,I.jsx)("span",{className:"nb-relation-check",children:"\u2713"}),(0,I.jsx)("span",{className:"nb-relation-badge",children:g})]},g)),b.length===0&&(0,I.jsx)("div",{className:"nb-relation-empty",children:u("relation_no_results")})]}),document.body):null;return(0,I.jsxs)("div",{className:"nb-cell-select-wrapper",ref:a,children:[(0,I.jsx)("div",{className:"nb-cell-clickable",onClick:o,children:e.length>0?(0,I.jsx)("span",{className:"nb-relation-badges",children:e.map(g=>(0,I.jsx)("span",{className:"nb-relation-badge",children:g},g))}):(0,I.jsx)("span",{className:"nb-cell-empty",children:"\u2014"})}),_]})}var Yv=new Set(["png","jpg","jpeg","gif","svg","webp","bmp"]);function bS({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let a=zt(),[l,s]=(0,fe.useState)([]),[d,p]=(0,fe.useState)(null),f=(0,fe.useRef)(null),m=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{if(!n)return;let b=e.imageSourceFolder,_=a.vault.getFiles(),g=b?_.filter(y=>Yv.has(y.extension.toLowerCase())&&(y.path.startsWith(b+"/")||y.parent?.path===b)):_.filter(y=>Yv.has(y.extension.toLowerCase()));if(s(g.sort((y,k)=>y.name.localeCompare(k.name))),f.current){let y=f.current.getBoundingClientRect(),k=y.left,D=y.bottom+4;k+280>window.innerWidth&&(k=window.innerWidth-288),p({x:k,y:D})}},[n,e.imageSourceFolder]),(0,fe.useEffect)(()=>{if(!n)return;let b=_=>{m.current?.contains(_.target)||f.current?.contains(_.target)||i()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[n,i]);let c=t?a.vault.getFileByPath(t):null,v=c?a.vault.getResourcePath(c):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:f,className:"nb-cell-image",onClick:o,children:v?(0,I.jsxs)("div",{className:"nb-image-cell-content",children:[(0,I.jsx)("img",{src:v,alt:"",className:"nb-image-cell-thumb"}),(0,I.jsx)("a",{className:"nb-image-cell-link",onClick:b=>{b.stopPropagation(),c&&a.workspace.getLeaf(!0).openFile(c)},title:t??"",children:c?.name??t??""})]}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("image_select_placeholder")})}),n&&d&&(0,fo.createPortal)((0,I.jsxs)("div",{ref:m,className:"nb-image-picker",style:{position:"fixed",top:d.y,left:d.x},children:[(0,I.jsxs)("div",{className:"nb-image-picker-header",children:[(0,I.jsx)("span",{children:u("image_picker_title")}),t&&(0,I.jsx)("button",{className:"nb-image-picker-clear",onClick:b=>{b.stopPropagation(),r(null)},children:u("image_picker_clear")})]}),l.length===0?(0,I.jsx)("div",{className:"nb-image-picker-empty",children:e.imageSourceFolder?`${u("image_picker_empty_folder")} "${e.imageSourceFolder}"`:u("image_picker_empty_vault")}):(0,I.jsx)("div",{className:"nb-image-picker-grid",children:l.map(b=>{let _=a.vault.getResourcePath(b);return(0,I.jsxs)("div",{className:`nb-image-picker-item${t===b.path?" nb-image-picker-item--selected":""}`,onClick:g=>{g.stopPropagation(),r(b.path)},title:b.path,children:[(0,I.jsx)("img",{src:_,alt:b.name,className:"nb-image-picker-thumb"}),(0,I.jsx)("span",{className:"nb-image-picker-name",children:b.name})]},b.path)})})]}),document.body)]})}var Xv=new Set(["mp3","wav","ogg","flac","m4a","aac","webm"]);function yS({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let a=zt(),[l,s]=(0,fe.useState)([]),[d,p]=(0,fe.useState)(null),f=(0,fe.useRef)(null),m=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{if(!n)return;let h=e.audioSourceFolder,b=a.vault.getFiles(),_=h?b.filter(g=>Xv.has(g.extension.toLowerCase())&&(g.path.startsWith(h+"/")||g.parent?.path===h)):b.filter(g=>Xv.has(g.extension.toLowerCase()));if(s(_.sort((g,y)=>g.name.localeCompare(y.name))),f.current){let g=f.current.getBoundingClientRect();p({top:g.bottom,left:g.left,width:g.width})}},[n,e.audioSourceFolder]),(0,fe.useEffect)(()=>{if(!n)return;let h=b=>{m.current?.contains(b.target)||f.current?.contains(b.target)||i()};return document.addEventListener("mousedown",h),()=>document.removeEventListener("mousedown",h)},[n,i]);let c=t?a.vault.getFileByPath(t):null,v=c?a.vault.getResourcePath(c):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:f,className:"nb-cell-audio",onClick:o,children:v?(0,I.jsx)("audio",{controls:!0,preload:"metadata",src:v,className:"nb-audio-player",onClick:h=>h.stopPropagation()}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("audio_select_placeholder")})}),n&&d&&(0,fo.createPortal)((0,I.jsxs)("div",{ref:m,className:"nb-select-dropdown",style:{position:"fixed",top:d.top,left:d.left,minWidth:d.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:h=>{h.stopPropagation(),r(null)},children:u("audio_picker_clear")}),(0,I.jsx)("div",{className:"nb-menu-separator"}),l.length===0?(0,I.jsx)("div",{className:"nb-select-option",style:{color:"var(--text-muted)",cursor:"default"},children:e.audioSourceFolder?`${u("audio_picker_empty_folder")} "${e.audioSourceFolder}"`:u("audio_picker_empty_vault")}):l.map(h=>(0,I.jsxs)("button",{className:`nb-select-option${t===h.path?" nb-select-option--active":""}`,onClick:b=>{b.stopPropagation(),r(h.path)},children:[(0,I.jsx)("span",{children:"\u{1F3B5}"}),(0,I.jsx)("span",{children:h.name})]},h.path))]}),document.body)]})}var Qv=new Set(["mp4","webm","ogv","mov","mkv"]);function wS({col:e,value:t,isEditing:n,onStartEdit:o,onCommit:r,onCancel:i}){let a=zt(),[l,s]=(0,fe.useState)([]),[d,p]=(0,fe.useState)(null),f=(0,fe.useRef)(null),m=(0,fe.useRef)(null);(0,fe.useEffect)(()=>{if(!n)return;let _=e.videoSourceFolder,g=a.vault.getFiles(),y=_?g.filter(k=>Qv.has(k.extension.toLowerCase())&&(k.path.startsWith(_+"/")||k.parent?.path===_)):g.filter(k=>Qv.has(k.extension.toLowerCase()));if(s(y.sort((k,D)=>k.name.localeCompare(D.name))),f.current){let k=f.current.getBoundingClientRect();p({top:k.bottom,left:k.left,width:k.width})}},[n,e.videoSourceFolder]),(0,fe.useEffect)(()=>{if(!n)return;let _=g=>{m.current?.contains(g.target)||f.current?.contains(g.target)||i()};return document.addEventListener("mousedown",_),()=>document.removeEventListener("mousedown",_)},[n,i]);let[c,v]=(0,fe.useState)(!1),h=t?a.vault.getFileByPath(t):null,b=h?a.vault.getResourcePath(h):null;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)("div",{ref:f,className:"nb-cell-video",onClick:o,children:h?(0,I.jsxs)("div",{className:"nb-video-cell-content",children:[(0,I.jsx)("span",{className:"nb-video-cell-icon",onClick:_=>{_.stopPropagation(),v(!0)},children:"\u25B6"}),(0,I.jsx)("a",{className:"nb-video-cell-link",onClick:_=>{_.stopPropagation(),v(!0)},title:t??"",children:h.name})]}):(0,I.jsx)("span",{className:"nb-cell-text nb-cell-placeholder",children:u("video_select_placeholder")})}),c&&b&&(0,fo.createPortal)((0,I.jsx)("div",{className:"nb-video-modal-backdrop",onClick:()=>v(!1),children:(0,I.jsxs)("div",{className:"nb-video-modal",onClick:_=>_.stopPropagation(),children:[(0,I.jsx)("video",{controls:!0,autoPlay:!0,src:b,className:"nb-video-modal-player"}),(0,I.jsx)("button",{className:"nb-video-modal-close",onClick:()=>v(!1),children:"\xD7"})]})}),document.body),n&&d&&(0,fo.createPortal)((0,I.jsxs)("div",{ref:m,className:"nb-select-dropdown",style:{position:"fixed",top:d.top,left:d.left,minWidth:d.width,zIndex:9999},children:[(0,I.jsx)("button",{className:"nb-select-option nb-select-clear",onClick:_=>{_.stopPropagation(),r(null)},children:u("video_picker_clear")}),(0,I.jsx)("div",{className:"nb-menu-separator"}),l.length===0?(0,I.jsx)("div",{className:"nb-select-option",style:{color:"var(--text-muted)",cursor:"default"},children:e.videoSourceFolder?`${u("video_picker_empty_folder")} "${e.videoSourceFolder}"`:u("video_picker_empty_vault")}):l.map(_=>(0,I.jsxs)("button",{className:`nb-select-option${t===_.path?" nb-select-option--active":""}`,onClick:g=>{g.stopPropagation(),r(_.path)},children:[(0,I.jsx)("span",{children:"\u{1F3AC}"}),(0,I.jsx)("span",{children:_.name})]},_.path))]}),document.body)]})}var Xu=require("obsidian"),Yu=class extends Xu.FuzzySuggestModal{constructor(t,n){super(t),this.onChoose=n,this.setPlaceholder("Escolha uma pasta de destino...")}getItems(){return this.app.vault.getAllLoadedFiles().filter(t=>t instanceof Xu.TFolder).sort((t,n)=>t.path.localeCompare(n.path))}getItemText(t){return t.path||"/"}onChooseItem(t){this.onChoose(t)}};var Zv=require("obsidian");function Cn(){return Zv.Platform.isMobile}var Ar=Re(xt(),1),Em=Re(uo(),1);var We=Re(St(),1),jn=()=>(0,We.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,We.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),go=()=>(0,We.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,We.jsx)("line",{x1:"4",y1:"6",x2:"16",y2:"6"}),(0,We.jsx)("line",{x1:"4",y1:"12",x2:"12",y2:"12"}),(0,We.jsx)("line",{x1:"4",y1:"18",x2:"8",y2:"18"})]}),kn=()=>(0,We.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,We.jsx)("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"}),(0,We.jsx)("circle",{cx:"12",cy:"12",r:"3"})]}),Jv=()=>(0,We.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,We.jsx)("polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2"})}),Hn=()=>(0,We.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,We.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,We.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,We.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]});function Un({search:e,actions:t,rowCount:n,rowCountLabel:o,filters:r,onFilterUpdate:i,onFilterRemove:a,onConjunctionToggle:l,actionBarRef:s,children:d}){let p=(0,Ar.useRef)(null),f=s??p,[m,c]=(0,Ar.useState)(!1),v=(0,Ar.useRef)(null);return(0,We.jsxs)("div",{className:"nb-mobile-toolbar",children:[e&&(0,We.jsx)("div",{className:"nb-mobile-search-strip",children:(0,We.jsxs)("div",{className:"nb-mobile-search-wrapper",onClick:()=>c(!0),children:[(0,We.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-mobile-search-icon",children:[(0,We.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,We.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,We.jsx)("div",{className:`nb-mobile-search-input nb-mobile-search-fake${e.value?" nb-mobile-search-fake--has-value":""}`,role:"button",tabIndex:-1,children:e.value||u("filter_value_placeholder").replace("...","")+"..."})]})}),e&&m&&(0,Em.createPortal)((0,We.jsx)("div",{className:"nb-mobile-search-overlay",onMouseDown:()=>c(!1),children:(0,We.jsxs)("div",{className:"nb-mobile-search-overlay-bar",onMouseDown:h=>h.stopPropagation(),children:[(0,We.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-mobile-search-overlay-icon",children:[(0,We.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,We.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]}),(0,We.jsx)("input",{ref:v,className:"nb-mobile-search-overlay-input",type:"text",placeholder:u("filter_value_placeholder").replace("...","")+"...",value:e.value,onChange:h=>e.onChange(h.target.value),onKeyDown:h=>{h.key==="Enter"&&(h.currentTarget.blur(),c(!1))},autoFocus:!0}),(0,We.jsx)("button",{className:"nb-mobile-search-overlay-close",onClick:()=>c(!1),children:"\xD7"})]})}),document.body),(0,We.jsx)("div",{className:"nb-mobile-action-bar",ref:f,children:t.map(h=>(0,We.jsxs)("button",{className:`nb-mobile-action-btn${h.active?" nb-mobile-action-btn--active":""}`,onMouseDown:b=>{b.stopPropagation(),b.nativeEvent.stopImmediatePropagation()},onClick:h.onClick,children:[h.icon,(0,We.jsx)("span",{className:"nb-mobile-action-label",children:h.label}),h.badge!=null&&h.badge>0&&(0,We.jsx)("span",{className:"nb-mobile-action-badge",children:h.badge})]},h.id))}),d,(0,We.jsx)(CS,{filters:r,rowCount:n,rowCountLabel:o,onFilterUpdate:i,onFilterRemove:a,onConjunctionToggle:l})]})}function CS({filters:e,rowCount:t,rowCountLabel:n,onFilterUpdate:o,onFilterRemove:r,onConjunctionToggle:i}){let[a,l]=(0,Ar.useState)(null);return e.length===0&&t<0?null:(0,We.jsxs)(We.Fragment,{children:[(0,We.jsxs)("div",{className:"nb-mobile-pills-strip",children:[e.map((s,d)=>(0,We.jsxs)(Ar.Fragment,{children:[d>0&&(0,We.jsx)("button",{className:`nb-pill-conjunction${s.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>i(s.id),children:s.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,We.jsxs)("button",{className:`nb-filter-pill${a===s.id?" nb-filter-pill--expanded":""}`,onClick:()=>l(p=>p===s.id?null:s.id),children:[(0,We.jsx)("span",{className:"nb-pill-name",children:s.columnName}),(0,We.jsx)("span",{className:"nb-pill-remove",onClick:p=>{p.stopPropagation(),r(s.id)},children:"\xD7"})]})]},s.id)),(0,We.jsxs)("span",{className:"nb-mobile-row-count",children:[t," ",n]})]}),(()=>{let s=a?e.find(d=>d.id===a):null;return s?(0,Em.createPortal)((0,We.jsx)("div",{className:"nb-mobile-search-overlay",onMouseDown:()=>l(null),children:(0,We.jsxs)("div",{className:"nb-mobile-search-overlay-bar nb-mobile-filter-overlay-bar",onMouseDown:d=>d.stopPropagation(),children:[(0,We.jsx)("span",{className:"nb-mobile-filter-overlay-title",children:s.columnName}),(0,We.jsx)("select",{className:"nb-mobile-filter-overlay-select",value:s.operator,onChange:d=>o(s.id,d.target.value,s.value),children:ga(s.columnType).map(d=>(0,We.jsx)("option",{value:d,children:Tr[d]},d))}),!Mr.has(s.operator)&&(0,We.jsx)("input",{className:"nb-mobile-search-overlay-input",type:"text",value:s.value,placeholder:u("filter_value_placeholder"),onChange:d=>o(s.id,s.operator,d.target.value),autoFocus:!0}),(0,We.jsx)("button",{className:"nb-mobile-search-overlay-close",onClick:()=>l(null),children:"\xD7"})]})}),document.body):null})()]})}var Ao=Re(xt(),1),eb=Re(uo(),1),hi=Re(St(),1);function dt({open:e,onClose:t,title:n,children:o}){let[r,i]=(0,Ao.useState)(!1),[a,l]=(0,Ao.useState)(!1),s=(0,Ao.useRef)(null),[d,p]=(0,Ao.useState)("70vh");return(0,Ao.useEffect)(()=>{if(e){i(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>l(!0))});return}l(!1);let f=setTimeout(()=>i(!1),250);return()=>clearTimeout(f)},[e]),(0,Ao.useEffect)(()=>{if(!e)return;let f=m=>{m.key==="Escape"&&t()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,t]),(0,Ao.useEffect)(()=>{if(!e||!window.visualViewport)return;let f=()=>{let m=window.visualViewport.height;p(`${m*.7}px`)};return f(),window.visualViewport.addEventListener("resize",f),()=>window.visualViewport.removeEventListener("resize",f)},[e]),r?(0,eb.createPortal)((0,hi.jsx)("div",{className:`nb-bottomsheet-backdrop${a?" nb-bottomsheet-backdrop--open":""}`,onMouseDown:t,children:(0,hi.jsxs)("div",{ref:s,className:`nb-bottomsheet${a?" nb-bottomsheet--open":""}`,style:{maxHeight:d},onMouseDown:f=>f.stopPropagation(),children:[(0,hi.jsx)("div",{className:"nb-bottomsheet-handle"}),n&&(0,hi.jsx)("div",{className:"nb-bottomsheet-title",children:n}),(0,hi.jsx)("div",{className:"nb-bottomsheet-content",children:o})]})}),document.body):null}var tb=Re(xt(),1);var Zt=Re(St(),1),Or=tb.default.memo(function({status:t}){return t==="idle"?null:(0,Zt.jsxs)("span",{className:`nb-save-indicator nb-save-indicator--${t}`,"aria-live":"polite",children:[t==="saving"&&(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)("span",{className:"nb-save-spinner"}),(0,Zt.jsx)("span",{className:"nb-save-label",children:u("saving")})]}),t==="saved"&&(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsx)("svg",{className:"nb-save-check",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Zt.jsx)("polyline",{points:"20 6 9 17 4 12"})}),(0,Zt.jsx)("span",{className:"nb-save-label",children:u("saved")})]}),t==="error"&&(0,Zt.jsxs)(Zt.Fragment,{children:[(0,Zt.jsxs)("svg",{className:"nb-save-error-icon",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Zt.jsx)("circle",{cx:"12",cy:"12",r:"10"}),(0,Zt.jsx)("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),(0,Zt.jsx)("line",{x1:"9",y1:"9",x2:"15",y2:"15"})]}),(0,Zt.jsx)("span",{className:"nb-save-label",children:u("save_error")})]})]})});var Fm=Re(xt(),1);var pt=Re(St(),1),kS=[{bg:"#dcfce7",text:""},{bg:"#fef9c3",text:""},{bg:"#fee2e2",text:""},{bg:"#dbeafe",text:""},{bg:"#f3e8ff",text:""},{bg:"#ffedd5",text:""},{bg:"",text:"#16a34a"},{bg:"",text:"#dc2626"},{bg:"",text:"#2563eb"},{bg:"#dc2626",text:"#ffffff"},{bg:"#16a34a",text:"#ffffff"},{bg:"#2563eb",text:"#ffffff"}];function $r({rules:e,schema:t,onChange:n,onClose:o}){let[r,i]=(0,Fm.useState)(null),a=t.filter(m=>m.visible&&m.type!=="formula"&&m.type!=="lookup"&&m.type!=="rollup"),l=()=>{let m=a[0];if(!m)return;let c={id:crypto.randomUUID(),columnId:m.id,operator:Tn(m.type),value:"",bgColor:"#dcfce7",textColor:""};i(c)},s=m=>{let v=e.find(h=>h.id===m.id)?e.map(h=>h.id===m.id?m:h):[...e,m];n(v),i(null)},d=m=>{n(e.filter(c=>c.id!==m)),r?.id===m&&i(null)},p=m=>t.find(c=>c.id===m)?.type??"text",f=m=>t.find(c=>c.id===m)?.name??m;return(0,pt.jsxs)("div",{className:"nb-cf-panel nb-fields-dropdown",children:[(0,pt.jsxs)("div",{className:"nb-cf-panel-header",children:[(0,pt.jsx)("span",{className:"nb-cf-panel-title",children:u("conditional_formatting")}),(0,pt.jsx)("button",{className:"nb-cf-panel-close",onClick:o,children:"\xD7"})]}),e.length===0&&!r&&(0,pt.jsx)("div",{className:"nb-cf-panel-empty",children:u("no_conditional_formats")}),e.map(m=>(0,pt.jsxs)("div",{className:"nb-cf-rule",onClick:()=>i({...m}),children:[(0,pt.jsx)("span",{className:"nb-cf-rule-preview",style:{backgroundColor:m.bgColor||void 0,color:m.textColor||void 0},children:"Aa"}),(0,pt.jsxs)("span",{className:"nb-cf-rule-desc",children:[f(m.columnId)," ",Tr[m.operator]," ",Mr.has(m.operator)?"":m.value]}),(0,pt.jsx)("button",{className:"nb-cf-rule-remove",onClick:c=>{c.stopPropagation(),d(m.id)},children:"\xD7"})]},m.id)),r&&(0,pt.jsx)(SS,{rule:r,schema:t,availableCols:a,getColType:p,onSave:s,onCancel:()=>i(null)}),!r&&(0,pt.jsx)("button",{className:"nb-cf-add-btn",onClick:l,children:"+ "+u("add_rule")})]})}function SS({rule:e,schema:t,availableCols:n,getColType:o,onSave:r,onCancel:i}){let[a,l]=(0,Fm.useState)(e),s=o(a.columnId),d=ga(s),p=!Mr.has(a.operator),m=t.find(v=>v.id===a.columnId)?.options?.map(v=>v.value||v.label||"").filter(Boolean)??[],c=s==="select"||s==="multiselect"||s==="status";return(0,pt.jsxs)("div",{className:"nb-cf-editor",children:[(0,pt.jsxs)("div",{className:"nb-cf-editor-row",children:[(0,pt.jsx)("select",{className:"nb-cf-select",value:a.columnId,onChange:v=>{let h=o(v.target.value);l({...a,columnId:v.target.value,operator:Tn(h),value:""})},children:n.map(v=>(0,pt.jsx)("option",{value:v.id,children:v.name},v.id))}),(0,pt.jsx)("select",{className:"nb-cf-select",value:a.operator,onChange:v=>l({...a,operator:v.target.value}),children:d.map(v=>(0,pt.jsx)("option",{value:v,children:Tr[v]},v))})]}),p&&(0,pt.jsx)("div",{className:"nb-cf-editor-row",children:c&&m.length>0?(0,pt.jsxs)("select",{className:"nb-cf-select nb-cf-value",value:a.value,onChange:v=>l({...a,value:v.target.value}),children:[(0,pt.jsx)("option",{value:"",children:u("select_value")}),m.map(v=>(0,pt.jsx)("option",{value:v,children:v},v))]}):(0,pt.jsx)("input",{className:"nb-cf-input",type:s==="number"?"number":s==="date"?"date":"text",value:a.value,onChange:v=>l({...a,value:v.target.value}),placeholder:u("value"),autoFocus:!0})}),(0,pt.jsx)("div",{className:"nb-cf-editor-row",children:(0,pt.jsx)("span",{className:"nb-cf-color-label",children:u("style")})}),(0,pt.jsx)("div",{className:"nb-cf-presets",children:kS.map((v,h)=>(0,pt.jsx)("button",{className:`nb-cf-preset${a.bgColor===v.bg&&a.textColor===v.text?" nb-cf-preset--active":""}`,style:{backgroundColor:v.bg||"transparent",color:v.text||"var(--text-normal)",borderColor:v.bg||v.text||"var(--background-modifier-border)"},onClick:()=>l({...a,bgColor:v.bg,textColor:v.text}),children:"Aa"},h))}),(0,pt.jsxs)("div",{className:"nb-cf-editor-row nb-cf-custom-colors",children:[(0,pt.jsxs)("label",{className:"nb-cf-color-field",children:[(0,pt.jsx)("span",{children:u("background")}),(0,pt.jsx)("input",{type:"color",value:a.bgColor||"#ffffff",onChange:v=>l({...a,bgColor:v.target.value==="#ffffff"?"":v.target.value})})]}),(0,pt.jsxs)("label",{className:"nb-cf-color-field",children:[(0,pt.jsx)("span",{children:u("text_color")}),(0,pt.jsx)("input",{type:"color",value:a.textColor||"#000000",onChange:v=>l({...a,textColor:v.target.value==="#000000"?"":v.target.value})})]})]}),(0,pt.jsxs)("div",{className:"nb-cf-editor-actions",children:[(0,pt.jsx)("button",{className:"nb-cf-btn nb-cf-btn--save",onClick:()=>r(a),children:u("save")}),(0,pt.jsx)("button",{className:"nb-cf-btn nb-cf-btn--cancel",onClick:i,children:u("cancel")})]})]})}var nb=Re(xt(),1);var zr=Re(St(),1),va=nb.default.memo(function({currentPage:t,totalPages:n,onPageChange:o}){return n<=1?null:(0,zr.jsxs)("div",{className:"nb-pagination",children:[(0,zr.jsx)("button",{className:"nb-pagination-btn",disabled:t===1,onClick:()=>o(1),title:u("first_page"),children:"\xAB"}),(0,zr.jsx)("button",{className:"nb-pagination-btn",disabled:t===1,onClick:()=>o(t-1),title:u("prev_page"),children:"\u2039"}),(0,zr.jsx)("span",{className:"nb-pagination-info",children:u("page_of").replace("{current}",String(t)).replace("{total}",String(n))}),(0,zr.jsx)("button",{className:"nb-pagination-btn",disabled:t===n,onClick:()=>o(t+1),title:u("next_page"),children:"\u203A"}),(0,zr.jsx)("button",{className:"nb-pagination-btn",disabled:t===n,onClick:()=>o(n),title:u("last_page"),children:"\xBB"})]})});var vi=Re(xt(),1);function Vr(e=2e3){let[t,n]=(0,vi.useState)("idle"),o=(0,vi.useRef)(0),r=(0,vi.useRef)(),i=(0,vi.useCallback)(a=>(o.current++,r.current&&clearTimeout(r.current),n("saving"),a.then(l=>(o.current--,o.current===0&&(n("saved"),r.current=setTimeout(()=>n("idle"),e)),l),l=>{throw o.current--,o.current===0&&(n("error"),r.current=setTimeout(()=>n("idle"),e)),l})),[e]);return{status:t,trackSave:i}}var bi=Re(xt(),1);function ba(e,t){let[n,o]=(0,bi.useState)(1),r=t>0?Math.max(1,Math.ceil(e.length/t)):1;return(0,bi.useEffect)(()=>{o(1)},[e.length,t]),(0,bi.useEffect)(()=>{n>r&&o(r)},[n,r]),{pageItems:(0,bi.useMemo)(()=>{if(t<=0)return e;let a=(n-1)*t;return e.slice(a,a+t)},[e,n,t]),currentPage:n,totalPages:r,setPage:o}}var NS=3;function Qu(e,t){return e.find(n=>n.type==="relation"&&n.isHierarchical&&n.refDatabasePath===t)??null}function Dm(e,t){let n=e[t];return n?Array.isArray(n)?n:[String(n)]:[]}function Zu(e,t,n,o,r){let i=new Map,a=new Map,l=new Set;for(let c of e)i.set(c._title,c);for(let c of e){let v=Dm(c,t);for(let h of v)if(i.has(h)&&h!==c._title){let b=a.get(h)??[];b.push(c),a.set(h,b),l.add(c._file.path);break}}for(let c of e){if(!l.has(c._file.path))continue;let v=new Set,h=c._title;for(;h;){if(v.has(h)){l.delete(c._file.path);let g=Dm(c,t)[0];if(g){let y=a.get(g);if(y){let k=y.indexOf(c);k>=0&&y.splice(k,1),y.length===0&&a.delete(g)}}break}v.add(h);let b=i.get(h);if(!b||!l.has(b._file.path))break;h=Dm(b,t).find(g=>i.has(g)&&g!==b._title)??""}}let s=e.filter(c=>!l.has(c._file.path)),d=to(s,n),p=[],f=new Set;function m(c,v,h){if(f.has(c._title))return;f.add(c._title);let b=a.get(c._title)??[],_=b.length>0;if(p.push({row:c,depth:v,hasChildren:_,parentTitle:h}),!_||v>=NS||!(r?!o.has(c._file.path):o.has(c._file.path)))return;let y=to(b,n);for(let k of y)m(k,v+1,c._title)}for(let c of d)m(c,0,null);return p}var C=Re(St(),1);function xS(e,t){let[n,o]=(0,le.useState)({scrollTop:0,viewportHeight:800}),r=(0,le.useRef)(null);(0,le.useEffect)(()=>{let s=e.current;if(!s)return;let d=()=>o({scrollTop:s.scrollTop,viewportHeight:s.clientHeight});d();let p=()=>{r.current||(r.current=setTimeout(()=>{r.current=null,d()},32))};s.addEventListener("scroll",p,{passive:!0});let f=new ResizeObserver(d);return f.observe(s),()=>{s.removeEventListener("scroll",p),f.disconnect(),r.current&&clearTimeout(r.current)}},[e]);let i=20,a=Math.max(0,Math.floor(n.scrollTop/t)-i),l=Math.ceil((n.scrollTop+n.viewportHeight)/t)+i;return{startIdx:a,endIdx:l,topPad:a*t}}function RS({scrollRef:e,rowHeight:t,rows:n,stickyMap:o,isMobile:r,setEditingCell:i,setContextMenuFile:a,longPressRef:l,columns:s,onAddRow:d,hierarchyMap:p,onToggleExpand:f,onAddSubRow:m,expandedSet:c,allExpanded:v,rowDragEnabled:h,dragOverPath:b,onRowDragStart:_,onRowDragOver:g,onRowDragEnd:y,onRowDrop:k,conditionalFormats:D,schema:M}){let{startIdx:V,endIdx:j,topPad:re}=xS(e,t),ne=n.slice(V,Math.min(n.length,j)),ce=Math.max(0,(n.length-Math.min(n.length,j))*t);return(0,C.jsxs)("tbody",{className:"nb-tbody",children:[n.length===0?(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:s.length+1,className:"nb-empty-rows",children:u("no_results")})}):(0,C.jsxs)(C.Fragment,{children:[re>0&&(0,C.jsx)("tr",{style:{height:re}}),ne.map(de=>{let De=de.original._file.path;return(0,C.jsxs)("tr",{className:`nb-row${b===De?" nb-row--drag-over":""}`,onClick:()=>i(null),onContextMenu:H=>{H.preventDefault(),a(de.original._file)},onTouchStart:r?()=>{l.current=setTimeout(()=>a(de.original._file),500)}:void 0,onTouchMove:r?()=>{l.current&&(clearTimeout(l.current),l.current=null)}:void 0,onTouchEnd:r?()=>{l.current&&(clearTimeout(l.current),l.current=null)}:void 0,onDragOver:h?H=>{H.preventDefault(),g?.(De)}:void 0,onDrop:h?H=>{H.preventDefault(),k?.(De)}:void 0,children:[de.getVisibleCells().map(H=>{let X=o.get(H.column.id),O=p?.get(de.original._file.path),J=H.column.id==="_title"&&O,ue=O?.depth??0,Se=v?!c?.has(de.original._file.path):!!c?.has(de.original._file.path),$e=H.column.id==="_select",Ie=D?.length&&M?Bv(de.original,H.column.id,D,M):void 0,ot=!!M?.find(Ge=>Ge.id===H.column.id)?.wrap;return(0,C.jsx)("td",{"data-col-id":H.column.id,className:["nb-td",X?"nb-td--sticky":"",X?.isLast?"nb-td--sticky-last":"",ot?"nb-td--wrap":""].filter(Boolean).join(" "),style:{width:H.column.getSize(),...X?{left:X.left,zIndex:1}:{},...Ie},onClick:Ge=>Ge.stopPropagation(),children:$e&&h?(0,C.jsxs)("div",{className:"nb-td-inner nb-td-inner--drag",children:[(0,C.jsx)("span",{className:"nb-row-drag-handle",draggable:!0,onDragStart:Ge=>{Ge.dataTransfer.effectAllowed="move",Ge.dataTransfer.setData("text/plain",De),_?.(De)},onDragEnd:()=>y?.(),children:"\u283F"}),aa(H.column.columnDef.cell,H.getContext())]}):J?(0,C.jsxs)("div",{className:"nb-td-inner nb-hierarchy-cell",style:{paddingLeft:ue*20},children:[O.hasChildren?(0,C.jsx)("button",{className:"nb-hierarchy-toggle",onClick:Ge=>{Ge.stopPropagation(),f?.(de.original._file.path)},children:Se?"\u25BC":"\u25B6"}):(0,C.jsx)("span",{className:"nb-hierarchy-toggle-spacer"}),(0,C.jsx)("span",{style:{flex:1},children:aa(H.column.columnDef.cell,H.getContext())}),!r&&ue<3&&(0,C.jsx)("button",{className:"nb-add-subrow-btn",onClick:Ge=>{Ge.stopPropagation(),m?.(de.original._title)},title:u("add_subrow"),children:"+"})]}):(0,C.jsx)("div",{className:"nb-td-inner",children:aa(H.column.columnDef.cell,H.getContext())})},H.id)}),(0,C.jsx)("td",{className:"nb-td nb-td-empty"})]},de.id)}),ce>0&&(0,C.jsx)("tr",{style:{height:ce}})]}),(0,C.jsx)("tr",{children:(0,C.jsx)("td",{colSpan:s.length+1,className:"nb-add-row-td",children:(0,C.jsx)("button",{className:"nb-add-row-btn",onClick:d,children:"+ "+u("add_row")})})})]})}function ES(e,t,n,o){if(n===o)return null;let r=["formula","lookup","relation"];if(r.includes(o)||r.includes(n))return null;let i=e.map(a=>a[t]).filter(a=>a!=null&&a!=="");if(o==="number"){let a=i.filter(l=>{let s=String(l).trim();return s!==""&&(isNaN(Number(s))||!isFinite(Number(s)))});if(a.length>0)return`${a.length} ${u("validate_non_numeric")}${String(a[0])}"`}if(o==="date"){let a=i.filter(l=>{let s=String(l).trim();return s!==""&&isNaN(new Date(s).getTime())});if(a.length>0)return`${a.length} ${u("validate_invalid_dates")}${String(a[0])}"`}if(o==="checkbox"){let a=new Set(["true","false","1","0","yes","no","sim","n\xE3o","nao"]),l=i.filter(s=>typeof s=="boolean"?!1:!a.has(String(s).toLowerCase().trim()));if(l.length>0)return`${l.length} ${u("validate_invalid_checkbox")}${String(l[0])}"`}if(n==="multiselect"&&o==="select"){let a=i.filter(l=>Array.isArray(l)&&l.length>1);if(a.length>0)return`${a.length} ${u("validate_multiselect_to_select")}`}if(o==="email"){let a=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,l=i.filter(s=>{let d=String(s).trim();return d!==""&&!a.test(d)});if(l.length>0)return`${l.length} ${u("validate_invalid_email")}${String(l[0])}"`}if(o==="url"){let a=i.filter(l=>{let s=String(l).trim();try{return new URL(s),!1}catch{return!0}});if(a.length>0)return`${a.length} ${u("validate_invalid_url")}${String(a[0])}"`}if(o==="phone"){let a=/^[\d\s()\-+]+$/,l=i.filter(s=>{let d=String(s).trim();return d!==""&&!a.test(d)});if(l.length>0)return`${l.length} ${u("validate_invalid_phone")}${String(l[0])}"`}return null}function FS(e){return{title:"\u{1F4C4}",text:"Aa",number:"#",select:"\u25C9",multiselect:"\u25C8",date:"\u{1F4C5}",checkbox:"\u2611",formula:"\u0192",relation:"\u{1F517}",lookup:"\u2197"}[e]??"\xB7"}var DS=["contains","not_contains","starts_with","ends_with","is","is_not","is_empty","is_not_empty"],TS=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],MS=["is","is_not","gt","gte","lt","lte","is_empty","is_not_empty"],Tm=["is","is_not","is_empty","is_not_empty"],PS=["is_checked","is_unchecked","is_empty","is_not_empty"];function LS(e){switch(e){case"number":return TS;case"date":return MS;case"select":return Tm;case"multiselect":return Tm;case"status":return Tm;case"checkbox":return PS;default:return DS}}function IS(e){switch(e){case"number":case"date":return"is";case"checkbox":return"is_checked";case"select":case"multiselect":case"status":return"is";default:return"contains"}}var ob=new Proxy({},{get:(e,t)=>({is:u("op_is"),is_not:u("op_is_not"),contains:u("op_contains"),not_contains:u("op_not_contains"),starts_with:u("op_starts_with"),ends_with:u("op_ends_with"),gt:u("op_gt"),gte:u("op_gte"),lt:u("op_lt"),lte:u("op_lte"),is_checked:u("op_is_checked"),is_unchecked:u("op_is_unchecked"),is_empty:u("op_is_empty"),is_not_empty:u("op_is_not_empty")})[t]??t}),ib=new Set(["is_empty","is_not_empty","is_checked","is_unchecked"]);function AS(e,t){if(!ib.has(t.operator)&&t.value==="")return!0;let o=t.columnId==="_title"?e._title:e[t.columnId];if(t.operator==="is_empty")return o==null||String(o??"").trim()==="";if(t.operator==="is_not_empty")return o!=null&&String(o??"").trim()!=="";if(t.operator==="is_checked")return o===!0||o==="true";if(t.operator==="is_unchecked")return o!==!0&&o!=="true";if(t.columnType==="number"){let a=parseFloat(String(o??"")),l=parseFloat(t.value);if(isNaN(a)||isNaN(l))return!1;switch(t.operator){case"is":return a===l;case"is_not":return a!==l;case"gt":return a>l;case"gte":return a>=l;case"lt":return a<l;case"lte":return a<=l;default:return!0}}if(t.columnType==="date"){let a=new Date(String(o??"")).getTime(),l=new Date(t.value).getTime();if(isNaN(a)||isNaN(l))return!1;switch(t.operator){case"is":return a===l;case"is_not":return a!==l;case"gt":return a>l;case"gte":return a>=l;case"lt":return a<l;case"lte":return a<=l;default:return!0}}if(_a(t)){let a=_i(t.value).map(s=>s.toLowerCase());if(a.length===0)return!0;let l=Array.isArray(o)?o.map(s=>s.toLowerCase()):[String(o??"").toLowerCase()];return t.operator==="is"?l.some(s=>a.includes(s)):l.every(s=>!a.includes(s))}let r=Array.isArray(o)?o.join(", ").toLowerCase():String(o??"").toLowerCase(),i=t.value.toLowerCase();switch(t.operator){case"is":return r===i;case"is_not":return r!==i;case"contains":return r.includes(i);case"not_contains":return!r.includes(i);case"starts_with":return r.startsWith(i);case"ends_with":return r.endsWith(i);default:return!0}}function OS(e){switch(e){case"number":return"basic";case"date":return(t,n,o)=>{let r=new Date(String(t.getValue(o)??"")).getTime()||0,i=new Date(String(n.getValue(o)??"")).getTime()||0;return r-i};case"checkbox":return(t,n,o)=>{let r=t.getValue(o)?1:0,i=n.getValue(o)?1:0;return r-i};default:return"text"}}function $S({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[a,l]=(0,le.useState)(()=>({x:r.right-280,y:r.bottom+4})),s=b=>{b.preventDefault();let _=b.clientX-a.x,g=b.clientY-a.y,y=D=>l({x:D.clientX-_,y:D.clientY-g}),k=()=>{window.removeEventListener("mousemove",y),window.removeEventListener("mouseup",k)};window.addEventListener("mousemove",y),window.addEventListener("mouseup",k)},d=t.filter(b=>b.type!=="formula"&&b.type!=="lookup"&&b.type!=="relation"&&b.type!=="multiselect"),p=new Set(e.map(b=>b.columnId)),f=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...d.filter(b=>!p.has(b.id)).map(b=>({id:b.id,name:b.name}))],m=(b,_)=>{let g=[...e],y=b+_;y<0||y>=g.length||([g[b],g[y]]=[g[y],g[b]],n(g))},c=b=>{n(e.map(_=>_.columnId===b?{..._,direction:_.direction==="asc"?"desc":"asc"}:_))},v=b=>{n(e.filter(_=>_.columnId!==b))},h=b=>{b&&n([...e,{columnId:b,direction:"asc"}])};return(0,Ju.createPortal)((0,C.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:a.y,left:a.x},children:[(0,C.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,C.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,C.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,C.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((b,_)=>{let g=b.columnId==="_title"?"Nome":t.find(y=>y.id===b.columnId)?.name??b.columnId;return(0,C.jsxs)("div",{className:"nb-sort-row",children:[(0,C.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,C.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(_,-1),disabled:_===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,C.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(_,1),disabled:_===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,C.jsx)("span",{className:"nb-sort-row-name",children:g}),(0,C.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>c(b.columnId),children:b.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,C.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>v(b.columnId),title:u("tooltip_remove"),children:"\xD7"})]},b.columnId)}),f.length>0&&(0,C.jsx)("div",{className:"nb-sort-add-row",children:(0,C.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:b=>{h(b.target.value),b.target.value=""},children:[(0,C.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),f.map(b=>(0,C.jsx)("option",{value:b.id,children:b.name},b.id))]})})]}),document.body)}function ab({onResize:e,onAutoFit:t}){return(0,C.jsx)("div",{className:"nb-col-resizer",onMouseDown:o=>{o.preventDefault(),o.stopPropagation();let r=o.currentTarget.closest("th");if(!r)return;let i=o.clientX,a=r.offsetWidth,l=a,s=p=>{l=Math.max(50,a+(p.clientX-i)),r.style.width=l+"px"},d=()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mouseup",d),e(l)};window.addEventListener("mousemove",s),window.addEventListener("mouseup",d)},onDoubleClick:o=>{o.stopPropagation(),t?.()},title:u("tooltip_resize_column")})}function zS({id:e,size:t,children:n,stickyLeft:o,isLastPinned:r,isPinned:i,onTogglePin:a,sorted:l,onToggleSort:s,onResize:d,onAutoFit:p}){let{attributes:f,listeners:m,setNodeRef:c,setActivatorNodeRef:v,transform:h,transition:b,isDragging:_}=ym({id:e}),g=o!==void 0;return(0,C.jsxs)("th",{ref:c,"data-col-id":e,className:["nb-th",_?"nb-th--dragging":"",g?"nb-th--sticky":"",r?"nb-th--sticky-last":""].filter(Boolean).join(" "),style:{width:t,transform:Jo.Transform.toString(h),transition:b,zIndex:_?10:g?3:void 0,...g?{left:o}:{}},children:[(0,C.jsxs)("div",{className:"nb-th-inner",children:[(0,C.jsx)("span",{ref:v,...m,...f,className:"nb-col-drag-handle",title:"Arrastar para reordenar",children:"\u283F"}),n,s&&(0,C.jsxs)("button",{className:l?"nb-sort-btn nb-sort-btn--sorted":"nb-sort-btn",onClick:y=>{y.stopPropagation(),s()},title:l==="asc"?u("sort_asc_title"):l==="desc"?u("sort_desc_title"):u("sort_none_title"),children:[(0,C.jsx)("span",{className:l==="asc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2303"}),(0,C.jsx)("span",{className:l==="desc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2304"})]}),(0,C.jsx)("span",{className:"nb-col-drag-spacer","aria-hidden":"true"}),a&&(0,C.jsx)("button",{className:`nb-pin-btn${i?" nb-pin-btn--active":""}`,onClick:y=>{y.stopPropagation(),a()},title:i?u("tooltip_unpin_column"):u("tooltip_pin_column"),children:"\u{1F4CC}"})]}),d&&(0,C.jsx)(ab,{onResize:d,onAutoFit:p})]})}function VS({filter:e,isActive:t,onToggle:n,onRemove:o,btnRef:r}){let{attributes:i,listeners:a,setNodeRef:l,setActivatorNodeRef:s,transform:d,transition:p,isDragging:f}=ym({id:e.id});return(0,C.jsxs)("div",{ref:l,style:{transform:Jo.Transform.toString(d),transition:p,opacity:f?.4:1},className:"nb-filter-pill-sortable",children:[(0,C.jsx)("span",{ref:s,...a,...i,className:"nb-pill-drag-handle",title:"Arrastar para reordenar",children:(0,C.jsxs)("svg",{width:"8",height:"14",viewBox:"0 0 8 14",fill:"currentColor",children:[(0,C.jsx)("circle",{cx:"2",cy:"2.5",r:"1.2"}),(0,C.jsx)("circle",{cx:"6",cy:"2.5",r:"1.2"}),(0,C.jsx)("circle",{cx:"2",cy:"7",r:"1.2"}),(0,C.jsx)("circle",{cx:"6",cy:"7",r:"1.2"}),(0,C.jsx)("circle",{cx:"2",cy:"11.5",r:"1.2"}),(0,C.jsx)("circle",{cx:"6",cy:"11.5",r:"1.2"})]})}),(0,C.jsxs)("button",{ref:r,className:`nb-filter-pill ${t?"nb-filter-pill--active":""}`,onClick:n,children:[(0,C.jsx)("span",{className:"nb-filter-pill-icon",children:e.icon}),(0,C.jsx)("span",{className:"nb-filter-pill-name",children:e.columnName}),(0,C.jsx)("span",{className:"nb-filter-pill-remove",onClick:m=>{m.stopPropagation(),o()},title:u("tooltip_remove_filter"),children:"\xD7"})]})]})}var BS=["number","formula"];function jS({colType:e,current:t,onSelect:n,anchorEl:o}){let r=o?.getBoundingClientRect(),i=r?r.bottom+window.scrollY:0,a=r?r.left+window.scrollX:0,l=BS.includes(e),s=[{type:"none",label:u("agg_none")},{type:"count",label:u("agg_count")},{type:"count_values",label:u("agg_count_values")},{type:"sum",label:u("agg_sum"),numericOnly:!0},{type:"avg",label:u("agg_avg"),numericOnly:!0},{type:"min",label:u("agg_min"),numericOnly:!0},{type:"max",label:u("agg_max"),numericOnly:!0}];return(0,C.jsx)("div",{className:"nb-agg-dropdown",style:{position:"absolute",top:i,left:a,zIndex:9999},children:s.filter(d=>!d.numericOnly||l).map(d=>(0,C.jsx)("button",{className:`nb-menu-item ${t===d.type?"nb-menu-item--active":""}`,onClick:()=>n(d.type),children:d.label},d.type))})}function Mm({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{status:i,trackSave:a}=Vr(),l=(0,le.useRef)(null),[s,d]=(0,le.useState)(new Map),[p,f]=(0,le.useState)(null),m=(0,le.useCallback)((w,L)=>{if(l.current){let W=L.findIndex(ge=>ge._file.path===l.current);W!==-1&&L.push(...L.splice(W,1)),l.current=null}let T=new Map;for(let W of w.schema.filter(ge=>ge.type==="relation"&&ge.refDatabasePath)){let ge=r.vault.getFileByPath(W.refDatabasePath);if(!ge)continue;let et=t.getNotesInDatabase(ge),nt=new Set;for(let Pn of et){let tn=Pn.basename.trim();tn&&nt.add(tn)}T.set(W.id,Array.from(nt).sort())}d(T),f((n??w.views[0])?.pinnedColumnId??null)},[r,t,n]),{rows:c,config:v,loading:h,activeFilters:b,setActiveFilters:_}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n?.includeSubfolders,externalView:n??Jn,onLoaded:m}),[g,y]=(0,le.useState)([]),[k,D]=(0,le.useState)(Rr);(0,le.useEffect)(()=>{y(c)},[c]),(0,le.useEffect)(()=>{D(v)},[v]);let[M,V]=(0,le.useState)([]),[j,re]=(0,le.useState)(!1),ne=(0,le.useRef)(null),[ce,de]=(0,le.useState)(null),De=(0,le.useRef)(null),[Ve,H]=(0,le.useState)(""),X=Bn(Ve,200),[O,J]=(0,le.useState)(null),[ue,Se]=(0,le.useState)(!1),$e=(0,le.useRef)(null),[Ie,ot]=(0,le.useState)({}),[Ge,ye]=(0,le.useState)(!1),[Ee,Le]=(0,le.useState)(null),Be=(0,le.useRef)(null),[Ae,Ne]=(0,le.useState)(!1),[it,Je]=(0,le.useState)(null),R=(0,le.useRef)(null),G=(0,le.useRef)(null),me=(0,le.useRef)(null),[ae,je]=(0,le.useState)(!1),qe=(0,le.useRef)(null),_e=(0,le.useRef)(null),Oe=(0,le.useRef)(null),vt=(0,le.useRef)(null),[Ft,P]=(0,le.useState)(!1),we=(0,le.useRef)(null),[A,ee]=(0,le.useState)(null),Me=(0,le.useRef)({}),Fe=(0,le.useRef)(null),[bt,cn]=(0,le.useState)(null),[mt,dn]=(0,le.useState)(null),Jt=(0,le.useRef)({}),[en,x]=(0,le.useState)(!1),N=(0,le.useRef)(null),Y=(0,le.useRef)(null),[se,oe]=(0,le.useState)(new Set),[te]=(0,le.useState)(!0),[S,Q]=(0,le.useState)(null),[he,be]=(0,le.useState)(null),xe=gv(gm(da,{activationConstraint:{distance:8}}),gm(Ll,{activationConstraint:{delay:200,tolerance:5}})),[Xe,Ue]=(0,le.useState)(n);(0,le.useEffect)(()=>{n&&Ue(n)},[n?.id]);let U=(n?Xe:void 0)??k.views[0]??Jn;(0,le.useEffect)(()=>{V(U.sorts.map(w=>({id:w.columnId,desc:w.direction==="desc"})))},[U.id]);let ze=(0,le.useMemo)(()=>{let w=n?U.columnOrder:void 0;if(!w||w.length===0)return k.schema;let L=new Map(k.schema.map(ge=>[ge.id,ge])),T=w.flatMap(ge=>L.has(ge)?[L.get(ge)]:[]),W=k.schema.filter(ge=>!w.includes(ge.id));return[...T,...W]},[n,U.columnOrder,k.schema]),Te=(0,le.useCallback)(async w=>{if(o)Ue(w),await o(w);else{if(!e)return;let L={...k,views:k.views.map((T,W)=>W===0?w:T)};D(L),await t.writeConfig(e,L)}},[o,k,e,t]),ft=(0,le.useRef)(g),st=(0,le.useCallback)(async(w,L,T)=>{let W=ft.current[w];if(!W)return;y(et=>et.map(nt=>nt._file.path===W._file.path?{...nt,[L]:T}:nt)),await a((async()=>{if(L==="_title")await t.renameNote(W._file,String(T));else{await t.updateNoteField(W._file,L,T,W._inlineFields);let et=k.schema.find(nt=>nt.id===L);if(et?.type==="relation"&&et.pairedColumnId){let nt=W[L],Pn=Array.isArray(nt)?nt.map(Tt=>`${Tt}`):typeof nt=="string"&&nt!==""?[nt]:[],tn=Array.isArray(T)?T.map(Tt=>`${Tt}`):typeof T=="string"&&T!==""?[T]:[];await t.syncTwoWayRelation(W._file,et,Pn,tn)}}})())},[t,k.schema,a]),yt=(0,le.useCallback)(async w=>{if(!e)return;let L={...k,schema:w};D(L),await t.writeConfig(e,L)},[e,k,t]),Ot=(0,le.useCallback)((w,L)=>{let T=k.schema.find(ge=>ge.id===w);if(!T)return!0;let W=ES(g,w,T.type,L);return W?(new rb.Notice(`${u("validate_type_change_prefix")}${W}`,6e3),!1):!0},[k.schema,g]),Vt=(0,le.useCallback)(async w=>{let L=p===w?null:w;f(L),await Te({...U,pinnedColumnId:L})},[p,Te,U]),Dt=(0,le.useCallback)(async w=>{V(w.map(L=>({id:L.columnId,desc:L.direction==="desc"}))),await Te({...U,sorts:w})},[U,Te]),an=(0,le.useCallback)(w=>{let L=U.sorts.find(W=>W.columnId===w),T;L?L.direction==="asc"?T=U.sorts.map(W=>W.columnId===w?{...W,direction:"desc"}:W):T=U.sorts.filter(W=>W.columnId!==w):T=[...U.sorts,{columnId:w,direction:"asc"}],Dt(T)},[U.sorts,Dt]),Wn=(0,le.useCallback)(async(w,L)=>{await Te({...U,columnWidths:{...U.columnWidths,[w]:L}})},[U,Te]),ka=(0,le.useCallback)(async w=>{let L=Oe.current;if(!L)return;let T=60;L.querySelectorAll(`[data-col-id="${w}"]`).forEach(W=>{T=Math.max(T,W.scrollWidth)}),await Wn(w,T+16)},[Wn]),Si=(0,le.useMemo)(()=>{let w=new Map,L=40,T=U.columnWidths._title??260;if(w.set("_select",{left:0,isLast:!1}),!p||(w.set("_title",{left:L,isLast:p==="_title"}),p==="_title"))return w;let W=L+T;for(let ge of k.schema.filter(et=>et.visible)){let et=U.columnWidths[ge.id]??ge.width??150;if(w.set(ge.id,{left:W,isLast:ge.id===p}),W+=et,ge.id===p)break}return w},[p,k]),Sa=(0,le.useCallback)(async(w,L)=>{if(!e)return;let T=await t.renameColumn(e,k,w,L);D(T)},[e,k,t]),er=(0,le.useMemo)(()=>{let w=[];if(w.push({id:"_select",size:40,enableSorting:!1,enableColumnFilter:!1,header:()=>null,cell:({row:T})=>(0,C.jsx)("div",{className:"nb-cell-checkbox-wrapper",onClick:T.getToggleSelectedHandler(),children:(0,C.jsx)("div",{className:`nb-cell-checkbox-custom${T.getIsSelected()?" nb-cell-checkbox-custom--checked":""}`,children:T.getIsSelected()&&(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-cell-check-icon",children:(0,C.jsx)("polyline",{points:"20 6 9 17 4 12"})})})})}),U.includeSubfolders&&!U.hiddenColumns.includes("_folder")){let T=e?.parent?.path??"",W=T.split("/").pop()||T||"";w.push({id:"_folder",accessorFn:ge=>{let et=ge._file.parent?.path??"";return et.length>T.length?et.slice(T.length+1):W},size:U.columnWidths._folder??150,enableColumnFilter:!0,enableSorting:!0,sortingFn:"text",header:()=>(0,C.jsx)("div",{className:"nb-header-title",children:(0,C.jsx)("span",{children:u("folder_column")})}),cell:ge=>(0,C.jsxs)("span",{className:"nb-folder-path nb-folder-path--cell",children:[ge.getValue(),"/"]})})}w.push({id:"_title",accessorFn:T=>T._title,size:U.columnWidths._title??260,enableColumnFilter:!0,enableSorting:!0,sortingFn:"text",header:({column:T})=>{let W=T.getIsSorted();return(0,C.jsxs)("div",{className:"nb-header-title",children:[(0,C.jsx)("span",{children:"\u{1F4C4}"}),(0,C.jsx)("span",{children:u("name_column")}),(0,C.jsxs)("button",{className:`nb-sort-btn ${W?"nb-sort-btn--sorted":""}`,onClick:ge=>{ge.stopPropagation(),an("_title")},title:W==="asc"?u("sort_asc_title"):W==="desc"?u("sort_desc_title"):u("sort_none_title"),children:[(0,C.jsx)("span",{className:W==="asc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2303"}),(0,C.jsx)("span",{className:W==="desc"?"nb-sort-chevron--active":"nb-sort-chevron",children:"\u2304"})]})]})},cell:T=>{let W=e?.parent?.path??"",ge=T.row.original._file.parent?.path??"",et=U.includeSubfolders&&ge.length>W.length?ge.slice(W.length+1):"";return(0,C.jsxs)("div",{children:[(0,C.jsx)(Rm,{col:{id:"_title",name:"Nome",type:"title",visible:!0},value:T.getValue(),rowIndex:T.row.index,columnId:"_title",file:T.row.original._file}),et&&(0,C.jsx)("div",{className:"nb-folder-path",children:et})]})}});let L=ze.filter(T=>T.visible&&!U.hiddenColumns.includes(T.id));for(let T of L)w.push({id:T.id,accessorFn:W=>W[T.id],size:U.columnWidths[T.id]??T.width??150,enableColumnFilter:T.type!=="formula"&&T.type!=="lookup"&&T.type!=="relation",enableSorting:T.type!=="formula"&&T.type!=="lookup"&&T.type!=="relation"&&T.type!=="multiselect",sortingFn:OS(T.type),header:()=>(0,C.jsx)(Gv,{col:T,schema:k.schema,onUpdateSchema:yt,onRenameColumn:Sa,onChangeType:W=>Ot(T.id,W),manager:t,dbFile:e}),cell:W=>(0,C.jsx)(Rm,{col:T,value:W.getValue(),rowIndex:W.row.index,columnId:T.id})});return w},[k,ze,U,yt,Sa,Ot,t,e]),ho=(0,le.useMemo)(()=>{if(b.length===0)return g;let w=[],L=[];for(let T of b)T.conjunction==="or"&&L.length>0&&(w.push(L),L=[]),L.push(T);return L.length>0&&w.push(L),g.filter(T=>w.some(W=>W.every(ge=>AS(T,ge))))},[g,b]),Mn=(0,le.useMemo)(()=>Qu(k.schema,e?.path??""),[k.schema,e?.path]),tr=(0,le.useMemo)(()=>Mn?Zu(ho,Mn.id,U.sorts,se,te):null,[ho,Mn,U.sorts,se,te]),Ni=!Mn&&M.length===0&&(U.rowOrder?.length??0)>0,nr=(0,le.useMemo)(()=>tr?tr.map(w=>w.row):Ni?Vv(ho,U.rowOrder):ho,[tr,ho,Ni,U.rowOrder]),Vl=(0,le.useMemo)(()=>{if(!tr)return null;let w=new Map;for(let L of tr)w.set(L.row._file.path,L);return w},[tr]),xi=t.pageSize>0,Na=(0,le.useMemo)(()=>{if(!xi||!X)return nr;let w=X.toLowerCase();return nr.filter(L=>Object.entries(L).some(([T,W])=>T==="_file"||T==="_inlineFields"||W==null?!1:typeof W=="string"?W.toLowerCase().includes(w):typeof W=="number"||typeof W=="boolean"?String(W).toLowerCase().includes(w):Array.isArray(W)?W.some(ge=>typeof ge=="string"&&ge.toLowerCase().includes(w)):!1))},[nr,X,xi]),{pageItems:Bl,currentPage:Gn,totalPages:jl,setPage:uc}=ba(Na,t.pageSize);ft.current=Bl;let Bt=Kh({data:Bl,columns:er,state:{sorting:M,globalFilter:xi?"":X,rowSelection:Ie},onSortingChange:V,onGlobalFilterChange:H,onRowSelectionChange:ot,enableRowSelection:!0,getCoreRowModel:Wh(),getSortedRowModel:Mn||Ni?void 0:qh(),getFilteredRowModel:xi?void 0:Gh(),manualSorting:!!Mn||Ni,meta:{updateCell:st,editingCell:O,setEditingCell:J,schema:k.schema}}),cc=!Mn&&M.length===0,Hl=(0,le.useCallback)(w=>{Q(w)},[]),xa=(0,le.useCallback)(w=>{be(w)},[]),dc=(0,le.useCallback)(()=>{Q(null),be(null)},[]),pc=(0,le.useCallback)(w=>{if(!S||S===w){Q(null),be(null);return}let L=nr.map(nt=>nt._file.path),T=L.indexOf(S),W=L.indexOf(w);if(T===-1||W===-1)return;let ge=[...L],[et]=ge.splice(T,1);ge.splice(W,0,et),Te({...U,rowOrder:ge}),Q(null),be(null)},[S,nr,U,Te]),Ul=async()=>{if(!e)return;let w=await t.createNoteWithTemplate(e);l.current=w.path},Wl=(0,le.useCallback)(async w=>{if(!e||!Mn)return;let L=await t.createNoteWithTemplate(e,{[Mn.id]:[w]});l.current=L.path},[e,Mn,t]),mc=(0,le.useCallback)(w=>{oe(L=>{let T=new Set(L);return T.has(w)?T.delete(w):T.add(w),T})},[]);(0,le.useEffect)(()=>{if(!ue)return;let w=L=>{_e.current?.contains(L.target)||$e.current&&!$e.current.contains(L.target)&&Se(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[ue]),(0,le.useEffect)(()=>{if(!Ge)return;let w=L=>{_e.current?.contains(L.target)||R.current&&!R.current.contains(L.target)&&ye(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[Ge]),(0,le.useEffect)(()=>{if(!Ae)return;let w=L=>{_e.current?.contains(L.target)||G.current&&!G.current.contains(L.target)&&Ne(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[Ae]),(0,le.useEffect)(()=>{if(!it)return;let w=L=>{let T=L.target,W=document.querySelector(".nb-agg-dropdown"),ge=document.querySelector(`[data-agg-col="${it}"]`);!W?.contains(T)&&!ge?.contains(T)&&Je(null)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[it]),(0,le.useEffect)(()=>{if(!j)return;let w=L=>{De.current?.contains(L.target)||ne.current&&!ne.current.contains(L.target)&&re(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[j]);let or=(0,le.useCallback)(()=>Bt.getSelectedRowModel().rows.map(w=>w.original._file),[Bt]),Gl=(0,le.useCallback)(async()=>{let w=or();w.length!==0&&(await t.deleteNotes(w),ot({}),ye(!1))},[or,t]),Ra=(0,le.useCallback)(()=>{let w=or();if(w.length===0)return;new Yu(r,T=>{t.moveNotes(w,T.path),ot({})}).open(),ye(!1)},[r,or,t]),ql=(0,le.useCallback)(async()=>{let w=or();w.length!==0&&(await t.duplicateNotes(w),ot({}),ye(!1))},[or,t]),Ea=(0,le.useCallback)(()=>{let w=ze.filter(tn=>tn.visible&&!U.hiddenColumns.includes(tn.id)),L=tn=>{let Tt=tn==null?"":String(tn);return Tt.includes(",")||Tt.includes('"')||Tt.includes(`
`)?'"'+Tt.replace(/"/g,'""')+'"':Tt},T=["Nome",...w.map(tn=>tn.name)],W=ho.map(tn=>[tn._title,...w.map(Fo=>{let Yt=tn[Fo.id];return Array.isArray(Yt)?Yt.join(";"):Yt})].map(L).join(",")),ge=[T.join(","),...W].join(`
`),et=new Blob([ge],{type:"text/csv;charset=utf-8;"}),nt=URL.createObjectURL(et),Pn=document.createElement("a");Pn.href=nt,Pn.download=(e?.parent?.name||r.vault.getName()||"database")+".csv",Pn.click(),URL.revokeObjectURL(nt),ye(!1)},[ze,U.hiddenColumns,ho,e,r]),Kl=(0,le.useCallback)(async w=>{let L=w.target.files?.[0];if(!L||!e)return;let W=(await L.text()).split(/\r?\n/).filter(Tt=>Tt.trim()!=="");if(W.length<2)return;let ge=Tt=>{let Fo=[],Yt="",zo=!1;for(let Vo=0;Vo<Tt.length;Vo++){let Ri=Tt[Vo];Ri==='"'?zo&&Tt[Vo+1]==='"'?(Yt+='"',Vo++):zo=!zo:Ri===","&&!zo?(Fo.push(Yt),Yt=""):Yt+=Ri}return Fo.push(Yt),Fo},et=ge(W[0]).map(Tt=>Tt.trim().toLowerCase()),nt=new Map,Pn=new Set;et.forEach((Tt,Fo)=>{if(Tt==="nome"||Tt==="title"||Tt==="name")return;let Yt=k.schema.find(zo=>zo.name.toLowerCase()===Tt);Yt&&!Pn.has(Yt.id)&&(nt.set(Fo,{id:Yt.id,type:Yt.type}),Pn.add(Yt.id))});let tn=et.findIndex(Tt=>Tt==="nome"||Tt==="title"||Tt==="name");for(let Tt of W.slice(1)){let Fo=ge(Tt),Yt=tn>=0?Fo[tn]?.trim():"";if(Yt&&g.some(Vo=>Vo._title===Yt))continue;let zo=await t.createNote(e);Yt&&await t.renameNote(zo,Yt);for(let[Vo,Ri]of nt){let yc=Fo[Vo]?.trim()??"";if(!yc)continue;let Kb=Ri.type==="multiselect"?yc.split(";").map(Yb=>Yb.trim()):yc;await t.updateNoteField(zo,Ri.id,Kb)}}w.target.value="",ye(!1)},[e,k.schema,t,r]);(0,le.useEffect)(()=>{if(!Ft)return;let w=L=>{_e.current?.contains(L.target)||we.current&&!we.current.contains(L.target)&&P(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[Ft]),(0,le.useEffect)(()=>{if(!ae)return;let w=L=>{qe.current&&!qe.current.contains(L.target)&&je(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[ae]),(0,le.useEffect)(()=>{if(!A){cn(null);return}let w=Me.current[A];if(!w)return;let L=w.getBoundingClientRect();cn({top:L.bottom+6,left:L.left})},[A]),(0,le.useEffect)(()=>{if(!A)return;let w=L=>{let T=Me.current[A],W=Fe.current,ge=T&&T.contains(L.target),et=W&&W.contains(L.target);!ge&&!et&&ee(null)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[A]),(0,le.useEffect)(()=>{if(!mt)return;let w=L=>{let T=Jt.current[mt];T&&!T.contains(L.target)&&dn(null)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[mt]);let Hr=FS,rr=(0,le.useCallback)(async w=>{let L=w.map(T=>({id:T.id,columnId:T.columnId,operator:T.operator,value:T.value,conjunction:T.conjunction}));await Te({...U,activePills:L})},[Te,U]),fc=w=>{let{active:L,over:T}=w;if(!T||L.id===T.id)return;let W=b.findIndex(nt=>nt.id===L.id),ge=b.findIndex(nt=>nt.id===T.id),et=pa(b,W,ge);_(et),rr(et)},Ur=(w,L,T,W)=>{let ge=crypto.randomUUID(),et=[...b,{id:ge,columnId:w,columnName:L,columnType:W,icon:T,operator:IS(W),value:"",conjunction:"and"}];_(et),rr(et),P(!1)},Fa=w=>{let L=b.filter(T=>T.id!==w);_(L),rr(L),A===w&&ee(null),mt===w&&dn(null)},gc=async w=>{await Te({...U,rowHeight:w}),Ne(!1)},_c=async()=>{await Te({...U,wrapText:!U.wrapText})},Yl=async()=>{await Te({...U,includeSubfolders:!U.includeSubfolders})},hc=async(w,L)=>{let T={...U.aggregations??{},[w]:L};await Te({...U,aggregations:T}),Je(null)},vc=(w,L)=>{if(L==="none")return"";let T=ho.map(nt=>w==="_title"?nt._title:nt[w]),W=ho.length;if(L==="count")return`${W} ${W===1?u("row_singular").toLowerCase():u("row_plural").toLowerCase()}`;let ge=T.filter(nt=>nt!=null&&String(nt).trim()!=="");if(L==="count_values")return`${ge.length} preenchido${ge.length!==1?"s":""}`;let et=ge.map(nt=>parseFloat(String(nt))).filter(nt=>!isNaN(nt));return et.length===0?"\u2014":L==="sum"?String(Math.round(et.reduce((nt,Pn)=>nt+Pn,0)*1e10)/1e10):L==="avg"?String(Math.round(et.reduce((nt,Pn)=>nt+Pn,0)/et.length*1e10)/1e10):L==="min"?String(Math.min(...et)):L==="max"?String(Math.max(...et)):""},bc={none:u("agg_none"),count:"",count_values:"",sum:u("agg_sum"),avg:u("agg_avg"),min:u("agg_min"),max:u("agg_max")},Wr=(w,L,T)=>{let W=b.map(ge=>ge.id===w?{...ge,operator:L,value:T}:ge);_(W),rr(W)},Xl=w=>{let L=b.map(T=>T.id===w?{...T,conjunction:T.conjunction==="and"?"or":"and"}:T);_(L),rr(L)},E=b.length>=3||b.some(w=>w.columnName.length>10);(0,le.useEffect)(()=>{E||(x(!1),Y.current&&clearTimeout(Y.current))},[E]),(0,le.useEffect)(()=>()=>{Y.current&&clearTimeout(Y.current)},[]);let ke=()=>{Y.current&&(clearTimeout(Y.current),Y.current=null)},Ce=()=>{ke(),Y.current=setTimeout(()=>x(!1),6e3)},gt=()=>{x(!0),Ce(),requestAnimationFrame(()=>N.current?.focus())},wt=()=>{ke(),x(!1)},ir=(0,le.useCallback)(async w=>{if(n){let L=U.hiddenColumns.includes(w)?U.hiddenColumns.filter(T=>T!==w):[...U.hiddenColumns,w];await Te({...U,hiddenColumns:L})}else{let L=k.schema.map(T=>T.id===w?{...T,visible:!T.visible}:T);await yt(L)}},[n,U,Te,k.schema,yt]),Wb=(0,le.useCallback)(async w=>{let{active:L,over:T}=w;if(!T||L.id===T.id)return;let W=ze.findIndex(et=>et.id===L.id),ge=ze.findIndex(et=>et.id===T.id);if(!(W===-1||ge===-1))if(n){let et=pa(ze,W,ge).map(nt=>nt.id);await Te({...U,columnOrder:et})}else await yt(pa(k.schema,W,ge))},[ze,n,U,Te,k.schema,yt]),Gb=async()=>{let L={id:`campo_${Date.now()}`,name:u("new_field"),type:"text",visible:!0,width:150};await yt([...k.schema,L])},Ql=Cn();if(!e)return(0,C.jsxs)("div",{className:"nb-empty-state",children:[(0,C.jsx)("p",{children:u("no_database_open")}),(0,C.jsx)("p",{children:u("no_database_hint")})]});if(h)return(0,C.jsx)("div",{className:"nb-loading",children:u("loading")});let Da=Bt.getRowModel().rows,Ta=w=>{w!=="fields"&&Se(!1),w!=="actions"&&ye(!1),w!=="filter"&&P(!1),w!=="sort"&&re(!1)},qb=Ql?(0,C.jsxs)(Un,{actionBarRef:_e,search:{value:Ve,onChange:H},actions:[{id:"fields",label:u("fields"),icon:(0,C.jsx)(kn,{}),active:ue,badge:k.schema.filter(w=>!w.visible).length||void 0,onClick:()=>{Ta("fields"),Se(w=>!w)}},{id:"actions",label:u("actions"),icon:(0,C.jsx)(Jv,{}),active:Ge,badge:Bt.getSelectedRowModel().rows.length||void 0,onClick:()=>{Ta("actions"),ye(w=>!w)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,C.jsx)(Hn,{}),active:!!U.includeSubfolders,onClick:()=>{Ta(),Yl()}},{id:"sort",label:u("sort"),icon:(0,C.jsx)(go,{}),active:U.sorts.length>0,badge:U.sorts.length||void 0,onClick:()=>{Ta("sort"),!j&&De.current&&de(De.current.getBoundingClientRect()),re(w=>!w)}},{id:"filter",label:u("filter"),icon:(0,C.jsx)(jn,{}),active:Ft,badge:b.length||void 0,onClick:()=>{Ta("filter"),P(w=>!w)}}],rowCount:Da.length,rowCountLabel:Da.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:b,onFilterUpdate:Wr,onFilterRemove:Fa,onConjunctionToggle:Xl,children:[(0,C.jsx)(dt,{open:ue,onClose:()=>Se(!1),title:u("fields"),children:k.schema.map(w=>(0,C.jsxs)("label",{className:"nb-field-row",children:[(0,C.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:n?w.visible&&!U.hiddenColumns.includes(w.id):w.visible,onChange:()=>{ir(w.id)}}),(0,C.jsx)("span",{className:"nb-field-icon",children:Hr(w.type)}),(0,C.jsx)("span",{className:"nb-field-name",children:w.name})]},w.id))}),(0,C.jsxs)(dt,{open:Ge,onClose:()=>ye(!1),title:u("actions"),children:[(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Gl()},disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,C.jsx)("span",{children:u("delete_selected")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:Ra,disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C1}"}),(0,C.jsx)("span",{children:u("move_selected")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{ql()},disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,C.jsx)("span",{children:u("duplicate_selected")})]}),(0,C.jsx)("div",{className:"nb-menu-separator"}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:Ea,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B07"}),(0,C.jsx)("span",{children:u("export_csv")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>me.current?.click(),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B06"}),(0,C.jsx)("span",{children:u("import_csv")})]}),(0,C.jsx)("input",{ref:me,type:"file",accept:".csv",style:{display:"none"},onChange:w=>{Kl(w)}})]}),(0,C.jsxs)(dt,{open:Ft,onClose:()=>P(!1),title:u("filter"),children:[(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ur("_title","Nome","\u{1F4C4}","title"),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,C.jsx)("span",{children:u("name_column")})]}),k.schema.map(w=>(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ur(w.id,w.name,Hr(w.type),w.type),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:Hr(w.type)}),(0,C.jsx)("span",{children:w.name})]},w.id))]}),(0,C.jsxs)(dt,{open:j,onClose:()=>re(!1),title:u("sort"),children:[U.sorts.length===0&&(0,C.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),U.sorts.map((w,L)=>{let T=w.columnId==="_title"?"Nome":k.schema.find(W=>W.id===w.columnId)?.name??w.columnId;return(0,C.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,C.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,C.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let W=[...U.sorts];L>0&&([W[L],W[L-1]]=[W[L-1],W[L]],Dt(W))},disabled:L===0,children:"\u2191"}),(0,C.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let W=[...U.sorts];L<W.length-1&&([W[L],W[L+1]]=[W[L+1],W[L]],Dt(W))},disabled:L===U.sorts.length-1,children:"\u2193"})]}),(0,C.jsx)("span",{style:{flex:1},children:T}),(0,C.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{Dt(U.sorts.map(W=>W.columnId===w.columnId?{...W,direction:W.direction==="asc"?"desc":"asc"}:W))},children:w.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,C.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{Dt(U.sorts.filter(W=>W.columnId!==w.columnId))},children:"\xD7"})]},w.columnId)}),(()=>{let w=k.schema.filter(W=>W.type!=="formula"&&W.type!=="lookup"&&W.type!=="relation"&&W.type!=="multiselect"),L=new Set(U.sorts.map(W=>W.columnId)),T=[...L.has("_title")?[]:[{id:"_title",name:"Nome"}],...w.filter(W=>!L.has(W.id)).map(W=>({id:W.id,name:W.name}))];return T.length===0?null:(0,C.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:W=>{W.target.value&&(Dt([...U.sorts,{columnId:W.target.value,direction:"asc"}]),W.target.value="")},children:[(0,C.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),T.map(W=>(0,C.jsx)("option",{value:W.id,children:W.name},W.id))]})})()]})]}):null;return(0,C.jsxs)("div",{className:"nb-container",children:[qb||(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("div",{className:"nb-toolbar",children:[(0,C.jsxs)("div",{className:`nb-search-container${E?en?" nb-search-container--expanded":" nb-search-container--collapsed":""}`,children:[E&&(0,C.jsx)("button",{className:"nb-search-icon-btn",onClick:gt,title:"Buscar",children:(0,C.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,C.jsx)("line",{x1:"21",y1:"21",x2:"16.65",y2:"16.65"})]})}),(0,C.jsx)("input",{ref:N,className:"nb-search",type:"text",placeholder:u("relation_search_placeholder"),value:Ve,onChange:w=>{H(w.target.value),E&&en&&Ce()},onKeyDown:w=>{w.key==="Enter"&&E&&en&&wt()},onBlur:()=>{E&&en&&wt()}})]}),(0,C.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:G,children:[(0,C.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${Ae?"nb-toolbar-btn--active":""}`,onClick:()=>Ne(w=>!w),title:u("row_height_label"),children:(0,C.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("line",{x1:"21",y1:"10",x2:"3",y2:"10"}),(0,C.jsx)("line",{x1:"21",y1:"6",x2:"3",y2:"6"}),(0,C.jsx)("line",{x1:"21",y1:"14",x2:"3",y2:"14"}),(0,C.jsx)("line",{x1:"21",y1:"18",x2:"3",y2:"18"})]})}),Ae&&(0,C.jsxs)("div",{className:"nb-fields-dropdown nb-rowheight-dropdown",children:[(0,C.jsx)("div",{className:"nb-fields-dropdown-label",children:u("row_height_label")}),["compact","medium","tall"].map(w=>(0,C.jsxs)("button",{className:`nb-menu-item ${(U.rowHeight??"medium")===w?"nb-menu-item--active":""}`,onClick:()=>{gc(w)},children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:w==="compact"?"\u25A4":w==="medium"?"\u25A5":"\u25A6"}),(0,C.jsx)("span",{children:w==="compact"?u("height_compact"):w==="medium"?u("height_medium"):u("height_tall")})]},w))]})]}),(0,C.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${U.wrapText?"nb-toolbar-btn--active":""}`,onClick:()=>{_c()},title:u("tooltip_wrap_text"),children:(0,C.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("path",{d:"M3 18h12a3 3 0 0 0 0-6h-3"}),(0,C.jsx)("polyline",{points:"9 15 6 18 9 21"})]})}),(0,C.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${U.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{Yl()},title:u("tooltip_include_subfolders"),children:(0,C.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,C.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,C.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,C.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:$e,children:[(0,C.jsxs)("button",{className:`nb-toolbar-btn ${ue?"nb-toolbar-btn--active":""}`,onClick:()=>Se(w=>!w),title:u("tooltip_manage_fields"),children:[u("fields")," ",k.schema.some(w=>!w.visible)&&(0,C.jsx)("span",{className:"nb-hidden-badge",children:k.schema.filter(w=>!w.visible).length})]}),ue&&(0,C.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,C.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),k.schema.map(w=>(0,C.jsxs)("label",{className:"nb-field-row",children:[(0,C.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:n?w.visible&&!U.hiddenColumns.includes(w.id):w.visible,onChange:()=>{ir(w.id)}}),(0,C.jsx)("span",{className:"nb-field-icon",children:w.type==="text"?"Aa":w.type==="number"?"#":w.type==="select"?"\u25C9":w.type==="multiselect"?"\u25C8":w.type==="date"?"\u{1F4C5}":w.type==="checkbox"?"\u2611":w.type==="lookup"?"\u2197":w.type==="relation"?"\u{1F517}":w.type==="formula"?"\u0192":"\xB7"}),(0,C.jsx)("span",{className:"nb-field-name",children:w.name})]},w.id))]})]}),(0,C.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:R,children:[(0,C.jsxs)("button",{className:`nb-toolbar-btn ${Ge?"nb-toolbar-btn--active":""}`,onClick:()=>ye(w=>!w),title:u("tooltip_batch_actions"),children:[u("actions"),Bt.getSelectedRowModel().rows.length>0&&(0,C.jsx)("span",{className:"nb-hidden-badge",children:Bt.getSelectedRowModel().rows.length})]}),Ge&&(0,C.jsxs)("div",{className:"nb-fields-dropdown nb-actions-dropdown",children:[(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Gl()},disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,C.jsx)("span",{children:u("delete_selected")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:Ra,disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C1}"}),(0,C.jsx)("span",{children:u("move_selected")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{ql()},disabled:Bt.getSelectedRowModel().rows.length===0,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,C.jsx)("span",{children:u("duplicate_selected")})]}),(0,C.jsx)("div",{className:"nb-menu-separator"}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:Ea,children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B07"}),(0,C.jsx)("span",{children:u("export_csv")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>me.current?.click(),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u2B06"}),(0,C.jsx)("span",{children:u("import_csv")})]}),(0,C.jsx)("input",{ref:me,type:"file",accept:".csv",style:{display:"none"},onChange:w=>{Kl(w)}})]})]}),(0,C.jsxs)("span",{className:"nb-row-count",children:[Da.length," ",Da.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,C.jsx)(Or,{status:i}),(0,C.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:we,style:{marginLeft:"auto"},children:[(0,C.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${Ft?"nb-toolbar-btn--active":""}`,onClick:()=>P(w=>!w),title:u("filters"),children:[(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,C.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),b.length>0&&(0,C.jsx)("span",{className:"nb-hidden-badge",children:b.length})]}),Ft&&(0,C.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,C.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ur("_title","Nome","\u{1F4C4}","title"),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,C.jsx)("span",{children:u("name_column")})]}),k.schema.map(w=>(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ur(w.id,w.name,Hr(w.type),w.type),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:Hr(w.type)}),(0,C.jsx)("span",{children:w.name})]},w.id)),(0,C.jsx)("div",{className:"nb-menu-separator"}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>P(!1),children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u26A1"}),(0,C.jsx)("span",{children:u("add_filter_advanced")})]})]})]}),(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)("button",{ref:De,className:`nb-toolbar-btn${U.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!j&&De.current&&de(De.current.getBoundingClientRect()),re(w=>!w)},children:[(0,C.jsx)("span",{children:u("sort")}),U.sorts.length>0&&(0,C.jsx)("span",{className:"nb-hidden-badge",children:U.sorts.length})]}),j&&ce&&(0,C.jsx)($S,{sorts:U.sorts,schema:k.schema,onSortChange:w=>{Dt(w)},onClose:()=>re(!1),anchorRect:ce,panelRef:ne})]}),(0,C.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:qe,children:[(0,C.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${(U.conditionalFormats?.length??0)>0?" nb-toolbar-btn--active":""}`,onClick:()=>je(w=>!w),title:u("conditional_formatting"),children:[(0,C.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,C.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,C.jsx)("path",{d:"M3 9h18"}),(0,C.jsx)("path",{d:"M3 15h18"}),(0,C.jsx)("path",{d:"M9 3v18"})]}),(U.conditionalFormats?.length??0)>0&&(0,C.jsx)("span",{className:"nb-hidden-badge",children:U.conditionalFormats.length})]}),ae&&(0,C.jsx)($r,{rules:U.conditionalFormats??[],schema:k.schema,onChange:w=>{Te({...U,conditionalFormats:w})},onClose:()=>je(!1)})]})]}),b.length>0&&!(E&&en)&&(0,C.jsxs)("div",{className:`nb-pills-row${U.filtersCollapsed?" nb-filter-pills-row--collapsed":""}`,children:[!U.filtersCollapsed&&(0,C.jsx)(hm,{sensors:xe,collisionDetection:_m,onDragStart:()=>ee(null),onDragEnd:fc,children:(0,C.jsx)(bm,{items:b.map(w=>w.id),strategy:vm,children:b.map((w,L)=>(0,C.jsxs)(le.Fragment,{children:[L>0&&(0,C.jsx)("button",{className:`nb-pill-conjunction ${w.conjunction==="or"?"nb-pill-conjunction--or":""}`,onClick:()=>Xl(w.id),title:"Clique para alternar entre E / OU",children:w.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,C.jsx)(VS,{filter:w,isActive:A===w.id,onToggle:()=>ee(T=>T===w.id?null:w.id),onRemove:()=>Fa(w.id),btnRef:T=>{Me.current[w.id]=T}})]},w.id))})}),U.filtersCollapsed&&(0,C.jsx)("span",{className:"nb-filter-pills-collapsed-label",children:b.length===1?u("filters_count_one"):u("filters_count_other").replace("{n}",String(b.length))}),(0,C.jsx)("button",{className:"nb-filter-pills-toggle",onClick:()=>{Te({...U,filtersCollapsed:!U.filtersCollapsed})},title:U.filtersCollapsed?u("show_filters"):u("hide_filters"),children:(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:U.filtersCollapsed?(0,C.jsx)("polyline",{points:"6 9 12 15 18 9"}):(0,C.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]}),(()=>{let w=b.find(L=>L.id===A);return!w||!bt||U.filtersCollapsed?null:(0,Ju.createPortal)((0,C.jsxs)("div",{ref:Fe,className:"nb-filter-pill-dropdown",style:{position:"fixed",top:bt.top,left:bt.left,zIndex:1e3},children:[(0,C.jsxs)("div",{className:"nb-filter-query-row",children:[(0,C.jsx)("span",{className:"nb-filter-query-name",children:w.columnName}),(0,C.jsxs)("div",{className:"nb-filter-op-wrapper",ref:L=>{Jt.current[w.id]=L},children:[(0,C.jsxs)("button",{className:`nb-filter-op-btn ${mt===w.id?"nb-filter-op-btn--open":""}`,onClick:L=>{L.stopPropagation(),dn(T=>T===w.id?null:w.id)},children:[ob[w.operator],(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,C.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),mt===w.id&&(0,C.jsx)("div",{className:"nb-filter-op-dropdown",children:LS(w.columnType).map(L=>(0,C.jsx)("button",{className:`nb-menu-item ${w.operator===L?"nb-menu-item--active":""}`,onClick:T=>{T.stopPropagation(),Wr(w.id,L,""),dn(null)},children:ob[L]},L))})]}),(0,C.jsx)("button",{className:"nb-filter-query-clear",onClick:L=>{L.stopPropagation(),Fa(w.id)},title:u("tooltip_remove_filter"),children:"\xD7"})]}),!ib.has(w.operator)&&(_a(w)?(0,C.jsx)("div",{className:"nb-filter-multi-select",children:(()=>{let T=k.schema.find(ge=>ge.id===w.columnId)?.options??[],W=_i(w.value);return T.length>0?T.map(ge=>(0,C.jsxs)("label",{className:"nb-filter-multi-option",children:[(0,C.jsx)("input",{type:"checkbox",checked:W.includes(ge.value),onChange:()=>Wr(w.id,w.operator,Uu(w.value,ge.value))}),(0,C.jsx)("span",{className:"nb-filter-option-badge",style:ge.color?{backgroundColor:ge.color}:void 0,children:ge.value})]},ge.value)):(0,C.jsx)("input",{className:"nb-filter-value-input",type:"text",placeholder:u("filter_value_placeholder"),value:w.value,autoFocus:!Ql,onChange:ge=>Wr(w.id,w.operator,ge.target.value)})})()}):(0,C.jsx)("input",{className:"nb-filter-value-input",type:w.columnType==="number"?"number":w.columnType==="date"?"date":"text",placeholder:w.columnType==="number"?u("filter_number_placeholder"):w.columnType==="date"?"":u("filter_value_placeholder"),value:w.value,autoFocus:!Ql,onChange:L=>Wr(w.id,w.operator,L.target.value)}))]}),document.body)})()]}),(0,C.jsxs)(xm.Provider,{value:{editingCell:O,setEditingCell:J,updateCell:st,schema:k.schema,relationOptions:s,updateSchema:yt},children:[(0,C.jsx)("div",{ref:vt,className:`nb-table-wrapper${U.wrapText?" nb-table--wrap":""}`,style:{"--nb-row-height":U.rowHeight==="compact"?"28px":U.rowHeight==="tall"?"64px":"36px"},children:(0,C.jsxs)("table",{ref:Oe,className:"nb-table",children:[(0,C.jsx)("thead",{className:"nb-thead",children:Bt.getHeaderGroups().map(w=>{let L=ze.filter(T=>T.visible&&!U.hiddenColumns.includes(T.id)).map(T=>T.id);return(0,C.jsx)(hm,{sensors:xe,collisionDetection:_m,onDragEnd:T=>{Wb(T)},children:(0,C.jsx)(bm,{items:L,strategy:vm,children:(0,C.jsxs)("tr",{className:"nb-header-row",children:[w.headers.map(T=>{let W=Si.get(T.id);return T.id==="_select"?(0,C.jsx)("th",{className:"nb-th nb-th-select nb-th--sticky",style:{width:T.getSize(),left:0,zIndex:3},children:(0,C.jsx)("div",{className:"nb-cell-checkbox-wrapper",onClick:Bt.getToggleAllRowsSelectedHandler(),children:(0,C.jsx)("div",{className:`nb-cell-checkbox-custom${Bt.getIsAllRowsSelected()?" nb-cell-checkbox-custom--checked":""}${Bt.getIsSomeRowsSelected()&&!Bt.getIsAllRowsSelected()?" nb-cell-checkbox-custom--indeterminate":""}`,children:(Bt.getIsAllRowsSelected()||Bt.getIsSomeRowsSelected())&&(0,C.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"white",strokeWidth:"3.5",strokeLinecap:"round",strokeLinejoin:"round",className:"nb-cell-check-icon",children:Bt.getIsAllRowsSelected()?(0,C.jsx)("polyline",{points:"20 6 9 17 4 12"}):(0,C.jsx)("line",{x1:"6",y1:"12",x2:"18",y2:"12"})})})})},T.id):T.id==="_title"?(0,C.jsxs)("th",{"data-col-id":"_title",className:["nb-th",W?"nb-th--sticky":"",W?.isLast?"nb-th--sticky-last":""].filter(Boolean).join(" "),style:{width:T.getSize(),...W?{left:W.left,zIndex:3}:{}},children:[(0,C.jsxs)("div",{className:"nb-th-inner-title",children:[(0,C.jsx)("div",{style:{flex:1},children:aa(T.column.columnDef.header,T.getContext())}),(0,C.jsx)("button",{className:`nb-pin-btn${p==="_title"?" nb-pin-btn--active":""}`,onClick:()=>{Vt("_title")},title:p==="_title"?u("tooltip_unpin_column"):u("tooltip_pin_column"),children:"\u{1F4CC}"})]}),(0,C.jsx)(ab,{onResize:ge=>{Wn("_title",ge)},onAutoFit:()=>{ka("_title")}})]},T.id):(0,C.jsx)(zS,{id:T.id,size:T.getSize(),stickyLeft:W?.left,isLastPinned:W?.isLast,isPinned:p===T.id,onTogglePin:()=>{Vt(T.id)},sorted:T.column.getCanSort()?T.column.getIsSorted():void 0,onToggleSort:T.column.getCanSort()?()=>an(T.id):void 0,onResize:ge=>{Wn(T.id,ge)},onAutoFit:()=>{ka(T.id)},children:aa(T.column.columnDef.header,T.getContext())},T.id)}),(0,C.jsx)("th",{className:"nb-th nb-th-add-col",children:(0,C.jsx)("button",{className:"nb-add-col-btn",onClick:()=>{Gb()},title:u("add_field"),children:"+"})})]})})},w.id)})}),(0,C.jsx)(RS,{scrollRef:vt,rowHeight:U.rowHeight==="compact"?28:U.rowHeight==="tall"?64:36,rows:Da,stickyMap:Si,isMobile:Ql,setEditingCell:J,setContextMenuFile:Le,longPressRef:Be,columns:er,onAddRow:()=>{Ul()},hierarchyMap:Vl,onToggleExpand:mc,onAddSubRow:w=>{Wl(w)},expandedSet:se,allExpanded:te,rowDragEnabled:cc,dragOverPath:he,onRowDragStart:Hl,onRowDragOver:xa,onRowDragEnd:dc,onRowDrop:pc,conditionalFormats:U.conditionalFormats,schema:k.schema}),(0,C.jsx)("tfoot",{className:"nb-tfoot",children:(0,C.jsxs)("tr",{children:[(0,C.jsx)("td",{className:"nb-td nb-agg-td nb-td--sticky",style:{left:0,zIndex:1,width:40}}),Bt.getVisibleLeafColumns().filter(w=>w.id!=="_select").map(w=>{let L=Si.get(w.id),T=(U.aggregations??{})[w.id]??"none",W=vc(w.id,T);return(0,C.jsxs)("td",{"data-agg-col":w.id,className:["nb-td","nb-agg-td",L?"nb-td--sticky":"",L?.isLast?"nb-td--sticky-last":""].filter(Boolean).join(" "),style:{width:w.getSize(),...L?{left:L.left,zIndex:1}:{}},onClick:()=>Je(ge=>ge===w.id?null:w.id),children:[T!=="none"?(0,C.jsxs)("div",{className:"nb-agg-cell",children:[(0,C.jsx)("span",{className:"nb-agg-label",children:bc[T]}),(0,C.jsx)("span",{className:"nb-agg-value",children:W})]}):(0,C.jsx)("div",{className:"nb-agg-empty"}),it===w.id&&(0,Ju.createPortal)((0,C.jsx)(jS,{colType:k.schema.find(ge=>ge.id===w.id)?.type??"text",current:T,onSelect:ge=>{hc(w.id,ge)},anchorEl:document.querySelector(`[data-agg-col="${w.id}"]`)}),document.body)]},w.id)}),(0,C.jsx)("td",{className:"nb-td nb-agg-td nb-td-empty"})]})})]})}),(0,C.jsxs)("div",{className:"nb-row-count-bar",children:[(()=>{let w=g.length,L=Na.length;return L!==w?(0,C.jsxs)("span",{className:"nb-row-count",children:[L," de ",w," ",w!==1?u("record_plural").toLowerCase():u("record_singular").toLowerCase()]}):(0,C.jsxs)("span",{className:"nb-row-count",children:[w," ",w!==1?u("record_plural").toLowerCase():u("record_singular").toLowerCase()]})})(),(0,C.jsx)(va,{currentPage:Gn,totalPages:jl,onPageChange:uc})]})]}),(0,C.jsxs)(dt,{open:Ee!==null,onClose:()=>Le(null),title:Ee?.basename??"",children:[(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Ee&&r.workspace.getLeaf().openFile(Ee),Le(null)},children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,C.jsx)("span",{children:u("open_note")})]}),(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Ee&&t.duplicateNotes([Ee]),Le(null)},children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,C.jsx)("span",{children:u("duplicate_note")})]}),Mn&&Ee&&(Vl?.get(Ee.path)?.depth??0)<3&&(0,C.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Wl(Ee.basename),Le(null)},children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u21B3"}),(0,C.jsx)("span",{children:u("add_subrow")})]}),(0,C.jsx)("div",{className:"nb-menu-separator"}),(0,C.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{Ee&&t.deleteNotes([Ee]),Le(null)},children:[(0,C.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,C.jsx)("span",{children:u("delete_note")})]})]})]})}var rt=Re(xt(),1),sb=Re(uo(),1);var Sn=Re(xt(),1),lb=Re(uo(),1);var Nt=Re(St(),1);function _o({activeFilters:e,schema:t,onUpdate:n,onRemove:o,onToggleConjunction:r,collapsed:i=!1,onToggleCollapsed:a}){let l=Cn(),[s,d]=(0,Sn.useState)(null),[p,f]=(0,Sn.useState)(null),[m,c]=(0,Sn.useState)(null),v=(0,Sn.useRef)({}),h=(0,Sn.useRef)({}),b=(0,Sn.useRef)(null);(0,Sn.useLayoutEffect)(()=>{if(!s){c(null);return}let g=v.current[s];if(!g)return;let y=g.getBoundingClientRect();c({top:y.bottom+4,left:y.left})},[s]),(0,Sn.useEffect)(()=>{if(!s)return;let g=y=>{let k=v.current[s],D=y.target,M=k?.contains(D),V=b.current?.contains(D);!M&&!V&&d(null)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[s]),(0,Sn.useEffect)(()=>{if(!p)return;let g=y=>{let k=h.current[p];k&&!k.contains(y.target)&&f(null)};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[p]),(0,Sn.useEffect)(()=>{e.find(g=>g.id===s)||d(null)},[e,s]);let _=e.find(g=>g.id===s);return(0,Nt.jsxs)(Nt.Fragment,{children:[e.length>0&&(0,Nt.jsxs)("div",{className:`nb-filter-pills-row${i?" nb-filter-pills-row--collapsed":""}`,children:[!i&&e.map((g,y)=>(0,Nt.jsxs)(Sn.Fragment,{children:[y>0&&(0,Nt.jsx)("button",{className:`nb-pill-conjunction${g.conjunction==="or"?" nb-pill-conjunction--or":""}`,onClick:()=>r(g.id),title:"Clique para alternar entre E / OU",children:g.conjunction==="or"?u("conjunction_or"):u("conjunction_and")}),(0,Nt.jsxs)("button",{ref:k=>{v.current[g.id]=k},className:`nb-filter-pill ${s===g.id?"nb-filter-pill--active":""}`,onClick:()=>d(k=>k===g.id?null:g.id),children:[(0,Nt.jsx)("span",{className:"nb-filter-pill-icon",children:g.icon}),(0,Nt.jsx)("span",{className:"nb-filter-pill-name",children:g.columnName}),(0,Nt.jsx)("span",{className:"nb-filter-pill-remove",onClick:k=>{k.stopPropagation(),o(g.id)},title:u("tooltip_remove_filter"),children:"\xD7"})]})]},g.id)),i&&(0,Nt.jsx)("span",{className:"nb-filter-pills-collapsed-label",children:e.length===1?u("filters_count_one"):u("filters_count_other").replace("{n}",String(e.length))}),a&&(0,Nt.jsx)("button",{className:"nb-filter-pills-toggle",onClick:a,title:i?u("show_filters"):u("hide_filters"),children:(0,Nt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:i?(0,Nt.jsx)("polyline",{points:"6 9 12 15 18 9"}):(0,Nt.jsx)("polyline",{points:"18 15 12 9 6 15"})})})]}),_&&!i&&m&&(0,lb.createPortal)((0,Nt.jsxs)("div",{ref:b,className:"nb-filter-pill-dropdown",style:{position:"fixed",top:m.top,left:m.left,zIndex:1e3},children:[(0,Nt.jsxs)("div",{className:"nb-filter-query-row",children:[(0,Nt.jsx)("span",{className:"nb-filter-query-name",children:_.columnName}),(0,Nt.jsxs)("div",{className:"nb-filter-op-wrapper",ref:g=>{h.current[_.id]=g},children:[(0,Nt.jsxs)("button",{className:`nb-filter-op-btn ${p===_.id?"nb-filter-op-btn--open":""}`,onClick:g=>{g.stopPropagation(),f(y=>y===_.id?null:_.id)},children:[Tr[_.operator],(0,Nt.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",children:(0,Nt.jsx)("polyline",{points:"6 9 12 15 18 9"})})]}),p===_.id&&(0,Nt.jsx)("div",{className:"nb-filter-op-dropdown",children:ga(_.columnType).map(g=>(0,Nt.jsx)("button",{className:`nb-menu-item ${_.operator===g?"nb-menu-item--active":""}`,onClick:y=>{y.stopPropagation(),n(_.id,g,""),f(null)},children:Tr[g]},g))})]}),(0,Nt.jsx)("button",{className:"nb-filter-query-clear",onClick:g=>{g.stopPropagation(),o(_.id)},title:u("tooltip_remove_filter"),children:"\xD7"})]}),!Mr.has(_.operator)&&(_a(_)?(0,Nt.jsx)("div",{className:"nb-filter-multi-select",children:(()=>{let y=t.find(D=>D.id===_.columnId)?.options??[],k=_i(_.value);return y.length>0?y.map(D=>(0,Nt.jsxs)("label",{className:"nb-filter-multi-option",children:[(0,Nt.jsx)("input",{type:"checkbox",checked:k.includes(D.value),onChange:()=>n(_.id,_.operator,Uu(_.value,D.value))}),(0,Nt.jsx)("span",{className:"nb-filter-option-badge",style:D.color?{backgroundColor:D.color}:void 0,children:D.value})]},D.value)):(0,Nt.jsx)("input",{className:"nb-filter-value-input",type:"text",placeholder:u("filter_value_placeholder"),value:_.value,autoFocus:!l,onChange:D=>n(_.id,_.operator,D.target.value)})})()}):(0,Nt.jsx)("input",{className:"nb-filter-value-input",type:_.columnType==="number"?"number":_.columnType==="date"?"date":"text",placeholder:_.columnType==="number"?u("filter_number_placeholder"):_.columnType==="date"?"":u("filter_value_placeholder"),value:_.value,autoFocus:!l,onChange:g=>n(_.id,_.operator,g.target.value)}))]}),document.body)]})}var Z=Re(St(),1);function HS({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[a,l]=(0,rt.useState)({x:r.right-280,y:r.bottom+4}),s=c=>{c.preventDefault();let v=c.clientX-a.x,h=c.clientY-a.y,b=g=>l({x:g.clientX-v,y:g.clientY-h}),_=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",_)},d=t.filter(c=>c.type!=="formula"&&c.type!=="lookup"&&c.type!=="relation"&&c.type!=="multiselect"),p=new Set(e.map(c=>c.columnId)),f=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...d.filter(c=>!p.has(c.id)).map(c=>({id:c.id,name:c.name}))],m=(c,v)=>{let h=[...e],b=c+v;b<0||b>=h.length||([h[c],h[b]]=[h[b],h[c]],n(h))};return(0,sb.createPortal)((0,Z.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:a.y,left:a.x},children:[(0,Z.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,Z.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,Z.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,Z.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((c,v)=>{let h=c.columnId==="_title"?"Nome":t.find(b=>b.id===c.columnId)?.name??c.columnId;return(0,Z.jsxs)("div",{className:"nb-sort-row",children:[(0,Z.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,Z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,Z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,Z.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,Z.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(b=>b.columnId===c.columnId?{...b,direction:b.direction==="asc"?"desc":"asc"}:b)),children:c.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,Z.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(b=>b.columnId!==c.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},c.columnId)}),f.length>0&&(0,Z.jsx)("div",{className:"nb-sort-add-row",children:(0,Z.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:c=>{c.target.value&&(n([...e,{columnId:c.target.value,direction:"asc"}]),c.target.value="")},children:[(0,Z.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),f.map(c=>(0,Z.jsx)("option",{value:c.id,children:c.name},c.id))]})})]}),document.body)}var US=rt.default.memo(function({row:t,depth:n,hasChildren:o,isExpanded:r,isHierarchical:i,visibleCols:a,dbFolderPath:l,includeSubfolders:s,onOpen:d,onToggleExpand:p,isMobile:f,onLongPress:m,onContextMenu:c,longPressRef:v,cardStyle:h}){let b=t._file.parent?.path??"",_=s&&b.length>l.length?b.slice(l.length+1):"";return(0,Z.jsxs)("div",{className:"nb-list-row",style:{...i?{paddingLeft:`${n*20+12}px`}:{},...h},onClick:()=>d(t._file),onContextMenu:f?void 0:g=>{g.preventDefault(),c(t._file)},onTouchStart:f?()=>{v.current=setTimeout(()=>m(t._file),500)}:void 0,onTouchMove:f?()=>{v.current&&(clearTimeout(v.current),v.current=null)}:void 0,onTouchEnd:f?()=>{v.current&&(clearTimeout(v.current),v.current=null)}:void 0,children:[o&&(0,Z.jsx)("button",{className:"nb-hierarchy-toggle",onClick:g=>{g.stopPropagation(),p(t._file.path)},children:r?"\u25BC":"\u25B6"}),(0,Z.jsx)("span",{className:"nb-list-row-icon",children:"\u{1F4C4}"}),(0,Z.jsx)("span",{className:"nb-list-row-title",children:t._title}),_?(0,Z.jsx)("span",{className:"nb-folder-path",style:{marginLeft:4},children:_}):null,a.length>0&&(0,Z.jsx)("div",{className:"nb-list-row-props",children:a.map(g=>{let y=t[g.id];if(y==null||String(y).trim()==="")return null;let k=Array.isArray(y)?y.join(", "):String(y);return(0,Z.jsxs)("span",{className:"nb-list-prop",children:[(0,Z.jsxs)("span",{className:"nb-list-prop-name",children:[g.name,":"]}),(0,Z.jsx)("span",{className:"nb-list-prop-value",children:k})]},g.id)})})]})});function ub({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{rows:i,config:a,loading:l,activeFilters:s,setActiveFilters:d}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,f]=(0,rt.useState)(n),[m,c]=(0,rt.useState)(!1),[v,h]=(0,rt.useState)(!1),[b,_]=(0,rt.useState)(!1),[g,y]=(0,rt.useState)(null),[k,D]=(0,rt.useState)(!1),M=(0,rt.useRef)(null),V=(0,rt.useRef)(null),j=(0,rt.useRef)(null),re=(0,rt.useRef)(null),ne=(0,rt.useRef)(null),ce=(0,rt.useRef)(null);(0,rt.useEffect)(()=>{f(n)},[n.id]);let de=(0,rt.useCallback)(async A=>{f(A),await o(A)},[o]);(0,rt.useEffect)(()=>{if(!m)return;let A=ee=>{ne.current?.contains(ee.target)||M.current&&!M.current.contains(ee.target)&&c(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[m]),(0,rt.useEffect)(()=>{if(!k)return;let A=ee=>{ce.current&&!ce.current.contains(ee.target)&&D(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[k]),(0,rt.useEffect)(()=>{if(!v)return;let A=ee=>{ne.current?.contains(ee.target)||V.current&&!V.current.contains(ee.target)&&h(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[v]),(0,rt.useEffect)(()=>{if(!b)return;let A=ee=>{ne.current?.contains(ee.target)||re.current?.contains(ee.target)||j.current&&!j.current.contains(ee.target)&&_(!1)};return document.addEventListener("mousedown",A),()=>document.removeEventListener("mousedown",A)},[b]);let De=(0,rt.useCallback)(async A=>{let ee=A.map(Me=>({id:Me.id,columnId:Me.columnId,operator:Me.operator,value:Me.value,conjunction:Me.conjunction}));await de({...p,activePills:ee})},[de,p]),Ve=(A,ee,Me,Fe)=>{let bt=[...s,{id:crypto.randomUUID(),columnId:A,columnName:ee,columnType:Fe,icon:Me,operator:Tn(Fe),value:"",conjunction:"and"}];d(bt),De(bt),c(!1)},H=A=>{let ee=s.filter(Me=>Me.id!==A);d(ee),De(ee)},X=(A,ee,Me)=>{let Fe=s.map(bt=>bt.id===A?{...bt,operator:ee,value:Me}:bt);d(Fe),De(Fe)},O=A=>{let ee=s.map(Me=>Me.id===A?{...Me,conjunction:Me.conjunction==="and"?"or":"and"}:Me);d(ee),De(ee)},J=(0,rt.useCallback)(async A=>{let ee=p.hiddenColumns.includes(A)?p.hiddenColumns.filter(Me=>Me!==A):[...p.hiddenColumns,A];await de({...p,hiddenColumns:ee})},[p,de]),ue=(0,rt.useCallback)(async A=>{await de({...p,sorts:A})},[p,de]),Se=async()=>{e&&await t.createNoteWithTemplate(e)},[$e,Ie]=(0,rt.useState)(new Set),[ot]=(0,rt.useState)(!0),Ge=(0,rt.useMemo)(()=>Qu(a.schema,e?.path??""),[a.schema,e?.path]),ye=(0,rt.useCallback)(A=>{Ie(ee=>{let Me=new Set(ee);return Me.has(A)?Me.delete(A):Me.add(A),Me})},[]),Ee=Bn(s,200),Le=(0,rt.useMemo)(()=>mo(i,Ee),[i,Ee]),Be=(0,rt.useMemo)(()=>to(Le,p.sorts),[Le,p.sorts]),Ae=(0,rt.useMemo)(()=>Ge?Zu(Be,Ge.id,p.sorts,$e,ot):null,[Be,Ge,p.sorts,$e,ot]),{pageItems:Ne,currentPage:it,totalPages:Je,setPage:R}=ba(Be,Ge?0:t.pageSize),G=(0,rt.useMemo)(()=>a.schema.filter(A=>A.visible&&!p.hiddenColumns.includes(A.id)),[a.schema,p.hiddenColumns]),me=Cn(),ae=e?.parent?.path??"",je=(0,rt.useCallback)(A=>{r.workspace.getLeaf().openFile(A)},[r]),[qe,_e]=(0,rt.useState)(null),Oe=(0,rt.useRef)(null),vt=(0,rt.useCallback)(A=>{_e(A)},[]),Ft=(0,rt.useCallback)(A=>{_e(A)},[]);if(!e)return(0,Z.jsx)("div",{className:"nb-empty-state",children:(0,Z.jsx)("p",{children:u("no_database_open")})});if(l)return(0,Z.jsx)("div",{className:"nb-loading",children:u("loading")});let P=A=>{A!=="fields"&&h(!1),A!=="filter"&&c(!1),A!=="sort"&&_(!1)},we=me?(0,Z.jsxs)(Un,{actionBarRef:ne,actions:[{id:"fields",label:u("fields"),icon:(0,Z.jsx)(kn,{}),active:v,onClick:()=>{P("fields"),h(A=>!A)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,Z.jsx)(Hn,{}),active:!!p.includeSubfolders,onClick:()=>{P(),de({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,Z.jsx)(go,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{P("sort"),!b&&re.current&&y(re.current.getBoundingClientRect()),_(A=>!A)}},{id:"filter",label:u("filter"),icon:(0,Z.jsx)(jn,{}),active:m,badge:s.length||void 0,onClick:()=>{P("filter"),c(A=>!A)}}],rowCount:Be.length,rowCountLabel:Be.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:s,onFilterUpdate:X,onFilterRemove:H,onConjunctionToggle:O,children:[(0,Z.jsx)(dt,{open:v,onClose:()=>h(!1),title:u("fields"),children:a.schema.map(A=>(0,Z.jsxs)("label",{className:"nb-field-row",children:[(0,Z.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:A.visible&&!p.hiddenColumns.includes(A.id),onChange:()=>{J(A.id)}}),(0,Z.jsx)("span",{className:"nb-field-icon",children:Qe(A.type)}),(0,Z.jsx)("span",{className:"nb-field-name",children:A.name})]},A.id))}),(0,Z.jsxs)(dt,{open:m,onClose:()=>c(!1),title:u("filter"),children:[(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ve("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Z.jsx)("span",{children:u("name_column")})]}),a.schema.map(A=>(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ve(A.id,A.name,Qe(A.type),A.type),children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:Qe(A.type)}),(0,Z.jsx)("span",{children:A.name})]},A.id))]}),(0,Z.jsxs)(dt,{open:b,onClose:()=>_(!1),title:u("sort"),children:[p.sorts.length===0&&(0,Z.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map((A,ee)=>{let Me=A.columnId==="_title"?"Nome":a.schema.find(Fe=>Fe.id===A.columnId)?.name??A.columnId;return(0,Z.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,Z.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,Z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let Fe=[...p.sorts];ee>0&&([Fe[ee],Fe[ee-1]]=[Fe[ee-1],Fe[ee]],ue(Fe))},disabled:ee===0,children:"\u2191"}),(0,Z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let Fe=[...p.sorts];ee<Fe.length-1&&([Fe[ee],Fe[ee+1]]=[Fe[ee+1],Fe[ee]],ue(Fe))},disabled:ee===p.sorts.length-1,children:"\u2193"})]}),(0,Z.jsx)("span",{style:{flex:1},children:Me}),(0,Z.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{ue(p.sorts.map(Fe=>Fe.columnId===A.columnId?{...Fe,direction:Fe.direction==="asc"?"desc":"asc"}:Fe))},children:A.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,Z.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{ue(p.sorts.filter(Fe=>Fe.columnId!==A.columnId))},children:"\xD7"})]},A.columnId)}),(()=>{let A=a.schema.filter(Fe=>Fe.type!=="formula"&&Fe.type!=="lookup"&&Fe.type!=="relation"&&Fe.type!=="multiselect"),ee=new Set(p.sorts.map(Fe=>Fe.columnId)),Me=[...ee.has("_title")?[]:[{id:"_title",name:"Nome"}],...A.filter(Fe=>!ee.has(Fe.id)).map(Fe=>({id:Fe.id,name:Fe.name}))];return Me.length===0?null:(0,Z.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:Fe=>{Fe.target.value&&(ue([...p.sorts,{columnId:Fe.target.value,direction:"asc"}]),Fe.target.value="")},children:[(0,Z.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),Me.map(Fe=>(0,Z.jsx)("option",{value:Fe.id,children:Fe.name},Fe.id))]})})()]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)("div",{className:"nb-toolbar",children:[(0,Z.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:V,children:[(0,Z.jsx)("button",{className:`nb-toolbar-btn ${v?"nb-toolbar-btn--active":""}`,onClick:()=>h(A=>!A),children:u("fields")}),v&&(0,Z.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,Z.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),a.schema.map(A=>(0,Z.jsxs)("label",{className:"nb-field-row",children:[(0,Z.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:A.visible&&!p.hiddenColumns.includes(A.id),onChange:()=>{J(A.id)}}),(0,Z.jsx)("span",{className:"nb-field-icon",children:Qe(A.type)}),(0,Z.jsx)("span",{className:"nb-field-name",children:A.name})]},A.id))]})]}),(0,Z.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{de({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,Z.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,Z.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,Z.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,Z.jsxs)("span",{className:"nb-row-count",children:[Be.length," ",Be.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,Z.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:M,style:{marginLeft:"auto"},children:[(0,Z.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${m?"nb-toolbar-btn--active":""}`,onClick:()=>c(A=>!A),title:u("filters"),children:[(0,Z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,Z.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,Z.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),m&&(0,Z.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,Z.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ve("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Z.jsx)("span",{children:u("name_column")})]}),a.schema.map(A=>(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>Ve(A.id,A.name,Qe(A.type),A.type),children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:Qe(A.type)}),(0,Z.jsx)("span",{children:A.name})]},A.id))]})]}),(0,Z.jsxs)("button",{ref:re,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!b&&re.current&&y(re.current.getBoundingClientRect()),_(A=>!A)},children:[(0,Z.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,Z.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),b&&g&&(0,Z.jsx)(HS,{sorts:p.sorts,schema:a.schema,onSortChange:A=>{ue(A)},onClose:()=>_(!1),anchorRect:g,panelRef:j}),(0,Z.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ce,children:[(0,Z.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${(p.conditionalFormats?.length??0)>0?" nb-toolbar-btn--active":""}`,onClick:()=>D(A=>!A),title:u("conditional_formatting"),children:[(0,Z.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,Z.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,Z.jsx)("path",{d:"M3 9h18"}),(0,Z.jsx)("path",{d:"M3 15h18"}),(0,Z.jsx)("path",{d:"M9 3v18"})]}),(p.conditionalFormats?.length??0)>0&&(0,Z.jsx)("span",{className:"nb-hidden-badge",children:p.conditionalFormats.length})]}),k&&(0,Z.jsx)($r,{rules:p.conditionalFormats??[],schema:a.schema,onChange:A=>{de({...p,conditionalFormats:A})},onClose:()=>D(!1)})]})]}),(0,Z.jsx)(_o,{activeFilters:s,schema:a.schema,onUpdate:X,onRemove:H,onToggleConjunction:O,collapsed:!!p.filtersCollapsed,onToggleCollapsed:()=>{de({...p,filtersCollapsed:!p.filtersCollapsed})}})]});return(0,Z.jsxs)("div",{className:"nb-container",children:[we,(0,Z.jsxs)("div",{className:"nb-list",children:[(Ae??Ne.map(A=>({row:A,depth:0,hasChildren:!1,parentTitle:null}))).map(({row:A,depth:ee,hasChildren:Me})=>{let Fe=ot?!$e.has(A._file.path):$e.has(A._file.path);return(0,Z.jsx)(US,{row:A,depth:ee,hasChildren:Me,isExpanded:Fe,isHierarchical:Ae!==null,visibleCols:G,dbFolderPath:ae,includeSubfolders:p.includeSubfolders??!1,onOpen:je,onToggleExpand:ye,isMobile:me,onLongPress:vt,onContextMenu:Ft,longPressRef:Oe,cardStyle:p.conditionalFormats?.length?ha(A,p.conditionalFormats,a.schema):void 0},A._file.path)}),(0,Z.jsx)("button",{className:"nb-add-row nb-list-add-row",onClick:()=>{Se()},children:"+ "+u("add_entry")})]}),(0,Z.jsx)(va,{currentPage:it,totalPages:Je,onPageChange:R}),(0,Z.jsxs)(dt,{open:qe!==null,onClose:()=>_e(null),title:qe?.basename??"",children:[(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>{qe&&r.workspace.getLeaf().openFile(qe),_e(null)},children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,Z.jsx)("span",{children:u("open_note")})]}),(0,Z.jsxs)("button",{className:"nb-menu-item",onClick:()=>{qe&&t.duplicateNotes([qe]),_e(null)},children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,Z.jsx)("span",{children:u("duplicate_note")})]}),(0,Z.jsx)("div",{className:"nb-menu-separator"}),(0,Z.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{qe&&t.deleteNotes([qe]),_e(null)},children:[(0,Z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,Z.jsx)("span",{children:u("delete_note")})]})]})]})}var He=Re(xt(),1);var K=Re(St(),1),ya="nb-card",ec="nb-column",WS=60,GS=30;function qS({children:e}){let t=(0,He.useRef)(null),[n,o]=(0,He.useState)(!1),r=(0,He.useRef)(WS);return(0,He.useEffect)(()=>{let i=t.current;if(!i)return;let a=new IntersectionObserver(([l])=>{l.isIntersecting&&(o(!0),a.disconnect())},{rootMargin:"200px 0px"});return a.observe(i),()=>a.disconnect()},[]),(0,He.useEffect)(()=>{n&&t.current&&(r.current=t.current.offsetHeight)},[n]),n?(0,K.jsx)("div",{ref:t,children:e}):(0,K.jsx)("div",{ref:t,style:{minHeight:r.current}})}var KS=He.default.memo(function({row:t,isMobile:n,visibleCols:o,dbFolderPath:r,includeSubfolders:i,onOpen:a,onDragStart:l,onTouchStart:s,onContextMenu:d,cardStyle:p}){let f=t._file.parent?.path??"",m=i&&f.length>r.length?f.slice(r.length+1):"";return(0,K.jsxs)("div",{className:"nb-board-card",style:p,draggable:!n,onDragStart:n?void 0:c=>{c.stopPropagation(),l?.(c,t._file.path)},onTouchStart:n?c=>s?.(c,t._file):void 0,onContextMenu:n?void 0:c=>{c.preventDefault(),d?.(c,t._file)},onClick:()=>a(t._file),children:[(0,K.jsx)("div",{className:"nb-board-card-title",children:t._title}),m?(0,K.jsx)("div",{className:"nb-folder-path",children:m}):null,o.length>0&&(0,K.jsx)("div",{className:"nb-board-card-props",children:o.map(c=>{let v=t[c.id];if(v==null||String(v).trim()==="")return null;let h=Array.isArray(v)?v.join(", "):String(v);return(0,K.jsxs)("span",{className:"nb-board-card-prop",children:[(0,K.jsxs)("span",{className:"nb-board-card-prop-name",children:[c.name,":"]}),(0,K.jsx)("span",{className:"nb-board-card-prop-value",children:h})]},c.id)})})]})});function cb({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{status:i,trackSave:a}=Vr(),{rows:l,config:s,loading:d,activeFilters:p,setActiveFilters:f}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[m,c]=(0,He.useState)(n),[v,h]=(0,He.useState)(!1),[b,_]=(0,He.useState)(!1),[g,y]=(0,He.useState)(null),[k,D]=(0,He.useState)(new Set),[M,V]=(0,He.useState)(!1),[j,re]=(0,He.useState)(!1),[ne,ce]=(0,He.useState)(!1),[de,De]=(0,He.useState)(!1),[Ve,H]=(0,He.useState)(null),[X,O]=(0,He.useState)(null),[J,ue]=(0,He.useState)(null),Se=(0,He.useRef)(null),$e=(0,He.useRef)(null),Ie=(0,He.useRef)(null),ot=(0,He.useRef)(null),Ge=(0,He.useRef)(null);(0,He.useEffect)(()=>{c(n)},[n.id]);let ye=(0,He.useCallback)(async N=>{c(N),await o(N)},[o]);(0,He.useEffect)(()=>{if(!M)return;let N=Y=>{Ge.current?.contains(Y.target)||Se.current&&!Se.current.contains(Y.target)&&V(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[M]),(0,He.useEffect)(()=>{if(!j)return;let N=Y=>{Ge.current?.contains(Y.target)||$e.current&&!$e.current.contains(Y.target)&&re(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[j]),(0,He.useEffect)(()=>{if(!ne)return;let N=Y=>{Ge.current?.contains(Y.target)||Ie.current&&!Ie.current.contains(Y.target)&&ce(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[ne]),(0,He.useEffect)(()=>{if(!de)return;let N=Y=>{ot.current&&!ot.current.contains(Y.target)&&De(!1)};return document.addEventListener("mousedown",N),()=>document.removeEventListener("mousedown",N)},[de]);let Ee=(0,He.useMemo)(()=>s.schema.filter(N=>N.type==="select"||N.type==="status"),[s.schema]),Le=(0,He.useMemo)(()=>s.schema.find(N=>N.id===m.groupByColumnId)??Ee[0]??null,[s.schema,m.groupByColumnId,Ee]),Be=Bn(p,200),Ae=(0,He.useMemo)(()=>mo(l,Be),[l,Be]),Ne=(0,He.useMemo)(()=>to(Ae,m.sorts),[Ae,m.sorts]),it=(0,He.useMemo)(()=>s.schema.filter(N=>N.id!==Le?.id&&N.type!=="title"&&N.visible&&!m.hiddenColumns.includes(N.id)),[s.schema,m.hiddenColumns,Le]),Je=[{value:u("status_not_started"),color:"#9E9E9E"},{value:u("status_in_progress"),color:"#2196F3"},{value:u("status_done"),color:"#4CAF50"},{value:u("status_cancelled"),color:"#F44336"}],R=(0,He.useMemo)(()=>{if(!Le)return[];let Y=[...(Le.type==="status"&&!Le.options?.length?Je:Le.options??[]).map(S=>({value:S.value,label:S.value,color:S.color,rows:Ne.filter(Q=>Q[Le.id]===S.value)})),{value:"",label:u("no_value"),color:void 0,rows:Ne.filter(S=>{let Q=S[Le.id];return Q==null||String(Q).trim()===""})}],se=m.boardColumnOrder,oe=Y;if(se&&se.length>0){let S=se.flatMap(he=>{let be=Y.find(xe=>xe.value===he);return be?[be]:[]}),Q=Y.filter(he=>!se.includes(he.value));oe=[...S,...Q]}let te=v?oe.filter(S=>S.rows.length>0):oe;return b&&(te=te.filter(S=>S.value!=="")),te},[Le,Ne,v,b,m.boardColumnOrder]),G=(0,He.useCallback)(async(N,Y)=>{if(!e||!Le)return;let se=r.vault.getFileByPath(N);se&&await a(r.fileManager.processFrontMatter(se,oe=>{Y===""?delete oe[Le.id]:oe[Le.id]=Y}))},[r,e,Le,a]),me=(0,He.useCallback)(async(N,Y)=>{if(N===Y)return;let se=R.map(Q=>Q.value),oe=se.indexOf(N),te=se.indexOf(Y);if(oe===-1||te===-1)return;let S=[...se];S.splice(oe,1),S.splice(te,0,N),await ye({...m,boardColumnOrder:S})},[R,m,ye]),ae=(0,He.useRef)(null),je=(0,He.useRef)(G);je.current=G;let qe=(0,He.useRef)(me);qe.current=me;let _e=(N,Y,se)=>{let oe=N.cloneNode(!0),te=N.getBoundingClientRect();return oe.style.cssText=`position:fixed;z-index:9999;pointer-events:none;opacity:0.85;width:${te.width}px;transform:rotate(2deg);box-shadow:0 8px 24px rgba(0,0,0,0.2);`,oe.style.left=`${Y-te.width/2}px`,oe.style.top=`${se-20}px`,document.body.appendChild(oe),oe},Oe=(0,He.useCallback)((N,Y)=>{let se=N.touches[0],oe=N.currentTarget,te=!1,S=null,Q=null,he=null,be=!1,xe=setTimeout(()=>{be=!0,U(),ue(Y)},500),Xe=ft=>{let st=ae.current;if(!st)return;let yt=st.getBoundingClientRect(),Ot=50,Vt=8,Dt=ft-yt.left<Ot,an=yt.right-ft<Ot;if(!Dt&&!an){he&&(clearInterval(he),he=null);return}if(he)return;let Wn=an?1:-1;he=setInterval(()=>{st.scrollLeft+=Wn*Vt},16)},Ue=()=>{he&&(clearInterval(he),he=null)},U=()=>{oe.removeEventListener("touchmove",ze),oe.removeEventListener("touchend",Te),oe.removeEventListener("touchcancel",Te)},ze=ft=>{let st=ft.touches[0];if(!te&&Math.abs(st.clientX-se.clientX)<12&&Math.abs(st.clientY-se.clientY)<12)return;clearTimeout(xe),ft.preventDefault(),ft.stopPropagation(),te||(te=!0,oe.classList.add("nb-touch-drag-source"),ae.current?.classList.add("nb-board--dragging"),Q=_e(oe,st.clientX,st.clientY)),Q&&(Q.style.left=`${st.clientX-Q.offsetWidth/2}px`,Q.style.top=`${st.clientY-20}px`),oe.classList.add("nb-touch-drag-hidden");let yt=document.elementFromPoint(st.clientX,st.clientY);oe.classList.remove("nb-touch-drag-hidden"),oe.classList.add("nb-touch-drag-source"),S=yt?.closest(".nb-board-column")?.dataset.colKey??null,H(S),Xe(st.clientX)},Te=()=>{clearTimeout(xe),Ue(),ae.current?.classList.remove("nb-board--dragging"),oe.classList.remove("nb-touch-drag-source","nb-touch-drag-hidden"),Q?.remove(),!be&&te&&S!==null&&je.current(Y.path,S),H(null),U()};oe.addEventListener("touchmove",ze,{passive:!1}),oe.addEventListener("touchend",Te),oe.addEventListener("touchcancel",Te)},[]),vt=(0,He.useCallback)((N,Y)=>{let se=N.touches[0],oe=N.currentTarget.closest(".nb-board-column");if(!oe)return;let te=!1,S=null,Q=null,he=null,be=U=>{let ze=ae.current;if(!ze)return;let Te=ze.getBoundingClientRect(),ft=50,st=8,yt=U-Te.left<ft,Ot=Te.right-U<ft;if(!yt&&!Ot){he&&(clearInterval(he),he=null);return}if(he)return;let Vt=Ot?1:-1;he=setInterval(()=>{ze.scrollLeft+=Vt*st},16)},xe=()=>{he&&(clearInterval(he),he=null)},Xe=U=>{let ze=U.touches[0];if(!te&&Math.abs(ze.clientX-se.clientX)<12&&Math.abs(ze.clientY-se.clientY)<12)return;U.preventDefault(),U.stopPropagation(),te||(te=!0,oe.classList.add("nb-touch-drag-source"),ae.current?.classList.add("nb-board--dragging"),Q=_e(oe,ze.clientX,ze.clientY)),Q&&(Q.style.left=`${ze.clientX-Q.offsetWidth/2}px`,Q.style.top=`${ze.clientY-20}px`),oe.classList.add("nb-touch-drag-hidden");let Te=document.elementFromPoint(ze.clientX,ze.clientY);oe.classList.remove("nb-touch-drag-hidden"),oe.classList.add("nb-touch-drag-source"),S=Te?.closest(".nb-board-column")?.dataset.colKey??null,O(S),be(ze.clientX)},Ue=()=>{xe(),ae.current?.classList.remove("nb-board--dragging"),oe.classList.remove("nb-touch-drag-source","nb-touch-drag-hidden"),Q?.remove(),te&&S!==null&&qe.current(Y,S),O(null),oe.removeEventListener("touchmove",Xe),oe.removeEventListener("touchend",Ue),oe.removeEventListener("touchcancel",Ue)};oe.addEventListener("touchmove",Xe,{passive:!1}),oe.addEventListener("touchend",Ue),oe.addEventListener("touchcancel",Ue)},[]),Ft=(0,He.useCallback)(async N=>{if(!e||!Le)return;let Y=await t.createNoteWithTemplate(e);N!==""&&await a(r.fileManager.processFrontMatter(Y,se=>{se[Le.id]=N}))},[r,e,t,Le,a]),P=(0,He.useCallback)(async N=>{let Y=N.map(se=>({id:se.id,columnId:se.columnId,operator:se.operator,value:se.value,conjunction:se.conjunction}));await ye({...m,activePills:Y})},[ye,m]),we=(N,Y,se,oe)=>{let te=[...p,{id:crypto.randomUUID(),columnId:N,columnName:Y,columnType:oe,icon:se,operator:Tn(oe),value:"",conjunction:"and"}];f(te),P(te),ce(!1)},A=N=>{let Y=p.filter(se=>se.id!==N);f(Y),P(Y)},ee=(N,Y,se)=>{let oe=p.map(te=>te.id===N?{...te,operator:Y,value:se}:te);f(oe),P(oe)},Me=N=>{let Y=p.map(se=>se.id===N?{...se,conjunction:se.conjunction==="and"?"or":"and"}:se);f(Y),P(Y)},Fe=(0,He.useCallback)(async N=>{let Y=m.hiddenColumns.includes(N)?m.hiddenColumns.filter(se=>se!==N):[...m.hiddenColumns,N];await ye({...m,hiddenColumns:Y})},[m,ye]),bt=Cn(),cn=e?.parent?.path??"",mt=(0,He.useCallback)(N=>{r.workspace.getLeaf().openFile(N)},[r]),dn=(0,He.useCallback)((N,Y)=>{N.dataTransfer.effectAllowed="move",N.dataTransfer.setData("nb-drag-type",ya),N.dataTransfer.setData("nb-row-path",Y),N.dataTransfer.setData(ya,"")},[]),Jt=(0,He.useCallback)((N,Y)=>{ue(Y)},[]);if(!e)return(0,K.jsx)("div",{className:"nb-empty-state",children:(0,K.jsx)("p",{children:u("no_database_open")})});if(d)return(0,K.jsx)("div",{className:"nb-loading",children:u("loading")});if(Ee.length===0)return(0,K.jsxs)("div",{className:"nb-empty-state",children:[(0,K.jsx)("p",{children:u("board_no_select_col")}),(0,K.jsx)("p",{children:u("board_add_select_hint")})]});let en=N=>{N!=="fields"&&V(!1),N!=="groupby"&&re(!1),N!=="filter"&&ce(!1)},x=bt?(0,K.jsxs)(Un,{actionBarRef:Ge,actions:[{id:"fields",label:u("fields"),icon:(0,K.jsx)(kn,{}),active:M,onClick:()=>{en("fields"),V(N=>!N)}},{id:"groupby",label:u("group_by"),icon:(0,K.jsx)(go,{}),active:j,onClick:()=>{en("groupby"),re(N=>!N)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,K.jsx)(Hn,{}),active:!!m.includeSubfolders,onClick:()=>{en(),ye({...m,includeSubfolders:!m.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,K.jsx)(jn,{}),active:ne,badge:p.length||void 0,onClick:()=>{en("filter"),ce(N=>!N)}}],rowCount:Ae.length,rowCountLabel:Ae.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:p,onFilterUpdate:ee,onFilterRemove:A,onConjunctionToggle:Me,children:[(0,K.jsx)(dt,{open:M,onClose:()=>V(!1),title:u("fields_in_card"),children:s.schema.filter(N=>N.id!==Le?.id&&N.type!=="title").map(N=>(0,K.jsxs)("label",{className:"nb-field-row",children:[(0,K.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:N.visible&&!m.hiddenColumns.includes(N.id),onChange:()=>{Fe(N.id)}}),(0,K.jsx)("span",{className:"nb-field-icon",children:Qe(N.type)}),(0,K.jsx)("span",{className:"nb-field-name",children:N.name})]},N.id))}),(0,K.jsx)(dt,{open:j,onClose:()=>re(!1),title:u("group_by"),children:Ee.map(N=>(0,K.jsxs)("button",{className:`nb-menu-item${m.groupByColumnId===N.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...m,groupByColumnId:N.id}),re(!1)},children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:Qe(N.type)}),(0,K.jsx)("span",{children:N.name})]},N.id))}),(0,K.jsxs)(dt,{open:ne,onClose:()=>ce(!1),title:u("filter"),children:[(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>we("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,K.jsx)("span",{children:u("name_column")})]}),s.schema.map(N=>(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>we(N.id,N.name,Qe(N.type),N.type),children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:Qe(N.type)}),(0,K.jsx)("span",{children:N.name})]},N.id))]}),(0,K.jsxs)("div",{className:"nb-mobile-toggles-row",children:[(0,K.jsxs)("label",{className:"nb-mobile-toggle",children:[(0,K.jsx)("input",{type:"checkbox",checked:v,onChange:N=>h(N.target.checked)}),(0,K.jsx)("span",{children:u("hide_empty_cols")})]}),(0,K.jsxs)("label",{className:"nb-mobile-toggle",children:[(0,K.jsx)("input",{type:"checkbox",checked:b,onChange:N=>_(N.target.checked)}),(0,K.jsx)("span",{children:u("hide_no_value_cols")})]})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)("div",{className:"nb-toolbar",children:[(0,K.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Se,children:[(0,K.jsx)("button",{className:`nb-toolbar-btn${M?" nb-toolbar-btn--active":""}`,onClick:()=>V(N=>!N),children:u("fields")}),M&&(0,K.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,K.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_in_card")}),s.schema.filter(N=>N.id!==Le?.id&&N.type!=="title").map(N=>(0,K.jsxs)("label",{className:"nb-field-row",children:[(0,K.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:N.visible&&!m.hiddenColumns.includes(N.id),onChange:()=>{Fe(N.id)}}),(0,K.jsx)("span",{className:"nb-field-icon",children:Qe(N.type)}),(0,K.jsx)("span",{className:"nb-field-name",children:N.name})]},N.id))]})]}),(0,K.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:$e,children:[(0,K.jsxs)("button",{className:`nb-toolbar-btn${j?" nb-toolbar-btn--active":""}`,onClick:()=>re(N=>!N),children:[u("group_by"),": ",(0,K.jsx)("strong",{children:Le?.name??"\u2014"})]}),j&&(0,K.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,K.jsx)("div",{className:"nb-fields-dropdown-label",children:u("group_by_label")}),Ee.map(N=>(0,K.jsxs)("button",{className:`nb-menu-item${m.groupByColumnId===N.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...m,groupByColumnId:N.id}),re(!1)},children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:Qe(N.type)}),(0,K.jsx)("span",{children:N.name})]},N.id))]})]}),(0,K.jsxs)("label",{className:"nb-toolbar-btn nb-toolbar-toggle",children:[(0,K.jsx)("input",{type:"checkbox",checked:v,onChange:N=>h(N.target.checked)}),u("hide_empty_cols")]}),(0,K.jsxs)("label",{className:"nb-toolbar-btn nb-toolbar-toggle",children:[(0,K.jsx)("input",{type:"checkbox",checked:b,onChange:N=>_(N.target.checked)}),u("hide_no_value_cols")]}),(0,K.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${m.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{ye({...m,includeSubfolders:!m.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,K.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,K.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,K.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,K.jsxs)("span",{className:"nb-row-count",children:[Ae.length," ",Ae.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,K.jsx)(Or,{status:i}),(0,K.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Ie,style:{marginLeft:"auto"},children:[(0,K.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${ne?" nb-toolbar-btn--active":""}`,onClick:()=>ce(N=>!N),title:u("filters"),children:[(0,K.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,K.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),p.length>0&&(0,K.jsx)("span",{className:"nb-hidden-badge",children:p.length})]}),ne&&(0,K.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,K.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>we("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,K.jsx)("span",{children:u("name_column")})]}),s.schema.map(N=>(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>we(N.id,N.name,Qe(N.type),N.type),children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:Qe(N.type)}),(0,K.jsx)("span",{children:N.name})]},N.id))]})]}),(0,K.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ot,children:[(0,K.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${(m.conditionalFormats?.length??0)>0?" nb-toolbar-btn--active":""}`,onClick:()=>De(N=>!N),title:u("conditional_formatting"),children:[(0,K.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,K.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,K.jsx)("path",{d:"M3 9h18"}),(0,K.jsx)("path",{d:"M3 15h18"}),(0,K.jsx)("path",{d:"M9 3v18"})]}),(m.conditionalFormats?.length??0)>0&&(0,K.jsx)("span",{className:"nb-hidden-badge",children:m.conditionalFormats.length})]}),de&&(0,K.jsx)($r,{rules:m.conditionalFormats??[],schema:s.schema,onChange:N=>{ye({...m,conditionalFormats:N})},onClose:()=>De(!1)})]})]}),(0,K.jsx)(_o,{activeFilters:p,schema:s.schema,onUpdate:ee,onRemove:A,onToggleConjunction:Me,collapsed:!!m.filtersCollapsed,onToggleCollapsed:()=>{ye({...m,filtersCollapsed:!m.filtersCollapsed})}})]});return(0,K.jsxs)("div",{className:"nb-container",children:[x,(0,K.jsx)("div",{className:"nb-board",ref:ae,children:R.map(N=>{let Y=N.value||"__no_value__";return(0,K.jsxs)("div",{"data-col-key":Y,className:`nb-board-column${Ve===Y?" nb-board-column--card-over":""}${X===Y?" nb-board-column--col-over":""}${(()=>{let te=m.boardColumnLimits?.[N.value];return te&&te>0&&N.rows.length>=te?" nb-board-column--over-limit":""})()}`,onDragOver:te=>{te.preventDefault(),(te.dataTransfer.types.includes(ya)?ya:ec)===ya?H(Y):O(Y)},onDragLeave:te=>{let S=te.relatedTarget;te.currentTarget.contains(S)||(H(null),O(null))},onDrop:async te=>{te.preventDefault(),H(null),O(null);let S=te.dataTransfer.getData("nb-drag-type");if(S===ya){let Q=te.dataTransfer.getData("nb-row-path");Q&&await G(Q,N.value)}else if(S===ec){let Q=te.dataTransfer.getData("nb-col-value");Q!==void 0&&await me(Q,N.value)}},children:[(0,K.jsxs)("div",{className:"nb-board-column-header",draggable:!bt,onDragStart:bt?void 0:te=>{te.stopPropagation(),te.dataTransfer.effectAllowed="move",te.dataTransfer.setData("nb-drag-type",ec),te.dataTransfer.setData("nb-col-value",N.value),te.dataTransfer.setData(ec,"")},onDragEnd:bt?void 0:()=>O(null),title:u("board_drag_reorder"),children:[(0,K.jsx)("span",{className:"nb-board-column-drag-handle",onTouchStart:bt?te=>vt(te,N.value):void 0,children:"\u283F"}),N.color?(0,K.jsx)("span",{className:"nb-board-column-badge",style:{background:N.color},children:N.label}):(0,K.jsx)("span",{className:"nb-board-column-name",children:N.label}),(()=>{let te=m.boardColumnLimits?.[N.value],S=N.rows.length,Q=te!==void 0&&te>0&&S>=te;return(0,K.jsx)("span",{className:`nb-board-column-count ${Q?"nb-board-column-count--over":""}`,onClick:he=>{he.stopPropagation(),y(g===N.value?null:N.value)},title:u("board_set_limit"),children:te&&te>0?`${S}/${te}`:S})})()]}),g===N.value&&(0,K.jsx)("div",{className:"nb-board-limit-input-wrapper",children:(0,K.jsx)("input",{className:"nb-board-limit-input",type:"number",min:"0",placeholder:u("board_limit_placeholder"),defaultValue:m.boardColumnLimits?.[N.value]??"",autoFocus:!0,onKeyDown:te=>{if(te.key==="Enter"||te.key==="Escape"){let S=parseInt(te.target.value),Q={...m.boardColumnLimits};isNaN(S)||S<=0?delete Q[N.value]:Q[N.value]=S,ye({...m,boardColumnLimits:Q}),y(null)}},onBlur:te=>{let S=parseInt(te.target.value),Q={...m.boardColumnLimits};isNaN(S)||S<=0?delete Q[N.value]:Q[N.value]=S,ye({...m,boardColumnLimits:Q}),y(null)}})}),(0,K.jsx)("div",{className:"nb-board-cards",children:(()=>{let te=m.boardColumnLimits?.[N.value],S=k.has(N.value),Q=te&&te>0&&!S?N.rows.slice(0,te):N.rows,he=N.rows.length-Q.length;return(0,K.jsxs)(K.Fragment,{children:[Q.map(be=>{let xe=Q.length>=GS,Xe=(0,K.jsx)(KS,{row:be,isMobile:bt,visibleCols:it,dbFolderPath:cn,includeSubfolders:m.includeSubfolders??!1,onOpen:mt,onDragStart:dn,onTouchStart:Oe,onContextMenu:Jt,cardStyle:m.conditionalFormats?.length?ha(be,m.conditionalFormats,s.schema):void 0},be._file.path);return xe?(0,K.jsx)(qS,{children:Xe},be._file.path):(0,K.jsx)(He.Fragment,{children:Xe},be._file.path)}),he>0&&(0,K.jsx)("button",{className:"nb-board-show-more",onClick:()=>D(be=>{let xe=new Set(be);return xe.add(N.value),xe}),children:`+${he} ${u("board_show_more")}`}),S&&te&&te>0&&N.rows.length>te&&(0,K.jsx)("button",{className:"nb-board-show-more",onClick:()=>D(be=>{let xe=new Set(be);return xe.delete(N.value),xe}),children:u("board_show_less")})]})})()}),(0,K.jsx)("button",{className:"nb-board-add-card",onClick:()=>{Ft(N.value)},children:"+ "+u("add_card")})]},Y)})}),(0,K.jsxs)(dt,{open:J!==null,onClose:()=>ue(null),title:J?.basename??"",children:[(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>{J&&r.workspace.getLeaf().openFile(J),ue(null)},children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,K.jsx)("span",{children:u("open_note")})]}),(0,K.jsxs)("button",{className:"nb-menu-item",onClick:()=>{J&&t.duplicateNotes([J]),ue(null)},children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,K.jsx)("span",{children:u("duplicate_note")})]}),(0,K.jsx)("div",{className:"nb-menu-separator"}),(0,K.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{J&&t.deleteNotes([J]),ue(null)},children:[(0,K.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,K.jsx)("span",{children:u("delete_note")})]})]})]})}var lt=Re(xt(),1),pb=Re(uo(),1);var q=Re(St(),1),db=()=>({small:u("size_small"),medium:u("size_medium"),large:u("size_large")}),YS={small:"repeat(auto-fill, minmax(160px, 1fr))",medium:"repeat(auto-fill, minmax(220px, 1fr))",large:"repeat(auto-fill, minmax(300px, 1fr))"};function XS({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[a,l]=(0,lt.useState)({x:r.right-280,y:r.bottom+4}),s=c=>{c.preventDefault();let v=c.clientX-a.x,h=c.clientY-a.y,b=g=>l({x:g.clientX-v,y:g.clientY-h}),_=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",_)},d=t.filter(c=>c.type!=="formula"&&c.type!=="lookup"&&c.type!=="relation"&&c.type!=="multiselect"),p=new Set(e.map(c=>c.columnId)),f=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...d.filter(c=>!p.has(c.id)).map(c=>({id:c.id,name:c.name}))],m=(c,v)=>{let h=[...e],b=c+v;b<0||b>=h.length||([h[c],h[b]]=[h[b],h[c]],n(h))};return(0,pb.createPortal)((0,q.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:a.y,left:a.x},children:[(0,q.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,q.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,q.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,q.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((c,v)=>{let h=c.columnId==="_title"?"Nome":t.find(b=>b.id===c.columnId)?.name??c.columnId;return(0,q.jsxs)("div",{className:"nb-sort-row",children:[(0,q.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,q.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,q.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,q.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,q.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(b=>b.columnId===c.columnId?{...b,direction:b.direction==="asc"?"desc":"asc"}:b)),children:c.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,q.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(b=>b.columnId!==c.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},c.columnId)}),f.length>0&&(0,q.jsx)("div",{className:"nb-sort-add-row",children:(0,q.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:c=>{c.target.value&&(n([...e,{columnId:c.target.value,direction:"asc"}]),c.target.value="")},children:[(0,q.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),f.map(c=>(0,q.jsx)("option",{value:c.id,children:c.name},c.id))]})})]}),document.body)}var QS=lt.default.memo(function({row:t,cardSize:n,coverField:o,visibleCols:r,dbFolderPath:i,includeSubfolders:a,onOpen:l,cardStyle:s}){let d=zt(),p=o?.type==="image"?t[o.id]??null:null,f=p?d.vault.getFileByPath(p):null,m=f?d.vault.getResourcePath(f):null,c=o&&o.type!=="image"?o.type==="title"?t._title:String(t[o.id]??""):null,v=t._file.parent?.path??"",h=a&&v.length>i.length?v.slice(i.length+1):"";return(0,q.jsxs)("div",{className:`nb-gallery-card nb-gallery-card--${n}`,style:s,onClick:()=>l(t._file),children:[m?(0,q.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--image",children:(0,q.jsx)("img",{src:m,alt:""})}):c?(0,q.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--text",children:(0,q.jsx)("span",{children:c})}):(0,q.jsx)("div",{className:"nb-gallery-cover nb-gallery-cover--empty",children:(0,q.jsx)("span",{className:"nb-gallery-cover-icon",children:"\u{1F4C4}"})}),(0,q.jsxs)("div",{className:"nb-gallery-body",children:[(0,q.jsx)("div",{className:"nb-gallery-title",children:t._title}),h?(0,q.jsx)("div",{className:"nb-folder-path",children:h}):null,r.length>0&&(0,q.jsx)("div",{className:"nb-gallery-props",children:r.map(b=>{let _=t[b.id];if(_==null||String(_).trim()==="")return null;let g=Array.isArray(_)?_.join(", "):String(_);return(0,q.jsxs)("span",{className:"nb-gallery-prop",children:[(0,q.jsxs)("span",{className:"nb-gallery-prop-name",children:[b.name,":"]}),(0,q.jsx)("span",{className:"nb-gallery-prop-value",children:g})]},b.id)})})]})]})});function mb({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{rows:i,config:a,loading:l,activeFilters:s,setActiveFilters:d}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,f]=(0,lt.useState)(n),[m,c]=(0,lt.useState)(!1),[v,h]=(0,lt.useState)(!1),[b,_]=(0,lt.useState)(!1),[g,y]=(0,lt.useState)(!1),[k,D]=(0,lt.useState)(!1),[M,V]=(0,lt.useState)(null),[j,re]=(0,lt.useState)(!1),ne=(0,lt.useRef)(null),ce=(0,lt.useRef)(null),de=(0,lt.useRef)(null),De=(0,lt.useRef)(null),Ve=(0,lt.useRef)(null),H=(0,lt.useRef)(null),X=(0,lt.useRef)(null),O=(0,lt.useRef)(null);(0,lt.useEffect)(()=>{f(n)},[n.id]);let J=(0,lt.useCallback)(async P=>{f(P),await o(P)},[o]);(0,lt.useEffect)(()=>{if(!m)return;let P=we=>{X.current?.contains(we.target)||ne.current&&!ne.current.contains(we.target)&&c(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[m]),(0,lt.useEffect)(()=>{if(!j)return;let P=we=>{O.current&&!O.current.contains(we.target)&&re(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[j]),(0,lt.useEffect)(()=>{if(!v)return;let P=we=>{X.current?.contains(we.target)||ce.current&&!ce.current.contains(we.target)&&h(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[v]),(0,lt.useEffect)(()=>{if(!b)return;let P=we=>{X.current?.contains(we.target)||de.current&&!de.current.contains(we.target)&&_(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[b]),(0,lt.useEffect)(()=>{if(!g)return;let P=we=>{X.current?.contains(we.target)||De.current&&!De.current.contains(we.target)&&y(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[g]),(0,lt.useEffect)(()=>{if(!k)return;let P=we=>{X.current?.contains(we.target)||H.current?.contains(we.target)||Ve.current&&!Ve.current.contains(we.target)&&D(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[k]);let ue=Bn(s,200),Se=(0,lt.useMemo)(()=>mo(i,ue),[i,ue]),$e=(0,lt.useMemo)(()=>to(Se,p.sorts),[Se,p.sorts]),{pageItems:Ie,currentPage:ot,totalPages:Ge,setPage:ye}=ba($e,t.pageSize),Ee=(0,lt.useMemo)(()=>a.schema.filter(P=>P.visible&&!p.hiddenColumns.includes(P.id)),[a.schema,p.hiddenColumns]),Le=(0,lt.useMemo)(()=>a.schema.find(P=>P.id===p.galleryCoverField)??null,[a.schema,p.galleryCoverField]),Be=p.galleryCardSize??"medium",Ae=YS[Be],Ne=(0,lt.useCallback)(async P=>{let we=P.map(A=>({id:A.id,columnId:A.columnId,operator:A.operator,value:A.value,conjunction:A.conjunction}));await J({...p,activePills:we})},[J,p]),it=(P,we,A,ee)=>{let Me=[...s,{id:crypto.randomUUID(),columnId:P,columnName:we,columnType:ee,icon:A,operator:Tn(ee),value:"",conjunction:"and"}];d(Me),Ne(Me),c(!1)},Je=P=>{let we=s.filter(A=>A.id!==P);d(we),Ne(we)},R=(P,we,A)=>{let ee=s.map(Me=>Me.id===P?{...Me,operator:we,value:A}:Me);d(ee),Ne(ee)},G=P=>{let we=s.map(A=>A.id===P?{...A,conjunction:A.conjunction==="and"?"or":"and"}:A);d(we),Ne(we)},me=(0,lt.useCallback)(async P=>{let we=p.hiddenColumns.includes(P)?p.hiddenColumns.filter(A=>A!==P):[...p.hiddenColumns,P];await J({...p,hiddenColumns:we})},[p,J]),ae=(0,lt.useCallback)(async P=>{await J({...p,sorts:P})},[p,J]),je=async()=>{e&&await t.createNoteWithTemplate(e)},qe=Cn(),_e=e?.parent?.path??"",Oe=(0,lt.useCallback)(P=>{r.workspace.getLeaf().openFile(P)},[r]);if(!e)return(0,q.jsx)("div",{className:"nb-empty-state",children:(0,q.jsx)("p",{children:u("no_database_open")})});if(l)return(0,q.jsx)("div",{className:"nb-loading",children:u("loading")});let vt=P=>{P!=="fields"&&h(!1),P!=="cover"&&_(!1),P!=="filter"&&c(!1),P!=="sort"&&D(!1)},Ft=qe?(0,q.jsxs)(Un,{actionBarRef:X,actions:[{id:"fields",label:u("fields"),icon:(0,q.jsx)(kn,{}),active:v,onClick:()=>{vt("fields"),h(P=>!P)}},{id:"cover",label:u("cover"),icon:(0,q.jsx)(kn,{}),active:b,onClick:()=>{vt("cover"),_(P=>!P)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,q.jsx)(Hn,{}),active:!!p.includeSubfolders,onClick:()=>{vt(),J({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,q.jsx)(go,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{vt("sort"),!k&&H.current&&V(H.current.getBoundingClientRect()),D(P=>!P)}},{id:"filter",label:u("filter"),icon:(0,q.jsx)(jn,{}),active:m,badge:s.length||void 0,onClick:()=>{vt("filter"),c(P=>!P)}}],rowCount:$e.length,rowCountLabel:$e.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:s,onFilterUpdate:R,onFilterRemove:Je,onConjunctionToggle:G,children:[(0,q.jsx)(dt,{open:v,onClose:()=>h(!1),title:u("fields"),children:a.schema.map(P=>(0,q.jsxs)("label",{className:"nb-field-row",children:[(0,q.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:P.visible&&!p.hiddenColumns.includes(P.id),onChange:()=>{me(P.id)}}),(0,q.jsx)("span",{className:"nb-field-icon",children:Qe(P.type)}),(0,q.jsx)("span",{className:"nb-field-name",children:P.name})]},P.id))}),(0,q.jsxs)(dt,{open:b,onClose:()=>_(!1),title:u("cover"),children:[(0,q.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField?"":" nb-menu-item--active"}`,onClick:()=>{J({...p,galleryCoverField:void 0}),_(!1)},children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,q.jsx)("span",{children:u("no_cover")})]}),a.schema.filter(P=>P.type==="text"||P.type==="title"||P.type==="image").map(P=>(0,q.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField===P.id?" nb-menu-item--active":""}`,onClick:()=>{J({...p,galleryCoverField:P.id}),_(!1)},children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:Qe(P.type)}),(0,q.jsx)("span",{children:P.name})]},P.id))]}),(0,q.jsxs)(dt,{open:m,onClose:()=>c(!1),title:u("filter"),children:[(0,q.jsxs)("button",{className:"nb-menu-item",onClick:()=>it("_title","Nome","\u{1F4C4}","title"),children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,q.jsx)("span",{children:u("name_column")})]}),a.schema.map(P=>(0,q.jsxs)("button",{className:"nb-menu-item",onClick:()=>it(P.id,P.name,Qe(P.type),P.type),children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:Qe(P.type)}),(0,q.jsx)("span",{children:P.name})]},P.id))]}),(0,q.jsxs)(dt,{open:k,onClose:()=>D(!1),title:u("sort"),children:[p.sorts.length===0&&(0,q.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map((P,we)=>{let A=P.columnId==="_title"?"Nome":a.schema.find(ee=>ee.id===P.columnId)?.name??P.columnId;return(0,q.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,q.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,q.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ee=[...p.sorts];we>0&&([ee[we],ee[we-1]]=[ee[we-1],ee[we]],ae(ee))},disabled:we===0,children:"\u2191"}),(0,q.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ee=[...p.sorts];we<ee.length-1&&([ee[we],ee[we+1]]=[ee[we+1],ee[we]],ae(ee))},disabled:we===p.sorts.length-1,children:"\u2193"})]}),(0,q.jsx)("span",{style:{flex:1},children:A}),(0,q.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{ae(p.sorts.map(ee=>ee.columnId===P.columnId?{...ee,direction:ee.direction==="asc"?"desc":"asc"}:ee))},children:P.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,q.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{ae(p.sorts.filter(ee=>ee.columnId!==P.columnId))},children:"\xD7"})]},P.columnId)}),(()=>{let P=a.schema.filter(ee=>ee.type!=="formula"&&ee.type!=="lookup"&&ee.type!=="relation"&&ee.type!=="multiselect"),we=new Set(p.sorts.map(ee=>ee.columnId)),A=[...we.has("_title")?[]:[{id:"_title",name:"Nome"}],...P.filter(ee=>!we.has(ee.id)).map(ee=>({id:ee.id,name:ee.name}))];return A.length===0?null:(0,q.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:ee=>{ee.target.value&&(ae([...p.sorts,{columnId:ee.target.value,direction:"asc"}]),ee.target.value="")},children:[(0,q.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),A.map(ee=>(0,q.jsx)("option",{value:ee.id,children:ee.name},ee.id))]})})()]})]}):(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)("div",{className:"nb-toolbar",children:[(0,q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ce,children:[(0,q.jsx)("button",{className:`nb-toolbar-btn${v?" nb-toolbar-btn--active":""}`,onClick:()=>h(P=>!P),children:u("fields")}),v&&(0,q.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),a.schema.map(P=>(0,q.jsxs)("label",{className:"nb-field-row",children:[(0,q.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:P.visible&&!p.hiddenColumns.includes(P.id),onChange:()=>{me(P.id)}}),(0,q.jsx)("span",{className:"nb-field-icon",children:Qe(P.type)}),(0,q.jsx)("span",{className:"nb-field-name",children:P.name})]},P.id))]})]}),(0,q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:de,children:[(0,q.jsxs)("button",{className:`nb-toolbar-btn${b?" nb-toolbar-btn--active":""}`,onClick:()=>_(P=>!P),children:[u("cover"),": ",(0,q.jsx)("strong",{children:Le?.name??u("no_cover")})]}),b&&(0,q.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("cover_field_label")}),(0,q.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField?"":" nb-menu-item--active"}`,onClick:()=>{J({...p,galleryCoverField:void 0}),_(!1)},children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,q.jsx)("span",{children:u("no_cover")})]}),a.schema.filter(P=>P.type==="text"||P.type==="title"||P.type==="image").map(P=>(0,q.jsxs)("button",{className:`nb-menu-item${p.galleryCoverField===P.id?" nb-menu-item--active":""}`,onClick:()=>{J({...p,galleryCoverField:P.id}),_(!1)},children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:Qe(P.type)}),(0,q.jsx)("span",{children:P.name})]},P.id))]})]}),(0,q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:De,children:[(0,q.jsx)("button",{className:`nb-toolbar-btn${g?" nb-toolbar-btn--active":""}`,onClick:()=>y(P=>!P),children:db()[Be]}),g&&(0,q.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("card_size_label")}),["small","medium","large"].map(P=>(0,q.jsx)("button",{className:`nb-menu-item${Be===P?" nb-menu-item--active":""}`,onClick:()=>{J({...p,galleryCardSize:P}),y(!1)},children:db()[P]},P))]})]}),(0,q.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{J({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,q.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,q.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,q.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,q.jsxs)("span",{className:"nb-row-count",children:[$e.length," ",$e.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ne,style:{marginLeft:"auto"},children:[(0,q.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${m?" nb-toolbar-btn--active":""}`,onClick:()=>c(P=>!P),title:u("filters"),children:[(0,q.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,q.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,q.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),m&&(0,q.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,q.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,q.jsxs)("button",{className:"nb-menu-item",onClick:()=>it("_title","Nome","\u{1F4C4}","title"),children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,q.jsx)("span",{children:u("name_column")})]}),a.schema.map(P=>(0,q.jsxs)("button",{className:"nb-menu-item",onClick:()=>it(P.id,P.name,Qe(P.type),P.type),children:[(0,q.jsx)("span",{className:"nb-menu-item-icon",children:Qe(P.type)}),(0,q.jsx)("span",{children:P.name})]},P.id))]})]}),(0,q.jsxs)("button",{ref:H,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!k&&H.current&&V(H.current.getBoundingClientRect()),D(P=>!P)},children:[(0,q.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,q.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),k&&M&&(0,q.jsx)(XS,{sorts:p.sorts,schema:a.schema,onSortChange:P=>{ae(P)},onClose:()=>D(!1),anchorRect:M,panelRef:Ve}),(0,q.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:O,children:[(0,q.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${(p.conditionalFormats?.length??0)>0?" nb-toolbar-btn--active":""}`,onClick:()=>re(P=>!P),title:u("conditional_formatting"),children:[(0,q.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,q.jsx)("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),(0,q.jsx)("path",{d:"M3 9h18"}),(0,q.jsx)("path",{d:"M3 15h18"}),(0,q.jsx)("path",{d:"M9 3v18"})]}),(p.conditionalFormats?.length??0)>0&&(0,q.jsx)("span",{className:"nb-hidden-badge",children:p.conditionalFormats.length})]}),j&&(0,q.jsx)($r,{rules:p.conditionalFormats??[],schema:a.schema,onChange:P=>{J({...p,conditionalFormats:P})},onClose:()=>re(!1)})]})]}),(0,q.jsx)(_o,{activeFilters:s,schema:a.schema,onUpdate:R,onRemove:Je,onToggleConjunction:G,collapsed:!!p.filtersCollapsed,onToggleCollapsed:()=>{J({...p,filtersCollapsed:!p.filtersCollapsed})}})]});return(0,q.jsxs)("div",{className:"nb-container",children:[Ft,(0,q.jsxs)("div",{className:"nb-gallery",style:{gridTemplateColumns:Ae},children:[Ie.map(P=>{let we=p.conditionalFormats?.length?ha(P,p.conditionalFormats,a.schema):void 0;return(0,q.jsx)(QS,{row:P,cardSize:Be,coverField:Le,visibleCols:Ee,dbFolderPath:_e,includeSubfolders:p.includeSubfolders??!1,onOpen:Oe,cardStyle:we},P._file.path)}),(0,q.jsx)("div",{className:"nb-gallery-card nb-gallery-card--add",onClick:()=>{je()},children:(0,q.jsx)("div",{className:"nb-gallery-add-inner",children:"+ "+u("add_entry")})})]}),(0,q.jsx)(va,{currentPage:ot,totalPages:Ge,onPageChange:ye})]})}var at=Re(xt(),1);var B=Re(St(),1),fb=()=>[u("day_sun"),u("day_mon"),u("day_tue"),u("day_wed"),u("day_thu"),u("day_fri"),u("day_sat")],gb=()=>[u("month_january"),u("month_february"),u("month_march"),u("month_april"),u("month_may"),u("month_june"),u("month_july"),u("month_august"),u("month_september"),u("month_october"),u("month_november"),u("month_december")];function ZS(e,t){let n=new Date(e,t,1).getDay(),o=new Date(e,t+1,0).getDate(),r=[];for(let i=0;i<n;i++)r.push(null);for(let i=1;i<=o;i++)r.push(i);for(;r.length%7!==0;)r.push(null);return r}function JS(e,t,n){let o=new Date(e,t,n),r=o.getDay(),i=new Date(o);i.setDate(o.getDate()-r);let a=[];for(let l=0;l<7;l++){let s=new Date(i);s.setDate(i.getDate()+l),a.push(s)}return a}function _b(e){if(e.length===0)return"";let t=e[0],n=e[6],r=[u("month_january"),u("month_february"),u("month_march"),u("month_april"),u("month_may"),u("month_june"),u("month_july"),u("month_august"),u("month_september"),u("month_october"),u("month_november"),u("month_december")];return t.getMonth()===n.getMonth()?`${r[t.getMonth()]} ${t.getDate()} \u2013 ${n.getDate()}, ${t.getFullYear()}`:t.getFullYear()===n.getFullYear()?`${r[t.getMonth()]} ${t.getDate()} \u2013 ${r[n.getMonth()]} ${n.getDate()}, ${t.getFullYear()}`:`${r[t.getMonth()]} ${t.getDate()}, ${t.getFullYear()} \u2013 ${r[n.getMonth()]} ${n.getDate()}, ${n.getFullYear()}`}function wa(e,t,n){return`${e}-${t}-${n}`}function Pm(e,t){return`${String(e).padStart(2,"0")}:${String(t).padStart(2,"0")}`}function eN(e,t){let n=Br(e[t]);return!n||n.hour===void 0||n.minute===void 0?null:Pm(n.hour,n.minute)}function Br(e){if(!e||typeof e!="string")return null;let t=e.indexOf("T"),o=(t>=0?e.slice(0,t):e).split("-");if(o.length!==3)return null;let r=parseInt(o[0]),i=parseInt(o[1])-1,a=parseInt(o[2]);if(isNaN(r)||isNaN(i)||isNaN(a))return null;if(t>=0){let s=e.slice(t+1).split(":");if(s.length>=2){let d=parseInt(s[0]),p=parseInt(s[1]);if(!isNaN(d)&&!isNaN(p))return{year:r,month:i,day:a,hour:d,minute:p}}}return{year:r,month:i,day:a}}function hb({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{status:i,trackSave:a}=Vr(),l=new Date,{rows:s,config:d,loading:p,activeFilters:f,setActiveFilters:m}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[c,v]=(0,at.useState)(n),[h,b]=(0,at.useState)(l.getFullYear()),[_,g]=(0,at.useState)(l.getMonth()),[y,k]=(0,at.useState)(l.getDate()),[D,M]=(0,at.useState)(!1),[V,j]=(0,at.useState)(!1),[re,ne]=(0,at.useState)(!1),[ce,de]=(0,at.useState)(null),[De,Ve]=(0,at.useState)(null),[H,X]=(0,at.useState)(null),O=(0,at.useRef)(null),J=(0,at.useRef)(null),[ue,Se]=(0,at.useState)(()=>{let x=new Date;return x.getHours()*60+x.getMinutes()}),$e=(0,at.useRef)(null),Ie=(0,at.useRef)(null),ot=(0,at.useRef)(null),Ge=(0,at.useRef)(null);(0,at.useEffect)(()=>{v(n)},[n.id]),(0,at.useEffect)(()=>{let N=setInterval(()=>{let Y=new Date;Se(Y.getHours()*60+Y.getMinutes())},6e4);return()=>clearInterval(N)},[]);let ye=(0,at.useCallback)(async x=>{v(x),await o(x)},[o]),Ee=c.calendarViewMode??"month";(0,at.useEffect)(()=>{if(!D)return;let x=N=>{Ge.current?.contains(N.target)||$e.current&&!$e.current.contains(N.target)&&M(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[D]),(0,at.useEffect)(()=>{if(!V)return;let x=N=>{Ge.current?.contains(N.target)||Ie.current&&!Ie.current.contains(N.target)&&j(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[V]),(0,at.useEffect)(()=>{if(!re)return;let x=N=>{Ge.current?.contains(N.target)||ot.current&&!ot.current.contains(N.target)&&ne(!1)};return document.addEventListener("mousedown",x),()=>document.removeEventListener("mousedown",x)},[re]);let Le=Bn(f,200),Be=(0,at.useMemo)(()=>mo(s,Le),[s,Le]),Ae=(0,at.useMemo)(()=>d.schema.find(x=>x.id===c.calendarDateField)??null,[d.schema,c.calendarDateField]),Ne=(0,at.useMemo)(()=>d.schema.filter(x=>x.visible&&!c.hiddenColumns.includes(x.id)),[d.schema,c.hiddenColumns]),it=(0,at.useMemo)(()=>ZS(h,_),[h,_]),Je=(0,at.useMemo)(()=>Ee==="week"?JS(h,_,y):[],[Ee,h,_,y]),R=(0,at.useMemo)(()=>{let x=new Map;if(!Ae)return x;for(let N of Be){let Y=Br(N[Ae.id]);if(!Y)continue;let se=wa(Y.year,Y.month,Y.day);if(Ee==="week"){if(Je.some(te=>te.getFullYear()===Y.year&&te.getMonth()===Y.month&&te.getDate()===Y.day)){let te=x.get(se)??[];te.push(N),x.set(se,te)}}else if(Y.year===h&&Y.month===_){let oe=x.get(se)??[];oe.push(N),x.set(se,oe)}}for(let[N,Y]of x)Y.sort((se,oe)=>{let te=Br(se[Ae.id]),S=Br(oe[Ae.id]),Q=(te?.hour??-1)*60+(te?.minute??-1),he=(S?.hour??-1)*60+(S?.minute??-1);return Q-he}),x.set(N,Y);return x},[Be,Ae,h,_,y,Ee,Je]),G=(0,at.useMemo)(()=>Ae?Be.filter(x=>{let N=x[Ae.id];return!N||String(N).trim()===""}):[],[Be,Ae]),me=(0,at.useMemo)(()=>{if(Ee!=="week"||!Ae)return null;let x=null;for(let[,N]of R)for(let Y of N){let se=Br(Y[Ae.id]);if(se&&se.hour!==void 0&&se.minute!==void 0){let oe=se.hour*60+se.minute;(x===null||oe<x)&&(x=oe)}}return x},[Ee,Ae,R]),ae=Ee==="week"&&Je.length>0?Je[0].toISOString():"";(0,at.useEffect)(()=>{if(Ee!=="week"||p)return;let x=setTimeout(()=>{let N=J.current;if(!N||N.scrollHeight<=N.clientHeight)return;let se=48*24,te=(me!==null?Math.min(me,ue):ue)/1440*se,S=N.clientHeight;N.scrollTo({top:Math.max(0,te-S*.25),behavior:"smooth"})},100);return()=>clearTimeout(x)},[Ee,ae,p]);let je=(0,at.useCallback)(async x=>{let N=x.map(Y=>({id:Y.id,columnId:Y.columnId,operator:Y.operator,value:Y.value,conjunction:Y.conjunction}));await ye({...c,activePills:N})},[ye,c]),qe=(x,N,Y,se)=>{let oe=[...f,{id:crypto.randomUUID(),columnId:x,columnName:N,columnType:se,icon:Y,operator:Tn(se),value:"",conjunction:"and"}];m(oe),je(oe),M(!1)},_e=x=>{let N=f.filter(Y=>Y.id!==x);m(N),je(N)},Oe=(x,N,Y)=>{let se=f.map(oe=>oe.id===x?{...oe,operator:N,value:Y}:oe);m(se),je(se)},vt=x=>{let N=f.map(Y=>Y.id===x?{...Y,conjunction:Y.conjunction==="and"?"or":"and"}:Y);m(N),je(N)},Ft=(0,at.useCallback)(async x=>{let N=c.hiddenColumns.includes(x)?c.hiddenColumns.filter(Y=>Y!==x):[...c.hiddenColumns,x];await ye({...c,hiddenColumns:N})},[c,ye]),P=()=>{if(Ee==="week"){let x=new Date(h,_,y-7);b(x.getFullYear()),g(x.getMonth()),k(x.getDate())}else _===0?(g(11),b(x=>x-1)):g(x=>x-1)},we=()=>{if(Ee==="week"){let x=new Date(h,_,y+7);b(x.getFullYear()),g(x.getMonth()),k(x.getDate())}else _===11?(g(0),b(x=>x+1)):g(x=>x+1)},A=()=>{b(l.getFullYear()),g(l.getMonth()),k(l.getDate())},ee=async(x,N,Y)=>{if(!e||!Ae)return;let se=await t.createNoteWithTemplate(e),oe=`${x}-${String(N+1).padStart(2,"0")}-${String(Y).padStart(2,"0")}`;await a(r.fileManager.processFrontMatter(se,te=>{te[Ae.id]=oe}))},Me=(x,N)=>{x.dataTransfer.setData("nb-cal-path",N._file.path),x.dataTransfer.effectAllowed="move",x.stopPropagation()},Fe=(x,N)=>{x.dataTransfer.types.includes("nb-cal-path")&&(x.preventDefault(),x.dataTransfer.dropEffect="move",de(N))},bt=x=>{x.currentTarget.contains(x.relatedTarget)||de(null)},cn=async(x,N,Y,se)=>{x.preventDefault(),x.stopPropagation(),de(null);let oe=x.dataTransfer.getData("nb-cal-path");if(!oe||!Ae)return;let te=r.vault.getFileByPath(oe);if(!te)return;let S=`${N}-${String(Y+1).padStart(2,"0")}-${String(se).padStart(2,"0")}`;await a(r.fileManager.processFrontMatter(te,Q=>{let he=Q[Ae.id];typeof he=="string"&&he.includes("T")?Q[Ae.id]=`${S}T${he.split("T")[1]}`:Q[Ae.id]=S}))},mt=Cn();if(!e)return(0,B.jsx)("div",{className:"nb-empty-state",children:(0,B.jsx)("p",{children:u("no_database_open")})});if(p)return(0,B.jsx)("div",{className:"nb-loading",children:u("loading")});let dn=l.getFullYear()===h&&l.getMonth()===_?l.getDate():null,Jt=x=>{x!=="datefield"&&ne(!1),x!=="fields"&&j(!1),x!=="filter"&&M(!1)},en=mt?(0,B.jsxs)(Un,{actionBarRef:Ge,actions:[{id:"datefield",label:u("date_field"),icon:(0,B.jsx)(kn,{}),active:re,onClick:()=>{Jt("datefield"),ne(x=>!x)}},{id:"fields",label:u("fields"),icon:(0,B.jsx)(kn,{}),active:V,onClick:()=>{Jt("fields"),j(x=>!x)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,B.jsx)(Hn,{}),active:!!c.includeSubfolders,onClick:()=>{Jt(),ye({...c,includeSubfolders:!c.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,B.jsx)(jn,{}),active:D,badge:f.length||void 0,onClick:()=>{Jt("filter"),M(x=>!x)}}],rowCount:Be.length,rowCountLabel:Be.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:f,onFilterUpdate:Oe,onFilterRemove:_e,onConjunctionToggle:vt,children:[(0,B.jsxs)(dt,{open:re,onClose:()=>ne(!1),title:u("date_field"),children:[(0,B.jsxs)("button",{className:`nb-menu-item${c.calendarDateField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,calendarDateField:void 0}),ne(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,B.jsx)("span",{children:u("none_value")})]}),d.schema.filter(x=>x.type==="date").map(x=>(0,B.jsxs)("button",{className:`nb-menu-item${c.calendarDateField===x.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,calendarDateField:x.id}),ne(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,B.jsx)("span",{children:x.name})]},x.id))]}),(0,B.jsx)(dt,{open:V,onClose:()=>j(!1),title:u("fields"),children:d.schema.map(x=>(0,B.jsxs)("label",{className:"nb-field-row",children:[(0,B.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:x.visible&&!c.hiddenColumns.includes(x.id),onChange:()=>{Ft(x.id)}}),(0,B.jsx)("span",{className:"nb-field-icon",children:Qe(x.type)}),(0,B.jsx)("span",{className:"nb-field-name",children:x.name})]},x.id))}),(0,B.jsxs)(dt,{open:D,onClose:()=>M(!1),title:u("filter"),children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>qe("_title","Nome","\u{1F4C4}","title"),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:u("name_column")})]}),d.schema.map(x=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>qe(x.id,x.name,Qe(x.type),x.type),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:Qe(x.type)}),(0,B.jsx)("span",{children:x.name})]},x.id))]}),(0,B.jsx)("div",{className:"nb-cal-view-toggle",style:{margin:"4px 12px"},children:["month","week"].map(x=>(0,B.jsx)("button",{className:`nb-cal-view-btn${Ee===x?" nb-cal-view-btn--active":""}`,onClick:()=>{ye({...c,calendarViewMode:x})},children:x==="month"?u("calendar_view_month"):u("calendar_view_week")},x))}),(0,B.jsxs)("div",{className:"nb-cal-nav",style:{padding:"4px 12px"},children:[(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:P,title:Ee==="week"?u("calendar_prev_week"):u("calendar_prev_month"),children:"\u2039"}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:A,children:u("calendar_today")}),(0,B.jsx)("span",{className:"nb-cal-month-label",children:Ee==="week"?_b(Je):`${gb()[_]} ${h}`}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:we,title:Ee==="week"?u("calendar_next_week"):u("calendar_next_month"),children:"\u203A"})]})]}):(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("div",{className:"nb-toolbar",children:[(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:ot,children:[(0,B.jsxs)("button",{className:`nb-toolbar-btn${re?" nb-toolbar-btn--active":""}`,onClick:()=>ne(x=>!x),children:[u("date_field"),": ",(0,B.jsx)("strong",{children:Ae?.name??u("none_value")})]}),re&&(0,B.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("date_field_label")}),(0,B.jsxs)("button",{className:`nb-menu-item${c.calendarDateField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,calendarDateField:void 0}),ne(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,B.jsx)("span",{children:u("none_value")})]}),d.schema.filter(x=>x.type==="date").map(x=>(0,B.jsxs)("button",{className:`nb-menu-item${c.calendarDateField===x.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,calendarDateField:x.id}),ne(!1)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,B.jsx)("span",{children:x.name})]},x.id))]})]}),(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:Ie,children:[(0,B.jsx)("button",{className:`nb-toolbar-btn${V?" nb-toolbar-btn--active":""}`,onClick:()=>j(x=>!x),children:"Campos"}),V&&(0,B.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_label")}),d.schema.map(x=>(0,B.jsxs)("label",{className:"nb-field-row",children:[(0,B.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:x.visible&&!c.hiddenColumns.includes(x.id),onChange:()=>{Ft(x.id)}}),(0,B.jsx)("span",{className:"nb-field-icon",children:Qe(x.type)}),(0,B.jsx)("span",{className:"nb-field-name",children:x.name})]},x.id))]})]}),(0,B.jsx)("div",{className:"nb-cal-view-toggle",children:["month","week"].map(x=>(0,B.jsx)("button",{className:`nb-cal-view-btn${Ee===x?" nb-cal-view-btn--active":""}`,onClick:()=>{ye({...c,calendarViewMode:x})},children:x==="month"?u("calendar_view_month"):u("calendar_view_week")},x))}),(0,B.jsxs)("div",{className:"nb-cal-nav",children:[(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:P,title:Ee==="week"?u("calendar_prev_week"):u("calendar_prev_month"),children:"\u2039"}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:A,children:u("calendar_today")}),(0,B.jsx)("span",{className:"nb-cal-month-label",children:Ee==="week"?_b(Je):`${gb()[_]} ${h}`}),(0,B.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:we,title:Ee==="week"?u("calendar_next_week"):u("calendar_next_month"),children:"\u203A"})]}),(0,B.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${c.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{ye({...c,includeSubfolders:!c.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,B.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,B.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,B.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,B.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,B.jsxs)("span",{className:"nb-row-count",children:[Be.length," ",Be.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,B.jsx)(Or,{status:i}),(0,B.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:$e,style:{marginLeft:"auto"},children:[(0,B.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${D?" nb-toolbar-btn--active":""}`,onClick:()=>M(x=>!x),title:u("filters"),children:[(0,B.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,B.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),f.length>0&&(0,B.jsx)("span",{className:"nb-hidden-badge",children:f.length})]}),D&&(0,B.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,B.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>qe("_title","Nome","\u{1F4C4}","title"),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:u("name_column")})]}),d.schema.map(x=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>qe(x.id,x.name,Qe(x.type),x.type),children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:Qe(x.type)}),(0,B.jsx)("span",{children:x.name})]},x.id))]})]})]}),(0,B.jsx)(_o,{activeFilters:f,schema:d.schema,onUpdate:Oe,onRemove:_e,onToggleConjunction:vt,collapsed:!!c.filtersCollapsed,onToggleCollapsed:()=>{ye({...c,filtersCollapsed:!c.filtersCollapsed})}})]});return(0,B.jsxs)("div",{className:"nb-container",children:[en,Ae?(0,B.jsxs)(B.Fragment,{children:[Ee==="week"?(0,B.jsxs)("div",{className:"nb-cal-week-container",children:[(0,B.jsxs)("div",{className:"nb-cal-week-allday",children:[(0,B.jsx)("div",{className:"nb-cal-week-time-gutter nb-cal-week-allday-label",children:u("calendar_all_day")}),Je.map(x=>{let N=wa(x.getFullYear(),x.getMonth(),x.getDate()),Y=(R.get(N)??[]).filter(se=>{let oe=Br(se[Ae.id]);return!oe||oe.hour===void 0});return(0,B.jsx)("div",{className:"nb-cal-week-allday-cell",onClick:()=>{ee(x.getFullYear(),x.getMonth(),x.getDate())},onDragOver:se=>Fe(se,x.getDate()),onDragLeave:bt,onDrop:se=>{cn(se,x.getFullYear(),x.getMonth(),x.getDate())},children:Y.map(se=>(0,B.jsx)("div",{className:"nb-cal-card nb-cal-card--allday",draggable:!0,onDragStart:oe=>Me(oe,se),onClick:oe=>{oe.stopPropagation(),r.workspace.getLeaf().openFile(se._file)},children:(0,B.jsx)("span",{className:"nb-cal-card-title",children:se._title})},se._file.path))},N)})]}),(0,B.jsxs)("div",{className:"nb-cal-week-header",children:[(0,B.jsx)("div",{className:"nb-cal-week-time-gutter"}),Je.map(x=>{let N=x.getFullYear()===l.getFullYear()&&x.getMonth()===l.getMonth()&&x.getDate()===l.getDate();return(0,B.jsxs)("div",{className:`nb-cal-week-day-header${N?" nb-cal-week-day-header--today":""}`,children:[fb()[x.getDay()]," ",x.getDate()]},x.toISOString())})]}),(0,B.jsxs)("div",{className:"nb-cal-week-body",ref:J,children:[Je.some(x=>x.getFullYear()===l.getFullYear()&&x.getMonth()===l.getMonth()&&x.getDate()===l.getDate())&&(0,B.jsx)("div",{className:"nb-cal-now-line",style:{top:`${ue/1440*48*24}px`}}),(0,B.jsx)("div",{className:"nb-cal-week-time-gutter",children:Array.from({length:24},(x,N)=>(0,B.jsx)("div",{className:"nb-cal-week-hour-label",children:Pm(N,0)},N))}),Je.map(x=>{let N=wa(x.getFullYear(),x.getMonth(),x.getDate()),Y=x.getFullYear()===l.getFullYear()&&x.getMonth()===l.getMonth()&&x.getDate()===l.getDate(),se=(R.get(N)??[]).filter(oe=>{let te=Br(oe[Ae.id]);return te&&te.hour!==void 0});return(0,B.jsxs)("div",{className:`nb-cal-week-day-col${Y?" nb-cal-week-day-col--today":""}`,onClick:()=>{ee(x.getFullYear(),x.getMonth(),x.getDate())},onDragOver:oe=>Fe(oe,x.getDate()),onDragLeave:bt,onDrop:oe=>{cn(oe,x.getFullYear(),x.getMonth(),x.getDate())},children:[Array.from({length:24},(oe,te)=>(0,B.jsx)("div",{className:"nb-cal-week-hour-slot"},te)),se.map(oe=>{let te=Br(oe[Ae.id]);if(!te||te.hour===void 0||te.minute===void 0)return null;let S=(te.hour*60+te.minute)/1440*100;return(0,B.jsx)("div",{className:"nb-cal-card nb-cal-card--timed",draggable:!0,onDragStart:Q=>Me(Q,oe),onClick:Q=>{Q.stopPropagation(),r.workspace.getLeaf().openFile(oe._file)},style:{top:`${S}%`},children:(0,B.jsxs)("div",{className:"nb-cal-card-title-row",children:[(0,B.jsx)("span",{className:"nb-cal-time-badge",children:Pm(te.hour,te.minute)}),(0,B.jsx)("span",{className:"nb-cal-card-title",children:oe._title})]})},oe._file.path)})]},N)})]})]}):(0,B.jsxs)("div",{className:"nb-cal-grid",children:[fb().map(x=>(0,B.jsx)("div",{className:"nb-cal-day-header",children:x},x)),it.map((x,N)=>{if(x===null)return(0,B.jsx)("div",{className:"nb-cal-cell nb-cal-cell--outside"},`empty-${N}`);let Y=x===dn,se=x===ce,oe=R.get(wa(h,_,x))??[];return(0,B.jsxs)("div",{className:`nb-cal-cell${Y?" nb-cal-cell--today":""}${se?" nb-cal-cell--drag-over":""}`,onClick:mt?void 0:()=>{ee(h,_,x)},onDragOver:te=>Fe(te,x),onDragLeave:bt,onDrop:te=>{cn(te,h,_,x)},title:mt?void 0:u("calendar_click_to_create"),onTouchStart:mt?()=>{O.current=setTimeout(()=>{X({year:h,month:_,day:x})},500)}:void 0,onTouchMove:mt?()=>{O.current&&(clearTimeout(O.current),O.current=null)}:void 0,onTouchEnd:mt?()=>{O.current&&(clearTimeout(O.current),O.current=null)}:void 0,children:[(0,B.jsx)("div",{className:"nb-cal-cell-header",children:(0,B.jsx)("span",{className:`nb-cal-day-num${Y?" nb-cal-day-num--today":""}`,children:x})}),(0,B.jsx)("div",{className:"nb-cal-cell-body",children:(()=>{let S=mt&&oe.length>1?oe.slice(0,1):oe,Q=mt?oe.length-S.length:0,he=wa(h,_,x);return(0,B.jsxs)(B.Fragment,{children:[S.map(be=>(0,B.jsxs)("div",{className:"nb-cal-card",draggable:!mt,onDragStart:mt?void 0:xe=>Me(xe,be),onClick:xe=>{xe.stopPropagation(),r.workspace.getLeaf().openFile(be._file)},children:[(0,B.jsxs)("div",{className:"nb-cal-card-title-row",children:[Ae&&(()=>{let xe=eN(be,Ae.id);return xe?(0,B.jsx)("span",{className:"nb-cal-time-badge",children:xe}):null})(),(0,B.jsx)("span",{className:"nb-cal-card-title",children:be._title})]}),!mt&&(()=>{let xe=e?.parent?.path??"",Xe=be._file.parent?.path??"",Ue=c.includeSubfolders&&Xe.length>xe.length?Xe.slice(xe.length+1):"";return Ue?(0,B.jsx)("div",{className:"nb-folder-path",children:Ue}):null})(),!mt&&Ne.length>0&&(0,B.jsx)("div",{className:"nb-cal-card-props",children:Ne.map(xe=>{let Xe=be[xe.id];if(Xe==null||String(Xe).trim()==="")return null;let Ue=Array.isArray(Xe)?Xe.join(", "):String(Xe);return(0,B.jsx)("span",{className:"nb-cal-card-prop",children:Ue},xe.id)})})]},be._file.path)),Q>0&&(0,B.jsxs)("button",{className:"nb-cal-more-badge",onClick:be=>{be.stopPropagation(),Ve(he)},children:["+",Q]})]})})()})]},x)})]}),G.length>0&&(0,B.jsxs)("div",{className:"nb-cal-no-date",children:[(0,B.jsxs)("div",{className:"nb-cal-no-date-title",children:[u("calendar_no_date_section")," (",G.length,")"]}),(0,B.jsx)("div",{className:"nb-cal-no-date-list",children:G.map(x=>(0,B.jsxs)("div",{className:"nb-cal-card nb-cal-card--no-date",draggable:!0,onDragStart:N=>Me(N,x),onClick:()=>{r.workspace.getLeaf().openFile(x._file)},children:[(0,B.jsx)("span",{className:"nb-cal-card-title",children:x._title}),(()=>{let N=e?.parent?.path??"",Y=x._file.parent?.path??"",se=c.includeSubfolders&&Y.length>N.length?Y.slice(N.length+1):"";return se?(0,B.jsx)("div",{className:"nb-folder-path",children:se}):null})()]},x._file.path))})]})]}):(0,B.jsx)("div",{className:"nb-cal-no-field",children:(0,B.jsx)("p",{children:u("calendar_no_date_field")})}),(0,B.jsx)(dt,{open:De!==null,onClose:()=>Ve(null),title:De??"",children:(De!==null?R.get(De)??[]:[]).map(x=>(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{r.workspace.getLeaf().openFile(x._file),Ve(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:x._title})]},x._file.path))}),(0,B.jsx)(dt,{open:H!==null,onClose:()=>X(null),title:H?`${H.day}/${H.month+1}/${H.year}`:"",children:H&&(()=>{let x=wa(H.year,H.month,H.day),N=R.get(x)??[];return(0,B.jsxs)(B.Fragment,{children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{ee(H.year,H.month,H.day),X(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u2795"}),(0,B.jsx)("span",{children:u("add_card")})]}),N.length>0&&(0,B.jsx)("div",{className:"nb-menu-separator"}),N.map(Y=>(0,B.jsxs)(at.Fragment,{children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{r.workspace.getLeaf().openFile(Y._file),X(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,B.jsx)("span",{children:Y._title})]}),(0,B.jsxs)("div",{className:"nb-cal-day-actions",children:[(0,B.jsxs)("button",{className:"nb-menu-item",onClick:()=>{t.duplicateNotes([Y._file]),X(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,B.jsx)("span",{children:u("duplicate_note")})]}),(0,B.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{t.deleteNotes([Y._file]),X(null)},children:[(0,B.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,B.jsx)("span",{children:u("delete_note")})]})]})]},Y._file.path))]})})()})]})}var Ze=Re(xt(),1);var $=Re(St(),1),vb=200,Am=34,bb=28,tc=56,Lm=()=>[u("month_short_jan"),u("month_short_feb"),u("month_short_mar"),u("month_short_apr"),u("month_short_may"),u("month_short_jun"),u("month_short_jul"),u("month_short_aug"),u("month_short_sep"),u("month_short_oct"),u("month_short_nov"),u("month_short_dec")],tN={days:30,weeks:80,months:100},nN={days:730,weeks:156,months:48},yb=()=>({days:u("zoom_days"),weeks:u("zoom_weeks"),months:u("zoom_months")});function Oo(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function Om(e,t){return new Date(e.getFullYear(),e.getMonth()+t,1)}function Ca(e){if(!e||typeof e!="string")return null;let t=e.split("-");if(t.length!==3)return null;let n=parseInt(t[0]),o=parseInt(t[1])-1,r=parseInt(t[2]);return isNaN(n)||isNaN(o)||isNaN(r)?null:new Date(n,o,r)}function oN(e,t){if(e==="months")return new Date(t.getFullYear()-1,0,1);if(e==="weeks"){let n=Oo(t,-546);return Oo(n,-n.getDay())}return new Date(t.getFullYear()-1,0,1)}function Im(e,t,n,o){if(t==="days")return Math.round((e.getTime()-n.getTime())/864e5)*o;if(t==="weeks")return(e.getTime()-n.getTime())/864e5/7*o;let r=(e.getFullYear()-n.getFullYear())*12+(e.getMonth()-n.getMonth()),i=new Date(e.getFullYear(),e.getMonth()+1,0).getDate();return(r+(e.getDate()-1)/i)*o}function wb(e,t,n,o){return t==="days"?Oo(n,Math.round(e/o)):t==="weeks"?Oo(n,Math.round(e/o*7)):Om(n,Math.floor(e/o))}function rN(e,t,n,o){let r=[],i=[];if(e==="months"){for(let s=0;s<o;s++){let d=Om(t,s);r.push({key:`m${s}`,left:s*n,width:n,label:Lm()[d.getMonth()]})}let a=-1,l=0;for(let s=0;s<=o;s++){let d=s<o?Om(t,s).getFullYear():-1;d!==a&&a!==-1&&(i.push({key:`y${a}`,left:l,width:s*n-l,label:String(a)}),l=s*n),(a===-1||d!==a)&&(a=d)}}else if(e==="weeks"){for(let s=0;s<o;s++){let d=Oo(t,s*7);r.push({key:`w${s}`,left:s*n,width:n,label:`${String(d.getDate()).padStart(2,"0")}/${String(d.getMonth()+1).padStart(2,"0")}`})}let a="",l=0;for(let s=0;s<=o;s++){let d=s<o?Oo(t,s*7):null,p=d?`${d.getFullYear()}-${d.getMonth()}`:"";if(p!==a&&a!==""){let f=Oo(t,Math.round(l/n)*7);i.push({key:a,left:l,width:s*n-l,label:`${Lm()[f.getMonth()]} ${f.getFullYear()}`}),l=s*n}(a===""||p!==a)&&(a=p)}}else{for(let s=0;s<o;s++){let d=Oo(t,s);r.push({key:`d${s}`,left:s*n,width:n,label:String(d.getDate())})}let a="",l=0;for(let s=0;s<=o;s++){let d=s<o?Oo(t,s):null,p=d?`${d.getFullYear()}-${d.getMonth()}`:"";if(p!==a&&a!==""){let f=Oo(t,Math.round(l/n));i.push({key:a,left:l,width:s*n-l,label:`${Lm()[f.getMonth()]} ${f.getFullYear()}`}),l=s*n}(a===""||p!==a)&&(a=p)}}return{top:i,bottom:r}}var iN=Ze.default.memo(function({row:t,barLeft:n,barWidth:o,isMobile:r,visibleCols:i,dbFolderPath:a,includeSubfolders:l,origBarLeft:s,origBarWidth:d,startFieldId:p,endFieldId:f,onOpen:m,onContextMenu:c,onResizeStart:v}){let h=t._file.parent?.path??"",b=l&&h.length>a.length?h.slice(a.length+1):"";return(0,$.jsxs)("div",{className:"nb-tl-bar",style:{left:n,width:o,top:(Am-22)/2,height:22},onClick:()=>{r?c(t._file):m(t._file)},onContextMenu:r?void 0:_=>{_.preventDefault(),c(t._file)},title:r?void 0:t._title,children:[(0,$.jsx)("div",{className:"nb-tl-bar-handle nb-tl-bar-handle--left",onMouseDown:_=>{_.stopPropagation(),_.preventDefault(),v(t._file.path,"left",_.clientX,s,d,p,f)}}),(0,$.jsx)("span",{className:"nb-tl-bar-title",children:t._title}),b?(0,$.jsx)("span",{className:"nb-folder-path",style:{marginLeft:4},children:b}):null,i.map(_=>{let g=t[_.id];if(!g||String(g).trim()==="")return null;let y=Array.isArray(g)?g.join(", "):String(g);return(0,$.jsxs)("span",{className:"nb-tl-bar-field",children:[" \xB7 ",y]},_.id)}),(0,$.jsx)("div",{className:"nb-tl-bar-handle nb-tl-bar-handle--right",onMouseDown:_=>{_.stopPropagation(),_.preventDefault(),v(t._file.path,"right",_.clientX,s,d,p,f)}})]})});function Cb({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{status:i,trackSave:a}=Vr(),l=(0,Ze.useMemo)(()=>new Date,[]),{rows:s,config:d,loading:p,activeFilters:f,setActiveFilters:m}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[c,v]=(0,Ze.useState)(n),[h,b]=(0,Ze.useState)(!1),[_,g]=(0,Ze.useState)(!1),[y,k]=(0,Ze.useState)(!1),[D,M]=(0,Ze.useState)(!1),[V,j]=(0,Ze.useState)(!1),[re,ne]=(0,Ze.useState)(!0),[ce,de]=(0,Ze.useState)(null),[De,Ve]=(0,Ze.useState)(0),[H,X]=(0,Ze.useState)(null),O=(0,Ze.useRef)(null),J=(0,Ze.useRef)(null),ue=(0,Ze.useRef)(null),Se=(0,Ze.useRef)(null),$e=(0,Ze.useRef)(null),Ie=(0,Ze.useRef)(null),ot=(0,Ze.useRef)(null),Ge=(0,Ze.useRef)(!1);(0,Ze.useEffect)(()=>{v(n)},[n.id]);let ye=(0,Ze.useCallback)(async S=>{v(S),await o(S)},[o]),Ee=(S,Q,he)=>(0,Ze.useEffect)(()=>{if(!S)return;let be=xe=>{ot.current?.contains(xe.target)||Q.current&&!Q.current.contains(xe.target)&&he(!1)};return document.addEventListener("mousedown",be),()=>document.removeEventListener("mousedown",be)},[S]);Ee(h,O,b),Ee(_,J,g),Ee(y,ue,k),Ee(D,Se,M),Ee(V,$e,j);let Le=c.timelineZoom??"months",Be=tN[Le],Ae=nN[Le],Ne=(0,Ze.useMemo)(()=>oN(Le,l),[Le,l]),it=Ae*Be,Je=(0,Ze.useMemo)(()=>rN(Le,Ne,Be,Ae),[Le,Ne,Be,Ae]),R=(0,Ze.useMemo)(()=>Im(l,Le,Ne,Be),[l,Le,Ne,Be]);(0,Ze.useEffect)(()=>{if(!ce)return;let S=be=>Ve(be.clientX-ce.startX),Q=async be=>{let xe=be.clientX-ce.startX;if(de(null),Ve(0),document.body.classList.remove("nb-tl-resizing"),Math.abs(xe)<2)return;Ge.current=!0,setTimeout(()=>{Ge.current=!1},200);let{handle:Xe,origBarLeft:Ue,origBarWidth:U,startFieldId:ze,endFieldId:Te,filePath:ft}=ce,st=Ue,yt=U;if(Xe==="left"?(st=Ue+xe,yt=U-xe):yt=U+xe,yt<Be)return;let Ot=Dt=>`${Dt.getFullYear()}-${String(Dt.getMonth()+1).padStart(2,"0")}-${String(Dt.getDate()).padStart(2,"0")}`,Vt=r.vault.getAbstractFileByPath(ft);Vt&&await a(r.fileManager.processFrontMatter(Vt,Dt=>{Xe==="left"&&ze&&(Dt[ze]=Ot(wb(st,Le,Ne,Be))),Xe==="right"&&Te&&(Dt[Te]=Ot(wb(st+yt-Be,Le,Ne,Be)))}))};document.body.classList.add("nb-tl-resizing");let he=be=>{Q(be)};return window.addEventListener("mousemove",S),window.addEventListener("mouseup",he),()=>{window.removeEventListener("mousemove",S),window.removeEventListener("mouseup",he)}},[ce,Le,Ne,Be,r]),(0,Ze.useEffect)(()=>{requestAnimationFrame(()=>{if(!Ie.current)return;let S=Math.max(0,R-Ie.current.clientWidth*.3);Ie.current.scrollLeft=S})},[Le]);let G=Bn(f,200),me=(0,Ze.useMemo)(()=>mo(s,G),[s,G]),ae=(0,Ze.useMemo)(()=>to(me,c.sorts),[me,c.sorts]),je=(0,Ze.useMemo)(()=>d.schema.find(S=>S.id===c.timelineStartField)??null,[d.schema,c.timelineStartField]),qe=(0,Ze.useMemo)(()=>d.schema.find(S=>S.id===c.timelineEndField)??null,[d.schema,c.timelineEndField]),_e=(0,Ze.useMemo)(()=>d.schema.find(S=>S.id===c.timelineGroupByField)??null,[d.schema,c.timelineGroupByField]),Oe=(0,Ze.useMemo)(()=>d.schema.filter(S=>S.visible&&!c.hiddenColumns.includes(S.id)&&S.id!==c.timelineStartField&&S.id!==c.timelineEndField),[d.schema,c.hiddenColumns,c.timelineStartField,c.timelineEndField]),vt=(0,Ze.useMemo)(()=>je?me.filter(S=>!Ca(S[je.id])):[],[me,je]),Ft=(0,Ze.useMemo)(()=>{let S=U=>{if(!je)return{kind:"row",row:U,barLeft:null,barWidth:null};let ze=Ca(U[je.id]);if(!ze)return{kind:"row",row:U,barLeft:null,barWidth:null};let ft=(qe?Ca(U[qe.id]):null)??ze,st=Math.max(0,Im(ze,Le,Ne,Be)),yt=Im(ft,Le,Ne,Be)+Be;return{kind:"row",row:U,barLeft:st,barWidth:Math.max(8,yt-st)}},Q=je?ae.filter(U=>!!Ca(U[je.id])):ae,he=c.sorts.length>0||!je?Q:[...Q].sort((U,ze)=>{let Te=Ca(U[je.id]),ft=Ca(ze[je.id]);return!Te&&!ft?0:Te?ft?Te.getTime()-ft.getTime():-1:1});if(!_e)return he.map(S);let be=new Map;for(let U of he){let ze=String(U[_e.id]??"");be.has(ze)||be.set(ze,[]),be.get(ze).push(U)}let xe=_e.options?.map(U=>U.value)??[],Xe=[...be.keys()].sort((U,ze)=>{let Te=xe.indexOf(U),ft=xe.indexOf(ze);return Te!==-1&&ft!==-1?Te-ft:Te!==-1?-1:ft!==-1||!U?1:ze?U.localeCompare(ze):-1}),Ue=[];for(let U of Xe){let ze=_e.options?.find(Te=>Te.value===U);Ue.push({kind:"group",label:U||u("no_value"),color:ze?.color});for(let Te of be.get(U))Ue.push(S(Te))}return Ue},[ae,je,qe,_e,Le,Ne,Be,c.sorts]),P=(0,Ze.useCallback)(async S=>{await ye({...c,activePills:S.map(Q=>({id:Q.id,columnId:Q.columnId,operator:Q.operator,value:Q.value,conjunction:Q.conjunction}))})},[ye,c]),we=(S,Q,he,be)=>{let xe=[...f,{id:crypto.randomUUID(),columnId:S,columnName:Q,columnType:be,icon:he,operator:Tn(be),value:"",conjunction:"and"}];m(xe),P(xe),b(!1)},A=S=>{let Q=f.filter(he=>he.id!==S);m(Q),P(Q)},ee=(S,Q,he)=>{let be=f.map(xe=>xe.id===S?{...xe,operator:Q,value:he}:xe);m(be),P(be)},Me=S=>{let Q=f.map(he=>he.id===S?{...he,conjunction:he.conjunction==="and"?"or":"and"}:he);m(Q),P(Q)},Fe=(0,Ze.useCallback)(async S=>{let Q=c.hiddenColumns.includes(S)?c.hiddenColumns.filter(he=>he!==S):[...c.hiddenColumns,S];await ye({...c,hiddenColumns:Q})},[c,ye]),bt=()=>Ie.current?.scrollBy({left:-(Ie.current.clientWidth*.6),behavior:"smooth"}),cn=()=>Ie.current?.scrollBy({left:Ie.current.clientWidth*.6,behavior:"smooth"}),mt=()=>{Ie.current&&Ie.current.scrollTo({left:Math.max(0,R-Ie.current.clientWidth*.3),behavior:"smooth"})},dn=Cn(),Jt=e?.parent?.path??"",en=(0,Ze.useCallback)(S=>{r.workspace.getLeaf().openFile(S)},[r]),x=(0,Ze.useCallback)(S=>{X(S)},[]),N=(0,Ze.useCallback)((S,Q,he,be,xe,Xe,Ue)=>{de({filePath:S,handle:Q,startX:he,origBarLeft:be,origBarWidth:xe,startFieldId:Xe,endFieldId:Ue}),Ve(0)},[]);if(!e)return(0,$.jsx)("div",{className:"nb-empty-state",children:(0,$.jsx)("p",{children:u("no_database_open")})});if(p)return(0,$.jsx)("div",{className:"nb-loading",children:u("loading")});let Y=R>=0&&R<=it,se=({label:S,valueKey:Q,open:he,setOpen:be,menuRef:xe})=>{let Xe=d.schema.find(Ue=>Ue.id===c[Q])?.name??u("none_value");return(0,$.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:xe,children:[(0,$.jsxs)("button",{className:`nb-toolbar-btn${he?" nb-toolbar-btn--active":""}`,onClick:()=>be(!he),children:[S,": ",(0,$.jsx)("strong",{children:Xe})]}),he&&(0,$.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,$.jsx)("div",{className:"nb-fields-dropdown-label",children:S}),(0,$.jsxs)("button",{className:`nb-menu-item${c[Q]?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,[Q]:void 0}),be(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,$.jsx)("span",{children:u("none_value")})]}),d.schema.filter(Ue=>Ue.type==="date").map(Ue=>(0,$.jsxs)("button",{className:`nb-menu-item${c[Q]===Ue.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,[Q]:Ue.id}),be(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,$.jsx)("span",{children:Ue.name})]},Ue.id))]})]})},oe=S=>{S!=="start"&&k(!1),S!=="end"&&M(!1),S!=="group"&&j(!1),S!=="fields"&&g(!1),S!=="filter"&&b(!1)},te=dn?(0,$.jsxs)(Un,{actionBarRef:ot,actions:[{id:"start",label:u("start_field"),icon:(0,$.jsx)(kn,{}),active:y,onClick:()=>{oe("start"),k(S=>!S)}},{id:"end",label:u("end_field"),icon:(0,$.jsx)(kn,{}),active:D,onClick:()=>{oe("end"),M(S=>!S)}},{id:"group",label:u("group_field"),icon:(0,$.jsx)(go,{}),active:V,onClick:()=>{oe("group"),j(S=>!S)}},{id:"fields",label:u("fields"),icon:(0,$.jsx)(kn,{}),active:_,onClick:()=>{oe("fields"),g(S=>!S)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,$.jsx)(Hn,{}),active:!!c.includeSubfolders,onClick:()=>{oe(),ye({...c,includeSubfolders:!c.includeSubfolders})}},{id:"filter",label:u("filter"),icon:(0,$.jsx)(jn,{}),active:h,badge:f.length||void 0,onClick:()=>{oe("filter"),b(S=>!S)}}],rowCount:me.length,rowCountLabel:me.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase(),filters:f,onFilterUpdate:ee,onFilterRemove:A,onConjunctionToggle:Me,children:[(0,$.jsxs)(dt,{open:y,onClose:()=>k(!1),title:u("start_field"),children:[(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineStartField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,timelineStartField:void 0}),k(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,$.jsx)("span",{children:u("none_value")})]}),d.schema.filter(S=>S.type==="date").map(S=>(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineStartField===S.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,timelineStartField:S.id}),k(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,$.jsx)("span",{children:S.name})]},S.id))]}),(0,$.jsxs)(dt,{open:D,onClose:()=>M(!1),title:u("end_field"),children:[(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineEndField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,timelineEndField:void 0}),M(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,$.jsx)("span",{children:u("none_value")})]}),d.schema.filter(S=>S.type==="date").map(S=>(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineEndField===S.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,timelineEndField:S.id}),M(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C5}"}),(0,$.jsx)("span",{children:S.name})]},S.id))]}),(0,$.jsxs)(dt,{open:V,onClose:()=>j(!1),title:u("group_field"),children:[(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineGroupByField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,timelineGroupByField:void 0}),j(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,$.jsx)("span",{children:u("none_value")})]}),d.schema.filter(S=>S.type==="select"||S.type==="status").map(S=>(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineGroupByField===S.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,timelineGroupByField:S.id}),j(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:Qe(S.type)}),(0,$.jsx)("span",{children:S.name})]},S.id))]}),(0,$.jsx)(dt,{open:_,onClose:()=>g(!1),title:u("fields"),children:d.schema.map(S=>(0,$.jsxs)("label",{className:"nb-field-row",children:[(0,$.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:S.visible&&!c.hiddenColumns.includes(S.id),onChange:()=>{Fe(S.id)}}),(0,$.jsx)("span",{className:"nb-field-icon",children:Qe(S.type)}),(0,$.jsx)("span",{className:"nb-field-name",children:S.name})]},S.id))}),(0,$.jsxs)(dt,{open:h,onClose:()=>b(!1),title:u("filter"),children:[(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>we("_title","Nome","\u{1F4C4}","title"),children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,$.jsx)("span",{children:u("name_column")})]}),d.schema.map(S=>(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>we(S.id,S.name,Qe(S.type),S.type),children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:Qe(S.type)}),(0,$.jsx)("span",{children:S.name})]},S.id))]}),(0,$.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:4,padding:"4px 12px"},children:[(0,$.jsxs)("div",{className:"nb-cal-nav",children:[(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:bt,title:u("timeline_scroll_prev"),children:"\u2039"}),(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:mt,children:u("calendar_today")}),(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:cn,title:u("timeline_scroll_next"),children:"\u203A"})]}),(0,$.jsx)("div",{className:"nb-tl-zoom-group",children:["days","weeks","months"].map(S=>(0,$.jsx)("button",{className:`nb-tl-zoom-btn${Le===S?" nb-tl-zoom-btn--active":""}`,onClick:()=>{ye({...c,timelineZoom:S})},children:yb()[S]},S))})]})]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)("div",{className:"nb-toolbar",children:[(0,$.jsx)(se,{label:u("start_field"),valueKey:"timelineStartField",open:y,setOpen:k,menuRef:ue}),(0,$.jsx)(se,{label:u("end_field"),valueKey:"timelineEndField",open:D,setOpen:M,menuRef:Se}),(0,$.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:$e,children:[(0,$.jsxs)("button",{className:`nb-toolbar-btn${V?" nb-toolbar-btn--active":""}`,onClick:()=>j(S=>!S),children:[u("group_field"),": ",(0,$.jsx)("strong",{children:_e?.name??u("none_value")})]}),V&&(0,$.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,$.jsx)("div",{className:"nb-fields-dropdown-label",children:u("group_by_label")}),(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineGroupByField?"":" nb-menu-item--active"}`,onClick:()=>{ye({...c,timelineGroupByField:void 0}),j(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u2014"}),(0,$.jsx)("span",{children:u("none_value")})]}),d.schema.filter(S=>S.type==="select"||S.type==="status").map(S=>(0,$.jsxs)("button",{className:`nb-menu-item${c.timelineGroupByField===S.id?" nb-menu-item--active":""}`,onClick:()=>{ye({...c,timelineGroupByField:S.id}),j(!1)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:Qe(S.type)}),(0,$.jsx)("span",{children:S.name})]},S.id))]})]}),(0,$.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:J,children:[(0,$.jsx)("button",{className:`nb-toolbar-btn${_?" nb-toolbar-btn--active":""}`,onClick:()=>g(S=>!S),children:u("fields")}),_&&(0,$.jsxs)("div",{className:"nb-fields-dropdown",children:[(0,$.jsx)("div",{className:"nb-fields-dropdown-label",children:u("fields_on_bars")}),d.schema.map(S=>(0,$.jsxs)("label",{className:"nb-field-row",children:[(0,$.jsx)("input",{type:"checkbox",className:"nb-field-checkbox",checked:S.visible&&!c.hiddenColumns.includes(S.id),onChange:()=>{Fe(S.id)}}),(0,$.jsx)("span",{className:"nb-field-icon",children:Qe(S.type)}),(0,$.jsx)("span",{className:"nb-field-name",children:S.name})]},S.id))]})]}),(0,$.jsxs)("div",{className:"nb-cal-nav",children:[(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:bt,title:u("timeline_scroll_prev"),children:"\u2039"}),(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-today-btn",onClick:mt,children:u("calendar_today")}),(0,$.jsx)("button",{className:"nb-toolbar-btn nb-cal-nav-arrow",onClick:cn,title:u("timeline_scroll_next"),children:"\u203A"})]}),(0,$.jsx)("div",{className:"nb-tl-zoom-group",children:["days","weeks","months"].map(S=>(0,$.jsx)("button",{className:`nb-tl-zoom-btn${Le===S?" nb-tl-zoom-btn--active":""}`,onClick:()=>{ye({...c,timelineZoom:S})},children:yb()[S]},S))}),(0,$.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${c.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{ye({...c,includeSubfolders:!c.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,$.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,$.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,$.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,$.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,$.jsxs)("span",{className:"nb-row-count",children:[me.length," ",me.length===1?u("item_singular").toLowerCase():u("item_plural").toLowerCase()]}),(0,$.jsx)(Or,{status:i}),(0,$.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:O,style:{marginLeft:"auto"},children:[(0,$.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon${h?" nb-toolbar-btn--active":""}`,onClick:()=>b(S=>!S),title:u("filters"),children:[(0,$.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,$.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),f.length>0&&(0,$.jsx)("span",{className:"nb-hidden-badge",children:f.length})]}),h&&(0,$.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,$.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>we("_title","Nome","\u{1F4C4}","title"),children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,$.jsx)("span",{children:u("name_column")})]}),d.schema.map(S=>(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>we(S.id,S.name,Qe(S.type),S.type),children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:Qe(S.type)}),(0,$.jsx)("span",{children:S.name})]},S.id))]})]})]}),(0,$.jsx)(_o,{activeFilters:f,schema:d.schema,onUpdate:ee,onRemove:A,onToggleConjunction:Me,collapsed:!!c.filtersCollapsed,onToggleCollapsed:()=>{ye({...c,filtersCollapsed:!c.filtersCollapsed})}})]});return(0,$.jsxs)("div",{className:"nb-container",children:[te,je?(0,$.jsx)("div",{className:"nb-tl-body",ref:Ie,children:(0,$.jsxs)("div",{className:"nb-tl-canvas-wrapper",style:{width:vb+it},children:[(0,$.jsxs)("div",{className:"nb-tl-sidebar",style:{width:vb},children:[(0,$.jsx)("div",{className:"nb-tl-sidebar-corner",style:{height:tc}}),Ft.map((S,Q)=>S.kind==="group"?(0,$.jsxs)("div",{className:"nb-tl-sidebar-row nb-tl-sidebar-group",style:{height:bb},children:[S.color&&(0,$.jsx)("span",{className:"nb-tl-group-dot",style:{background:S.color}}),(0,$.jsx)("span",{children:S.label})]},`sg-${Q}`):(0,$.jsxs)("div",{className:"nb-tl-sidebar-row",style:{height:Am},onClick:()=>{r.workspace.getLeaf().openFile(S.row._file)},children:[(0,$.jsx)("span",{className:"nb-tl-row-label",children:S.row._title}),(()=>{let he=e?.parent?.path??"",be=S.row._file.parent?.path??"",xe=c.includeSubfolders&&be.length>he.length?be.slice(he.length+1):"";return xe?(0,$.jsx)("div",{className:"nb-folder-path",children:xe}):null})()]},S.row._file.path))]}),(0,$.jsxs)("div",{className:"nb-tl-right",style:{width:it},children:[(0,$.jsxs)("div",{className:"nb-tl-header",style:{height:tc},children:[(0,$.jsx)("div",{className:"nb-tl-header-row",style:{height:tc/2,borderBottom:"1px solid var(--background-modifier-border)"},children:Je.top.map(S=>(0,$.jsx)("div",{className:"nb-tl-header-top-cell",style:{left:S.left,width:S.width},children:S.label},S.key))}),(0,$.jsx)("div",{className:"nb-tl-header-row",style:{height:tc/2},children:Je.bottom.map(S=>(0,$.jsx)("div",{className:"nb-tl-header-bottom-cell",style:{left:S.left,width:S.width},children:S.label},S.key))})]}),(0,$.jsxs)("div",{style:{position:"relative",width:it},children:[Y&&(0,$.jsx)("div",{className:"nb-tl-today-line",style:{left:R}}),Ft.map((S,Q)=>S.kind==="group"?(0,$.jsx)("div",{className:"nb-tl-group-row",style:{height:bb}},`gr-${Q}`):(0,$.jsx)("div",{className:`nb-tl-row${Q%2===0?"":" nb-tl-row--odd"}`,style:{height:Am},children:S.barLeft!==null&&S.barWidth!==null&&(()=>{let he=ce?.filePath===S.row._file.path,be=S.barLeft,xe=S.barWidth;return he&&ce&&(ce.handle==="left"?(be=S.barLeft+De,xe=S.barWidth-De):xe=S.barWidth+De),xe=Math.max(8,xe),(0,$.jsx)(iN,{row:S.row,barLeft:be,barWidth:xe,origBarLeft:S.barLeft,origBarWidth:S.barWidth,isMobile:dn,visibleCols:Oe,dbFolderPath:Jt,includeSubfolders:c.includeSubfolders??!1,startFieldId:je?.id??null,endFieldId:qe?.id??null,onOpen:en,onContextMenu:x,onResizeStart:N})})()},S.row._file.path))]})]})]})}):(0,$.jsx)("div",{className:"nb-cal-no-field",children:(0,$.jsx)("p",{children:u("timeline_no_start_field")})}),vt.length>0&&(0,$.jsxs)("div",{className:"nb-tl-no-interval",children:[(0,$.jsxs)("div",{className:"nb-tl-no-interval-title",onClick:()=>ne(S=>!S),children:[re?"\u25BE":"\u25B8"," ",u("timeline_no_interval")," (",vt.length,")"]}),re&&(0,$.jsx)("div",{className:"nb-tl-no-interval-list",children:vt.map(S=>(0,$.jsx)("div",{className:"nb-cal-card nb-cal-card--no-date",onClick:()=>{r.workspace.getLeaf().openFile(S._file)},children:(0,$.jsx)("span",{className:"nb-cal-card-title",children:S._title})},S._file.path))})]}),(0,$.jsxs)(dt,{open:H!==null,onClose:()=>X(null),title:H?.basename??"",children:[(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>{H&&r.workspace.getLeaf().openFile(H),X(null)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,$.jsx)("span",{children:u("open_note")})]}),(0,$.jsxs)("button",{className:"nb-menu-item",onClick:()=>{H&&t.duplicateNotes([H]),X(null)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4CB}"}),(0,$.jsx)("span",{children:u("duplicate_note")})]}),(0,$.jsx)("div",{className:"nb-menu-separator"}),(0,$.jsxs)("button",{className:"nb-menu-item nb-menu-item--danger",onClick:()=>{H&&t.deleteNotes([H]),X(null)},children:[(0,$.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F5D1}"}),(0,$.jsx)("span",{children:u("delete_note")})]})]})]})}var Ct=Re(xt(),1),Sb=Re(uo(),1);var z=Re(St(),1),Ol=["#4c6ef5","#7950f2","#e64980","#f76707","#fab005","#40c057","#15aabf","#be4bdb","#fd7e14","#20c997","#228be6","#845ef7","#f06595","#ff922b","#fcc419","#51cf66","#22b8cf","#cc5de8","#ff6b6b","#38d9a9"];function Nb(e){let t=Math.abs(e);return t>=1e6?(e/1e6).toFixed(1).replace(/\.0$/,"")+"M":t>=1e4?(e/1e3).toFixed(0)+"k":t>=1e3?(e/1e3).toFixed(1).replace(/\.0$/,"")+"k":Number.isInteger(e)?String(e):e.toFixed(1)}function $m(e){return Number.isInteger(e)?e.toLocaleString():e.toLocaleString(void 0,{maximumFractionDigits:2})}function xb(e,t){if(e<=t&&Number.isInteger(e))return Array.from({length:Math.floor(e)+1},(l,s)=>s);let n=e/t,o=Math.pow(10,Math.floor(Math.log10(n))),r=n/o,i=r<=1.5?o:r<=3?2*o:r<=7?5*o:10*o,a=[];for(let l=0;l<=e+i*.01;l+=i)a.push(Math.round(l*1e3)/1e3);return a[a.length-1]<e&&a.push(a[a.length-1]+i),a}function aN(e,t,n,o,r){let i=new Map;for(let s of e){let d=t==="_title"?s._title:s[t],p=Array.isArray(d)?d:[d==null?u("no_value"):String(d)];for(let f of p){let m=f.trim()||u("no_value"),c=i.get(m)??[];c.push(s),i.set(m,c)}}let a=[],l=0;for(let[s,d]of i){let p;if(!n||n==="_count")p=d.length;else{let f=d.map(m=>{let c=m[n];return typeof c=="number"?c:parseFloat(c==null?"":String(c))}).filter(m=>!isNaN(m));switch(o){case"sum":p=f.reduce((m,c)=>m+c,0);break;case"avg":p=f.length>0?f.reduce((m,c)=>m+c,0)/f.length:0;break;case"min":p=f.length>0?Math.min(...f):0;break;case"max":p=f.length>0?Math.max(...f):0;break;default:p=f.reduce((m,c)=>m+c,0);break}}a.push({label:s,value:p,color:Ol[l%Ol.length]}),l++}return a}function lN({data:e,width:t,height:n}){if(e.length===0)return(0,z.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o={top:20,right:20,bottom:60,left:60},r=t-o.left-o.right,i=n-o.top-o.bottom,a=Math.max(...e.map(v=>v.value),1),l=Math.min(Math.max(r/e.length-4,8),60),s=e.length*(l+4),d=Math.max((r-s)/2,0),p=xb(a,5),f=p[p.length-1]||a,[m,c]=(0,Ct.useState)(null);return(0,z.jsxs)("g",{transform:`translate(${o.left},${o.top})`,children:[p.map((v,h)=>{let b=i-v/f*i;return(0,z.jsxs)("g",{children:[(0,z.jsx)("line",{x1:0,y1:b,x2:r,y2:b,stroke:"var(--background-modifier-border)",strokeDasharray:"2,2"}),(0,z.jsx)("text",{x:-8,y:b+4,textAnchor:"end",fontSize:11,fill:"var(--text-muted)",children:Nb(v)})]},h)}),e.map((v,h)=>{let b=v.value/f*i,_=d+h*(l+4),g=i-b,y=`${v.label}: ${$m(v.value)}`,k=Math.max(y.length*7,60);return(0,z.jsxs)("g",{onMouseEnter:()=>c(h),onMouseLeave:()=>c(null),children:[(0,z.jsx)("rect",{x:_,y:g,width:l,height:b,rx:2,fill:v.color,opacity:m===null||m===h?1:.4,style:{transition:"opacity 0.15s, height 0.3s, y 0.3s"}}),(0,z.jsx)("text",{x:_+l/2,y:i+14,textAnchor:"end",fontSize:11,fill:"var(--text-normal)",transform:`rotate(-35, ${_+l/2}, ${i+14})`,children:v.label.length>12?v.label.slice(0,11)+"\u2026":v.label}),m===h&&(0,z.jsxs)("g",{children:[(0,z.jsx)("rect",{x:_+l/2-k/2,y:g-28,width:k,height:22,rx:4,fill:"var(--background-primary)",stroke:"var(--background-modifier-border)"}),(0,z.jsx)("text",{x:_+l/2,y:g-13,textAnchor:"middle",fontSize:12,fontWeight:"600",fill:"var(--text-normal)",children:y})]})]},h)}),(0,z.jsx)("line",{x1:0,y1:0,x2:0,y2:i,stroke:"var(--background-modifier-border)"}),(0,z.jsx)("line",{x1:0,y1:i,x2:r,y2:i,stroke:"var(--background-modifier-border)"})]})}function sN({data:e,width:t,height:n}){if(e.length===0)return(0,z.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o=e.reduce((c,v)=>c+v.value,0);if(o===0)return(0,z.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let r=t*.4,i=n/2,a=Math.min(r,i)-20,[l,s]=(0,Ct.useState)(null),d=-Math.PI/2,p=e.map((c,v)=>{let h=c.value/o*2*Math.PI,b=d;d+=h;let _=d,g=r+a*Math.cos(b),y=i+a*Math.sin(b),k=r+a*Math.cos(_),D=i+a*Math.sin(_),M=h>Math.PI?1:0,V=b+h/2,j=a+16,re=r+j*Math.cos(V),ne=i+j*Math.sin(V),ce=e.length===1?`M ${r+a} ${i} A ${a} ${a} 0 1 1 ${r+a-.001} ${i}`:`M ${r} ${i} L ${g} ${y} A ${a} ${a} 0 ${M} 1 ${k} ${D} Z`,de=l===v,De=de?"scale(1.04)":"scale(1)",Ve=(c.value/o*100).toFixed(1);return(0,z.jsxs)("g",{onMouseEnter:()=>s(v),onMouseLeave:()=>s(null),style:{transformOrigin:`${r}px ${i}px`,transform:De,transition:"transform 0.15s"},children:[(0,z.jsx)("path",{d:ce,fill:c.color,opacity:l===null||de?1:.5,stroke:"var(--background-primary)",strokeWidth:2}),h>.3&&(0,z.jsxs)("text",{x:re,y:ne,textAnchor:"middle",fontSize:11,fill:"var(--text-muted)",children:[Ve,"%"]})]},v)}),f=t*.75,m=e.slice(0,12);return(0,z.jsxs)("g",{children:[p,m.map((c,v)=>(0,z.jsxs)("g",{transform:`translate(${f}, ${30+v*22})`,onMouseEnter:()=>s(v),onMouseLeave:()=>s(null),style:{cursor:"default"},children:[(0,z.jsx)("rect",{width:12,height:12,rx:2,fill:c.color}),(0,z.jsxs)("text",{x:18,y:10,fontSize:12,fill:"var(--text-normal)",children:[c.label.length>16?c.label.slice(0,15)+"\u2026":c.label," (",$m(c.value),")"]})]},v)),e.length>12&&(0,z.jsxs)("text",{x:f,y:304,fontSize:11,fill:"var(--text-muted)",children:["+",e.length-12," ",u("board_show_more").toLowerCase()]})]})}function uN({data:e,width:t,height:n}){if(e.length===0)return(0,z.jsx)("text",{x:t/2,y:n/2,textAnchor:"middle",fill:"var(--text-muted)",children:u("no_results")});let o={top:20,right:20,bottom:60,left:60},r=t-o.left-o.right,i=n-o.top-o.bottom,a=Math.max(...e.map(_=>_.value),1),l=30,s=r-l*2,d=e.length>1?s/(e.length-1):0,p=xb(a,5),f=p[p.length-1]||a,[m,c]=(0,Ct.useState)(null),v=e.map((_,g)=>({x:l+(e.length===1?s/2:g*d),y:i-_.value/f*i})),h=v.map(_=>`${_.x},${_.y}`).join(" "),b=`M ${v[0].x} ${i} `+v.map(_=>`L ${_.x} ${_.y}`).join(" ")+` L ${v[v.length-1].x} ${i} Z`;return(0,z.jsxs)("g",{transform:`translate(${o.left},${o.top})`,children:[p.map((_,g)=>{let y=i-_/f*i;return(0,z.jsxs)("g",{children:[(0,z.jsx)("line",{x1:0,y1:y,x2:r,y2:y,stroke:"var(--background-modifier-border)",strokeDasharray:"2,2"}),(0,z.jsx)("text",{x:-8,y:y+4,textAnchor:"end",fontSize:11,fill:"var(--text-muted)",children:Nb(_)})]},g)}),(0,z.jsx)("path",{d:b,fill:Ol[0],opacity:.1}),(0,z.jsx)("polyline",{points:h,fill:"none",stroke:Ol[0],strokeWidth:2.5,strokeLinejoin:"round",strokeLinecap:"round"}),e.map((_,g)=>{let y=`${_.label}: ${$m(_.value)}`,k=Math.max(y.length*7,60);return(0,z.jsxs)("g",{onMouseEnter:()=>c(g),onMouseLeave:()=>c(null),children:[(0,z.jsx)("circle",{cx:v[g].x,cy:v[g].y,r:m===g?6:4,fill:Ol[0],stroke:"var(--background-primary)",strokeWidth:2,style:{transition:"r 0.15s"}}),(0,z.jsx)("text",{x:v[g].x,y:i+14,textAnchor:"end",fontSize:11,fill:"var(--text-normal)",transform:`rotate(-35, ${v[g].x}, ${i+14})`,children:_.label.length>12?_.label.slice(0,11)+"\u2026":_.label}),m===g&&(0,z.jsxs)("g",{children:[(0,z.jsx)("rect",{x:v[g].x-k/2,y:v[g].y-28,width:k,height:22,rx:4,fill:"var(--background-primary)",stroke:"var(--background-modifier-border)"}),(0,z.jsx)("text",{x:v[g].x,y:v[g].y-13,textAnchor:"middle",fontSize:12,fontWeight:"600",fill:"var(--text-normal)",children:y})]})]},g)}),(0,z.jsx)("line",{x1:0,y1:0,x2:0,y2:i,stroke:"var(--background-modifier-border)"}),(0,z.jsx)("line",{x1:0,y1:i,x2:r,y2:i,stroke:"var(--background-modifier-border)"})]})}function cN({sorts:e,schema:t,onSortChange:n,onClose:o,anchorRect:r,panelRef:i}){let[a,l]=(0,Ct.useState)({x:r.right-280,y:r.bottom+4}),s=c=>{c.preventDefault();let v=c.clientX-a.x,h=c.clientY-a.y,b=g=>l({x:g.clientX-v,y:g.clientY-h}),_=()=>{window.removeEventListener("mousemove",b),window.removeEventListener("mouseup",_)};window.addEventListener("mousemove",b),window.addEventListener("mouseup",_)},d=t.filter(c=>c.type!=="formula"&&c.type!=="lookup"&&c.type!=="relation"&&c.type!=="multiselect"),p=new Set(e.map(c=>c.columnId)),f=[...p.has("_title")?[]:[{id:"_title",name:"Nome"}],...d.filter(c=>!p.has(c.id)).map(c=>({id:c.id,name:c.name}))],m=(c,v)=>{let h=[...e],b=c+v;b<0||b>=h.length||([h[c],h[b]]=[h[b],h[c]],n(h))};return(0,Sb.createPortal)((0,z.jsxs)("div",{ref:i,className:"nb-sort-panel",style:{position:"fixed",top:a.y,left:a.x},children:[(0,z.jsxs)("div",{className:"nb-sort-panel-titlebar",onMouseDown:s,children:[(0,z.jsx)("span",{className:"nb-sort-panel-title",children:u("sort_by")}),(0,z.jsx)("button",{className:"nb-sort-panel-close",onClick:o,title:u("tooltip_close"),children:"\xD7"})]}),e.length===0&&(0,z.jsx)("div",{className:"nb-sort-panel-empty",children:u("no_active_sorts")}),e.map((c,v)=>{let h=c.columnId==="_title"?"Nome":t.find(b=>b.id===c.columnId)?.name??c.columnId;return(0,z.jsxs)("div",{className:"nb-sort-row",children:[(0,z.jsxs)("div",{className:"nb-sort-row-priority",children:[(0,z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,-1),disabled:v===0,title:u("tooltip_move_up"),children:"\u2191"}),(0,z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>m(v,1),disabled:v===e.length-1,title:u("tooltip_move_down"),children:"\u2193"})]}),(0,z.jsx)("span",{className:"nb-sort-row-name",children:h}),(0,z.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>n(e.map(b=>b.columnId===c.columnId?{...b,direction:b.direction==="asc"?"desc":"asc"}:b)),children:c.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,z.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>n(e.filter(b=>b.columnId!==c.columnId)),title:u("tooltip_remove"),children:"\xD7"})]},c.columnId)}),f.length>0&&(0,z.jsx)("div",{className:"nb-sort-add-row",children:(0,z.jsxs)("select",{className:"nb-sort-add-select",value:"",onChange:c=>{c.target.value&&(n([...e,{columnId:c.target.value,direction:"asc"}]),c.target.value="")},children:[(0,z.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),f.map(c=>(0,z.jsx)("option",{value:c.id,children:c.name},c.id))]})})]}),document.body)}function kb(){return(0,z.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,z.jsx)("rect",{x:"3",y:"12",width:"4",height:"9"}),(0,z.jsx)("rect",{x:"10",y:"5",width:"4",height:"16"}),(0,z.jsx)("rect",{x:"17",y:"9",width:"4",height:"12"})]})}function dN(){return(0,z.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,z.jsx)("polyline",{points:"3 18 9 11 13 15 21 5"})})}function pN(){return(0,z.jsxs)("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,z.jsx)("path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83"}),(0,z.jsx)("path",{d:"M22 12A10 10 0 0 0 12 2v10z"})]})}function Rb({dbFile:e,manager:t,externalView:n,onViewChange:o}){let r=zt(),{rows:i,config:a,loading:l,activeFilters:s,setActiveFilters:d}=Vn({app:r,dbFile:e,manager:t,includeSubfolders:n.includeSubfolders,externalView:n}),[p,f]=(0,Ct.useState)(n),[m,c]=(0,Ct.useState)(!1),[v,h]=(0,Ct.useState)(!1),[b,_]=(0,Ct.useState)(null),[g,y]=(0,Ct.useState)(!1),k=(0,Ct.useRef)(null),D=(0,Ct.useRef)(null),M=(0,Ct.useRef)(null),V=(0,Ct.useRef)(null),j=(0,Ct.useRef)(null),re=(0,Ct.useRef)(null),[ne,ce]=(0,Ct.useState)({width:600,height:400});(0,Ct.useEffect)(()=>{f(n)},[n.id]);let de=(0,Ct.useCallback)(async R=>{f(R),await o(R)},[o]),De=p.chartType??"bar",Ve=p.chartXAxis??"",H=p.chartYAxis??"_count",X=p.chartAggregation??"count";(0,Ct.useEffect)(()=>{let R=re.current;if(!R)return;let G=new ResizeObserver(me=>{for(let ae of me){let je=ae.contentRect.width,qe=Math.max(ae.contentRect.height,300);ce({width:Math.max(je,300),height:Math.min(qe,600)})}});return G.observe(R),()=>G.disconnect()},[l]),(0,Ct.useEffect)(()=>{if(!m)return;let R=G=>{j.current?.contains(G.target)||k.current&&!k.current.contains(G.target)&&c(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[m]),(0,Ct.useEffect)(()=>{if(!v)return;let R=G=>{j.current?.contains(G.target)||M.current?.contains(G.target)||D.current&&!D.current.contains(G.target)&&h(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[v]),(0,Ct.useEffect)(()=>{if(!g)return;let R=G=>{j.current?.contains(G.target)||V.current&&!V.current.contains(G.target)&&y(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[g]);let O=(0,Ct.useCallback)(async R=>{let G=R.map(me=>({id:me.id,columnId:me.columnId,operator:me.operator,value:me.value,conjunction:me.conjunction}));await de({...p,activePills:G})},[de,p]),J=(R,G,me,ae)=>{let je=[...s,{id:crypto.randomUUID(),columnId:R,columnName:G,columnType:ae,icon:me,operator:Tn(ae),value:"",conjunction:"and"}];d(je),O(je),c(!1)},ue=R=>{let G=s.filter(me=>me.id!==R);d(G),O(G)},Se=(R,G,me)=>{let ae=s.map(je=>je.id===R?{...je,operator:G,value:me}:je);d(ae),O(ae)},$e=R=>{let G=s.map(me=>me.id===R?{...me,conjunction:me.conjunction==="and"?"or":"and"}:me);d(G),O(G)},Ie=(0,Ct.useCallback)(async R=>{await de({...p,sorts:R})},[p,de]),ot=Bn(s,200),Ge=(0,Ct.useMemo)(()=>mo(i,ot),[i,ot]),ye=(0,Ct.useMemo)(()=>to(Ge,p.sorts),[Ge,p.sorts]),Ee=(0,Ct.useMemo)(()=>{if(!Ve)return[];let R=aN(ye,Ve,H==="_count"?void 0:H,X,a.schema);return p.sorts.length===0&&R.sort((G,me)=>me.value-G.value),R},[ye,Ve,H,X,a.schema,p.sorts.length]),Le=(0,Ct.useMemo)(()=>{let R=a.schema.filter(G=>G.visible&&["text","select","multiselect","status","date","checkbox"].includes(G.type));return[{id:"_title",name:u("name_column"),type:"title"},...R]},[a.schema]),Be=(0,Ct.useMemo)(()=>{let R=a.schema.filter(G=>G.visible&&G.type==="number");return[{id:"_count",name:u("chart_count_records"),type:"count"},...R]},[a.schema]),Ae=Cn();if(!e)return(0,z.jsx)("div",{className:"nb-empty-state",children:(0,z.jsx)("p",{children:u("no_database_open")})});if(l)return(0,z.jsx)("div",{className:"nb-loading",children:u("loading")});let Ne=R=>{R!=="filter"&&c(!1),R!=="sort"&&h(!1),R!=="config"&&y(!1)},it=(0,z.jsxs)("div",{className:"nb-chart-config-body",children:[(0,z.jsxs)("div",{className:"nb-chart-config-row",children:[(0,z.jsx)("label",{className:"nb-chart-config-label",children:u("chart_type")}),(0,z.jsx)("div",{className:"nb-chart-type-btns",children:["bar","line","pie"].map(R=>(0,z.jsxs)("button",{className:`nb-chart-type-btn${De===R?" nb-chart-type-btn--active":""}`,onClick:()=>{de({...p,chartType:R})},title:u(`chart_type_${R}`),children:[R==="bar"&&(0,z.jsx)(kb,{}),R==="line"&&(0,z.jsx)(dN,{}),R==="pie"&&(0,z.jsx)(pN,{})]},R))})]}),(0,z.jsxs)("div",{className:"nb-chart-config-row",children:[(0,z.jsx)("label",{className:"nb-chart-config-label",children:u("chart_x_axis")}),(0,z.jsxs)("select",{className:"nb-chart-config-select",value:Ve,onChange:R=>{de({...p,chartXAxis:R.target.value})},children:[(0,z.jsx)("option",{value:"",children:u("chart_select_column")}),Le.map(R=>(0,z.jsx)("option",{value:R.id,children:R.name},R.id))]})]}),(0,z.jsxs)("div",{className:"nb-chart-config-row",children:[(0,z.jsx)("label",{className:"nb-chart-config-label",children:u("chart_y_axis")}),(0,z.jsx)("select",{className:"nb-chart-config-select",value:H,onChange:R=>{de({...p,chartYAxis:R.target.value})},children:Be.map(R=>(0,z.jsx)("option",{value:R.id,children:R.name},R.id))})]}),H!=="_count"&&(0,z.jsxs)("div",{className:"nb-chart-config-row",children:[(0,z.jsx)("label",{className:"nb-chart-config-label",children:u("chart_aggregation")}),(0,z.jsxs)("select",{className:"nb-chart-config-select",value:X,onChange:R=>{de({...p,chartAggregation:R.target.value})},children:[(0,z.jsx)("option",{value:"sum",children:u("agg_sum")}),(0,z.jsx)("option",{value:"avg",children:u("agg_avg")}),(0,z.jsx)("option",{value:"min",children:u("agg_min")}),(0,z.jsx)("option",{value:"max",children:u("agg_max")})]})]})]}),Je=Ae?(0,z.jsxs)(Un,{actionBarRef:j,actions:[{id:"config",label:u("chart_configure"),icon:(0,z.jsx)(kb,{}),active:g,onClick:()=>{Ne("config"),y(R=>!R)}},{id:"subfolders",label:u("tooltip_include_subfolders"),icon:(0,z.jsx)(Hn,{}),active:!!p.includeSubfolders,onClick:()=>{Ne(),de({...p,includeSubfolders:!p.includeSubfolders})}},{id:"sort",label:u("sort"),icon:(0,z.jsx)(go,{}),active:p.sorts.length>0,badge:p.sorts.length||void 0,onClick:()=>{Ne("sort"),!v&&M.current&&_(M.current.getBoundingClientRect()),h(R=>!R)}},{id:"filter",label:u("filter"),icon:(0,z.jsx)(jn,{}),active:m,badge:s.length||void 0,onClick:()=>{Ne("filter"),c(R=>!R)}}],rowCount:ye.length,rowCountLabel:ye.length===1?u("record_singular").toLowerCase():u("record_plural").toLowerCase(),filters:s,onFilterUpdate:Se,onFilterRemove:ue,onConjunctionToggle:$e,children:[(0,z.jsx)(dt,{open:g,onClose:()=>y(!1),title:u("chart_configure"),children:it}),(0,z.jsxs)(dt,{open:m,onClose:()=>c(!1),title:u("filter"),children:[(0,z.jsxs)("button",{className:"nb-menu-item",onClick:()=>J("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,z.jsx)("span",{children:u("name_column")})]}),a.schema.map(R=>(0,z.jsxs)("button",{className:"nb-menu-item",onClick:()=>J(R.id,R.name,Qe(R.type),R.type),children:[(0,z.jsx)("span",{className:"nb-menu-item-icon",children:Qe(R.type)}),(0,z.jsx)("span",{children:R.name})]},R.id))]}),(0,z.jsxs)(dt,{open:v,onClose:()=>h(!1),title:u("sort"),children:[p.sorts.length===0&&(0,z.jsx)("div",{className:"nb-sort-panel-empty",style:{padding:"8px 0"},children:u("no_active_sorts")}),p.sorts.map((R,G)=>{let me=R.columnId==="_title"?"Nome":a.schema.find(ae=>ae.id===R.columnId)?.name??R.columnId;return(0,z.jsxs)("div",{className:"nb-sort-row",style:{display:"flex",alignItems:"center",gap:"8px",padding:"6px 0",minHeight:"44px"},children:[(0,z.jsxs)("div",{className:"nb-sort-row-priority",style:{display:"flex",flexDirection:"column",gap:"2px"},children:[(0,z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ae=[...p.sorts];G>0&&([ae[G],ae[G-1]]=[ae[G-1],ae[G]],Ie(ae))},disabled:G===0,children:"\u2191"}),(0,z.jsx)("button",{className:"nb-sort-priority-btn",onClick:()=>{let ae=[...p.sorts];G<ae.length-1&&([ae[G],ae[G+1]]=[ae[G+1],ae[G]],Ie(ae))},disabled:G===p.sorts.length-1,children:"\u2193"})]}),(0,z.jsx)("span",{style:{flex:1},children:me}),(0,z.jsx)("button",{className:"nb-sort-dir-btn",onClick:()=>{Ie(p.sorts.map(ae=>ae.columnId===R.columnId?{...ae,direction:ae.direction==="asc"?"desc":"asc"}:ae))},children:R.direction==="asc"?u("sort_asc"):u("sort_desc")}),(0,z.jsx)("button",{className:"nb-sort-remove-btn",onClick:()=>{Ie(p.sorts.filter(ae=>ae.columnId!==R.columnId))},children:"\xD7"})]},R.columnId)}),(()=>{let R=a.schema.filter(ae=>ae.type!=="formula"&&ae.type!=="lookup"&&ae.type!=="relation"&&ae.type!=="multiselect"),G=new Set(p.sorts.map(ae=>ae.columnId)),me=[...G.has("_title")?[]:[{id:"_title",name:"Nome"}],...R.filter(ae=>!G.has(ae.id)).map(ae=>({id:ae.id,name:ae.name}))];return me.length===0?null:(0,z.jsxs)("select",{className:"nb-mobile-filter-overlay-select",style:{width:"100%",marginTop:"8px",padding:"10px"},value:"",onChange:ae=>{ae.target.value&&(Ie([...p.sorts,{columnId:ae.target.value,direction:"asc"}]),ae.target.value="")},children:[(0,z.jsx)("option",{value:"",children:"+ "+u("add_sort")+"..."}),me.map(ae=>(0,z.jsx)("option",{value:ae.id,children:ae.name},ae.id))]})})()]})]}):(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)("div",{className:"nb-toolbar",children:[(0,z.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:V,children:[(0,z.jsx)("button",{className:`nb-toolbar-btn ${g?"nb-toolbar-btn--active":""}`,onClick:()=>y(R=>!R),children:u("chart_configure")}),g&&(0,z.jsxs)("div",{className:"nb-fields-dropdown nb-chart-config-dropdown",children:[(0,z.jsx)("div",{className:"nb-fields-dropdown-label",children:u("chart_configure")}),it]})]}),(0,z.jsx)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon nb-subfolder-toggle ${p.includeSubfolders?"nb-toolbar-btn--active":""}`,onClick:()=>{de({...p,includeSubfolders:!p.includeSubfolders})},title:u("tooltip_include_subfolders"),children:(0,z.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,z.jsx)("path",{d:"M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z"}),(0,z.jsx)("line",{x1:"12",y1:"11",x2:"12",y2:"17"}),(0,z.jsx)("line",{x1:"9",y1:"14",x2:"15",y2:"14"})]})}),(0,z.jsxs)("span",{className:"nb-row-count",children:[ye.length," ",ye.length===1?u("record_singular").toLowerCase():u("record_plural").toLowerCase()]}),(0,z.jsxs)("div",{className:"nb-fields-menu-wrapper",ref:k,style:{marginLeft:"auto"},children:[(0,z.jsxs)("button",{className:`nb-toolbar-btn nb-toolbar-btn--icon ${m?"nb-toolbar-btn--active":""}`,onClick:()=>c(R=>!R),title:u("filters"),children:[(0,z.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:(0,z.jsx)("polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"})}),s.length>0&&(0,z.jsx)("span",{className:"nb-hidden-badge",children:s.length})]}),m&&(0,z.jsxs)("div",{className:"nb-fields-dropdown nb-filter-menu-dropdown",children:[(0,z.jsx)("div",{className:"nb-fields-dropdown-label",children:u("filter_by")}),(0,z.jsxs)("button",{className:"nb-menu-item",onClick:()=>J("_title",u("name_column"),"\u{1F4C4}","title"),children:[(0,z.jsx)("span",{className:"nb-menu-item-icon",children:"\u{1F4C4}"}),(0,z.jsx)("span",{children:u("name_column")})]}),a.schema.map(R=>(0,z.jsxs)("button",{className:"nb-menu-item",onClick:()=>J(R.id,R.name,Qe(R.type),R.type),children:[(0,z.jsx)("span",{className:"nb-menu-item-icon",children:Qe(R.type)}),(0,z.jsx)("span",{children:R.name})]},R.id))]})]}),(0,z.jsxs)("button",{ref:M,className:`nb-toolbar-btn${p.sorts.length>0?" nb-toolbar-btn--active":""}`,onClick:()=>{!v&&M.current&&_(M.current.getBoundingClientRect()),h(R=>!R)},children:[(0,z.jsx)("span",{children:u("sort")}),p.sorts.length>0&&(0,z.jsx)("span",{className:"nb-hidden-badge",children:p.sorts.length})]}),v&&b&&(0,z.jsx)(cN,{sorts:p.sorts,schema:a.schema,onSortChange:R=>{Ie(R)},onClose:()=>h(!1),anchorRect:b,panelRef:D})]}),(0,z.jsx)(_o,{activeFilters:s,schema:a.schema,onUpdate:Se,onRemove:ue,onToggleConjunction:$e,collapsed:!!p.filtersCollapsed,onToggleCollapsed:()=>{de({...p,filtersCollapsed:!p.filtersCollapsed})}})]});return Ve?(0,z.jsxs)("div",{className:"nb-container",children:[Je,(0,z.jsx)("div",{className:"nb-chart-wrapper",ref:re,children:(0,z.jsxs)("svg",{className:"nb-chart-svg",width:ne.width,height:ne.height,viewBox:`0 0 ${ne.width} ${ne.height}`,children:[De==="bar"&&(0,z.jsx)(lN,{data:Ee,width:ne.width,height:ne.height}),De==="pie"&&(0,z.jsx)(sN,{data:Ee,width:ne.width,height:ne.height}),De==="line"&&(0,z.jsx)(uN,{data:Ee,width:ne.width,height:ne.height})]})})]}):(0,z.jsxs)("div",{className:"nb-container",children:[Je,(0,z.jsxs)("div",{className:"nb-chart-empty",children:[(0,z.jsx)("p",{children:u("chart_no_config")}),(0,z.jsx)("p",{className:"nb-chart-empty-hint",children:u("chart_no_config_hint")})]})]})}var ct=Re(St(),1),nc={table:"\u229E",list:"\u2261",board:"\u25A6",gallery:"\u229F",calendar:"\u{1F4C5}",timeline:"\u25AC",chart:"\u{1F4CA}"},jr=()=>({table:u("view_table"),list:u("view_list"),board:u("view_board"),gallery:u("view_gallery"),calendar:u("view_calendar"),timeline:u("view_timeline"),chart:u("view_chart")});function oc({dbFile:e,manager:t,externalView:n,onViewChange:o,embedState:r,onEmbedStateChange:i}){let a=zt(),[l,s]=(0,Et.useState)(Rr),d=(0,Et.useRef)(0),p=(0,Et.useCallback)(async R=>{if(e){d.current++;try{await t.writeConfig(e,R)}finally{setTimeout(()=>{d.current=Math.max(0,d.current-1)},150)}}},[e,t]),[f,m]=(0,Et.useState)(""),[c,v]=(0,Et.useState)(!1),h=(0,Et.useRef)(null),[b,_]=(0,Et.useState)(r?.views??[]),[g,y]=(0,Et.useState)(r?.activeViewId??""),[k,D]=(0,Et.useState)(!!r),[M,V]=(0,Et.useState)(!1),j=(0,Et.useRef)(null),re=!!n,ne=!!i&&!re,ce=!re&&!ne,[de,De]=(0,Et.useState)(null),[Ve,H]=(0,Et.useState)(""),X=(0,Et.useRef)(null),[O,J]=(0,Et.useState)(null),[ue,Se]=(0,Et.useState)(null);(0,Et.useEffect)(()=>{if(!e||re)return;let R=t.readConfig(e);if(s(R),ce)m(G=>G&&R.views.some(me=>me.id===G)?G:R.views[0]?.id??"");else if(ne&&!k){let G=R.views.map(ae=>({...ae,id:crypto.randomUUID()})),me={activeViewId:G[0]?.id??"",views:G};_(G),y(G[0]?.id??""),D(!0),i(me)}},[e,t,re]),(0,Et.useEffect)(()=>{if(!e||!ce)return;let R=G=>{G===e&&(d.current>0||s(t.readConfig(e)))};return a.metadataCache.on("changed",R),()=>a.metadataCache.off("changed",R)},[e,t,a,ce]),(0,Et.useEffect)(()=>{if(!c)return;let R=G=>{h.current&&!h.current.contains(G.target)&&v(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[c]),(0,Et.useEffect)(()=>{if(!M)return;let R=G=>{j.current&&!j.current.contains(G.target)&&V(!1)};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[M]);let $e=(R,G)=>{De(R),H(G),requestAnimationFrame(()=>{X.current?.select()})},Ie=(0,Et.useCallback)(async(R,G,me)=>{if(!de)return;let ae=G.trim();if(ae){let je=R.map(qe=>qe.id===de?{...qe,name:ae}:qe);await me(je)}De(null)},[de]),ot=(R,G,me)=>{let ae=R.findIndex(Oe=>Oe.id===G),je=R.findIndex(Oe=>Oe.id===me);if(ae<0||je<0)return R;let qe=[...R],[_e]=qe.splice(ae,1);return qe.splice(je,0,_e),qe},Ge=async R=>{if(Se(null),!O||O===R||!e){J(null);return}let G=ot(l.views,O,R),me={...l,views:G};s(me),J(null),await p(me)},ye=async R=>{if(Se(null),!O||O===R){J(null);return}let G=ot(b,O,R);_(G),J(null),await i({activeViewId:g,views:G})};function Ee(R,G,me){let ae={key:me,dbFile:e,manager:t,externalView:R,onViewChange:G};return R.type==="list"?(0,ct.jsx)(ub,{...ae}):R.type==="board"?(0,ct.jsx)(cb,{...ae}):R.type==="gallery"?(0,ct.jsx)(mb,{...ae}):R.type==="calendar"?(0,ct.jsx)(hb,{...ae}):R.type==="timeline"?(0,ct.jsx)(Cb,{...ae}):R.type==="chart"?(0,ct.jsx)(Rb,{...ae}):(0,ct.jsx)(Mm,{dbFile:e,manager:t,externalView:R,onViewChange:G},me)}if(re)return Ee(n,o);if(ne){let R=b.find(_e=>_e.id===g)??b[0]??Jn,G=async _e=>{let Oe=b.map(vt=>vt.id===_e.id?_e:vt);_(Oe),await i({activeViewId:g,views:Oe})},me=async _e=>{let Oe={...Jn,id:crypto.randomUUID(),type:_e,name:jr()[_e]??_e,filters:[],sorts:[],hiddenColumns:[],columnWidths:{}},vt=[...b,Oe];_(vt),y(Oe.id),V(!1),await i({activeViewId:Oe.id,views:vt})},ae=async _e=>{if(b.length<=1)return;let Oe=b.filter(Ft=>Ft.id!==_e),vt=g===_e?Oe[0].id:g;_(Oe),y(vt),await i({activeViewId:vt,views:Oe})},je=_e=>{y(_e),i({activeViewId:_e,views:b})},qe=async _e=>{_(_e),await i({activeViewId:g,views:_e})};return(0,ct.jsxs)(Et.Fragment,{children:[(0,ct.jsxs)("div",{className:"nb-view-tabs nb-view-tabs--embed",children:[b.map(_e=>(0,ct.jsxs)("button",{className:`nb-view-tab${_e.id===g?" nb-view-tab--active":""}${ue===_e.id&&O!==_e.id?" nb-view-tab--drag-over":""}`,draggable:!0,onDragStart:()=>J(_e.id),onDragOver:Oe=>{Oe.preventDefault(),Se(_e.id)},onDragLeave:()=>Se(null),onDrop:()=>{ye(_e.id)},onDragEnd:()=>{J(null),Se(null)},onClick:()=>de!==_e.id&&je(_e.id),children:[(0,ct.jsx)("span",{className:"nb-view-tab-icon",children:nc[_e.type]??"\u25A1"}),de===_e.id?(0,ct.jsx)("input",{ref:X,className:"nb-view-tab-rename-input",value:Ve,onChange:Oe=>H(Oe.target.value),onBlur:()=>{Ie(b,Ve,qe)},onKeyDown:Oe=>{Oe.key==="Enter"&&(Oe.preventDefault(),Ie(b,Ve,qe)),Oe.key==="Escape"&&(Oe.preventDefault(),De(null))},onClick:Oe=>Oe.stopPropagation()}):(0,ct.jsx)("span",{onDoubleClick:Oe=>{Oe.stopPropagation(),$e(_e.id,_e.name??jr()[_e.type]??_e.type)},title:u("rename_view_hint"),children:_e.name??jr()[_e.type]??_e.type}),b.length>1&&de!==_e.id&&(0,ct.jsx)("span",{className:"nb-view-tab-remove",onClick:Oe=>{Oe.stopPropagation(),ae(_e.id)},title:u("remove_view"),children:"\xD7"})]},_e.id)),(0,ct.jsxs)("div",{className:"nb-view-tab-add",ref:j,children:[(0,ct.jsx)("button",{className:"nb-view-tab-add-btn",onClick:()=>V(_e=>!_e),title:u("add_view"),children:"+"}),M&&(0,ct.jsxs)("div",{className:"nb-view-add-menu nb-fields-dropdown",children:[(0,ct.jsx)("div",{className:"nb-fields-dropdown-label",children:u("add_view")}),["table","list","board","gallery","calendar","timeline","chart"].map(_e=>(0,ct.jsxs)("button",{className:"nb-menu-item",onClick:()=>{me(_e)},children:[(0,ct.jsx)("span",{className:"nb-menu-item-icon",children:nc[_e]}),(0,ct.jsx)("span",{children:jr()[_e]})]},_e))]})]})]}),Ee(R,G,g)]})}let Le=(0,Et.useCallback)(async R=>{if(!e)return;let G=l.views.map(ae=>ae.id===R.id?R:ae),me={...l,views:G};s(me),await p(me)},[l,e,p]),Be=(0,Et.useCallback)(async R=>{if(!e)return;let G=l.views.length===1,me=G?l.schema.map(Oe=>({...Oe,visible:!0})):l.schema,ae=G?{...l.views[0],hiddenColumns:[...l.views[0].hiddenColumns??[],...l.schema.filter(Oe=>!Oe.visible).map(Oe=>Oe.id)]}:l.views[0],je={...Jn,id:crypto.randomUUID(),type:R,name:jr()[R]??R,filters:[],sorts:[],hiddenColumns:[],columnWidths:{}},qe=G?[ae,je]:[...l.views,je],_e={schema:me,views:qe};s(_e),m(je.id),v(!1),await p(_e)},[l,e,p]),Ae=(0,Et.useCallback)(async R=>{if(!e||l.views.length<=1)return;let G=l.views.filter(ae=>ae.id!==R),me={...l,views:G};s(me),f===R&&m(G[0].id),await p(me)},[l,e,p,f]),Ne=l.views.find(R=>R.id===f)??l.views[0]??Jn,it=l.views.length===1&&Ne.type==="table",Je=async R=>{if(!e)return;let G={...l,views:R};s(G),await p(G)};return(0,ct.jsxs)(Et.Fragment,{children:[(0,ct.jsxs)("div",{className:"nb-view-tabs",children:[l.views.map(R=>(0,ct.jsxs)("button",{className:`nb-view-tab${R.id===f?" nb-view-tab--active":""}${ue===R.id&&O!==R.id?" nb-view-tab--drag-over":""}`,draggable:!0,onDragStart:()=>J(R.id),onDragOver:G=>{G.preventDefault(),Se(R.id)},onDragLeave:()=>Se(null),onDrop:()=>{Ge(R.id)},onDragEnd:()=>{J(null),Se(null)},onClick:()=>de!==R.id&&m(R.id),children:[(0,ct.jsx)("span",{className:"nb-view-tab-icon",children:nc[R.type]??"\u25A1"}),de===R.id?(0,ct.jsx)("input",{ref:X,className:"nb-view-tab-rename-input",value:Ve,onChange:G=>H(G.target.value),onBlur:()=>{Ie(l.views,Ve,Je)},onKeyDown:G=>{G.key==="Enter"&&(G.preventDefault(),Ie(l.views,Ve,Je)),G.key==="Escape"&&(G.preventDefault(),De(null))},onClick:G=>G.stopPropagation()}):(0,ct.jsx)("span",{onDoubleClick:G=>{G.stopPropagation(),$e(R.id,R.name??jr()[R.type]??R.type)},title:u("rename_view_hint"),children:R.name??jr()[R.type]??R.type}),l.views.length>1&&de!==R.id&&(0,ct.jsx)("span",{className:"nb-view-tab-remove",onClick:G=>{G.stopPropagation(),Ae(R.id)},title:u("remove_view"),children:"\xD7"})]},R.id)),(0,ct.jsxs)("div",{className:"nb-view-tab-add",ref:h,children:[(0,ct.jsx)("button",{className:"nb-view-tab-add-btn",onClick:()=>v(R=>!R),title:u("add_view"),children:"+"}),c&&(0,ct.jsxs)("div",{className:"nb-view-add-menu nb-fields-dropdown",children:[(0,ct.jsx)("div",{className:"nb-fields-dropdown-label",children:u("add_view")}),["table","list","board","gallery","calendar","timeline","chart"].map(R=>(0,ct.jsxs)("button",{className:"nb-menu-item",onClick:()=>{Be(R)},children:[(0,ct.jsx)("span",{className:"nb-menu-item-icon",children:nc[R]}),(0,ct.jsx)("span",{children:jr()[R]})]},R))]})]}),(0,ct.jsx)("button",{className:"nb-view-tab-settings-btn",title:u("db_settings_open"),onClick:()=>{e&&new Su(a,l,async R=>{let G={...l,...R};s(G),await p(G)},t,e).open()},children:"\u2699"})]}),Ne.type==="table"?(0,ct.jsx)(Mm,{dbFile:e,manager:t,externalView:it?void 0:Ne,onViewChange:it?void 0:Le},f):Ee(Ne,Le,f)]})}var $l="notion-bases-view",yi=class extends Eb.ItemView{constructor(n,o){super(n);this.root=null;this.dbFilePath="";this.plugin=o}getViewType(){return $l}getDisplayText(){return this.dbFilePath?this.app.vault.getFileByPath(this.dbFilePath)?.parent?.name??u("view_fallback_name"):u("plugin_display_name")}getIcon(){return"table"}async setState(n,o){n.dbFilePath&&(this.dbFilePath=n.dbFilePath),await super.setState(n,o),this.render()}getState(){return{dbFilePath:this.dbFilePath}}setDatabaseFile(n){this.dbFilePath=n.path,this.render()}getDatabaseFilePath(){return this.dbFilePath}async onOpen(){}async onClose(){this.root?.unmount(),this.root=null}render(){let n=this.containerEl.children[1];if(!n)return;this.root&&(this.root.unmount(),this.root=null),n.empty(),n.addClass("notion-bases-view-container");let o=this.dbFilePath?this.app.vault.getFileByPath(this.dbFilePath)??null:null,r=this.plugin.manager;this.root=(0,Fb.createRoot)(n),this.root.render((0,zm.createElement)(Sl.Provider,{value:this.app},(0,zm.createElement)(oc,{dbFile:o,manager:r})))}};var gn=require("obsidian");var mN=/^(`{3,}|~{3,})/,fN=/`[^`]+`/g,gN=/^([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*(.*)$/,Db=/\[([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*([^\]]*)\]/g,Tb=/\(([A-Za-z0-9\u00C0-\u024F_ -]+)::\s*([^)]*)\)/g;function _N(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?e.slice(t[0].length):e}function Mb(e){let t=e.match(/^---\r?\n[\s\S]*?\r?\n---\r?\n?/);return t?t[0].split(/\r?\n/).length-1:0}function Vm(e){return e.replace(/[*_~]/g,"").trim().toLowerCase().replace(/\s+/g,"-")}var hN=/^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}(:\d{2})?)?$/,vN=/^\[\[.+\]\]$/,bN=/^-?\d+(\.\d+)?$/;function Bm(e){let t=e.trim();return t===""?null:t==="true"?!0:t==="false"?!1:bN.test(t)?Number(t):(hN.test(t)||vN.test(t),t)}function jm(e){let n=_N(e).split(/\r?\n/),o=[],r=!1,i="";for(let a=0;a<n.length;a++){let l=n[a],s=l.match(mN);if(s){r?l.trim().startsWith(i)&&(r=!1,i=""):(r=!0,i=s[1][0]);continue}if(r)continue;let d=l.replace(fN,""),p=d.match(gN);if(p){let m=p[1].trim(),c=p[2];o.push({key:Vm(m),rawKey:m,value:Bm(c),format:"standalone",rawValue:c,lineNumber:a,fullMatch:`${m}:: ${c}`})}let f;for(Db.lastIndex=0;(f=Db.exec(d))!==null;){let m=f[1].trim(),c=f[2];o.push({key:Vm(m),rawKey:m,value:Bm(c),format:"bracketed",rawValue:c,lineNumber:a,fullMatch:`[${f[1]}:: ${c}]`})}for(Tb.lastIndex=0;(f=Tb.exec(d))!==null;){let m=f[1].trim(),c=f[2];o.push({key:Vm(m),rawKey:m,value:Bm(c),format:"parenthesized",rawValue:c,lineNumber:a,fullMatch:`(${f[1]}:: ${c})`})}}return o}var rc="notion-bases";function yN(e){return e.replace(/[/\\:*?"<>|]/g,"").replace(/\s+/g," ").trim()}var ic=class{constructor(t,n){this.app=t;this.databaseFileName=n;this.readInlineFields=!1;this.pageSize=0;this.folderArrangementInProgress=new Set}isDatabaseFile(t){return this.app.metadataCache.getFileCache(t)?.frontmatter?.[rc]===!0}getDatabaseFileInFolder(t){let n=(0,gn.normalizePath)(t?`${t}/${this.databaseFileName}`:this.databaseFileName);return this.app.vault.getFileByPath(n)??null}readConfig(t){let o=this.app.metadataCache.getFileCache(t)?.frontmatter;if(!o||!o[rc])return structuredClone(Rr);let i=(Array.isArray(o.schema)?o.schema:[]).filter(s=>s.id&&typeof s.id=="string"&&!s.id.startsWith("notion-bases")&&s.type&&!s.options?.some(d=>d.value==="[object Object]")),a=o.folderArrangement,l;if(a&&typeof a=="object"&&!Array.isArray(a)){let s=a,d=Array.isArray(s.propertyIds)?s.propertyIds.filter(p=>typeof p=="string"):[];l={enabled:s.enabled===!0,propertyIds:d}}return{schema:i,views:Array.isArray(o.views)&&o.views.length>0?o.views:[Jn],templatePath:typeof o.templatePath=="string"&&o.templatePath?o.templatePath:void 0,askTemplateOnCreate:o.askTemplateOnCreate===!0,folderArrangement:l}}async writeConfig(t,n){await this.app.fileManager.processFrontMatter(t,o=>{o[rc]=!0,o.schema=n.schema,o.views=n.views,n.templatePath?o.templatePath=n.templatePath:delete o.templatePath,n.askTemplateOnCreate?o.askTemplateOnCreate=!0:delete o.askTemplateOnCreate,n.folderArrangement&&n.folderArrangement.propertyIds.length>0?o.folderArrangement={enabled:!!n.folderArrangement.enabled,propertyIds:n.folderArrangement.propertyIds}:delete o.folderArrangement})}getNotesInDatabase(t,n){let o=t.parent??this.app.vault.getRoot();if(!o)return[];if(n){let r=[],i=a=>{for(let l of a.children)l instanceof gn.TFile&&l.extension==="md"&&l.path!==t.path?r.push(l):l instanceof gn.TFolder&&i(l)};return i(o),r.sort((a,l)=>a.basename.localeCompare(l.basename))}return o.children.filter(r=>r instanceof gn.TFile&&r.extension==="md"&&r.path!==t.path).sort((r,i)=>r.basename.localeCompare(i.basename))}getNoteDataSync(t,n){let r=this.app.metadataCache.getFileCache(t)?.frontmatter??{},i={_file:t,_title:t.basename};for(let a of n)a.type==="formula"||a.type==="lookup"||a.type==="rollup"||(i[a.id]=r[a.id]??null);return i}async getNoteData(t,n){let o=this.getNoteDataSync(t,n);if(this.readInlineFields){let r=await this.app.vault.cachedRead(t),i=jm(r),a=Mb(r),l={};for(let s of i){let d=n.find(p=>p.id===s.key);d&&o[d.id]==null&&(d.type==="multiselect"&&typeof s.value=="string"?o[d.id]=s.value.split(",").map(p=>p.trim()).filter(Boolean):o[d.id]=s.value,l[d.id]={format:s.format,rawKey:s.rawKey,rawValue:s.rawValue,lineNumber:a+s.lineNumber,fullMatch:s.fullMatch})}Object.keys(l).length>0&&(o._inlineFields=l)}return o}async updateNoteField(t,n,o,r){let i=r?.[n];i&&this.readInlineFields?o==null||o===""?await this.removeInlineField(t,i):await this.updateInlineField(t,o,i):await this.updateFrontmatterField(t,n,o)}async updateFrontmatterField(t,n,o){await this.app.fileManager.processFrontMatter(t,r=>{o==null||o===""?delete r[n]:r[n]=o})}async updateInlineField(t,n,o){let r=await this.app.vault.read(t),i=r.indexOf(o.fullMatch);if(i===-1){await this.app.fileManager.processFrontMatter(t,d=>{d[o.rawKey]=n});return}let a=this.serializeInlineValue(n),l;switch(o.format){case"standalone":l=`${o.rawKey}:: ${a}`;break;case"bracketed":l=`[${o.rawKey}:: ${a}]`;break;case"parenthesized":l=`(${o.rawKey}:: ${a})`;break}let s=r.slice(0,i)+l+r.slice(i+o.fullMatch.length);await this.app.vault.modify(t,s)}async removeInlineField(t,n){let o=await this.app.vault.read(t),r=o.indexOf(n.fullMatch);if(r===-1)return;let i;if(n.format==="standalone"){let a=o.lastIndexOf(`
`,r-1)+1,l=o.indexOf(`
`,r+n.fullMatch.length);l===-1?l=o.length:l+=1,i=o.slice(0,a)+o.slice(l)}else i=o.slice(0,r)+o.slice(r+n.fullMatch.length);await this.app.vault.modify(t,i)}serializeInlineValue(t){return t==null?"":Array.isArray(t)?t.join(", "):typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"?String(t):JSON.stringify(t)}async syncTwoWayRelation(t,n,o,r){if(!n.pairedColumnId||!n.refDatabasePath)return;let i=this.app.vault.getFileByPath(n.refDatabasePath);if(!i)return;let a=this.getNotesInDatabase(i),l=t.basename,s=r.filter(p=>!o.includes(p)),d=o.filter(p=>!r.includes(p));for(let p of a){let m=this.app.metadataCache.getFileCache(p)?.frontmatter??{},c=n.refColumnId==="_title"?p.basename:String(m[n.refColumnId]??"");s.includes(c)&&await this.app.fileManager.processFrontMatter(p,v=>{let h=Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[];h.includes(l)||(v[n.pairedColumnId]=[...h,l])}),d.includes(c)&&await this.app.fileManager.processFrontMatter(p,v=>{let b=(Array.isArray(v[n.pairedColumnId])?v[n.pairedColumnId]:v[n.pairedColumnId]?[String(v[n.pairedColumnId])]:[]).filter(_=>_!==l);b.length>0?v[n.pairedColumnId]=b:delete v[n.pairedColumnId]})}}async renameNote(t,n){if(!n.trim()||n===t.basename)return;let o=(0,gn.normalizePath)(`${t.parent?.path??""}/${n.trim()}.md`);await this.app.fileManager.renameFile(t,o)}async createNote(t,n,o){let r=t.parent?.path??"",i=(0,gn.normalizePath)(`${r}/${u("db_untitled_note")}`),a=`${i}.md`,l=1;for(;this.app.vault.getFileByPath(a);)a=`${i} ${l++}.md`;let s=await this.app.vault.create(a,`---
---
`);return n&&Object.keys(n).length>0&&await this.app.fileManager.processFrontMatter(s,d=>{for(let[p,f]of Object.entries(n))d[p]=f}),o&&await this.applyTemplate(s,o),s}async createNoteWithTemplate(t,n){let o=this.readConfig(t);if(o.askTemplateOnCreate){let r=await new Promise(i=>{new ra(this.app,a=>i(a),o.templatePath?this.folderOf(o.templatePath):null).open()});return this.createNote(t,n,r)}return this.createNote(t,n,o.templatePath??null)}folderOf(t){let n=t.lastIndexOf("/");return n>0?t.slice(0,n):null}async applyTemplate(t,n){let o=this.app.vault.getFileByPath((0,gn.normalizePath)(n));if(!o)return;let r=await this.app.vault.read(o),i=r.match(/^---\n([\s\S]*?)\n---\n?/),a=r.replace(/^---\n[\s\S]*?\n---\n?/,""),l=window.moment,s=new Date,d=c=>l?l(s).format(c):s.toISOString().slice(0,10),p=c=>l?l(s).format(c):s.toTimeString().slice(0,5),f=c=>c.replace(/\{\{title\}\}/g,t.basename).replace(/\{\{folder\}\}/g,t.parent?.path??"").replace(/\{\{date:([^}]+)\}\}/g,(v,h)=>d(String(h))).replace(/\{\{time:([^}]+)\}\}/g,(v,h)=>p(String(h))).replace(/\{\{date\}\}/g,d("YYYY-MM-DD")).replace(/\{\{time\}\}/g,p("HH:mm")),m=c=>{if(typeof c=="string")return f(c);if(Array.isArray(c))return c.map(m);if(c&&typeof c=="object"){let v={};for(let[h,b]of Object.entries(c))v[h]=m(b);return v}return c};if(i){let c={};try{let v=(0,gn.parseYaml)(i[1]);v&&typeof v=="object"&&!Array.isArray(v)&&(c=m(v))}catch{c={}}Object.keys(c).length>0&&await this.app.fileManager.processFrontMatter(t,v=>{for(let[h,b]of Object.entries(c)){let _=v[h];(_==null||_==="")&&(v[h]=b)}})}if(a.trim()){let c=await this.app.vault.read(t);await this.app.vault.modify(t,c+f(a))}}findGoverningDatabase(t){let n=t.parent;for(;n;){let o=this.getDatabaseFileInFolder(n.path);if(o&&o.path!==t.path)return o;n=n.parent}return null}computeArrangedPath(t,n,o){let r=o.folderArrangement;if(!r||!r.enabled||r.propertyIds.length===0||t.path===n.path)return null;let i=this.app.metadataCache.getFileCache(t)?.frontmatter,a=[];for(let p of r.propertyIds){let f=i?.[p];if(f==null||f==="")break;let m=Array.isArray(f)?f[0]:f;if(m==null||m==="")break;let c;if(typeof m=="string")c=m;else if(typeof m=="number"||typeof m=="boolean"||typeof m=="bigint")c=String(m);else continue;let v=yN(c);if(!v)break;a.push(v)}let s=[n.parent?.path??"",...a].filter(Boolean).join("/"),d=(0,gn.normalizePath)(`${s?`${s}/`:""}${t.basename}.md`);return d===t.path?null:d}isArrangementInProgress(t){return this.folderArrangementInProgress.has(t)}async applyArrangement(t,n,o){let r=this.computeArrangedPath(t,n,o);if(!r||this.folderArrangementInProgress.has(t.path))return!1;let i=r.slice(0,r.lastIndexOf("/"));if(i&&await this.ensureFolder(i),this.app.vault.getFileByPath(r))return!1;this.folderArrangementInProgress.add(t.path),this.folderArrangementInProgress.add(r);try{await this.app.fileManager.renameFile(t,r)}finally{setTimeout(()=>{this.folderArrangementInProgress.delete(t.path),this.folderArrangementInProgress.delete(r)},500)}return!0}async applyArrangementToAll(t,n){let o=[],r=this.getNotesInDatabase(t,!0);for(let i of r){let a=this.computeArrangedPath(i,t,n);if(!a)continue;let l=i.path;await this.applyArrangement(i,t,n)&&o.push({from:l,to:a})}return o}previewArrangement(t,n){return this.getNotesInDatabase(t,!0).map(r=>({file:r,from:r.path,to:this.computeArrangedPath(r,t,n)}))}async ensureFolder(t){let n=t.split("/").filter(Boolean),o="";for(let r of n)if(o=o?`${o}/${r}`:r,!this.app.vault.getFolderByPath(o))try{await this.app.vault.createFolder(o)}catch{}}getAllDatabases(){return this.app.vault.getMarkdownFiles().filter(t=>this.isDatabaseFile(t))}resolveLookupsForRows(t,n){let o=n.filter(i=>i.type==="lookup"&&i.refDatabasePath&&i.refColumnId&&i.refMatchColumnId);if(o.length===0)return t;let r=new Map;for(let i of o){let a=i.refDatabasePath;if(!r.has(a)){let l=this.app.vault.getFileByPath(a);if(!l){r.set(a,[]);continue}let s=this.readConfig(l),p=this.getNotesInDatabase(l).map(f=>this.getNoteDataSync(f,s.schema));r.set(a,p)}}return t.map(i=>{let a={...i};for(let l of o){let s=r.get(l.refDatabasePath)??[],d=l.refMatchColumnId==="_title"?i._title:i[l.refMatchColumnId],p=String(d??"");if(!p){a[l.id]=null;continue}let f=s.find(m=>m._title===p);a[l.id]=f?f[l.refColumnId]??null:null}return a})}resolveRollupsForRows(t,n){let o=n.filter(i=>i.type==="rollup"&&i.rollupRelationColumnId&&i.rollupTargetColumnId&&i.rollupFunction);if(o.length===0)return t;let r=new Map;for(let i of o){let a=n.find(s=>s.id===i.rollupRelationColumnId);if(!a||a.type!=="relation"||!a.refDatabasePath)continue;let l=a.refDatabasePath;if(!r.has(l)){let s=this.app.vault.getFileByPath(l);if(!s){r.set(l,[]);continue}let d=this.readConfig(s),p=this.getNotesInDatabase(s);r.set(l,p.map(f=>this.getNoteDataSync(f,d.schema)))}}return t.map(i=>{let a={...i};for(let l of o){let s=n.find(h=>h.id===l.rollupRelationColumnId);if(!s||!s.refDatabasePath){a[l.id]=null;continue}let d=r.get(s.refDatabasePath)??[],p=i[s.id],f=Array.isArray(p)?p.filter(h=>typeof h=="string"):typeof p=="string"&&p?[p]:[];if(f.length===0){a[l.id]=null;continue}let m=d.filter(h=>f.includes(h._title)),c=l.rollupTargetColumnId,v=m.map(h=>c==="_title"?h._title:h[c]).filter(h=>h!=null);a[l.id]=this.applyRollupFunction(v,l.rollupFunction)}return a})}applyRollupFunction(t,n){if(t.length===0)return null;switch(n){case"count":return t.length;case"count_values":return new Set(t.map(o=>String(o))).size;case"list":return t.map(o=>String(o)).join(", ");case"sum":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?o.reduce((r,i)=>r+i,0):null}case"avg":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.round(o.reduce((r,i)=>r+i,0)/o.length*100)/100:null}case"min":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.min(...o):null}case"max":{let o=t.map(Number).filter(r=>!isNaN(r));return o.length>0?Math.max(...o):null}default:return null}}async deleteNotes(t){for(let n of t)await this.app.fileManager.trashFile(n)}async duplicateNotes(t){for(let n of t){let o=n.parent?.path??"",r=(0,gn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix")}.md`),i=2;for(;this.app.vault.getFileByPath(r);)r=(0,gn.normalizePath)(`${o}/${n.basename} ${u("db_copy_suffix_n").replace("$n",String(i++))}.md`);let a=await this.app.vault.read(n);await this.app.vault.create(r,a)}}async moveNotes(t,n){for(let o of t){let r=(0,gn.normalizePath)(`${n}/${o.name}`);await this.app.fileManager.renameFile(o,r)}}async createDatabase(t){let n=(0,gn.normalizePath)(t?`${t}/${this.databaseFileName}`:this.databaseFileName);if(this.app.vault.getFileByPath(n))throw new Error(u("db_already_exists").replace("$folder",t||"/"));let o=["---",`${rc}: true`,"schema: []","views:"," - id: default"," type: table"," filters: []"," sorts: []"," hiddenColumns: []"," columnWidths: {}","---","","> [!tip] Notion Bases","> "+u("db_tip_body"),""].join(`
`);return this.app.vault.create(n,o)}async inferSchema(t){let n=new Map;for(let o of t){let i=this.app.metadataCache.getFileCache(o)?.frontmatter;if(i)for(let[a,l]of Object.entries(i))a==="position"||a.startsWith("notion-bases")||(n.has(a)||n.set(a,[]),l!=null&&n.get(a).push(l))}if(this.readInlineFields)for(let o of t){let r=await this.app.vault.cachedRead(o),i=jm(r);for(let a of i)n.has(a.key)||n.set(a.key,[]),a.value!==null&&a.value!==void 0&&n.get(a.key).push(a.value)}return Array.from(n.entries()).map(([o,r])=>{let i=this.inferType(o,r),a=i==="select"||i==="multiselect"||i==="status"?this.extractOptions(r,i):void 0;return{id:o,name:this.toDisplayName(o),type:i,visible:!0,width:i==="title"||i==="text"?200:140,options:a}})}inferType(t,n){if(t==="tags")return"multiselect";if(["date","created","modified","due"].includes(t)||t.endsWith("_date")||t.endsWith("_at")||t.endsWith("At"))return"date";if(["status","priority","type","category","stage"].includes(t))return"select";if(["done","completed","archived","published","pinned"].includes(t))return"checkbox";if(["audio","sound","music","recording"].includes(t)||t.endsWith("_audio")||t.endsWith("_sound"))return"audio";if(["video","clip","movie"].includes(t)||t.endsWith("_video")||t.endsWith("_clip"))return"video";let o=n.filter(l=>l!=null);if(o.length===0)return"text";if(o.every(l=>typeof l=="boolean"))return"checkbox";if(o.every(l=>typeof l=="number"))return"number";if(o.every(l=>Array.isArray(l)))return"multiselect";let r=o.map(l=>typeof l=="object"&&l!==null?JSON.stringify(l):typeof l=="string"?l:typeof l=="number"||typeof l=="boolean"?String(l):"");if(r.some(l=>l.length>40||/\s/.test(l)&&/[.!?,;:]/.test(l)))return"text";let a=new Set(r);return a.size<=8&&a.size<o.length?"select":"text"}extractOptions(t,n){let o=new Set;for(let r of t)if(n==="multiselect"&&Array.isArray(r))for(let i of r)o.add(String(i));else r!=null&&o.add(String(r));return Array.from(o).map(r=>({value:r}))}toDisplayName(t){return t.replace(/_/g," ").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/^./,n=>n.toUpperCase())}async renameColumn(t,n,o,r){let i=this.uniqueSlug(r,n.schema,o);if(i!==o){let d=this.getNotesInDatabase(t);for(let p of d){let f=this.app.metadataCache.getFileCache(p);f?.frontmatter&&o in f.frontmatter&&await this.app.fileManager.processFrontMatter(p,m=>{m[i]=m[o],delete m[o]})}}let l=n.schema.map(d=>d.id===o?{...d,id:i,name:r}:d),s={...n,schema:l};return await this.writeConfig(t,s),s}slugify(t){return t.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").replace(/_+/g,"_")||"campo"}uniqueSlug(t,n,o){let r=this.slugify(t),i=new Set(n.filter(l=>l.id!==o).map(l=>l.id));if(!i.has(r))return r;let a=2;for(;i.has(`${r}_${a}`);)a++;return`${r}_${a}`}};var wi=require("obsidian");var Pb={databaseFileName:"_database.md",defaultRowHeight:36,embedViews:{},readInlineFields:!1,pageSize:0},ac=class extends wi.PluginSettingTab{constructor(t,n){super(t,n),this.plugin=n}display(){let{containerEl:t}=this;t.empty(),new wi.Setting(t).setName(u("settings_db_filename_name")).setDesc(u("settings_db_filename_desc")).addText(n=>n.setPlaceholder("_database.md").setValue(this.plugin.settings.databaseFileName).onChange(async o=>{this.plugin.settings.databaseFileName=o||"_database.md",await this.plugin.saveSettings()})),new wi.Setting(t).setName(u("settings_inline_fields_name")).setDesc(u("settings_inline_fields_desc")).addToggle(n=>n.setValue(this.plugin.settings.readInlineFields).onChange(async o=>{this.plugin.settings.readInlineFields=o,this.plugin.manager.readInlineFields=o,await this.plugin.saveSettings()})),new wi.Setting(t).setName(u("settings_row_height_name")).setDesc(u("settings_row_height_desc")).addSlider(n=>n.setLimits(28,80,4).setValue(this.plugin.settings.defaultRowHeight).setDynamicTooltip().onChange(async o=>{this.plugin.settings.defaultRowHeight=o,await this.plugin.saveSettings()})),new wi.Setting(t).setName(u("settings_page_size_name")).setDesc(u("settings_page_size_desc")).addDropdown(n=>n.addOptions({0:u("settings_page_size_all"),50:"50",100:"100",200:"200"}).setValue(String(this.plugin.settings.pageSize)).onChange(async o=>{this.plugin.settings.pageSize=Number(o),this.plugin.manager.pageSize=Number(o),await this.plugin.saveSettings()}))}};var Lb=require("obsidian");var zl=class extends Lb.FuzzySuggestModal{constructor(t,n,o){super(t),this.onChoose=o,this.setPlaceholder(u("picker_placeholder")),this.entries=n.map(r=>{let i=!r.parent?.path||r.parent.path==="/";return{file:r,label:i?u("picker_root"):r.parent?.name??"/",sublabel:i?"":r.parent?.path??"/"}})}getItems(){return this.entries}getItemText(t){return`${t.label} ${t.sublabel}`}renderSuggestion(t,n){n.createEl("div",{text:t.item.label,cls:"nb-picker-title"}),n.createEl("small",{text:t.item.sublabel,cls:"nb-picker-path"})}onChooseItem(t){this.onChoose(t.file)}};var Ci=require("obsidian");var wN=new Set(["text","number","select","multiselect","status","date","checkbox","url","email","phone"]),lc=class extends Ci.Modal{constructor(n,o,r,i){super(n);this.values={};this.titleValue="";this.manager=o,this.dbFile=r,this.schema=i}onOpen(){let{contentEl:n}=this;n.empty(),n.addClass("nb-quick-add-modal"),n.createEl("h3",{text:u("quick_add_title")});let o=this.dbFile.parent?.name??this.dbFile.path;n.createEl("p",{text:o,cls:"nb-quick-add-db-name"}),new Ci.Setting(n).setName(u("quick_add_note_title")).addText(s=>{s.setPlaceholder(u("quick_add_note_title_placeholder")),s.onChange(d=>{this.titleValue=d}),s.inputEl.addClass("nb-quick-add-title-input"),setTimeout(()=>s.inputEl.focus(),50)});let r=this.schema.filter(s=>s.type!=="title"&&s.visible&&wN.has(s.type)&&!s.formula&&!s.isHierarchical);if(r.length===0)n.createEl("p",{text:u("quick_add_no_visible_fields"),cls:"nb-quick-add-empty"});else for(let s of r)this.renderField(n,s);let i=n.createDiv({cls:"nb-quick-add-buttons"});i.createEl("button",{text:u("quick_add_create"),cls:"nb-quick-add-btn"}).addEventListener("click",()=>{this.handleCreate(!1)}),i.createEl("button",{text:u("quick_add_create_and_open"),cls:"nb-quick-add-btn nb-quick-add-btn--primary"}).addEventListener("click",()=>{this.handleCreate(!0)})}onClose(){this.contentEl.empty()}renderField(n,o){let r=new Ci.Setting(n).setName(o.name);switch(o.type){case"text":case"url":case"email":case"phone":r.addText(i=>{i.setPlaceholder(o.name),i.onChange(a=>{this.values[o.id]=a||null})});break;case"number":r.addText(i=>{i.setPlaceholder("0"),i.inputEl.type="number",i.onChange(a=>{this.values[o.id]=a?Number(a):null})});break;case"date":r.addText(i=>{i.inputEl.type="date",i.onChange(a=>{this.values[o.id]=a||null})});break;case"checkbox":r.addToggle(i=>{i.onChange(a=>{this.values[o.id]=a})});break;case"select":case"status":r.addDropdown(i=>{i.addOption("","");for(let a of o.options??[])i.addOption(a.value,a.value);i.onChange(a=>{this.values[o.id]=a||null})});break;case"multiselect":r.addText(i=>{let a=(o.options??[]).map(l=>l.value);i.setPlaceholder(a.join(", ")),i.onChange(l=>{this.values[o.id]=l?l.split(",").map(s=>s.trim()).filter(Boolean):null})});break}}async handleCreate(n){let o={};for(let[r,i]of Object.entries(this.values))i!=null&&i!==""&&!(Array.isArray(i)&&i.length===0)&&(o[r]=i);try{let r=await this.manager.createNoteWithTemplate(this.dbFile,o);if(this.titleValue.trim()){let i=r.parent?.path??"",a=i?`${i}/${this.titleValue.trim()}.md`:`${this.titleValue.trim()}.md`;await this.app.fileManager.renameFile(r,a)}if(this.close(),n){let i=this.titleValue.trim()?this.app.vault.getFileByPath((r.parent?.path?`${r.parent.path}/`:"")+`${this.titleValue.trim()}.md`)??r:r;await this.app.workspace.getLeaf("tab").openFile(i)}}catch(r){new Ci.Notice(String(r))}}};var Ib=require("obsidian"),Hm=Re(xt(),1),Ab=Re(Hp(),1);var ki="notion-bases-embeds",Um=class extends Ib.MarkdownRenderChild{constructor(n,o,r,i,a,l){super(n);this.plugin=o;this.folderPath=r;this.embedId=i;this.sourcePath=a;this.forcedType=l;this.root=null}onload(){let n=this.plugin.manager,o=n.getDatabaseFileInFolder(this.folderPath);if(!o){this.containerEl.createEl("div",{text:`Database not found: "${this.folderPath||"/"}"`,cls:"nb-embed-error"});return}let r=this.plugin.app.vault.getFileByPath(this.sourcePath),a=(r?this.plugin.app.metadataCache.getFileCache(r)?.frontmatter:void 0)?.[ki]?.[this.embedId],l;if(this.forcedType){let s=a&&typeof a=="object"&&!("activeViewId"in a)?a:void 0,p=this.plugin.app.metadataCache.getFileCache(o)?.frontmatter?.views?.[0],f;s?f={...s,id:this.embedId,type:this.forcedType}:f=p?{...p,id:this.embedId,type:this.forcedType}:{...Jn,id:this.embedId,type:this.forcedType},l={dbFile:o,manager:n,externalView:f,onViewChange:async c=>{let v=this.plugin.app.vault.getFileByPath(this.sourcePath);v&&await this.plugin.app.fileManager.processFrontMatter(v,h=>{h[ki]||(h[ki]={}),h[ki][this.embedId]=c})}}}else{let s=a&&typeof a=="object"&&"activeViewId"in a&&Array.isArray(a.views)?a:void 0;l={dbFile:o,manager:n,embedState:s,onEmbedStateChange:async p=>{let f=this.plugin.app.vault.getFileByPath(this.sourcePath);f&&await this.plugin.app.fileManager.processFrontMatter(f,m=>{m[ki]||(m[ki]={}),m[ki][this.embedId]=p})}}}this.root=(0,Ab.createRoot)(this.containerEl),this.root.render((0,Hm.createElement)(Sl.Provider,{value:this.plugin.app},(0,Hm.createElement)(oc,l)))}onunload(){this.root?.unmount(),this.root=null}};function Ob(e){e.registerMarkdownCodeBlockProcessor("nb-database",(t,n,o)=>{let r=t.trim().split(`
`),i="",a="",l;for(let s of r){let d=s.match(/^path:\s*(.+)$/);d&&(i=d[1].trim());let p=s.match(/^id:\s*(.+)$/);p&&(a=p[1].trim());let f=s.match(/^type:\s*(.+)$/);if(f){let m=f[1].trim();(m==="table"||m==="list")&&(l=m)}}if(!a){a="nb"+Math.random().toString(36).slice(2,10);let s=e.app.vault.getFileByPath(o.sourcePath);s&&e.app.vault.process(s,d=>{let p="```nb-database\n"+t.trimEnd(),f=d.indexOf(p);if(f===-1)return d;let m=f+15;return d.slice(0,m)+`id: ${a}
`+d.slice(m)}).catch(console.error)}n.addClass("nb-embed-container"),o.addChild(new Um(n,e,i,a,o.sourcePath,l))})}var Hb=require("obsidian");var $b=["#e0e7ff","#fce7f3","#fef3c7","#dcfce7","#dbeafe","#e9d5ff","#fed7aa","#fecaca","#d1fae5","#e0f2fe","#fae8ff","#fef9c3","#ffd6d6","#d6f0f0","#f0d6f0","#f0f0d6"];function zb(e,t){let n=e.find(r=>r.value===t);if(n?.color)return n.color;let o=e.findIndex(r=>r.value===t);return $b[o%$b.length]??"#e8e8e8"}function CN(e){let t=e.replace("#",""),n=parseInt(t.substring(0,2),16),o=parseInt(t.substring(2,4),16),r=parseInt(t.substring(4,6),16);return(.299*n+.587*o+.114*r)/255>.5?"rgba(0,0,0,0.75)":"rgba(255,255,255,0.9)"}function kN(e,t){if(!t)return String(e);let n={minimumFractionDigits:t.decimals,maximumFractionDigits:t.decimals,useGrouping:t.thousandsSeparator},o=new Intl.NumberFormat("pt-BR",n).format(e);return t.prefix&&(o=`${t.prefix} ${o}`),t.suffix&&(o=`${o} ${t.suffix}`),o}function SN(){return window.moment??null}function Eo(e){if(e==null)return"";if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e);if(typeof e=="bigint")return e.toString();try{return JSON.stringify(e)}catch{return""}}function NN(e,t,n){if(e==null||e==="")return"";if(!t)return Array.isArray(e)?e.map(Eo).join(", "):Eo(e);switch(t.type){case"number":{let o=typeof e=="number"?e:Number(Eo(e));return Number.isNaN(o)?Eo(e):kN(o,t.numberFormat)}case"date":{let o=SN(),r=Eo(e);if(!o)return r;let i=n||"YYYY-MM-DD";try{return o(r).format(i)}catch{return r}}case"checkbox":return e?"\u2713":"\u2717";case"multiselect":case"relation":return Array.isArray(e)?e.map(Eo).join(", "):Eo(e);default:return Array.isArray(e)?e.map(Eo).join(", "):Eo(e)}}function Vb(e,t){let n=document.createElement("span");return n.className="nb-placeholder-pill",n.textContent=e,n.style.background=t,n.style.color=CN(t),n}function Bb(e,t,n){if(e==null||e==="")return[document.createTextNode("")];if(t?.type==="select"||t?.type==="status"){let o=Eo(e);return[Vb(o,zb(t.options??[],o))]}if(t?.type==="multiselect"&&Array.isArray(e)){let o=[];return e.forEach((r,i)=>{let a=Eo(r);i>0&&o.push(document.createTextNode(" ")),o.push(Vb(a,zb(t.options??[],a)))}),o}return[document.createTextNode(NN(e,t,n))]}var jb=/\{\{([a-zA-Z0-9_-]+)(?::([^}]+))?\}\}/g,xN=new Set(["CODE","PRE","SCRIPT","STYLE","KBD"]);function RN(){return window.moment??null}function EN(e,t,n){let o=RN(),r=new Date;switch(e){case"title":return n.basename;case"folder":return n.parent?.path??"";case"date":return o?o(r).format(t||"YYYY-MM-DD"):r.toISOString().slice(0,10);case"time":return o?o(r).format(t||"HH:mm"):r.toTimeString().slice(0,5);default:return null}}function FN(e,t,n,o,r){let i=EN(e,t,r);if(i!==null)return[document.createTextNode(i)];let a=n.find(s=>s.id===e),l=o[e];return l===void 0?null:Bb(l,a,t)}function DN(e,t){let n=document.createElement("span");return n.className="nb-placeholder",n.dataset.token=e,t&&(n.dataset.format=t),n.textContent=t?`{{${e}:${t}}}`:`{{${e}}}`,n}function TN(e){let t=e.nodeValue??"";if(!t.includes("{{"))return!1;jb.lastIndex=0;let n=[],o=0,r,i=!1;for(;(r=jb.exec(t))!==null;)i=!0,r.index>o&&n.push(document.createTextNode(t.slice(o,r.index))),n.push(DN(r[1],r[2])),o=r.index+r[0].length;if(!i)return!1;o<t.length&&n.push(document.createTextNode(t.slice(o)));let a=e.parentNode;if(!a)return!1;for(let l of n)a.insertBefore(l,e);return a.removeChild(e),!0}function MN(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_TEXT,{acceptNode:i=>{let a=i.parentElement;for(;a;){if(xN.has(a.tagName)||a.classList.contains("nb-database-embed"))return NodeFilter.FILTER_REJECT;a=a.parentElement}return i.nodeValue&&i.nodeValue.includes("{{")?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}}),o=n.nextNode();for(;o;)t.push(o),o=n.nextNode();let r=!1;for(let i of t)TN(i)&&(r=!0);return r}var Wm=class extends Hb.MarkdownRenderChild{constructor(n,o,r,i){super(n);this.app=o;this.manager=r;this.file=i}onload(){this.render(),this.listener=n=>{n.path===this.file.path&&this.render()},this.app.metadataCache.on("changed",this.listener)}onunload(){this.listener&&this.app.metadataCache.off("changed",this.listener)}render(){let o=this.app.metadataCache.getFileCache(this.file)?.frontmatter??{},r=this.file.parent?.path??"",i=this.manager.getDatabaseFileInFolder(r),a=i?this.manager.readConfig(i).schema:[];this.containerEl.querySelectorAll("span.nb-placeholder").forEach(s=>{let d=s.dataset.token??"",p=s.dataset.format||void 0;if(!d)return;let f=FN(d,p,a,o,this.file);if(f===null){s.textContent=p?`{{${d}:${p}}}`:`{{${d}}}`;return}s.replaceChildren(...f)})}};function Ub(e,t){return(n,o)=>{let r=e.vault.getFileByPath(o.sourcePath);!r||t.isDatabaseFile(r)||!MN(n)||o.addChild(new Wm(n,e,t,r))}}var sc=class extends $o.Plugin{constructor(){super(...arguments);this._redirecting=!1}async onload(){await this.loadSettings(),this.manager=new ic(this.app,this.settings.databaseFileName),this.manager.readInlineFields=this.settings.readInlineFields,this.manager.pageSize=this.settings.pageSize,this.registerView($l,n=>new yi(n,this)),this.addRibbonIcon("table","Notion bases",()=>{this.openDatabasePicker()}),this.addCommand({id:"open-database",name:u("cmd_open_database"),callback:async()=>{await this.openOrCreateDatabase()}}),this.addCommand({id:"create-database",name:u("cmd_create_database"),callback:async()=>{let o=this.app.workspace.getActiveFile()?.parent?.path??"";await this.createAndOpenDatabase(o)}}),this.addCommand({id:"quick-add",name:u("cmd_quick_add"),callback:()=>{this.openQuickAdd()}}),this.registerEvent(this.app.workspace.on("active-leaf-change",async n=>{if(!n||this._redirecting||n.view.getViewType()!=="markdown")return;let o=n.view.file??void 0;if(!o||!this.manager.isDatabaseFile(o))return;let r=this.findDatabaseLeaf(o.path);if(r&&r!==n){this.app.workspace.revealLeaf(r),n.detach();return}if(!r){this._redirecting=!0;try{await this.openDatabaseInLeaf(n,o)}finally{this._redirecting=!1}}})),this.registerEvent(this.app.workspace.on("file-menu",(n,o)=>{o instanceof $o.TFolder&&(this.manager.getDatabaseFileInFolder(o.path)||n.addItem(r=>{r.setTitle(u("ctx_create_database")).setIcon("database").onClick(async()=>{await this.createAndOpenDatabase(o.path)})}))})),this.registerEvent(this.app.metadataCache.on("changed",n=>{if(!(n instanceof $o.TFile)||n.extension!=="md"||this.manager.isDatabaseFile(n)||this.manager.isArrangementInProgress(n.path))return;let o=this.manager.findGoverningDatabase(n);if(!o)return;let r=this.manager.readConfig(o);r.folderArrangement?.enabled&&this.manager.applyArrangement(n,o,r)})),Ob(this),this.registerMarkdownPostProcessor(Ub(this.app,this.manager)),this.addSettingTab(new ac(this.app,this))}onunload(){}async loadSettings(){this.settings=Object.assign({},Pb,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}openQuickAdd(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new $o.Notice(u("no_databases_found"));return}new zl(this.app,n,o=>{let r=this.manager.readConfig(o);new lc(this.app,this.manager,o,r.schema).open()}).open()}openDatabasePicker(){let n=this.manager.getAllDatabases().sort((o,r)=>(o.parent?.path??"").localeCompare(r.parent?.path??""));if(n.length===0){new $o.Notice(u("no_databases_found"));return}new zl(this.app,n,o=>{let r=this.findDatabaseLeaf(o.path);if(r){this.app.workspace.revealLeaf(r);return}let i=this.app.workspace.getLeaf("tab");this.openDatabaseInLeaf(i,o)}).open()}async openOrCreateDatabase(){let n=this.app.workspace.getActiveFile(),o=n?.parent?.path??"";if(!n){let i=this.app.workspace.getActiveViewOfType(yi)?.leaf??null;if(i?.view instanceof yi){let a=i.view.getDatabaseFilePath();o=this.app.vault.getFileByPath(a)?.parent?.path??""}}let r=this.manager.getDatabaseFileInFolder(o);if(r){let i=this.findDatabaseLeaf(r.path);if(i){this.app.workspace.revealLeaf(i);return}let a=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(a,r)}else await this.createAndOpenDatabase(o)}async createAndOpenDatabase(n){try{let o=await this.manager.createDatabase(n),r=this.app.workspace.getLeaf("tab");await this.openDatabaseInLeaf(r,o)}catch(o){new $o.Notice(String(o))}}async openDatabaseInLeaf(n,o){await n.setViewState({type:$l,state:{dbFilePath:o.path},active:!0}),this.app.workspace.revealLeaf(n);let r=n.view;r instanceof yi&&r.getDatabaseFilePath()!==o.path&&r.setDatabaseFile(o)}findDatabaseLeaf(n){let o=null;return this.app.workspace.iterateAllLeaves(r=>{if(o||r.view.getViewType()!==$l)return;r.view.getState().dbFilePath===n&&(o=r)}),o}};
/*! Bundled license information:
react/cjs/react.production.min.js:
(**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
scheduler/cjs/scheduler.production.min.js:
(**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react-dom/cjs/react-dom.production.min.js:
(**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
react/cjs/react-jsx-runtime.production.min.js:
(**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
@tanstack/table-core/build/lib/index.mjs:
(**
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*)
@tanstack/react-table/build/lib/index.mjs:
(**
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*)
*/