You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

156 lines
1.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

"use strict";var n4=Object.defineProperty;var r4=(e,t,n)=>t in e?n4(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var me=(e,t,n)=>(r4(e,typeof t!="symbol"?t+"":t,n),n);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const C=require("obsidian"),b0=require("@codemirror/language"),ep=require("@codemirror/state"),Ci=require("@codemirror/view");var Jn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function er(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var cI={exports:{}},Nh={},dI={exports:{}},kt={},Hb;function a4(){if(Hb)return kt;Hb=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.iterator;function v(Z){return Z===null||typeof Z!="object"?null:(Z=g&&Z[g]||Z["@@iterator"],typeof Z=="function"?Z:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,T={};function E(Z,G,te){this.props=Z,this.context=G,this.refs=T,this.updater=te||D}E.prototype.isReactComponent={},E.prototype.setState=function(Z,G){if(typeof Z!="object"&&typeof Z!="function"&&Z!=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,Z,G,"setState")},E.prototype.forceUpdate=function(Z){this.updater.enqueueForceUpdate(this,Z,"forceUpdate")};function O(){}O.prototype=E.prototype;function k(Z,G,te){this.props=Z,this.context=G,this.refs=T,this.updater=te||D}var j=k.prototype=new O;j.constructor=k,S(j,E.prototype),j.isPureReactComponent=!0;var F=Array.isArray,B=Object.prototype.hasOwnProperty,R={current:null},z={key:!0,ref:!0,__self:!0,__source:!0};function H(Z,G,te){var ge,Ie={},De=null,ke=null;if(G!=null)for(ge in G.ref!==void 0&&(ke=G.ref),G.key!==void 0&&(De=""+G.key),G)B.call(G,ge)&&!z.hasOwnProperty(ge)&&(Ie[ge]=G[ge]);var Ye=arguments.length-2;if(Ye===1)Ie.children=te;else if(1<Ye){for(var Re=Array(Ye),rt=0;rt<Ye;rt++)Re[rt]=arguments[rt+2];Ie.children=Re}if(Z&&Z.defaultProps)for(ge in Ye=Z.defaultProps,Ye)Ie[ge]===void 0&&(Ie[ge]=Ye[ge]);return{$$typeof:e,type:Z,key:De,ref:ke,props:Ie,_owner:R.current}}function Y(Z,G){return{$$typeof:e,type:Z.type,key:G,ref:Z.ref,props:Z.props,_owner:Z._owner}}function U(Z){return typeof Z=="object"&&Z!==null&&Z.$$typeof===e}function J(Z){var G={"=":"=0",":":"=2"};return"$"+Z.replace(/[=:]/g,function(te){return G[te]})}var Q=/\/+/g;function le(Z,G){return typeof Z=="object"&&Z!==null&&Z.key!=null?J(""+Z.key):G.toString(36)}function pe(Z,G,te,ge,Ie){var De=typeof Z;(De==="undefined"||De==="boolean")&&(Z=null);var ke=!1;if(Z===null)ke=!0;else switch(De){case"string":case"number":ke=!0;break;case"object":switch(Z.$$typeof){case e:case t:ke=!0}}if(ke)return ke=Z,Ie=Ie(ke),Z=ge===""?"."+le(ke,0):ge,F(Ie)?(te="",Z!=null&&(te=Z.replace(Q,"$&/")+"/"),pe(Ie,G,te,"",function(rt){return rt})):Ie!=null&&(U(Ie)&&(Ie=Y(Ie,te+(!Ie.key||ke&&ke.key===Ie.key?"":(""+Ie.key).replace(Q,"$&/")+"/")+Z)),G.push(Ie)),1;if(ke=0,ge=ge===""?".":ge+":",F(Z))for(var Ye=0;Ye<Z.length;Ye++){De=Z[Ye];var Re=ge+le(De,Ye);ke+=pe(De,G,te,Re,Ie)}else if(Re=v(Z),typeof Re=="function")for(Z=Re.call(Z),Ye=0;!(De=Z.next()).done;)De=De.value,Re=ge+le(De,Ye++),ke+=pe(De,G,te,Re,Ie);else if(De==="object")throw G=String(Z),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(Z).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.");return ke}function ie(Z,G,te){if(Z==null)return Z;var ge=[],Ie=0;return pe(Z,ge,"","",function(De){return G.call(te,De,Ie++)}),ge}function se(Z){if(Z._status===-1){var G=Z._result;G=G(),G.then(function(te){(Z._status===0||Z._status===-1)&&(Z._status=1,Z._result=te)},function(te){(Z._status===0||Z._status===-1)&&(Z._status=2,Z._result=te)}),Z._status===-1&&(Z._status=0,Z._result=G)}if(Z._status===1)return Z._result.default;throw Z._result}var fe={current:null},oe={transition:null},we={ReactCurrentDispatcher:fe,ReactCurrentBatchConfig:oe,ReactCurrentOwner:R};return kt.Children={map:ie,forEach:function(Z,G,te){ie(Z,function(){G.apply(this,arguments)},te)},count:function(Z){var G=0;return ie(Z,function(){G++}),G},toArray:function(Z){return ie(Z,function(G){return G})||[]},only:function(Z){if(!U(Z))throw Error("React.Children.only expected to receive a single React element child.");return Z}},kt.Component=E,kt.Fragment=n,kt.Profiler=a,kt.PureComponent=k,kt.StrictMode=r,kt.Suspense=d,kt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=we,kt.cloneElement=function(Z,G,te){if(Z==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+Z+".");var ge=S({},Z.props),Ie=Z.key,De=Z.ref,ke=Z._owner;if(G!=null){if(G.ref!==void 0&&(De=G.ref,ke=R.current),G.key!==void 0&&(Ie=""+G.key),Z.type&&Z.type.defaultProps)var Ye=Z.type.defaultProps;for(Re in G)B.call(G,Re)&&!z.hasOwnProperty(Re)&&(ge[Re]=G[Re]===void 0&&Ye!==void 0?Ye[Re]:G[Re])}var Re=arguments.length-2;if(Re===1)ge.children=te;else if(1<Re){Ye=Array(Re);for(var rt=0;rt<Re;rt++)Ye[rt]=arguments[rt+2];ge.children=Ye}return{$$typeof:e,type:Z.type,key:Ie,ref:De,props:ge,_owner:ke}},kt.createContext=function(Z){return Z={$$typeof:s,_currentValue:Z,_currentValue2:Z,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},Z.Provider={$$typeof:o,_context:Z},Z.Consumer=Z},kt.createElement=H,kt.createFactory=function(Z){var G=H.bind(null,Z);return G.type=Z,G},kt.createRef=function(){return{current:null}},kt.forwardRef=function(Z){return{$$typeof:c,render:Z}},kt.isValidElement=U,kt.lazy=function(Z){return{$$typeof:m,_payload:{_status:-1,_result:Z},_init:se}},kt.memo=function(Z,G){return{$$typeof:p,type:Z,compare:G===void 0?null:G}},kt.startTransition=function(Z){var G=oe.transition;oe.transition={};try{Z()}finally{oe.transition=G}},kt.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},kt.useCallback=function(Z,G){return fe.current.useCallback(Z,G)},kt.useContext=function(Z){return fe.current.useContext(Z)},kt.useDebugValue=function(){},kt.useDeferredValue=function(Z){return fe.current.useDeferredValue(Z)},kt.useEffect=function(Z,G){return fe.current.useEffect(Z,G)},kt.useId=function(){return fe.current.useId()},kt.useImperativeHandle=function(Z,G,te){return fe.current.useImperativeHandle(Z,G,te)},kt.useInsertionEffect=function(Z,G){return fe.current.useInsertionEffect(Z,G)},kt.useLayoutEffect=function(Z,G){return fe.current.useLayoutEffect(Z,G)},kt.useMemo=function(Z,G){return fe.current.useMemo(Z,G)},kt.useReducer=function(Z,G,te){return fe.current.useReducer(Z,G,te)},kt.useRef=function(Z){return fe.current.useRef(Z)},kt.useState=function(Z){return fe.current.useState(Z)},kt.useSyncExternalStore=function(Z,G,te){return fe.current.useSyncExternalStore(Z,G,te)},kt.useTransition=function(){return fe.current.useTransition()},kt.version="18.2.0",kt}dI.exports=a4();var A=dI.exports;const $=er(A);var Yb;function o4(){if(Yb)return Nh;Yb=1;var e=A,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function s(c,d,p){var m,g={},v=null,D=null;p!==void 0&&(v=""+p),d.key!==void 0&&(v=""+d.key),d.ref!==void 0&&(D=d.ref);for(m in d)r.call(d,m)&&!o.hasOwnProperty(m)&&(g[m]=d[m]);if(c&&c.defaultProps)for(m in d=c.defaultProps,d)g[m]===void 0&&(g[m]=d[m]);return{$$typeof:t,type:c,key:v,ref:D,props:g,_owner:a.current}}return Nh.Fragment=n,Nh.jsx=s,Nh.jsxs=s,Nh}cI.exports=o4();var w=cI.exports;const Bo=e=>{const{children:t,store:n,context:r}=e,[a,o]=A.useState(n.getState());return A.useEffect(()=>{const s=n.subscribe(c=>{o(c)});return()=>{s()}},[]),w.jsx(r.Provider,{value:a,children:t})};function i4(e){const t=Object.keys(e),n={};for(const r of t)typeof e[r]=="function"&&(n[r]=e[r]);return(r={},a)=>{let o=!1;const s={};for(const c of t){const d=r[c],p=n[c](d,a);s[c]=p,o=o||p!==d}return o?s:r}}function s4(e,t){const n=[];let r=e;return{dispatch:c=>{const d=t(r,c),p=r;r=d;for(const m of n)m(r,p)},getState:()=>r,subscribe:c=>{let d=!0;return n.push(c),()=>{if(!d)return;const p=n.indexOf(c);n.splice(p,1),d=!1}}}}function l4(e,t){switch(t.type){case"SET_MARK_MEMO_ID":return t.payload.markMemoId===e.markMemoId?e:{...e,markMemoId:t.payload.markMemoId};case"SET_EDIT_MEMO_ID":return t.payload.editMemoId===e.editMemoId?e:{...e,editMemoId:t.payload.editMemoId};case"SET_GLOBAL_EDITOR_SHOWN":return t.payload.globalEditorShown===e.globalEditorShown?e:{...e,globalEditorShown:t.payload.globalEditorShown};case"SET_COMMENT_MEMO_ID":return t.payload.commentMemoId===e.commentMemoId?e:{...e,commentMemoId:t.payload.commentMemoId};case"SET_MOBILE_VIEW":return t.payload.isMobileView===e.isMobileView?e:{...e,isMobileView:t.payload.isMobileView};case"SET_CHANGED_BY_MEMOS":return t.payload.changedByMemos===e.changedByMemos?e:{...e,changedByMemos:t.payload.changedByMemos};case"SET_REFRESH":return t.payload.refresh===e.refresh?e:{...e,refresh:t.payload.refresh};case"SET_INSTANCE":return{...e,instanceList:e.instanceList.set(t.payload.id,t.payload.instance)};case"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW":return t.payload.showSiderbarInMobileView===e.showSiderbarInMobileView?e:{...e,showSiderbarInMobileView:t.payload.showSiderbarInMobileView};case"SET_MEMO_LIST_VIEW":return t.payload.memoListView===e.memoListView?e:{...e,memoListView:t.payload.memoListView};case"SET_MEMO_PLUGIN_MANIFEST":return{...e,manifest:t.payload.manifest};case"SET_LOADED":return{...e,loaded:t.payload.loaded};case"SET_LOCKED":return{...e,locked:t.payload.locked};case"SET_APP_SETTING":return{...e,...t.payload};default:return e}}const u4={markMemoId:"",editMemoId:"",commentMemoId:"",shouldSplitMemoWord:!0,shouldHideImageUrl:!0,shouldUseMarkdownParser:!0,useTinyUndoHistoryCache:!1,isMobileView:!1,showSiderbarInMobileView:!1,changedByMemos:!1,memoListView:null,manifest:null,refresh:!1,loaded:!1,globalEditorShown:!1,instanceList:new Map,locked:!1};function c4(e,t){switch(t.type){case"RELOAD":return fI;case"SET_LOCATION":return t.payload;case"SET_PATHNAME":return t.payload.pathname===e.pathname?e:{...e,pathname:t.payload.pathname};case"SET_HASH":return t.payload.hash===e.hash?e:{...e,hash:t.payload.hash};case"SET_QUERY":return{...e,query:{...t.payload}};case"SET_TAG_QUERY":return t.payload.tag===e.query.tag?e:{...e,query:{...e.query,tag:t.payload.tag}};case"SET_DURATION_QUERY":return t.payload.duration===e.query.duration?e:{...e,query:{...e.query,duration:{...e.query.duration,...t.payload.duration}}};case"SET_TYPE":return t.payload.type===e.query.type?e:{...e,query:{...e.query,type:t.payload.type}};case"SET_TEXT":return t.payload.text===e.query.text?e:{...e,query:{...e.query,text:t.payload.text}};case"SET_QUERY_FILTER":return t.payload===e.query.filter?e:{...e,query:{...e.query,filter:t.payload}};default:return e}}const fI={pathname:"/",hash:"",query:{tag:"",duration:null,type:"",text:"",filter:""}};var At={};Object.defineProperty(At,"__esModule",{value:!0});var In=C;const cw="YYYY-MM-DD",dw="gggg-[W]ww",hI="YYYY-MM",pI="YYYY-[Q]Q",mI="YYYY";function vp(e){var n,r;const t=window.app.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n[e])==null?void 0:r.enabled)}function wp(){var e,t,n,r;try{const{internalPlugins:a,plugins:o}=window.app;if(vp("daily")){const{format:p,folder:m,template:g}=((t=(e=o.getPlugin("periodic-notes"))==null?void 0:e.settings)==null?void 0:t.daily)||{};return{format:p||cw,folder:(m==null?void 0:m.trim())||"",template:(g==null?void 0:g.trim())||""}}const{folder:s,format:c,template:d}=((r=(n=a.getPluginById("daily-notes"))==null?void 0:n.instance)==null?void 0:r.options)||{};return{format:c||cw,folder:(s==null?void 0:s.trim())||"",template:(d==null?void 0:d.trim())||""}}catch{}}function bp(){var e,t,n,r,a,o,s;try{const c=window.app.plugins,d=(e=c.getPlugin("calendar"))==null?void 0:e.options,p=(n=(t=c.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.weekly;if(vp("weekly"))return{format:p.format||dw,folder:((r=p.folder)==null?void 0:r.trim())||"",template:((a=p.template)==null?void 0:a.trim())||""};const m=d||{};return{format:m.weeklyNoteFormat||dw,folder:((o=m.weeklyNoteFolder)==null?void 0:o.trim())||"",template:((s=m.weeklyNoteTemplate)==null?void 0:s.trim())||""}}catch{}}function Dp(){var t,n,r,a;const e=window.app.plugins;try{const o=vp("monthly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.monthly)||{};return{format:o.format||hI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function Sp(){var t,n,r,a;const e=window.app.plugins;try{const o=vp("quarterly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.quarterly)||{};return{format:o.format||pI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function Ip(){var t,n,r,a;const e=window.app.plugins;try{const o=vp("yearly")&&((n=(t=e.getPlugin("periodic-notes"))==null?void 0:t.settings)==null?void 0:n.yearly)||{};return{format:o.format||mI,folder:((r=o.folder)==null?void 0:r.trim())||"",template:((a=o.template)==null?void 0:a.trim())||""}}catch{}}function gI(...e){let t=[];for(let r=0,a=e.length;r<a;r++)t=t.concat(e[r].split("/"));const n=[];for(let r=0,a=t.length;r<a;r++){const o=t[r];!o||o==="."||n.push(o)}return t[0]===""&&n.unshift(""),n.join("/")}function d4(e){let t=e.substring(e.lastIndexOf("/")+1);return t.lastIndexOf(".")!=-1&&(t=t.substring(0,t.lastIndexOf("."))),t}async function f4(e){const t=e.replace(/\\/g,"/").split("/");if(t.pop(),t.length){const n=gI(...t);window.app.vault.getAbstractFileByPath(n)||await window.app.vault.createFolder(n)}}async function Tp(e,t){t.endsWith(".md")||(t+=".md");const n=In.normalizePath(gI(e,t));return await f4(n),n}async function Rd(e){const{metadataCache:t,vault:n}=window.app,r=In.normalizePath(e);if(r==="/")return Promise.resolve(["",null]);try{const a=t.getFirstLinkpathDest(r,""),o=await n.cachedRead(a),s=window.app.foldManager.load(a);return[o,s]}catch(a){return console.error(`Failed to read the daily note template '${r}'`,a),new In.Notice("Failed to read the daily note template"),["",null]}}function _o(e,t="day"){const n=e.clone().startOf(t).format();return`${t}-${n}`}function yI(e){return e.replace(/\[[^\]]*\]/g,"")}function h4(e,t){if(t==="week"){const n=yI(e);return/w{1,2}/i.test(n)&&(/M{1,4}/.test(n)||/D{1,4}/.test(n))}return!1}function Bd(e,t){return vI(e.basename,t)}function p4(e,t){return vI(d4(e),t)}function vI(e,t){const r={day:wp,week:bp,month:Dp,quarter:Sp,year:Ip}[t]().format.split("/").pop(),a=window.moment(e,r,!0);if(!a.isValid())return null;if(h4(r,t)&&t==="week"){const o=yI(r);if(/w{1,2}/i.test(o))return window.moment(e,r.replace(/M{1,4}/g,"").replace(/D{1,4}/g,""),!1)}return a}class m4 extends Error{}async function wI(e){const t=window.app,{vault:n}=t,r=window.moment,{template:a,format:o,folder:s}=wp(),[c,d]=await Rd(a),p=e.format(o),m=await Tp(s,p);try{const g=await n.create(m,c.replace(/{{\s*date\s*}}/gi,p).replace(/{{\s*time\s*}}/gi,r().format("HH:mm")).replace(/{{\s*title\s*}}/gi,p).replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,D,S,T,E,O)=>{const k=r(),j=e.clone().set({hour:k.get("hour"),minute:k.get("minute"),second:k.get("second")});return S&&j.add(parseInt(T,10),E),O?j.format(O.substring(1).trim()):j.format(o)}).replace(/{{\s*yesterday\s*}}/gi,e.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,e.clone().add(1,"d").format(o)));return t.foldManager.save(g,d),g}catch(g){console.error(`Failed to create file: '${m}'`,g),new In.Notice("Unable to create new file.")}}function g4(e,t){return t[_o(e,"day")]??null}function y4(){const{vault:e}=window.app,{folder:t}=wp(),n=e.getAbstractFileByPath(In.normalizePath(t));if(!n)throw new m4("Failed to find daily notes folder");const r={};return In.Vault.recurseChildren(n,a=>{if(a instanceof In.TFile){const o=Bd(a,"day");if(o){const s=_o(o,"day");r[s]=a}}}),r}class v4 extends Error{}function w4(){const{moment:e}=window;let t=e.localeData()._week.dow;const n=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)n.push(n.shift()),t--;return n}function b4(e){return w4().indexOf(e.toLowerCase())}async function bI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=bp(),[o,s]=await Rd(n),c=e.format(r),d=await Tp(a,c);try{const p=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,g,v,D,S,T)=>{const E=window.moment(),O=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return v&&O.add(parseInt(D,10),S),T?O.format(T.substring(1).trim()):O.format(r)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(m,g,v)=>{const D=b4(g);return e.weekday(D).format(v.trim())}));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new In.Notice("Unable to create new file.")}}function D4(e,t){return t[_o(e,"week")]??null}function S4(){const e={};if(!SI())return e;const{vault:t}=window.app,{folder:n}=bp(),r=t.getAbstractFileByPath(In.normalizePath(n));if(!r)throw new v4("Failed to find weekly notes folder");return In.Vault.recurseChildren(r,a=>{if(a instanceof In.TFile){const o=Bd(a,"week");if(o){const s=_o(o,"week");e[s]=a}}}),e}class I4 extends Error{}async function DI(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Dp(),[o,s]=await Rd(n),c=e.format(r),d=await Tp(a,c);try{const p=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,g,v,D,S,T)=>{const E=window.moment(),O=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return v&&O.add(parseInt(D,10),S),T?O.format(T.substring(1).trim()):O.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new In.Notice("Unable to create new file.")}}function T4(e,t){return t[_o(e,"month")]??null}function E4(){const e={};if(!II())return e;const{vault:t}=window.app,{folder:n}=Dp(),r=t.getAbstractFileByPath(In.normalizePath(n));if(!r)throw new I4("Failed to find monthly notes folder");return In.Vault.recurseChildren(r,a=>{if(a instanceof In.TFile){const o=Bd(a,"month");if(o){const s=_o(o,"month");e[s]=a}}}),e}class C4 extends Error{}async function x4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Sp(),[o,s]=await Rd(n),c=e.format(r),d=await Tp(a,c);try{const p=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,g,v,D,S,T)=>{const E=window.moment(),O=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return v&&O.add(parseInt(D,10),S),T?O.format(T.substring(1).trim()):O.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new In.Notice("Unable to create new file.")}}function M4(e,t){return t[_o(e,"quarter")]??null}function N4(){const e={};if(!TI())return e;const{vault:t}=window.app,{folder:n}=Sp(),r=t.getAbstractFileByPath(In.normalizePath(n));if(!r)throw new C4("Failed to find quarterly notes folder");return In.Vault.recurseChildren(r,a=>{if(a instanceof In.TFile){const o=Bd(a,"quarter");if(o){const s=_o(o,"quarter");e[s]=a}}}),e}class k4 extends Error{}async function A4(e){const{vault:t}=window.app,{template:n,format:r,folder:a}=Ip(),[o,s]=await Rd(n),c=e.format(r),d=await Tp(a,c);try{const p=await t.create(d,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(m,g,v,D,S,T)=>{const E=window.moment(),O=e.clone().set({hour:E.get("hour"),minute:E.get("minute"),second:E.get("second")});return v&&O.add(parseInt(D,10),S),T?O.format(T.substring(1).trim()):O.format(r)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${d}'`,p),new In.Notice("Unable to create new file.")}}function F4(e,t){return t[_o(e,"year")]??null}function O4(){const e={};if(!EI())return e;const{vault:t}=window.app,{folder:n}=Ip(),r=t.getAbstractFileByPath(In.normalizePath(n));if(!r)throw new k4("Failed to find yearly notes folder");return In.Vault.recurseChildren(r,a=>{if(a instanceof In.TFile){const o=Bd(a,"year");if(o){const s=_o(o,"year");e[s]=a}}}),e}function P4(){var r,a;const{app:e}=window,t=e.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;const n=e.plugins.getPlugin("periodic-notes");return n&&((a=(r=n.settings)==null?void 0:r.daily)==null?void 0:a.enabled)}function SI(){var n,r;const{app:e}=window;if(e.plugins.getPlugin("calendar"))return!0;const t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.weekly)==null?void 0:r.enabled)}function II(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.monthly)==null?void 0:r.enabled)}function TI(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.quarterly)==null?void 0:r.enabled)}function EI(){var n,r;const{app:e}=window,t=e.plugins.getPlugin("periodic-notes");return t&&((r=(n=t.settings)==null?void 0:n.yearly)==null?void 0:r.enabled)}function j4(e){const t={day:wp,week:bp,month:Dp,quarter:Sp,year:Ip}[e];return t()}function L4(e,t){return{day:wI,month:DI,week:bI}[e](t)}At.DEFAULT_DAILY_NOTE_FORMAT=cw;At.DEFAULT_MONTHLY_NOTE_FORMAT=hI;At.DEFAULT_QUARTERLY_NOTE_FORMAT=pI;At.DEFAULT_WEEKLY_NOTE_FORMAT=dw;At.DEFAULT_YEARLY_NOTE_FORMAT=mI;var a1=At.appHasDailyNotesPluginLoaded=P4;At.appHasMonthlyNotesPluginLoaded=II;At.appHasQuarterlyNotesPluginLoaded=TI;At.appHasWeeklyNotesPluginLoaded=SI;At.appHasYearlyNotesPluginLoaded=EI;var CI=At.createDailyNote=wI;At.createMonthlyNote=DI;At.createPeriodicNote=L4;At.createQuarterlyNote=x4;At.createWeeklyNote=bI;At.createYearlyNote=A4;var bs=At.getAllDailyNotes=y4;At.getAllMonthlyNotes=E4;At.getAllQuarterlyNotes=N4;At.getAllWeeklyNotes=S4;At.getAllYearlyNotes=O4;var Fy=At.getDailyNote=g4,oy=At.getDailyNoteSettings=wp,Wh=At.getDateFromFile=Bd;At.getDateFromPath=p4;At.getDateUID=_o;At.getMonthlyNote=T4;At.getMonthlyNoteSettings=Dp;At.getPeriodicNoteSettings=j4;At.getQuarterlyNote=M4;At.getQuarterlyNoteSettings=Sp;At.getTemplateInfo=Rd;At.getWeeklyNote=D4;At.getWeeklyNoteSettings=bp;At.getYearlyNote=F4;At.getYearlyNoteSettings=Ip;const R4={},B4={},_4={},H4={},xI={welcome:"Welcome to Thino",ribbonIconTitle:"Thino",to:"to",months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],weekDaysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],year:null,month:null,"Basic Options":"Basic options","User name":"User name","Set your user name here. 'Memos 😏' By default":"Set your user name here. 'Thino 😏' By default",'You can set target heading like "# Heading" to control data location':'You can set target heading like "# Heading" to control data location',"Insert after heading":"Insert after heading","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"You should set the same heading below if you want to insert and process thino below the same heading.","Allows admonitions to be created using ":"Allows admonitions to be created using ","Process Memos below":"Process thino below","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.","Save Memo button label":"Save thino button label","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"The text shown on the save Thino button in the UI. 'NOTEIT' by default.","Focus on editor when open memos":"Focus on editor when open thino","Focus on editor when open memos. Focus by default.":"Focus on editor when open thino. Focus by default.","Open daily memos with open memos":"Open daily thino with open thino","Open daily memos with open memos. Open by default.":"Open daily thino with open thino. Open by default.","Open Memos when obsidian opens":"Open Thino when obsidian opens","When enable this, Memos will open when Obsidian opens. False by default.":"When enable this, Thino will open when Obsidian opens. False by default.","Hide done tasks in Memo list":"Hide done tasks in Thino list","Hide all done tasks in Memo list. Show done tasks by default.":"Hide all done tasks in Thino list. Show done tasks by default.","Advanced Options":"Advanced Options","UI language for date":"UI language for date","Translates the date UI language. Only 'en' and 'zh' are available.":"Translates the date UI language. Only 'en' and 'zh' are available.","Default prefix when save thino in daily notes":"Default prefix when save thino in daily notes","Set the default prefix when create memo, 'List' by default.":"Set the default prefix when create thino, 'List' by default.","Default insert date format":"Default insert date format","Set the default date format when insert date by @, 'Tasks' by default.":"Set the default date format when insert date by @, 'Tasks' by default.","Default editor position on mobile":"Default editor position on mobile","Set the default editor position on Mobile, 'Top' by default.":"Set the default editor position on Mobile, 'Top' by default.","Use button to show editor on mobile":"Use button to show editor on mobile","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Set a float button to call editor on mobile. Only when editor located at the bottom works.","Show Time When Copy Results":"Show Time When Copy Results","Show time when you copy results, like 12:00. Copy time by default.":"Show time when you copy results, like 12:00. Copy time by default.","Show Date When Copy Results":"Show Date When Copy Results","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Show date when you copy results, like [[2022-01-01]]. Copy date by default.","Add Blank Line Between Different Date":"Add Blank Line Between Different Date","Add blank line when copy result with date. No blank line by default.":"Add blank line when copy result with date. No blank line by default.","Share Options":"Share Options","Share Memos Image Footer Start":"Share Thino Image Footer Start","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default","Share Memos Image Footer End":"Share Thino Image Footer End","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default","Save Shared Image To Folder For Mobile":"Save Shared Image To Folder For Mobile","Save image to folder for mobile. False by Default":"Save image to folder for mobile. False by Default","Say Thank You":"Say Thank You",Donate:"Donate","If you like this plugin, consider donating to support continued development:":"If you like this plugin, consider donating to support continued development:","File Name of Recycle Bin":"File Name of Recycle Bin","Set the filename for recycle bin. 'delete' By default":"Set the filename for recycle bin. 'delete' By default","File Name of Query File":"File Name of Query File","Set the filename for query file. 'query' By default":"Set the filename for query file. 'query' By default","Use Tags In Vault":"Use Tags In Vault","Use tags in vault rather than only in Memos. False by default.":"Use tags in vault rather than only in Thino. False by default.","Ready to convert image into background":"Ready to convert image into background",List:"List",Task:"Task",Top:"Top",Bottom:"Bottom",TAG:"TAG",DAY:"DAY",QUERY:"Query",EDIT:"EDIT",PIN:"PIN",UNPIN:"UNPIN",DELETE:"DELETE","CONFIRM":"CONFIRM","CREATE FILTER":"CREATE FILTER","Comment it...":"Comment it...",Settings:"Settings","Recycle bin":"Recycle bin","About Me":"About Me","Fetching data...":"Fetching data...","Here is No Memos.":"Here is No Thino.","Frequently Used Tags":"Frequently Used Tags","What do you think now...":"What do you think now...",READ:"READ",MARK:"MARK",SHARE:"SHARE",SOURCE:"SOURCE",RESTORE:"RESTORE",ARCHIVE:"Archive","DELETE AT":"DELETE AT","Noooop!":"Noooop!","All Data is Loaded 🎉":"All Data is Loaded 🎉","Quick filter":"Quick filter",TYPE:"TYPE",LINKED:"LINKED","NO TAGS":"NO TAGS","HAS LINKS":"HAS LINKS","HAS IMAGES":"HAS IMAGES",INCLUDE:"INCLUDE",EXCLUDE:"EXCLUDE",TEXT:"TEXT",IS:"IS",AND:"AND",OR:"OR",LIST:"LIST",ISNOT:"ISNOT",SELECT:"SELECT","ADD FILTER TERMS":"ADD FILTER TERMS",FILTER:"FILTER",Filter:"Filter",TITLE:"TITLE","CREATE QUERY":"CREATE QUERY","EDIT QUERY":"EDIT QUERY",MATCH:"MATCH",TIMES:"TIMES","Share Memo Image":"Share Thino Image","↗Click the button to save":"↗Click the button to save","Image is generating...":"Image is generating...","Image is loading...":"Image is loading...","Loading...":"Loading...","😟 Cannot load image, image link maybe broken":"😟 Cannot load image, image link maybe broken","Daily Memos":"Daily Thino","CANCEL EDIT":"CANCEL EDIT","LINK TO THE":"LINK TO THE","Mobile Options":"Mobile Options","Experimental Options":"Experimental Options","Don't support web image yet, please input image path in vault":"Don't support web image yet, please input image path in vault","Background Image in Dark Theme":"Background Image in Dark Theme","Background Image in Light Theme":"Background Image in Light Theme",'Set background image in dark theme. Set something like "Daily/one.png"':'Set background image in dark theme. Set something like "Daily/one.png"','Set background image in light theme. Set something like "Daily/one.png"':'Set background image in light theme. Set something like "Daily/one.png"','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Set default thino composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default',"Default Memo Composition":"[Deprecated] Default Thino Composition","Show Tasks Label":"Show Tasks Label","Show tasks label near the time text. False by default":"Show tasks label near the time text. False by default","Please Open Memos First":"Please Open Thino First",DATE:"DATE",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"BEFORE",AFTER:"AFTER","Allow Comments On Memos":"Allow Comments On Thino","You can comment on memos. False by default":"You can comment on thino. False by default",Import:"Import","TITLE CANNOT BE NULL!":"TITLE CANNOT BE NULL!","FILTER CANNOT BE NULL!":"FILTER CANNOT BE NULL!","Comments In Original DailyNotes/Notes":"Comments In Original DailyNotes/Notes","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"You should install Dataview Plugin ver 0.5.9 or later to use this feature.","Open Memos Successfully":"Open Thino Successfully","Fetch Memos Error":"😭 Fetch Error","Copied to clipboard Successfully":"Copied to clipboard Successfully","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Check if you opened Daily Notes Plugin Or Periodic Notes Plugin","Please finish the last filter setting first":"Please finish the last filter setting first","Close Memos Successfully":"Close Thino Successfully","Insert as Memo":"Insert as Thino","Insert file as memo content":"Insert file as thino content","Image load failed":"Image load failed","Content cannot be empty":"Content cannot be empty","Unable to create new file.":"Unable to create new file.","Failed to fetch deleted memos: ":"Failed to fetch deleted thino: ","RESTORE SUCCEED":"RESTORE SUCCEED","DELETE SUCCEED":"DELETE SUCCEED","Save Memo button icon":"Save Thino button icon","The icon shown on the save Memo button in the UI.":"The icon shown on the save Thino button in the UI.","Fetch Memos From Particular Notes":"Fetch Thino From Particular Notes",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'You can set any Dataview Query for thino to fetch it. All thino in those notes will show on list. "#memo" by default',"Allow Memos to Fetch Memo from Notes":"Allow Thino to Fetch Thino from Notes","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"Use Thino to manage all thino in your notes, not only in daily notes. False by default","Always Show Memo Comments":"Always Show Thino Comments","Always show memo comments on memos. False by default":"Always show thino comments on thino. False by default","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.","Please check your daily note plugin OR periodic notes plugin settings":"Please check your daily note plugin OR periodic notes plugin settings","Use which plugin's default configuration":"Use which plugin's default configuration","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino use the plugin's default configuration to fetch thino from daily, 'Daily' by default.",Daily:"Daily","Always Show Leaf Sidebar on PC":"Always Show Leaf Sidebar on PC","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"Show left sidebar on PC even when the leaf width is less than 875px. False by default.","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"You didn't set format for daily notes in both periodic-notes and daily-notes plugins.","fetch more":"fetch more","Search all settings":"Search all settings",General:"General",Theme:"Theme",Share:"Share",Advanced:"Advanced",Thino:"Thino","Random Review":"Random Review","ARCHIVED AT":"ARCHIVED AT","Failed to get memos from daily notes":"Failed to get thino from daily notes","Failed to delete memo":"Failed to delete thino","CTRL + ENTER to save":"CTRL + ENTER to save","Started from":"Started from","Custom Background Image":"Custom Background Image","Set custom background image.":"Set custom background image.","Custom Memo Footer":"Custom Thino Footer","Set custom memo footer.":"Set custom thino footer.","Heatmap Color Scheme":"Heatmap Color Scheme","Set different color scheme for heatmap.":"Set different color scheme for heatmap.","Enable Local Http Server":"Enable Local Http Server","Memos Http Server Port":"Thino Http Server Port","Set memos http server port to listen. '43999' by default":"Set thino http server port to listen. '43999' by default","Default Editor Mode":"Default Editor Mode","Live-Preview Mode OR Source Mode.":"Live-Preview Mode/Source Mode.","Save type for Thino":"Save type for Thino",DAILY:"DAILY",MULTI:"MULTI",CANVAS:"CANVAS",ALL:"ALL",FILE:"FILE",TODO:"TODO",DONE:"DONE",JOURNAL:"JOURNAL",OTHER:"OTHER","Failed to create daily note, check if it exists.":"Failed to create daily note, check if it exists.","Failed to create daily note. Please check if you created a folder for daily notes.":"Failed to create daily note. Please check if you created a folder for daily notes.","After you verify your account, please refresh this page.":"After you verify your account, please refresh this page.",Verify:"Verify","Oops! You forget to verify insider account":"Oops! You forget to verify insider account","If you have any questions, please contact us.":"If you have any questions, please contact us.","Delete Thino Directly":"Delete Thino Directly","When delete thino directly, it will not be moved to trash. False by default.":"When delete thino directly, it will not be moved to trash. False by default.","Enable opening thino globally":"Enable opening thino globally","Enable opening thino globally. False by default.":"Enable opening thino globally. False by default.","Key for opening thino globally":"Key for opening thino globally","Set key for opening thino globally. CTRL + SHIFT + T by default.":"Set key for opening thino globally. CTRL + SHIFT + T by default.","Key for showing thino globally":"Key for showing thino globally","Set key for showing thino globally. CTRL + SHIFT + E by default.":"Set key for showing thino globally. CTRL + SHIFT + E by default.","Get activation code":"Get activation code","Input activation code here":"Input activation code here","Copy Thino id":"Copy Thino id","Activate Pro Version":"Activate Pro Version","Please copy Thino id first":"Please copy Thino id first",'You can set folder name with file name like "folder/file"':'You can set folder name with file name like "folder/file"','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'You can set folder name like "folder1/folder2/folder3" to create sub-folder',"Default save type":"Default save location",'Set the default save type for thino. "DAILY" by default':'Set the default save type for thino. "DAILY" by default',"Sync Thino via PKMer":"Sync Thino via PKMer",Unlink:"Unlink",Link:"Link","Connect to PKMer Sync, you can check it in ":"Connect to PKMer Sync, you can check it in ","PKMer Sync":"PKMer Sync","Remove successfully":"Remove successfully",Deactivate:"Deactivate",Remove:"Remove","Confirm?":"Confirm?","Sync Status":"Sync Status","Start or stop sync":"Start or stop sync","Stop sync successfully":"Stop sync successfully","Start sync successfully":"Start sync successfully",Stop:"Stop",Start:"Start","Show thino near mouse":"Show thino near mouse","Query not found":"Query not found","Send to clipboard successfully":"Send to clipboard successfully","Thino - Failed to start HTTP server, please check the port is available.":"Thino - Failed to start HTTP server, please check the port is available.","Thino - Started HTTP server on port":"Thino - Started HTTP server on port","Thino - Terminated HTTP server":"Thino - Terminated HTTP server","File not exist":"File not exist","Thino not found":"Thino not found","File not found for the given thino path, is creating a new file":"File not found for the given thino path, is creating a new file","Saved sync token successfully":"Saved sync token successfully","Failed to find daily notes folder":"Failed to find daily notes folder","Please install obsidian-hover-editor plugin first":"Please install obsidian-hover-editor plugin first","Copied app id successfully":"Copied app id successfully","Please input token first":"Please input token first","Please enable sync first":"Please enable sync first","Init Failed":"Init Failed","Verify successfully":"Verify successfully","Failed to verify":"Failed to verify","Folder not found for the given thino path, is creating a new folder":"Folder not found for the given thino path, is creating a new folder","File not found for the given thino path":"File not found for the given thino path","Failed to read current daily note, check if it exists.":"Failed to read current daily note, check if it exists.","Failed to save":"Failed to save","Failed to login, please login again":"Failed to login, please login again","COPY FAILED":"COPY FAILED","COPY SUCCEED":"COPY SUCCEED","Copy selected text":"Copy selected text","Copy thino":"Copy thino",COPY:"COPY","This is a pro feature, please upgrade to pro version to use it.":"This is a pro feature, please upgrade to pro version to use it.","You can get pro version from: ":"You can get pro version from: ",Save:"Save",Cancel:"Cancel","Thino Daily Target":"Thino Daily Target",Input:"Input","#Tag":"#Tag","to create tag":"to create tag","You have verified your account. Congrats!":"You have verified your account. Congrats!","Pro features":"Pro features","Target Thino Count":"Target Thino Count",on:"on","Switch waterfall view":"Switch waterfall view","Switch view":"Switch view","Switch list view":"Switch list view","Set daily target":"Set daily target","Thino Save To: ":"Thino Save To: ","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",words:"words","Return To Home Page":"Return To Home Page","Open thino in center window":"Open thino in center window","Open thino in float window":"Open thino in float window","Open thino in right sidebar":"Open thino in right sidebar","Open thino in left sidebar":"Open thino in left sidebar","Show thino editor":"Show thino editor","Toggle minimal mode":"Toggle minimal mode","Focus on thino editor":"Focus on thino editor","ReSync web thinos to local":"ReSync web thinos to local","Sync local thinos to web":"Sync local thinos to web","Show daily thino":"Show daily thino","Focus on search bar":"Focus on search bar","Show-thino in popover(Hover editor)":"Show-thino in popover(Hover editor)","Center window":"Center window","Float window":"Float window","Right sidebar":"Right sidebar","Left sidebar":"Left sidebar","Save thino type when sync local":"Save thino type when sync local","Set the default save thino type when sync local, FILE by default.":"Set the default save thino type when sync local, FILE by default.","Sync service":"Sync service","Pro verification status":"Pro verification status","Live-preview":"Live-preview",Source:"Source","Global copy":"Global copy","Set the folder name":"Set the folder name","Set the filename":"Set the filename","Set the filename for current location file":"Set the filename for current location file","Switch calendar type":"Switch calendar type",alphabetical:"alphabetical",alphabeticalReverse:"alphabeticalReverse",byCount:"byCount",byCountReverse:"byCountReverse","Type here":"Type here",Today:"Today",Yesterday:"Yesterday","Last 7 days":"Last 7 days","Last 30 days":"Last 30 days","Last 90 days":"Last 90 days","Last 180 days":"Last 180 days","Last 365 days":"Last 365 days",Found:"Found","Copy filtered thinos":"Copy filtered thinos","Bulk delete":"Bulk delete","Bulk archive":"Bulk archive","Bulk tag operation":"Bulk tag operation","Bulk restore":"Bulk restore","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.",Preview:"Preview","Set and save":"Set and save","Show day mark in thino list":"Show day mark in thino list","Show day mark on the top of daily range thino. False by default.":"Show day mark on the top of daily range thino. False by default.","Click to expand or fold, Cmd+Click to show all thinos of the day":"Click to expand or fold, Cmd+Click to show all thinos of the day","You can buy a license from":"You can buy a license from","No thinos in range":"No thinos in range",Month:"Month",Week:"Week",Day:"Day",Agenda:"Agenda",Tomorrow:"Tomorrow",Previous:"Previous",Next:"Next","Search all columns...":"Search all columns...","Basic Info":"Basic Info","Additional Info":"Additional Info","Created At":"Created At",Content:"Content","Thino Type":"Thino Type","Source Type":"Source Type","Row status":"Row status",Path:"Path","Pinned Status":"Pinned Status",Table:"Table",Chat:"Chat",Moments:"Moments",Waterfall:"Waterfall",Calendar:"Calendar","Go to page":"Go to page",Page:"Page",Show:"Show",rows:"rows","Temp Filter":"Temp Filter","Open link directly in Thino view":"Open link directly in Thino view","Day mark range":"Day mark range","Set the range of day mark. Day by default.":"Set the range of day mark. Day by default.","Thino is locked":"Thino is locked","Please unlock Thino by input password":"Please unlock Thino by input password","Auto Download Image":"Auto Download Image","Auto download image when save to thino. 'false' by default":"Auto download image when save to thino. 'false' by default","Thino Http IP Type":"Thino Http IP Type","Set Thino http server ip to listen. 'localhost' by default":"Set Thino http server ip to listen. 'localhost' by default","Password to lock Thino":"Password to lock Thino",Unlock:"Unlock",Locked:"Locked","Password is incorrect":"Password is incorrect",Lock:"Lock","Need password to unlock Thino":"Need password to unlock Thino","You have not set a password or enable this feature yet":"You have not set a password or enable this feature yet",Password:"Password","Password for Thino":"Password for Thino","Please input your password to change password settings":"Please input your password to change password settings","Please input your password":"Please input your password","Lock thino":"Lock thino",date:"date",time:"time",event:"event","Add tag position":"Add tag position","Set the position of the tag when adding tag automatically":"Set the position of the tag when adding tag automatically","Add tag automatically":"Add tag automatically","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"Add tag to the end or beginning of the thino content when creating a thino and filtering tags","Add tag with new line":"Add tag with new line","Add tag with new line when adding tag automatically":"Add tag with new line when adding tag automatically","Input to select more tags":"Input to select more tags","Tag Bulk Edit":"Tag Bulk Edit","Exist Tags":"Exist Tags","Selected Tags":"Selected Tags","Click to remove exist tag":"Click to remove exist tag","Click to remove selected tag":"Click to remove selected tag","Select tags":"Select tags","Input to select exist tag":"Input to select exist tag",Beginning:"Beginning",End:"End","Set the heading for saving thino":"Set the heading for saving thino","# Heading":"# Heading","Chat view style":"Chat view style","Set the style of chat view":"Set the style of chat view","Background image for moments view":"Background image for moments view","Set the background image for moments view":"Set the background image for moments view","Icon for moments/chat view/share image":"Icon for moments/chat view/share image","Set the icon for moments/chat view/share image":"Set the icon for moments/chat view/share image","Quote for moments view/share image":"Quote for moments view/share image","Set the quote for moments view/share image":"Set the quote for moments view/share image","Theme for Thino":"Theme for Thino","Set the theme for Thino":"Set the theme for Thino","Interface Details":"Interface Details","Task amount":"Task amount","Thino status":"Thino status","Used tags":"Used tags","Used days":"Used days","Most active day":"Most active day","Most active hour":"Most active hour","Thino amount":"Thino amount","No content to generate.":"No content to generate.","Image generated successfully.":"Image generated successfully.","Failed to generate image.":"Failed to generate image.","Share filtered thinos as image":"Share filtered thinos as image","Latest version":"Latest version","Previous version":"Previous version","Thino update info":"Thino update info","Debug info copied to clipboard":"Debug info copied to clipboard","Copy debug info":"Copy debug info","Failed to load changelog":"Failed to load changelog","View online":"View online",ChangeLog:"ChangeLog","Please open thino first":"Please open thino first","Insert editor":"Insert editor","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.","Default time prefix for thino in daily notes":"Default time prefix for thino in daily notes","Set default time prefix for thino in daily notes.":"Set default time prefix for thino in daily notes.","Save image successfully":"Save image successfully","User quote":"User quote","Set user quote for thino":"Set user quote for thino","User icon":"User icon","Set user icon for thino":"Set user icon for thino","User info":"User info","Copy filtered results":"Copy filtered results","Share image":"Share image",Default:"Default",Gray:"Gray",Grass:"Grass",Flame:"Flame",Olive:"Olive",Ice:"Ice",Magenta:"Magenta","Daily notes":"Daily notes",Editor:"Editor","Append/prepend text when share to Thino":"Append/prepend text when share to Thino","Append text when share to Thino":"Append text when share to Thino","Prepend text when share to Thino":"Prepend text when share to Thino","Add newline when append/prepend text":"Add newline when append/prepend text","Input anything here":"Input anything here",Prepend:"Prepend",Append:"Append",Both:"Both",None:"None","Hide pinned group":"Hide pinned group","Hide pinned group in thino list. False by default.":"Hide pinned group in thino list. False by default.","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.","Different insert target for different type":"Different insert target for different type","Toggle this to set different insert target for different type of thino, like task or list type of thino":"Toggle this to set different insert target for different type of thino, like task or list type of thino","You can set whole diary or only part of it":"You can set whole diary or only part of it","Set process target":"Set process target",Custom:"Custom","Whole diary":"Whole Diary","Set thino insert place":"Set thino insert place","Set where to insert thino content":"Set where to insert thino content","End of the diary":"End of the diary","Custom location":"Custom location"},Y4={},z4={},U4={welcome:"Bienvenue dans Mémo !",ribbonIconTitle:"Mémos",months:["Janvier","Février","Mars","Avril","Mai","Juin","Juillet","Aout","Septembre","Octobre","Novembre","Décembre"],monthsShort:["Jan.","Feb.","Mar.","Apr.","May","June","July","Aug.","Sept.","Oct.","Nov.","Dec."],weekDays:["Dimanche","Lundi","Mardi","Mercredi","Jeudi","Vendredi","Samedi"],weekDaysShort:["Dim","Lun","Mar","Mer","Jeu","Ven","Sam"],to:"à",year:null,month:null,"Basic Options":"Options basique","User name":"Username","Set your user name here. 'Memos 😏' By default":"Définissez votre username ici. Défaut : 'Memo 😏'","Insert after heading":"Insérer après le titre","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Vous devez définir le même titre en-dessous si vous voulez insérer et traiter des mémos sous le même titre.","Allows admonitions to be created using ":"Permet de créer des admonitions en utilisant","Process Memos below":"Insérer Mémo sous","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Seulement les entrée sous cette section/phrase dans vos notes seront considérés. S'il n'existe pas, aucune notes ne sera traité pour ce fichier.","Save Memo button label":"Titre du bouton de sauvegarde","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"Le texte affiché sur le bouton de sauvegarde dans l'UI. Défaut : 'NOTEIT'","Focus on editor when open memos":"Focus sur l'éditeur lors de l'ouverture du mémo.","Focus on editor when open memos. Focus by default.":"Focus sur l'éditeur lors de l'ouverture du mémo. Focus par défaut.","Open daily memos with open memos":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open daily memos with open memos. Open by default.":"Ouvrir les mémos quotidiens quand mémo est ouvert.","Open Memos when obsidian opens":"Ouvrir Mémo quand Obsidian est ouvert.","When enable this, Memos will open when Obsidian opens. False by default.":"Quand activé, Memo sera ouvert quand Obsidian à l'ouverture d'Obsidian. Désactivé par défaut.","Hide done tasks in Memo list":"Masquer les tâches accomplies dans la liste des mémos.","Hide all done tasks in Memo list. Show done tasks by default.":"Masquer les tâches accomplies dans les mémos. Affiche les tâches accomplies par défaut.","Advanced Options":"Options avancées","UI language for date":"Langue de l'UI pour la date","Translates the date UI language. Only 'en' and 'zh' are available.":"Traduit la langue des dates dans l'UI. Seuls 'en', 'fr' et 'zh' sont disponibles. ","Default prefix":"Préfix par défaut.","Set the default prefix when create memo, 'List' by default.":"Définit le préfix par défaut lors de la création d'un mémo. Défault : 'Liste'","Default insert date format":"Format de la date insérée par défaut.","Default editor position on mobile":"Position par défaut de l'éditeur sur mobile.","Set the default date format when insert date by @, 'Tasks' by default.":"Définit le format de la date par défaut lors de l'insertion de la date par @. Défaut : 'Tâches'.","Set the default editor position on Mobile, 'Top' by default.":"Position par défaut de l'éditeur sur le mobile. Défaut : 'Haut'.","Use button to show editor on mobile":"Utilisation du bouton pour afficher l'éditeur sur le mobile.","Show Time When Copy Results":"Aficher l'heure quand les résultats sont copiés","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Place un bouton flottant pour appeler l'éditeur sur mobile. Fonctionne uniquement quand l'éditeur est placé en bas.","Show time when you copy results, like 12:00. Copy time by default.":"Affiche l'heure quand les résultats sont copiés, comme '12:00'. Copie l'heure par défaut","Show Date When Copy Results":"Affiche la date quand les résultats sont copiés","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"Affiche la date quand les résultats sont copiés, comme [[2022-01-01]]. Par défaut, copie la date.","Add Blank Line Between Different Date":"Ajoute une ligne entre les différentes dates.","Add blank line when copy result with date. No blank line by default.":"Ajoute une ligne lors de la copie du résultat avec la date. Pas de ligne par défaut.","Share Options":"Options de partage","Share Memos Image Footer Start":"Début du pied de page — Partage de mémo de mémos","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Définissez ce que vous voulez ici, utilisez {ThinoNum} pour afficher le nombre de thino, {UsedDay} pour les jours. Par défaut : '{ThinoNum} Thino {UsedDay} Days.","Share Memos Image Footer End":"Fin du pied de page — Partage de mémo","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Définissez ce que vous voulez ici. Utilisez {UserName} comme username. Par défaut : '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"Sauvegarde des images partagés dans un dossier sur mobile.","Save image to folder for mobile. False by Default":"Sauvegarder les images dans un dossier sur mobile. Désactivé par défaut.","Say Thank You":"Dites Merci",Donate:"Faire un don","If you like this plugin, consider donating to support continued development:":"Si vous aimez ce plugin, envisagez de faire un don pour soutenir le développement continu :","File Name of Recycle Bin":"Nom de la corbeille","Set the filename for recycle bin. 'delete' By default":"Définition du nom de la poubelle. Défaut : 'Delete'","Set the filename for query file. 'query' By default":"Définit le nom de fichier pour les requête. Défaut : 'Query'","Use Tags In Vault":"Utiliser des tags dans le Coffre","Use tags in vault rather than only in Memos. False by default.":"Utiliser des tags du coffre plutôt que ceux que seulement dans Mémo. Désactivé par défaut.","Ready to convert image into background":"Prêt pour convertir des image en arrière-plan.",List:"Liste",Task:"Tâche",Top:"Haut",Bottom:"Bas",TAG:"TAG",DAY:"JOUR",QUERY:"RECHERCHE",EDIT:"EDITER",PIN:"PIN",UNPIN:"ÉPINGLER",DELETE:"DESÉPINGLER","CONFIRM":"CONFIRMER ","CREATE FILTER":"CRÉER FILTRE",Settings:"Paramètres","Recycle bin":"Corbeille","About Me":"À propos de moi","Fetching data...":"Récupération des données...","Here is No Memos.":"Il n'y a pas de Memos.","Frequently Used Tags":"Tags fréquemment utilisés","What do you think now...":"Que pensez-vous maintenant...",READ:"LU",MARK:"MARQUER",SHARE:"PARTAGER",SOURCE:"SOURCE",RESTORE:"RESTAURER","DELETE AT":"SUPPRIMER","Noooop!":"Noooop!","All Data is Loaded 🎉":"Toutes les données sont chargées 🎉","Quick filter":"Filtre rapide",TYPE:"TYPE",LINKED:"LIEN","NO TAGS":"PAS DE TAGS","HAS LINKS":"A DES LIENS","HAS IMAGES":"A DES IMAGES",INCLUDE:"INCLUS",EXCLUDE:"EXCLUS",TEXT:"TEXTE",IS:"EST",ISNOT:"N'EST PAS",SELECT:"SELECTION","ADD FILTER TERMS":"AJOUTER DES TERMES FILTRÉ",FILTER:"FILTRE",TITLE:"TITRE","CREATE QUERY":"CRÉER UNE RECHERCHE","EDIT QUERY":"ÉDITER UNE RECHERCHE",MATCH:"MATCH",TIMES:"HEURE","Share Memo Image":"Partager un mémo image","↗Click the button to save":"↗Clique pour sauvegarder","Image is generating...":"Génération de l'image...","Image is loading...":"Image en chargement...","Loading...":"Chargement...","😟 Cannot load image, image link maybe broken":"😟 Impossible de charger l'image, le lien peut être brisé","Daily Memos":"Mémo quotidien","CANCEL EDIT":"ANNULER L'ÉDITION","LINK TO THE":"LIENS À","Mobile Options":"Options mobile","Don't support web image yet, please input image path in vault":"Ne supporte pas les images webs. Merci d'insérer le chemin de l'image depuis le coffre.","Background Image in Dark Theme":"Image de fond en thème sombre","Background Image in Light Theme":"Image de fond en thème clair",'Set background image in dark theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème sombre. Définir 'Daily/one.png' par exemple.",'Set background image in light theme. Set something like "Daily/one.png"':"Définir l'image de fond en thème clair. Définir 'Daily/one.png' par exemple.",'Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Définir la composition par défaut du mémo, vous devez utiliser {TIME} comme "HH:mm" et {CONTENT} comme contenu. "{TIME} {CONTENT}" par défaut',"Default Memo Composition":"Composition par défaut du mémo","Show Tasks Label":"Afficher les étiquettes des tâches","Show tasks label near the time text. False by default":"Afficher les étiquettes des tâches à côté du texte horaire. Désactivé par défaut.","Please Open Memos First":"Merci d'ouvrir les mémos en premier"},V4={},Z4={},W4={},$4={},G4={},q4={},J4={},K4={},Q4={welcome:"Bem-vindo ao Thino!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino in daily notes":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM":"CONFIRMAR","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},X4={welcome:"Bem-vindo ao Memos!",ribbonIconTitle:"Thino",months:["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"],monthsShort:["Jan.","Fev.","Mar.","Abr.","Maio","Jun.","Jul.","Ago.","Set.","Out.","Nov.","Dez."],weekDays:["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"],weekDaysShort:["Dom","Seg","Ter","Qua","Qui","Sex","Sáb"],to:"para",year:null,month:null,"Basic Options":"Opções Básicas","User name":"Nome de Usuário","Set your user name here. 'Memos 😏' By default":"Defina o nome de usuário. Padrão: 'Thino 😏'.","Insert after heading":"Inserir após o cabeçalho","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"Deve definir o mesmo cabeçalho na configuração posterior se pretende inserir e processar memorandos abaixo do cabeçalho aqui definido.","Allows admonitions to be created using ":"Permitir que Admonitions sejam criadas usando ","Process Memos below":"Processar Memorandos abaixo do Cabeçalho","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"Somente as entradas abaixo deste cabeçalho serão processadas nas suas notas. Se não configurar esta funcionalidade, nenhuma nota será processada para o ficheiro respetivo.","Save Memo button label":"Legenda do Botão de Guardar Memorandos","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":'Define o texto apresentado na UI do botão guardar memorandos. Padrão: "NOTEIT".',"Focus on editor when open memos":"Focar no Editor ao iniciar o Thino","Focus on Editor when open memos. Focus by default.":'Focar no editor ao iniciar o Thino. Padrão: "Focar".',"Open daily memos with open memos":"Abrir memorandos diários ao iniciar o Thino","Open daily memos with open memos. Open by default.":'Abrir memorandos diários ao iniciar o Thino. Padrão: "Abrir".',"Open Memos when obsidian opens":"Abrir Thino quando o Obsidian inicia","When enable this, Memos will open when Obsidian opens. False by default.":'Quando esta opção está activa, o Memos abrirá quando o Obsidian inicia. Padrão: "Falso".',"Hide done tasks in Memo list":"Ocultar tarefas concluídas na lista de memorandos","Hide all done tasks in Memo list. Show done tasks by default.":'Ocultar todas as tarefas concluídas na lista de memorandos. Padrão: "Mostrar tarefas concluídas".',"Advanced Options":"Opções Avançadas","UI language for date":"Idioma na UI da Data ","Translates the date UI language. Only 'en' and 'zh' are available.":"Define o idioma na UI da Data. De momento, apenas 'en', 'fr', 'pt' e 'zh' estão disponíveis.","Default prefix when save thino in daily notes":"Prefixo Padrão","Set the default prefix when create memo, 'List' by default.":"Define o prefixo padrão quando um memorando é criado. Padrão: 'Lista'.","Default insert date format":"Formato Padrão para Inserção de Data","Set the default date format when insert date by @, 'Tasks' by default.":"Define o formato de Data padrão ao inserir a data usando '@'. Padrão: 'Tarefas'.","Default editor position on mobile":"Posição Padrão do Editor de Memorandos na Versão Móvel","Set the default editor position on Mobile, 'Top' by default.":"Define a posição padrão do editor de memorandos na versão móvel. Padrão: 'Topo'.","Use button to show editor on mobile":"Usar Botão para Mostrar o Editor na Versão Móvel","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"Define um botão flutuante para abrir o editor na versão móvel. Opção disponível somente quando a posição do editor está definida para 'Fundo'.","Show Time When Copy Results":"Mostrar a Hora ao Copiar os Resultados","Show time when you copy results, like 12:00. Copy time by default.":"Mostrar a Hora, no formato '12:00', ao copiar os resultados. Padrão: 'Copiar a hora'.","Show Date When Copy Results":"Mostrar a Data ao Copiar os Resultados","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":'Mostrar a Data, no formato [[2022-01-01]], ao copiar os resultados. Padrão: "Copiar a hora".',"Add Blank Line Between Different Date":"Adicionar Linha em Branco entre Datas Diferentes.","Add blank line when copy result with date. No blank line by default.":'Adicionar linha em branco ao copiar resultados com Data. Padrão: "Não adicionar linha."',"Share Options":"Opções de Partilha","Share Memos Image Footer Start":"Partilhar a Imagem de um memorando - Início do Rodapé","Set anything you want here, use {ThinoNum} to display Number of memos, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"Defina como preferir, use {ThinoNum} para mostrar o número de thinorandos e use {UsedDay} para dias. 'Padrão: {ThinoNum} Thinorandos {UsedDay} Dias'.","Share Memos Image Footer End":"Partilhar a Imagem de um memorando - Fim do Rodapé","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"Defina como preferir, use {UserName} como o seu nome de usuário. Padrão: '✍️ Por {UserName}'.","Save Shared Image To Folder For Mobile":"Guardar a Imagem Partilhada para Pasta na Versão Móvel","Save image to folder for mobile. False by Default":'Guardar a imagem partilhada para pasta na versão móvel. Padrão: "Falso".',"Say Thank You":"Agradeça",Donate:"Doar","If you like this plugin, consider donating to support continued development:":"Se gosta deste plugin, considere doar para apoiar o seu desenvolvimento contínuo:","File Name of Recycle Bin":"Nome da Reciclagem","Set the filename for recycle bin. 'delete' By default":"Define o nome do ficheiro para a Reciclagem. Padrão: 'delete'.","File Name of Query File":"Nome do Ficheiro de Query","Set the filename for query file. 'query' By default":"Define o nome do ficheiro de Query. Padrão: 'Query'.","Use Tags In Vault":"Usar Tags no Vault","Use tags in vault rather than only in Memos. False by default.":'Usar as Tags do Vault e não somente dos memorandos. Padrão: "Falso".',"Ready to convert image into background":"Pronto para converter imagem em fundo",List:"Lista",Task:"Tarefa",Top:"Topo",Bottom:"Fundo",TAG:"TAG",DAY:"DIA",QUERY:"QUERY",EDIT:"EDITAR",PIN:"FIXAR",UNPIN:"DESAFIXAR",DELETE:"ELIMINAR","CONFIRM":"CONFIRMAR","CREATE FILTER":"CRIAR FILTRO",Settings:"Definições","Recycle bin":"Reciclagem","About Me":"Acerca de mim","Fetching data...":"A obter dados...","Here is No Memos.":"Não existem Thino.","Frequently Used Tags":"Tags Usadas Frequentemente","What do you think now...":"Em que está a pensar...",READ:"LER",MARK:"ASSINALAR",SHARE:"PARTILHAR",SOURCE:"ORIGEM",RESTORE:"RESTAURAR","DELETE AT":"ELIMINADO EM","Noooop!":"Noooop!","All Data is Loaded 🎉":"Todos os Dados foram Carregados 🎉","Quick filter":"Filtro rápido",TYPE:"TIPO",LINKED:"LINKED","NO TAGS":"SEM TAGS","HAS LINKS":"TEM LINKS","HAS IMAGES":"TEM IMAGENS",INCLUDE:"INCLUIR",EXCLUDE:"EXCLUIR",TEXT:"TEXTO",IS:"É",ISNOT:"NÃO É",SELECT:"SELECCIONAR","ADD FILTER TERMS":"ADICIONAR TERMOS DE FILTRAGEM",FILTER:"FILTRAR",TITLE:"TÍTULO","CREATE QUERY":"CRIAR QUERY","EDIT QUERY":"EDITAR QUERY",MATCH:"IGUALA",TIMES:"VEZES","Share Memo Image":"Partilhar Imagem de Memo","↗Click the button to save":"↗Clique no botão para guardar","Image is generating...":"A gerar Imagem..","Image is loading...":"A carregar Imagem...","Loading...":"Carregando...","😟 Cannot load image, image link maybe broken":"😟 Não é possível carregar a imagem, o link da imagem pode estar incorrecto","Daily Memos":"Thino Diários","CANCEL EDIT":"CANCELAR EDIÇÃO","LINK TO THE":"LINK PARA O","Mobile Options":"Opções Móveis","Don't support web image yet, please input image path in vault":"Ainda não existe suporte para imagens de web. Por favor, insira o link para uma imagem do vault","Experimental Options":"Opções Experimentais","Background Image in Dark Theme":"Imagem de Fundo no Tema Escuro","Background Image in Light Theme":"Imagem de Fundo no Tema Claro",'Set background image in dark theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema escuro. Defina da seguinte forma: "Daily/one.png".','Set background image in light theme. Set something like "Daily/one.png"':'Defina a imagem de fundo para o tema claro. Defina da seguinte forma: "Daily/one.png".','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'Defina a composição padrão do memorando, deve usar {TIME} como "HH:mm" e {CONTENT} como conteúdo. Padrão: "{TIME} {CONTENT}".',"Default Memo Composition":"Composição Padrão de um Memorando","Show Tasks Label":"Mostrar Etiquetas de Tarefas","Show tasks label near the time text. False by default":'Mostrar etiquetas de tarefas próximas do texto de tempo. Padrão: "Falso".',"Please Open Memos First":"Por favor, abra o Thino primeiro",DATE:"DATA",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED",BEFORE:"ANTES",AFTER:"DEPOIS","Allow Comments On Memos":"Permitir Comentários nos Memorandos","You can comment on memos. False by default":'Permite que comente os memorandos. Padrão: "Falso".',Import:"Importar","TITLE CANNOT BE NULL!":"O TÍTULO NÃO PODE SER NULO!","FILTER CANNOT BE NULL!":"O FILTRO NÃO PODE SER NULO!","Comments In Original DailyNotes/Notes":"Comentários nas Notas/Notas Diárias Originais","You should install Dataview Plug-in ver 0.5.9 or later to use this feature.":"Deve instalar a versão 0.5.9 ou posterior do plugin Dataview para usar esta funcionalidade.","Open Memos Successfully":"Thino Iniciado com Sucesso","Fetch Memos Error":"😭 Erro de Fetch","Copied to clipboard Successfully":"Copiado para a área de transferência com sucesso","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"Verifique se abriu o plugin de Notas Diárias ou de Notas Periódicas","Please finish the last filter setting first":"Por favor, termine primeiro a configuração do último filtro","Close Memos Successfully":"Thino Fechado com Sucesso","Insert as Memo":"Inserir como um Memorando","Insert file as memo content":"Inserir ficheiro como conteúdo de um memorando","Image load failed":"Falha no carregamento da imagem","Content cannot be empty":"O Conteúdo não pode estar vazio","Unable to create new file.":"Não foi possível criar um novo ficheiro.","Failed to fetch deleted memos: ":"Falha no fetch dos memorandos removidos: ","RESTORE SUCCEED":"RESTAURO BEM SUCEDIDO","Save Memo button icon":"Ícone do Botão para Guardar Memorandos","The icon shown on the save Memo button in the UI.":"O ícone exibido na UI do botão para guardar memorandos.","Fetch Memos From Particular Notes":"Obter Memorandos de Notas Específicas",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'Pode definir qualquer Query de Dataview para o Memos procurar. Todos os memorandos nessas notas serão mostrados na lista. Padrão: "#memo".',"Allow Memos to Fetch Memo from Notes":"Permitir que o Thino Obtenha memorandos das Notas","Use Memos to manage all memos in your notes, not only in daily notes. False by default":'Use o Memos para gerir todos os memorandos nas suas notas e não apenas nas notas diárias. Padrão: "Falso".',"Always Show Memo Comments":"Mostrar Comentários dos Memorandos","Always show memo comments on memos. False by default":'Mostrar sempre os comentários dos memorandos. Padrão: "Falso".',"You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"Não definiu a pasta para as notas diárias, quer no plugin the Notas Periódicas ou de Notas Diárias.","Please check your daily note plugin OR periodic notes plugin settings":"Por favor, verifique as configurações dos plugins de Notas Diárias OU de Notas Periódicas","Use Which Plugin's Default Configuration":"Usar a Configuração Padrão do Plugin","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"O Memos usa a configuração padrão do plugin seleccionado para obter memorandos diariamente. Padrão: 'Notas Diárias'.",Daily:"Diário"},eN={},tN={},nN={},rN={welcome:"欢迎使用 Thino ",ribbonIconTitle:"Thino",months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:[null,null,null,null,null,null,null,null,null,null,null,null],weekDays:["周日","周一","周二","周三","周四","周五","周六"],weekDaysShort:["周日","周一","周二","周三","周四","周五","周六"],to:"至",year:"年",month:"月","Basic Options":"基础选项","User name":"用户名","Set your user name here. 'Memos 😏' By default":"在这里设置你喜欢的用户名。 默认为 'Thino 😏'",'You can set target heading like "# Heading" to control data location':'你可以设置目标标题,例如 "# Heading" 来控制数据的位置',"Insert after heading":"在指定标题后插入 Thino","If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"若留空,则记录的 thino 内容在日记末尾插入,若填写标题,则记录的 thino 内容统一都记录在该标题下","Process Memos below":"解析指定标题后的 Thino","If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.":"若留空则在Thino界面会显示所有thino记录内容若填写标题则Thino界面只显示该标题下的内容写入其他位置的内容不显示","Save Memo button label":"保存按钮上的文本","The text shown on the save Memo button in the UI. 'NOTEIT' by default.":"在保存按钮上展示的文本。默认为 'NOTEIT'","Focus on editor when open memos":"自动聚焦到 Thino 输入框","Focus on editor when open memos. Focus by default.":"当打开 Thino 的时候自动聚焦到 Thino 输入框。默认开启","Open daily memos with open memos":"打开每日 Thino 的时候打开 Thino 界面","Open daily memos with open memos. Open by default.":"打开每日 Thino 的时候打开 Thino 界面。默认开启","Open Memos when obsidian opens":"当开启 Obsidian 的时候自动打开 Thino","When enable this, Memos will open when Obsidian opens. False by default.":"当开启该选项, Thino 会在 Obsidian 打开时自动打开。默认不开启。","Hide done tasks in Memo list":"在 Thino 列表中隐藏已完成 Thino","Hide all done tasks in Memo list. Show done tasks by default.":"在 Thino 列表中隐藏已完成 Thino。默认不开启","Advanced Options":"进阶选项","UI language for date":"针对日期展示的语言界面","Translates the date UI language. Only 'en' and 'zh' are available.":"对日期的不同翻译。目前只能选择 'en' 和 'zh'(未来会废置)","Default prefix when save thino in daily notes":"在日记中保存 Thino 时的默认前缀","Set the default prefix when create memo, 'List' by default.":"设置默认的前缀样式。默认为列表","Default insert date format":"插入日期附带的样式","Set the default date format when insert date by @, 'Tasks' by default.":"当使用 @ 来快速插入日期时,插入日期附带的样式,默认为 'Tasks' 样式","Default editor position on mobile":"在移动端上的默认编辑器位置","Set the default editor position on Mobile, 'Top' by default.":"设置在移动端上的默认编辑器位置,默认在顶部。","Use button to show editor on mobile":"当编辑器位置在底部时,用按钮来唤出编辑器","Set a float button to call editor on mobile. Only when editor located at the bottom works.":"设置一个浮动按钮来唤出编辑器。当在移动端上启用该选项才会生效","Show Time When Copy Results":"当复制检索结果时附带时间","Show time when you copy results, like 12:00. Copy time by default.":"在复制检索结果时附带其时间,例如 12:00 。默认开启","Show Date When Copy Results":"当复制检索结果时附带日期","Show date when you copy results, like [[2022-01-01]]. Copy date by default.":"在复制检索结果时附带其日期,例如 [[2022-01-01]]。默认开启","Add Blank Line Between Different Date":"在复制日期的时候加上空行","Add blank line when copy result with date. No blank line by default.":"在复制日期的时候在相邻的日期之间加上空行。默认无空行","Share Options":"分享选项","Share Memos Image Footer Start":"分享 Thino 图片的左边页脚","Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default":"你可以在这里设置你想要的任意文本,用 {ThinoNum} 来展示你记录的 thino 数量,{UsedDay} 来展示使用日期。默认为'{ThinoNum} Thino {UsedDay} Days'","Share Memos Image Footer End":"分享 Thino 图片的右边页脚","Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default":"你可以在这里设置你想要的任意文本,用 {UserName} 来展示你的用户名。默认为 '✍️ By {UserName}'","Save Shared Image To Folder For Mobile":"当在移动端上时保存图片到文件夹","Save image to folder for mobile. False by Default":"当在移动端上时,保存生成的图片到文件夹","Say Thank You":"感谢开发",Donate:"捐赠","If you like this plugin, consider donating to support continued development:":"如果你喜欢这个插件,而且也希望给我买鸡腿,那么可以考虑 Github 页面右边的 Sponsor~","File Name of Recycle Bin":"回收站的文件名","Set the filename for recycle bin. 'delete' By default":"给回收站设置一个文件名。默认为'delete'","File Name of Query File":"检索文件的文件名","Set the filename for query file. 'query' By default":"设置存放检索式的文件的文件名。默认为'query'","Use Tags In Vault":"使用在库内的所有标签","Use tags in vault rather than only in Memos. False by default.":"使用在库内的而不是 Thino 内的标签。默认关闭","Don't support web image yet, please input image path in vault":"暂不支持网络图片,请使用本地图片","Ready to convert image into background":"正在将图片转换为背景图",List:"列表",Task:"任务",Top:"顶部",Bottom:"底部",TAG:"标签",DAY:"天",QUERY:"检索式",EDIT:"编辑",PIN:"置顶",UNPIN:"取消置顶",DELETE:"删除","CONFIRM":"确定删除","CREATE FILTER":"创建检索式",Filter:"筛选",Settings:"设置","Recycle bin":"回收站","About Me":"关于","Fetching data...":"获取数据中...","Here is No Memos.":"没有找到 Thino","Frequently Used Tags":"常用标签","What do you think now...":"你现在在想什么?",READ:"阅读",MARK:"引用",SHARE:"分享",SOURCE:"来源",RESTORE:"恢复",ARCHIVE:"归档","DELETE AT":"删除于","Noooop!":"啥都没有!","All Data is Loaded 🎉":"所有数据都加载好啦 🎉","Quick filter":"快速筛选",TYPE:"类型",LINKED:"有链接","NO TAGS":"无标签","HAS LINKS":"有超链接","HAS IMAGES":"有图片",INCLUDE:"包括",EXCLUDE:"排除",TEXT:"文本",IS:"是",AND:"和",OR:"或",LIST:"状态",ISNOT:"不是",SELECT:"选择","ADD FILTER TERMS":"添加检索条件",FILTER:"筛选器",TITLE:"标题","CREATE QUERY":"创建检索式","EDIT QUERY":"编辑检索式",MATCH:"匹配",TIMES:"次","Share Memo Image":"分享 Thino 图片","↗Click the button to save":"↗点击右上角的按钮来保存","Image is generating...":"图片正在生成中...","Image is loading...":"图片正在加载中...","😟 Cannot load image, image link maybe broken":"😟 无法加载图片,图片链接也许不存在","Loading...":"努力加载中...","Daily Memos":"每日 Thino","CANCEL EDIT":"取消编辑","LINK TO THE":"链接到","Mobile Options":"移动端选项","Experimental Options":"实验性选项","Background Image in Dark Theme":"深色主题的背景图","Background Image in Light Theme":"浅色主题的背景图",'Set background image in dark theme. Set something like "Daily/one.png"':'设置深色主题的背景图。请设置类似"Daily/one.png"的路径','Set background image in light theme. Set something like "Daily/one.png"':'设置浅色主题的背景图。请设置类似"Daily/one.png"的路径','Set default memo composition, you should use {TIME} as "HH:mm" and {CONTENT} as content. "{TIME} {CONTENT}" by default':'设置默认 Thino 组成,你必须要使用 {TIME} 作为 "HH:mm" 而且要设置 {CONTENT} 作为内容识别。默认情况下, Thino 基于 "{TIME} {CONTENT}" 识别',"Default Memo Composition":"【已弃置】默认 Thino 组成","Show Tasks Label":"展示任务标签","Show tasks label near the time text. False by default":"在 Thino 的时间旁展示任务标签。默认情况下不展示","Please Open Memos First":"请先打开 Thino","Comment it...":"评论...",DATE:"日期",OBSIDIAN_NLDATES_PLUGIN_NOT_ENABLED:"Obsidian Natrual DATES language 插件没启动",BEFORE:"在之前",AFTER:"在之后","Allow Comments On Memos":"允许在 Thino 上评论","You can comment on memos. False by default":"你可以在 Thino 点击图标进行评论了。默认不开启",Import:"导入","TITLE CANNOT BE NULL!":"标题不可以为空!","FILTER CANNOT BE NULL!":"筛选器不可以为空!","Comments In Original DailyNotes/Notes":"在原文件中进行评论","You should install Dataview Plugin ver 0.5.9 or later to use this feature.":"你需要安装 0.5.9 版本以上的 Dataview 插件来使用该功能","Open Memos Successfully":"成功打开 Thino ","Fetch Memos Error":"😭 Thino 获取失败","Copied to clipboard Successfully":"复制成功","Check if you opened Daily Notes Plugin Or Periodic Notes Plugin":"请检查你有没有开启日记插件或者 Periodic Notes 插件且启用了日记模式","Please finish the last filter setting first":"先完善上一个过滤器吧","Close Memos Successfully":"成功关闭 Thino ","Insert as Memo":"插入内容为 Thino","Insert file as memo content":"插入文件为 Thino","Image load failed":"有个图片加载失败了😟","Content cannot be empty":"内容不能为空呀","Unable to create new file.":"无法新建文件","Failed to fetch deleted memos: ":"无法获取已删除的 Thino ","RESTORE SUCCEED":"成功恢复 Thino","DELETE SUCCEED":"删除成功","Save Memo button icon":"保存按钮上的图标","The icon shown on the save Memo button in the UI.":"你可以设置保存按钮上的图标","Fetch Memos From Particular Notes":"从指定的文件中获取 Thino",'You can set any Dataview Query for memos to fetch it. All memos in those notes will show on list. "#memo" by default':'你可以给笔记设置指定检索式来让 Memos 可以索引到它。默认为 "#memo" ',"Allow Memos to Fetch Memo from Notes":"允许 Thino 从笔记中获取 Thino","Use Memos to manage all memos in your notes, not only in daily notes. False by default":"使用 Memos 来管理你笔记中的 Memos不单只 DailyNotes 中的内容。默认为关闭","Always Show Memo Comments":"评论将总是可见","Always show memo comments on memos. False by default":"当开启后评论总是会在 Thino 的下方展示。默认为关闭","You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的所在文件夹","Please check your daily note plugin OR periodic notes plugin settings":"请检查你的日记插件和/或 Periodic Notes 插件的设置","Use which plugin's default configuration":"使用哪个插件的默认日记配置","Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.":"Thino 采用指定插件的默认配置来获取 Thino。默认为日记插件。",Daily:"日记插件","Always Show Leaf Sidebar on PC":"在 PC 上总是展示左侧栏","Show left sidebar on PC even when the leaf width is less than 875px. False by default.":"在 PC 上即使页面宽度小于 875px 时都展示左侧栏。默认为关闭","You didn't set format for daily notes in both periodic-notes and daily-notes plugins.":"你在 Periodic Notes 插件和日记插件都没设置日记的格式","fetch more":"加载更多","Search all settings":"搜索所有设置","Random Review":"随机回顾","ARCHIVED AT":"归档于","Failed to get memos from daily notes":"无法从日记中获取 Thino","Failed to delete memo":"无法删除 Thino","CTRL + ENTER to save":"CTRL + ENTER 保存","Started from":"开始于","Custom Background Image":"自定义背景图","Set custom background image.":"设置自定义背景图","Custom Memo Footer":"自定义 Thino 页脚","Set custom memo footer.":"设置自定义 Thino 页脚","Heatmap Color Scheme":"热力图颜色","Set different color scheme for heatmap.":"设置热力图的颜色","Enable Local Http Server":"启用本地 HTTP 服务器","Memos Http Server Port":"Thino HTTP 服务器端口","Set memos http server port to listen. '43999' by default":"设置 Thino HTTP 服务器端口。默认为 '43999'","Live-Preview Mode OR Source Mode.":"基于 Thino 的所见即所得模式(默认) 或者 源码模式,你可以自己选择适合自己的输入体验。","Default Editor Mode":"默认编辑器模式","Save type for Thino":"Thino 保存类型",DAILY:"日记",MULTI:"多文件",CANVAS:"画布",FILE:"单文件",ALL:"所有","Failed to create daily note, check if it exists.":"无法创建日记,请检查是否存在文件夹","Failed to create daily note. Please check if you created a folder for daily notes.":"无法创建日记,请检查是否存在日记文件夹","After you verify your account, please refresh this page.":"验证成功后,请刷新页面。",Verify:"去验证","Oops! You forget to verify insider account":"内测账户验证失败","If you have any questions, please contact us.":"如果你有任何问题,请联系我们。","Delete Thino Directly":"直接删除 Thino","When delete thino directly, it will not be moved to trash. False by default.":"当直接删除 Thino 时,不会移动到回收站。默认为关闭","Get activation code":"获取激活码","Input activation code here":"在这里输入激活码","Copy Thino id":"获取 Thino id","Activate Pro Version":"激活专业版","Please copy Thino id first":"请先获取 Thino id",'You can set folder name with file name like "folder/file"':'你可以设置例如 "folder/file" 的文件夹名+文件名的搭配来存放在指定文件夹','You can set folder name like "folder1/folder2/folder3" to create sub-folder':'你可以设置例如 "folder1/folder2/folder3" 的文件夹名来创建子文件夹',"Default save type":"默认保存类型",'Set the default save type for thino. "DAILY" by default':'设置 Thino 的默认保存类型。默认为 "日记"',"Enable opening thino globally":"全局唤醒 Thino","Enable opening thino globally. False by default.":"全局唤醒 Thino。默认为关闭","Key for opening thino globally":"全局唤醒 Thino 的快捷键","Set key for opening thino globally. CTRL + SHIFT + T by default.":"设置全局唤醒 Thino 的快捷键。默认为 CTRL + SHIFT + T","Sync Thino via PKMer":"通过 PKMer 同步 Thino",Unlink:"取消链接",Link:"链接","Connect to PKMer Sync, you can check it in ":"连接到 PKMer 同步,你可以在该链接中查看:","PKMer Sync":"PKMer 同步","Remove successfully":"移除成功",Deactivate:"取消激活",Remove:"移除","Confirm?":"确认?","Sync Status":"同步状态","Start or stop sync":"开始或停止同步","Stop sync successfully":"停止同步成功","Start sync successfully":"开始同步成功",Stop:"停止",Start:"开始","Show thino near mouse":"在鼠标附近展示 Thino","Query not found":"检索式未找到","Send to clipboard successfully":"发送到剪贴板成功","Thino - Failed to start HTTP server, please check the port is available.":"Thino - 启动 HTTP 服务器失败,请检查端口是否可用。","Thino - Started HTTP server on port":"Thino - 启动 HTTP 服务器成功,端口为","Thino - Terminated HTTP server":"Thino - 终止 HTTP 服务器","File not exist":"文件不存在","Thino not found":"Thino 未找到","File not found for the given thino path, is creating a new file":"未找到承载指定 Thino 的文件,正在创建新文件","Saved sync token successfully":"保存同步令牌成功","Failed to find daily notes folder":"未找到日记文件夹","Please install obsidian-hover-editor plugin first":"请先安装 obsidian-hover-editor 插件","Copied app id successfully":"复制 app id 成功","Please input token first":"请先输入 token","Please enable sync first":"请先启用同步","Init Failed":"初始化失败","Folder not found for the given thino path, is creating a new folder":"未找到承载指定 Thino 的文件夹,正在创建新文件夹","File not found for the given thino path":"未找到承载指定 Thino 的文件","Failed to read current daily note, check if it exists.":"无法读取日记文件,请检查是否存在","Verify successfully":"验证成功","Failed to verify":"验证失败","Failed to save":"保存失败","Failed to login, please login again":"登录已过期,请重新登录","COPY FAILED":"复制失败","COPY SUCCEED":"复制成功","Copy selected text":"复制选中文本","Copy thino":"复制",COPY:"复制","This is a pro feature, please upgrade to pro version to use it.":"这是专业版功能,请升级到专业版来使用它。","You can get pro version from: ":"你可以从这里获取专业版:",Save:"保存",Cancel:"取消","Thino Daily Target":"Thino 每日目标",Input:"输入","#Tag":"#标签","to create tag":"来创建标签","You have verified your account. Congrats!":"你已经验证了你的账户。恭喜!","Pro features":"专业版功能","Target Thino Count":"目标 Thino 数量",on:"在","Switch waterfall view":"切换瀑布流视图","Switch view":"切换视图","Switch list view":"切换列表视图","Set daily target":"设置每日目标","Thino Save To: ":"Thino 保存到:","Enter fullscreen mode":"进入全屏模式","Exit fullscreen mode":"退出全屏模式",words:"字词","Return To Home Page":"返回首页","Open thino in center window":"在中心窗口打开 thino","Open thino in float window":"在浮动窗口打开 thino","Open thino in right sidebar":"在右侧边栏打开 thino","Open thino in left sidebar":"在左侧边栏打开 thino","Show thino editor":"显示 thino 编辑器","Toggle minimal mode":"切换 Minimal 模式","Focus on thino editor":"聚焦到 thino 编辑器","ReSync web thinos to local":"重新同步 web 上的 thino 到本地","Sync local thinos to web":"同步本地的 thino 到 web","Show daily thino":"显示每日 thino 视图","Focus on search bar":"聚焦到搜索栏","Show-thino in popover(Hover editor)":"在弹出框中显示 thino","Center window":"中心窗口","Float window":"浮动窗口","Right sidebar":"右侧边栏","Left sidebar":"左侧边栏","Save thino type when sync local":"同步本地时保存的 thino 类型","Set the default save thino type when sync local, FILE by default.":"设置同步本地时保存的 thino 类型,默认为单文件。","Sync service":"同步服务","Pro verification status":"专业版激活状态","Live-preview":"所见即所得",Source:"源码",General:"通用",Thino:"Thino",Theme:"主题",Share:"分享",Interface:"界面",Advanced:"进阶","Global copy":"全局复制","Set the folder name":"设置文件夹名","Set the filename":"设置文件名","Set the filename for current location file":"设置当前位置文件的文件名","Switch calendar type":"切换日历类型",alphabetical:"标签名称A-Z",alphabeticalReverse:"标签名称Z-A",byCount:"按使用次数(从高到低)",byCountReverse:"按使用次数(从低到高)","Type here":"在这里输入",Today:"今天",Yesterday:"昨天","Last 7 days":"最近 7 天","Last 30 days":"最近 30 天","Last 90 days":"最近 90 天","Last 180 days":"最近 180 天","Last 365 days":"最近 365 天",Found:"被找到","Copy filtered thinos":"复制筛选的 thino","Bulk delete":"批量删除","Bulk archive":"批量归档","Bulk tag operation":"标签编辑","Bulk restore":"批量恢复","If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again.":"如果你禁用了日记插件,可能会导致 thino 无法被正确删除。请启用插件后再试一次。",Preview:"预览","Set and save":"设置并保存","Show day mark in thino list":"在 Thino 列中展示日期标记","Show day mark on the top of daily range thino. False by default.":"在 Thino 列中展示日期标记。默认为关闭","Click to expand or fold, Cmd+Click to show all thinos of the day":"点击展开或折叠Cmd+点击展示当天所有 thino","You can buy a license from":"你可以从这里购买许可证","No thinos in range":"该范围内没有 thino",Month:"月视图",Week:"周视图",Day:"日视图",Agenda:"日程视图",Tomorrow:"明天",Previous:"往前",Next:"往后","Search all columns...":"搜索所有的列...","Basic Info":"基础信息","Additional Info":"附加信息","Created At":"创建于",Content:"内容","Thino Type":"Thino 类型","Source Type":"来源类型","Row status":"归档状态",Path:"路径","Pinned Status":"置顶状态",Table:"表格",Chat:"聊天",Moments:"动态",Waterfall:"瀑布流",Calendar:"日历","Go to page":"跳转到页",Page:"页",Show:"展示",rows:"行","Temp Filter":"临时筛选器","Set the heading for saving thino":"设置保存 Thino 的标题","# Heading":"# 标题","Open link directly in Thino view":"Thino 视图内直接打开双链","Day mark range":"日期标记范围","Set the range of day mark. Day by default.":"设置日期标记的范围,默认为天","Thino is locked":"Thino 已锁定","Please unlock Thino by input password":"请输入密码来解锁 Thino","Auto Download Image":"自动下载图片","Auto download image when save to thino. 'false' by default":"当保存到 Thino 时自动下载图片。默认为 'false'","Thino Http IP Type":"Thino HTTP 服务器 IP 类型","Set Thino http server ip to listen. 'localhost' by default":"设置 Thino HTTP 服务器 IP。默认为 'localhost'","Password to lock Thino":"锁定 Thino 的密码",Unlock:"解锁",Locked:"已锁定","Password is incorrect":"密码错误",Lock:"锁定","Need password to unlock Thino":"需要密码来解锁 Thino","You have not set a password or enable this feature yet":"你还没有设置密码或者启用该功能",Password:"密码","Password for Thino":"Thino 的密码","Please input your password to change password settings":"请输入原来的密码来修改密码设置","Please input your password":"请输入密码","Lock thino":"锁定 Thino",date:"日期",time:"时间",event:"事件","Add tag position":"添加标签位置","Set the position of the tag when adding tag automatically":"设置自动添加标签的位置","Add tag automatically":"自动添加标签","Add tag to the end or beginning of the thino content when creating a thino and filtering tags":"在创建 Thino 和筛选标签时,将标签添加到 Thino 内容的末尾或开头","Add tag with new line":"添加标签时换行","Add tag with new line when adding tag automatically":"自动添加标签时换行","Input to select more tags":"输入来选择更多标签","Tag Bulk Edit":"标签批量编辑","Exist Tags":"已有标签","Selected Tags":"已选标签","Click to remove exist tag":"点击移除已有标签","Click to remove selected tag":"点击移除已选标签","Select tags":"选择标签","Input to select exist tag":"输入来选择已有标签",Beginning:"开头",End:"末尾","Chat view style":"聊天视图样式","Set the style of chat view":"设置聊天视图的样式","Background image for moments view":"动态视图的背景图","Set the background image for moments view":"设置动态视图的背景图","Icon for moments/chat view/share image":"动态/聊天视图/分享图的头像","Set the icon for moments/chat view/share image":"设置动态/聊天视图/分享图的头像","Quote for moments view/share image":"动态视图/分享图的个性签名","Set the quote for moments view/share image":"设置动态视图/分享图的个性签名","Theme for Thino":"Thino 主题","Set the theme for Thino":"设置 Thino 的主题","Interface Details":"界面详情","Task amount":"任务数量","Thino status":"Thino 状态","Used tags":"使用的标签","Used days":"使用的天数","Most active day":"最活跃的一天","Most active hour":"最活跃的一小时","Thino amount":"Thino 数量","No content to generate.":"没有内容可以生成。","Image generated successfully.":"图片生成成功。","Failed to generate image.":"图片生成失败。","Share filtered thinos as image":"分享筛选的 Thino 为图片","Latest version":"最新版本","Previous version":"之前版本","Thino update info":"Thino 更新信息","Debug info copied to clipboard":"调试信息已复制到剪贴板","Copy debug info":"复制调试信息","Failed to load changelog":"无法加载更新日志","View online":"在线查看",ChangeLog:"更新日志","Please open thino first":"请先打开 Thino","Insert editor":"插入编辑器","Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly.":"请在 Thino 设置中为多文件设置不同的路径,日记文件夹与多文件保存路径重复,或者存在被重复读取可能","Default time prefix for thino in daily notes":"日记中 Thino 的默认时间前缀","Set default time prefix for thino in daily notes.":"设置日记中 Thino 的默认时间前缀","Save image successfully":"保存图片成功","User quote":"用户签名","Set user quote for thino":"设置用户签名","User icon":"用户头像","Set user icon for thino":"设置用户头像","User info":"用户信息","Copy filtered results":"复制筛选结果","Share image":"分享图片",Default:"默认",Gray:"灰色",Grass:"草绿",Flame:"火焰",Olive:"橄榄",Ice:"冰",Magenta:"品红","Daily notes":"日记相关",Editor:"编辑器","Append/prepend text when share to Thino":"分享到 Thino 时添加/前置文本","Append text when share to Thino":"分享到 Thino 时添加文本","Prepend text when share to Thino":"分享到 Thino 时前置文本","Add newline when append/prepend text":"添加换行符",Prepend:"前置",Append:"后置",Both:"两者",None:"无","Hide pinned group":"隐藏置顶分组","Hide pinned group in thino list. False by default.":"隐藏置顶的 Thino 分组。默认为关闭","Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.":"设置 Thino 任务类型的标题,如果提供了标题,所有记录的 Thino 内容将统一归类到该标题下。","Different insert target for different type":"不同类型的 Thino 有不同的插入目标","Toggle this to set different insert target for different type of thino, like task or list type of thino":"切换此选项以为不同类型的 Thino 设置不同的插入目标,例如任务或列表类型的 Thino","Set process target":"设置处理目标","You can set whole diary or only part of it":"你可以设置整个日记或者其中的一部分",Custom:"自定义","Whole diary":"整个日记","Set thino insert place":"设置 Thino 插入位置","Set where to insert thino content":"设置 Thino 内容插入位置","End of the diary":"日记的末尾","Custom location":"自定义位置"},aN={},oN={ar:R4,cs:B4,da:_4,de:H4,en:xI,"en-gb":Y4,es:z4,fr:U4,hi:V4,id:Z4,it:W4,ja:$4,ko:G4,nl:q4,nn:J4,pl:K4,pt:Q4,"pt-br":X4,ro:eN,ru:tN,tr:nN,"zh-cn":rN,"zh-tw":aN},zb=oN[C.moment.locale()];function N(e){const t=zb&&zb[e]||xI[e];return t===null?t:t||e}const iN=/```([\s\S]*?)```/g,sN=/\*\*(.+?)\*\*/g,lN=/\*(.+?)\*/g,uN=/\[ \] /g,cN=/\[.{1}\] /g,dN=/^[*-]/g,fN=/(\d+)\. /g,Ub=/\[\[([^\]]+)\]\]/g,fw=/\[([^\]]+)\]\((([^\]]+).md)\)/g,hN=(e,t)=>{const n=e.replace(iN,"<pre lang=''>$1</pre>").replace(dN,"<span class='counter-block'>•</span>").replace(fN,"<span class='counter-block'>$1.</span>").replace(uN,"<span class='todo-block' data-type='todo'>⬜</span>").replace(cN,"<span class='todo-block' data-type='done'>✅</span>").replace(sN,"<strong>$1</strong>").replace(lN,"<em>$1</em>").replace(/&lt;br&gt;/g,"</p><p>").replace(/&amp;/g,"&");let r=n;if(t){if(Ub.test(n)){const a=n.match(Ub);for(let o=0;o<a.length;o++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(a[o])){const s=pN(a[o]);if(/\|/g.test(s)){const[c,d]=s.split("|"),p=D0(c,d);r=n.replace(a[o],p)}else{const p=D0(s,"");r=r.replace(a[o],p)}}}if(fw.test(n)){const a=n.match(fw);for(let o=0;o<a.length;o++)if(!/(jpeg|jpg|gif|png|svg|bmp|wepg)/g.test(a[o])){const s=gN(a[o]),c=mN(a[o]),d=D0(s,c);r=n.replace(a[o],d)}}}return r},D0=(e,t)=>{const{metadataCache:n}=Ee.getState().dailyNotesState.app;return n.getFirstLinkpathDest(decodeURIComponent(e),"")instanceof C.TFile?t?`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link">${t}</a>`:`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link">${e}</a>`:t?`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link is-unresolved">${t}</a>`:`<a data-href="${e}" data-type="link" data-filepath="${e}" class="internal-link is-unresolved">${e}</a>`},pN=e=>{var t;return(t=/\[\[([^\]]+)\]\]/g.exec(e))==null?void 0:t[1]},mN=e=>{var t;return(t=fw.exec(e))==null?void 0:t[1]},gN=e=>{var t;return(t=/\[([^\]]+)\]\((([^\]]+).md)\)/g.exec(e))==null?void 0:t[3]},Vb=e=>{const t=document.createElement("div");return t.className="memo-content-text",t.innerHTML=e,t.innerText},yN=e=>e.replace(/\n/g,"<br>"),vN=e=>{const t=document.createElement("div");return t.textContent=e,t.innerHTML},Zb="mobile-show-sidebar",MI=200,Mi=3600*24*1e3,Fn=/\s#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,mr=/(<p>|<br>)#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/g,$n=/^#([^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]+)/gu,Bu=/(\s||\(|>|^)((http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/~+#-]*[\w@?^=%&/~+#-]))/g,wN=/\[([\s\S]*?)\]\(([\s\S]*?)\)/gu,_u=/([^\s<\\*>'(]+\.(jpeg|jpg|gif|png|svg))(\]\])?(\))?/g,Il=/\[@(.+?)\]\((.+?)\)/g,bN=/^(-|\*|\d\.)\s(\[.\]\s)?(\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,tp=[{title:"DAILY",icon:"list"},{title:"CANVAS",icon:"layout-dashboard"},{title:"MULTI",icon:"file-text"},{title:"FILE",icon:"edit"}];var hw;(e=>{function t(){return parseInt(C.moment().format("x"))}e.getNowTimeStamp=t;function n(H){const Y=/'A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source,U=/\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5/.source,J=/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source,Q=new RegExp([`(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-${Y}])+`,U,J].join("|"),"g");return(H.match(Q)||[]).length}e.getWordCount=n;function r(H){a1()&&(H!=null&&H.EnabledLocationList.some(Y=>Y.value==="DAILY"))&&(H!=null&&H.EnabledLocationList.some(Y=>Y.value==="MULTI"))&&o1().contains(H==null?void 0:H.MemoOtherSaveLocation.MemoDefaultMultiFilePath)&&new C.Notice(N("Please set different save locations for multi-file settings in Thino. The diary folder overlaps with the multi-file save location, or there is a risk of it being read repeatedly."),5e3)}e.checkDailyInMulti=r;function a(){const H=navigator.userAgent;let Y="Unknown";return H.indexOf("Win")!=-1?Y="Windows":H.indexOf("Mac")!=-1?Y="MacOS":H.indexOf("Linux")!=-1&&(Y="Linux"),Y}e.getOSVersion=a;function o(H){return typeof H=="string"&&(H=H.replaceAll("-","/")),new Date(H).getTime()}e.getTimeStampByDate=o;function s(H){const Y=new Date(o(H));return new Date(Y.getFullYear(),Y.getMonth(),Y.getDate()).getTime()}e.getDateStampByDate=s;function c(H){const Y=new Date(o(H)),U=Y.getFullYear(),J=Y.getMonth()+1,Q=Y.getDate();return`${U}/${J}/${Q}`}e.getDateString=c;function d(H){const Y=new Date(o(H)),U=Y.getHours(),J=Y.getMinutes(),Q=U<10?"0"+U:U,le=J<10?"0"+J:J;return`${Q}:${le}`}e.getTimeString=d;function p(H){const Y=new Date(o(H)),U=Y.getFullYear(),J=Y.getMonth()+1,Q=Y.getDate(),le=Y.getHours(),pe=Y.getMinutes(),ie=Y.getSeconds(),se=J<10?"0"+J:J,fe=Q<10?"0"+Q:Q,oe=le<10?"0"+le:le,we=pe<10?"0"+pe:pe,Z=ie<10?"0"+ie:ie;return`${U}/${se}/${fe} ${oe}:${we}:${Z}`}e.getDateTimeString=p;function m(H){return Array.from(new Set(H))}e.dedupe=m;function g(H){const Y=new Set,U=[];for(const J of H)Y.has(J.id)||(Y.add(J.id),U.push(J));return U}e.dedupeObjectWithId=g;function v(H,Y){let U=null;return()=>{U&&clearTimeout(U),U=setTimeout(H,Y)}}e.debounce=v;function D(H,Y,U=!1,J){let Q=null,le=!1;function pe(...ie){if(Q&&clearTimeout(Q),U&&!le){const se=H.apply(this,ie);J&&typeof J=="function"&&J(se),le=!0}else Q=setTimeout(()=>{const se=H.apply(this,ie);J&&typeof J=="function"&&J(se),le=!1,Q=null},Y)}return pe.cancel=function(){Q&&clearTimeout(Q),Q=null,le=!1},pe}e.debouncePlus=D;function S(H,Y){let U=!0;return()=>{if(!U)return!1;U=!1,setTimeout(()=>{H(),U=!0},Y)}}e.throttle=S;function T(H){const Y=[],U=Object.keys(H).sort();for(const J of U){const Q=H[J];Q&&(typeof Q=="object"?Y.push(...T(Q).split("&")):Y.push(`${J}=${Q}`))}return Y.join("&")}e.transformObjectToParamsString=T;function E(H){const Y={},U=H.split("&");for(const J of U){const[Q,le]=J.split("=");Q&&le&&(Y[Q]=le)}return Y}e.transformParamsStringToObject=E;function O(H){if(!H)return{};const Y={},U=Object.keys(H).sort();for(const J of U){const Q=H[J];if(typeof Q=="object"){const le=O(JSON.parse(JSON.stringify(Q)));le&&Object.keys(le).length>0&&(Y[J]=le)}else Q&&(Y[J]=Q)}return Y}e.filterObjectNullKeys=O;async function k(H){if(navigator.clipboard&&navigator.clipboard.writeText)try{await navigator.clipboard.writeText(H)}catch(Y){console.warn("Copy to clipboard failed.",Y)}else console.warn("Copy to clipboard failed, methods not supports.")}e.copyTextToClipboard=k;function j(H){return new Promise(Y=>{const U=new Image;U.onload=()=>{const{width:J,height:Q}=U;J>0&&Q>0?Y({width:J,height:Q}):Y({width:0,height:0})},U.onerror=()=>{Y({width:0,height:0})},U.className="hidden",U.src=H,document.body.appendChild(U),U.remove()})}e.getImageSize=j;async function F(H){var Q,le,pe,ie;let Y;const J=app.plugins.getPlugin("obsidian-memos").settings.UseDailyOrPeriodic==="Daily";try{return!J&&((ie=(pe=(le=(Q=window.app.plugins)==null?void 0:Q.getPlugin("periodic-notes"))==null?void 0:le.calendarSetManager)==null?void 0:pe.getActiveConfig("day"))!=null&&ie.enabled)?(Y=await window.app.plugins.getPlugin("periodic-notes").createPeriodicNote("day",H),Y):(Y=await CI(H),Y)}catch(se){return console.error(se),new C.Notice(N("Failed to create daily note. Please check if you created a folder for daily notes.")),null}}e.createDailyNoteCheck=F;function B(H){const Y=[];let U=0;for(;U<H;U++)Y.push((16*Math.random()|0).toString(16));return Y.join("")}e.randomId=B;function R(H){return H.replace(/[\p{P}\p{Z}\p{S}]/gu,"").length}e.countWords=R;async function z(H){try{const Y=await C.requestUrl(H),U=new Uint8Array(Y.arrayBuffer);return new Blob([U],{type:"image/png"})}catch(Y){return console.error("error in grabImageFromUrl",H,Y),new Blob}}e.grabImageFromUrl=z})(hw||(hw={}));const Ue=hw;function DN(){var o,s,c,d,p,m;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(c=(s=(o=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:o.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:c.folder,a=(m=(p=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:p.daily)==null?void 0:m.format;switch(r===void 0?n=a:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=oy().format||"YYYY-MM-DD";break;case"Periodic":e=n||"YYYY-MM-DD";break;default:e=oy().format||"YYYY-MM-DD";break}return e===void 0&&new C.Notice(N("You didn't set format for daily notes in both periodic-notes and daily-notes plugins.")),e}function o1(){var o,s,c,d,p,m;let e="";const t=app.plugins.getPlugin("obsidian-memos").settings;let n="";const r=(c=(s=(o=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:o.calendarSetManager)==null?void 0:s.getActiveConfig("day"))==null?void 0:c.folder,a=(m=(p=(d=window.app.plugins.getPlugin("periodic-notes"))==null?void 0:d.settings)==null?void 0:p.daily)==null?void 0:m.folder;switch(r===void 0?n=a:n=r,(t==null?void 0:t.UseDailyOrPeriodic)||"Daily"){case"Daily":e=oy().folder||"";break;case"Periodic":e=n||"";break;default:e=oy().folder||"";break}return e===void 0&&new C.Notice(N("You didn't set folder for daily notes in both periodic-notes and daily-notes plugins.")),e}function pw(e,t){var r;e=vN(e),e=yN(e).split("<br>").map(a=>`<p>${a!==""?a:"<br>"}</p>`).join(""),e=hN(e,t),e=e.replace(Fn,"<span class='tag-span'>#$1</span>").replace(mr,"<p><span class='tag-span'>#$2</span>").replace(Bu,"$1<a class='link' target='_blank' rel='noreferrer' href='$2'>$2</a>").replace(wN,"<a class='link' target='_blank' rel='noreferrer' href='$2'>$1</a>").replace(Il,"<span class='memo-link-text' data-value='$2'>$1</span>").replace(/\^\S{6}/g,"");const n=document.createElement("div");n.innerHTML=e;for(let a=0;a<n.children.length;a++){const o=n.children[a];if(o.tagName==="P"&&o.textContent===""&&((r=o.firstElementChild)==null?void 0:r.tagName)!=="BR"){o.remove(),a--;continue}}return n.innerHTML}const Oy=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return new Blob([r],{type:t})};function SN(e,t){switch(t.type){case"SET_MEMOS":{const n=t.payload.memos.sort((a,o)=>{const s=Ue.getTimeStampByDate(a.createdAt),c=Ue.getTimeStampByDate(o.createdAt);return s===c?o.id.localeCompare(a.id):Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(a.createdAt)}),r=Ue.dedupeObjectWithId(n);return{...e,memos:[...r]}}case"SET_COMMENT_MEMOS":{const n=Ue.dedupeObjectWithId(t.payload.commentMemos.sort((r,a)=>Ue.getTimeStampByDate(a.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"SET_TAGS":return{...e,tags:t.payload.tags,tagsNum:t.payload.tagsNum};case"INSERT_MEMO":{const n=Ue.dedupeObjectWithId([t.payload.memo,...e.memos].sort((r,a)=>Ue.getTimeStampByDate(a.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,memos:n}}case"INSERT_COMMENT_MEMO":{const n=Ue.dedupeObjectWithId([t.payload.memo,...e.commentMemos].sort((r,a)=>Ue.getTimeStampByDate(a.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,commentMemos:[...n]}}case"DELETE_MEMO_BY_ID":return{...e,memos:[...e.memos].filter(n=>n.id!==t.payload.id)};case"DELETE_MEMO_BY_ID_BATCH":{const n=[...e.memos];return t.payload.ids.forEach(r=>{n.splice(n.findIndex(a=>a.id===r),1)}),{...e,memos:[...n]}}case"CLEAR_MEMOS":return{...NI};case"EDIT_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"EDIT_MEMO_PATH":{const n=e.memos.map(r=>r.path===t.payload.path?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"UPDATE_MEMO_BATCH":{const n=e.memos.filter(a=>a.path!==t.payload.path),r=Ue.dedupeObjectWithId([...t.payload.memos,...n].sort((a,o)=>Ue.getTimeStampByDate(o.createdAt)-Ue.getTimeStampByDate(a.createdAt)));return{...e,memos:[...r]}}case"ARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"ARCHIVE_MEMO_BY_ID_BULK":{const n=e.memos.map(r=>t.payload.some(a=>a.id===r.id)?{...r,...t.payload.filter(a=>a.id===r.id)[0]}:r);return{...e,memos:[...n]}}case"UNARCHIVE_MEMO_BY_ID":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,memos:[...n]}}case"PIN_MEMO":{const n=e.memos.map(r=>r.id===t.payload.id?{...r,pinned:t.payload.pinned}:r);return{...e,memos:[...n]}}case"EDIT_COMMENT_MEMO":{const n=e.commentMemos.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,commentMemos:[...n]}}default:return e}}const NI={memos:[],commentMemos:[],tags:[],tagsNum:{}};function IN(e,t){switch(t.type){case"SIGN_IN":return{user:t.payload.user};case"SIGN_OUT":return{user:null};default:return e}}const TN={user:null};function EN(e,t){switch(t.type){case"SET_QUERIES":{const n=Ue.dedupeObjectWithId(t.payload.queries.sort((r,a)=>Ue.getTimeStampByDate(a.createdAt)-Ue.getTimeStampByDate(r.createdAt)).sort((r,a)=>Ue.getTimeStampByDate(a.pinnedAt??0)-Ue.getTimeStampByDate(r.pinnedAt??0)));return{...e,queries:n}}case"INSERT_QUERY":{const n=Ue.dedupeObjectWithId([t.payload.query,...e.queries].sort((r,a)=>Ue.getTimeStampByDate(a.createdAt)-Ue.getTimeStampByDate(r.createdAt)));return{...e,queries:n}}case"DELETE_QUERY_BY_ID":return{...e,queries:[...e.queries].filter(n=>n.id!==t.payload.id)};case"UPDATE_QUERY":{const n=e.queries.map(r=>r.id===t.payload.id?{...r,...t.payload}:r);return{...e,queries:n}}default:return e}}const CN={queries:[]};function xN(e,t){var n,r,a,o;switch(t.type){case"SET_DAILY_NOTES":return{...e,dailyNotes:t.payload.dailyNotes};case"SET_APP":return e.app?{...e}:{...e,app:t.payload.app};case"SET_PLUGIN":return e.plugin?{...e}:{...e,plugin:t.payload.plugin};case"SET_EDITOR":return e.editor?{...e}:{...e,editor:t.payload.editor};case"SET_SETTINGS":return e.settings&&e.settings===t.payload.settings?{...e}:{...e,settings:t.payload.settings};case"SET_VIEW":return e.view&&((r=(n=e.view)==null?void 0:n.leaf)==null?void 0:r.id)===((o=(a=t.payload.view)==null?void 0:a.leaf)==null?void 0:o.id)?{...e}:{...e,view:t.payload.view};case"CLEAR_VIEW":return e.view&&e.view.unload(),{...e,view:null};case"CLEAR_FILES":return{...e,dailyNotes:null};case"SET_VERIFY_STATE":return{...e,verifyState:t.payload.verifyState};default:return e}}const MN={dailyNotes:null,app:null,view:null,settings:null,editor:null,plugin:null,verifyState:null},Ee=s4({globalState:u4,locationState:fI,memoState:NI,userState:TN,queryState:CN,dailyNotesState:MN},i4({globalState:l4,locationState:c4,memoState:SN,userState:IN,queryState:EN,dailyNotesState:xN})),mt=A.createContext(Ee.getState());String.prototype.replaceAll||(String.prototype.replaceAll=function(e,t){return Object.prototype.toString.call(e).toLowerCase()==="[object regexp]"?this.replace(e,t):this.replace(new RegExp(e,"g"),t)});class NN{constructor(){me(this,"initialized",!1)}getState(){return Ee.getState().dailyNotesState}setApp(t){return Ee.dispatch({type:"SET_APP",payload:{app:t}}),t}setPlugin(t){return Ee.dispatch({type:"SET_PLUGIN",payload:{plugin:t}}),t}setSettings(t){return Ee.dispatch({type:"SET_SETTINGS",payload:{settings:t}}),this.initialized||(this.initialized=!0),t}setView(t){return Ee.dispatch({type:"SET_VIEW",payload:{view:t}}),t}setEditor(t){return Ee.dispatch({type:"SET_EDITOR",payload:{editor:t}}),t}async updateDailyNotes(t,n){const r=this.getState().dailyNotes,a=Wh(t,"day");return n?delete r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]:r[`day-${a.format("YYYY-MM-DD")}T00:00:00+08:00}`]=t,Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:r}}),r}setVerifyState(t){return Ee.dispatch({type:"SET_VERIFY_STATE",payload:{verifyState:t}}),t}async fechLocalDailyNotes(){try{const t=bs();return Ee.dispatch({type:"SET_DAILY_NOTES",payload:{dailyNotes:t}}),t}catch(t){console.error(t)}}}const Xe=new NN;var Kn;(e=>{function t(o){const s={};for(const c of o)try{const d=localStorage.getItem(c);if(d!==null){const p=JSON.parse(d);s[c]=p}}catch(d){console.error("Get storage failed in ",c,d)}return s}e.get=t;function n(o){for(const s in o)try{const c=JSON.stringify(o[s]);localStorage.setItem(s,c)}catch(c){console.error("Save storage failed in ",s,c)}}e.set=n;function r(o){for(const s of o)try{localStorage.removeItem(s)}catch(c){console.error("Remove storage failed in ",s,c)}}e.remove=r;function a(){var s;const o=document.createElement("iframe");o.style.display="none",document.body.appendChild(o),(s=o.contentWindow)==null||s.localStorage.setItem("t",Date.now().toString()),o.remove()}e.emitStorageChangedEvent=a})(Kn||(Kn={}));class kN{constructor(){me(this,"getState",()=>Ee.getState().globalState);me(this,"setEditMemoId",t=>{Ee.dispatch({type:"SET_EDIT_MEMO_ID",payload:{editMemoId:t}})});me(this,"setRefresh",t=>{Ee.dispatch({type:"SET_REFRESH",payload:{refresh:t}})});me(this,"setCommentMemoId",t=>{Ee.dispatch({type:"SET_COMMENT_MEMO_ID",payload:{commentMemoId:t}})});me(this,"setMarkMemoId",t=>{Ee.dispatch({type:"SET_MARK_MEMO_ID",payload:{markMemoId:t}})});me(this,"setLoaded",t=>{Ee.dispatch({type:"SET_LOADED",payload:{loaded:t}})});me(this,"setGlobalEditorShown",t=>{Ee.dispatch({type:"SET_GLOBAL_EDITOR_SHOWN",payload:{globalEditorShown:t}})});me(this,"setIsMobileView",t=>{Ee.dispatch({type:"SET_MOBILE_VIEW",payload:{isMobileView:t}})});me(this,"setChangedByMemos",t=>{Ee.dispatch({type:"SET_CHANGED_BY_MEMOS",payload:{changedByMemos:t}})});me(this,"setShowSiderbarInMobileView",t=>{Ee.dispatch({type:"SET_SHOW_SIDEBAR_IN_MOBILE_VIEW",payload:{showSiderbarInMobileView:t}})});me(this,"setAppSetting",t=>{Ee.dispatch({type:"SET_APP_SETTING",payload:t}),Kn.set(t)});me(this,"setMemoListView",t=>{Ee.dispatch({type:"SET_MEMO_LIST_VIEW",payload:{memoListView:t}})});me(this,"setInstance",(t,n)=>{Ee.dispatch({type:"SET_INSTANCE",payload:{id:t,instance:n}})});me(this,"setLocked",t=>{Ee.dispatch({type:"SET_LOCKED",payload:{locked:t}})});me(this,"setPluginManifest",t=>{Ee.dispatch({type:"SET_MEMO_PLUGIN_MANIFEST",payload:{manifest:t}})});const t=Kn.get(["shouldSplitMemoWord","shouldHideImageUrl","shouldUseMarkdownParser","useTinyUndoHistoryCache"]),n={shouldSplitMemoWord:t.shouldSplitMemoWord||!0,shouldHideImageUrl:t.shouldHideImageUrl||!0,shouldUseMarkdownParser:t.shouldUseMarkdownParser||!0,useTinyUndoHistoryCache:t.useTinyUndoHistoryCache||!1};this.setAppSetting(n)}}const Qe=new kN;class AN{constructor(){me(this,"updateStateWithLocation",()=>{const{pathname:t,search:n,hash:r}=window.location,a=new URLSearchParams(n),o={pathname:"/",hash:"",query:{tag:"",duration:null,text:"",type:"",filter:""}};o.query.tag=a.get("tag")||"",o.query.type=a.get("type")??"",o.query.text=a.get("text")??"",o.query.filter=a.get("filter")??"";const s=parseInt(a.get("from")??"0"),c=parseInt(a.get("to")??"0");c>s&&c!==0&&(o.query.duration={from:s,to:c}),o.hash=r,o.pathname=this.getValidPathname(t),Ee.dispatch({type:"SET_LOCATION",payload:o})});me(this,"getState",()=>Ee.getState().locationState);me(this,"clearQuery",()=>{Ee.dispatch({type:"SET_QUERY",payload:{tag:"",duration:null,text:"",type:"",filter:""}})});me(this,"setQuery",t=>{Ee.dispatch({type:"SET_QUERY",payload:t})});me(this,"reloadApp",()=>{Ee.dispatch({type:"RELOAD"})});me(this,"setHash",t=>{Ee.dispatch({type:"SET_HASH",payload:{hash:t}})});me(this,"setPathname",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});me(this,"pushHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});me(this,"replaceHistory",t=>{Ee.dispatch({type:"SET_PATHNAME",payload:{pathname:t}})});me(this,"setMemoTypeQuery",(t="")=>{Ee.dispatch({type:"SET_TYPE",payload:{type:t}})});me(this,"setMemoFilter",t=>{Ee.dispatch({type:"SET_QUERY_FILTER",payload:t})});me(this,"setTextQuery",t=>{Ee.dispatch({type:"SET_TEXT",payload:{text:t}})});me(this,"setTimeQuery",t=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:t}})});me(this,"setTagQuery",t=>{Ee.dispatch({type:"SET_TAG_QUERY",payload:{tag:t}})});me(this,"setFromAndToQuery",(t,n)=>{Ee.dispatch({type:"SET_DURATION_QUERY",payload:{duration:{from:t,to:n}}})});me(this,"getValidPathname",t=>["/","/homeboard","/recycle","/setting"].includes(t)?t:"/");this.updateStateWithLocation(),window.onpopstate=()=>{this.updateStateWithLocation()}}}const He=new AN,Cu=e=>`${e.vault.configDir}/query.json`,kI=async(e,t)=>{try{return await e.vault.adapter.read(t),!0}catch(n){return console.error(n),!1}},_d=async e=>(await kI(e,Cu(e))||await AI(e),JSON.parse(await e.vault.adapter.read(Cu(e))).queries||[]),Ep=async(e,t)=>{await e.vault.adapter.write(Cu(e),JSON.stringify({queries:t},null,2))},AI=async e=>{const t=Qe.getState().manifest,n=e.plugins.getPlugin(t.id||"obsidian-memos").settings,r=e.metadataCache.getFirstLinkpathDest(n.QueryFileName,"");if(!r)await e.vault.adapter.write(Cu(e),JSON.stringify({queries:[]},null,2));else{const o=(await e.vault.read(r)).split(`
`);o.length===0&&await e.vault.adapter.write(Cu(e),JSON.stringify({queries:[]},null,2));const s=[];for(let c=0;c<o.length;c++){const d=c,p="Memos";let m="未命名";const g=o[c];let v=C.moment().format("YYYY/MM/DD HH:mm:ss"),D="[]";const S=g.match(/^\d{14,16}/);S&&(v=C.moment(S[0].slice(0,14),"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:ss"));const T=g.match(/\[\{(.+)\}\]/);T&&(D=T[0]);const E=g.match(/\s(.+)\s\[\{/);E&&(m=E[0].slice(1,-3)),s.push({id:d,pinnedAt:"",createdAt:v,updatedAt:v,title:m,querystring:D,userId:p})}await e.vault.adapter.write(Cu(e),JSON.stringify({queries:s},null,2))}},FN=async()=>{const{app:e}=Ee.getState().dailyNotesState;return await kI(e,Cu(e))||await AI(e),await _d(e)||[]},ON=(e,t)=>({createdAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),id:e,pinnedAt:"",querystring:t,title:N("Temp Filter"),updatedAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"}),PN=async(e,t)=>{const n=await _d(Ee.getState().dailyNotesState.app)||[],r={createdAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),id:C.moment().format("YYYYMMDDHHmmss")+n.length,pinnedAt:"",querystring:t,title:e,updatedAt:C.moment().format("YYYY/MM/DD HH:mm:ss"),userId:"Thino"};return n.push(r),await Ep(Ee.getState().dailyNotesState.app,n),r};var iy={exports:{}};iy.exports;(function(e,t){(function(){var n,r="4.17.21",a=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",s="Expected a function",c="Invalid `variable` option passed into `_.template`",d="__lodash_hash_undefined__",p=500,m="__lodash_placeholder__",g=1,v=2,D=4,S=1,T=2,E=1,O=2,k=4,j=8,F=16,B=32,R=64,z=128,H=256,Y=512,U=30,J="...",Q=800,le=16,pe=1,ie=2,se=3,fe=1/0,oe=9007199254740991,we=17976931348623157e292,Z=NaN,G=4294967295,te=G-1,ge=G>>>1,Ie=[["ary",z],["bind",E],["bindKey",O],["curry",j],["curryRight",F],["flip",Y],["partial",B],["partialRight",R],["rearg",H]],De="[object Arguments]",ke="[object Array]",Ye="[object AsyncFunction]",Re="[object Boolean]",rt="[object Date]",Ht="[object DOMException]",Se="[object Error]",Ze="[object Function]",Ke="[object GeneratorFunction]",Je="[object Map]",lt="[object Number]",ft="[object Null]",Dt="[object Object]",Ct="[object Promise]",un="[object Proxy]",Ft="[object RegExp]",Ot="[object Set]",an="[object String]",wn="[object Symbol]",Tn="[object Undefined]",vr="[object WeakMap]",Ia="[object WeakSet]",tr="[object ArrayBuffer]",Nr="[object DataView]",Is="[object Float32Array]",ho="[object Float64Array]",po="[object Int8Array]",Nl="[object Int16Array]",Pi="[object Int32Array]",ji="[object Uint8Array]",Ts="[object Uint8ClampedArray]",Ho="[object Uint16Array]",Li="[object Uint32Array]",W=/\b__p \+= '';/g,re=/\b(__p \+=) '' \+/g,ye=/(__e\(.*?\)|\b__t\)) \+\n'';/g,xe=/&(?:amp|lt|gt|quot|#39);/g,je=/[&<>"']/g,_e=RegExp(xe.source),ze=RegExp(je.source),gt=/<%-([\s\S]+?)%>/g,Vt=/<%([\s\S]+?)%>/g,On=/<%=([\s\S]+?)%>/g,bn=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,na=/^\w*$/,Pn=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,wr=/[\\^$.*+?()[\]{}|]/g,ra=RegExp(wr.source),kl=/^\s+/,Qt=/\s/,Ta=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Ea=/\{\n\/\* \[wrapped with (.+)\] \*/,Ca=/,? & /,Yo=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,zo=/[()=,{}\[\]\/\s]/,wv=/\\(\\)?/g,Ri=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,of=/\w*$/,Gp=/^[-+]0x[0-9a-f]+$/i,bv=/^0b[01]+$/i,qp=/^\[object .+?Constructor\]$/,Jp=/^0o[0-7]+$/i,Kp=/^(?:0|[1-9]\d*)$/,Qp=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,zu=/($^)/,Dv=/['\n\r\u2028\u2029\\]/g,on="\\ud800-\\udfff",Sv="\\u0300-\\u036f",sf="\\ufe20-\\ufe2f",Xp="\\u20d0-\\u20ff",Al=Sv+sf+Xp,em="\\u2700-\\u27bf",lf="a-z\\xdf-\\xf6\\xf8-\\xff",Uu="\\xac\\xb1\\xd7\\xf7",Va="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Iv="\\u2000-\\u206f",xa=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",tm="A-Z\\xc0-\\xd6\\xd8-\\xde",nm="\\ufe0e\\ufe0f",rm=Uu+Va+Iv+xa,Es="[']",Vu="["+on+"]",Cs="["+rm+"]",Bi="["+Al+"]",am="\\d+",Tv="["+em+"]",Zu="["+lf+"]",uf="[^"+on+rm+am+em+lf+tm+"]",Fl="\\ud83c[\\udffb-\\udfff]",Ol="(?:"+Bi+"|"+Fl+")",om="[^"+on+"]",Pl="(?:\\ud83c[\\udde6-\\uddff]){2}",Yt="[\\ud800-\\udbff][\\udc00-\\udfff]",_i="["+tm+"]",cf="\\u200d",Wu="(?:"+Zu+"|"+uf+")",im="(?:"+_i+"|"+uf+")",df="(?:"+Es+"(?:d|ll|m|re|s|t|ve))?",ff="(?:"+Es+"(?:D|LL|M|RE|S|T|VE))?",$u=Ol+"?",jl="["+nm+"]?",Uo="(?:"+cf+"(?:"+[om,Pl,Yt].join("|")+")"+jl+$u+")*",Vo="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Zo="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",xs=jl+$u+Uo,Ll="(?:"+[Tv,Pl,Yt].join("|")+")"+xs,Wo="(?:"+[om+Bi+"?",Bi,Pl,Yt,Vu].join("|")+")",Ev=RegExp(Es,"g"),sm=RegExp(Bi,"g"),Hi=RegExp(Fl+"(?="+Fl+")|"+Wo+xs,"g"),Cv=RegExp([_i+"?"+Zu+"+"+df+"(?="+[Cs,_i,"$"].join("|")+")",im+"+"+ff+"(?="+[Cs,_i+Wu,"$"].join("|")+")",_i+"?"+Wu+"+"+df,_i+"+"+ff,Zo,Vo,am,Ll].join("|"),"g"),lm=RegExp("["+cf+on+Al+nm+"]"),Gu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,um=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xv=-1,Zt={};Zt[Is]=Zt[ho]=Zt[po]=Zt[Nl]=Zt[Pi]=Zt[ji]=Zt[Ts]=Zt[Ho]=Zt[Li]=!0,Zt[De]=Zt[ke]=Zt[tr]=Zt[Re]=Zt[Nr]=Zt[rt]=Zt[Se]=Zt[Ze]=Zt[Je]=Zt[lt]=Zt[Dt]=Zt[Ft]=Zt[Ot]=Zt[an]=Zt[vr]=!1;var zt={};zt[De]=zt[ke]=zt[tr]=zt[Nr]=zt[Re]=zt[rt]=zt[Is]=zt[ho]=zt[po]=zt[Nl]=zt[Pi]=zt[Je]=zt[lt]=zt[Dt]=zt[Ft]=zt[Ot]=zt[an]=zt[wn]=zt[ji]=zt[Ts]=zt[Ho]=zt[Li]=!0,zt[Se]=zt[Ze]=zt[vr]=!1;var Ms={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},qu={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Mv={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},Nv={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},hf=parseFloat,Ju=parseInt,Ku=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,cm=typeof self=="object"&&self&&self.Object===Object&&self,sn=Ku||cm||Function("return this")(),Rl=t&&!t.nodeType&&t,Za=Rl&&!0&&e&&!e.nodeType&&e,pf=Za&&Za.exports===Rl,Ns=pf&&Ku.process,br=function(){try{var ue=Za&&Za.require&&Za.require("util").types;return ue||Ns&&Ns.binding&&Ns.binding("util")}catch{}}(),mf=br&&br.isArrayBuffer,kr=br&&br.isDate,Yi=br&&br.isMap,Qu=br&&br.isRegExp,ks=br&&br.isSet,dm=br&&br.isTypedArray;function Dr(ue,Ce,ve){switch(ve.length){case 0:return ue.call(Ce);case 1:return ue.call(Ce,ve[0]);case 2:return ue.call(Ce,ve[0],ve[1]);case 3:return ue.call(Ce,ve[0],ve[1],ve[2])}return ue.apply(Ce,ve)}function gf(ue,Ce,ve,Ge){for(var bt=-1,Lt=ue==null?0:ue.length;++bt<Lt;){var En=ue[bt];Ce(Ge,En,ve(En),ue)}return Ge}function nr(ue,Ce){for(var ve=-1,Ge=ue==null?0:ue.length;++ve<Ge&&Ce(ue[ve],ve,ue)!==!1;);return ue}function Xu(ue,Ce){for(var ve=ue==null?0:ue.length;ve--&&Ce(ue[ve],ve,ue)!==!1;);return ue}function yf(ue,Ce){for(var ve=-1,Ge=ue==null?0:ue.length;++ve<Ge;)if(!Ce(ue[ve],ve,ue))return!1;return!0}function $o(ue,Ce){for(var ve=-1,Ge=ue==null?0:ue.length,bt=0,Lt=[];++ve<Ge;){var En=ue[ve];Ce(En,ve,ue)&&(Lt[bt++]=En)}return Lt}function ec(ue,Ce){var ve=ue==null?0:ue.length;return!!ve&&As(ue,Ce,0)>-1}function vf(ue,Ce,ve){for(var Ge=-1,bt=ue==null?0:ue.length;++Ge<bt;)if(ve(Ce,ue[Ge]))return!0;return!1}function Jt(ue,Ce){for(var ve=-1,Ge=ue==null?0:ue.length,bt=Array(Ge);++ve<Ge;)bt[ve]=Ce(ue[ve],ve,ue);return bt}function Go(ue,Ce){for(var ve=-1,Ge=Ce.length,bt=ue.length;++ve<Ge;)ue[bt+ve]=Ce[ve];return ue}function wf(ue,Ce,ve,Ge){var bt=-1,Lt=ue==null?0:ue.length;for(Ge&&Lt&&(ve=ue[++bt]);++bt<Lt;)ve=Ce(ve,ue[bt],bt,ue);return ve}function kv(ue,Ce,ve,Ge){var bt=ue==null?0:ue.length;for(Ge&&bt&&(ve=ue[--bt]);bt--;)ve=Ce(ve,ue[bt],bt,ue);return ve}function bf(ue,Ce){for(var ve=-1,Ge=ue==null?0:ue.length;++ve<Ge;)if(Ce(ue[ve],ve,ue))return!0;return!1}var Av=Sf("length");function fm(ue){return ue.split("")}function Fv(ue){return ue.match(Yo)||[]}function hm(ue,Ce,ve){var Ge;return ve(ue,function(bt,Lt,En){if(Ce(bt,Lt,En))return Ge=Lt,!1}),Ge}function tc(ue,Ce,ve,Ge){for(var bt=ue.length,Lt=ve+(Ge?1:-1);Ge?Lt--:++Lt<bt;)if(Ce(ue[Lt],Lt,ue))return Lt;return-1}function As(ue,Ce,ve){return Ce===Ce?ac(ue,Ce,ve):tc(ue,pm,ve)}function Df(ue,Ce,ve,Ge){for(var bt=ve-1,Lt=ue.length;++bt<Lt;)if(Ge(ue[bt],Ce))return bt;return-1}function pm(ue){return ue!==ue}function mm(ue,Ce){var ve=ue==null?0:ue.length;return ve?If(ue,Ce)/ve:Z}function Sf(ue){return function(Ce){return Ce==null?n:Ce[ue]}}function nc(ue){return function(Ce){return ue==null?n:ue[Ce]}}function gm(ue,Ce,ve,Ge,bt){return bt(ue,function(Lt,En,$t){ve=Ge?(Ge=!1,Lt):Ce(ve,Lt,En,$t)}),ve}function Ov(ue,Ce){var ve=ue.length;for(ue.sort(Ce);ve--;)ue[ve]=ue[ve].value;return ue}function If(ue,Ce){for(var ve,Ge=-1,bt=ue.length;++Ge<bt;){var Lt=Ce(ue[Ge]);Lt!==n&&(ve=ve===n?Lt:ve+Lt)}return ve}function Tf(ue,Ce){for(var ve=-1,Ge=Array(ue);++ve<ue;)Ge[ve]=Ce(ve);return Ge}function Pv(ue,Ce){return Jt(Ce,function(ve){return[ve,ue[ve]]})}function ym(ue){return ue&&ue.slice(0,oc(ue)+1).replace(kl,"")}function Yr(ue){return function(Ce){return ue(Ce)}}function Bl(ue,Ce){return Jt(Ce,function(ve){return ue[ve]})}function mo(ue,Ce){return ue.has(Ce)}function vm(ue,Ce){for(var ve=-1,Ge=ue.length;++ve<Ge&&As(Ce,ue[ve],0)>-1;);return ve}function Ef(ue,Ce){for(var ve=ue.length;ve--&&As(Ce,ue[ve],0)>-1;);return ve}function wm(ue,Ce){for(var ve=ue.length,Ge=0;ve--;)ue[ve]===Ce&&++Ge;return Ge}var bm=nc(Ms),Dm=nc(qu);function Sm(ue){return"\\"+Nv[ue]}function Fs(ue,Ce){return ue==null?n:ue[Ce]}function Os(ue){return lm.test(ue)}function jv(ue){return Gu.test(ue)}function Lv(ue){for(var Ce,ve=[];!(Ce=ue.next()).done;)ve.push(Ce.value);return ve}function rc(ue){var Ce=-1,ve=Array(ue.size);return ue.forEach(function(Ge,bt){ve[++Ce]=[bt,Ge]}),ve}function Cf(ue,Ce){return function(ve){return ue(Ce(ve))}}function aa(ue,Ce){for(var ve=-1,Ge=ue.length,bt=0,Lt=[];++ve<Ge;){var En=ue[ve];(En===Ce||En===m)&&(ue[ve]=m,Lt[bt++]=ve)}return Lt}function qo(ue){var Ce=-1,ve=Array(ue.size);return ue.forEach(function(Ge){ve[++Ce]=Ge}),ve}function Rv(ue){var Ce=-1,ve=Array(ue.size);return ue.forEach(function(Ge){ve[++Ce]=[Ge,Ge]}),ve}function ac(ue,Ce,ve){for(var Ge=ve-1,bt=ue.length;++Ge<bt;)if(ue[Ge]===Ce)return Ge;return-1}function Bv(ue,Ce,ve){for(var Ge=ve+1;Ge--;)if(ue[Ge]===Ce)return Ge;return Ge}function zi(ue){return Os(ue)?Tm(ue):Av(ue)}function zr(ue){return Os(ue)?Em(ue):fm(ue)}function oc(ue){for(var Ce=ue.length;Ce--&&Qt.test(ue.charAt(Ce)););return Ce}var Im=nc(Mv);function Tm(ue){for(var Ce=Hi.lastIndex=0;Hi.test(ue);)++Ce;return Ce}function Em(ue){return ue.match(Hi)||[]}function _v(ue){return ue.match(Cv)||[]}var Hv=function ue(Ce){Ce=Ce==null?sn:Ps.defaults(sn.Object(),Ce,Ps.pick(sn,um));var ve=Ce.Array,Ge=Ce.Date,bt=Ce.Error,Lt=Ce.Function,En=Ce.Math,$t=Ce.Object,_l=Ce.RegExp,Yv=Ce.String,oa=Ce.TypeError,go=ve.prototype,xf=Lt.prototype,Wa=$t.prototype,js=Ce["__core-js_shared__"],Hl=xf.toString,Rt=Wa.hasOwnProperty,Ls=0,ic=function(){var u=/[^.]+$/.exec(js&&js.keys&&js.keys.IE_PROTO||"");return u?"Symbol(src)_1."+u:""}(),Yl=Wa.toString,sc=Hl.call($t),Cm=sn._,xm=_l("^"+Hl.call(Rt).replace(wr,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),zl=pf?Ce.Buffer:n,yo=Ce.Symbol,Ul=Ce.Uint8Array,Mf=zl?zl.allocUnsafe:n,Ma=Cf($t.getPrototypeOf,$t),lc=$t.create,uc=Wa.propertyIsEnumerable,cc=go.splice,Mm=yo?yo.isConcatSpreadable:n,vo=yo?yo.iterator:n,Ui=yo?yo.toStringTag:n,Vl=function(){try{var u=To($t,"defineProperty");return u({},"",{}),u}catch{}}(),Nm=Ce.clearTimeout!==sn.clearTimeout&&Ce.clearTimeout,Xt=Ge&&Ge.now!==sn.Date.now&&Ge.now,Nf=Ce.setTimeout!==sn.setTimeout&&Ce.setTimeout,Vi=En.ceil,Jo=En.floor,dc=$t.getOwnPropertySymbols,kf=zl?zl.isBuffer:n,Rs=Ce.isFinite,fc=go.join,Bs=Cf($t.keys,$t),Cn=En.max,rr=En.min,zv=Ge.now,km=Ce.parseInt,Zl=En.random,hc=go.reverse,Wl=To(Ce,"DataView"),Zi=To(Ce,"Map"),$l=To(Ce,"Promise"),Ko=To(Ce,"Set"),Gl=To(Ce,"WeakMap"),_s=To($t,"create"),pc=Gl&&new Gl,Hs={},Af=di(Wl),Qo=di(Zi),Am=di($l),Ys=di(Ko),$a=di(Gl),Xo=yo?yo.prototype:n,Ur=Xo?Xo.valueOf:n,mc=Xo?Xo.toString:n;function _(u){if(Mn(u)&&!Tt(u)&&!(u instanceof St)){if(u instanceof ar)return u;if(Rt.call(u,"__wrapped__"))return ch(u)}return new ar(u)}var zs=function(){function u(){}return function(f){if(!Sn(f))return{};if(lc)return lc(f);u.prototype=f;var b=new u;return u.prototype=n,b}}();function Ga(){}function ar(u,f){this.__wrapped__=u,this.__actions__=[],this.__chain__=!!f,this.__index__=0,this.__values__=n}_.templateSettings={escape:gt,evaluate:Vt,interpolate:On,variable:"",imports:{_}},_.prototype=Ga.prototype,_.prototype.constructor=_,ar.prototype=zs(Ga.prototype),ar.prototype.constructor=ar;function St(u){this.__wrapped__=u,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=G,this.__views__=[]}function gc(){var u=new St(this.__wrapped__);return u.__actions__=Tr(this.__actions__),u.__dir__=this.__dir__,u.__filtered__=this.__filtered__,u.__iteratees__=Tr(this.__iteratees__),u.__takeCount__=this.__takeCount__,u.__views__=Tr(this.__views__),u}function Ff(){if(this.__filtered__){var u=new St(this);u.__dir__=-1,u.__filtered__=!0}else u=this.clone(),u.__dir__*=-1;return u}function Us(){var u=this.__wrapped__.value(),f=this.__dir__,b=Tt(u),M=f<0,P=b?u.length:0,V=tg(0,P,this.__views__),K=V.start,ne=V.end,ce=ne-K,Me=M?ne:K-1,Ne=this.__iteratees__,Pe=Ne.length,We=0,it=rr(ce,this.__takeCount__);if(!b||!M&&P==ce&&it==ce)return Vf(u,this.__actions__);var yt=[];e:for(;ce--&&We<it;){Me+=f;for(var Mt=-1,vt=u[Me];++Mt<Pe;){var Nt=Ne[Mt],jt=Nt.iteratee,Ba=Nt.type,Jr=jt(vt);if(Ba==ie)vt=Jr;else if(!Jr){if(Ba==pe)continue e;break e}}yt[We++]=vt}return yt}St.prototype=zs(Ga.prototype),St.prototype.constructor=St;function Ar(u){var f=-1,b=u==null?0:u.length;for(this.clear();++f<b;){var M=u[f];this.set(M[0],M[1])}}function en(){this.__data__=_s?_s(null):{},this.size=0}function Kt(u){var f=this.has(u)&&delete this.__data__[u];return this.size-=f?1:0,f}function ei(u){var f=this.__data__;if(_s){var b=f[u];return b===d?n:b}return Rt.call(f,u)?f[u]:n}function or(u){var f=this.__data__;return _s?f[u]!==n:Rt.call(f,u)}function Fr(u,f){var b=this.__data__;return this.size+=this.has(u)?0:1,b[u]=_s&&f===n?d:f,this}Ar.prototype.clear=en,Ar.prototype.delete=Kt,Ar.prototype.get=ei,Ar.prototype.has=or,Ar.prototype.set=Fr;function Sr(u){var f=-1,b=u==null?0:u.length;for(this.clear();++f<b;){var M=u[f];this.set(M[0],M[1])}}function Vs(){this.__data__=[],this.size=0}function Or(u){var f=this.__data__,b=sr(f,u);if(b<0)return!1;var M=f.length-1;return b==M?f.pop():cc.call(f,b,1),--this.size,!0}function yc(u){var f=this.__data__,b=sr(f,u);return b<0?n:f[b][1]}function Fm(u){return sr(this.__data__,u)>-1}function Om(u,f){var b=this.__data__,M=sr(b,u);return M<0?(++this.size,b.push([u,f])):b[M][1]=f,this}Sr.prototype.clear=Vs,Sr.prototype.delete=Or,Sr.prototype.get=yc,Sr.prototype.has=Fm,Sr.prototype.set=Om;function ia(u){var f=-1,b=u==null?0:u.length;for(this.clear();++f<b;){var M=u[f];this.set(M[0],M[1])}}function Pm(){this.size=0,this.__data__={hash:new Ar,map:new(Zi||Sr),string:new Ar}}function wo(u){var f=Vc(this,u).delete(u);return this.size-=f?1:0,f}function vc(u){return Vc(this,u).get(u)}function Of(u){return Vc(this,u).has(u)}function jm(u,f){var b=Vc(this,u),M=b.size;return b.set(u,f),this.size+=b.size==M?0:1,this}ia.prototype.clear=Pm,ia.prototype.delete=wo,ia.prototype.get=vc,ia.prototype.has=Of,ia.prototype.set=jm;function Wi(u){var f=-1,b=u==null?0:u.length;for(this.__data__=new ia;++f<b;)this.add(u[f])}function ti(u){return this.__data__.set(u,d),this}function Zs(u){return this.__data__.has(u)}Wi.prototype.add=Wi.prototype.push=ti,Wi.prototype.has=Zs;function ir(u){var f=this.__data__=new Sr(u);this.size=f.size}function wc(){this.__data__=new Sr,this.size=0}function bc(u){var f=this.__data__,b=f.delete(u);return this.size=f.size,b}function sa(u){return this.__data__.get(u)}function la(u){return this.__data__.has(u)}function $i(u,f){var b=this.__data__;if(b instanceof Sr){var M=b.__data__;if(!Zi||M.length<a-1)return M.push([u,f]),this.size=++b.size,this;b=this.__data__=new ia(M)}return b.set(u,f),this.size=b.size,this}ir.prototype.clear=wc,ir.prototype.delete=bc,ir.prototype.get=sa,ir.prototype.has=la,ir.prototype.set=$i;function qa(u,f){var b=Tt(u),M=!b&&wu(u),P=!b&&!M&&ll(u),V=!b&&!M&&!P&&hd(u),K=b||M||P||V,ne=K?Tf(u.length,Yv):[],ce=ne.length;for(var Me in u)(f||Rt.call(u,Me))&&!(K&&(Me=="length"||P&&(Me=="offset"||Me=="parent")||V&&(Me=="buffer"||Me=="byteLength"||Me=="byteOffset")||ca(Me,ce)))&&ne.push(Me);return ne}function Ja(u){var f=u.length;return f?u[nu(0,f-1)]:n}function Gi(u,f){return $r(Tr(u),bo(f,0,u.length))}function Lm(u){return $r(Tr(u))}function ql(u,f,b){(b!==n&&!xo(u[f],b)||b===n&&!(f in u))&&Ka(u,f,b)}function qi(u,f,b){var M=u[f];(!(Rt.call(u,f)&&xo(M,b))||b===n&&!(f in u))&&Ka(u,f,b)}function sr(u,f){for(var b=u.length;b--;)if(xo(u[b][0],f))return b;return-1}function Vr(u,f,b,M){return Xa(u,function(P,V,K){f(M,P,b(P),K)}),M}function tn(u,f){return u&&Pa(f,pr(f),u)}function Na(u,f){return u&&Pa(f,pa(f),u)}function Ka(u,f,b){f=="__proto__"&&Vl?Vl(u,f,{configurable:!0,enumerable:!0,value:b,writable:!0}):u[f]=b}function Dc(u,f){for(var b=-1,M=f.length,P=ve(M),V=u==null;++b<M;)P[b]=V?n:d0(u,f[b]);return P}function bo(u,f,b){return u===u&&(b!==n&&(u=u<=b?u:b),f!==n&&(u=u>=f?u:f)),u}function Pr(u,f,b,M,P,V){var K,ne=f&g,ce=f&v,Me=f&D;if(b&&(K=P?b(u,M,P,V):b(u)),K!==n)return K;if(!Sn(u))return u;var Ne=Tt(u);if(Ne){if(K=ng(u),!ne)return Tr(u,K)}else{var Pe=dr(u),We=Pe==Ze||Pe==Ke;if(ll(u))return Wf(u,ne);if(Pe==Dt||Pe==De||We&&!P){if(K=ce||We?{}:nl(u),!ne)return ce?Vv(u,Na(K,u)):Wm(u,tn(K,u))}else{if(!zt[Pe])return P?u:{};K=fr(u,Pe,ne)}}V||(V=new ir);var it=V.get(u);if(it)return it;V.set(u,K),Eb(u)?u.forEach(function(vt){K.add(Pr(vt,f,b,vt,u,V))}):Ib(u)&&u.forEach(function(vt,Nt){K.set(Nt,Pr(vt,f,b,Nt,u,V))});var yt=Me?ce?uu:Uc:ce?pa:pr,Mt=Ne?n:yt(u);return nr(Mt||u,function(vt,Nt){Mt&&(Nt=vt,vt=u[Nt]),qi(K,Nt,Pr(vt,f,b,Nt,u,V))}),K}function Rm(u){var f=pr(u);return function(b){return Jl(b,u,f)}}function Jl(u,f,b){var M=b.length;if(u==null)return!M;for(u=$t(u);M--;){var P=b[M],V=f[P],K=u[P];if(K===n&&!(P in u)||!V(K))return!1}return!0}function Pf(u,f,b){if(typeof u!="function")throw new oa(s);return al(function(){u.apply(n,b)},f)}function Qa(u,f,b,M){var P=-1,V=ec,K=!0,ne=u.length,ce=[],Me=f.length;if(!ne)return ce;b&&(f=Jt(f,Yr(b))),M?(V=vf,K=!1):f.length>=a&&(V=mo,K=!1,f=new Wi(f));e:for(;++P<ne;){var Ne=u[P],Pe=b==null?Ne:b(Ne);if(Ne=M||Ne!==0?Ne:0,K&&Pe===Pe){for(var We=Me;We--;)if(f[We]===Pe)continue e;ce.push(Ne)}else V(f,Pe,M)||ce.push(Ne)}return ce}var Xa=$m(ua),Bm=$m(ni,!0);function ka(u,f){var b=!0;return Xa(u,function(M,P,V){return b=!!f(M,P,V),b}),b}function Ji(u,f,b){for(var M=-1,P=u.length;++M<P;){var V=u[M],K=f(V);if(K!=null&&(ne===n?K===K&&!Ra(K):b(K,ne)))var ne=K,ce=V}return ce}function Sc(u,f,b,M){var P=u.length;for(b=xt(b),b<0&&(b=-b>P?0:P+b),M=M===n||M>P?P:xt(M),M<0&&(M+=P),M=b>M?0:xb(M);b<M;)u[b++]=f;return u}function Ki(u,f){var b=[];return Xa(u,function(M,P,V){f(M,P,V)&&b.push(M)}),b}function jn(u,f,b,M,P){var V=-1,K=u.length;for(b||(b=$v),P||(P=[]);++V<K;){var ne=u[V];f>0&&b(ne)?f>1?jn(ne,f-1,b,M,P):Go(P,ne):M||(P[P.length]=ne)}return P}var Kl=Kf(),Ic=Kf(!0);function ua(u,f){return u&&Kl(u,f,pr)}function ni(u,f){return u&&Ic(u,f,pr)}function Ir(u,f){return $o(f,function(b){return os(u[b])})}function Zr(u,f){f=Do(f,u);for(var b=0,M=f.length;u!=null&&b<M;)u=u[ja(f[b++])];return b&&b==M?u:n}function Tc(u,f,b){var M=f(u);return Tt(u)?M:Go(M,b(u))}function lr(u){return u==null?u===n?Tn:ft:Ui&&Ui in $t(u)?eg(u):ig(u)}function Aa(u,f){return u>f}function ri(u,f){return u!=null&&Rt.call(u,f)}function jf(u,f){return u!=null&&f in $t(u)}function _m(u,f,b){return u>=rr(f,b)&&u<Cn(f,b)}function Fa(u,f,b){for(var M=b?vf:ec,P=u[0].length,V=u.length,K=V,ne=ve(V),ce=1/0,Me=[];K--;){var Ne=u[K];K&&f&&(Ne=Jt(Ne,Yr(f))),ce=rr(Ne.length,ce),ne[K]=!b&&(f||P>=120&&Ne.length>=120)?new Wi(K&&Ne):n}Ne=u[0];var Pe=-1,We=ne[0];e:for(;++Pe<P&&Me.length<ce;){var it=Ne[Pe],yt=f?f(it):it;if(it=b||it!==0?it:0,!(We?mo(We,yt):M(Me,yt,b))){for(K=V;--K;){var Mt=ne[K];if(!(Mt?mo(Mt,yt):M(u[K],yt,b)))continue e}We&&We.push(yt),Me.push(it)}}return Me}function ai(u,f,b,M){return ua(u,function(P,V,K){f(M,b(P),V,K)}),M}function oi(u,f,b){f=Do(f,u),u=$c(u,f);var M=u==null?u:u[ja(Hn(f))];return M==null?n:Dr(M,u,b)}function Lf(u){return Mn(u)&&lr(u)==De}function Ec(u){return Mn(u)&&lr(u)==tr}function Hm(u){return Mn(u)&&lr(u)==rt}function Ws(u,f,b,M,P){return u===f?!0:u==null||f==null||!Mn(u)&&!Mn(f)?u!==u&&f!==f:Rf(u,f,b,M,Ws,P)}function Rf(u,f,b,M,P,V){var K=Tt(u),ne=Tt(f),ce=K?ke:dr(u),Me=ne?ke:dr(f);ce=ce==De?Dt:ce,Me=Me==De?Dt:Me;var Ne=ce==Dt,Pe=Me==Dt,We=ce==Me;if(We&&ll(u)){if(!ll(f))return!1;K=!0,Ne=!1}if(We&&!Ne)return V||(V=new ir),K||hd(u)?zc(u,f,b,M,P,V):Xm(u,f,ce,b,M,P,V);if(!(b&S)){var it=Ne&&Rt.call(u,"__wrapped__"),yt=Pe&&Rt.call(f,"__wrapped__");if(it||yt){var Mt=it?u.value():u,vt=yt?f.value():f;return V||(V=new ir),P(Mt,vt,b,M,V)}}return We?(V||(V=new ir),rh(u,f,b,M,P,V)):!1}function Cc(u){return Mn(u)&&dr(u)==Je}function xc(u,f,b,M){var P=b.length,V=P,K=!M;if(u==null)return!V;for(u=$t(u);P--;){var ne=b[P];if(K&&ne[2]?ne[1]!==u[ne[0]]:!(ne[0]in u))return!1}for(;++P<V;){ne=b[P];var ce=ne[0],Me=u[ce],Ne=ne[1];if(K&&ne[2]){if(Me===n&&!(ce in u))return!1}else{var Pe=new ir;if(M)var We=M(Me,Ne,ce,u,f,Pe);if(!(We===n?Ws(Ne,Me,S|T,M,Pe):We))return!1}}return!0}function Bf(u){if(!Sn(u)||sh(u))return!1;var f=os(u)?xm:qp;return f.test(di(u))}function Ym(u){return Mn(u)&&lr(u)==Ft}function _f(u){return Mn(u)&&dr(u)==Ot}function Ql(u){return Mn(u)&&Sg(u.length)&&!!Zt[lr(u)]}function Xl(u){return typeof u=="function"?u:u==null?ma:typeof u=="object"?Tt(u)?Oa(u[0],u[1]):$s(u):Bb(u)}function Mc(u){if(!fu(u))return Bs(u);var f=[];for(var b in $t(u))Rt.call(u,b)&&b!="constructor"&&f.push(b);return f}function zm(u){if(!Sn(u))return og(u);var f=fu(u),b=[];for(var M in u)M=="constructor"&&(f||!Rt.call(u,M))||b.push(M);return b}function ii(u,f){return u<f}function Hf(u,f){var b=-1,M=ha(u)?ve(u.length):[];return Xa(u,function(P,V,K){M[++b]=f(P,V,K)}),M}function $s(u){var f=Zc(u);return f.length==1&&f[0][2]?hu(f[0][0],f[0][1]):function(b){return b===u||xc(b,u,f)}}function Oa(u,f){return ih(u)&&rl(f)?hu(ja(u),f):function(b){var M=d0(b,u);return M===n&&M===f?f0(b,u):Ws(f,M,S|T)}}function si(u,f,b,M,P){u!==f&&Kl(f,function(V,K){if(P||(P=new ir),Sn(V))eu(u,f,K,b,si,M,P);else{var ne=M?M(Wr(u,K),V,K+"",u,f,P):n;ne===n&&(ne=V),ql(u,K,ne)}},pa)}function eu(u,f,b,M,P,V,K){var ne=Wr(u,b),ce=Wr(f,b),Me=K.get(ce);if(Me){ql(u,b,Me);return}var Ne=V?V(ne,ce,b+"",u,f,K):n,Pe=Ne===n;if(Pe){var We=Tt(ce),it=!We&&ll(ce),yt=!We&&!it&&hd(ce);Ne=ce,We||it||yt?Tt(ne)?Ne=ne:Yn(ne)?Ne=Tr(ne):it?(Pe=!1,Ne=Wf(ce,!0)):yt?(Pe=!1,Ne=Gf(ce,!0)):Ne=[]:Mh(ce)||wu(ce)?(Ne=ne,wu(ne)?Ne=Mb(ne):(!Sn(ne)||os(ne))&&(Ne=nl(ce))):Pe=!1}Pe&&(K.set(ce,Ne),P(Ne,ce,M,V,K),K.delete(ce)),ql(u,b,Ne)}function li(u,f){var b=u.length;if(b)return f+=f<0?b:0,ca(f,b)?u[f]:n}function Nc(u,f,b){f.length?f=Jt(f,function(V){return Tt(V)?function(K){return Zr(K,V.length===1?V[0]:V)}:V}):f=[ma];var M=-1;f=Jt(f,Yr(ut()));var P=Hf(u,function(V,K,ne){var ce=Jt(f,function(Me){return Me(V)});return{criteria:ce,index:++M,value:V}});return Ov(P,function(V,K){return Zm(V,K,b)})}function Gs(u,f){return Yf(u,f,function(b,M){return f0(u,M)})}function Yf(u,f,b){for(var M=-1,P=f.length,V={};++M<P;){var K=f[M],ne=Zr(u,K);b(ne,K)&&dn(V,Do(K,u),ne)}return V}function zf(u){return function(f){return Zr(f,u)}}function nn(u,f,b,M){var P=M?Df:As,V=-1,K=f.length,ne=u;for(u===f&&(f=Tr(f)),b&&(ne=Jt(u,Yr(b)));++V<K;)for(var ce=0,Me=f[V],Ne=b?b(Me):Me;(ce=P(ne,Ne,ce,M))>-1;)ne!==u&&cc.call(ne,ce,1),cc.call(u,ce,1);return u}function tu(u,f){for(var b=u?f.length:0,M=b-1;b--;){var P=f[b];if(b==M||P!==V){var V=P;ca(P)?cc.call(u,P,1):Xi(u,P)}}return u}function nu(u,f){return u+Jo(Zl()*(f-u+1))}function Uf(u,f,b,M){for(var P=-1,V=Cn(Vi((f-u)/(b||1)),0),K=ve(V);V--;)K[M?V:++P]=u,u+=b;return K}function qs(u,f){var b="";if(!u||f<1||f>oe)return b;do f%2&&(b+=u),f=Jo(f/2),f&&(u+=u);while(f);return b}function It(u,f){return Gc(Wc(u,f,ma),u+"")}function Qi(u){return Ja(pd(u))}function cn(u,f){var b=pd(u);return $r(b,bo(f,0,b.length))}function dn(u,f,b,M){if(!Sn(u))return u;f=Do(f,u);for(var P=-1,V=f.length,K=V-1,ne=u;ne!=null&&++P<V;){var ce=ja(f[P]),Me=b;if(ce==="__proto__"||ce==="constructor"||ce==="prototype")return u;if(P!=K){var Ne=ne[ce];Me=M?M(Ne,ce,ne):n,Me===n&&(Me=Sn(Ne)?Ne:ca(f[P+1])?[]:{})}qi(ne,ce,Me),ne=ne[ce]}return u}var Ln=pc?function(u,f){return pc.set(u,f),u}:ma,kc=Vl?function(u,f){return Vl(u,"toString",{configurable:!0,enumerable:!1,value:p0(f),writable:!0})}:ma;function ru(u){return $r(pd(u))}function ur(u,f,b){var M=-1,P=u.length;f<0&&(f=-f>P?0:P+f),b=b>P?P:b,b<0&&(b+=P),P=f>b?0:b-f>>>0,f>>>=0;for(var V=ve(P);++M<P;)V[M]=u[M+f];return V}function Uv(u,f){var b;return Xa(u,function(M,P,V){return b=f(M,P,V),!b}),!!b}function Rn(u,f,b){var M=0,P=u==null?M:u.length;if(typeof f=="number"&&f===f&&P<=ge){for(;M<P;){var V=M+P>>>1,K=u[V];K!==null&&!Ra(K)&&(b?K<=f:K<f)?M=V+1:P=V}return P}return au(u,f,ma,b)}function au(u,f,b,M){var P=0,V=u==null?0:u.length;if(V===0)return 0;f=b(f);for(var K=f!==f,ne=f===null,ce=Ra(f),Me=f===n;P<V;){var Ne=Jo((P+V)/2),Pe=b(u[Ne]),We=Pe!==n,it=Pe===null,yt=Pe===Pe,Mt=Ra(Pe);if(K)var vt=M||yt;else Me?vt=yt&&(M||We):ne?vt=yt&&We&&(M||!it):ce?vt=yt&&We&&!it&&(M||!Mt):it||Mt?vt=!1:vt=M?Pe<=f:Pe<f;vt?P=Ne+1:V=Ne}return rr(V,te)}function Ac(u,f){for(var b=-1,M=u.length,P=0,V=[];++b<M;){var K=u[b],ne=f?f(K):K;if(!b||!xo(ne,ce)){var ce=ne;V[P++]=K===0?0:K}}return V}function Fc(u){return typeof u=="number"?u:Ra(u)?Z:+u}function pn(u){if(typeof u=="string")return u;if(Tt(u))return Jt(u,pn)+"";if(Ra(u))return mc?mc.call(u):"";var f=u+"";return f=="0"&&1/u==-fe?"-0":f}function Bn(u,f,b){var M=-1,P=ec,V=u.length,K=!0,ne=[],ce=ne;if(b)K=!1,P=vf;else if(V>=a){var Me=f?null:Er(u);if(Me)return qo(Me);K=!1,P=mo,ce=new Wi}else ce=f?[]:ne;e:for(;++M<V;){var Ne=u[M],Pe=f?f(Ne):Ne;if(Ne=b||Ne!==0?Ne:0,K&&Pe===Pe){for(var We=ce.length;We--;)if(ce[We]===Pe)continue e;f&&ce.push(Pe),ne.push(Ne)}else P(ce,Pe,b)||(ce!==ne&&ce.push(Pe),ne.push(Ne))}return ne}function Xi(u,f){return f=Do(f,u),u=$c(u,f),u==null||delete u[ja(Hn(f))]}function Oc(u,f,b,M){return dn(u,f,b(Zr(u,f)),M)}function Js(u,f,b,M){for(var P=u.length,V=M?P:-1;(M?V--:++V<P)&&f(u[V],V,u););return b?ur(u,M?0:V,M?V+1:P):ur(u,M?V+1:0,M?P:V)}function Vf(u,f){var b=u;return b instanceof St&&(b=b.value()),wf(f,function(M,P){return P.func.apply(P.thisArg,Go([M],P.args))},b)}function Pc(u,f,b){var M=u.length;if(M<2)return M?Bn(u[0]):[];for(var P=-1,V=ve(M);++P<M;)for(var K=u[P],ne=-1;++ne<M;)ne!=P&&(V[P]=Qa(V[P]||K,u[ne],f,b));return Bn(jn(V,1),f,b)}function Zf(u,f,b){for(var M=-1,P=u.length,V=f.length,K={};++M<P;){var ne=M<V?f[M]:n;b(K,u[M],ne)}return K}function jc(u){return Yn(u)?u:[]}function Lc(u){return typeof u=="function"?u:ma}function Do(u,f){return Tt(u)?u:ih(u,f)?[u]:sg(Gt(u))}var Um=It;function So(u,f,b){var M=u.length;return b=b===n?M:b,!f&&b>=M?u:ur(u,f,b)}var Ks=Nm||function(u){return sn.clearTimeout(u)};function Wf(u,f){if(f)return u.slice();var b=u.length,M=Mf?Mf(b):new u.constructor(b);return u.copy(M),M}function Qs(u){var f=new u.constructor(u.byteLength);return new Ul(f).set(new Ul(u)),f}function Rc(u,f){var b=f?Qs(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.byteLength)}function Vm(u){var f=new u.constructor(u.source,of.exec(u));return f.lastIndex=u.lastIndex,f}function $f(u){return Ur?$t(Ur.call(u)):{}}function Gf(u,f){var b=f?Qs(u.buffer):u.buffer;return new u.constructor(b,u.byteOffset,u.length)}function qf(u,f){if(u!==f){var b=u!==n,M=u===null,P=u===u,V=Ra(u),K=f!==n,ne=f===null,ce=f===f,Me=Ra(f);if(!ne&&!Me&&!V&&u>f||V&&K&&ce&&!ne&&!Me||M&&K&&ce||!b&&ce||!P)return 1;if(!M&&!V&&!Me&&u<f||Me&&b&&P&&!M&&!V||ne&&b&&P||!K&&P||!ce)return-1}return 0}function Zm(u,f,b){for(var M=-1,P=u.criteria,V=f.criteria,K=P.length,ne=b.length;++M<K;){var ce=qf(P[M],V[M]);if(ce){if(M>=ne)return ce;var Me=b[M];return ce*(Me=="desc"?-1:1)}}return u.index-f.index}function Jf(u,f,b,M){for(var P=-1,V=u.length,K=b.length,ne=-1,ce=f.length,Me=Cn(V-K,0),Ne=ve(ce+Me),Pe=!M;++ne<ce;)Ne[ne]=f[ne];for(;++P<K;)(Pe||P<V)&&(Ne[b[P]]=u[P]);for(;Me--;)Ne[ne++]=u[P++];return Ne}function Bc(u,f,b,M){for(var P=-1,V=u.length,K=-1,ne=b.length,ce=-1,Me=f.length,Ne=Cn(V-ne,0),Pe=ve(Ne+Me),We=!M;++P<Ne;)Pe[P]=u[P];for(var it=P;++ce<Me;)Pe[it+ce]=f[ce];for(;++K<ne;)(We||P<V)&&(Pe[it+b[K]]=u[P++]);return Pe}function Tr(u,f){var b=-1,M=u.length;for(f||(f=ve(M));++b<M;)f[b]=u[b];return f}function Pa(u,f,b,M){var P=!b;b||(b={});for(var V=-1,K=f.length;++V<K;){var ne=f[V],ce=M?M(b[ne],u[ne],ne,b,u):n;ce===n&&(ce=u[ne]),P?Ka(b,ne,ce):qi(b,ne,ce)}return b}function Wm(u,f){return Pa(u,tl(u),f)}function Vv(u,f){return Pa(u,no(u),f)}function ou(u,f){return function(b,M){var P=Tt(b)?gf:Vr,V=f?f():{};return P(b,u,ut(M,2),V)}}function Xs(u){return It(function(f,b){var M=-1,P=b.length,V=P>1?b[P-1]:n,K=P>2?b[2]:n;for(V=u.length>3&&typeof V=="function"?(P--,V):n,K&&Ut(b[0],b[1],K)&&(V=P<3?n:V,P=1),f=$t(f);++M<P;){var ne=b[M];ne&&u(f,ne,M,V)}return f})}function $m(u,f){return function(b,M){if(b==null)return b;if(!ha(b))return u(b,M);for(var P=b.length,V=f?P:-1,K=$t(b);(f?V--:++V<P)&&M(K[V],V,K)!==!1;);return b}}function Kf(u){return function(f,b,M){for(var P=-1,V=$t(f),K=M(f),ne=K.length;ne--;){var ce=K[u?ne:++P];if(b(V[ce],ce,V)===!1)break}return f}}function Gm(u,f,b){var M=f&E,P=iu(u);function V(){var K=this&&this!==sn&&this instanceof V?P:u;return K.apply(M?b:this,arguments)}return V}function Qf(u){return function(f){f=Gt(f);var b=Os(f)?zr(f):n,M=b?b[0]:f.charAt(0),P=b?So(b,1).join(""):f.slice(1);return M[u]()+P}}function Io(u){return function(f){return wf(Lb(jb(f).replace(Ev,"")),u,"")}}function iu(u){return function(){var f=arguments;switch(f.length){case 0:return new u;case 1:return new u(f[0]);case 2:return new u(f[0],f[1]);case 3:return new u(f[0],f[1],f[2]);case 4:return new u(f[0],f[1],f[2],f[3]);case 5:return new u(f[0],f[1],f[2],f[3],f[4]);case 6:return new u(f[0],f[1],f[2],f[3],f[4],f[5]);case 7:return new u(f[0],f[1],f[2],f[3],f[4],f[5],f[6])}var b=zs(u.prototype),M=u.apply(b,f);return Sn(M)?M:b}}function Zv(u,f,b){var M=iu(u);function P(){for(var V=arguments.length,K=ve(V),ne=V,ce=ui(P);ne--;)K[ne]=arguments[ne];var Me=V<3&&K[0]!==ce&&K[V-1]!==ce?[]:aa(K,ce);if(V-=Me.length,V<b)return Km(u,f,el,P.placeholder,n,K,Me,n,n,b-V);var Ne=this&&this!==sn&&this instanceof P?M:u;return Dr(Ne,this,K)}return P}function qm(u){return function(f,b,M){var P=$t(f);if(!ha(f)){var V=ut(b,3);f=pr(f),b=function(ne){return V(P[ne],ne,P)}}var K=u(f,b,M);return K>-1?P[V?f[K]:K]:n}}function es(u){return to(function(f){var b=f.length,M=b,P=ar.prototype.thru;for(u&&f.reverse();M--;){var V=f[M];if(typeof V!="function")throw new oa(s);if(P&&!K&&du(V)=="wrapper")var K=new ar([],!0)}for(M=K?M:b;++M<b;){V=f[M];var ne=du(V),ce=ne=="wrapper"?cu(V):n;ce&&ci(ce[0])&&ce[1]==(z|j|B|H)&&!ce[4].length&&ce[9]==1?K=K[du(ce[0])].apply(K,ce[3]):K=V.length==1&&ci(V)?K[ne]():K.thru(V)}return function(){var Me=arguments,Ne=Me[0];if(K&&Me.length==1&&Tt(Ne))return K.plant(Ne).value();for(var Pe=0,We=b?f[Pe].apply(this,Me):Ne;++Pe<b;)We=f[Pe].call(this,We);return We}})}function el(u,f,b,M,P,V,K,ne,ce,Me){var Ne=f&z,Pe=f&E,We=f&O,it=f&(j|F),yt=f&Y,Mt=We?n:iu(u);function vt(){for(var Nt=arguments.length,jt=ve(Nt),Ba=Nt;Ba--;)jt[Ba]=arguments[Ba];if(it)var Jr=ui(vt),_a=wm(jt,Jr);if(M&&(jt=Jf(jt,M,P,it)),V&&(jt=Bc(jt,V,K,it)),Nt-=_a,it&&Nt<Me){var zn=aa(jt,Jr);return Km(u,f,el,vt.placeholder,b,jt,zn,ne,ce,Me-Nt)}var Mo=Pe?b:this,ss=We?Mo[u]:u;return Nt=jt.length,ne?jt=Gn(jt,ne):yt&&Nt>1&&jt.reverse(),Ne&&ce<Nt&&(jt.length=ce),this&&this!==sn&&this instanceof vt&&(ss=Mt||iu(ss)),ss.apply(Mo,jt)}return vt}function _c(u,f){return function(b,M){return ai(b,u,f(M),{})}}function Hc(u,f){return function(b,M){var P;if(b===n&&M===n)return f;if(b!==n&&(P=b),M!==n){if(P===n)return M;typeof b=="string"||typeof M=="string"?(b=pn(b),M=pn(M)):(b=Fc(b),M=Fc(M)),P=u(b,M)}return P}}function Yc(u){return to(function(f){return f=Jt(f,Yr(ut())),It(function(b){var M=this;return u(f,function(P){return Dr(P,M,b)})})})}function su(u,f){f=f===n?" ":pn(f);var b=f.length;if(b<2)return b?qs(f,u):f;var M=qs(f,Vi(u/zi(f)));return Os(f)?So(zr(M),0,u).join(""):M.slice(0,u)}function Jm(u,f,b,M){var P=f&E,V=iu(u);function K(){for(var ne=-1,ce=arguments.length,Me=-1,Ne=M.length,Pe=ve(Ne+ce),We=this&&this!==sn&&this instanceof K?V:u;++Me<Ne;)Pe[Me]=M[Me];for(;ce--;)Pe[Me++]=arguments[++ne];return Dr(We,P?b:this,Pe)}return K}function Xf(u){return function(f,b,M){return M&&typeof M!="number"&&Ut(f,b,M)&&(b=M=n),f=is(f),b===n?(b=f,f=0):b=is(b),M=M===n?f<b?1:-1:is(M),Uf(f,b,M,u)}}function lu(u){return function(f,b){return typeof f=="string"&&typeof b=="string"||(f=ro(f),b=ro(b)),u(f,b)}}function Km(u,f,b,M,P,V,K,ne,ce,Me){var Ne=f&j,Pe=Ne?K:n,We=Ne?n:K,it=Ne?V:n,yt=Ne?n:V;f|=Ne?B:R,f&=~(Ne?R:B),f&k||(f&=~(E|O));var Mt=[u,f,P,it,Pe,yt,We,ne,ce,Me],vt=b.apply(n,Mt);return ci(u)&&Eo(vt,Mt),vt.placeholder=M,da(vt,u,f)}function cr(u){var f=En[u];return function(b,M){if(b=ro(b),M=M==null?0:rr(xt(M),292),M&&Rs(b)){var P=(Gt(b)+"e").split("e"),V=f(P[0]+"e"+(+P[1]+M));return P=(Gt(V)+"e").split("e"),+(P[0]+"e"+(+P[1]-M))}return f(b)}}var Er=Ko&&1/qo(new Ko([,-0]))[1]==fe?function(u){return new Ko(u)}:y0;function eh(u){return function(f){var b=dr(f);return b==Je?rc(f):b==Ot?Rv(f):Pv(f,u(f))}}function eo(u,f,b,M,P,V,K,ne){var ce=f&O;if(!ce&&typeof u!="function")throw new oa(s);var Me=M?M.length:0;if(Me||(f&=~(B|R),M=P=n),K=K===n?K:Cn(xt(K),0),ne=ne===n?ne:xt(ne),Me-=P?P.length:0,f&R){var Ne=M,Pe=P;M=P=n}var We=ce?n:cu(u),it=[u,f,b,M,P,Ne,Pe,V,K,ne];if(We&&ag(it,We),u=it[0],f=it[1],b=it[2],M=it[3],P=it[4],ne=it[9]=it[9]===n?ce?0:u.length:Cn(it[9]-Me,0),!ne&&f&(j|F)&&(f&=~(j|F)),!f||f==E)var yt=Gm(u,f,b);else f==j||f==F?yt=Zv(u,f,ne):(f==B||f==(E|B))&&!P.length?yt=Jm(u,f,b,M):yt=el.apply(n,it);var Mt=We?Ln:Eo;return da(Mt(yt,it),u,f)}function th(u,f,b,M){return u===n||xo(u,Wa[b])&&!Rt.call(M,b)?f:u}function nh(u,f,b,M,P,V){return Sn(u)&&Sn(f)&&(V.set(f,u),si(u,f,n,nh,V),V.delete(f)),u}function Qm(u){return Mh(u)?n:u}function zc(u,f,b,M,P,V){var K=b&S,ne=u.length,ce=f.length;if(ne!=ce&&!(K&&ce>ne))return!1;var Me=V.get(u),Ne=V.get(f);if(Me&&Ne)return Me==f&&Ne==u;var Pe=-1,We=!0,it=b&T?new Wi:n;for(V.set(u,f),V.set(f,u);++Pe<ne;){var yt=u[Pe],Mt=f[Pe];if(M)var vt=K?M(Mt,yt,Pe,f,u,V):M(yt,Mt,Pe,u,f,V);if(vt!==n){if(vt)continue;We=!1;break}if(it){if(!bf(f,function(Nt,jt){if(!mo(it,jt)&&(yt===Nt||P(yt,Nt,b,M,V)))return it.push(jt)})){We=!1;break}}else if(!(yt===Mt||P(yt,Mt,b,M,V))){We=!1;break}}return V.delete(u),V.delete(f),We}function Xm(u,f,b,M,P,V,K){switch(b){case Nr:if(u.byteLength!=f.byteLength||u.byteOffset!=f.byteOffset)return!1;u=u.buffer,f=f.buffer;case tr:return!(u.byteLength!=f.byteLength||!V(new Ul(u),new Ul(f)));case Re:case rt:case lt:return xo(+u,+f);case Se:return u.name==f.name&&u.message==f.message;case Ft:case an:return u==f+"";case Je:var ne=rc;case Ot:var ce=M&S;if(ne||(ne=qo),u.size!=f.size&&!ce)return!1;var Me=K.get(u);if(Me)return Me==f;M|=T,K.set(u,f);var Ne=zc(ne(u),ne(f),M,P,V,K);return K.delete(u),Ne;case wn:if(Ur)return Ur.call(u)==Ur.call(f)}return!1}function rh(u,f,b,M,P,V){var K=b&S,ne=Uc(u),ce=ne.length,Me=Uc(f),Ne=Me.length;if(ce!=Ne&&!K)return!1;for(var Pe=ce;Pe--;){var We=ne[Pe];if(!(K?We in f:Rt.call(f,We)))return!1}var it=V.get(u),yt=V.get(f);if(it&&yt)return it==f&&yt==u;var Mt=!0;V.set(u,f),V.set(f,u);for(var vt=K;++Pe<ce;){We=ne[Pe];var Nt=u[We],jt=f[We];if(M)var Ba=K?M(jt,Nt,We,f,u,V):M(Nt,jt,We,u,f,V);if(!(Ba===n?Nt===jt||P(Nt,jt,b,M,V):Ba)){Mt=!1;break}vt||(vt=We=="constructor")}if(Mt&&!vt){var Jr=u.constructor,_a=f.constructor;Jr!=_a&&"constructor"in u&&"constructor"in f&&!(typeof Jr=="function"&&Jr instanceof Jr&&typeof _a=="function"&&_a instanceof _a)&&(Mt=!1)}return V.delete(u),V.delete(f),Mt}function to(u){return Gc(Wc(u,n,pu),u+"")}function Uc(u){return Tc(u,pr,tl)}function uu(u){return Tc(u,pa,no)}var cu=pc?function(u){return pc.get(u)}:y0;function du(u){for(var f=u.name+"",b=Hs[f],M=Rt.call(Hs,f)?b.length:0;M--;){var P=b[M],V=P.func;if(V==null||V==u)return P.name}return f}function ui(u){var f=Rt.call(_,"placeholder")?_:u;return f.placeholder}function ut(){var u=_.iteratee||m0;return u=u===m0?Xl:u,arguments.length?u(arguments[0],arguments[1]):u}function Vc(u,f){var b=u.__data__;return et(f)?b[typeof f=="string"?"string":"hash"]:b.map}function Zc(u){for(var f=pr(u),b=f.length;b--;){var M=f[b],P=u[M];f[b]=[M,P,rl(P)]}return f}function To(u,f){var b=Fs(u,f);return Bf(b)?b:n}function eg(u){var f=Rt.call(u,Ui),b=u[Ui];try{u[Ui]=n;var M=!0}catch{}var P=Yl.call(u);return M&&(f?u[Ui]=b:delete u[Ui]),P}var tl=dc?function(u){return u==null?[]:(u=$t(u),$o(dc(u),function(f){return uc.call(u,f)}))}:v0,no=dc?function(u){for(var f=[];u;)Go(f,tl(u)),u=Ma(u);return f}:v0,dr=lr;(Wl&&dr(new Wl(new ArrayBuffer(1)))!=Nr||Zi&&dr(new Zi)!=Je||$l&&dr($l.resolve())!=Ct||Ko&&dr(new Ko)!=Ot||Gl&&dr(new Gl)!=vr)&&(dr=function(u){var f=lr(u),b=f==Dt?u.constructor:n,M=b?di(b):"";if(M)switch(M){case Af:return Nr;case Qo:return Je;case Am:return Ct;case Ys:return Ot;case $a:return vr}return f});function tg(u,f,b){for(var M=-1,P=b.length;++M<P;){var V=b[M],K=V.size;switch(V.type){case"drop":u+=K;break;case"dropRight":f-=K;break;case"take":f=rr(f,u+K);break;case"takeRight":u=Cn(u,f-K);break}}return{start:u,end:f}}function ah(u){var f=u.match(Ea);return f?f[1].split(Ca):[]}function oh(u,f,b){f=Do(f,u);for(var M=-1,P=f.length,V=!1;++M<P;){var K=ja(f[M]);if(!(V=u!=null&&b(u,K)))break;u=u[K]}return V||++M!=P?V:(P=u==null?0:u.length,!!P&&Sg(P)&&ca(K,P)&&(Tt(u)||wu(u)))}function ng(u){var f=u.length,b=new u.constructor(f);return f&&typeof u[0]=="string"&&Rt.call(u,"index")&&(b.index=u.index,b.input=u.input),b}function nl(u){return typeof u.constructor=="function"&&!fu(u)?zs(Ma(u)):{}}function fr(u,f,b){var M=u.constructor;switch(f){case tr:return Qs(u);case Re:case rt:return new M(+u);case Nr:return Rc(u,b);case Is:case ho:case po:case Nl:case Pi:case ji:case Ts:case Ho:case Li:return Gf(u,b);case Je:return new M;case lt:case an:return new M(u);case Ft:return Vm(u);case Ot:return new M;case wn:return $f(u)}}function Wv(u,f){var b=f.length;if(!b)return u;var M=b-1;return f[M]=(b>1?"& ":"")+f[M],f=f.join(b>2?", ":" "),u.replace(Ta,`{
/* [wrapped with `+f+`] */
`)}function $v(u){return Tt(u)||wu(u)||!!(Mm&&u&&u[Mm])}function ca(u,f){var b=typeof u;return f=f??oe,!!f&&(b=="number"||b!="symbol"&&Kp.test(u))&&u>-1&&u%1==0&&u<f}function Ut(u,f,b){if(!Sn(b))return!1;var M=typeof f;return(M=="number"?ha(b)&&ca(f,b.length):M=="string"&&f in b)?xo(b[f],u):!1}function ih(u,f){if(Tt(u))return!1;var b=typeof u;return b=="number"||b=="symbol"||b=="boolean"||u==null||Ra(u)?!0:na.test(u)||!bn.test(u)||f!=null&&u in $t(f)}function et(u){var f=typeof u;return f=="string"||f=="number"||f=="symbol"||f=="boolean"?u!=="__proto__":u===null}function ci(u){var f=du(u),b=_[f];if(typeof b!="function"||!(f in St.prototype))return!1;if(u===b)return!0;var M=cu(b);return!!M&&u===M[0]}function sh(u){return!!ic&&ic in u}var rg=js?os:w0;function fu(u){var f=u&&u.constructor,b=typeof f=="function"&&f.prototype||Wa;return u===b}function rl(u){return u===u&&!Sn(u)}function hu(u,f){return function(b){return b==null?!1:b[u]===f&&(f!==n||u in $t(b))}}function lh(u){var f=ae(u,function(M){return b.size===p&&b.clear(),M}),b=f.cache;return f}function ag(u,f){var b=u[1],M=f[1],P=b|M,V=P<(E|O|z),K=M==z&&b==j||M==z&&b==H&&u[7].length<=f[8]||M==(z|H)&&f[7].length<=f[8]&&b==j;if(!(V||K))return u;M&E&&(u[2]=f[2],P|=b&E?0:k);var ne=f[3];if(ne){var ce=u[3];u[3]=ce?Jf(ce,ne,f[4]):ne,u[4]=ce?aa(u[3],m):f[4]}return ne=f[5],ne&&(ce=u[5],u[5]=ce?Bc(ce,ne,f[6]):ne,u[6]=ce?aa(u[5],m):f[6]),ne=f[7],ne&&(u[7]=ne),M&z&&(u[8]=u[8]==null?f[8]:rr(u[8],f[8])),u[9]==null&&(u[9]=f[9]),u[0]=f[0],u[1]=P,u}function og(u){var f=[];if(u!=null)for(var b in $t(u))f.push(b);return f}function ig(u){return Yl.call(u)}function Wc(u,f,b){return f=Cn(f===n?u.length-1:f,0),function(){for(var M=arguments,P=-1,V=Cn(M.length-f,0),K=ve(V);++P<V;)K[P]=M[f+P];P=-1;for(var ne=ve(f+1);++P<f;)ne[P]=M[P];return ne[f]=b(K),Dr(u,this,ne)}}function $c(u,f){return f.length<2?u:Zr(u,ur(f,0,-1))}function Gn(u,f){for(var b=u.length,M=rr(f.length,b),P=Tr(u);M--;){var V=f[M];u[M]=ca(V,b)?P[V]:n}return u}function Wr(u,f){if(!(f==="constructor"&&typeof u[f]=="function")&&f!="__proto__")return u[f]}var Eo=uh(Ln),al=Nf||function(u,f){return sn.setTimeout(u,f)},Gc=uh(kc);function da(u,f,b){var M=f+"";return Gc(u,Wv(M,lg(ah(M),b)))}function uh(u){var f=0,b=0;return function(){var M=zv(),P=le-(M-b);if(b=M,P>0){if(++f>=Q)return arguments[0]}else f=0;return u.apply(n,arguments)}}function $r(u,f){var b=-1,M=u.length,P=M-1;for(f=f===n?M:f;++b<f;){var V=nu(b,P),K=u[V];u[V]=u[b],u[b]=K}return u.length=f,u}var sg=lh(function(u){var f=[];return u.charCodeAt(0)===46&&f.push(""),u.replace(Pn,function(b,M,P,V){f.push(P?V.replace(wv,"$1"):M||b)}),f});function ja(u){if(typeof u=="string"||Ra(u))return u;var f=u+"";return f=="0"&&1/u==-fe?"-0":f}function di(u){if(u!=null){try{return Hl.call(u)}catch{}try{return u+""}catch{}}return""}function lg(u,f){return nr(Ie,function(b){var M="_."+b[0];f&b[1]&&!ec(u,M)&&u.push(M)}),u.sort()}function ch(u){if(u instanceof St)return u.clone();var f=new ar(u.__wrapped__,u.__chain__);return f.__actions__=Tr(u.__actions__),f.__index__=u.__index__,f.__values__=u.__values__,f}function Gv(u,f,b){(b?Ut(u,f,b):f===n)?f=1:f=Cn(xt(f),0);var M=u==null?0:u.length;if(!M||f<1)return[];for(var P=0,V=0,K=ve(Vi(M/f));P<M;)K[V++]=ur(u,P,P+=f);return K}function qc(u){for(var f=-1,b=u==null?0:u.length,M=0,P=[];++f<b;){var V=u[f];V&&(P[M++]=V)}return P}function dh(){var u=arguments.length;if(!u)return[];for(var f=ve(u-1),b=arguments[0],M=u;M--;)f[M-1]=arguments[M];return Go(Tt(b)?Tr(b):[b],jn(f,1))}var fa=It(function(u,f){return Yn(u)?Qa(u,jn(f,1,Yn,!0)):[]}),Pt=It(function(u,f){var b=Hn(f);return Yn(b)&&(b=n),Yn(u)?Qa(u,jn(f,1,Yn,!0),ut(b,2)):[]}),Un=It(function(u,f){var b=Hn(f);return Yn(b)&&(b=n),Yn(u)?Qa(u,jn(f,1,Yn,!0),n,b):[]});function xn(u,f,b){var M=u==null?0:u.length;return M?(f=b||f===n?1:xt(f),ur(u,f<0?0:f,M)):[]}function qn(u,f,b){var M=u==null?0:u.length;return M?(f=b||f===n?1:xt(f),f=M-f,ur(u,0,f<0?0:f)):[]}function Gr(u,f){return u&&u.length?Js(u,ut(f,3),!0,!0):[]}function ol(u,f){return u&&u.length?Js(u,ut(f,3),!0):[]}function _n(u,f,b,M){var P=u==null?0:u.length;return P?(b&&typeof b!="number"&&Ut(u,f,b)&&(b=0,M=P),Sc(u,f,b,M)):[]}function il(u,f,b){var M=u==null?0:u.length;if(!M)return-1;var P=b==null?0:xt(b);return P<0&&(P=Cn(M+P,0)),tc(u,ut(f,3),P)}function fi(u,f,b){var M=u==null?0:u.length;if(!M)return-1;var P=M-1;return b!==n&&(P=xt(b),P=b<0?Cn(M+P,0):rr(P,M-1)),tc(u,ut(f,3),P,!0)}function pu(u){var f=u==null?0:u.length;return f?jn(u,1):[]}function fh(u){var f=u==null?0:u.length;return f?jn(u,fe):[]}function mu(u,f){var b=u==null?0:u.length;return b?(f=f===n?1:xt(f),jn(u,f)):[]}function jr(u){for(var f=-1,b=u==null?0:u.length,M={};++f<b;){var P=u[f];M[P[0]]=P[1]}return M}function Jc(u){return u&&u.length?u[0]:n}function sl(u,f,b){var M=u==null?0:u.length;if(!M)return-1;var P=b==null?0:xt(b);return P<0&&(P=Cn(M+P,0)),As(u,f,P)}function Co(u){var f=u==null?0:u.length;return f?ur(u,0,-1):[]}var Kc=It(function(u){var f=Jt(u,jc);return f.length&&f[0]===u[0]?Fa(f):[]}),hh=It(function(u){var f=Hn(u),b=Jt(u,jc);return f===Hn(b)?f=n:b.pop(),b.length&&b[0]===u[0]?Fa(b,ut(f,2)):[]}),hi=It(function(u){var f=Hn(u),b=Jt(u,jc);return f=typeof f=="function"?f:n,f&&b.pop(),b.length&&b[0]===u[0]?Fa(b,n,f):[]});function Qc(u,f){return u==null?"":fc.call(u,f)}function Hn(u){var f=u==null?0:u.length;return f?u[f-1]:n}function Xc(u,f,b){var M=u==null?0:u.length;if(!M)return-1;var P=M;return b!==n&&(P=xt(b),P=P<0?Cn(M+P,0):rr(P,M-1)),f===f?Bv(u,f,P):tc(u,pm,P,!0)}function gu(u,f){return u&&u.length?li(u,xt(f)):n}var ph=It(yu);function yu(u,f){return u&&u.length&&f&&f.length?nn(u,f):u}function ed(u,f,b){return u&&u.length&&f&&f.length?nn(u,f,ut(b,2)):u}function Cr(u,f,b){return u&&u.length&&f&&f.length?nn(u,f,n,b):u}var pi=to(function(u,f){var b=u==null?0:u.length,M=Dc(u,f);return tu(u,Jt(f,function(P){return ca(P,b)?+P:P}).sort(qf)),M});function La(u,f){var b=[];if(!(u&&u.length))return b;var M=-1,P=[],V=u.length;for(f=ut(f,3);++M<V;){var K=u[M];f(K,M,u)&&(b.push(K),P.push(M))}return tu(u,P),b}function hr(u){return u==null?u:hc.call(u)}function ug(u,f,b){var M=u==null?0:u.length;return M?(b&&typeof b!="number"&&Ut(u,f,b)?(f=0,b=M):(f=f==null?0:xt(f),b=b===n?M:xt(b)),ur(u,f,b)):[]}function mh(u,f){return Rn(u,f)}function gh(u,f,b){return au(u,f,ut(b,2))}function qv(u,f){var b=u==null?0:u.length;if(b){var M=Rn(u,f);if(M<b&&xo(u[M],f))return M}return-1}function mi(u,f){return Rn(u,f,!0)}function cg(u,f,b){return au(u,f,ut(b,2),!0)}function yh(u,f){var b=u==null?0:u.length;if(b){var M=Rn(u,f,!0)-1;if(xo(u[M],f))return M}return-1}function ts(u){return u&&u.length?Ac(u):[]}function vh(u,f){return u&&u.length?Ac(u,ut(f,2)):[]}function ns(u){var f=u==null?0:u.length;return f?ur(u,1,f):[]}function dg(u,f,b){return u&&u.length?(f=b||f===n?1:xt(f),ur(u,0,f<0?0:f)):[]}function fg(u,f,b){var M=u==null?0:u.length;return M?(f=b||f===n?1:xt(f),f=M-f,ur(u,f<0?0:f,M)):[]}function wh(u,f){return u&&u.length?Js(u,ut(f,3),!1,!0):[]}function td(u,f){return u&&u.length?Js(u,ut(f,3)):[]}var Jv=It(function(u){return Bn(jn(u,1,Yn,!0))}),Kv=It(function(u){var f=Hn(u);return Yn(f)&&(f=n),Bn(jn(u,1,Yn,!0),ut(f,2))}),hg=It(function(u){var f=Hn(u);return f=typeof f=="function"?f:n,Bn(jn(u,1,Yn,!0),n,f)});function pg(u){return u&&u.length?Bn(u):[]}function rs(u,f){return u&&u.length?Bn(u,ut(f,2)):[]}function Qv(u,f){return f=typeof f=="function"?f:n,u&&u.length?Bn(u,n,f):[]}function gi(u){if(!(u&&u.length))return[];var f=0;return u=$o(u,function(b){if(Yn(b))return f=Cn(b.length,f),!0}),Tf(f,function(b){return Jt(u,Sf(b))})}function bh(u,f){if(!(u&&u.length))return[];var b=gi(u);return f==null?b:Jt(b,function(M){return Dr(f,n,M)})}var mn=It(function(u,f){return Yn(u)?Qa(u,f):[]}),Xv=It(function(u){return Pc($o(u,Yn))}),mg=It(function(u){var f=Hn(u);return Yn(f)&&(f=n),Pc($o(u,Yn),ut(f,2))}),e0=It(function(u){var f=Hn(u);return f=typeof f=="function"?f:n,Pc($o(u,Yn),n,f)}),t0=It(gi);function gg(u,f){return Zf(u||[],f||[],qi)}function yg(u,f){return Zf(u||[],f||[],dn)}var n0=It(function(u){var f=u.length,b=f>1?u[f-1]:n;return b=typeof b=="function"?(u.pop(),b):n,bh(u,b)});function qr(u){var f=_(u);return f.__chain__=!0,f}function Dh(u,f){return f(u),u}function nd(u,f){return f(u)}var yi=to(function(u){var f=u.length,b=f?u[0]:0,M=this.__wrapped__,P=function(V){return Dc(V,u)};return f>1||this.__actions__.length||!(M instanceof St)||!ca(b)?this.thru(P):(M=M.slice(b,+b+(f?1:0)),M.__actions__.push({func:nd,args:[P],thisArg:n}),new ar(M,this.__chain__).thru(function(V){return f&&!V.length&&V.push(n),V}))});function rd(){return qr(this)}function as(){return new ar(this.value(),this.__chain__)}function ad(){this.__values__===n&&(this.__values__=Cb(this.value()));var u=this.__index__>=this.__values__.length,f=u?n:this.__values__[this.__index__++];return{done:u,value:f}}function Sh(){return this}function Ih(u){for(var f,b=this;b instanceof Ga;){var M=ch(b);M.__index__=0,M.__values__=n,f?P.__wrapped__=M:f=M;var P=M;b=b.__wrapped__}return P.__wrapped__=u,f}function r0(){var u=this.__wrapped__;if(u instanceof St){var f=u;return this.__actions__.length&&(f=new St(this)),f=f.reverse(),f.__actions__.push({func:nd,args:[hr],thisArg:n}),new ar(f,this.__chain__)}return this.thru(hr)}function Th(){return Vf(this.__wrapped__,this.__actions__)}var a0=ou(function(u,f,b){Rt.call(u,b)?++u[b]:Ka(u,b,1)});function vg(u,f,b){var M=Tt(u)?yf:ka;return b&&Ut(u,f,b)&&(f=n),M(u,ut(f,3))}function wg(u,f){var b=Tt(u)?$o:Ki;return b(u,ut(f,3))}var od=qm(il),id=qm(fi);function bg(u,f){return jn(cd(u,f),1)}function Eh(u,f){return jn(cd(u,f),fe)}function o0(u,f,b){return b=b===n?1:xt(b),jn(cd(u,f),b)}function Ch(u,f){var b=Tt(u)?nr:Xa;return b(u,ut(f,3))}function sd(u,f){var b=Tt(u)?Xu:Bm;return b(u,ut(f,3))}var ld=ou(function(u,f,b){Rt.call(u,b)?u[b].push(f):Ka(u,b,[f])});function xh(u,f,b,M){u=ha(u)?u:pd(u),b=b&&!M?xt(b):0;var P=u.length;return b<0&&(b=Cn(P+b,0)),Ig(u)?b<=P&&u.indexOf(f,b)>-1:!!P&&As(u,f,b)>-1}var ud=It(function(u,f,b){var M=-1,P=typeof f=="function",V=ha(u)?ve(u.length):[];return Xa(u,function(K){V[++M]=P?Dr(f,K,b):oi(K,f,b)}),V}),Dg=ou(function(u,f,b){Ka(u,b,f)});function cd(u,f){var b=Tt(u)?Jt:Hf;return b(u,ut(f,3))}function dd(u,f,b,M){return u==null?[]:(Tt(f)||(f=f==null?[]:[f]),b=M?n:b,Tt(b)||(b=b==null?[]:[b]),Nc(u,f,b))}var i0=ou(function(u,f,b){u[b?0:1].push(f)},function(){return[[],[]]});function vu(u,f,b){var M=Tt(u)?wf:gm,P=arguments.length<3;return M(u,ut(f,4),b,P,Xa)}function s0(u,f,b){var M=Tt(u)?kv:gm,P=arguments.length<3;return M(u,ut(f,4),b,P,Bm)}function fd(u,f){var b=Tt(u)?$o:Ki;return b(u,he(ut(f,3)))}function i(u){var f=Tt(u)?Ja:Qi;return f(u)}function l(u,f,b){(b?Ut(u,f,b):f===n)?f=1:f=xt(f);var M=Tt(u)?Gi:cn;return M(u,f)}function h(u){var f=Tt(u)?Lm:ru;return f(u)}function y(u){if(u==null)return 0;if(ha(u))return Ig(u)?zi(u):u.length;var f=dr(u);return f==Je||f==Ot?u.size:Mc(u).length}function I(u,f,b){var M=Tt(u)?bf:Uv;return b&&Ut(u,f,b)&&(f=n),M(u,ut(f,3))}var x=It(function(u,f){if(u==null)return[];var b=f.length;return b>1&&Ut(u,f[0],f[1])?f=[]:b>2&&Ut(f[0],f[1],f[2])&&(f=[f[0]]),Nc(u,jn(f,1),[])}),L=Xt||function(){return sn.Date.now()};function q(u,f){if(typeof f!="function")throw new oa(s);return u=xt(u),function(){if(--u<1)return f.apply(this,arguments)}}function ee(u,f,b){return f=b?n:f,f=u&&f==null?u.length:f,eo(u,z,n,n,n,n,f)}function be(u,f){var b;if(typeof f!="function")throw new oa(s);return u=xt(u),function(){return--u>0&&(b=f.apply(this,arguments)),u<=1&&(f=n),b}}var Oe=It(function(u,f,b){var M=E;if(b.length){var P=aa(b,ui(Oe));M|=B}return eo(u,M,f,b,P)}),Le=It(function(u,f,b){var M=E|O;if(b.length){var P=aa(b,ui(Le));M|=B}return eo(f,M,u,b,P)});function Fe(u,f,b){f=b?n:f;var M=eo(u,j,n,n,n,n,n,f);return M.placeholder=Fe.placeholder,M}function qe(u,f,b){f=b?n:f;var M=eo(u,F,n,n,n,n,n,f);return M.placeholder=qe.placeholder,M}function nt(u,f,b){var M,P,V,K,ne,ce,Me=0,Ne=!1,Pe=!1,We=!0;if(typeof u!="function")throw new oa(s);f=ro(f)||0,Sn(b)&&(Ne=!!b.leading,Pe="maxWait"in b,V=Pe?Cn(ro(b.maxWait)||0,f):V,We="trailing"in b?!!b.trailing:We);function it(zn){var Mo=M,ss=P;return M=P=n,Me=zn,K=u.apply(ss,Mo),K}function yt(zn){return Me=zn,ne=al(Nt,f),Ne?it(zn):K}function Mt(zn){var Mo=zn-ce,ss=zn-Me,_b=f-Mo;return Pe?rr(_b,V-ss):_b}function vt(zn){var Mo=zn-ce,ss=zn-Me;return ce===n||Mo>=f||Mo<0||Pe&&ss>=V}function Nt(){var zn=L();if(vt(zn))return jt(zn);ne=al(Nt,Mt(zn))}function jt(zn){return ne=n,We&&M?it(zn):(M=P=n,K)}function Ba(){ne!==n&&Ks(ne),Me=0,M=ce=P=ne=n}function Jr(){return ne===n?K:jt(L())}function _a(){var zn=L(),Mo=vt(zn);if(M=arguments,P=this,ce=zn,Mo){if(ne===n)return yt(ce);if(Pe)return Ks(ne),ne=al(Nt,f),it(ce)}return ne===n&&(ne=al(Nt,f)),K}return _a.cancel=Ba,_a.flush=Jr,_a}var at=It(function(u,f){return Pf(u,1,f)}),Dn=It(function(u,f,b){return Pf(u,ro(f)||0,b)});function de(u){return eo(u,Y)}function ae(u,f){if(typeof u!="function"||f!=null&&typeof f!="function")throw new oa(s);var b=function(){var M=arguments,P=f?f.apply(this,M):M[0],V=b.cache;if(V.has(P))return V.get(P);var K=u.apply(this,M);return b.cache=V.set(P,K)||V,K};return b.cache=new(ae.Cache||ia),b}ae.Cache=ia;function he(u){if(typeof u!="function")throw new oa(s);return function(){var f=arguments;switch(f.length){case 0:return!u.call(this);case 1:return!u.call(this,f[0]);case 2:return!u.call(this,f[0],f[1]);case 3:return!u.call(this,f[0],f[1],f[2])}return!u.apply(this,f)}}function Be(u){return be(2,u)}var ot=Um(function(u,f){f=f.length==1&&Tt(f[0])?Jt(f[0],Yr(ut())):Jt(jn(f,1),Yr(ut()));var b=f.length;return It(function(M){for(var P=-1,V=rr(M.length,b);++P<V;)M[P]=f[P].call(this,M[P]);return Dr(u,this,M)})}),ct=It(function(u,f){var b=aa(f,ui(ct));return eo(u,B,n,f,b)}),dt=It(function(u,f){var b=aa(f,ui(dt));return eo(u,R,n,f,b)}),wt=to(function(u,f){return eo(u,H,n,n,n,f)});function Vn(u,f){if(typeof u!="function")throw new oa(s);return f=f===n?f:xt(f),It(u,f)}function Bt(u,f){if(typeof u!="function")throw new oa(s);return f=f==null?0:Cn(xt(f),0),It(function(b){var M=b[f],P=So(b,0,f);return M&&Go(P,M),Dr(u,this,P)})}function vi(u,f,b){var M=!0,P=!0;if(typeof u!="function")throw new oa(s);return Sn(b)&&(M="leading"in b?!!b.leading:M,P="trailing"in b?!!b.trailing:P),nt(u,f,{leading:M,maxWait:f,trailing:P})}function l0(u){return ee(u,1)}function Px(u,f){return ct(Lc(f),u)}function jx(){if(!arguments.length)return[];var u=arguments[0];return Tt(u)?u:[u]}function Lx(u){return Pr(u,D)}function Rx(u,f){return f=typeof f=="function"?f:n,Pr(u,D,f)}function Bx(u){return Pr(u,g|D)}function _x(u,f){return f=typeof f=="function"?f:n,Pr(u,g|D,f)}function Hx(u,f){return f==null||Jl(u,f,pr(f))}function xo(u,f){return u===f||u!==u&&f!==f}var Yx=lu(Aa),zx=lu(function(u,f){return u>=f}),wu=Lf(function(){return arguments}())?Lf:function(u){return Mn(u)&&Rt.call(u,"callee")&&!uc.call(u,"callee")},Tt=ve.isArray,Ux=mf?Yr(mf):Ec;function ha(u){return u!=null&&Sg(u.length)&&!os(u)}function Yn(u){return Mn(u)&&ha(u)}function Vx(u){return u===!0||u===!1||Mn(u)&&lr(u)==Re}var ll=kf||w0,Zx=kr?Yr(kr):Hm;function Wx(u){return Mn(u)&&u.nodeType===1&&!Mh(u)}function $x(u){if(u==null)return!0;if(ha(u)&&(Tt(u)||typeof u=="string"||typeof u.splice=="function"||ll(u)||hd(u)||wu(u)))return!u.length;var f=dr(u);if(f==Je||f==Ot)return!u.size;if(fu(u))return!Mc(u).length;for(var b in u)if(Rt.call(u,b))return!1;return!0}function Gx(u,f){return Ws(u,f)}function qx(u,f,b){b=typeof b=="function"?b:n;var M=b?b(u,f):n;return M===n?Ws(u,f,n,b):!!M}function u0(u){if(!Mn(u))return!1;var f=lr(u);return f==Se||f==Ht||typeof u.message=="string"&&typeof u.name=="string"&&!Mh(u)}function Jx(u){return typeof u=="number"&&Rs(u)}function os(u){if(!Sn(u))return!1;var f=lr(u);return f==Ze||f==Ke||f==Ye||f==un}function Sb(u){return typeof u=="number"&&u==xt(u)}function Sg(u){return typeof u=="number"&&u>-1&&u%1==0&&u<=oe}function Sn(u){var f=typeof u;return u!=null&&(f=="object"||f=="function")}function Mn(u){return u!=null&&typeof u=="object"}var Ib=Yi?Yr(Yi):Cc;function Kx(u,f){return u===f||xc(u,f,Zc(f))}function Qx(u,f,b){return b=typeof b=="function"?b:n,xc(u,f,Zc(f),b)}function Xx(u){return Tb(u)&&u!=+u}function eM(u){if(rg(u))throw new bt(o);return Bf(u)}function tM(u){return u===null}function nM(u){return u==null}function Tb(u){return typeof u=="number"||Mn(u)&&lr(u)==lt}function Mh(u){if(!Mn(u)||lr(u)!=Dt)return!1;var f=Ma(u);if(f===null)return!0;var b=Rt.call(f,"constructor")&&f.constructor;return typeof b=="function"&&b instanceof b&&Hl.call(b)==sc}var c0=Qu?Yr(Qu):Ym;function rM(u){return Sb(u)&&u>=-oe&&u<=oe}var Eb=ks?Yr(ks):_f;function Ig(u){return typeof u=="string"||!Tt(u)&&Mn(u)&&lr(u)==an}function Ra(u){return typeof u=="symbol"||Mn(u)&&lr(u)==wn}var hd=dm?Yr(dm):Ql;function aM(u){return u===n}function oM(u){return Mn(u)&&dr(u)==vr}function iM(u){return Mn(u)&&lr(u)==Ia}var sM=lu(ii),lM=lu(function(u,f){return u<=f});function Cb(u){if(!u)return[];if(ha(u))return Ig(u)?zr(u):Tr(u);if(vo&&u[vo])return Lv(u[vo]());var f=dr(u),b=f==Je?rc:f==Ot?qo:pd;return b(u)}function is(u){if(!u)return u===0?u:0;if(u=ro(u),u===fe||u===-fe){var f=u<0?-1:1;return f*we}return u===u?u:0}function xt(u){var f=is(u),b=f%1;return f===f?b?f-b:f:0}function xb(u){return u?bo(xt(u),0,G):0}function ro(u){if(typeof u=="number")return u;if(Ra(u))return Z;if(Sn(u)){var f=typeof u.valueOf=="function"?u.valueOf():u;u=Sn(f)?f+"":f}if(typeof u!="string")return u===0?u:+u;u=ym(u);var b=bv.test(u);return b||Jp.test(u)?Ju(u.slice(2),b?2:8):Gp.test(u)?Z:+u}function Mb(u){return Pa(u,pa(u))}function uM(u){return u?bo(xt(u),-oe,oe):u===0?u:0}function Gt(u){return u==null?"":pn(u)}var cM=Xs(function(u,f){if(fu(f)||ha(f)){Pa(f,pr(f),u);return}for(var b in f)Rt.call(f,b)&&qi(u,b,f[b])}),Nb=Xs(function(u,f){Pa(f,pa(f),u)}),Tg=Xs(function(u,f,b,M){Pa(f,pa(f),u,M)}),dM=Xs(function(u,f,b,M){Pa(f,pr(f),u,M)}),fM=to(Dc);function hM(u,f){var b=zs(u);return f==null?b:tn(b,f)}var pM=It(function(u,f){u=$t(u);var b=-1,M=f.length,P=M>2?f[2]:n;for(P&&Ut(f[0],f[1],P)&&(M=1);++b<M;)for(var V=f[b],K=pa(V),ne=-1,ce=K.length;++ne<ce;){var Me=K[ne],Ne=u[Me];(Ne===n||xo(Ne,Wa[Me])&&!Rt.call(u,Me))&&(u[Me]=V[Me])}return u}),mM=It(function(u){return u.push(n,nh),Dr(kb,n,u)});function gM(u,f){return hm(u,ut(f,3),ua)}function yM(u,f){return hm(u,ut(f,3),ni)}function vM(u,f){return u==null?u:Kl(u,ut(f,3),pa)}function wM(u,f){return u==null?u:Ic(u,ut(f,3),pa)}function bM(u,f){return u&&ua(u,ut(f,3))}function DM(u,f){return u&&ni(u,ut(f,3))}function SM(u){return u==null?[]:Ir(u,pr(u))}function IM(u){return u==null?[]:Ir(u,pa(u))}function d0(u,f,b){var M=u==null?n:Zr(u,f);return M===n?b:M}function TM(u,f){return u!=null&&oh(u,f,ri)}function f0(u,f){return u!=null&&oh(u,f,jf)}var EM=_c(function(u,f,b){f!=null&&typeof f.toString!="function"&&(f=Yl.call(f)),u[f]=b},p0(ma)),CM=_c(function(u,f,b){f!=null&&typeof f.toString!="function"&&(f=Yl.call(f)),Rt.call(u,f)?u[f].push(b):u[f]=[b]},ut),xM=It(oi);function pr(u){return ha(u)?qa(u):Mc(u)}function pa(u){return ha(u)?qa(u,!0):zm(u)}function MM(u,f){var b={};return f=ut(f,3),ua(u,function(M,P,V){Ka(b,f(M,P,V),M)}),b}function NM(u,f){var b={};return f=ut(f,3),ua(u,function(M,P,V){Ka(b,P,f(M,P,V))}),b}var kM=Xs(function(u,f,b){si(u,f,b)}),kb=Xs(function(u,f,b,M){si(u,f,b,M)}),AM=to(function(u,f){var b={};if(u==null)return b;var M=!1;f=Jt(f,function(V){return V=Do(V,u),M||(M=V.length>1),V}),Pa(u,uu(u),b),M&&(b=Pr(b,g|v|D,Qm));for(var P=f.length;P--;)Xi(b,f[P]);return b});function FM(u,f){return Ab(u,he(ut(f)))}var OM=to(function(u,f){return u==null?{}:Gs(u,f)});function Ab(u,f){if(u==null)return{};var b=Jt(uu(u),function(M){return[M]});return f=ut(f),Yf(u,b,function(M,P){return f(M,P[0])})}function PM(u,f,b){f=Do(f,u);var M=-1,P=f.length;for(P||(P=1,u=n);++M<P;){var V=u==null?n:u[ja(f[M])];V===n&&(M=P,V=b),u=os(V)?V.call(u):V}return u}function jM(u,f,b){return u==null?u:dn(u,f,b)}function LM(u,f,b,M){return M=typeof M=="function"?M:n,u==null?u:dn(u,f,b,M)}var Fb=eh(pr),Ob=eh(pa);function RM(u,f,b){var M=Tt(u),P=M||ll(u)||hd(u);if(f=ut(f,4),b==null){var V=u&&u.constructor;P?b=M?new V:[]:Sn(u)?b=os(V)?zs(Ma(u)):{}:b={}}return(P?nr:ua)(u,function(K,ne,ce){return f(b,K,ne,ce)}),b}function BM(u,f){return u==null?!0:Xi(u,f)}function _M(u,f,b){return u==null?u:Oc(u,f,Lc(b))}function HM(u,f,b,M){return M=typeof M=="function"?M:n,u==null?u:Oc(u,f,Lc(b),M)}function pd(u){return u==null?[]:Bl(u,pr(u))}function YM(u){return u==null?[]:Bl(u,pa(u))}function zM(u,f,b){return b===n&&(b=f,f=n),b!==n&&(b=ro(b),b=b===b?b:0),f!==n&&(f=ro(f),f=f===f?f:0),bo(ro(u),f,b)}function UM(u,f,b){return f=is(f),b===n?(b=f,f=0):b=is(b),u=ro(u),_m(u,f,b)}function VM(u,f,b){if(b&&typeof b!="boolean"&&Ut(u,f,b)&&(f=b=n),b===n&&(typeof f=="boolean"?(b=f,f=n):typeof u=="boolean"&&(b=u,u=n)),u===n&&f===n?(u=0,f=1):(u=is(u),f===n?(f=u,u=0):f=is(f)),u>f){var M=u;u=f,f=M}if(b||u%1||f%1){var P=Zl();return rr(u+P*(f-u+hf("1e-"+((P+"").length-1))),f)}return nu(u,f)}var ZM=Io(function(u,f,b){return f=f.toLowerCase(),u+(b?Pb(f):f)});function Pb(u){return h0(Gt(u).toLowerCase())}function jb(u){return u=Gt(u),u&&u.replace(Qp,bm).replace(sm,"")}function WM(u,f,b){u=Gt(u),f=pn(f);var M=u.length;b=b===n?M:bo(xt(b),0,M);var P=b;return b-=f.length,b>=0&&u.slice(b,P)==f}function $M(u){return u=Gt(u),u&&ze.test(u)?u.replace(je,Dm):u}function GM(u){return u=Gt(u),u&&ra.test(u)?u.replace(wr,"\\$&"):u}var qM=Io(function(u,f,b){return u+(b?"-":"")+f.toLowerCase()}),JM=Io(function(u,f,b){return u+(b?" ":"")+f.toLowerCase()}),KM=Qf("toLowerCase");function QM(u,f,b){u=Gt(u),f=xt(f);var M=f?zi(u):0;if(!f||M>=f)return u;var P=(f-M)/2;return su(Jo(P),b)+u+su(Vi(P),b)}function XM(u,f,b){u=Gt(u),f=xt(f);var M=f?zi(u):0;return f&&M<f?u+su(f-M,b):u}function e3(u,f,b){u=Gt(u),f=xt(f);var M=f?zi(u):0;return f&&M<f?su(f-M,b)+u:u}function t3(u,f,b){return b||f==null?f=0:f&&(f=+f),km(Gt(u).replace(kl,""),f||0)}function n3(u,f,b){return(b?Ut(u,f,b):f===n)?f=1:f=xt(f),qs(Gt(u),f)}function r3(){var u=arguments,f=Gt(u[0]);return u.length<3?f:f.replace(u[1],u[2])}var a3=Io(function(u,f,b){return u+(b?"_":"")+f.toLowerCase()});function o3(u,f,b){return b&&typeof b!="number"&&Ut(u,f,b)&&(f=b=n),b=b===n?G:b>>>0,b?(u=Gt(u),u&&(typeof f=="string"||f!=null&&!c0(f))&&(f=pn(f),!f&&Os(u))?So(zr(u),0,b):u.split(f,b)):[]}var i3=Io(function(u,f,b){return u+(b?" ":"")+h0(f)});function s3(u,f,b){return u=Gt(u),b=b==null?0:bo(xt(b),0,u.length),f=pn(f),u.slice(b,b+f.length)==f}function l3(u,f,b){var M=_.templateSettings;b&&Ut(u,f,b)&&(f=n),u=Gt(u),f=Tg({},f,M,th);var P=Tg({},f.imports,M.imports,th),V=pr(P),K=Bl(P,V),ne,ce,Me=0,Ne=f.interpolate||zu,Pe="__p += '",We=_l((f.escape||zu).source+"|"+Ne.source+"|"+(Ne===On?Ri:zu).source+"|"+(f.evaluate||zu).source+"|$","g"),it="//# sourceURL="+(Rt.call(f,"sourceURL")?(f.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++xv+"]")+`
`;u.replace(We,function(vt,Nt,jt,Ba,Jr,_a){return jt||(jt=Ba),Pe+=u.slice(Me,_a).replace(Dv,Sm),Nt&&(ne=!0,Pe+=`' +
__e(`+Nt+`) +
'`),Jr&&(ce=!0,Pe+=`';
`+Jr+`;
__p += '`),jt&&(Pe+=`' +
((__t = (`+jt+`)) == null ? '' : __t) +
'`),Me=_a+vt.length,vt}),Pe+=`';
`;var yt=Rt.call(f,"variable")&&f.variable;if(!yt)Pe=`with (obj) {
`+Pe+`
}
`;else if(zo.test(yt))throw new bt(c);Pe=(ce?Pe.replace(W,""):Pe).replace(re,"$1").replace(ye,"$1;"),Pe="function("+(yt||"obj")+`) {
`+(yt?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(ne?", __e = _.escape":"")+(ce?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+Pe+`return __p
}`;var Mt=Rb(function(){return Lt(V,it+"return "+Pe).apply(n,K)});if(Mt.source=Pe,u0(Mt))throw Mt;return Mt}function u3(u){return Gt(u).toLowerCase()}function c3(u){return Gt(u).toUpperCase()}function d3(u,f,b){if(u=Gt(u),u&&(b||f===n))return ym(u);if(!u||!(f=pn(f)))return u;var M=zr(u),P=zr(f),V=vm(M,P),K=Ef(M,P)+1;return So(M,V,K).join("")}function f3(u,f,b){if(u=Gt(u),u&&(b||f===n))return u.slice(0,oc(u)+1);if(!u||!(f=pn(f)))return u;var M=zr(u),P=Ef(M,zr(f))+1;return So(M,0,P).join("")}function h3(u,f,b){if(u=Gt(u),u&&(b||f===n))return u.replace(kl,"");if(!u||!(f=pn(f)))return u;var M=zr(u),P=vm(M,zr(f));return So(M,P).join("")}function p3(u,f){var b=U,M=J;if(Sn(f)){var P="separator"in f?f.separator:P;b="length"in f?xt(f.length):b,M="omission"in f?pn(f.omission):M}u=Gt(u);var V=u.length;if(Os(u)){var K=zr(u);V=K.length}if(b>=V)return u;var ne=b-zi(M);if(ne<1)return M;var ce=K?So(K,0,ne).join(""):u.slice(0,ne);if(P===n)return ce+M;if(K&&(ne+=ce.length-ne),c0(P)){if(u.slice(ne).search(P)){var Me,Ne=ce;for(P.global||(P=_l(P.source,Gt(of.exec(P))+"g")),P.lastIndex=0;Me=P.exec(Ne);)var Pe=Me.index;ce=ce.slice(0,Pe===n?ne:Pe)}}else if(u.indexOf(pn(P),ne)!=ne){var We=ce.lastIndexOf(P);We>-1&&(ce=ce.slice(0,We))}return ce+M}function m3(u){return u=Gt(u),u&&_e.test(u)?u.replace(xe,Im):u}var g3=Io(function(u,f,b){return u+(b?" ":"")+f.toUpperCase()}),h0=Qf("toUpperCase");function Lb(u,f,b){return u=Gt(u),f=b?n:f,f===n?jv(u)?_v(u):Fv(u):u.match(f)||[]}var Rb=It(function(u,f){try{return Dr(u,n,f)}catch(b){return u0(b)?b:new bt(b)}}),y3=to(function(u,f){return nr(f,function(b){b=ja(b),Ka(u,b,Oe(u[b],u))}),u});function v3(u){var f=u==null?0:u.length,b=ut();return u=f?Jt(u,function(M){if(typeof M[1]!="function")throw new oa(s);return[b(M[0]),M[1]]}):[],It(function(M){for(var P=-1;++P<f;){var V=u[P];if(Dr(V[0],this,M))return Dr(V[1],this,M)}})}function w3(u){return Rm(Pr(u,g))}function p0(u){return function(){return u}}function b3(u,f){return u==null||u!==u?f:u}var D3=es(),S3=es(!0);function ma(u){return u}function m0(u){return Xl(typeof u=="function"?u:Pr(u,g))}function I3(u){return $s(Pr(u,g))}function T3(u,f){return Oa(u,Pr(f,g))}var E3=It(function(u,f){return function(b){return oi(b,u,f)}}),C3=It(function(u,f){return function(b){return oi(u,b,f)}});function g0(u,f,b){var M=pr(f),P=Ir(f,M);b==null&&!(Sn(f)&&(P.length||!M.length))&&(b=f,f=u,u=this,P=Ir(f,pr(f)));var V=!(Sn(b)&&"chain"in b)||!!b.chain,K=os(u);return nr(P,function(ne){var ce=f[ne];u[ne]=ce,K&&(u.prototype[ne]=function(){var Me=this.__chain__;if(V||Me){var Ne=u(this.__wrapped__),Pe=Ne.__actions__=Tr(this.__actions__);return Pe.push({func:ce,args:arguments,thisArg:u}),Ne.__chain__=Me,Ne}return ce.apply(u,Go([this.value()],arguments))})}),u}function x3(){return sn._===this&&(sn._=Cm),this}function y0(){}function M3(u){return u=xt(u),It(function(f){return li(f,u)})}var N3=Yc(Jt),k3=Yc(yf),A3=Yc(bf);function Bb(u){return ih(u)?Sf(ja(u)):zf(u)}function F3(u){return function(f){return u==null?n:Zr(u,f)}}var O3=Xf(),P3=Xf(!0);function v0(){return[]}function w0(){return!1}function j3(){return{}}function L3(){return""}function R3(){return!0}function B3(u,f){if(u=xt(u),u<1||u>oe)return[];var b=G,M=rr(u,G);f=ut(f),u-=G;for(var P=Tf(M,f);++b<u;)f(b);return P}function _3(u){return Tt(u)?Jt(u,ja):Ra(u)?[u]:Tr(sg(Gt(u)))}function H3(u){var f=++Ls;return Gt(u)+f}var Y3=Hc(function(u,f){return u+f},0),z3=cr("ceil"),U3=Hc(function(u,f){return u/f},1),V3=cr("floor");function Z3(u){return u&&u.length?Ji(u,ma,Aa):n}function W3(u,f){return u&&u.length?Ji(u,ut(f,2),Aa):n}function $3(u){return mm(u,ma)}function G3(u,f){return mm(u,ut(f,2))}function q3(u){return u&&u.length?Ji(u,ma,ii):n}function J3(u,f){return u&&u.length?Ji(u,ut(f,2),ii):n}var K3=Hc(function(u,f){return u*f},1),Q3=cr("round"),X3=Hc(function(u,f){return u-f},0);function e4(u){return u&&u.length?If(u,ma):0}function t4(u,f){return u&&u.length?If(u,ut(f,2)):0}return _.after=q,_.ary=ee,_.assign=cM,_.assignIn=Nb,_.assignInWith=Tg,_.assignWith=dM,_.at=fM,_.before=be,_.bind=Oe,_.bindAll=y3,_.bindKey=Le,_.castArray=jx,_.chain=qr,_.chunk=Gv,_.compact=qc,_.concat=dh,_.cond=v3,_.conforms=w3,_.constant=p0,_.countBy=a0,_.create=hM,_.curry=Fe,_.curryRight=qe,_.debounce=nt,_.defaults=pM,_.defaultsDeep=mM,_.defer=at,_.delay=Dn,_.difference=fa,_.differenceBy=Pt,_.differenceWith=Un,_.drop=xn,_.dropRight=qn,_.dropRightWhile=Gr,_.dropWhile=ol,_.fill=_n,_.filter=wg,_.flatMap=bg,_.flatMapDeep=Eh,_.flatMapDepth=o0,_.flatten=pu,_.flattenDeep=fh,_.flattenDepth=mu,_.flip=de,_.flow=D3,_.flowRight=S3,_.fromPairs=jr,_.functions=SM,_.functionsIn=IM,_.groupBy=ld,_.initial=Co,_.intersection=Kc,_.intersectionBy=hh,_.intersectionWith=hi,_.invert=EM,_.invertBy=CM,_.invokeMap=ud,_.iteratee=m0,_.keyBy=Dg,_.keys=pr,_.keysIn=pa,_.map=cd,_.mapKeys=MM,_.mapValues=NM,_.matches=I3,_.matchesProperty=T3,_.memoize=ae,_.merge=kM,_.mergeWith=kb,_.method=E3,_.methodOf=C3,_.mixin=g0,_.negate=he,_.nthArg=M3,_.omit=AM,_.omitBy=FM,_.once=Be,_.orderBy=dd,_.over=N3,_.overArgs=ot,_.overEvery=k3,_.overSome=A3,_.partial=ct,_.partialRight=dt,_.partition=i0,_.pick=OM,_.pickBy=Ab,_.property=Bb,_.propertyOf=F3,_.pull=ph,_.pullAll=yu,_.pullAllBy=ed,_.pullAllWith=Cr,_.pullAt=pi,_.range=O3,_.rangeRight=P3,_.rearg=wt,_.reject=fd,_.remove=La,_.rest=Vn,_.reverse=hr,_.sampleSize=l,_.set=jM,_.setWith=LM,_.shuffle=h,_.slice=ug,_.sortBy=x,_.sortedUniq=ts,_.sortedUniqBy=vh,_.split=o3,_.spread=Bt,_.tail=ns,_.take=dg,_.takeRight=fg,_.takeRightWhile=wh,_.takeWhile=td,_.tap=Dh,_.throttle=vi,_.thru=nd,_.toArray=Cb,_.toPairs=Fb,_.toPairsIn=Ob,_.toPath=_3,_.toPlainObject=Mb,_.transform=RM,_.unary=l0,_.union=Jv,_.unionBy=Kv,_.unionWith=hg,_.uniq=pg,_.uniqBy=rs,_.uniqWith=Qv,_.unset=BM,_.unzip=gi,_.unzipWith=bh,_.update=_M,_.updateWith=HM,_.values=pd,_.valuesIn=YM,_.without=mn,_.words=Lb,_.wrap=Px,_.xor=Xv,_.xorBy=mg,_.xorWith=e0,_.zip=t0,_.zipObject=gg,_.zipObjectDeep=yg,_.zipWith=n0,_.entries=Fb,_.entriesIn=Ob,_.extend=Nb,_.extendWith=Tg,g0(_,_),_.add=Y3,_.attempt=Rb,_.camelCase=ZM,_.capitalize=Pb,_.ceil=z3,_.clamp=zM,_.clone=Lx,_.cloneDeep=Bx,_.cloneDeepWith=_x,_.cloneWith=Rx,_.conformsTo=Hx,_.deburr=jb,_.defaultTo=b3,_.divide=U3,_.endsWith=WM,_.eq=xo,_.escape=$M,_.escapeRegExp=GM,_.every=vg,_.find=od,_.findIndex=il,_.findKey=gM,_.findLast=id,_.findLastIndex=fi,_.findLastKey=yM,_.floor=V3,_.forEach=Ch,_.forEachRight=sd,_.forIn=vM,_.forInRight=wM,_.forOwn=bM,_.forOwnRight=DM,_.get=d0,_.gt=Yx,_.gte=zx,_.has=TM,_.hasIn=f0,_.head=Jc,_.identity=ma,_.includes=xh,_.indexOf=sl,_.inRange=UM,_.invoke=xM,_.isArguments=wu,_.isArray=Tt,_.isArrayBuffer=Ux,_.isArrayLike=ha,_.isArrayLikeObject=Yn,_.isBoolean=Vx,_.isBuffer=ll,_.isDate=Zx,_.isElement=Wx,_.isEmpty=$x,_.isEqual=Gx,_.isEqualWith=qx,_.isError=u0,_.isFinite=Jx,_.isFunction=os,_.isInteger=Sb,_.isLength=Sg,_.isMap=Ib,_.isMatch=Kx,_.isMatchWith=Qx,_.isNaN=Xx,_.isNative=eM,_.isNil=nM,_.isNull=tM,_.isNumber=Tb,_.isObject=Sn,_.isObjectLike=Mn,_.isPlainObject=Mh,_.isRegExp=c0,_.isSafeInteger=rM,_.isSet=Eb,_.isString=Ig,_.isSymbol=Ra,_.isTypedArray=hd,_.isUndefined=aM,_.isWeakMap=oM,_.isWeakSet=iM,_.join=Qc,_.kebabCase=qM,_.last=Hn,_.lastIndexOf=Xc,_.lowerCase=JM,_.lowerFirst=KM,_.lt=sM,_.lte=lM,_.max=Z3,_.maxBy=W3,_.mean=$3,_.meanBy=G3,_.min=q3,_.minBy=J3,_.stubArray=v0,_.stubFalse=w0,_.stubObject=j3,_.stubString=L3,_.stubTrue=R3,_.multiply=K3,_.nth=gu,_.noConflict=x3,_.noop=y0,_.now=L,_.pad=QM,_.padEnd=XM,_.padStart=e3,_.parseInt=t3,_.random=VM,_.reduce=vu,_.reduceRight=s0,_.repeat=n3,_.replace=r3,_.result=PM,_.round=Q3,_.runInContext=ue,_.sample=i,_.size=y,_.snakeCase=a3,_.some=I,_.sortedIndex=mh,_.sortedIndexBy=gh,_.sortedIndexOf=qv,_.sortedLastIndex=mi,_.sortedLastIndexBy=cg,_.sortedLastIndexOf=yh,_.startCase=i3,_.startsWith=s3,_.subtract=X3,_.sum=e4,_.sumBy=t4,_.template=l3,_.times=B3,_.toFinite=is,_.toInteger=xt,_.toLength=xb,_.toLower=u3,_.toNumber=ro,_.toSafeInteger=uM,_.toString=Gt,_.toUpper=c3,_.trim=d3,_.trimEnd=f3,_.trimStart=h3,_.truncate=p3,_.unescape=m3,_.uniqueId=H3,_.upperCase=g3,_.upperFirst=h0,_.each=Ch,_.eachRight=sd,_.first=Jc,g0(_,function(){var u={};return ua(_,function(f,b){Rt.call(_.prototype,b)||(u[b]=f)}),u}(),{chain:!1}),_.VERSION=r,nr(["bind","bindKey","curry","curryRight","partial","partialRight"],function(u){_[u].placeholder=_}),nr(["drop","take"],function(u,f){St.prototype[u]=function(b){b=b===n?1:Cn(xt(b),0);var M=this.__filtered__&&!f?new St(this):this.clone();return M.__filtered__?M.__takeCount__=rr(b,M.__takeCount__):M.__views__.push({size:rr(b,G),type:u+(M.__dir__<0?"Right":"")}),M},St.prototype[u+"Right"]=function(b){return this.reverse()[u](b).reverse()}}),nr(["filter","map","takeWhile"],function(u,f){var b=f+1,M=b==pe||b==se;St.prototype[u]=function(P){var V=this.clone();return V.__iteratees__.push({iteratee:ut(P,3),type:b}),V.__filtered__=V.__filtered__||M,V}}),nr(["head","last"],function(u,f){var b="take"+(f?"Right":"");St.prototype[u]=function(){return this[b](1).value()[0]}}),nr(["initial","tail"],function(u,f){var b="drop"+(f?"":"Right");St.prototype[u]=function(){return this.__filtered__?new St(this):this[b](1)}}),St.prototype.compact=function(){return this.filter(ma)},St.prototype.find=function(u){return this.filter(u).head()},St.prototype.findLast=function(u){return this.reverse().find(u)},St.prototype.invokeMap=It(function(u,f){return typeof u=="function"?new St(this):this.map(function(b){return oi(b,u,f)})}),St.prototype.reject=function(u){return this.filter(he(ut(u)))},St.prototype.slice=function(u,f){u=xt(u);var b=this;return b.__filtered__&&(u>0||f<0)?new St(b):(u<0?b=b.takeRight(-u):u&&(b=b.drop(u)),f!==n&&(f=xt(f),b=f<0?b.dropRight(-f):b.take(f-u)),b)},St.prototype.takeRightWhile=function(u){return this.reverse().takeWhile(u).reverse()},St.prototype.toArray=function(){return this.take(G)},ua(St.prototype,function(u,f){var b=/^(?:filter|find|map|reject)|While$/.test(f),M=/^(?:head|last)$/.test(f),P=_[M?"take"+(f=="last"?"Right":""):f],V=M||/^find/.test(f);P&&(_.prototype[f]=function(){var K=this.__wrapped__,ne=M?[1]:arguments,ce=K instanceof St,Me=ne[0],Ne=ce||Tt(K),Pe=function(Nt){var jt=P.apply(_,Go([Nt],ne));return M&&We?jt[0]:jt};Ne&&b&&typeof Me=="function"&&Me.length!=1&&(ce=Ne=!1);var We=this.__chain__,it=!!this.__actions__.length,yt=V&&!We,Mt=ce&&!it;if(!V&&Ne){K=Mt?K:new St(this);var vt=u.apply(K,ne);return vt.__actions__.push({func:nd,args:[Pe],thisArg:n}),new ar(vt,We)}return yt&&Mt?u.apply(this,ne):(vt=this.thru(Pe),yt?M?vt.value()[0]:vt.value():vt)})}),nr(["pop","push","shift","sort","splice","unshift"],function(u){var f=go[u],b=/^(?:push|sort|unshift)$/.test(u)?"tap":"thru",M=/^(?:pop|shift)$/.test(u);_.prototype[u]=function(){var P=arguments;if(M&&!this.__chain__){var V=this.value();return f.apply(Tt(V)?V:[],P)}return this[b](function(K){return f.apply(Tt(K)?K:[],P)})}}),ua(St.prototype,function(u,f){var b=_[f];if(b){var M=b.name+"";Rt.call(Hs,M)||(Hs[M]=[]),Hs[M].push({name:f,func:b})}}),Hs[el(n,O).name]=[{name:"wrapper",func:n}],St.prototype.clone=gc,St.prototype.reverse=Ff,St.prototype.value=Us,_.prototype.at=yi,_.prototype.chain=rd,_.prototype.commit=as,_.prototype.next=ad,_.prototype.plant=Ih,_.prototype.reverse=r0,_.prototype.toJSON=_.prototype.valueOf=_.prototype.value=Th,_.prototype.first=_.prototype.head,vo&&(_.prototype[vo]=Sh),_},Ps=Hv();Za?((Za.exports=Ps)._=Ps,Rl._=Ps):sn._=Ps}).call(Jn)})(iy,iy.exports);var FI=iy.exports;function Eg(e){const t=e.match(/^#+/);return t?t[0].length:0}function Wb(e,t){const n=e.split(`
`);let r="",a=[],o=!1,s=1;for(let c=0;c<n.length;c++){const d=n[c];if(d.startsWith("#")&&/^#{1,6}\s/g.test(d)){if(o&&Eg(d)<=Eg(t))break;r=d,r===t?(o=!0,s=c+1):o&&Eg(d)>Eg(t)?a.push(d):(o=!1,a=[])}else o&&a.push(d)}return t?FI.isEmpty(a)?{content:"",startLine:-1}:{content:a.join(`
`),startLine:s}:{content:e,startLine:0}}function jN(e){const t=e.split(/\r?\n/),n=[];for(let r=0;r<t.length;r++)new RegExp(bN).test(t[r])&&n.push({line:t[r],index:r+1});return n}async function LN(e,t){let n=t.vault.getAbstractFileByPath(e);return n||(new C.Notice(N("File not found for the given thino path, is creating a new file")),n=await t.vault.create(e,'{"nodes": [], "edges": []}'),Qe.setChangedByMemos(!0)),n}async function RN(e,t){var a;let n;try{n=await t.vault.read(e)}catch(o){console.error(o),n=await t.vault.cachedRead(e)}const r=(a=t.metadataCache.getFileCache(e))==null?void 0:a.frontmatterPosition;return r?n.slice(r.end.offset+1):n}function BN(e){const t=e.split(/\r?\n/),n=[];let r="",a=[],o=0;for(let s=0;s<t.length;s++){const c=t[s];c.startsWith("#")?(r&&n.push({header:r,content:a.join(`
`).trim(),pos:{start:o,end:s-1}}),r=c,a=[],o=s):a.push(c)}return r&&n.push({header:r,content:a.join(`
`).trim(),pos:{start:o,end:t.length-1}}),n}function _N(e){const t=e.split(/\r?\n/),n=[];let r=!1,a=[],o="";for(let s=0;s<t.length;s++){const c=t[s];c.startsWith("> [!thino]")?(r&&(n.push({metadata:o,content:a.join(`
`).trim()}),a=[]),r=!0,o=c.replace("> [!thino]","").trim()):r&&c.startsWith(">")?a.push(c.replace(/^> /,"")):r&&!c.startsWith(">")&&(r=!1,n.push({metadata:o,content:a.join(`
`).trim()}),a=[],o="")}return r&&n.push({metadata:o,content:a.join(`
`).trim()}),n}const HN=e=>{let t;switch(e){case" ":t="TASK-TODO";break;case"x":case"X":t="TASK-DONE";break;default:t="TASK-"+e;break}return t};async function YN(e,t){if(!t)return 0;const{vault:n}=Ee.getState().dailyNotesState.app,r=e==null?void 0:e.DefaultMemoComposition,a=e!=null&&e.ProcessEntriesBelow&&(e==null?void 0:e.ProcessContentTarget)!=="whole"?e==null?void 0:e.ProcessEntriesBelow:"",o=(e==null?void 0:e.ProcessContentTarget)!=="whole"?e!=null&&e.DifferentInsertTarget?e!=null&&e.InsertAfterForTask?e==null?void 0:e.InsertAfterForTask:"":a:"";let s;try{s=await n.read(t)}catch(S){console.error(S),s=await n.cachedRead(t)}let c;r!=""&&/{TIME}/g.test(r)&&/{CONTENT}/g.test(r)?c="(-|\\*) (\\[(.{1})\\]\\s)?"+r.replace(/{TIME}/g,"((\\<time\\>)?\\d{1,2}:\\d{2}(\\:\\d{2})?)?").replace(/ {CONTENT}/g,""):c="(-|\\*) (\\[(.{1})\\]\\s)?((\\<time\\>)?\\d{1,2}\\:\\d{2}(\\:\\d{2})?)?";const d=new RegExp(c,"g"),p=(s.match(d)||[]).length,m=new RegExp(a.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),g=new RegExp(o.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),"g"),v=(s.match(m)||[]).length,D=(s.match(g)||[]).length;return s=null,v||D?p:0}function $b(e,t,n,r,a){var d,p,m;const o=Wh(a,"day");let s;const c=jN(t);for(const g of c){const v=ZN(e.DefaultMemoComposition,g.line),D=WN(e.DefaultMemoComposition,g.line),S=$N(g.line);let T=zN(g.line);if(o.hours(parseInt(v)),o.minutes(parseInt(D)),S&&o.seconds(parseInt(S)),!S&&o.seconds(0),/^\s*[-*]\s(\[(.)\])\s/g.test(g.line)){const H=GN(g.line);T=UN(e.DefaultMemoComposition,g.line),s=HN(H)}else s="JOURNAL";let E=T.replaceAll(/<br>/g,`
`);const O=new RegExp(/\[(pinned|PINNED)::true\]/,"g").test(T),k=new RegExp(/\[(archived|ARCHIVED)::true\]/,"g").test(T),j=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").test(T),F=(d=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(T))==null?void 0:d[2],B=(p=new RegExp(/\[(webId|WEBID)::([^\]]*)\]/,"g").exec(T))==null?void 0:p[2],R=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(T)?"PUBLIC":"PRIVATE",z=(m=new RegExp(/\s\^([0-9a-zA-Z-]+)$/).exec(T))==null?void 0:m[1];E=E.replace(/\s\[pinned::[^\]]+\]/g,"").replace(/\s\[visibility::[^\]]+\]/g,"").replace(/\s\[archived::[^\]]+\]/g,"").replace(/\s\[deleted::[^\]]+\]/g,"").replace(/\s\[webId::[^\]]+\]/g,"").replace(/\s\^([0-9a-zA-Z-]+)$/g,""),r.push({id:o.format("YYYYMMDDHHmmss")+`${g.index+n-1}`,content:E,createdAt:o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:o.format("YYYY/MM/DD HH:mm:ss"),thinoType:s,hasId:z||"",linkId:"",path:a.path,deletedAt:j?C.moment(F,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",rowStatus:k?"ARCHIVED":"NORMAL",visibility:R,pinned:O,creatorName:"Memo",resourceList:[],sourceType:"DAILY",webId:B})}}function zN(e){return e.replace(/^(-|\*|\d\.) (\d{1,2}:\d{2}(:\d{2})?)\s(.*)$/g,"$4")}function UN(e,t){return VN(e,t)}const VN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"((\\d{1,2})\\:(\\d{2}))?(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*[\\-\\*]\\s(\\[(.{1})\\]\\s?)?((\\d{1,2})\\:(\\d{2}))?(\\:\\d{2})?\\s?(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},ZN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[6]},WN=(e,t)=>{var a;let n;return e!=""&&/{TIME}/g.test(e)&&/{CONTENT}/g.test(e)?n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?"+e.replace(/{TIME}/g,"(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(\\:\\d{2})?").replace(/{CONTENT}/g,"(.*)$"):n="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\<time\\>)?(\\d{1,2})\\:(\\d{2})(.*)$",(a=new RegExp(n,"").exec(t))==null?void 0:a[7]},$N=e=>{var r;const t="^\\s*(\\-|\\*|(\\d{1,}\\.))\\s(\\[(.{1})\\]\\s?)?(\\d{1,2})\\:(\\d{2})\\:(\\d{2})(.*)$";return(r=new RegExp(t,"").exec(e))==null?void 0:r[7]},GN=e=>{var t;return(t=/^\s*[\-\*]\s(\[(.{1})\])\s(.*)$/.exec(e))==null?void 0:t[2]},OI=()=>a1()?!0:(new C.Notice(N("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),!1);async function PI(e,t){if(!e)return t;const n=Ee.getState().dailyNotesState.app,r=await RN(e,n);if(!r.trim())return t;let a=C.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss");await n.fileManager.processFrontMatter(e,o=>{if(!o)return t;const s=!!o.pinned,c=o.rowStatus&&o.rowStatus==="ARCHIVED",d=!!o.deletedAt;o.createdAt&&(a=C.moment(o.createdAt,"YYYY/MM/DD HH:mm:ss").isValid()?o.createdAt:a);const p=o.deletedAt?o.deletedAt:"",m=o.visibility?o.visibility:"PRIVATE",g=o.thinoType?o.thinoType:"JOURNAL",v=o.webId?o.webId:"";o.id||(o.id=Ue.randomId(16));const D=o.id?o.id:"",S=o.hasId?o.hasId:"",T=o.linkId?o.linkId:"",E=e.path,O="Memo",k="MULTI",j=[];return t.push({id:D,content:r,createdAt:a,updatedAt:a,deletedAt:d?C.moment(p,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:s,rowStatus:c?"ARCHIVED":"NORMAL",visibility:m,thinoType:g,hasId:S,linkId:T,path:E,creatorName:O,sourceType:k,resourceList:j,webId:v}),t})}async function mw(e,t){var D,S,T,E,O,k;if(!e)return t;const{vault:n}=Ee.getState().dailyNotesState.app;let r;try{r=await n.read(e)}catch(j){console.error(j),r=await n.cachedRead(e)}if(!r)return;const a=C.moment(e.stat.ctime).format("YYYY/MM/DD HH:mm:ss"),o=C.moment(e.stat.mtime).format("YYYY/MM/DD HH:mm:ss"),s=e.path,c="Thino",d="FILE",p="",m="",g=[],v=await BN(r);for(const j of v){const F=_N(j.content);for(const B of F){const R=B.metadata.match(/\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/g);if(!R)continue;const z=(S=(D=B.metadata.match(/id::([^\]]*)/g))==null?void 0:D[0])==null?void 0:S.replace("id::","");if(!z)continue;const H=R?R[0]:a,Y=R?R[0]:o,U=B.metadata.match(/webId::([^\]]*)/g)?(E=(T=B.metadata.match(/webId::([^\]]*)/g))==null?void 0:T[0])==null?void 0:E.replace("webId::",""):"",J=B.metadata.contains("[pinned::true]"),Q=B.metadata.contains("[archived::true]"),le=B.metadata.contains("[deleted::"),pe=(O=new RegExp(/\[(deleted|DELETED)::([^\]]*)\]/,"g").exec(B.metadata))==null?void 0:O[2],ie=new RegExp(/\[(visibility|VISIBILITY)::("PROTECT"|"PUBLIC")\]/,"g").test(B.metadata)?"PUBLIC":"PRIVATE",se=(k=new RegExp(/\[(thinoType|THINOTYPE)::([^\]]*)\]/,"g").exec(B.metadata))==null?void 0:k[2];t.push({id:z,content:B.content,createdAt:H,updatedAt:Y,deletedAt:le?C.moment(pe,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",pinned:J,rowStatus:Q?"ARCHIVED":"NORMAL",visibility:ie,thinoType:se||"JOURNAL",hasId:p,linkId:m,path:s,creatorName:c,sourceType:d,resourceList:g,webId:U})}}return t}async function gw(e,t){if(!e)return[];const n=Ee.getState().dailyNotesState.settings,{vault:r}=Ee.getState().dailyNotesState.app;if(await YN(n,e)===0)return;let o;try{o=await r.read(e)}catch(g){console.error(g),o=await r.cachedRead(e)}const{content:s,startLine:c}=Wb(o,(n==null?void 0:n.ProcessContentTarget)==="whole"?"":n.ProcessEntriesBelow);let d="",p=0;if(n.DifferentInsertTarget&&(n==null?void 0:n.ProcessContentTarget)!=="whole"&&n.InsertAfterForTask&&!s.includes(n.InsertAfterForTask)){const{content:g,startLine:v}=Wb(o,n.InsertAfterForTask);d=g,p=v}const m=[];$b(n,s,c,m,e),n.DifferentInsertTarget&&d&&$b(n,d,p,m,e),t.push(...m.sort((g,v)=>g.createdAt>v.createdAt?-1:1))}async function yw(e,t){const{app:n}=Ee.getState().dailyNotesState;if(!(e instanceof C.TFile))return;let r;try{r=await n.vault.read(e)}catch(s){console.error(s),r=await n.vault.cachedRead(e)}if(!r)return;const a=JSON.parse(r),o=a==null?void 0:a.nodes;for(const s of o){if(s.type==="group"||s.createdAt===void 0||s.text.trim()==="")continue;const c=C.moment(s==null?void 0:s.createdAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),d=C.moment(s==null?void 0:s.updatedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"),p=s!=null&&s.deletedAt?C.moment(s==null?void 0:s.deletedAt,"YYYYMMDDHHmmss").format("YYYY/MM/DD HH:mm:SS"):"",m=!!(s!=null&&s.pinned),g=s!=null&&s.archived?"ARCHIVED":"NORMAL",v=s!=null&&s.visibility?s==null?void 0:s.visibility:"PRIVATE",D=s!=null&&s.thinoType?s==null?void 0:s.thinoType:"JOURNAL",S=s!=null&&s.text?s==null?void 0:s.text:"",T=s!=null&&s.id?s==null?void 0:s.id:"",E=s!=null&&s.hasId?s==null?void 0:s.hasId:"",O=s!=null&&s.linkId?s==null?void 0:s.linkId:"",k=e.path,j="Memo",F="CANVAS",B=[],R=s!=null&&s.webId?s==null?void 0:s.webId:void 0;t.push({id:T,content:S,createdAt:c,updatedAt:d,deletedAt:p,pinned:m,rowStatus:g,visibility:v,thinoType:D,hasId:E,linkId:O,path:k,creatorName:j,sourceType:F,resourceList:B,webId:R})}}async function Gb(e=[]){const t=[],n=[],r=Ee.getState().dailyNotesState.app,{vault:a}=r,{settings:o}=Ee.getState().dailyNotesState,s=r.loadLocalStorage("tokenForSync"),c=async(d,p)=>{for(const m of d)try{await p(m,t)}catch(g){console.error(g),new C.Notice(g)}};if(e.includes("CANVAS")){const d=qN(a);await c(d,yw)}if(e.includes("MULTI")){const d=JN(a,o);await c(d,PI)}if(e.includes("DAILY")){const d=await KN(a);await c(d,gw)}if(e.includes("FILE")||s){const d=QN(a);await c(d,mw)}return{memos:t,commentMemos:n}}function qN(e){return e.getAllLoadedFiles().filter(t=>t instanceof C.TFile&&t.extension==="canvas"&&t.name.includes(".thino"))}function JN(e,t){return e.getMarkdownFiles().filter(n=>{var r,a;return n instanceof C.TFile&&((r=n.parent)==null?void 0:r.path.includes(t.MemoOtherSaveLocation.MemoDefaultMultiFilePath.trim()))&&!((a=n.path)!=null&&a.endsWith("thino.md"))})}async function KN(e){const t=o1();t===void 0&&new C.Notice(N("Please check your daily note plugin OR periodic notes plugin settings")+"folder path is empty or undefined"),e.getAbstractFileByPath(C.normalizePath(t))||new C.Notice(N("Failed to find daily notes folder"));const r=bs();return Object.values(r).filter(a=>a instanceof C.TFile&&a.extension==="md")}function QN(e){return e.getMarkdownFiles().filter(t=>t instanceof C.TFile&&t.name.trim().includes("thino"))}const XN=async(e,t,n)=>{const r=await _d(Ee.getState().dailyNotesState.app)||[],a=r.find(c=>c.id===e),o={...a,title:t,querystring:n},s=r.findIndex(c=>c.id===e);return r[s]=o,await Ep(Ee.getState().dailyNotesState.app,r),[a]};function ek(e){return(e==null?void 0:e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"))||e}function tk(e){const t=[];let n=e;for(;n.contains(`
`);){const r=n.indexOf(`
`);t.push(n.slice(0,r)),n=n.slice(r+1)}return t.push(n),t}async function nk({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=C.moment(),a=Ue.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",s=`${o}/${r.format("YYYYMMDD")}-${a}.md`,c={id:a,content:e,deletedAt:"",path:s,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"MULTI"},d=Xe.getState().app,{vault:p,fileManager:m}=d,g=p.getAbstractFileByPath(o);(!g||!(g instanceof C.TFolder))&&(new C.Notice(N("Folder not found for the given thino path, is creating a new folder")),await p.createFolder(o)),Qe.setChangedByMemos(!0);const v=await p.create(s,e);return await m.processFrontMatter(v,D=>{D.id=a,D.createdAt=r.format("YYYY/MM/DD HH:mm:ss"),D.updatedAt=r.format("YYYY/MM/DD HH:mm:ss"),D.thinoType=t?"JOURNAL":"TASK-TODO",D.pinned=!1,D.visibility="PUBLIC",D.rowStatus="NORMAL"}),c}async function rk({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=C.moment(),a=Ue.randomId(16),o=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",s={id:a,content:e,deletedAt:"",path:o,createdAt:r.format("YYYY/MM/DD HH:mm:ss"),updatedAt:r.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE"},c=Xe.getState().app,{vault:d}=c;let p=d.getAbstractFileByPath(o);(!p||!(p instanceof C.TFile))&&(new C.Notice(N("File not found for the given thino path, is creating a new file")),p=await d.create(o,""));let m="";try{m=await d.read(p)||await d.cachedRead(p)}catch(O){console.error(O),new C.Notice(N("Failed to read current daily note, check if it exists."))}const g=m.indexOf(`# ${r.format("YYYY-MM-DD")}`);let v=m.indexOf(`
#`,g+1);v===-1&&(v=m.length);const D=`> [!thino] ${r.format("YYYY/MM/DD HH:mm:ss")} %% [id::${a}] [thinoType::${t?"JOURNAL":"TASK-TODO"}] %%`,S=e.replace(/\n/g,`
> `),T=`
${D}
> ${S}
`;let E;if(g===-1){const O=`# ${r.format("YYYY-MM-DD")}`;E=`${m.substring(0,v)}
${O}${T}
${m.substring(v)}`}else E=`${m.substring(0,v)}${T}${m.substring(v)}`;return setTimeout(async()=>{Qe.setChangedByMemos(!0),await d.modify(p,E)},200),s}async function qb(e){const t=Ee.getState().dailyNotesState.settings,n=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),r=e.id,a=(t==null?void 0:t.MemoOtherSaveLocation.MemoDefaultSingleFilePath)||"basic.thino.md",o={id:r,content:e.content,deletedAt:e.deletedAt||"",path:a,createdAt:n.format("YYYY/MM/DD HH:mm:ss"),updatedAt:n.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",hasId:"",linkId:"",pinned:e.pinned,visibility:"PUBLIC",rowStatus:e.rowStatus||"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"FILE",webId:e.id},s=Xe.getState().app,{vault:c}=s;let d=c.getAbstractFileByPath(a);(!d||!(d instanceof C.TFile))&&(new C.Notice(N("File not found for the given thino path, is creating a new file")),d=await c.create(a,""));let p="";try{p=await c.read(d)||await c.cachedRead(d)}catch(E){console.error(E),new C.Notice(N("Failed to read current daily note, check if it exists."))}const m=p.indexOf(`# ${n.format("YYYY-MM-DD")}`);let g=p.indexOf(`
#`,m+1);g===-1&&(g=p.length);const v=`> [!thino] ${n.format("YYYY/MM/DD HH:mm:ss")} %% [id::${r}] [thinoType::JOURNAL]${e.rowStatus==="ARCHIVED"?" [archived::true]":""}${e.pinned===!0?" [pinned::true]":""}${e.deletedAt?` [deleted::${e.deletedAt}]`:""}${e.id?` [webId::${e.id}]`:""} %%`,D=e.content.replace(/\n/g,`
> `),S=`
${v}
> ${D}
`;let T;if(m===-1){const E=`# ${n.format("YYYY-MM-DD")}`;T=`${p.substring(0,g)}
${E}${S}
${p.substring(g)}`}else T=`${p.substring(0,g)}${S}${p.substring(g)}`;return Qe.setChangedByMemos(!0),await c.modify(d,T),o}async function ak({content:e,isList:t}){const n=Ee.getState().dailyNotesState.settings,r=(n==null?void 0:n.MemoOtherSaveLocation.MemoDefaultCanvasPath)||"basic.thino.canvas",a=C.moment(),o=Ue.randomId(16),s={id:o,content:e,deletedAt:"",path:r,createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"CANVAS"},c=Xe.getState().app,{vault:d}=c,p=await LN(r,c);if(!p||!(p instanceof C.TFile)){new C.Notice(N("File not found for the given thino path, is creating a new file"));return}const m=await d.read(p),g=JSON.parse(m);if(g.nodes.find(E=>E.id===s.id))return;let D;g.nodes.length>0&&(D=[...g.nodes].reduce((E,O)=>{if(!E.createdAt)return O;const k=C.moment(E.createdAt,"YYYY/MM/DD HH:mm:ss"),j=C.moment(O.createdAt,"YYYY/MM/DD HH:mm:ss");return k.isAfter(j)?E:O}));const S=D?{x:D.x,y:D.y+100,width:D.width,height:D.height}:{x:0,y:0,width:200,height:100};g.nodes.push({...S,type:"text",id:o,text:e,deletedAt:"",createdAt:a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:a.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[]}),Qe.setChangedByMemos(!0);const T=JSON.stringify(g,null,2);return await d.modify(p,T),s}async function Jb(e,t,n){var F;const{vault:r}=Ee.getState().dailyNotesState.app||app,a=Ee.getState().dailyNotesState.settings,o=e.replace(/\n/g,"<br>"),s=n||C.moment(),{DifferentInsertTarget:c,InsertAfterForTask:d,InsertType:p}=a,m=s.format(a.DefaultTimePrefix||"HH:mm"),g=t?"- ":"- [ ] ",v=a!=null&&a.DefaultMemoComposition?`${g}${(F=a==null?void 0:a.DefaultMemoComposition)==null?void 0:F.replace(/{TIME}/g,m).replace(/{CONTENT}/g,o)}`:`${g}${m} ${o}`,D=bs(),S=Fy(s,D);let T;if(S?T=S:T=await Ue.createDailyNoteCheck(s),!T){new C.Notice(N("Failed to create daily note, check if it exists."));return}S||await Xe.fechLocalDailyNotes();let E="";try{E=await r.read(T)||await r.cachedRead(T)}catch(B){console.error(B),new C.Notice(N("Failed to read current daily note, check if it exists."))}const O=p==="end"?"":t?a.InsertAfter:c&&d||a.InsertAfter,k=await jI(O,v,E);n?await r.modify(T,k.content):setTimeout(async()=>{await r.modify(T,k.content)},200);const j=k.posNum===-1?LI(k.content).length-1:k.posNum+1;return Qe.setChangedByMemos(!0),{id:s.format("YYYYMMDDHHmm")+"00"+j,content:e,deletedAt:"",createdAt:s.format("YYYY/MM/DD HH:mm:ss"),updatedAt:s.format("YYYY/MM/DD HH:mm:ss"),thinoType:t?"JOURNAL":"TASK-TODO",path:T.path,hasId:"",linkId:"",pinned:!1,visibility:"PUBLIC",rowStatus:"NORMAL",creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function ok(e){const{vault:t}=Ee.getState().dailyNotesState.app??app,{DefaultMemoComposition:n,InsertAfter:r,DefaultTimePrefix:a,DifferentInsertTarget:o,InsertAfterForTask:s,InsertType:c}=Ee.getState().dailyNotesState.settings;let d=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PRIVATE"?' [visibility::"PRIVATE"]':"");if(e.id){const R=" [webId::"+e.id+"]";d+=R}const p=C.moment();if(e.deletedAt){const R=" [deleted::"+p.format("YYYYMMDDHHmmss")+"]";d+=R}const m=e.content.replace(/\n/g,"<br>")+d,g=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),v=g.format(a||"HH:mm"),D=e.thinoType?"- [ ] ":"- ",S=n?`${D}${n==null?void 0:n.replace(/{TIME}/g,v).replace(/{CONTENT}/g,m)}`:`${D}${v} ${m}`,T=bs(),E=Fy(g,T);let O;if(E?O=E:O=await Ue.createDailyNoteCheck(g),!O){new C.Notice(N("Failed to create daily note, check if it exists."));return}E||await Xe.fechLocalDailyNotes();let k="";try{k=await t.read(O)||await t.cachedRead(O)}catch(R){console.error(R),new C.Notice(N("Failed to read current daily note, check if it exists."))}const j=c==="end"?"":e.thinoType&&o&&s||r,F=await jI(j,S,k);await t.modify(O,F.content);const B=F.posNum===-1?LI(F.content).length-1:F.posNum+1;return Qe.setChangedByMemos(!0),{id:g.format("YYYYMMDDHHmm")+"00"+B,content:e.content,deletedAt:e.deletedAt??"",createdAt:g.format("YYYY/MM/DD HH:mm:ss"),updatedAt:g.format("YYYY/MM/DD HH:mm:ss"),thinoType:e.thinoType??"JOURNAL",path:O.path,hasId:"",linkId:"",pinned:e.pinned??!1,visibility:"PUBLIC",rowStatus:e.rowStatus??"NORMAL",webId:e.id,creatorName:"Thino",resourceList:[],sourceType:"DAILY"}}async function jI(e,t,n){const r=new RegExp(`s*${await ek(e)}s*`),a=tk(n),o=a.findIndex(p=>r.test(p)),s=(e==null?void 0:e.trim())===""?!0:o===-1;s&&console.error("unable to find insert after line in file.");const c=a.slice(o+1).findIndex(p=>/^#+ |---/.test(p)),d=c!==-1;if(d){let p;for(let m=c+o;m>o;m--)if(!/^[\s\n ]*$/.test(a[m])){p=m;break}return p||(p=o),await Kb(t,n,s?-1:p,d)}else return await Kb(t,n,a.length-1,d)}async function Kb(e,t,n,r){if(n<-1)throw new Error("Invalid position");if(n===-1)return{content:`${t}
${e}`,posNum:-1};const a=t.split(`
`),o=a.slice(0,n+1).join(`
`),s=a.slice(n+1).join(`
`),c=s.trim().length>0;return{content:`${o}${!c&&!r||!o.endsWith(`
`)?`
`:""}${e}${(c||r?`
`:"")+s}`,posNum:n}}const LI=e=>e.split(/\r?\n/);async function ik(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof C.TFile)){new C.Notice(N("File not found for the given thino path"));return}await t.vault.delete(n)}async function sk(e){const t=Ee.getState().dailyNotesState.app,n=t.vault.getAbstractFileByPath(e.path);if(!(n instanceof C.TFile)){new C.Notice(N("File not found for the given thino path"));return}const a=(await t.vault.read(n)).split(`
`),o=a.findIndex(d=>d.includes(e.id));if(o===-1){new C.Notice(N("Thino not found"));return}const s=a.findIndex((d,p)=>p>o&&d.trim()==="");s===-1?a.splice(o,a.length-o):a.splice(o,s-o);const c=a.join(`
`);if(!c){new C.Notice(N("Thino not found"));return}Qe.setChangedByMemos(!0),await t.vault.modify(n,c)}async function lk(e){const t=Ee.getState().dailyNotesState.app,n=t.metadataCache.getFirstLinkpathDest("",e.path);if(!n){new C.Notice(N("File not found for the given thino path"));return}const r=await t.vault.read(n),a=JSON.parse(r),o=a.nodes,s=o.findIndex(m=>m.id===e.id);if(s===-1){new C.Notice(N("Thino not found"));return}o.splice(s,1);const c=a.edges;c.filter(m=>m.fromNode===e.id||m.toNode===e.id).forEach(m=>{const g=c.findIndex(v=>v.id===m.id);g!==-1&&c.splice(g,1)}),Qe.setChangedByMemos(!0);const p=JSON.stringify(a,null,2);await t.vault.modify(n,p)}async function uk(e){OI()||new C.Notice(N("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."),5e3);const{vault:t}=Ee.getState().dailyNotesState.app,n=e.id.toString().slice(0,14),r=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(C.moment(n,"YYYYMMDDHHmmss"))?C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):C.moment(n,"YYYYMMDDHHmmss"),a=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(r,"day"),o=e.path,s=t.getAbstractFileByPath(o);if(!s){new C.Notice(N("Please check your daily note plugin OR periodic notes plugin settings"));return}const c=await t.read(s),d=c.split(`
`),p=a?C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14),m=d.findIndex(S=>S.includes(e.content.replace(/\n/g,"<br>").trim())&&S.includes(p)),g=parseInt(e.id.slice(14));let v=m;m===-1&&(v=g-1);const D=d[m]||d[g-1];if(!c){new C.Notice(N("Thino not found"));return}if(D===d[v]){Qe.setChangedByMemos(!0),d.splice(v,1),await t.modify(s,d.join(`
`));return}}async function ck(){const{vault:e,metadataCache:t}=Ee.getState().dailyNotesState.app,n=Ee.getState().dailyNotesState.settings,a=o1()+"/"+n.DeleteFileName+".md",o=[],s=t.getFirstLinkpathDest("",a);if(s instanceof C.TFile){let c=await e.read(s),d=dk(c);if(d.length===0)return o;for(let p=0;p<d.length;p++){const m=d[p];if(/- /.test(m)){const v=fk(m).slice(0,13),D=C.moment(v,"YYYYMMDDHHmmss"),S=pk(d[p]),T=C.moment(S.slice(0,13),"YYYYMMDDHHmmss"),E=hk(d[p]);o.push({id:S,content:E,user_id:1,createdAt:D.format("YYYY/MM/DD HH:mm:SS"),updatedAt:D.format("YYYY/MM/DD HH:mm:SS"),deletedAt:T})}else continue}d=null,c=null}return o}const dk=e=>e.split(/\r?\n/),fk=e=>{var t;return(t=/^- (\d{14})(\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[1]},hk=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[2]},pk=e=>{var t;return(t=/^- (\d+)\s(.+)\s(deletedAt: )(.+)$/.exec(e))==null?void 0:t[4]};async function mk(e){const t=await _d(Ee.getState().dailyNotesState.app)||[],n=t.findIndex(r=>r.id===e);t.splice(n,1),await Ep(Ee.getState().dailyNotesState.app,t)}const gk=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await _d(t)||[],r=n.find(a=>a.id===e);if(r){const a=C.moment().format("YYYY/MM/DD HH:mm:ss");return r.pinnedAt=a,await Ep(t,n),a}else{new C.Notice(N("Query not found"));return}},yk=async e=>{const{app:t}=Ee.getState().dailyNotesState,n=await _d(t)||[],r=n.find(a=>a.id===e);if(r){r.pinnedAt="",await Ep(t,n);return}else{new C.Notice(N("Query not found"));return}};function vk(e,t){const n=/%%(.*?)%%/,r=e.match(n);if(!r)return e;const a=r[1].trim(),o={};a.split(" ").forEach(c=>{const[d,p]=c.slice(1,-1).split("::");o[d]=p});for(const c of Object.keys(t))if(c!=="id"&&c!=="content"){if(c==="rowStatus"&&t.rowStatus==="ARCHIVED"){o.archived="true";continue}else if(c==="rowStatus"&&t.rowStatus==="NORMAL"){delete o.archived;continue}if(c==="deleted"&&t.deleted){const d=C.moment().format("YYYYMMDDHHmmss");o.deleted=d}else typeof t[c]=="boolean"?t[c]?o[c]="true":delete o[c]:t[c]&&(o[c]=t[c])}const s=Object.entries(o).map(([c,d])=>`[${c}::${d}]`).join(" ");return e.replace(n,`%% ${s} %%`)}async function Fo(e,t){if(!e.sourceType||e.sourceType!=="MULTI")return e;const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=n.getAbstractFileByPath(e.path);if(!a)return e;const o=C.moment();if(await r.processFrontMatter(a,s=>{(t.pinned!==void 0||t.thinoType||t.rowStatus||t.visibility||t.deleted)&&Qe.setChangedByMemos(!0),t.id&&(s.id=t.id),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.webId&&(s.webId=t.webId),t.pinned!==void 0&&(s.pinned=t.pinned),t.deleted!==void 0&&(s.deletedAt=t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):""),s.createdAt||(s.createdAt=o.format("YYYY/MM/DD HH:mm:ss")),s.updatedAt=o.format("YYYY/MM/DD HH:mm:ss")}),t.content){const s=await n.read(a);let c=s;const d=t.content.replace(/\$/g,"$$$$");c=s.replace(e.content,d),await n.modify(a,c)}return Qe.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||o.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?o.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Di(e,t){if(!e.sourceType||e.sourceType!=="FILE")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=C.moment();let o="";try{o=await n.read(r)}catch(O){console.error(O),o=await n.cachedRead(r)}const s=o.split(/\r?\n/),c=s.findIndex(O=>O.includes(e.id)||e.webId&&O.includes(e.webId)),d=s[c];if(!d)return e;const p=vk(d,t);if(!d)return e;const m=p+`
`,g=s.findIndex((O,k)=>k>c&&O.trim()==="");let v="";g===-1&&(v=s.slice(c+1).join(`
`)),g!==-1&&(v=s.slice(c+1,g).join(`
`));let D=v;t!=null&&t.content&&(D=t.content.split(/\r?\n/).map(F=>"> "+F).join(`
`));const T=(m+D).split(/\r?\n/);s.splice(c,g?g-c:s.length-c,...T);const E=s.join(`
`);return await n.modify(r,E),Qe.setChangedByMemos(!0),{...e,id:t.id||e.id,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt||a.format("YYYY/MM/DD HH:mm:ss"),updatedAt:e.updatedAt,content:t.content||e.content,rowStatus:t.rowStatus||e.rowStatus,visibility:t.visibility||e.visibility,pinned:t.pinned!==void 0?t.pinned:e.pinned,webId:t.webId||e.webId,deletedAt:t.deleted?a.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Si(e,t){if(!e.sourceType||e.sourceType!=="CANVAS")return e;const{vault:n}=Ee.getState().dailyNotesState.app,r=n.getAbstractFileByPath(e.path);if(!r)return e;const a=await n.read(r),o=JSON.parse(a),s=o.nodes.find(p=>p.id===e.id);if(!s)return e;t.content&&(s.text=t.content),t.thinoType&&(s.thinoType=t.thinoType),t.rowStatus&&(s.rowStatus=t.rowStatus),t.visibility&&(s.visibility=t.visibility),t.pinned!==void 0&&(s.pinned=t.pinned),t.webId&&(s.webId=t.webId);const c=C.moment();t.deleted!==void 0&&(s.deletedAt=t.deleted?c.format("YYYY/MM/DD HH:mm:ss"):""),s.updatedAt=c.format("YYYY/MM/DD HH:mm:ss");const d=JSON.stringify(o,null,2);return await n.modify(r,d),Qe.setChangedByMemos(!0),{...e,thinoType:t.thinoType||e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?c.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}}async function Ii(e,t){OI()||new C.Notice(N("If you are disabling the daily note plugin, it would be possible that the thino will not be deleted or patched properly. Please enable the plugin and try again."));const{vault:n}=Ee.getState().dailyNotesState.app,{settings:r}=Ee.getState().dailyNotesState,a=e.id.toString().slice(0,14),o=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(C.moment(a,"YYYYMMDDHHmmss"))?C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"):C.moment(a,"YYYYMMDDHHmmss"),s=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(o,"day"),c=e.path,d=n.getAbstractFileByPath(c)||n.getAbstractFileByPath(e.path);if(!d)return new C.Notice(N("Please check your daily note plugin OR periodic notes plugin settings")),e;const m=(await n.read(d)).split(`
`),g=s?C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm"):(parseInt(e.id.toString().slice(10,12))+24).toString()+":"+e.id.toString().slice(12,14);let v,D,S;try{v=m.findIndex(j=>{const F=j.replace(/^(-|\*|\d\.|-\s\[.?\])\s\d{2}:\d{2}(:\d{2})?/,"").trim(),B=e.content.replace(/\n/g,"<br>").trim(),R=j.includes(g),z=F.includes(B);return R&&(z||F===B)}),S=!1,D=parseInt(e.id.slice(14))}catch(j){console.error(j)}let T=v!==-1&&v===D?v:D;v===-1&&(T=D,m[D-1]&&(S=!0));let E=m[D]||m[v];if(E=E.replace(/\s\^([0-9a-zA-Z-]+)$/g,""),!E)return new C.Notice(N("Thino not found")),e;let O=g;if(r.DefaultTimePrefix!=="HH:mm"&&(O=C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format(r.DefaultTimePrefix)),t.content)if(S){const j=e.thinoType==="TASK-TODO"?"- [ ] ":e.thinoType==="TASK-DONE"?"- [x] ":e.thinoType.startsWith("TASK")?`- [${e.thinoType.slice(5)}] `:"- ",F=(e.pinned?" [pinned::true]":"")+(e.rowStatus==="ARCHIVED"?" [archived::true]":"")+(e.visibility==="PUBLIC"?' [visibility::"PUBLIC"]':"");E=`${j}${O} ${t.content.trim()} ${F}`}else{const j=/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2}(:\d{2})?)/.exec(E)[1];E=E.replace(/^(((-|\*)|(\d\.)|(-\s\[.?\]))\s\d{2}:\d{2}(:\d{2})?)/,"").replace(e.content.trim().replace(/\n/g,"<br>"),t.content.trim().replace(/\n/g,"<br>")).trim(),E=j+" "+E}if(t.thinoType){const j=t.thinoType==="TASK-TODO"?"- [ ] ":t.thinoType==="TASK-DONE"?"- [x] ":t.thinoType.startsWith("TASK")?`- [${t.thinoType.slice(5)}] `:"- ";E=E.replace(/^((- \[.\] )|((-|\*) ))/,j)}if(t.rowStatus){const j=t.rowStatus==="ARCHIVED"?"[archived::"+(t.rowStatus==="ARCHIVED"?"true":"false")+"]":"";E=E.includes("[archived::")?E.replace(/\[archived::(true|false)\]/,j):E+" "+j}if(t.visibility){const j='[visibility::"'+t.visibility+'"]';E=E.includes("[visibility::")?E.replace(/\[visibility::"(PUBLIC|PROTECTED)"\]/g,j):E+" "+j}if(t.pinned!==void 0){const j=t.pinned?"[pinned::"+(t.pinned?"true":"false")+"]":"";E=E.includes("[pinned::")?E.replace(/\[pinned::(true|false)\]/,t.pinned===!1?"":j):E+" "+j}if(t.webId!==void 0){const j="[webId::"+t.webId+"]";E=E.includes("[webId::")?E.replace(/\[webId::([^\]]+)\]/,t.webId===""?"":j):E+" "+j}const k=C.moment();if(t.deleted!==void 0){const j="[deleted::"+k.format("YYYYMMDDHHmmss")+"]";t.deleted?(E=E.replace(/\[deleted::([^\]]+)\]/,""),E=E+" "+j):t.deleted===!1&&(E=E.replace(/\[deleted::([^\]]+)\]/,""))}if(e.hasId){const j=" ^"+e.hasId;E=E.replace(/\s\^([0-9a-zA-Z-]+)$/g,"")+j}return E!==m[T]?(m.splice(T,1,E),await n.modify(d,m.join(`
`)),Qe.setChangedByMemos(!0),{...e,thinoType:t.thinoType??e.thinoType,createdAt:e.createdAt,updatedAt:e.updatedAt,content:t.content??e.content,rowStatus:t.rowStatus??e.rowStatus,visibility:t.visibility??e.visibility,pinned:t.pinned??e.pinned,webId:t.webId??e.webId,deletedAt:t.deleted?k.format("YYYY/MM/DD HH:mm:ss"):t.deleted===!1?"":e.deletedAt?e.deletedAt:""}):e}const wk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Si(e,{id:e.id,pinned:!0});case"DAILY":return Ii(e,{id:e.id,pinned:!0});case"MULTI":return Fo(e,{id:e.id,pinned:!0});case"FILE":return Di(e,{id:e.id,pinned:!0})}},bk=e=>{switch(e==null?void 0:e.sourceType){case"CANVAS":return Si(e,{id:e.id,pinned:!1});case"DAILY":return Ii(e,{id:e.id,pinned:!1});case"MULTI":return Fo(e,{id:e.id,pinned:!1});case"FILE":return Di(e,{id:e.id,pinned:!1})}};var vw;(e=>{async function t(T){return await Gb(T)}e.getMyMemos=t;async function n(T){return await Gb([T])}e.updateSpecificTypeMemo=n;function r(){return ck()}e.getMyDeletedMemos=r;function a(T){const E=Te.getMemoById(T);if(E)switch(E==null?void 0:E.sourceType){case"DAILY":return Ii(E,{id:E.id,deleted:!1});case"CANVAS":return Si(E,{id:E.id,deleted:!1});case"MULTI":return Fo(E,{id:E.id,deleted:!1});case"FILE":return Di(E,{id:E.id,deleted:!1})}}e.restoreMemo=a;function o(T){return sk(T)}e.deleteMemoInSingleFile=o;function s(T){return ik(T)}e.deleteMemoInMultiFiles=s;function c(T){return uk(T)}e.deleteMemoInDailyNote=c;function d(T){return lk(T)}e.deleteMemoInCanvas=d;function p(){return FN()}e.getMyQueries=p;async function m(T,E){return await PN(T,E)}e.createQuery=m;function g(T,E,O){return XN(T,E,O)}e.updateQuery=g;function v(T){return mk(T)}e.deleteQueryById=v;function D(T){return gk(T)}e.pinQuery=D;function S(T){return yk(T)}e.unpinQuery=S})(vw||(vw={}));const ya=vw;var Ds={};Object.defineProperty(Ds,"__esModule",{value:!0});class Hu extends Error{}class Dk extends Hu{constructor(t){super(`Invalid DateTime: ${t.toMessage()}`)}}class Sk extends Hu{constructor(t){super(`Invalid Interval: ${t.toMessage()}`)}}class Ik extends Hu{constructor(t){super(`Invalid Duration: ${t.toMessage()}`)}}class Yh extends Hu{}class RI extends Hu{constructor(t){super(`Invalid unit ${t}`)}}class oo extends Hu{}class ul extends Hu{constructor(){super("Zone is an abstract class")}}const $e="numeric",jo="short",Ya="long",sy={year:$e,month:$e,day:$e},BI={year:$e,month:jo,day:$e},Tk={year:$e,month:jo,day:$e,weekday:jo},_I={year:$e,month:Ya,day:$e},HI={year:$e,month:Ya,day:$e,weekday:Ya},YI={hour:$e,minute:$e},zI={hour:$e,minute:$e,second:$e},UI={hour:$e,minute:$e,second:$e,timeZoneName:jo},VI={hour:$e,minute:$e,second:$e,timeZoneName:Ya},ZI={hour:$e,minute:$e,hourCycle:"h23"},WI={hour:$e,minute:$e,second:$e,hourCycle:"h23"},$I={hour:$e,minute:$e,second:$e,hourCycle:"h23",timeZoneName:jo},GI={hour:$e,minute:$e,second:$e,hourCycle:"h23",timeZoneName:Ya},qI={year:$e,month:$e,day:$e,hour:$e,minute:$e},JI={year:$e,month:$e,day:$e,hour:$e,minute:$e,second:$e},KI={year:$e,month:jo,day:$e,hour:$e,minute:$e},QI={year:$e,month:jo,day:$e,hour:$e,minute:$e,second:$e},Ek={year:$e,month:jo,day:$e,weekday:jo,hour:$e,minute:$e},XI={year:$e,month:Ya,day:$e,hour:$e,minute:$e,timeZoneName:jo},eT={year:$e,month:Ya,day:$e,hour:$e,minute:$e,second:$e,timeZoneName:jo},tT={year:$e,month:Ya,day:$e,weekday:Ya,hour:$e,minute:$e,timeZoneName:Ya},nT={year:$e,month:Ya,day:$e,weekday:Ya,hour:$e,minute:$e,second:$e,timeZoneName:Ya};class Cp{get type(){throw new ul}get name(){throw new ul}get ianaName(){return this.name}get isUniversal(){throw new ul}offsetName(t,n){throw new ul}formatOffset(t,n){throw new ul}offset(t){throw new ul}equals(t){throw new ul}get isValid(){throw new ul}}let S0=null;class Py extends Cp{static get instance(){return S0===null&&(S0=new Py),S0}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return aT(t,n,r)}formatOffset(t,n){return Gh(this.offset(t),n)}offset(t){return-new Date(t).getTimezoneOffset()}equals(t){return t.type==="system"}get isValid(){return!0}}let Gg={};function Ck(e){return Gg[e]||(Gg[e]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Gg[e]}const xk={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Mk(e,t){const n=e.format(t).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,a,o,s,c,d,p,m]=r;return[s,a,o,c,d,p,m]}function Nk(e,t){const n=e.formatToParts(t),r=[];for(let a=0;a<n.length;a++){const{type:o,value:s}=n[a],c=xk[o];o==="era"?r[c]=s:_t(c)||(r[c]=parseInt(s,10))}return r}let Cg={};class ps extends Cp{static create(t){return Cg[t]||(Cg[t]=new ps(t)),Cg[t]}static resetCache(){Cg={},Gg={}}static isValidSpecifier(t){return this.isValidZone(t)}static isValidZone(t){if(!t)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:t}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=ps.isValidZone(t)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(t,{format:n,locale:r}){return aT(t,n,r,this.name)}formatOffset(t,n){return Gh(this.offset(t),n)}offset(t){const n=new Date(t);if(isNaN(n))return NaN;const r=Ck(this.name);let[a,o,s,c,d,p,m]=r.formatToParts?Nk(r,n):Mk(r,n);c==="BC"&&(a=-Math.abs(a)+1);const v=l1({year:a,month:o,day:s,hour:d===24?0:d,minute:p,second:m,millisecond:0});let D=+n;const S=D%1e3;return D-=S>=0?S:1e3+S,(v-D)/(60*1e3)}equals(t){return t.type==="iana"&&t.name===this.name}get isValid(){return this.valid}}let Qb={};function kk(e,t={}){const n=JSON.stringify([e,t]);let r=Qb[n];return r||(r=new Intl.ListFormat(e,t),Qb[n]=r),r}let ww={};function bw(e,t={}){const n=JSON.stringify([e,t]);let r=ww[n];return r||(r=new Intl.DateTimeFormat(e,t),ww[n]=r),r}let Dw={};function Ak(e,t={}){const n=JSON.stringify([e,t]);let r=Dw[n];return r||(r=new Intl.NumberFormat(e,t),Dw[n]=r),r}let Sw={};function Fk(e,t={}){const{base:n,...r}=t,a=JSON.stringify([e,r]);let o=Sw[a];return o||(o=new Intl.RelativeTimeFormat(e,t),Sw[a]=o),o}let zh=null;function Ok(){return zh||(zh=new Intl.DateTimeFormat().resolvedOptions().locale,zh)}function Pk(e){const t=e.indexOf("-x-");t!==-1&&(e=e.substring(0,t));const n=e.indexOf("-u-");if(n===-1)return[e];{let r,a;try{r=bw(e).resolvedOptions(),a=e}catch{const d=e.substring(0,n);r=bw(d).resolvedOptions(),a=d}const{numberingSystem:o,calendar:s}=r;return[a,o,s]}}function jk(e,t,n){return(n||t)&&(e.includes("-u-")||(e+="-u"),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`)),e}function Lk(e){const t=[];for(let n=1;n<=12;n++){const r=st.utc(2016,n,1);t.push(e(r))}return t}function Rk(e){const t=[];for(let n=1;n<=7;n++){const r=st.utc(2016,11,13+n);t.push(e(r))}return t}function xg(e,t,n,r,a){const o=e.listingMode(n);return o==="error"?null:o==="en"?r(t):a(t)}function Bk(e){return e.numberingSystem&&e.numberingSystem!=="latn"?!1:e.numberingSystem==="latn"||!e.locale||e.locale.startsWith("en")||new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem==="latn"}class _k{constructor(t,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:a,floor:o,...s}=r;if(!n||Object.keys(s).length>0){const c={useGrouping:!1,...r};r.padTo>0&&(c.minimumIntegerDigits=r.padTo),this.inf=Ak(t,c)}}format(t){if(this.inf){const n=this.floor?Math.floor(t):t;return this.inf.format(n)}else{const n=this.floor?Math.floor(t):s1(t,3);return Wn(n,this.padTo)}}}class Hk{constructor(t,n,r){this.opts=r;let a;if(t.zone.isUniversal){const s=-1*(t.offset/60),c=s>=0?`Etc/GMT+${s}`:`Etc/GMT${s}`;t.offset!==0&&ps.create(c).valid?(a=c,this.dt=t):(a="UTC",r.timeZoneName?this.dt=t:this.dt=t.offset===0?t:st.fromMillis(t.ts+t.offset*60*1e3))}else t.zone.type==="system"?this.dt=t:(this.dt=t,a=t.zone.name);const o={...this.opts};o.timeZone=o.timeZone||a,this.dtf=bw(n,o)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Yk{constructor(t,n,r){this.opts={style:"long",...r},!n&&rT()&&(this.rtf=Fk(t,r))}format(t,n){return this.rtf?this.rtf.format(t,n):aA(n,t,this.opts.numeric,this.opts.style!=="long")}formatToParts(t,n){return this.rtf?this.rtf.formatToParts(t,n):[]}}class hn{static fromOpts(t){return hn.create(t.locale,t.numberingSystem,t.outputCalendar,t.defaultToEN)}static create(t,n,r,a=!1){const o=t||Zn.defaultLocale,s=o||(a?"en-US":Ok()),c=n||Zn.defaultNumberingSystem,d=r||Zn.defaultOutputCalendar;return new hn(s,c,d,o)}static resetCache(){zh=null,ww={},Dw={},Sw={}}static fromObject({locale:t,numberingSystem:n,outputCalendar:r}={}){return hn.create(t,n,r)}constructor(t,n,r,a){const[o,s,c]=Pk(t);this.locale=o,this.numberingSystem=n||s||null,this.outputCalendar=r||c||null,this.intl=jk(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=a,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Bk(this)),this.fastNumbersCached}listingMode(){const t=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return t&&n?"en":"intl"}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:hn.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,t.defaultToEN||!1)}redefaultToEN(t={}){return this.clone({...t,defaultToEN:!0})}redefaultToSystem(t={}){return this.clone({...t,defaultToEN:!1})}months(t,n=!1,r=!0){return xg(this,t,r,sT,()=>{const a=n?{month:t,day:"numeric"}:{month:t},o=n?"format":"standalone";return this.monthsCache[o][t]||(this.monthsCache[o][t]=Lk(s=>this.extract(s,a,"month"))),this.monthsCache[o][t]})}weekdays(t,n=!1,r=!0){return xg(this,t,r,cT,()=>{const a=n?{weekday:t,year:"numeric",month:"long",day:"numeric"}:{weekday:t},o=n?"format":"standalone";return this.weekdaysCache[o][t]||(this.weekdaysCache[o][t]=Rk(s=>this.extract(s,a,"weekday"))),this.weekdaysCache[o][t]})}meridiems(t=!0){return xg(this,void 0,t,()=>dT,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[st.utc(2016,11,13,9),st.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(t,n=!0){return xg(this,t,n,fT,()=>{const r={era:t};return this.eraCache[t]||(this.eraCache[t]=[st.utc(-40,1,1),st.utc(2017,1,1)].map(a=>this.extract(a,r,"era"))),this.eraCache[t]})}extract(t,n,r){const a=this.dtFormatter(t,n),o=a.formatToParts(),s=o.find(c=>c.type.toLowerCase()===r);return s?s.value:null}numberFormatter(t={}){return new _k(this.intl,t.forceSimple||this.fastNumbers,t)}dtFormatter(t,n={}){return new Hk(t,this.intl,n)}relFormatter(t={}){return new Yk(this.intl,this.isEnglish(),t)}listFormatter(t={}){return kk(this.intl,t)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(t){return this.locale===t.locale&&this.numberingSystem===t.numberingSystem&&this.outputCalendar===t.outputCalendar}}let I0=null;class Xr extends Cp{static get utcInstance(){return I0===null&&(I0=new Xr(0)),I0}static instance(t){return t===0?Xr.utcInstance:new Xr(t)}static parseSpecifier(t){if(t){const n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Xr(Ly(n[1],n[2]))}return null}constructor(t){super(),this.fixed=t}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Gh(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Gh(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(t,n){return Gh(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(t){return t.type==="fixed"&&t.fixed===this.fixed}get isValid(){return!0}}class zk extends Cp{constructor(t){super(),this.zoneName=t}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function yl(e,t){if(_t(e)||e===null)return t;if(e instanceof Cp)return e;if(Uk(e)){const n=e.toLowerCase();return n==="default"?t:n==="local"||n==="system"?Py.instance:n==="utc"||n==="gmt"?Xr.utcInstance:Xr.parseSpecifier(n)||ps.create(e)}else return xu(e)?Xr.instance(e):typeof e=="object"&&e.offset&&typeof e.offset=="number"?e:new zk(e)}let Xb=()=>Date.now(),eD="system",tD=null,nD=null,rD=null,aD=60,oD;class Zn{static get now(){return Xb}static set now(t){Xb=t}static set defaultZone(t){eD=t}static get defaultZone(){return yl(eD,Py.instance)}static get defaultLocale(){return tD}static set defaultLocale(t){tD=t}static get defaultNumberingSystem(){return nD}static set defaultNumberingSystem(t){nD=t}static get defaultOutputCalendar(){return rD}static set defaultOutputCalendar(t){rD=t}static get twoDigitCutoffYear(){return aD}static set twoDigitCutoffYear(t){aD=t%100}static get throwOnInvalid(){return oD}static set throwOnInvalid(t){oD=t}static resetCaches(){hn.resetCache(),ps.resetCache()}}function _t(e){return typeof e>"u"}function xu(e){return typeof e=="number"}function jy(e){return typeof e=="number"&&e%1===0}function Uk(e){return typeof e=="string"}function Vk(e){return Object.prototype.toString.call(e)==="[object Date]"}function rT(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Zk(e){return Array.isArray(e)?e:[e]}function iD(e,t,n){if(e.length!==0)return e.reduce((r,a)=>{const o=[t(a),a];return r&&n(r[0],o[0])===r[0]?r:o},null)[1]}function Wk(e,t){return t.reduce((n,r)=>(n[r]=e[r],n),{})}function Md(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function hs(e,t,n){return jy(e)&&e>=t&&e<=n}function $k(e,t){return e-t*Math.floor(e/t)}function Wn(e,t=2){const n=e<0;let r;return n?r="-"+(""+-e).padStart(t,"0"):r=(""+e).padStart(t,"0"),r}function gl(e){if(!(_t(e)||e===null||e===""))return parseInt(e,10)}function bu(e){if(!(_t(e)||e===null||e===""))return parseFloat(e)}function i1(e){if(!(_t(e)||e===null||e==="")){const t=parseFloat("0."+e)*1e3;return Math.floor(t)}}function s1(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function xp(e){return e%4===0&&(e%100!==0||e%400===0)}function $h(e){return xp(e)?366:365}function ly(e,t){const n=$k(t-1,12)+1,r=e+(t-n)/12;return n===2?xp(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function l1(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function uy(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return t===4||r===3?53:52}function Iw(e){return e>99?e:e>Zn.twoDigitCutoffYear?1900+e:2e3+e}function aT(e,t,n,r=null){const a=new Date(e),o={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(o.timeZone=r);const s={timeZoneName:t,...o},c=new Intl.DateTimeFormat(n,s).formatToParts(a).find(d=>d.type.toLowerCase()==="timezonename");return c?c.value:null}function Ly(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0,a=n<0||Object.is(n,-0)?-r:r;return n*60+a}function oT(e){const t=Number(e);if(typeof e=="boolean"||e===""||Number.isNaN(t))throw new oo(`Invalid unit value ${e}`);return t}function cy(e,t){const n={};for(const r in e)if(Md(e,r)){const a=e[r];if(a==null)continue;n[t(r)]=oT(a)}return n}function Gh(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),a=e>=0?"+":"-";switch(t){case"short":return`${a}${Wn(n,2)}:${Wn(r,2)}`;case"narrow":return`${a}${n}${r>0?`:${r}`:""}`;case"techie":return`${a}${Wn(n,2)}${Wn(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function Ry(e){return Wk(e,["hour","minute","second","millisecond"])}const Gk=["January","February","March","April","May","June","July","August","September","October","November","December"],iT=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],qk=["J","F","M","A","M","J","J","A","S","O","N","D"];function sT(e){switch(e){case"narrow":return[...qk];case"short":return[...iT];case"long":return[...Gk];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const lT=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],uT=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Jk=["M","T","W","T","F","S","S"];function cT(e){switch(e){case"narrow":return[...Jk];case"short":return[...uT];case"long":return[...lT];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const dT=["AM","PM"],Kk=["Before Christ","Anno Domini"],Qk=["BC","AD"],Xk=["B","A"];function fT(e){switch(e){case"narrow":return[...Xk];case"short":return[...Qk];case"long":return[...Kk];default:return null}}function eA(e){return dT[e.hour<12?0:1]}function tA(e,t){return cT(t)[e.weekday-1]}function nA(e,t){return sT(t)[e.month-1]}function rA(e,t){return fT(t)[e.year<0?0:1]}function aA(e,t,n="always",r=!1){const a={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},o=["hours","minutes","seconds"].indexOf(e)===-1;if(n==="auto"&&o){const g=e==="days";switch(t){case 1:return g?"tomorrow":`next ${a[e][0]}`;case-1:return g?"yesterday":`last ${a[e][0]}`;case 0:return g?"today":`this ${a[e][0]}`}}const s=Object.is(t,-0)||t<0,c=Math.abs(t),d=c===1,p=a[e],m=r?d?p[1]:p[2]||p[1]:d?a[e][0]:e;return s?`${c} ${m} ago`:`in ${c} ${m}`}function sD(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const oA={D:sy,DD:BI,DDD:_I,DDDD:HI,t:YI,tt:zI,ttt:UI,tttt:VI,T:ZI,TT:WI,TTT:$I,TTTT:GI,f:qI,ff:KI,fff:XI,ffff:tT,F:JI,FF:QI,FFF:eT,FFFF:nT};class Hr{static create(t,n={}){return new Hr(t,n)}static parseFormat(t){let n=null,r="",a=!1;const o=[];for(let s=0;s<t.length;s++){const c=t.charAt(s);c==="'"?(r.length>0&&o.push({literal:a,val:r}),n=null,r="",a=!a):a||c===n?r+=c:(r.length>0&&o.push({literal:!1,val:r}),r=c,n=c)}return r.length>0&&o.push({literal:a,val:r}),o}static macroTokenToFormatOpts(t){return oA[t]}constructor(t,n){this.opts=n,this.loc=t,this.systemLoc=null}formatWithSystemDefault(t,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTime(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).format()}formatDateTimeParts(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).formatToParts()}formatInterval(t,n={}){return this.loc.dtFormatter(t.start,{...this.opts,...n}).dtf.formatRange(t.start.toJSDate(),t.end.toJSDate())}resolvedOptions(t,n={}){return this.loc.dtFormatter(t,{...this.opts,...n}).resolvedOptions()}num(t,n=0){if(this.opts.forceSimple)return Wn(t,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(t)}formatDateTimeFromString(t,n){const r=this.loc.listingMode()==="en",a=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",o=(D,S)=>this.loc.extract(t,D,S),s=D=>t.isOffsetFixed&&t.offset===0&&D.allowZ?"Z":t.isValid?t.zone.formatOffset(t.ts,D.format):"",c=()=>r?eA(t):o({hour:"numeric",hourCycle:"h12"},"dayperiod"),d=(D,S)=>r?nA(t,D):o(S?{month:D}:{month:D,day:"numeric"},"month"),p=(D,S)=>r?tA(t,D):o(S?{weekday:D}:{weekday:D,month:"long",day:"numeric"},"weekday"),m=D=>{const S=Hr.macroTokenToFormatOpts(D);return S?this.formatWithSystemDefault(t,S):D},g=D=>r?rA(t,D):o({era:D},"era"),v=D=>{switch(D){case"S":return this.num(t.millisecond);case"u":case"SSS":return this.num(t.millisecond,3);case"s":return this.num(t.second);case"ss":return this.num(t.second,2);case"uu":return this.num(Math.floor(t.millisecond/10),2);case"uuu":return this.num(Math.floor(t.millisecond/100));case"m":return this.num(t.minute);case"mm":return this.num(t.minute,2);case"h":return this.num(t.hour%12===0?12:t.hour%12);case"hh":return this.num(t.hour%12===0?12:t.hour%12,2);case"H":return this.num(t.hour);case"HH":return this.num(t.hour,2);case"Z":return s({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return s({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return s({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return t.zone.offsetName(t.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return t.zone.offsetName(t.ts,{format:"long",locale:this.loc.locale});case"z":return t.zoneName;case"a":return c();case"d":return a?o({day:"numeric"},"day"):this.num(t.day);case"dd":return a?o({day:"2-digit"},"day"):this.num(t.day,2);case"c":return this.num(t.weekday);case"ccc":return p("short",!0);case"cccc":return p("long",!0);case"ccccc":return p("narrow",!0);case"E":return this.num(t.weekday);case"EEE":return p("short",!1);case"EEEE":return p("long",!1);case"EEEEE":return p("narrow",!1);case"L":return a?o({month:"numeric",day:"numeric"},"month"):this.num(t.month);case"LL":return a?o({month:"2-digit",day:"numeric"},"month"):this.num(t.month,2);case"LLL":return d("short",!0);case"LLLL":return d("long",!0);case"LLLLL":return d("narrow",!0);case"M":return a?o({month:"numeric"},"month"):this.num(t.month);case"MM":return a?o({month:"2-digit"},"month"):this.num(t.month,2);case"MMM":return d("short",!1);case"MMMM":return d("long",!1);case"MMMMM":return d("narrow",!1);case"y":return a?o({year:"numeric"},"year"):this.num(t.year);case"yy":return a?o({year:"2-digit"},"year"):this.num(t.year.toString().slice(-2),2);case"yyyy":return a?o({year:"numeric"},"year"):this.num(t.year,4);case"yyyyyy":return a?o({year:"numeric"},"year"):this.num(t.year,6);case"G":return g("short");case"GG":return g("long");case"GGGGG":return g("narrow");case"kk":return this.num(t.weekYear.toString().slice(-2),2);case"kkkk":return this.num(t.weekYear,4);case"W":return this.num(t.weekNumber);case"WW":return this.num(t.weekNumber,2);case"o":return this.num(t.ordinal);case"ooo":return this.num(t.ordinal,3);case"q":return this.num(t.quarter);case"qq":return this.num(t.quarter,2);case"X":return this.num(Math.floor(t.ts/1e3));case"x":return this.num(t.ts);default:return m(D)}};return sD(Hr.parseFormat(n),v)}formatDurationFromString(t,n){const r=d=>{switch(d[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},a=d=>p=>{const m=r(p);return m?this.num(d.get(m),p.length):p},o=Hr.parseFormat(n),s=o.reduce((d,{literal:p,val:m})=>p?d:d.concat(m),[]),c=t.shiftTo(...s.map(r).filter(d=>d));return sD(o,a(c))}}class Oo{constructor(t,n){this.reason=t,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const hT=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function Hd(...e){const t=e.reduce((n,r)=>n+r.source,"");return RegExp(`^${t}$`)}function Yd(...e){return t=>e.reduce(([n,r,a],o)=>{const[s,c,d]=o(t,a);return[{...n,...s},c||r,d]},[{},null,1]).slice(0,2)}function zd(e,...t){if(e==null)return[null,null];for(const[n,r]of t){const a=n.exec(e);if(a)return r(a)}return[null,null]}function pT(...e){return(t,n)=>{const r={};let a;for(a=0;a<e.length;a++)r[e[a]]=gl(t[n+a]);return[r,null,n+a]}}const mT=/(?:(Z)|([+-]\d\d)(?::?(\d\d))?)/,iA=`(?:${mT.source}?(?:\\[(${hT.source})\\])?)?`,u1=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,gT=RegExp(`${u1.source}${iA}`),c1=RegExp(`(?:T${gT.source})?`),sA=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,lA=/(\d{4})-?W(\d\d)(?:-?(\d))?/,uA=/(\d{4})-?(\d{3})/,cA=pT("weekYear","weekNumber","weekDay"),dA=pT("year","ordinal"),fA=/(\d{4})-(\d\d)-(\d\d)/,yT=RegExp(`${u1.source} ?(?:${mT.source}|(${hT.source}))?`),hA=RegExp(`(?: ${yT.source})?`);function Ed(e,t,n){const r=e[t];return _t(r)?n:gl(r)}function pA(e,t){return[{year:Ed(e,t),month:Ed(e,t+1,1),day:Ed(e,t+2,1)},null,t+3]}function Ud(e,t){return[{hours:Ed(e,t,0),minutes:Ed(e,t+1,0),seconds:Ed(e,t+2,0),milliseconds:i1(e[t+3])},null,t+4]}function Mp(e,t){const n=!e[t]&&!e[t+1],r=Ly(e[t+1],e[t+2]),a=n?null:Xr.instance(r);return[{},a,t+3]}function Np(e,t){const n=e[t]?ps.create(e[t]):null;return[{},n,t+1]}const mA=RegExp(`^T?${u1.source}$`),gA=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function yA(e){const[t,n,r,a,o,s,c,d,p]=e,m=t[0]==="-",g=d&&d[0]==="-",v=(D,S=!1)=>D!==void 0&&(S||D&&m)?-D:D;return[{years:v(bu(n)),months:v(bu(r)),weeks:v(bu(a)),days:v(bu(o)),hours:v(bu(s)),minutes:v(bu(c)),seconds:v(bu(d),d==="-0"),milliseconds:v(i1(p),g)}]}const vA={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function d1(e,t,n,r,a,o,s){const c={year:t.length===2?Iw(gl(t)):gl(t),month:iT.indexOf(n)+1,day:gl(r),hour:gl(a),minute:gl(o)};return s&&(c.second=gl(s)),e&&(c.weekday=e.length>3?lT.indexOf(e)+1:uT.indexOf(e)+1),c}const wA=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function bA(e){const[,t,n,r,a,o,s,c,d,p,m,g]=e,v=d1(t,a,r,n,o,s,c);let D;return d?D=vA[d]:p?D=0:D=Ly(m,g),[v,new Xr(D)]}function DA(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const SA=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,IA=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,TA=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function lD(e){const[,t,n,r,a,o,s,c]=e;return[d1(t,a,r,n,o,s,c),Xr.utcInstance]}function EA(e){const[,t,n,r,a,o,s,c]=e;return[d1(t,c,n,r,a,o,s),Xr.utcInstance]}const CA=Hd(sA,c1),xA=Hd(lA,c1),MA=Hd(uA,c1),NA=Hd(gT),vT=Yd(pA,Ud,Mp,Np),kA=Yd(cA,Ud,Mp,Np),AA=Yd(dA,Ud,Mp,Np),FA=Yd(Ud,Mp,Np);function OA(e){return zd(e,[CA,vT],[xA,kA],[MA,AA],[NA,FA])}function PA(e){return zd(DA(e),[wA,bA])}function jA(e){return zd(e,[SA,lD],[IA,lD],[TA,EA])}function LA(e){return zd(e,[gA,yA])}const RA=Yd(Ud);function BA(e){return zd(e,[mA,RA])}const _A=Hd(fA,hA),HA=Hd(yT),YA=Yd(Ud,Mp,Np);function zA(e){return zd(e,[_A,vT],[HA,YA])}const UA="Invalid Duration",wT={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},VA={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...wT},ao=146097/400,md=146097/4800,ZA={years:{quarters:4,months:12,weeks:ao/7,days:ao,hours:ao*24,minutes:ao*24*60,seconds:ao*24*60*60,milliseconds:ao*24*60*60*1e3},quarters:{months:3,weeks:ao/28,days:ao/4,hours:ao*24/4,minutes:ao*24*60/4,seconds:ao*24*60*60/4,milliseconds:ao*24*60*60*1e3/4},months:{weeks:md/7,days:md,hours:md*24,minutes:md*24*60,seconds:md*24*60*60,milliseconds:md*24*60*60*1e3},...wT},Du=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],WA=Du.slice(0).reverse();function cl(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix};return new tt(r)}function $A(e){return e<0?Math.floor(e):Math.ceil(e)}function bT(e,t,n,r,a){const o=e[a][n],s=t[n]/o,c=Math.sign(s)===Math.sign(r[a]),d=!c&&r[a]!==0&&Math.abs(s)<=1?$A(s):Math.trunc(s);r[a]+=d,t[n]-=d*o}function GA(e,t){WA.reduce((n,r)=>_t(t[r])?n:(n&&bT(e,t,n,t,r),r),null)}function qA(e){const t={};for(const[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}class tt{constructor(t){const n=t.conversionAccuracy==="longterm"||!1;let r=n?ZA:VA;t.matrix&&(r=t.matrix),this.values=t.values,this.loc=t.loc||hn.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=t.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(t,n){return tt.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(t==null||typeof t!="object")throw new oo(`Duration.fromObject: argument expected to be an object, got ${t===null?"null":typeof t}`);return new tt({values:cy(t,tt.normalizeUnit),loc:hn.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(xu(t))return tt.fromMillis(t);if(tt.isDuration(t))return t;if(typeof t=="object")return tt.fromObject(t);throw new oo(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){const[r]=LA(t);return r?tt.fromObject(r,n):tt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){const[r]=BA(t);return r?tt.fromObject(r,n):tt.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new oo("need to specify a reason the Duration is invalid");const r=t instanceof Oo?t:new Oo(t,n);if(Zn.throwOnInvalid)throw new Ik(r);return new tt({invalid:r})}static normalizeUnit(t){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[t&&t.toLowerCase()];if(!n)throw new RI(t);return n}static isDuration(t){return t&&t.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(t,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?Hr.create(this.loc,r).formatDurationFromString(this,t):UA}toHuman(t={}){const n=Du.map(r=>{const a=this.values[r];return _t(a)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...t,unit:r.slice(0,-1)}).format(a)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:t.listStyle||"narrow",...t}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let t="P";return this.years!==0&&(t+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(t+=this.months+this.quarters*3+"M"),this.weeks!==0&&(t+=this.weeks+"W"),this.days!==0&&(t+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(t+="T"),this.hours!==0&&(t+=this.hours+"H"),this.minutes!==0&&(t+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(t+=s1(this.seconds+this.milliseconds/1e3,3)+"S"),t==="P"&&(t+="T0S"),t}toISOTime(t={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;t={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...t};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let a=t.format==="basic"?"hhmm":"hh:mm";(!t.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(a+=t.format==="basic"?"ss":":ss",(!t.suppressMilliseconds||r.milliseconds!==0)&&(a+=".SSS"));let o=r.toFormat(a);return t.includePrefix&&(o="T"+o),o}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;const n=tt.fromDurationLike(t),r={};for(const a of Du)(Md(n.values,a)||Md(this.values,a))&&(r[a]=n.get(a)+this.get(a));return cl(this,{values:r},!0)}minus(t){if(!this.isValid)return this;const n=tt.fromDurationLike(t);return this.plus(n.negate())}mapUnits(t){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=oT(t(this.values[r],r));return cl(this,{values:n},!0)}get(t){return this[tt.normalizeUnit(t)]}set(t){if(!this.isValid)return this;const n={...this.values,...cy(t,tt.normalizeUnit)};return cl(this,{values:n})}reconfigure({locale:t,numberingSystem:n,conversionAccuracy:r,matrix:a}={}){const s={loc:this.loc.clone({locale:t,numberingSystem:n}),matrix:a,conversionAccuracy:r};return cl(this,s)}as(t){return this.isValid?this.shiftTo(t).get(t):NaN}normalize(){if(!this.isValid)return this;const t=this.toObject();return GA(this.matrix,t),cl(this,{values:t},!0)}rescale(){if(!this.isValid)return this;const t=qA(this.normalize().shiftToAll().toObject());return cl(this,{values:t},!0)}shiftTo(...t){if(!this.isValid)return this;if(t.length===0)return this;t=t.map(s=>tt.normalizeUnit(s));const n={},r={},a=this.toObject();let o;for(const s of Du)if(t.indexOf(s)>=0){o=s;let c=0;for(const p in r)c+=this.matrix[p][s]*r[p],r[p]=0;xu(a[s])&&(c+=a[s]);const d=Math.trunc(c);n[s]=d,r[s]=(c*1e3-d*1e3)/1e3;for(const p in a)Du.indexOf(p)>Du.indexOf(s)&&bT(this.matrix,a,p,n,s)}else xu(a[s])&&(r[s]=a[s]);for(const s in r)r[s]!==0&&(n[o]+=s===o?r[s]:r[s]/this.matrix[o][s]);return cl(this,{values:n},!0).normalize()}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=this.values[n]===0?0:-this.values[n];return cl(this,{values:t},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(t){if(!this.isValid||!t.isValid||!this.loc.equals(t.loc))return!1;function n(r,a){return r===void 0||r===0?a===void 0||a===0:r===a}for(const r of Du)if(!n(this.values[r],t.values[r]))return!1;return!0}}const gd="Invalid Interval";function JA(e,t){return!e||!e.isValid?kn.invalid("missing or invalid start"):!t||!t.isValid?kn.invalid("missing or invalid end"):t<e?kn.invalid("end before start",`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}class kn{constructor(t){this.s=t.start,this.e=t.end,this.invalid=t.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new oo("need to specify a reason the Interval is invalid");const r=t instanceof Oo?t:new Oo(t,n);if(Zn.throwOnInvalid)throw new Sk(r);return new kn({invalid:r})}static fromDateTimes(t,n){const r=Fh(t),a=Fh(n),o=JA(r,a);return o??new kn({start:r,end:a})}static after(t,n){const r=tt.fromDurationLike(n),a=Fh(t);return kn.fromDateTimes(a,a.plus(r))}static before(t,n){const r=tt.fromDurationLike(n),a=Fh(t);return kn.fromDateTimes(a.minus(r),a)}static fromISO(t,n){const[r,a]=(t||"").split("/",2);if(r&&a){let o,s;try{o=st.fromISO(r,n),s=o.isValid}catch{s=!1}let c,d;try{c=st.fromISO(a,n),d=c.isValid}catch{d=!1}if(s&&d)return kn.fromDateTimes(o,c);if(s){const p=tt.fromISO(a,n);if(p.isValid)return kn.after(o,p)}else if(d){const p=tt.fromISO(r,n);if(p.isValid)return kn.before(c,p)}}return kn.invalid("unparsable",`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(t){return t&&t.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(t="milliseconds"){return this.isValid?this.toDuration(t).get(t):NaN}count(t="milliseconds"){if(!this.isValid)return NaN;const n=this.start.startOf(t),r=this.end.startOf(t);return Math.floor(r.diff(n,t).get(t))+1}hasSame(t){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,t):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(t){return this.isValid?this.s>t:!1}isBefore(t){return this.isValid?this.e<=t:!1}contains(t){return this.isValid?this.s<=t&&this.e>t:!1}set({start:t,end:n}={}){return this.isValid?kn.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];const n=t.map(Fh).filter(s=>this.contains(s)).sort(),r=[];let{s:a}=this,o=0;for(;a<this.e;){const s=n[o]||this.e,c=+s>+this.e?this.e:s;r.push(kn.fromDateTimes(a,c)),a=c,o+=1}return r}splitBy(t){const n=tt.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,a=1,o;const s=[];for(;r<this.e;){const c=this.start.plus(n.mapUnits(d=>d*a));o=+c>+this.e?this.e:c,s.push(kn.fromDateTimes(r,o)),r=o,a+=1}return s}divideEqually(t){return this.isValid?this.splitBy(this.length()/t).slice(0,t):[]}overlaps(t){return this.e>t.s&&this.s<t.e}abutsStart(t){return this.isValid?+this.e==+t.s:!1}abutsEnd(t){return this.isValid?+t.e==+this.s:!1}engulfs(t){return this.isValid?this.s<=t.s&&this.e>=t.e:!1}equals(t){return!this.isValid||!t.isValid?!1:this.s.equals(t.s)&&this.e.equals(t.e)}intersection(t){if(!this.isValid)return this;const n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:kn.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;const n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return kn.fromDateTimes(n,r)}static merge(t){const[n,r]=t.sort((a,o)=>a.s-o.s).reduce(([a,o],s)=>o?o.overlaps(s)||o.abutsStart(s)?[a,o.union(s)]:[a.concat([o]),s]:[a,s],[[],null]);return r&&n.push(r),n}static xor(t){let n=null,r=0;const a=[],o=t.map(d=>[{time:d.s,type:"s"},{time:d.e,type:"e"}]),s=Array.prototype.concat(...o),c=s.sort((d,p)=>d.time-p.time);for(const d of c)r+=d.type==="s"?1:-1,r===1?n=d.time:(n&&+n!=+d.time&&a.push(kn.fromDateTimes(n,d.time)),n=null);return kn.merge(a)}difference(...t){return kn.xor([this].concat(t)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} ${this.e.toISO()})`:gd}toLocaleString(t=sy,n={}){return this.isValid?Hr.create(this.s.loc.clone(n),t).formatInterval(this):gd}toISO(t){return this.isValid?`${this.s.toISO(t)}/${this.e.toISO(t)}`:gd}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:gd}toISOTime(t){return this.isValid?`${this.s.toISOTime(t)}/${this.e.toISOTime(t)}`:gd}toFormat(t,{separator:n=" "}={}){return this.isValid?`${this.s.toFormat(t)}${n}${this.e.toFormat(t)}`:gd}toDuration(t,n){return this.isValid?this.e.diff(this.s,t,n):tt.invalid(this.invalidReason)}mapEndpoints(t){return kn.fromDateTimes(t(this.s),t(this.e))}}class Mg{static hasDST(t=Zn.defaultZone){const n=st.now().setZone(t).set({month:12});return!t.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(t){return ps.isValidZone(t)}static normalizeZone(t){return yl(t,Zn.defaultZone)}static months(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t)}static monthsFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null,outputCalendar:o="gregory"}={}){return(a||hn.create(n,r,o)).months(t,!0)}static weekdays(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t)}static weekdaysFormat(t="long",{locale:n=null,numberingSystem:r=null,locObj:a=null}={}){return(a||hn.create(n,r,null)).weekdays(t,!0)}static meridiems({locale:t=null}={}){return hn.create(t).meridiems()}static eras(t="short",{locale:n=null}={}){return hn.create(n,null,"gregory").eras(t)}static features(){return{relative:rT()}}}function uD(e,t){const n=a=>a.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(tt.fromMillis(r).as("days"))}function KA(e,t,n){const r=[["years",(d,p)=>p.year-d.year],["quarters",(d,p)=>p.quarter-d.quarter+(p.year-d.year)*4],["months",(d,p)=>p.month-d.month+(p.year-d.year)*12],["weeks",(d,p)=>{const m=uD(d,p);return(m-m%7)/7}],["days",uD]],a={},o=e;let s,c;for(const[d,p]of r)n.indexOf(d)>=0&&(s=d,a[d]=p(e,t),c=o.plus(a),c>t?(a[d]--,e=o.plus(a)):e=c);return[e,a,c,s]}function QA(e,t,n,r){let[a,o,s,c]=KA(e,t,n);const d=t-a,p=n.filter(g=>["hours","minutes","seconds","milliseconds"].indexOf(g)>=0);p.length===0&&(s<t&&(s=a.plus({[c]:1})),s!==a&&(o[c]=(o[c]||0)+d/(s-a)));const m=tt.fromObject(o,r);return p.length>0?tt.fromMillis(d,r).shiftTo(...p).plus(m):m}const f1={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[-৯]",deva:"[-९]",fullwide:"[-]",gujr:"[-૯]",hanidec:"[|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[-೯]",laoo:"[-໙]",limb:"[᥆-᥏]",mlym:"[-൯]",mong:"[᠐-᠙]",mymr:"[-၉]",orya:"[-୯]",tamldec:"[-௯]",telu:"[-౯]",thai:"[-๙]",tibt:"[༠-༩]",latn:"\\d"},cD={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},XA=f1.hanidec.replace(/[\[|\]]/g,"").split("");function e6(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);if(e[n].search(f1.hanidec)!==-1)t+=XA.indexOf(e[n]);else for(const a in cD){const[o,s]=cD[a];r>=o&&r<=s&&(t+=r-o)}}return parseInt(t,10)}else return t}function No({numberingSystem:e},t=""){return new RegExp(`${f1[e||"latn"]}${t}`)}const t6="missing Intl.DateTimeFormat.formatToParts support";function Wt(e,t=n=>n){return{regex:e,deser:([n])=>t(e6(n))}}const n6=" ",DT=`[ ${n6}]`,ST=new RegExp(DT,"g");function r6(e){return e.replace(/\./g,"\\.?").replace(ST,DT)}function dD(e){return e.replace(/\./g,"").replace(ST," ").toLowerCase()}function ko(e,t){return e===null?null:{regex:RegExp(e.map(r6).join("|")),deser:([n])=>e.findIndex(r=>dD(n)===dD(r))+t}}function fD(e,t){return{regex:e,deser:([,n,r])=>Ly(n,r),groups:t}}function T0(e){return{regex:e,deser:([t])=>t}}function a6(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o6(e,t){const n=No(t),r=No(t,"{2}"),a=No(t,"{3}"),o=No(t,"{4}"),s=No(t,"{6}"),c=No(t,"{1,2}"),d=No(t,"{1,3}"),p=No(t,"{1,6}"),m=No(t,"{1,9}"),g=No(t,"{2,4}"),v=No(t,"{4,6}"),D=E=>({regex:RegExp(a6(E.val)),deser:([O])=>O,literal:!0}),T=(E=>{if(e.literal)return D(E);switch(E.val){case"G":return ko(t.eras("short",!1),0);case"GG":return ko(t.eras("long",!1),0);case"y":return Wt(p);case"yy":return Wt(g,Iw);case"yyyy":return Wt(o);case"yyyyy":return Wt(v);case"yyyyyy":return Wt(s);case"M":return Wt(c);case"MM":return Wt(r);case"MMM":return ko(t.months("short",!0,!1),1);case"MMMM":return ko(t.months("long",!0,!1),1);case"L":return Wt(c);case"LL":return Wt(r);case"LLL":return ko(t.months("short",!1,!1),1);case"LLLL":return ko(t.months("long",!1,!1),1);case"d":return Wt(c);case"dd":return Wt(r);case"o":return Wt(d);case"ooo":return Wt(a);case"HH":return Wt(r);case"H":return Wt(c);case"hh":return Wt(r);case"h":return Wt(c);case"mm":return Wt(r);case"m":return Wt(c);case"q":return Wt(c);case"qq":return Wt(r);case"s":return Wt(c);case"ss":return Wt(r);case"S":return Wt(d);case"SSS":return Wt(a);case"u":return T0(m);case"uu":return T0(c);case"uuu":return Wt(n);case"a":return ko(t.meridiems(),0);case"kkkk":return Wt(o);case"kk":return Wt(g,Iw);case"W":return Wt(c);case"WW":return Wt(r);case"E":case"c":return Wt(n);case"EEE":return ko(t.weekdays("short",!1,!1),1);case"EEEE":return ko(t.weekdays("long",!1,!1),1);case"ccc":return ko(t.weekdays("short",!0,!1),1);case"cccc":return ko(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return fD(new RegExp(`([+-]${c.source})(?::(${r.source}))?`),2);case"ZZZ":return fD(new RegExp(`([+-]${c.source})(${r.source})?`),2);case"z":return T0(/[a-z_+-/]{1,256}?/i);default:return D(E)}})(e)||{invalidReason:t6};return T.token=e,T}const i6={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function s6(e,t){const{type:n,value:r}=e;if(n==="literal")return{literal:!0,val:r};const a=t[n];let o=i6[n];if(typeof o=="object"&&(o=o[a]),o)return{literal:!1,val:o}}function l6(e){return[`^${e.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,e]}function u6(e,t,n){const r=e.match(t);if(r){const a={};let o=1;for(const s in n)if(Md(n,s)){const c=n[s],d=c.groups?c.groups+1:1;!c.literal&&c.token&&(a[c.token.val[0]]=c.deser(r.slice(o,o+d))),o+=d}return[r,a]}else return[r,{}]}function c6(e){const t=o=>{switch(o){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return _t(e.z)||(n=ps.create(e.z)),_t(e.Z)||(n||(n=new Xr(e.Z)),r=e.Z),_t(e.q)||(e.M=(e.q-1)*3+1),_t(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),_t(e.u)||(e.S=i1(e.u)),[Object.keys(e).reduce((o,s)=>{const c=t(s);return c&&(o[c]=e[s]),o},{}),n,r]}let E0=null;function d6(){return E0||(E0=st.fromMillis(1555555555555)),E0}function f6(e,t){if(e.literal)return e;const n=Hr.macroTokenToFormatOpts(e.val),r=ET(n,t);return r==null||r.includes(void 0)?e:r}function IT(e,t){return Array.prototype.concat(...e.map(n=>f6(n,t)))}function TT(e,t,n){const r=IT(Hr.parseFormat(n),e),a=r.map(s=>o6(s,e)),o=a.find(s=>s.invalidReason);if(o)return{input:t,tokens:r,invalidReason:o.invalidReason};{const[s,c]=l6(a),d=RegExp(s,"i"),[p,m]=u6(t,d,c),[g,v,D]=m?c6(m):[null,null,void 0];if(Md(m,"a")&&Md(m,"H"))throw new Yh("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:d,rawMatches:p,matches:m,result:g,zone:v,specificOffset:D}}}function h6(e,t,n){const{result:r,zone:a,specificOffset:o,invalidReason:s}=TT(e,t,n);return[r,a,o,s]}function ET(e,t){return e?Hr.create(t,e).formatDateTimeParts(d6()).map(a=>s6(a,e)):null}const CT=[0,31,59,90,120,151,181,212,243,273,304,334],xT=[0,31,60,91,121,152,182,213,244,274,305,335];function io(e,t){return new Oo("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function MT(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const a=r.getUTCDay();return a===0?7:a}function NT(e,t,n){return n+(xp(e)?xT:CT)[t-1]}function kT(e,t){const n=xp(e)?xT:CT,r=n.findIndex(o=>o<t),a=t-n[r];return{month:r+1,day:a}}function Tw(e){const{year:t,month:n,day:r}=e,a=NT(t,n,r),o=MT(t,n,r);let s=Math.floor((a-o+10)/7),c;return s<1?(c=t-1,s=uy(c)):s>uy(t)?(c=t+1,s=1):c=t,{weekYear:c,weekNumber:s,weekday:o,...Ry(e)}}function hD(e){const{weekYear:t,weekNumber:n,weekday:r}=e,a=MT(t,1,4),o=$h(t);let s=n*7+r-a-3,c;s<1?(c=t-1,s+=$h(c)):s>o?(c=t+1,s-=$h(t)):c=t;const{month:d,day:p}=kT(c,s);return{year:c,month:d,day:p,...Ry(e)}}function C0(e){const{year:t,month:n,day:r}=e,a=NT(t,n,r);return{year:t,ordinal:a,...Ry(e)}}function pD(e){const{year:t,ordinal:n}=e,{month:r,day:a}=kT(t,n);return{year:t,month:r,day:a,...Ry(e)}}function p6(e){const t=jy(e.weekYear),n=hs(e.weekNumber,1,uy(e.weekYear)),r=hs(e.weekday,1,7);return t?n?r?!1:io("weekday",e.weekday):io("week",e.week):io("weekYear",e.weekYear)}function m6(e){const t=jy(e.year),n=hs(e.ordinal,1,$h(e.year));return t?n?!1:io("ordinal",e.ordinal):io("year",e.year)}function AT(e){const t=jy(e.year),n=hs(e.month,1,12),r=hs(e.day,1,ly(e.year,e.month));return t?n?r?!1:io("day",e.day):io("month",e.month):io("year",e.year)}function FT(e){const{hour:t,minute:n,second:r,millisecond:a}=e,o=hs(t,0,23)||t===24&&n===0&&r===0&&a===0,s=hs(n,0,59),c=hs(r,0,59),d=hs(a,0,999);return o?s?c?d?!1:io("millisecond",a):io("second",r):io("minute",n):io("hour",t)}const x0="Invalid DateTime",mD=864e13;function Ng(e){return new Oo("unsupported zone",`the zone "${e.name}" is not supported`)}function M0(e){return e.weekData===null&&(e.weekData=Tw(e.c)),e.weekData}function kh(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new st({...n,...t,old:n})}function OT(e,t,n){let r=e-t*60*1e3;const a=n.offset(r);if(t===a)return[r,t];r-=(a-t)*60*1e3;const o=n.offset(r);return a===o?[r,a]:[e-Math.min(a,o)*60*1e3,Math.max(a,o)]}function gD(e,t){e+=t*60*1e3;const n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function qg(e,t,n){return OT(l1(e),t,n)}function yD(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),a=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,o={...e.c,year:r,month:a,day:Math.min(e.c.day,ly(r,a))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},s=tt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),c=l1(o);let[d,p]=OT(c,n,e.zone);return s!==0&&(d+=s,p=e.zone.offset(d)),{ts:d,o:p}}function Ah(e,t,n,r,a,o){const{setZone:s,zone:c}=n;if(e&&Object.keys(e).length!==0){const d=t||c,p=st.fromObject(e,{...n,zone:d,specificOffset:o});return s?p:p.setZone(c)}else return st.invalid(new Oo("unparsable",`the input "${a}" can't be parsed as ${r}`))}function kg(e,t,n=!0){return e.isValid?Hr.create(hn.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function N0(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=Wn(e.c.year,n?6:4),t?(r+="-",r+=Wn(e.c.month),r+="-",r+=Wn(e.c.day)):(r+=Wn(e.c.month),r+=Wn(e.c.day)),r}function vD(e,t,n,r,a,o){let s=Wn(e.c.hour);return t?(s+=":",s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=":")):s+=Wn(e.c.minute),(e.c.second!==0||!n)&&(s+=Wn(e.c.second),(e.c.millisecond!==0||!r)&&(s+=".",s+=Wn(e.c.millisecond,3))),a&&(e.isOffsetFixed&&e.offset===0&&!o?s+="Z":e.o<0?(s+="-",s+=Wn(Math.trunc(-e.o/60)),s+=":",s+=Wn(Math.trunc(-e.o%60))):(s+="+",s+=Wn(Math.trunc(e.o/60)),s+=":",s+=Wn(Math.trunc(e.o%60)))),o&&(s+="["+e.zone.ianaName+"]"),s}const PT={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},g6={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},y6={ordinal:1,hour:0,minute:0,second:0,millisecond:0},jT=["year","month","day","hour","minute","second","millisecond"],v6=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],w6=["year","ordinal","hour","minute","second","millisecond"];function wD(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new RI(e);return t}function bD(e,t){const n=yl(t.zone,Zn.defaultZone),r=hn.fromObject(t),a=Zn.now();let o,s;if(_t(e.year))o=a;else{for(const p of jT)_t(e[p])&&(e[p]=PT[p]);const c=AT(e)||FT(e);if(c)return st.invalid(c);const d=n.offset(a);[o,s]=qg(e,d,n)}return new st({ts:o,zone:n,loc:r,o:s})}function DD(e,t,n){const r=_t(n.round)?!0:n.round,a=(s,c)=>(s=s1(s,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(s,c)),o=s=>n.calendary?t.hasSame(e,s)?0:t.startOf(s).diff(e.startOf(s),s).get(s):t.diff(e,s).get(s);if(n.unit)return a(o(n.unit),n.unit);for(const s of n.units){const c=o(s);if(Math.abs(c)>=1)return a(c,s)}return a(e>t?-0:0,n.units[n.units.length-1])}function SD(e){let t={},n;return e.length>0&&typeof e[e.length-1]=="object"?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}class st{constructor(t){const n=t.zone||Zn.defaultZone;let r=t.invalid||(Number.isNaN(t.ts)?new Oo("invalid input"):null)||(n.isValid?null:Ng(n));this.ts=_t(t.ts)?Zn.now():t.ts;let a=null,o=null;if(!r)if(t.old&&t.old.ts===this.ts&&t.old.zone.equals(n))[a,o]=[t.old.c,t.old.o];else{const c=n.offset(this.ts);a=gD(this.ts,c),r=Number.isNaN(a.year)?new Oo("invalid input"):null,a=r?null:a,o=r?null:c}this._zone=n,this.loc=t.loc||hn.create(),this.invalid=r,this.weekData=null,this.c=a,this.o=o,this.isLuxonDateTime=!0}static now(){return new st({})}static local(){const[t,n]=SD(arguments),[r,a,o,s,c,d,p]=n;return bD({year:r,month:a,day:o,hour:s,minute:c,second:d,millisecond:p},t)}static utc(){const[t,n]=SD(arguments),[r,a,o,s,c,d,p]=n;return t.zone=Xr.utcInstance,bD({year:r,month:a,day:o,hour:s,minute:c,second:d,millisecond:p},t)}static fromJSDate(t,n={}){const r=Vk(t)?t.valueOf():NaN;if(Number.isNaN(r))return st.invalid("invalid input");const a=yl(n.zone,Zn.defaultZone);return a.isValid?new st({ts:r,zone:a,loc:hn.fromObject(n)}):st.invalid(Ng(a))}static fromMillis(t,n={}){if(xu(t))return t<-mD||t>mD?st.invalid("Timestamp out of range"):new st({ts:t,zone:yl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new oo(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`)}static fromSeconds(t,n={}){if(xu(t))return new st({ts:t*1e3,zone:yl(n.zone,Zn.defaultZone),loc:hn.fromObject(n)});throw new oo("fromSeconds requires a numerical input")}static fromObject(t,n={}){t=t||{};const r=yl(n.zone,Zn.defaultZone);if(!r.isValid)return st.invalid(Ng(r));const a=Zn.now(),o=_t(n.specificOffset)?r.offset(a):n.specificOffset,s=cy(t,wD),c=!_t(s.ordinal),d=!_t(s.year),p=!_t(s.month)||!_t(s.day),m=d||p,g=s.weekYear||s.weekNumber,v=hn.fromObject(n);if((m||c)&&g)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(p&&c)throw new Yh("Can't mix ordinal dates with month/day");const D=g||s.weekday&&!m;let S,T,E=gD(a,o);D?(S=v6,T=g6,E=Tw(E)):c?(S=w6,T=y6,E=C0(E)):(S=jT,T=PT);let O=!1;for(const H of S){const Y=s[H];_t(Y)?O?s[H]=T[H]:s[H]=E[H]:O=!0}const k=D?p6(s):c?m6(s):AT(s),j=k||FT(s);if(j)return st.invalid(j);const F=D?hD(s):c?pD(s):s,[B,R]=qg(F,o,r),z=new st({ts:B,zone:r,o:R,loc:v});return s.weekday&&m&&t.weekday!==z.weekday?st.invalid("mismatched weekday",`you can't specify both a weekday of ${s.weekday} and a date of ${z.toISO()}`):z}static fromISO(t,n={}){const[r,a]=OA(t);return Ah(r,a,n,"ISO 8601",t)}static fromRFC2822(t,n={}){const[r,a]=PA(t);return Ah(r,a,n,"RFC 2822",t)}static fromHTTP(t,n={}){const[r,a]=jA(t);return Ah(r,a,n,"HTTP",n)}static fromFormat(t,n,r={}){if(_t(t)||_t(n))throw new oo("fromFormat requires an input string and a format");const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0}),[c,d,p,m]=h6(s,t,n);return m?st.invalid(m):Ah(c,d,r,`format ${n}`,t,p)}static fromString(t,n,r={}){return st.fromFormat(t,n,r)}static fromSQL(t,n={}){const[r,a]=zA(t);return Ah(r,a,n,"SQL",t)}static invalid(t,n=null){if(!t)throw new oo("need to specify a reason the DateTime is invalid");const r=t instanceof Oo?t:new Oo(t,n);if(Zn.throwOnInvalid)throw new Dk(r);return new st({invalid:r})}static isDateTime(t){return t&&t.isLuxonDateTime||!1}static parseFormatForOpts(t,n={}){const r=ET(t,hn.fromObject(n));return r?r.map(a=>a?a.val:null).join(""):null}static expandFormat(t,n={}){return IT(Hr.parseFormat(t),hn.fromObject(n)).map(a=>a.val).join("")}get(t){return this[t]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?M0(this).weekYear:NaN}get weekNumber(){return this.isValid?M0(this).weekNumber:NaN}get weekday(){return this.isValid?M0(this).weekday:NaN}get ordinal(){return this.isValid?C0(this.c).ordinal:NaN}get monthShort(){return this.isValid?Mg.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Mg.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Mg.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Mg.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return xp(this.year)}get daysInMonth(){return ly(this.year,this.month)}get daysInYear(){return this.isValid?$h(this.year):NaN}get weeksInWeekYear(){return this.isValid?uy(this.weekYear):NaN}resolvedLocaleOptions(t={}){const{locale:n,numberingSystem:r,calendar:a}=Hr.create(this.loc.clone(t),t).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:a}}toUTC(t=0,n={}){return this.setZone(Xr.instance(t),n)}toLocal(){return this.setZone(Zn.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=yl(t,Zn.defaultZone),t.equals(this.zone))return this;if(t.isValid){let a=this.ts;if(n||r){const o=t.offset(this.ts),s=this.toObject();[a]=qg(s,o,t)}return kh(this,{ts:a,zone:t})}else return st.invalid(Ng(t))}reconfigure({locale:t,numberingSystem:n,outputCalendar:r}={}){const a=this.loc.clone({locale:t,numberingSystem:n,outputCalendar:r});return kh(this,{loc:a})}setLocale(t){return this.reconfigure({locale:t})}set(t){if(!this.isValid)return this;const n=cy(t,wD),r=!_t(n.weekYear)||!_t(n.weekNumber)||!_t(n.weekday),a=!_t(n.ordinal),o=!_t(n.year),s=!_t(n.month)||!_t(n.day),c=o||s,d=n.weekYear||n.weekNumber;if((c||a)&&d)throw new Yh("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(s&&a)throw new Yh("Can't mix ordinal dates with month/day");let p;r?p=hD({...Tw(this.c),...n}):_t(n.ordinal)?(p={...this.toObject(),...n},_t(n.day)&&(p.day=Math.min(ly(p.year,p.month),p.day))):p=pD({...C0(this.c),...n});const[m,g]=qg(p,this.o,this.zone);return kh(this,{ts:m,o:g})}plus(t){if(!this.isValid)return this;const n=tt.fromDurationLike(t);return kh(this,yD(this,n))}minus(t){if(!this.isValid)return this;const n=tt.fromDurationLike(t).negate();return kh(this,yD(this,n))}startOf(t){if(!this.isValid)return this;const n={},r=tt.normalizeUnit(t);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const a=Math.ceil(this.month/3);n.month=(a-1)*3+1}return this.set(n)}endOf(t){return this.isValid?this.plus({[t]:1}).startOf(t).minus(1):this}toFormat(t,n={}){return this.isValid?Hr.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,t):x0}toLocaleString(t=sy,n={}){return this.isValid?Hr.create(this.loc.clone(n),t).formatDateTime(this):x0}toLocaleParts(t={}){return this.isValid?Hr.create(this.loc.clone(t),t).formatDateTimeParts(this):[]}toISO({format:t="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:a=!0,extendedZone:o=!1}={}){if(!this.isValid)return null;const s=t==="extended";let c=N0(this,s);return c+="T",c+=vD(this,s,n,r,a,o),c}toISODate({format:t="extended"}={}){return this.isValid?N0(this,t==="extended"):null}toISOWeekDate(){return kg(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:t=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:a=!1,extendedZone:o=!1,format:s="extended"}={}){return this.isValid?(a?"T":"")+vD(this,s==="extended",n,t,r,o):null}toRFC2822(){return kg(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return kg(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?N0(this,!0):null}toSQLTime({includeOffset:t=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let a="HH:mm:ss.SSS";return(n||t)&&(r&&(a+=" "),n?a+="z":t&&(a+="ZZ")),kg(this,a,!0)}toSQL(t={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(t)}`:null}toString(){return this.isValid?this.toISO():x0}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(t={}){if(!this.isValid)return{};const n={...this.c};return t.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(t,n="milliseconds",r={}){if(!this.isValid||!t.isValid)return tt.invalid("created by diffing an invalid DateTime");const a={locale:this.locale,numberingSystem:this.numberingSystem,...r},o=Zk(n).map(tt.normalizeUnit),s=t.valueOf()>this.valueOf(),c=s?this:t,d=s?t:this,p=QA(c,d,o,a);return s?p.negate():p}diffNow(t="milliseconds",n={}){return this.diff(st.now(),t,n)}until(t){return this.isValid?kn.fromDateTimes(this,t):this}hasSame(t,n){if(!this.isValid)return!1;const r=t.valueOf(),a=this.setZone(t.zone,{keepLocalTime:!0});return a.startOf(n)<=r&&r<=a.endOf(n)}equals(t){return this.isValid&&t.isValid&&this.valueOf()===t.valueOf()&&this.zone.equals(t.zone)&&this.loc.equals(t.loc)}toRelative(t={}){if(!this.isValid)return null;const n=t.base||st.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0;let a=["years","months","days","hours","minutes","seconds"],o=t.unit;return Array.isArray(t.unit)&&(a=t.unit,o=void 0),DD(n,this.plus(r),{...t,numeric:"always",units:a,unit:o})}toRelativeCalendar(t={}){return this.isValid?DD(t.base||st.fromObject({},{zone:this.zone}),this,{...t,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...t){if(!t.every(st.isDateTime))throw new oo("min requires all arguments be DateTimes");return iD(t,n=>n.valueOf(),Math.min)}static max(...t){if(!t.every(st.isDateTime))throw new oo("max requires all arguments be DateTimes");return iD(t,n=>n.valueOf(),Math.max)}static fromFormatExplain(t,n,r={}){const{locale:a=null,numberingSystem:o=null}=r,s=hn.fromOpts({locale:a,numberingSystem:o,defaultToEN:!0});return TT(s,t,n)}static fromStringExplain(t,n,r={}){return st.fromFormatExplain(t,n,r)}static get DATE_SHORT(){return sy}static get DATE_MED(){return BI}static get DATE_MED_WITH_WEEKDAY(){return Tk}static get DATE_FULL(){return _I}static get DATE_HUGE(){return HI}static get TIME_SIMPLE(){return YI}static get TIME_WITH_SECONDS(){return zI}static get TIME_WITH_SHORT_OFFSET(){return UI}static get TIME_WITH_LONG_OFFSET(){return VI}static get TIME_24_SIMPLE(){return ZI}static get TIME_24_WITH_SECONDS(){return WI}static get TIME_24_WITH_SHORT_OFFSET(){return $I}static get TIME_24_WITH_LONG_OFFSET(){return GI}static get DATETIME_SHORT(){return qI}static get DATETIME_SHORT_WITH_SECONDS(){return JI}static get DATETIME_MED(){return KI}static get DATETIME_MED_WITH_SECONDS(){return QI}static get DATETIME_MED_WITH_WEEKDAY(){return Ek}static get DATETIME_FULL(){return XI}static get DATETIME_FULL_WITH_SECONDS(){return eT}static get DATETIME_HUGE(){return tT}static get DATETIME_HUGE_WITH_SECONDS(){return nT}}function Fh(e){if(st.isDateTime(e))return e;if(e&&e.valueOf&&xu(e.valueOf()))return st.fromJSDate(e);if(e&&typeof e=="object")return st.fromObject(e);throw new oo(`Unknown datetime argument: ${e}, of type ${typeof e}`)}const h1={renderNullAs:"\\-",taskCompletionTracking:!1,taskCompletionUseEmojiShorthand:!1,taskCompletionText:"completion",taskCompletionDateFormat:"yyyy-MM-dd",recursiveSubTaskCompletion:!1,warnOnEmptyResult:!0,refreshEnabled:!0,refreshInterval:2500,defaultDateFormat:"MMMM dd, yyyy",defaultDateTimeFormat:"h:mm a - MMMM dd, yyyy",maxRecursiveRenderDepth:4,tableIdColumnName:"File",tableGroupColumnName:"Group",showResultCount:!0},b6={allowHtml:!0};({...h1,...b6});class p1{constructor(t){this.value=t,this.successful=!0}map(t){return new p1(t(this.value))}flatMap(t){return t(this.value)}mapErr(t){return this}bimap(t,n){return this.map(t)}orElse(t){return this.value}cast(){return this}orElseThrow(t){return this.value}}class m1{constructor(t){this.error=t,this.successful=!1}map(t){return this}flatMap(t){return this}mapErr(t){return new m1(t(this.error))}bimap(t,n){return this.mapErr(n)}orElse(t){return t}cast(){return this}orElseThrow(t){throw t?new Error(t(this.error)):new Error(""+this.error)}}var dy;(function(e){function t(o){return new p1(o)}e.success=t;function n(o){return new m1(o)}e.failure=n;function r(o,s,c){return o.successful?s.successful?c(o.value,s.value):n(s.error):n(o.error)}e.flatMap2=r;function a(o,s,c){return r(o,s,(d,p)=>t(c(d,p)))}e.map2=a})(dy||(dy={}));var D6=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Jn<"u"?Jn:typeof self<"u"?self:{},X={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:D6,function(){return function(n){var r={};function a(o){if(r[o])return r[o].exports;var s=r[o]={i:o,l:!1,exports:{}};return n[o].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=n,a.c=r,a.d=function(o,s,c){a.o(o,s)||Object.defineProperty(o,s,{configurable:!1,enumerable:!0,get:c})},a.r=function(o){Object.defineProperty(o,"__esModule",{value:!0})},a.n=function(o){var s=o&&o.__esModule?function(){return o.default}:function(){return o};return a.d(s,"a",s),s},a.o=function(o,s){return Object.prototype.hasOwnProperty.call(o,s)},a.p="",a(a.s=0)}([function(n,r,a){function o(W){if(!(this instanceof o))return new o(W);this._=W}var s=o.prototype;function c(W,re){for(var ye=0;ye<W;ye++)re(ye)}function d(W,re,ye){return function(xe,je){c(je.length,function(_e){xe(je[_e],_e,je)})}(function(xe,je,_e){re=W(re,xe,je,_e)},ye),re}function p(W,re){return d(function(ye,xe,je,_e){return ye.concat([W(xe,je,_e)])},[],re)}function m(W,re){var ye={v:0,buf:re};return c(W,function(){var xe;ye={v:ye.v<<1|(xe=ye.buf,xe[0]>>7),buf:function(je){var _e=d(function(ze,gt,Vt,On){return ze.concat(Vt===On.length-1?Buffer.from([gt,0]).readUInt16BE(0):On.readUInt16BE(Vt))},[],je);return Buffer.from(p(function(ze){return(ze<<1&65535)>>8},_e))}(ye.buf)}}),ye}function g(){return typeof Buffer<"u"}function v(){if(!g())throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser.")}function D(W){v();var re=d(function(_e,ze){return _e+ze},0,W);if(re%8!=0)throw new Error("The bits ["+W.join(", ")+"] add up to "+re+" which is not an even number of bytes; the total should be divisible by 8");var ye,xe=re/8,je=(ye=function(_e){return _e>48},d(function(_e,ze){return _e||(ye(ze)?ze:_e)},null,W));if(je)throw new Error(je+" bit range requested exceeds 48 bit (6 byte) Number max.");return new o(function(_e,ze){var gt=xe+ze;return gt>_e.length?H(ze,xe.toString()+" bytes"):z(gt,d(function(Vt,On){var bn=m(On,Vt.buf);return{coll:Vt.coll.concat(bn.v),buf:bn.buf}},{coll:[],buf:_e.slice(ze,gt)},W).coll)})}function S(W,re){return new o(function(ye,xe){return v(),xe+re>ye.length?H(xe,re+" bytes for "+W):z(xe+re,ye.slice(xe,xe+re))})}function T(W,re){if(typeof(ye=re)!="number"||Math.floor(ye)!==ye||re<0||re>6)throw new Error(W+" requires integer length in range [0, 6].");var ye}function E(W){return T("uintBE",W),S("uintBE("+W+")",W).map(function(re){return re.readUIntBE(0,W)})}function O(W){return T("uintLE",W),S("uintLE("+W+")",W).map(function(re){return re.readUIntLE(0,W)})}function k(W){return T("intBE",W),S("intBE("+W+")",W).map(function(re){return re.readIntBE(0,W)})}function j(W){return T("intLE",W),S("intLE("+W+")",W).map(function(re){return re.readIntLE(0,W)})}function F(W){return W instanceof o}function B(W){return{}.toString.call(W)==="[object Array]"}function R(W){return g()&&Buffer.isBuffer(W)}function z(W,re){return{status:!0,index:W,value:re,furthest:-1,expected:[]}}function H(W,re){return B(re)||(re=[re]),{status:!1,index:-1,value:null,furthest:W,expected:re}}function Y(W,re){if(!re||W.furthest>re.furthest)return W;var ye=W.furthest===re.furthest?function(xe,je){if(function(){if(o._supportsSet!==void 0)return o._supportsSet;var wr=typeof Set<"u";return o._supportsSet=wr,wr}()&&Array.from){for(var _e=new Set(xe),ze=0;ze<je.length;ze++)_e.add(je[ze]);var gt=Array.from(_e);return gt.sort(),gt}for(var Vt={},On=0;On<xe.length;On++)Vt[xe[On]]=!0;for(var bn=0;bn<je.length;bn++)Vt[je[bn]]=!0;var na=[];for(var Pn in Vt)({}).hasOwnProperty.call(Vt,Pn)&&na.push(Pn);return na.sort(),na}(W.expected,re.expected):re.expected;return{status:W.status,index:W.index,value:W.value,furthest:re.furthest,expected:ye}}var U={};function J(W,re){if(R(W))return{offset:re,line:-1,column:-1};W in U||(U[W]={});for(var ye=U[W],xe=0,je=0,_e=0,ze=re;ze>=0;){if(ze in ye){xe=ye[ze].line,_e===0&&(_e=ye[ze].lineStart);break}(W.charAt(ze)===`
`||W.charAt(ze)==="\r"&&W.charAt(ze+1)!==`
`)&&(je++,_e===0&&(_e=ze+1)),ze--}var gt=xe+je,Vt=re-_e;return ye[re]={line:gt,lineStart:_e},{offset:re,line:gt+1,column:Vt+1}}function Q(W){if(!F(W))throw new Error("not a parser: "+W)}function le(W,re){return typeof W=="string"?W.charAt(re):W[re]}function pe(W){if(typeof W!="number")throw new Error("not a number: "+W)}function ie(W){if(typeof W!="function")throw new Error("not a function: "+W)}function se(W){if(typeof W!="string")throw new Error("not a string: "+W)}var fe=2,oe=3,we=8,Z=5*we,G=4*we,te=" ";function ge(W,re){return new Array(re+1).join(W)}function Ie(W,re,ye){var xe=re-W.length;return xe<=0?W:ge(ye,xe)+W}function De(W,re,ye,xe){return{from:W-re>0?W-re:0,to:W+ye>xe?xe:W+ye}}function ke(W,re){var ye,xe,je,_e,ze,gt=re.index,Vt=gt.offset,On=1;if(Vt===W.length)return"Got the end of the input";if(R(W)){var bn=Vt-Vt%we,na=Vt-bn,Pn=De(bn,Z,G+we,W.length),wr=p(function(Qt){return p(function(Ta){return Ie(Ta.toString(16),2,"0")},Qt)},function(Qt,Ta){var Ea=Qt.length,Ca=[],Yo=0;if(Ea<=Ta)return[Qt.slice()];for(var zo=0;zo<Ea;zo++)Ca[Yo]||Ca.push([]),Ca[Yo].push(Qt[zo]),(zo+1)%Ta==0&&Yo++;return Ca}(W.slice(Pn.from,Pn.to).toJSON().data,we));_e=function(Qt){return Qt.from===0&&Qt.to===1?{from:Qt.from,to:Qt.to}:{from:Qt.from/we,to:Math.floor(Qt.to/we)}}(Pn),xe=bn/we,ye=3*na,na>=4&&(ye+=1),On=2,je=p(function(Qt){return Qt.length<=4?Qt.join(" "):Qt.slice(0,4).join(" ")+" "+Qt.slice(4).join(" ")},wr),(ze=(8*(_e.to>0?_e.to-1:_e.to)).toString(16).length)<2&&(ze=2)}else{var ra=W.split(/\r\n|[\n\r\u2028\u2029]/);ye=gt.column-1,xe=gt.line-1,_e=De(xe,fe,oe,ra.length),je=ra.slice(_e.from,_e.to),ze=_e.to.toString().length}var kl=xe-_e.from;return R(W)&&(ze=(8*(_e.to>0?_e.to-1:_e.to)).toString(16).length)<2&&(ze=2),d(function(Qt,Ta,Ea){var Ca,Yo=Ea===kl,zo=Yo?"> ":te;return Ca=R(W)?Ie((8*(_e.from+Ea)).toString(16),ze,"0"):Ie((_e.from+Ea+1).toString(),ze," "),[].concat(Qt,[zo+Ca+" | "+Ta],Yo?[te+ge(" ",ze)+" | "+Ie("",ye," ")+ge("^",On)]:[])},[],je).join(`
`)}function Ye(W,re){return[`
`,"-- PARSING FAILED "+ge("-",50),`
`,ke(W,re),`
`,(ye=re.expected,ye.length===1?`Expected:
`+ye[0]:`Expected one of the following:
`+ye.join(", ")),`
`].join("");var ye}function Re(W){return W.flags!==void 0?W.flags:[W.global?"g":"",W.ignoreCase?"i":"",W.multiline?"m":"",W.unicode?"u":"",W.sticky?"y":""].join("")}function rt(){for(var W=[].slice.call(arguments),re=W.length,ye=0;ye<re;ye+=1)Q(W[ye]);return o(function(xe,je){for(var _e,ze=new Array(re),gt=0;gt<re;gt+=1){if(!(_e=Y(W[gt]._(xe,je),_e)).status)return _e;ze[gt]=_e.value,je=_e.index}return Y(z(je,ze),_e)})}function Ht(){var W=[].slice.call(arguments);if(W.length===0)throw new Error("seqMap needs at least one argument");var re=W.pop();return ie(re),rt.apply(null,W).map(function(ye){return re.apply(null,ye)})}function Se(){var W=[].slice.call(arguments),re=W.length;if(re===0)return Dt("zero alternates");for(var ye=0;ye<re;ye+=1)Q(W[ye]);return o(function(xe,je){for(var _e,ze=0;ze<W.length;ze+=1)if((_e=Y(W[ze]._(xe,je),_e)).status)return _e;return _e})}function Ze(W,re){return Ke(W,re).or(ft([]))}function Ke(W,re){return Q(W),Q(re),Ht(W,re.then(W).many(),function(ye,xe){return[ye].concat(xe)})}function Je(W){se(W);var re="'"+W+"'";return o(function(ye,xe){var je=xe+W.length,_e=ye.slice(xe,je);return _e===W?z(je,_e):H(xe,re)})}function lt(W,re){(function(je){if(!(je instanceof RegExp))throw new Error("not a regexp: "+je);for(var _e=Re(je),ze=0;ze<_e.length;ze++){var gt=_e.charAt(ze);if(gt!=="i"&&gt!=="m"&&gt!=="u"&&gt!=="s")throw new Error('unsupported regexp flag "'+gt+'": '+je)}})(W),arguments.length>=2?pe(re):re=0;var ye=function(je){return RegExp("^(?:"+je.source+")",Re(je))}(W),xe=""+W;return o(function(je,_e){var ze=ye.exec(je.slice(_e));if(ze){if(0<=re&&re<=ze.length){var gt=ze[0],Vt=ze[re];return z(_e+gt.length,Vt)}return H(_e,"valid match group (0 to "+ze.length+") in "+xe)}return H(_e,xe)})}function ft(W){return o(function(re,ye){return z(ye,W)})}function Dt(W){return o(function(re,ye){return H(ye,W)})}function Ct(W){if(F(W))return o(function(re,ye){var xe=W._(re,ye);return xe.index=ye,xe.value="",xe});if(typeof W=="string")return Ct(Je(W));if(W instanceof RegExp)return Ct(lt(W));throw new Error("not a string, regexp, or parser: "+W)}function un(W){return Q(W),o(function(re,ye){var xe=W._(re,ye),je=re.slice(ye,xe.index);return xe.status?H(ye,'not "'+je+'"'):z(ye,null)})}function Ft(W){return ie(W),o(function(re,ye){var xe=le(re,ye);return ye<re.length&&W(xe)?z(ye+1,xe):H(ye,"a character/byte matching "+W)})}function Ot(W,re){arguments.length<2&&(re=W,W=void 0);var ye=o(function(xe,je){return ye._=re()._,ye._(xe,je)});return W?ye.desc(W):ye}function an(){return Dt("fantasy-land/empty")}s.parse=function(W){if(typeof W!="string"&&!R(W))throw new Error(".parse must be called with a string or Buffer as its argument");var re,ye=this.skip(Ia)._(W,0);return re=ye.status?{status:!0,value:ye.value}:{status:!1,index:J(W,ye.furthest),expected:ye.expected},delete U[W],re},s.tryParse=function(W){var re=this.parse(W);if(re.status)return re.value;var ye=Ye(W,re),xe=new Error(ye);throw xe.type="ParsimmonError",xe.result=re,xe},s.assert=function(W,re){return this.chain(function(ye){return W(ye)?ft(ye):Dt(re)})},s.or=function(W){return Se(this,W)},s.trim=function(W){return this.wrap(W,W)},s.wrap=function(W,re){return Ht(W,this,re,function(ye,xe){return xe})},s.thru=function(W){return W(this)},s.then=function(W){return Q(W),rt(this,W).map(function(re){return re[1]})},s.many=function(){var W=this;return o(function(re,ye){for(var xe=[],je=void 0;;){if(!(je=Y(W._(re,ye),je)).status)return Y(z(ye,xe),je);if(ye===je.index)throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause");ye=je.index,xe.push(je.value)}})},s.tieWith=function(W){return se(W),this.map(function(re){if(function(je){if(!B(je))throw new Error("not an array: "+je)}(re),re.length){se(re[0]);for(var ye=re[0],xe=1;xe<re.length;xe++)se(re[xe]),ye+=W+re[xe];return ye}return""})},s.tie=function(){return this.tieWith("")},s.times=function(W,re){var ye=this;return arguments.length<2&&(re=W),pe(W),pe(re),o(function(xe,je){for(var _e=[],ze=void 0,gt=void 0,Vt=0;Vt<W;Vt+=1){if(gt=Y(ze=ye._(xe,je),gt),!ze.status)return gt;je=ze.index,_e.push(ze.value)}for(;Vt<re&&(gt=Y(ze=ye._(xe,je),gt),ze.status);Vt+=1)je=ze.index,_e.push(ze.value);return Y(z(je,_e),gt)})},s.result=function(W){return this.map(function(){return W})},s.atMost=function(W){return this.times(0,W)},s.atLeast=function(W){return Ht(this.times(W),this.many(),function(re,ye){return re.concat(ye)})},s.map=function(W){ie(W);var re=this;return o(function(ye,xe){var je=re._(ye,xe);return je.status?Y(z(je.index,W(je.value)),je):je})},s.contramap=function(W){ie(W);var re=this;return o(function(ye,xe){var je=re.parse(W(ye.slice(xe)));return je.status?z(xe+ye.length,je.value):je})},s.promap=function(W,re){return ie(W),ie(re),this.contramap(W).map(re)},s.skip=function(W){return rt(this,W).map(function(re){return re[0]})},s.mark=function(){return Ht(wn,this,wn,function(W,re,ye){return{start:W,value:re,end:ye}})},s.node=function(W){return Ht(wn,this,wn,function(re,ye,xe){return{name:W,value:ye,start:re,end:xe}})},s.sepBy=function(W){return Ze(this,W)},s.sepBy1=function(W){return Ke(this,W)},s.lookahead=function(W){return this.skip(Ct(W))},s.notFollowedBy=function(W){return this.skip(un(W))},s.desc=function(W){B(W)||(W=[W]);var re=this;return o(function(ye,xe){var je=re._(ye,xe);return je.status||(je.expected=W),je})},s.fallback=function(W){return this.or(ft(W))},s.ap=function(W){return Ht(W,this,function(re,ye){return re(ye)})},s.chain=function(W){var re=this;return o(function(ye,xe){var je=re._(ye,xe);return je.status?Y(W(je.value)._(ye,je.index),je):je})},s.concat=s.or,s.empty=an,s.of=ft,s["fantasy-land/ap"]=s.ap,s["fantasy-land/chain"]=s.chain,s["fantasy-land/concat"]=s.concat,s["fantasy-land/empty"]=s.empty,s["fantasy-land/of"]=s.of,s["fantasy-land/map"]=s.map;var wn=o(function(W,re){return z(re,J(W,re))}),Tn=o(function(W,re){return re>=W.length?H(re,"any character/byte"):z(re+1,le(W,re))}),vr=o(function(W,re){return z(W.length,W.slice(re))}),Ia=o(function(W,re){return re<W.length?H(re,"EOF"):z(re,null)}),tr=lt(/[0-9]/).desc("a digit"),Nr=lt(/[0-9]*/).desc("optional digits"),Is=lt(/[a-z]/i).desc("a letter"),ho=lt(/[a-z]*/i).desc("optional letters"),po=lt(/\s*/).desc("optional whitespace"),Nl=lt(/\s+/).desc("whitespace"),Pi=Je("\r"),ji=Je(`
`),Ts=Je(`\r
`),Ho=Se(Ts,ji,Pi).desc("newline"),Li=Se(Ho,Ia);o.all=vr,o.alt=Se,o.any=Tn,o.cr=Pi,o.createLanguage=function(W){var re={};for(var ye in W)({}).hasOwnProperty.call(W,ye)&&function(xe){re[xe]=Ot(function(){return W[xe](re)})}(ye);return re},o.crlf=Ts,o.custom=function(W){return o(W(z,H))},o.digit=tr,o.digits=Nr,o.empty=an,o.end=Li,o.eof=Ia,o.fail=Dt,o.formatError=Ye,o.index=wn,o.isParser=F,o.lazy=Ot,o.letter=Is,o.letters=ho,o.lf=ji,o.lookahead=Ct,o.makeFailure=H,o.makeSuccess=z,o.newline=Ho,o.noneOf=function(W){return Ft(function(re){return W.indexOf(re)<0}).desc("none of '"+W+"'")},o.notFollowedBy=un,o.of=ft,o.oneOf=function(W){for(var re=W.split(""),ye=0;ye<re.length;ye++)re[ye]="'"+re[ye]+"'";return Ft(function(xe){return W.indexOf(xe)>=0}).desc(re)},o.optWhitespace=po,o.Parser=o,o.range=function(W,re){return Ft(function(ye){return W<=ye&&ye<=re}).desc(W+"-"+re)},o.regex=lt,o.regexp=lt,o.sepBy=Ze,o.sepBy1=Ke,o.seq=rt,o.seqMap=Ht,o.seqObj=function(){for(var W,re={},ye=0,xe=(W=arguments,Array.prototype.slice.call(W)),je=xe.length,_e=0;_e<je;_e+=1){var ze=xe[_e];if(!F(ze)){if(B(ze)&&ze.length===2&&typeof ze[0]=="string"&&F(ze[1])){var gt=ze[0];if(Object.prototype.hasOwnProperty.call(re,gt))throw new Error("seqObj: duplicate key "+gt);re[gt]=!0,ye++;continue}throw new Error("seqObj arguments must be parsers or [string, parser] array pairs.")}}if(ye===0)throw new Error("seqObj expects at least one named parser, found zero");return o(function(Vt,On){for(var bn,na={},Pn=0;Pn<je;Pn+=1){var wr,ra;if(B(xe[Pn])?(wr=xe[Pn][0],ra=xe[Pn][1]):(wr=null,ra=xe[Pn]),!(bn=Y(ra._(Vt,On),bn)).status)return bn;wr&&(na[wr]=bn.value),On=bn.index}return Y(z(On,na),bn)})},o.string=Je,o.succeed=ft,o.takeWhile=function(W){return ie(W),o(function(re,ye){for(var xe=ye;xe<re.length&&W(le(re,xe));)xe++;return z(xe,re.slice(ye,xe))})},o.test=Ft,o.whitespace=Nl,o["fantasy-land/empty"]=an,o["fantasy-land/of"]=ft,o.Binary={bitSeq:D,bitSeqObj:function(W){v();var re={},ye=0,xe=p(function(_e){if(B(_e)){var ze=_e;if(ze.length!==2)throw new Error("["+ze.join(", ")+"] should be length 2, got length "+ze.length);if(se(ze[0]),pe(ze[1]),Object.prototype.hasOwnProperty.call(re,ze[0]))throw new Error("duplicate key in bitSeqObj: "+ze[0]);return re[ze[0]]=!0,ye++,ze}return pe(_e),[null,_e]},W);if(ye<1)throw new Error("bitSeqObj expects at least one named pair, got ["+W.join(", ")+"]");var je=p(function(_e){return _e[0]},xe);return D(p(function(_e){return _e[1]},xe)).map(function(_e){return d(function(ze,gt){return gt[0]!==null&&(ze[gt[0]]=gt[1]),ze},{},p(function(ze,gt){return[ze,_e[gt]]},je))})},byte:function(W){if(v(),pe(W),W>255)throw new Error("Value specified to byte constructor ("+W+"=0x"+W.toString(16)+") is larger in value than a single byte.");var re=(W>15?"0x":"0x0")+W.toString(16);return o(function(ye,xe){var je=le(ye,xe);return je===W?z(xe+1,je):H(xe,re)})},buffer:function(W){return S("buffer",W).map(function(re){return Buffer.from(re)})},encodedString:function(W,re){return S("string",re).map(function(ye){return ye.toString(W)})},uintBE:E,uint8BE:E(1),uint16BE:E(2),uint32BE:E(4),uintLE:O,uint8LE:O(1),uint16LE:O(2),uint32LE:O(4),intBE:k,int8BE:k(1),int16BE:k(2),int32BE:k(4),intLE:j,int8LE:j(1),int16LE:j(2),int32LE:j(4),floatBE:S("floatBE",4).map(function(W){return W.readFloatBE(0)}),floatLE:S("floatLE",4).map(function(W){return W.readFloatLE(0)}),doubleBE:S("doubleBE",8).map(function(W){return W.readDoubleBE(0)}),doubleLE:S("doubleLE",8).map(function(W){return W.readDoubleLE(0)})},n.exports=o}])})})(X);var g1=()=>/(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g;function LT(e){return e==null?e:e.shiftToAll().normalize()}function ID(e){return e.includes("/")&&(e=e.substring(e.lastIndexOf("/")+1)),e.endsWith(".md")&&(e=e.substring(0,e.length-3)),e}X.exports.alt(X.exports.regex(new RegExp(g1(),"")),X.exports.regex(/[0-9\p{Letter}_-]+/u).map(e=>e.toLocaleLowerCase()),X.exports.whitespace.map(e=>"-"),X.exports.any.map(e=>"")).many().map(e=>e.join(""));const S6=X.exports.alt(X.exports.regex(new RegExp(g1(),"")),X.exports.regex(/[0-9\p{Letter}_-]+/u),X.exports.whitespace.map(e=>" "),X.exports.any.map(e=>" ")).many().map(e=>e.join("").split(/\s+/).join(" ").trim());function I6(e){return S6.tryParse(e)}function T6(e){return e=LT(e),e=tt.fromObject(Object.fromEntries(Object.entries(e.toObject()).filter(([,t])=>t>0))),e.toHuman()}var np;(function(e){function t(F,B=h1,R=!1){let z=n(F);if(!z)return B.renderNullAs;switch(z.type){case"null":return B.renderNullAs;case"string":return z.value;case"number":case"boolean":return""+z.value;case"html":return z.value.outerHTML;case"widget":return z.value.markdown();case"link":return z.value.markdown();case"function":return"<function>";case"array":let H="";return R&&(H+="["),H+=z.value.map(Y=>t(Y,B,!0)).join(", "),R&&(H+="]"),H;case"object":return"{ "+Object.entries(z.value).map(Y=>Y[0]+": "+t(Y[1],B,!0)).join(", ")+" }";case"date":return z.value.second==0&&z.value.hour==0&&z.value.minute==0?z.value.toFormat(B.defaultDateFormat):z.value.toFormat(B.defaultDateTimeFormat);case"duration":return T6(z.value)}}e.toString=t;function n(F){return v(F)?{type:"null",value:F}:p(F)?{type:"number",value:F}:d(F)?{type:"string",value:F}:S(F)?{type:"boolean",value:F}:g(F)?{type:"duration",value:F}:m(F)?{type:"date",value:F}:E(F)?{type:"widget",value:F}:D(F)?{type:"array",value:F}:T(F)?{type:"link",value:F}:j(F)?{type:"function",value:F}:O(F)?{type:"html",value:F}:k(F)?{type:"object",value:F}:void 0}e.wrapValue=n;function r(F,B){if(k(F)){let R={};for(let[z,H]of Object.entries(F))R[z]=r(H,B);return R}else if(D(F)){let R=[];for(let z of F)R.push(r(z,B));return R}else return B(F)}e.mapLeaves=r;function a(F,B,R){var z,H;if(F===void 0&&(F=null),B===void 0&&(B=null),F===null&&B===null)return 0;if(F===null)return-1;if(B===null)return 1;let Y=n(F),U=n(B);if(Y===void 0&&U===void 0)return 0;if(Y===void 0)return-1;if(U===void 0)return 1;if(Y.type!=U.type)return Y.type.localeCompare(U.type);if(Y.value===U.value)return 0;switch(Y.type){case"string":return Y.value.localeCompare(U.value);case"number":return Y.value<U.value?-1:Y.value==U.value?0:1;case"null":return 0;case"boolean":return Y.value==U.value?0:Y.value?1:-1;case"link":let J=Y.value,Q=U.value,le=R??(ge=>ge),pe=le(J.path).localeCompare(le(Q.path));if(pe!=0)return pe;let ie=J.type.localeCompare(Q.type);return ie!=0?ie:J.subpath&&!Q.subpath?1:!J.subpath&&Q.subpath?-1:!J.subpath&&!Q.subpath?0:((z=J.subpath)!==null&&z!==void 0?z:"").localeCompare((H=Q.subpath)!==null&&H!==void 0?H:"");case"date":return Y.value<U.value?-1:Y.value.equals(U.value)?0:1;case"duration":return Y.value<U.value?-1:Y.value.equals(U.value)?0:1;case"array":let se=Y.value,fe=U.value;for(let ge=0;ge<Math.min(se.length,fe.length);ge++){let Ie=a(se[ge],fe[ge]);if(Ie!=0)return Ie}return se.length-fe.length;case"object":let oe=Y.value,we=U.value,Z=Array.from(Object.keys(oe)),G=Array.from(Object.keys(we));Z.sort(),G.sort();let te=a(Z,G);if(te!=0)return te;for(let ge of Z){let Ie=a(oe[ge],we[ge]);if(Ie!=0)return Ie}return 0;case"widget":case"html":case"function":return 0}}e.compareValue=a;function o(F){var B;return(B=n(F))===null||B===void 0?void 0:B.type}e.typeOf=o;function s(F){let B=n(F);if(!B)return!1;switch(B.type){case"number":return B.value!=0;case"string":return B.value.length>0;case"boolean":return B.value;case"link":return!!B.value.path;case"date":return B.value.toMillis()!=0;case"duration":return B.value.as("seconds")!=0;case"object":return Object.keys(B.value).length>0;case"array":return B.value.length>0;case"null":return!1;case"html":case"widget":case"function":return!0}}e.isTruthy=s;function c(F){if(F==null)return F;if(e.isArray(F))return[].concat(F.map(B=>c(B)));if(e.isObject(F)){let B={};for(let[R,z]of Object.entries(F))B[R]=c(z);return B}else return F}e.deepCopy=c;function d(F){return typeof F=="string"}e.isString=d;function p(F){return typeof F=="number"}e.isNumber=p;function m(F){return F instanceof st}e.isDate=m;function g(F){return F instanceof tt}e.isDuration=g;function v(F){return F==null}e.isNull=v;function D(F){return Array.isArray(F)}e.isArray=D;function S(F){return typeof F=="boolean"}e.isBoolean=S;function T(F){return F instanceof Br}e.isLink=T;function E(F){return F instanceof y1}e.isWidget=E;function O(F){return typeof HTMLElement<"u"?F instanceof HTMLElement:!1}e.isHtml=O;function k(F){return typeof F=="object"&&!O(F)&&!E(F)&&!D(F)&&!g(F)&&!m(F)&&!T(F)&&F!==void 0&&!v(F)}e.isObject=k;function j(F){return typeof F=="function"}e.isFunction=j})(np||(np={}));var TD;(function(e){function t(a){return np.isObject(a)&&Object.keys(a).length==2&&"key"in a&&"rows"in a}e.isElementGroup=t;function n(a){for(let o of a)if(!t(o))return!1;return!0}e.isGrouping=n;function r(a){if(n(a)){let o=0;for(let s of a)o+=r(s.rows);return o}else return a.length}e.count=r})(TD||(TD={}));class Br{constructor(t){Object.assign(this,t)}static file(t,n=!1,r){return new Br({path:t,embed:n,display:r,subpath:void 0,type:"file"})}static infer(t,n=!1,r){if(t.includes("#^")){let a=t.split("#^");return Br.block(a[0],a[1],n,r)}else if(t.includes("#")){let a=t.split("#");return Br.header(a[0],a[1],n,r)}else return Br.file(t,n,r)}static header(t,n,r,a){return new Br({path:t,embed:r,display:a,subpath:I6(n),type:"header"})}static block(t,n,r,a){return new Br({path:t,embed:r,display:a,subpath:n,type:"block"})}static fromObject(t){return new Br(t)}equals(t){return t==null||t==null?!1:this.path==t.path&&this.type==t.type&&this.subpath==t.subpath}toString(){return this.markdown()}toObject(){return{path:this.path,type:this.type,subpath:this.subpath,display:this.display,embed:this.embed}}withPath(t){return new Br(Object.assign({},this,{path:t}))}withDisplay(t){return new Br(Object.assign({},this,{display:t}))}withHeader(t){return Br.header(this.path,t,this.embed,this.display)}toFile(){return Br.file(this.path,this.embed,this.display)}toEmbed(){if(this.embed)return this;{let t=new Br(this);return t.embed=!0,t}}fromEmbed(){if(this.embed){let t=new Br(this);return t.embed=!1,t}else return this}markdown(){let t=(this.embed?"!":"")+"[["+this.obsidianLink();return this.display?t+="|"+this.display:(t+="|"+ID(this.path),(this.type=="header"||this.type=="block")&&(t+=" > "+this.subpath)),t+="]]",t}obsidianLink(){var t,n;const r=this.path.replace("|","\\|");return this.type=="header"?r+"#"+((t=this.subpath)===null||t===void 0?void 0:t.replace("|","\\|")):this.type=="block"?r+"#^"+((n=this.subpath)===null||n===void 0?void 0:n.replace("|","\\|")):r}fileName(){return ID(this.path).replace(".md","")}}class y1{constructor(t){this.$widget=t}}class E6 extends y1{constructor(t,n){super("dataview:list-pair"),this.key=t,this.value=n}markdown(){return`${np.toString(this.key)}: ${np.toString(this.value)}`}}class C6 extends y1{constructor(t,n){super("dataview:external-link"),this.url=t,this.display=n}markdown(){var t;return`[${(t=this.display)!==null&&t!==void 0?t:this.url}](${this.url})`}}var ED;(function(e){function t(s,c){return new E6(s,c)}e.listPair=t;function n(s,c){return new C6(s,c)}e.externalLink=n;function r(s){return s.$widget==="dataview:list-pair"}e.isListPair=r;function a(s){return s.$widget==="dataview:external-link"}e.isExternalLink=a;function o(s){return r(s)||a(s)}e.isBuiltin=o})(ED||(ED={}));var Nn;(function(e){function t(v){return{type:"variable",name:v}}e.variable=t;function n(v){return{type:"literal",value:v}}e.literal=n;function r(v,D,S){return{type:"binaryop",left:v,op:D,right:S}}e.binaryOp=r;function a(v,D){return{type:"index",object:v,index:D}}e.index=a;function o(v){let D=v.split("."),S=e.variable(D[0]);for(let T=1;T<D.length;T++)S=e.index(S,e.literal(D[T]));return S}e.indexVariable=o;function s(v,D){return{type:"lambda",arguments:v,value:D}}e.lambda=s;function c(v,D){return{type:"function",func:v,arguments:D}}e.func=c;function d(v){return{type:"list",values:v}}e.list=d;function p(v){return{type:"object",values:v}}e.object=p;function m(v){return{type:"negated",child:v}}e.negate=m;function g(v){return v=="<="||v=="<"||v==">"||v==">="||v=="!="||v=="="}e.isCompareOp=g,e.NULL=e.literal(null)})(Nn||(Nn={}));var Ti;(function(e){function t(m){return{type:"tag",tag:m}}e.tag=t;function n(m){return{type:"csv",path:m}}e.csv=n;function r(m){return{type:"folder",folder:m}}e.folder=r;function a(m,g){return{type:"link",file:m,direction:g?"incoming":"outgoing"}}e.link=a;function o(m,g,v){return{type:"binaryop",left:m,op:g,right:v}}e.binaryOp=o;function s(m,g){return{type:"binaryop",left:m,op:"&",right:g}}e.and=s;function c(m,g){return{type:"binaryop",left:m,op:"|",right:g}}e.or=c;function d(m){return{type:"negate",child:m}}e.negate=d;function p(){return{type:"empty"}}e.empty=p})(Ti||(Ti={}));const CD=new RegExp(g1(),""),Ew={year:tt.fromObject({years:1}),years:tt.fromObject({years:1}),yr:tt.fromObject({years:1}),yrs:tt.fromObject({years:1}),month:tt.fromObject({months:1}),months:tt.fromObject({months:1}),mo:tt.fromObject({months:1}),mos:tt.fromObject({months:1}),week:tt.fromObject({weeks:1}),weeks:tt.fromObject({weeks:1}),wk:tt.fromObject({weeks:1}),wks:tt.fromObject({weeks:1}),w:tt.fromObject({weeks:1}),day:tt.fromObject({days:1}),days:tt.fromObject({days:1}),d:tt.fromObject({days:1}),hour:tt.fromObject({hours:1}),hours:tt.fromObject({hours:1}),hr:tt.fromObject({hours:1}),hrs:tt.fromObject({hours:1}),h:tt.fromObject({hours:1}),minute:tt.fromObject({minutes:1}),minutes:tt.fromObject({minutes:1}),min:tt.fromObject({minutes:1}),mins:tt.fromObject({minutes:1}),m:tt.fromObject({minutes:1}),second:tt.fromObject({seconds:1}),seconds:tt.fromObject({seconds:1}),sec:tt.fromObject({seconds:1}),secs:tt.fromObject({seconds:1}),s:tt.fromObject({seconds:1})},Cw={now:()=>st.local(),today:()=>st.local().startOf("day"),yesterday:()=>st.local().startOf("day").minus(tt.fromObject({days:1})),tomorrow:()=>st.local().startOf("day").plus(tt.fromObject({days:1})),sow:()=>st.local().startOf("week"),"start-of-week":()=>st.local().startOf("week"),eow:()=>st.local().endOf("week"),"end-of-week":()=>st.local().endOf("week"),soy:()=>st.local().startOf("year"),"start-of-year":()=>st.local().startOf("year"),eoy:()=>st.local().endOf("year"),"end-of-year":()=>st.local().endOf("year"),som:()=>st.local().startOf("month"),"start-of-month":()=>st.local().startOf("month"),eom:()=>st.local().endOf("month"),"end-of-month":()=>st.local().endOf("month")},xw=["FROM","WHERE","LIMIT","GROUP","FLATTEN"];function x6(e){let t=-1;for(;(t=e.indexOf("|",t+1))>=0;)if(!(t>0&&e[t-1]=="\\"))return[e.substring(0,t).replace(/\\\|/g,"|"),e.substring(t+1)];return[e.replace(/\\\|/g,"|"),void 0]}function M6(e){let[t,n]=x6(e);return Br.infer(t,!1,n)}function Oh(e,t,n){return X.exports.seqMap(e,X.exports.seq(X.exports.optWhitespace,t,X.exports.optWhitespace,e).many(),(r,a)=>{if(a.length==0)return r;let o=n(r,a[0][1],a[0][3]);for(let s=1;s<a.length;s++)o=n(o,a[s][1],a[s][3]);return o})}function N6(e,...t){return X.exports.custom((n,r)=>(a,o)=>{let s=e._(a,o);if(!s.status)return s;for(let c of t){let d=c(s.value)._(a,s.index);if(!d.status)return s;s=d}return s})}const Ao=X.exports.createLanguage({number:e=>X.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map(t=>Number.parseFloat(t)).desc("number"),string:e=>X.exports.string('"').then(X.exports.alt(e.escapeCharacter,X.exports.noneOf('"\\')).atLeast(0).map(t=>t.join(""))).skip(X.exports.string('"')).desc("string"),escapeCharacter:e=>X.exports.string("\\").then(X.exports.any).map(t=>t==='"'?'"':t==="\\"?"\\":"\\"+t),bool:e=>X.exports.regexp(/true|false|True|False/).map(t=>t.toLowerCase()=="true").desc("boolean ('true' or 'false')"),tag:e=>X.exports.seqMap(X.exports.string("#"),X.exports.alt(X.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(),(t,n)=>t+n.join("")).desc("tag ('#hello/stuff')"),identifier:e=>X.exports.seqMap(X.exports.alt(X.exports.regexp(new RegExp("\\p{Letter}","u")),X.exports.regexp(CD).desc("text")),X.exports.alt(X.exports.regexp(/[0-9\p{Letter}_-]/u),X.exports.regexp(CD).desc("text")).many(),(t,n)=>t+n.join("")).desc("variable identifier"),link:e=>X.exports.regexp(/\[\[([^\[\]]*?)\]\]/u,1).map(t=>M6(t)).desc("file link"),embedLink:e=>X.exports.seqMap(X.exports.string("!").atMost(1),e.link,(t,n)=>(t.length>0&&(n.embed=!0),n)).desc("file link"),binaryPlusMinus:e=>X.exports.regexp(/\+|-/).map(t=>t).desc("'+' or '-'"),binaryMulDiv:e=>X.exports.regexp(/\*|\/|%/).map(t=>t).desc("'*' or '/' or '%'"),binaryCompareOp:e=>X.exports.regexp(/>=|<=|!=|>|<|=/).map(t=>t).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"),binaryBooleanOp:e=>X.exports.regexp(/and|or|&|\|/i).map(t=>t.toLowerCase()=="and"?"&":t.toLowerCase()=="or"?"|":t).desc("'and' or 'or'"),rootDate:e=>X.exports.seqMap(X.exports.regexp(/\d{4}/),X.exports.string("-"),X.exports.regexp(/\d{2}/),(t,n,r)=>st.fromObject({year:Number.parseInt(t),month:Number.parseInt(r)})).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),dateShorthand:e=>X.exports.alt(...Object.keys(Cw).sort((t,n)=>n.length-t.length).map(X.exports.string)),date:e=>N6(e.rootDate,t=>X.exports.seqMap(X.exports.string("-"),X.exports.regexp(/\d{2}/),(n,r)=>t.set({day:Number.parseInt(r)})),t=>X.exports.seqMap(X.exports.string("T"),X.exports.regexp(/\d{2}/),(n,r)=>t.set({hour:Number.parseInt(r)})),t=>X.exports.seqMap(X.exports.string(":"),X.exports.regexp(/\d{2}/),(n,r)=>t.set({minute:Number.parseInt(r)})),t=>X.exports.seqMap(X.exports.string(":"),X.exports.regexp(/\d{2}/),(n,r)=>t.set({second:Number.parseInt(r)})),t=>X.exports.alt(X.exports.seqMap(X.exports.string("."),X.exports.regexp(/\d{3}/),(n,r)=>t.set({millisecond:Number.parseInt(r)})),X.exports.succeed(t)),t=>X.exports.alt(X.exports.seqMap(X.exports.string("+").or(X.exports.string("-")),X.exports.regexp(/\d{1,2}(:\d{2})?/),(n,r)=>t.setZone("UTC"+n+r,{keepLocalTime:!0})),X.exports.seqMap(X.exports.string("Z"),()=>t.setZone("utc",{keepLocalTime:!0})),X.exports.seqMap(X.exports.string("["),X.exports.regexp(/[0-9A-Za-z+-\/]+/u),X.exports.string("]"),(n,r,a)=>t.setZone(r,{keepLocalTime:!0})))).assert(t=>t.isValid,"valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"),datePlus:e=>X.exports.alt(e.dateShorthand.map(t=>Cw[t]()),e.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"),durationType:e=>X.exports.alt(...Object.keys(Ew).sort((t,n)=>n.length-t.length).map(X.exports.string)),duration:e=>X.exports.seqMap(e.number,X.exports.optWhitespace,e.durationType,(t,n,r)=>Ew[r].mapUnits(a=>a*t)).sepBy1(X.exports.string(",").trim(X.exports.optWhitespace).or(X.exports.optWhitespace)).map(t=>t.reduce((n,r)=>n.plus(r))).desc("duration like 4hr2min"),rawNull:e=>X.exports.string("null"),tagSource:e=>e.tag.map(t=>Ti.tag(t)),csvSource:e=>X.exports.seqMap(X.exports.string("csv(").skip(X.exports.optWhitespace),e.string,X.exports.string(")"),(t,n,r)=>Ti.csv(n)),linkIncomingSource:e=>e.link.map(t=>Ti.link(t.path,!0)),linkOutgoingSource:e=>X.exports.seqMap(X.exports.string("outgoing(").skip(X.exports.optWhitespace),e.link,X.exports.string(")"),(t,n,r)=>Ti.link(n.path,!1)),folderSource:e=>e.string.map(t=>Ti.folder(t)),parensSource:e=>X.exports.seqMap(X.exports.string("("),X.exports.optWhitespace,e.source,X.exports.optWhitespace,X.exports.string(")"),(t,n,r,a,o)=>r),negateSource:e=>X.exports.seqMap(X.exports.alt(X.exports.string("-"),X.exports.string("!")),e.atomSource,(t,n)=>Ti.negate(n)),atomSource:e=>X.exports.alt(e.parensSource,e.negateSource,e.linkOutgoingSource,e.linkIncomingSource,e.folderSource,e.tagSource,e.csvSource),binaryOpSource:e=>Oh(e.atomSource,e.binaryBooleanOp.map(t=>t),Ti.binaryOp),source:e=>e.binaryOpSource,variableField:e=>e.identifier.chain(t=>xw.includes(t.toUpperCase())?X.exports.fail("Variable fields cannot be a keyword ("+xw.join(" or ")+")"):X.exports.succeed(Nn.variable(t))).desc("variable"),numberField:e=>e.number.map(t=>Nn.literal(t)).desc("number"),stringField:e=>e.string.map(t=>Nn.literal(t)).desc("string"),boolField:e=>e.bool.map(t=>Nn.literal(t)).desc("boolean"),dateField:e=>X.exports.seqMap(X.exports.string("date("),X.exports.optWhitespace,e.datePlus,X.exports.optWhitespace,X.exports.string(")"),(t,n,r,a,o)=>Nn.literal(r)).desc("date"),durationField:e=>X.exports.seqMap(X.exports.string("dur("),X.exports.optWhitespace,e.duration,X.exports.optWhitespace,X.exports.string(")"),(t,n,r,a,o)=>Nn.literal(r)).desc("duration"),nullField:e=>e.rawNull.map(t=>Nn.NULL),linkField:e=>e.link.map(t=>Nn.literal(t)),listField:e=>e.field.sepBy(X.exports.string(",").trim(X.exports.optWhitespace)).wrap(X.exports.string("[").skip(X.exports.optWhitespace),X.exports.optWhitespace.then(X.exports.string("]"))).map(t=>Nn.list(t)).desc("list ('[1, 2, 3]')"),objectField:e=>X.exports.seqMap(e.identifier.or(e.string),X.exports.string(":").trim(X.exports.optWhitespace),e.field,(t,n,r)=>({name:t,value:r})).sepBy(X.exports.string(",").trim(X.exports.optWhitespace)).wrap(X.exports.string("{").skip(X.exports.optWhitespace),X.exports.optWhitespace.then(X.exports.string("}"))).map(t=>{let n={};for(let r of t)n[r.name]=r.value;return Nn.object(n)}).desc("object ('{ a: 1, b: 2 }')"),atomInlineField:e=>X.exports.alt(e.date,e.duration.map(t=>LT(t)),e.string,e.tag,e.embedLink,e.bool,e.number,e.rawNull),inlineFieldList:e=>e.atomInlineField.sepBy(X.exports.string(",").trim(X.exports.optWhitespace).lookahead(e.atomInlineField)),inlineField:e=>X.exports.alt(X.exports.seqMap(e.atomInlineField,X.exports.string(",").trim(X.exports.optWhitespace),e.inlineFieldList,(t,n,r)=>[t].concat(r)),e.atomInlineField),atomField:e=>X.exports.alt(e.embedLink.map(t=>Nn.literal(t)),e.negatedField,e.linkField,e.listField,e.objectField,e.lambdaField,e.parensField,e.boolField,e.numberField,e.stringField,e.dateField,e.durationField,e.nullField,e.variableField),indexField:e=>X.exports.seqMap(e.atomField,X.exports.alt(e.dotPostfix,e.indexPostfix,e.functionPostfix).many(),(t,n)=>{let r=t;for(let a of n)switch(a.type){case"dot":r=Nn.index(r,Nn.literal(a.field));break;case"index":r=Nn.index(r,a.field);break;case"function":r=Nn.func(r,a.fields);break}return r}),negatedField:e=>X.exports.seqMap(X.exports.string("!"),e.indexField,(t,n)=>Nn.negate(n)).desc("negated field"),parensField:e=>X.exports.seqMap(X.exports.string("("),X.exports.optWhitespace,e.field,X.exports.optWhitespace,X.exports.string(")"),(t,n,r,a,o)=>r),lambdaField:e=>X.exports.seqMap(e.identifier.sepBy(X.exports.string(",").trim(X.exports.optWhitespace)).wrap(X.exports.string("(").trim(X.exports.optWhitespace),X.exports.string(")").trim(X.exports.optWhitespace)),X.exports.string("=>").trim(X.exports.optWhitespace),e.field,(t,n,r)=>({type:"lambda",arguments:t,value:r})),dotPostfix:e=>X.exports.seqMap(X.exports.string("."),e.identifier,(t,n)=>({type:"dot",field:n})),indexPostfix:e=>X.exports.seqMap(X.exports.string("["),X.exports.optWhitespace,e.field,X.exports.optWhitespace,X.exports.string("]"),(t,n,r,a,o)=>({type:"index",field:r})),functionPostfix:e=>X.exports.seqMap(X.exports.string("("),X.exports.optWhitespace,e.field.sepBy(X.exports.string(",").trim(X.exports.optWhitespace)),X.exports.optWhitespace,X.exports.string(")"),(t,n,r,a,o)=>({type:"function",fields:r})),binaryMulDivField:e=>Oh(e.indexField,e.binaryMulDiv,Nn.binaryOp),binaryPlusMinusField:e=>Oh(e.binaryMulDivField,e.binaryPlusMinus,Nn.binaryOp),binaryCompareField:e=>Oh(e.binaryPlusMinusField,e.binaryCompareOp,Nn.binaryOp),binaryBooleanField:e=>Oh(e.binaryCompareField,e.binaryBooleanOp,Nn.binaryOp),binaryOpField:e=>e.binaryBooleanField,field:e=>e.binaryOpField});function k6(e){try{return dy.success(Ao.field.tryParse(e))}catch(t){return dy.failure(""+t)}}var fy;(function(e){function t(r,a){return{name:r,field:a}}e.named=t;function n(r,a){return{field:r,direction:a}}e.sortBy=n})(fy||(fy={}));function A6(e){return X.exports.custom((t,n)=>(r,a)=>{let o=e._(r,a);return o.status?Object.assign({},o,{value:[o.value,r.substring(a,o.index)]}):o})}function F6(e){return e.split(/[\r\n]+/).map(t=>t.trim()).join("")}const O6=X.exports.createLanguage({queryType:e=>X.exports.alt(X.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map(t=>t.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"),explicitNamedField:e=>X.exports.seqMap(Ao.field.skip(X.exports.whitespace),X.exports.regexp(/AS/i).skip(X.exports.whitespace),Ao.identifier.or(Ao.string),(t,n,r)=>fy.named(r,t)),namedField:e=>X.exports.alt(e.explicitNamedField,A6(Ao.field).map(([t,n])=>fy.named(F6(n),t))),sortField:e=>X.exports.seqMap(Ao.field.skip(X.exports.optWhitespace),X.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1),(t,n)=>{let r=n.length==0?"ascending":n[0].toLowerCase();return r=="desc"&&(r="descending"),r=="asc"&&(r="ascending"),{field:t,direction:r}}),headerClause:e=>e.queryType.skip(X.exports.whitespace).chain(t=>{switch(t){case"table":return X.exports.seqMap(X.exports.regexp(/WITHOUT\s+ID/i).skip(X.exports.optWhitespace).atMost(1),X.exports.sepBy(e.namedField,X.exports.string(",").trim(X.exports.optWhitespace)),(n,r)=>({type:"table",fields:r,showId:n.length==0}));case"list":return X.exports.seqMap(X.exports.regexp(/WITHOUT\s+ID/i).skip(X.exports.optWhitespace).atMost(1),Ao.field.atMost(1),(n,r)=>({type:"list",format:r.length==1?r[0]:void 0,showId:n.length==0}));case"task":return X.exports.succeed({type:"task"});case"calendar":return X.exports.seqMap(e.namedField,n=>({type:"calendar",showId:!0,field:n}));default:return X.exports.fail(`Unrecognized query type '${t}'`)}}).desc("TABLE or LIST or TASK or CALENDAR"),fromClause:e=>X.exports.seqMap(X.exports.regexp(/FROM/i),X.exports.whitespace,Ao.source,(t,n,r)=>r),whereClause:e=>X.exports.seqMap(X.exports.regexp(/WHERE/i),X.exports.whitespace,Ao.field,(t,n,r)=>({type:"where",clause:r})).desc("WHERE <expression>"),sortByClause:e=>X.exports.seqMap(X.exports.regexp(/SORT/i),X.exports.whitespace,e.sortField.sepBy1(X.exports.string(",").trim(X.exports.optWhitespace)),(t,n,r)=>({type:"sort",fields:r})).desc("SORT field [ASC/DESC]"),limitClause:e=>X.exports.seqMap(X.exports.regexp(/LIMIT/i),X.exports.whitespace,Ao.field,(t,n,r)=>({type:"limit",amount:r})).desc("LIMIT <value>"),flattenClause:e=>X.exports.seqMap(X.exports.regexp(/FLATTEN/i).skip(X.exports.whitespace),e.namedField,(t,n)=>({type:"flatten",field:n})).desc("FLATTEN <value> [AS <name>]"),groupByClause:e=>X.exports.seqMap(X.exports.regexp(/GROUP BY/i).skip(X.exports.whitespace),e.namedField,(t,n)=>({type:"group",field:n})).desc("GROUP BY <value> [AS <name>]"),clause:e=>X.exports.alt(e.fromClause,e.whereClause,e.sortByClause,e.limitClause,e.groupByClause,e.flattenClause),query:e=>X.exports.seqMap(e.headerClause.trim(X.exports.optWhitespace),e.fromClause.trim(X.exports.optWhitespace).atMost(1),e.clause.trim(X.exports.optWhitespace).many(),(t,n,r)=>({header:t,source:n.length==0?Ti.folder(""):n[0],operations:r,settings:h1}))}),P6=e=>{var t;return e?(t=e.plugins.plugins.dataview)===null||t===void 0?void 0:t.api:window.DataviewAPI},j6=e=>e.plugins.enabledPlugins.has("dataview");Ds.DATE_SHORTHANDS=Cw;Ds.DURATION_TYPES=Ew;Ds.EXPRESSION=Ao;Ds.KEYWORDS=xw;Ds.QUERY_LANGUAGE=O6;var L6=Ds.getAPI=P6;Ds.isPluginEnabled=j6;Ds.parseField=k6;async function R6(e,t,n,r,a){var E,O;const{vault:o,metadataCache:s}=Ee.getState().dailyNotesState.app===void 0?app:Ee.getState().dailyNotesState.app,c=Ee.getState().dailyNotesState.settings,d=e.replace(/\n/g,"<br>");if(n===void 0)return;const p=s.getFirstLinkpathDest("",n),m=C.moment(),g=m.format("YYYYMMDDHHmmss"),v=r.slice(14),D=" ",S=g+" "+d.trim(),T=D+"- "+g+" "+d.trim();if(p){let k;if(c!=null&&c.CommentOnMemos&&(c!=null&&c.CommentsInOriginalNotes)){const R=L6();if(R!==void 0)try{k=(O=(E=R.page(p.path))==null?void 0:E.file.lists.values)==null?void 0:O.filter(z=>z.line===parseInt(v))}catch(z){console.error(z)}}const j=await o.read(p);let F=0;k[0].children.values.length>0?F=k[0].children.values[k[0].children.values.length-1].line:F=k[0].line;const B=await B6(T,j,F);if(await o.modify(p,B.content),t)return{id:g+(F+1),content:S,deletedAt:"",createdAt:m.format("YYYY/MM/DD HH:mm:ss"),updatedAt:m.format("YYYY/MM/DD HH:mm:ss"),thinoType:"JOURNAL",path:p.path,hasId:"",linkId:a}}}async function B6(e,t,n){if(n===-1)return{content:`${t}
${e}`,posNum:-1};const r=t.split(`
`),a=r.slice(0,n+1).join(`
`),o=r.slice(n+1).join(`
`);return/^\s*$/g.test(r[n+1])?{content:`${a}
${e}
${o}`,posNum:n}:{content:`${a}
${e}
${o}`,posNum:n}}function _6(e,t,n){var a;const r=t.workspace.getLeavesOfType("markdown");for(const o of r){const s=o.view;if(((a=s==null?void 0:s.file)==null?void 0:a.path)===e){t.workspace.revealLeaf(o);try{return o.view.setEphemeralState({line:n}),!0}catch(c){return console.error(c),!1}}}return!1}const v1=async e=>{var o;const t=Xe.getState().app,n=t.workspace.getLeavesOfType("markdown");for(const s of n){const c=s.view;if(((o=c==null?void 0:c.file)==null?void 0:o.path)===e){t.workspace.revealLeaf(s);return}}const r=t.metadataCache.getFirstLinkpathDest("",e);if(!r){new C.Notice(N("File not found for the given thino path"));return}await t.workspace.getLeaf(!0).openFile(r)},w1=async(e,t)=>{const{app:n}=Xe.getState(),r=parseInt(e.slice(14));if(_6(t,n,r))return;const a=n.metadataCache.getFirstLinkpathDest("",t);if(!C.Platform.isMobile)await n.workspace.getLeaf(!0).openFile(a,{eState:{line:r}});else{let o=n.workspace.activeLeaf;o===null&&(o=n.workspace.getLeaf(!0)),await o.openFile(a,{eState:{line:r}})}},b1=async(e,t)=>{var p,m,g;const n=Xe.getState().app,r=n.metadataCache.getFirstLinkpathDest("",t);if(!r){new C.Notice(N("File not found for the given thino path"));return}let a="";try{a=await n.vault.read(r)}catch(v){console.error(v),a=await n.vault.cachedRead(r)}const s=a.split(/\r?\n/).findIndex(v=>v.contains(e)),c=n.workspace.getLeavesOfType("markdown");for(const v of c){const D=v.view;if(((p=D==null?void 0:D.file)==null?void 0:p.path)===r.path){n.workspace.revealLeaf(v);try{(m=v.view.editor)==null||m.setCursor({line:s,ch:1});return}catch(S){console.error(S)}}}const d=n.workspace.getLeaf(!0);await d.openFile(r,{eState:{line:s}});try{(g=d.view.editor)==null||g.setCursor({line:s,ch:1})}catch(v){console.error(v)}},D1=async(e,t)=>{var c;const n=Xe.getState().app,r=(d,p)=>{var g;const m=(g=Array.from(d.nodes.values()))==null?void 0:g.find(v=>v.id===p);return m?(d.selectOnly(m),d.zoomToSelection(),!0):!1},a=n.workspace.getLeavesOfType("canvas");for(const d of a){const p=d.view;if(((c=p==null?void 0:p.file)==null?void 0:c.path)===t&&(n.workspace.revealLeaf(d),r(p.canvas,e)))return}const o=n.metadataCache.getFirstLinkpathDest("",t);if(!o){new C.Notice(N("File not found for the given thino path"));return}const s=n.workspace.getLeaf(!0);await s.openFile(o),setTimeout(()=>{var d;r((d=s.view)==null?void 0:d.canvas,e)},10)},H6="https://api.thino.pkmer.cn/test",Vd=H6,Y6="unknown",z6=/!\[(?<content>[^\]]+)\]\((?<link>[^)]+)\)/g;function U6(e){return e.substring(e.lastIndexOf(".")+1)}function V6(e){return{id:e.id,createdAt:Date.now().toString(),filename:e.id,type:`${U6(e.id)}`,size:e.size.toString()}}function Z6(e){const t=e==null?void 0:e.matchAll(z6);return t?Array.from(t).map(n=>{var r;return V6({url:(r=n.groups)==null?void 0:r.link,id:Y6,size:0,mtime:""})}).filter(n=>n.type!="html"):[]}function kp(e){var t;return{id:e.id,createdAt:C.moment(e.ctime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),updatedAt:C.moment(e.mtime.toString(),"x").format("YYYY/MM/DD HH:mm:ss"),deletedAt:(t=e.ttime)!=null&&t.toString()?C.moment(e.ttime.toString(),"x").format("YYYY-MM-DD HH:mm:ss"):"",rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,resourceList:Z6(e.content),creatorName:"thino",sourceType:(e==null?void 0:e.thinoType)||"FILE",visibility:"PUBLIC",localId:e.originalId,deleted:!!e.dtime}}async function W6(e){const n={url:`${Vd}/thino/getThinos${e?`?since=${e}&includeDeleted=true`:""}`,method:"GET",headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to fetch memos: ${r.status}`);try{return r.json.payload.map(o=>kp(o))}catch(a){console.error(`Error processing memo response: ${a}`)}}).catch(r=>(console.error(r),[]))}function Zd(){const e=Ee.getState().dailyNotesState.app||app;return(e==null?void 0:e.loadLocalStorage("tokenForSync"))||""}async function RT(e){const t=`${Vd}/thino/createThino`,n={content:e.content,thinoType:(e==null?void 0:e.thinoType)||"FILE",pinned:!1,rowStatus:"NORMAL",encrypted:!1},r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create memo: ${a.status}`);try{const o=a.json;return kp(o.payload)}catch(o){console.error(`Error processing memo creation response: ${o}`)}}).catch(a=>(console.error(a),null))}function $6(e){return{id:e.id,ctime:C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").valueOf(),mtime:C.moment(e.updatedAt,"YYYY/MM/DD HH:mm:ss").valueOf(),ttime:e.deletedAt?C.moment(e.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():void 0,rowStatus:e.rowStatus,content:e.content,pinned:e.pinned,encrypted:!1,thinoType:e.sourceType==="DAILY"?"DAILY":"FILE",tags:[]}}async function G6(e){const t=`${Vd}/thino/createThinosByData`,n=e.map(a=>$6(a)),r={url:t,method:"POST",contentType:"application/json",body:JSON.stringify(n),headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(r).then(a=>{a.status>=400&&console.error(`Failed to create thinos: ${a.status}`);try{return a.json.payload.map(c=>kp(c))}catch(o){console.error(`Error processing thinos creation response: ${o}`)}}).catch(a=>(console.error(a),[]))}async function k0(e){const n={url:`${Vd}/thino/updateThinoById/${e.id}`,method:"POST",contentType:"application/json",body:JSON.stringify(e),headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to update memo: ${r.status}`);try{const a=r.json;return kp(a.payload)}catch(a){console.error(`Error processing memo update response: ${a}`)}}).catch(r=>(console.error(r),null))}async function BT(e){const n={url:`${Vd}/thino/recoverThinoFromTrash/${e}`,method:"POST",headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to recover memo: ${r.status}`);try{const a=r.json;return kp(a.payload)}catch(a){console.error(`Error processing memo recovery response: ${a}`)}}).catch(r=>(console.error(r),null))}async function q6(e){const n={url:`${Vd}/thino/deleteThinoById/${e}`,method:"DELETE",headers:{Authorization:`Bearer ${Zd()}`}};return C.requestUrl(n).then(r=>{r.status>=400&&console.error(`Failed to delete memo: ${r.status}`)}).catch(r=>(console.error(r),null))}class J6{constructor(){me(this,"initialized",!1)}getState(){return Ee.getState().memoState}async fetchAllMemos(){const t=Xe.getState().settings;Ue.checkDailyInMulti(t);const n=await ya.getMyMemos(t.EnabledLocationList.map(o=>o.value)),r=[...n.memos],a=[...n.commentMemos];return Ee.dispatch({type:"SET_MEMOS",payload:{memos:r}}),Ee.dispatch({type:"SET_COMMENT_MEMOS",payload:{commentMemos:a}}),this.initialized||(this.initialized=!0,Qe.setLoaded(!0)),r}async updateTypeMemos(t){const n=await ya.updateSpecificTypeMemo(t),r=this.getState().memos.filter(a=>a.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...r,...n.memos]}})}async removeTypeMemos(t){const n=this.getState().memos.filter(r=>r.sourceType!==t);Ee.dispatch({type:"SET_MEMOS",payload:{memos:[...n]}})}async fetchDeletedMemos(){const t=await ya.getMyDeletedMemos();return t.sort((n,r)=>Ue.getTimeStampByDate(r.deletedAt)-Ue.getTimeStampByDate(n.deletedAt)),t}pushMemo(t){Ee.dispatch({type:"INSERT_MEMO",payload:{memo:{...t}}})}pushCommentMemo(t){Ee.dispatch({type:"INSERT_COMMENT_MEMO",payload:{memo:{...t}}})}getMemoById(t){for(const n of this.getState().memos)if(n.id===t)return n;return null}getCommentMemoById(t){for(const n of this.getState().commentMemos)if(n.id===t)return n;return null}getMemoByWebId(t){for(const n of this.getState().memos)if(n.webId===t||n.id===t)return n;return null}async updateMemoById(t,n,r){const a=this.getMemoByWebId(t);if(!a)return;let o=null;const s=r?{}:{content:n.content,rowStatus:n.rowStatus,pinned:n.pinned,deleted:!!n.deletedAt,thinoType:n.thinoType??""};switch(a.sourceType){case"DAILY":o=await Ii(a,{id:a.id,webId:n.id,...s});break;case"CANVAS":o=await Si(a,{id:a.id,webId:n.id,...s});break;case"MULTI":o=await Fo(a,{id:a.id,webId:n.id,...s});break;case"FILE":o=await Di(a,{id:a.id,webId:n.id,...s});break}if(!o)return a;Ee.dispatch({type:"EDIT_MEMO",payload:o})}async archiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ii(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"CANVAS":a=await Si(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"MULTI":a=await Fo(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break;case"FILE":a=await Di(r,{id:r.id,rowStatus:"ARCHIVED"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async archiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ii(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"CANVAS":n=await Si(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"MULTI":n=await Fo(t,{id:t.id,rowStatus:"ARCHIVED"});break;case"FILE":n=await Di(t,{id:t.id,rowStatus:"ARCHIVED"});break}return n?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID",payload:n}),n):t}async unarchiveThinoBulk(t){const n=[];for(const r of t){let a;switch(r.sourceType){case"DAILY":a=await Ii(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"CANVAS":a=await Si(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"MULTI":a=await Fo(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break;case"FILE":a=await Di(r,{id:r.id,rowStatus:"NORMAL"}),n.push(a);break}}return n.length>0?(Ee.dispatch({type:"ARCHIVE_MEMO_BY_ID_BULK",payload:n}),n):t}async unarchiveMemo(t){let n=null;switch(t.sourceType){case"DAILY":n=await Ii(t,{id:t.id,rowStatus:"NORMAL"});break;case"CANVAS":n=await Si(t,{id:t.id,rowStatus:"NORMAL"});break;case"MULTI":n=await Fo(t,{id:t.id,rowStatus:"NORMAL"});break;case"FILE":n=await Di(t,{id:t.id,rowStatus:"NORMAL"});break}return Ee.dispatch({type:"UNARCHIVE_MEMO_BY_ID",payload:n}),n}async hideMemoById(t){const n=this.getMemoById(t);if(!n)return n;let r=null;switch(n.sourceType){case"DAILY":r=await Ii(n,{id:n.id,deleted:!0});break;case"CANVAS":r=await Si(n,{id:n.id,deleted:!0});break;case"MULTI":r=await Fo(n,{id:n.id,deleted:!0});break;case"FILE":r=await Di(n,{id:n.id,deleted:!0});break}if(!r)return n;if(r)return r}async restoreMemoById(t){return await ya.restoreMemo(t)}async deleteMemoById(t,n){const r=this.getMemoById(t);try{switch(r.sourceType){case"DAILY":await ya.deleteMemoInDailyNote(r);break;case"CANVAS":await ya.deleteMemoInCanvas(r);break;case"MULTI":await ya.deleteMemoInMultiFiles(r);break;case"FILE":await ya.deleteMemoInSingleFile(r);break}Ee.dispatch({type:"DELETE_MEMO_BY_ID",payload:{id:t}})}catch(c){console.error(c),new C.Notice(N("Failed to delete memo"))}if(n&&n==="local")return;const a=Xe.getState().settings,o=Xe.getState().app;!(o!=null&&o.loadLocalStorage("tokenForSync"))||!a.startSync||r.webId&&await q6(r.webId)}async removeMemosInFile(t,n){var a,o;const r=[];try{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n)await gw(t,r);else if(t.path.contains("thino.canvas"))await yw(t,r);else if((a=t==null?void 0:t.parent)!=null&&a.path.contains(n)||!(t!=null&&t.parent)&&!((o=t==null?void 0:t.parent)!=null&&o.path)){const c=this.getState().memos.filter(d=>d.path.trim()===t.path.trim());c.length>0&&r.push(...c)}else t.path.endsWith(".md")&&t.path.contains(".thino")&&await mw(t,r);const s=r.map(c=>c.id);Ee.dispatch({type:"DELETE_MEMO_BY_ID_BATCH",payload:{ids:s}})}catch(s){console.error(s)}}async updateMemosInFile(t,n){const r=[],a=async()=>{if(t.path.endsWith(".md")&&!t.path.contains(".thino")&&!n){await gw(t,r);return}else if(t.path.contains("thino.canvas")){await yw(t,r);return}else if(t!=null&&t.parent.path.contains(n)&&!t.path.endsWith(".thino.md")){await PI(t,r);return}else if(t.path.endsWith(".md")&&t.path.contains(".thino")){await mw(t,r);return}};try{await a(),Ee.dispatch({type:"UPDATE_MEMO_BATCH",payload:{memos:r,path:t.path}})}catch(o){console.error(o)}}async updateMemoProperty(t){const n=Ue.randomId(16),r=await Fo(t,{id:n});Ee.dispatch({type:"EDIT_MEMO_PATH",payload:r})}editMemo(t){const n=t.webId;Ee.dispatch({type:"EDIT_MEMO",payload:t});const r=Xe.getState().settings,a=Xe.getState().app;if(!(!(a!=null&&a.loadLocalStorage("tokenForSync"))||!r.startSync))try{t&&n&&k0({id:n,content:t.content,rowStatus:t.rowStatus,pinned:t.pinned,ttime:t.deletedAt?C.moment(t.deletedAt,"YYYY/MM/DD HH:mm:ss").valueOf():0,thinoType:t.sourceType==="DAILY"?"DAILY":"FILE"})}catch(s){console.error(s)}}editMemoBulk(t){for(const n of t)this.editMemo(n);this.updateTagsState()}editCommentMemo(t){Ee.dispatch({type:"EDIT_COMMENT_MEMO",payload:t})}getThinoViaKeyword(t){const{memos:n}=this.getState();return n.filter(a=>a.content.toLowerCase().includes(t==null?void 0:t.toLowerCase()))}updateTagsState(){const{memos:t}=this.getState(),n=new Set,r={};for(const a of t){const o=a.content.replace(/<[^>]*>/g,"").replace(/\`\`\`[a-z]*\n[\s\S]*?\n\`\`\`/g,"").replace(/\`([^\`].*?)\`/g,"");if(a.deletedAt!==""&&a.deletedAt)continue;[...Array.from(o.match(Fn)||[]),...Array.from(o.match($n)||[]),...Array.from(o.match(mr)||[])].forEach(c=>{const d=c.replace(Fn,"$1").replace($n,"$1").replace(mr,"$2").trim();/^\d+$/.test(d)||(n.add(d),r[d]=(r[d]||0)+1)})}Ee.dispatch({type:"SET_TAGS",payload:{tags:Array.from(n),tagsNum:r}})}clearMemos(){Ee.dispatch({type:"SET_MEMOS",payload:{memos:[]}})}async getLinkedMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes(t))}async getCommentMemos(t){const{memos:n}=this.getState();return n.filter(r=>r.content.includes("comment: "+t))}async createMemoMultiFile({content:t,isList:n}){return await nk({content:t,isList:n})}async createMemoSingleFile({content:t,isList:n}){return await rk({content:t,isList:n})}async createOrPatchThinoFromWeb(t){const n=this.getState().memos;if(t.localId&&(n!=null&&n.some(o=>o.id===t.localId)))return await this.updateMemoById(t.localId,t,!0),null;if(n!=null&&n.some(o=>o.id===t.id)||n!=null&&n.some(o=>o.webId===t.id))return await this.updateMemoById(t.id,t,!1),null;let r=t.sourceType;const a=Xe.getState().settings;switch(a&&(a!=null&&a.saveThinoType)&&(r=a.saveThinoType!=="FILE"?a.saveThinoType:t.sourceType),r){case"FILE":case"MULTI":case"CANVAS":return await qb(t);case"DAILY":return await ok(t);default:return await qb(t)}}async initSync(){const n=this.getState().memos.filter(a=>!a.webId),r=await G6(n);for(const a of r)await this.createOrPatchThinoFromWeb(a)}async createMemoCanvas({text:t,isList:n}){return await ak({content:t,isList:n})}async createMemoDaily(t,n){return await Jb(t,n)}async pinMemoById(t){const n=this.getMemoById(t),r=await wk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=Xe.getState().settings,o=Xe.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const c=await k0({id:r.webId,pinned:!0});this.editMemo(c)}}catch(a){console.error(a)}}async unpinMemoById(t){const n=this.getMemoById(t),r=await bk(n);Ee.dispatch({type:"PIN_MEMO",payload:r});try{const a=Xe.getState().settings,o=Xe.getState().app;if((o==null?void 0:o.loadLocalStorage("tokenForSync"))&&a.startSync){const c=await k0({id:r.webId,pinned:!1});this.editMemo(c)}}catch(a){console.error(a)}}async createCommentMemo(t,n,r,a,o){return await R6(t,n,r,a,o)}async importMemos(t,n,r){return await Jb(t,n,r)}async createThino({content:t,isList:n,type:r}){let a=null;switch(r.toLowerCase()){case"canvas":a=await Te.createMemoCanvas({text:t,isList:n});break;case"multi":a=await Te.createMemoMultiFile({content:t,isList:n});break;case"daily":a=await Te.createMemoDaily(t,n);break;case"file":a=await Te.createMemoSingleFile({content:t,isList:n});break;default:a=await Te.createMemoDaily(t,n);break}const o=Xe.getState().settings,s=Xe.getState().app,c=s==null?void 0:s.loadLocalStorage("tokenForSync");if(a&&c&&o.startSync){const d=await RT({content:t,thinoType:r==="DAILY"?"DAILY":"FILE"});await this.updateMemoById(a.id,d,!0)}return a}async openThinoByID(t){const n=this.getMemoById(t);if(n)switch(n.sourceType){case"DAILY":await w1(n.id,n.path);break;case"CANVAS":await D1(n.id,n.path);break;case"MULTI":await v1(n.path);break;case"FILE":await b1(n.id,n.path);break}}async updateMemo(t,n,r){const a=this.getMemoById(t);if(a){let o=null;switch(a.sourceType){case"DAILY":o=await Ii(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"CANVAS":o=await Si(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"MULTI":o=await Fo(a,{id:a.id,content:n,thinoType:r||a.thinoType});break;case"FILE":o=await Di(a,{id:a.id,content:n,thinoType:r||a.thinoType})}if(o)return o}return a}}const Te=new J6;class K6{getState(){return Ee.getState().queryState}async getMyAllQueries(){const t=He.getState().query.filter,n=this.getQueryById(t),r=await ya.getMyQueries();return Ee.dispatch({type:"SET_QUERIES",payload:{queries:[...r,...n?[n]:[]]}}),r}getQueryById(t){return this.getState().queries.find(n=>n.id===t)}pushQuery(t){Ee.dispatch({type:"INSERT_QUERY",payload:{query:{...t}}})}editQuery(t){Ee.dispatch({type:"UPDATE_QUERY",payload:t})}async deleteQuery(t){await ya.deleteQueryById(t),Ee.dispatch({type:"DELETE_QUERY_BY_ID",payload:{id:t}})}async createQuery(t,n){return await ya.createQuery(t,n)}createTempQuery(t,n){return ON(t,n)}async updateQuery(t,n,r){return await ya.updateQuery(t,n,r)}async pinQuery(t){await ya.pinQuery(t)}async unpinQuery(t){await ya.unpinQuery(t)}}const Et=new K6;class Q6{async upload(t){const{vault:n,fileManager:r}=Ee.getState().dailyNotesState.app,a=await t.arrayBuffer(),o=X6(t.type),s=bs(),c=C.moment(),d=Fy(c,s);let p;if(d)d instanceof C.TFile&&(p=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,o,d),a));else{const m=await CI(c);p=await n.createBinary(await n.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,o,m),a)}return r.generateMarkdownLink(p,p.path,"","")}async parseHtml(t){const n=await t.text(),r=document.createElement("html");r.innerHTML=n;const a=Array.from(r.getElementsByClassName("memo"));for(const o of a){const s=o.getElementsByClassName("content")[0],c=C.htmlToMarkdown(s.innerHTML),d=await Te.importMemos(c,!0,C.moment(o.getElementsByClassName("time")[0].innerHTML));Te.pushMemo(d)}}}const X6=e=>{var t;return(t=/^image\/(.+)$/.exec(e))==null?void 0:t[1]},S1=new Q6;var Lo={},_T={exports:{}},ga={},A0={exports:{}},F0={},xD;function e8(){return xD||(xD=1,function(e){function t(oe,we){var Z=oe.length;oe.push(we);e:for(;0<Z;){var G=Z-1>>>1,te=oe[G];if(0<a(te,we))oe[G]=we,oe[Z]=te,Z=G;else break e}}function n(oe){return oe.length===0?null:oe[0]}function r(oe){if(oe.length===0)return null;var we=oe[0],Z=oe.pop();if(Z!==we){oe[0]=Z;e:for(var G=0,te=oe.length,ge=te>>>1;G<ge;){var Ie=2*(G+1)-1,De=oe[Ie],ke=Ie+1,Ye=oe[ke];if(0>a(De,Z))ke<te&&0>a(Ye,De)?(oe[G]=Ye,oe[ke]=Z,G=ke):(oe[G]=De,oe[Ie]=Z,G=Ie);else if(ke<te&&0>a(Ye,Z))oe[G]=Ye,oe[ke]=Z,G=ke;else break e}}return we}function a(oe,we){var Z=oe.sortIndex-we.sortIndex;return Z!==0?Z:oe.id-we.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var s=Date,c=s.now();e.unstable_now=function(){return s.now()-c}}var d=[],p=[],m=1,g=null,v=3,D=!1,S=!1,T=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(oe){for(var we=n(p);we!==null;){if(we.callback===null)r(p);else if(we.startTime<=oe)r(p),we.sortIndex=we.expirationTime,t(d,we);else break;we=n(p)}}function F(oe){if(T=!1,j(oe),!S)if(n(d)!==null)S=!0,se(B);else{var we=n(p);we!==null&&fe(F,we.startTime-oe)}}function B(oe,we){S=!1,T&&(T=!1,O(H),H=-1),D=!0;var Z=v;try{for(j(we),g=n(d);g!==null&&(!(g.expirationTime>we)||oe&&!J());){var G=g.callback;if(typeof G=="function"){g.callback=null,v=g.priorityLevel;var te=G(g.expirationTime<=we);we=e.unstable_now(),typeof te=="function"?g.callback=te:g===n(d)&&r(d),j(we)}else r(d);g=n(d)}if(g!==null)var ge=!0;else{var Ie=n(p);Ie!==null&&fe(F,Ie.startTime-we),ge=!1}return ge}finally{g=null,v=Z,D=!1}}var R=!1,z=null,H=-1,Y=5,U=-1;function J(){return!(e.unstable_now()-U<Y)}function Q(){if(z!==null){var oe=e.unstable_now();U=oe;var we=!0;try{we=z(!0,oe)}finally{we?le():(R=!1,z=null)}}else R=!1}var le;if(typeof k=="function")le=function(){k(Q)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,ie=pe.port2;pe.port1.onmessage=Q,le=function(){ie.postMessage(null)}}else le=function(){E(Q,0)};function se(oe){z=oe,R||(R=!0,le())}function fe(oe,we){H=E(function(){oe(e.unstable_now())},we)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(oe){oe.callback=null},e.unstable_continueExecution=function(){S||D||(S=!0,se(B))},e.unstable_forceFrameRate=function(oe){0>oe||125<oe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Y=0<oe?Math.floor(1e3/oe):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(oe){switch(v){case 1:case 2:case 3:var we=3;break;default:we=v}var Z=v;v=we;try{return oe()}finally{v=Z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(oe,we){switch(oe){case 1:case 2:case 3:case 4:case 5:break;default:oe=3}var Z=v;v=oe;try{return we()}finally{v=Z}},e.unstable_scheduleCallback=function(oe,we,Z){var G=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?G+Z:G):Z=G,oe){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=Z+te,oe={id:m++,callback:we,priorityLevel:oe,startTime:Z,expirationTime:te,sortIndex:-1},Z>G?(oe.sortIndex=Z,t(p,oe),n(d)===null&&oe===n(p)&&(T?(O(H),H=-1):T=!0,fe(F,Z-G))):(oe.sortIndex=te,t(d,oe),S||D||(S=!0,se(B))),oe},e.unstable_shouldYield=J,e.unstable_wrapCallback=function(oe){var we=v;return function(){var Z=v;v=we;try{return oe.apply(this,arguments)}finally{v=Z}}}}(F0)),F0}var MD;function t8(){return MD||(MD=1,A0.exports=e8()),A0.exports}var ND;function n8(){if(ND)return ga;ND=1;var e=A,t=t8();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,a={};function o(i,l){s(i,l),s(i+"Capture",l)}function s(i,l){for(a[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,p=/^[: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]*$/,m={},g={};function v(i){return d.call(g,i)?!0:d.call(m,i)?!1:p.test(i)?g[i]=!0:(m[i]=!0,!1)}function D(i,l,h,y){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return y?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function S(i,l,h,y){if(l===null||typeof l>"u"||D(i,l,h,y))return!0;if(y)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function T(i,l,h,y,I,x,L){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=y,this.attributeNamespace=I,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=x,this.removeEmptyString=L}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){E[i]=new T(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];E[l]=new T(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){E[i]=new T(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){E[i]=new T(i,2,!1,i,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(i){E[i]=new T(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){E[i]=new T(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){E[i]=new T(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){E[i]=new T(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){E[i]=new T(i,5,!1,i.toLowerCase(),null,!1,!1)});var O=/[\-:]([a-z])/g;function k(i){return i[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(i){var l=i.replace(O,k);E[l]=new T(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(O,k);E[l]=new T(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(O,k);E[l]=new T(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!1,!1)}),E.xlinkHref=new T("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){E[i]=new T(i,1,!1,i.toLowerCase(),null,!0,!0)});function j(i,l,h,y){var I=E.hasOwnProperty(l)?E[l]:null;(I!==null?I.type!==0:y||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(S(l,h,I,y)&&(h=null),y||I===null?v(l)&&(h===null?i.removeAttribute(l):i.setAttribute(l,""+h)):I.mustUseProperty?i[I.propertyName]=h===null?I.type===3?!1:"":h:(l=I.attributeName,y=I.attributeNamespace,h===null?i.removeAttribute(l):(I=I.type,h=I===3||I===4&&h===!0?"":""+h,y?i.setAttributeNS(y,l,h):i.setAttribute(l,h))))}var F=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,B=Symbol.for("react.element"),R=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),H=Symbol.for("react.strict_mode"),Y=Symbol.for("react.profiler"),U=Symbol.for("react.provider"),J=Symbol.for("react.context"),Q=Symbol.for("react.forward_ref"),le=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),se=Symbol.for("react.lazy"),fe=Symbol.for("react.offscreen"),oe=Symbol.iterator;function we(i){return i===null||typeof i!="object"?null:(i=oe&&i[oe]||i["@@iterator"],typeof i=="function"?i:null)}var Z=Object.assign,G;function te(i){if(G===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);G=l&&l[1]||""}return`
`+G+i}var ge=!1;function Ie(i,l){if(!i||ge)return"";ge=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(be){var y=be}Reflect.construct(i,[],l)}else{try{l.call()}catch(be){y=be}i.call(l.prototype)}else{try{throw Error()}catch(be){y=be}i()}}catch(be){if(be&&y&&typeof be.stack=="string"){for(var I=be.stack.split(`
`),x=y.stack.split(`
`),L=I.length-1,q=x.length-1;1<=L&&0<=q&&I[L]!==x[q];)q--;for(;1<=L&&0<=q;L--,q--)if(I[L]!==x[q]){if(L!==1||q!==1)do if(L--,q--,0>q||I[L]!==x[q]){var ee=`
`+I[L].replace(" at new "," at ");return i.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",i.displayName)),ee}while(1<=L&&0<=q);break}}}finally{ge=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?te(i):""}function De(i){switch(i.tag){case 5:return te(i.type);case 16:return te("Lazy");case 13:return te("Suspense");case 19:return te("SuspenseList");case 0:case 2:case 15:return i=Ie(i.type,!1),i;case 11:return i=Ie(i.type.render,!1),i;case 1:return i=Ie(i.type,!0),i;default:return""}}function ke(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case z:return"Fragment";case R:return"Portal";case Y:return"Profiler";case H:return"StrictMode";case le:return"Suspense";case pe:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case J:return(i.displayName||"Context")+".Consumer";case U:return(i._context.displayName||"Context")+".Provider";case Q:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return l=i.displayName||null,l!==null?l:ke(i.type)||"Memo";case se:l=i._payload,i=i._init;try{return ke(i(l))}catch{}}return null}function Ye(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ke(l);case 8:return l===H?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Re(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function rt(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Ht(i){var l=rt(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),y=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var I=h.get,x=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return I.call(this)},set:function(L){y=""+L,x.call(this,L)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return y},setValue:function(L){y=""+L},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Se(i){i._valueTracker||(i._valueTracker=Ht(i))}function Ze(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),y="";return i&&(y=rt(i)?i.checked?"true":"false":i.value),i=y,i!==h?(l.setValue(i),!0):!1}function Ke(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function Je(i,l){var h=l.checked;return Z({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function lt(i,l){var h=l.defaultValue==null?"":l.defaultValue,y=l.checked!=null?l.checked:l.defaultChecked;h=Re(l.value!=null?l.value:h),i._wrapperState={initialChecked:y,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ft(i,l){l=l.checked,l!=null&&j(i,"checked",l,!1)}function Dt(i,l){ft(i,l);var h=Re(l.value),y=l.type;if(h!=null)y==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(y==="submit"||y==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?un(i,l.type,h):l.hasOwnProperty("defaultValue")&&un(i,l.type,Re(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function Ct(i,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var y=l.type;if(!(y!=="submit"&&y!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function un(i,l,h){(l!=="number"||Ke(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var Ft=Array.isArray;function Ot(i,l,h,y){if(i=i.options,l){l={};for(var I=0;I<h.length;I++)l["$"+h[I]]=!0;for(h=0;h<i.length;h++)I=l.hasOwnProperty("$"+i[h].value),i[h].selected!==I&&(i[h].selected=I),I&&y&&(i[h].defaultSelected=!0)}else{for(h=""+Re(h),l=null,I=0;I<i.length;I++){if(i[I].value===h){i[I].selected=!0,y&&(i[I].defaultSelected=!0);return}l!==null||i[I].disabled||(l=i[I])}l!==null&&(l.selected=!0)}}function an(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return Z({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function wn(i,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(Ft(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}i._wrapperState={initialValue:Re(h)}}function Tn(i,l){var h=Re(l.value),y=Re(l.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),l.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),y!=null&&(i.defaultValue=""+y)}function vr(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Ia(i){switch(i){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 tr(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Ia(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var Nr,Is=function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,y,I){MSApp.execUnsafeLocalFunction(function(){return i(l,h,y,I)})}:i}(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(Nr=Nr||document.createElement("div"),Nr.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=Nr.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function ho(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var po={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},Nl=["Webkit","ms","Moz","O"];Object.keys(po).forEach(function(i){Nl.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),po[l]=po[i]})});function Pi(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||po.hasOwnProperty(i)&&po[i]?(""+l).trim():l+"px"}function ji(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var y=h.indexOf("--")===0,I=Pi(h,l[h],y);h==="float"&&(h="cssFloat"),y?i.setProperty(h,I):i[h]=I}}var Ts=Z({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 Ho(i,l){if(l){if(Ts[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function Li(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 W=null;function re(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ye=null,xe=null,je=null;function _e(i){if(i=ar(i)){if(typeof ye!="function")throw Error(n(280));var l=i.stateNode;l&&(l=gc(l),ye(i.stateNode,i.type,l))}}function ze(i){xe?je?je.push(i):je=[i]:xe=i}function gt(){if(xe){var i=xe,l=je;if(je=xe=null,_e(i),l)for(i=0;i<l.length;i++)_e(l[i])}}function Vt(i,l){return i(l)}function On(){}var bn=!1;function na(i,l,h){if(bn)return i(l,h);bn=!0;try{return Vt(i,l,h)}finally{bn=!1,(xe!==null||je!==null)&&(On(),gt())}}function Pn(i,l){var h=i.stateNode;if(h===null)return null;var y=gc(h);if(y===null)return null;h=y[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(y=!y.disabled)||(i=i.type,y=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!y;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var wr=!1;if(c)try{var ra={};Object.defineProperty(ra,"passive",{get:function(){wr=!0}}),window.addEventListener("test",ra,ra),window.removeEventListener("test",ra,ra)}catch{wr=!1}function kl(i,l,h,y,I,x,L,q,ee){var be=Array.prototype.slice.call(arguments,3);try{l.apply(h,be)}catch(Oe){this.onError(Oe)}}var Qt=!1,Ta=null,Ea=!1,Ca=null,Yo={onError:function(i){Qt=!0,Ta=i}};function zo(i,l,h,y,I,x,L,q,ee){Qt=!1,Ta=null,kl.apply(Yo,arguments)}function wv(i,l,h,y,I,x,L,q,ee){if(zo.apply(this,arguments),Qt){if(Qt){var be=Ta;Qt=!1,Ta=null}else throw Error(n(198));Ea||(Ea=!0,Ca=be)}}function Ri(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,l.flags&4098&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function of(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function Gp(i){if(Ri(i)!==i)throw Error(n(188))}function bv(i){var l=i.alternate;if(!l){if(l=Ri(i),l===null)throw Error(n(188));return l!==i?null:i}for(var h=i,y=l;;){var I=h.return;if(I===null)break;var x=I.alternate;if(x===null){if(y=I.return,y!==null){h=y;continue}break}if(I.child===x.child){for(x=I.child;x;){if(x===h)return Gp(I),i;if(x===y)return Gp(I),l;x=x.sibling}throw Error(n(188))}if(h.return!==y.return)h=I,y=x;else{for(var L=!1,q=I.child;q;){if(q===h){L=!0,h=I,y=x;break}if(q===y){L=!0,y=I,h=x;break}q=q.sibling}if(!L){for(q=x.child;q;){if(q===h){L=!0,h=x,y=I;break}if(q===y){L=!0,y=x,h=I;break}q=q.sibling}if(!L)throw Error(n(189))}}if(h.alternate!==y)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?i:l}function qp(i){return i=bv(i),i!==null?Jp(i):null}function Jp(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=Jp(i);if(l!==null)return l;i=i.sibling}return null}var Kp=t.unstable_scheduleCallback,Qp=t.unstable_cancelCallback,zu=t.unstable_shouldYield,Dv=t.unstable_requestPaint,on=t.unstable_now,Sv=t.unstable_getCurrentPriorityLevel,sf=t.unstable_ImmediatePriority,Xp=t.unstable_UserBlockingPriority,Al=t.unstable_NormalPriority,em=t.unstable_LowPriority,lf=t.unstable_IdlePriority,Uu=null,Va=null;function Iv(i){if(Va&&typeof Va.onCommitFiberRoot=="function")try{Va.onCommitFiberRoot(Uu,i,void 0,(i.current.flags&128)===128)}catch{}}var xa=Math.clz32?Math.clz32:rm,tm=Math.log,nm=Math.LN2;function rm(i){return i>>>=0,i===0?32:31-(tm(i)/nm|0)|0}var Es=64,Vu=4194304;function Cs(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Bi(i,l){var h=i.pendingLanes;if(h===0)return 0;var y=0,I=i.suspendedLanes,x=i.pingedLanes,L=h&268435455;if(L!==0){var q=L&~I;q!==0?y=Cs(q):(x&=L,x!==0&&(y=Cs(x)))}else L=h&~I,L!==0?y=Cs(L):x!==0&&(y=Cs(x));if(y===0)return 0;if(l!==0&&l!==y&&!(l&I)&&(I=y&-y,x=l&-l,I>=x||I===16&&(x&4194240)!==0))return l;if(y&4&&(y|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=y;0<l;)h=31-xa(l),I=1<<h,y|=i[h],l&=~I;return y}function am(i,l){switch(i){case 1:case 2:case 4:return l+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 l+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 Tv(i,l){for(var h=i.suspendedLanes,y=i.pingedLanes,I=i.expirationTimes,x=i.pendingLanes;0<x;){var L=31-xa(x),q=1<<L,ee=I[L];ee===-1?(!(q&h)||q&y)&&(I[L]=am(q,l)):ee<=l&&(i.expiredLanes|=q),x&=~q}}function Zu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function uf(){var i=Es;return Es<<=1,!(Es&4194240)&&(Es=64),i}function Fl(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function Ol(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-xa(l),i[l]=h}function om(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var y=i.eventTimes;for(i=i.expirationTimes;0<h;){var I=31-xa(h),x=1<<I;l[I]=0,y[I]=-1,i[I]=-1,h&=~x}}function Pl(i,l){var h=i.entangledLanes|=l;for(i=i.entanglements;h;){var y=31-xa(h),I=1<<y;I&l|i[y]&l&&(i[y]|=l),h&=~I}}var Yt=0;function _i(i){return i&=-i,1<i?4<i?i&268435455?16:536870912:4:1}var cf,Wu,im,df,ff,$u=!1,jl=[],Uo=null,Vo=null,Zo=null,xs=new Map,Ll=new Map,Wo=[],Ev="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 sm(i,l){switch(i){case"focusin":case"focusout":Uo=null;break;case"dragenter":case"dragleave":Vo=null;break;case"mouseover":case"mouseout":Zo=null;break;case"pointerover":case"pointerout":xs.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ll.delete(l.pointerId)}}function Hi(i,l,h,y,I,x){return i===null||i.nativeEvent!==x?(i={blockedOn:l,domEventName:h,eventSystemFlags:y,nativeEvent:x,targetContainers:[I]},l!==null&&(l=ar(l),l!==null&&Wu(l)),i):(i.eventSystemFlags|=y,l=i.targetContainers,I!==null&&l.indexOf(I)===-1&&l.push(I),i)}function Cv(i,l,h,y,I){switch(l){case"focusin":return Uo=Hi(Uo,i,l,h,y,I),!0;case"dragenter":return Vo=Hi(Vo,i,l,h,y,I),!0;case"mouseover":return Zo=Hi(Zo,i,l,h,y,I),!0;case"pointerover":var x=I.pointerId;return xs.set(x,Hi(xs.get(x)||null,i,l,h,y,I)),!0;case"gotpointercapture":return x=I.pointerId,Ll.set(x,Hi(Ll.get(x)||null,i,l,h,y,I)),!0}return!1}function lm(i){var l=Ga(i.target);if(l!==null){var h=Ri(l);if(h!==null){if(l=h.tag,l===13){if(l=of(h),l!==null){i.blockedOn=l,ff(i.priority,function(){im(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Gu(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var h=Ku(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var y=new h.constructor(h.type,h);W=y,h.target.dispatchEvent(y),W=null}else return l=ar(h),l!==null&&Wu(l),i.blockedOn=h,!1;l.shift()}return!0}function um(i,l,h){Gu(i)&&h.delete(l)}function xv(){$u=!1,Uo!==null&&Gu(Uo)&&(Uo=null),Vo!==null&&Gu(Vo)&&(Vo=null),Zo!==null&&Gu(Zo)&&(Zo=null),xs.forEach(um),Ll.forEach(um)}function Zt(i,l){i.blockedOn===l&&(i.blockedOn=null,$u||($u=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,xv)))}function zt(i){function l(I){return Zt(I,i)}if(0<jl.length){Zt(jl[0],i);for(var h=1;h<jl.length;h++){var y=jl[h];y.blockedOn===i&&(y.blockedOn=null)}}for(Uo!==null&&Zt(Uo,i),Vo!==null&&Zt(Vo,i),Zo!==null&&Zt(Zo,i),xs.forEach(l),Ll.forEach(l),h=0;h<Wo.length;h++)y=Wo[h],y.blockedOn===i&&(y.blockedOn=null);for(;0<Wo.length&&(h=Wo[0],h.blockedOn===null);)lm(h),h.blockedOn===null&&Wo.shift()}var Ms=F.ReactCurrentBatchConfig,qu=!0;function Mv(i,l,h,y){var I=Yt,x=Ms.transition;Ms.transition=null;try{Yt=1,hf(i,l,h,y)}finally{Yt=I,Ms.transition=x}}function Nv(i,l,h,y){var I=Yt,x=Ms.transition;Ms.transition=null;try{Yt=4,hf(i,l,h,y)}finally{Yt=I,Ms.transition=x}}function hf(i,l,h,y){if(qu){var I=Ku(i,l,h,y);if(I===null)kf(i,l,y,Ju,h),sm(i,y);else if(Cv(I,i,l,h,y))y.stopPropagation();else if(sm(i,y),l&4&&-1<Ev.indexOf(i)){for(;I!==null;){var x=ar(I);if(x!==null&&cf(x),x=Ku(i,l,h,y),x===null&&kf(i,l,y,Ju,h),x===I)break;I=x}I!==null&&y.stopPropagation()}else kf(i,l,y,null,h)}}var Ju=null;function Ku(i,l,h,y){if(Ju=null,i=re(y),i=Ga(i),i!==null)if(l=Ri(i),l===null)i=null;else if(h=l.tag,h===13){if(i=of(l),i!==null)return i;i=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return Ju=i,null}function cm(i){switch(i){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(Sv()){case sf:return 1;case Xp:return 4;case Al:case em:return 16;case lf:return 536870912;default:return 16}default:return 16}}var sn=null,Rl=null,Za=null;function pf(){if(Za)return Za;var i,l=Rl,h=l.length,y,I="value"in sn?sn.value:sn.textContent,x=I.length;for(i=0;i<h&&l[i]===I[i];i++);var L=h-i;for(y=1;y<=L&&l[h-y]===I[x-y];y++);return Za=I.slice(i,1<y?1-y:void 0)}function Ns(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function br(){return!0}function mf(){return!1}function kr(i){function l(h,y,I,x,L){this._reactName=h,this._targetInst=I,this.type=y,this.nativeEvent=x,this.target=L,this.currentTarget=null;for(var q in i)i.hasOwnProperty(q)&&(h=i[q],this[q]=h?h(x):x[q]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?br:mf,this.isPropagationStopped=mf,this}return Z(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=br)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=br)},persist:function(){},isPersistent:br}),l}var Yi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qu=kr(Yi),ks=Z({},Yi,{view:0,detail:0}),dm=kr(ks),Dr,gf,nr,Xu=Z({},ks,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Df,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==nr&&(nr&&i.type==="mousemove"?(Dr=i.screenX-nr.screenX,gf=i.screenY-nr.screenY):gf=Dr=0,nr=i),Dr)},movementY:function(i){return"movementY"in i?i.movementY:gf}}),yf=kr(Xu),$o=Z({},Xu,{dataTransfer:0}),ec=kr($o),vf=Z({},ks,{relatedTarget:0}),Jt=kr(vf),Go=Z({},Yi,{animationName:0,elapsedTime:0,pseudoElement:0}),wf=kr(Go),kv=Z({},Yi,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),bf=kr(kv),Av=Z({},Yi,{data:0}),fm=kr(Av),Fv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hm={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"},tc={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function As(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=tc[i])?!!l[i]:!1}function Df(){return As}var pm=Z({},ks,{key:function(i){if(i.key){var l=Fv[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Ns(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?hm[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Df,charCode:function(i){return i.type==="keypress"?Ns(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ns(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),mm=kr(pm),Sf=Z({},Xu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),nc=kr(Sf),gm=Z({},ks,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Df}),Ov=kr(gm),If=Z({},Yi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tf=kr(If),Pv=Z({},Xu,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),ym=kr(Pv),Yr=[9,13,27,32],Bl=c&&"CompositionEvent"in window,mo=null;c&&"documentMode"in document&&(mo=document.documentMode);var vm=c&&"TextEvent"in window&&!mo,Ef=c&&(!Bl||mo&&8<mo&&11>=mo),wm=" ",bm=!1;function Dm(i,l){switch(i){case"keyup":return Yr.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sm(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Fs=!1;function Os(i,l){switch(i){case"compositionend":return Sm(l);case"keypress":return l.which!==32?null:(bm=!0,wm);case"textInput":return i=l.data,i===wm&&bm?null:i;default:return null}}function jv(i,l){if(Fs)return i==="compositionend"||!Bl&&Dm(i,l)?(i=pf(),Za=Rl=sn=null,Fs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Ef&&l.locale!=="ko"?null:l.data;default:return null}}var Lv={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 rc(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Lv[i.type]:l==="textarea"}function Cf(i,l,h,y){ze(y),l=fc(l,"onChange"),0<l.length&&(h=new Qu("onChange","change",null,h,y),i.push({event:h,listeners:l}))}var aa=null,qo=null;function Rv(i){Nm(i,0)}function ac(i){var l=St(i);if(Ze(l))return i}function Bv(i,l){if(i==="change")return l}var zi=!1;if(c){var zr;if(c){var oc="oninput"in document;if(!oc){var Im=document.createElement("div");Im.setAttribute("oninput","return;"),oc=typeof Im.oninput=="function"}zr=oc}else zr=!1;zi=zr&&(!document.documentMode||9<document.documentMode)}function Tm(){aa&&(aa.detachEvent("onpropertychange",Em),qo=aa=null)}function Em(i){if(i.propertyName==="value"&&ac(qo)){var l=[];Cf(l,qo,i,re(i)),na(Rv,l)}}function _v(i,l,h){i==="focusin"?(Tm(),aa=l,qo=h,aa.attachEvent("onpropertychange",Em)):i==="focusout"&&Tm()}function Hv(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return ac(qo)}function Ps(i,l){if(i==="click")return ac(l)}function ue(i,l){if(i==="input"||i==="change")return ac(l)}function Ce(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var ve=typeof Object.is=="function"?Object.is:Ce;function Ge(i,l){if(ve(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var h=Object.keys(i),y=Object.keys(l);if(h.length!==y.length)return!1;for(y=0;y<h.length;y++){var I=h[y];if(!d.call(l,I)||!ve(i[I],l[I]))return!1}return!0}function bt(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function Lt(i,l){var h=bt(i);i=0;for(var y;h;){if(h.nodeType===3){if(y=i+h.textContent.length,i<=l&&y>=l)return{node:h,offset:l-i};i=y}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=bt(h)}}function En(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?En(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function $t(){for(var i=window,l=Ke();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=Ke(i.document)}return l}function _l(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function Yv(i){var l=$t(),h=i.focusedElem,y=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&En(h.ownerDocument.documentElement,h)){if(y!==null&&_l(h)){if(l=y.start,i=y.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var I=h.textContent.length,x=Math.min(y.start,I);y=y.end===void 0?x:Math.min(y.end,I),!i.extend&&x>y&&(I=y,y=x,x=I),I=Lt(h,x);var L=Lt(h,y);I&&L&&(i.rangeCount!==1||i.anchorNode!==I.node||i.anchorOffset!==I.offset||i.focusNode!==L.node||i.focusOffset!==L.offset)&&(l=l.createRange(),l.setStart(I.node,I.offset),i.removeAllRanges(),x>y?(i.addRange(l),i.extend(L.node,L.offset)):(l.setEnd(L.node,L.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)i=l[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var oa=c&&"documentMode"in document&&11>=document.documentMode,go=null,xf=null,Wa=null,js=!1;function Hl(i,l,h){var y=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;js||go==null||go!==Ke(y)||(y=go,"selectionStart"in y&&_l(y)?y={start:y.selectionStart,end:y.selectionEnd}:(y=(y.ownerDocument&&y.ownerDocument.defaultView||window).getSelection(),y={anchorNode:y.anchorNode,anchorOffset:y.anchorOffset,focusNode:y.focusNode,focusOffset:y.focusOffset}),Wa&&Ge(Wa,y)||(Wa=y,y=fc(xf,"onSelect"),0<y.length&&(l=new Qu("onSelect","select",null,l,h),i.push({event:l,listeners:y}),l.target=go)))}function Rt(i,l){var h={};return h[i.toLowerCase()]=l.toLowerCase(),h["Webkit"+i]="webkit"+l,h["Moz"+i]="moz"+l,h}var Ls={animationend:Rt("Animation","AnimationEnd"),animationiteration:Rt("Animation","AnimationIteration"),animationstart:Rt("Animation","AnimationStart"),transitionend:Rt("Transition","TransitionEnd")},ic={},Yl={};c&&(Yl=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function sc(i){if(ic[i])return ic[i];if(!Ls[i])return i;var l=Ls[i],h;for(h in l)if(l.hasOwnProperty(h)&&h in Yl)return ic[i]=l[h];return i}var Cm=sc("animationend"),xm=sc("animationiteration"),zl=sc("animationstart"),yo=sc("transitionend"),Ul=new Map,Mf="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 Ma(i,l){Ul.set(i,l),o(l,[i])}for(var lc=0;lc<Mf.length;lc++){var uc=Mf[lc],cc=uc.toLowerCase(),Mm=uc[0].toUpperCase()+uc.slice(1);Ma(cc,"on"+Mm)}Ma(Cm,"onAnimationEnd"),Ma(xm,"onAnimationIteration"),Ma(zl,"onAnimationStart"),Ma("dblclick","onDoubleClick"),Ma("focusin","onFocus"),Ma("focusout","onBlur"),Ma(yo,"onTransitionEnd"),s("onMouseEnter",["mouseout","mouseover"]),s("onMouseLeave",["mouseout","mouseover"]),s("onPointerEnter",["pointerout","pointerover"]),s("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),Ui=new Set("cancel close invalid load scroll toggle".split(" ").concat(vo));function Vl(i,l,h){var y=i.type||"unknown-event";i.currentTarget=h,wv(y,l,void 0,i),i.currentTarget=null}function Nm(i,l){l=(l&4)!==0;for(var h=0;h<i.length;h++){var y=i[h],I=y.event;y=y.listeners;e:{var x=void 0;if(l)for(var L=y.length-1;0<=L;L--){var q=y[L],ee=q.instance,be=q.currentTarget;if(q=q.listener,ee!==x&&I.isPropagationStopped())break e;Vl(I,q,be),x=ee}else for(L=0;L<y.length;L++){if(q=y[L],ee=q.instance,be=q.currentTarget,q=q.listener,ee!==x&&I.isPropagationStopped())break e;Vl(I,q,be),x=ee}}}if(Ea)throw i=Ca,Ea=!1,Ca=null,i}function Xt(i,l){var h=l[mc];h===void 0&&(h=l[mc]=new Set);var y=i+"__bubble";h.has(y)||(dc(l,i,2,!1),h.add(y))}function Nf(i,l,h){var y=0;l&&(y|=4),dc(h,i,y,l)}var Vi="_reactListening"+Math.random().toString(36).slice(2);function Jo(i){if(!i[Vi]){i[Vi]=!0,r.forEach(function(h){h!=="selectionchange"&&(Ui.has(h)||Nf(h,!1,i),Nf(h,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Vi]||(l[Vi]=!0,Nf("selectionchange",!1,l))}}function dc(i,l,h,y){switch(cm(l)){case 1:var I=Mv;break;case 4:I=Nv;break;default:I=hf}h=I.bind(null,l,h,i),I=void 0,!wr||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(I=!0),y?I!==void 0?i.addEventListener(l,h,{capture:!0,passive:I}):i.addEventListener(l,h,!0):I!==void 0?i.addEventListener(l,h,{passive:I}):i.addEventListener(l,h,!1)}function kf(i,l,h,y,I){var x=y;if(!(l&1)&&!(l&2)&&y!==null)e:for(;;){if(y===null)return;var L=y.tag;if(L===3||L===4){var q=y.stateNode.containerInfo;if(q===I||q.nodeType===8&&q.parentNode===I)break;if(L===4)for(L=y.return;L!==null;){var ee=L.tag;if((ee===3||ee===4)&&(ee=L.stateNode.containerInfo,ee===I||ee.nodeType===8&&ee.parentNode===I))return;L=L.return}for(;q!==null;){if(L=Ga(q),L===null)return;if(ee=L.tag,ee===5||ee===6){y=x=L;continue e}q=q.parentNode}}y=y.return}na(function(){var be=x,Oe=re(h),Le=[];e:{var Fe=Ul.get(i);if(Fe!==void 0){var qe=Qu,nt=i;switch(i){case"keypress":if(Ns(h)===0)break e;case"keydown":case"keyup":qe=mm;break;case"focusin":nt="focus",qe=Jt;break;case"focusout":nt="blur",qe=Jt;break;case"beforeblur":case"afterblur":qe=Jt;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":qe=yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":qe=ec;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":qe=Ov;break;case Cm:case xm:case zl:qe=wf;break;case yo:qe=Tf;break;case"scroll":qe=dm;break;case"wheel":qe=ym;break;case"copy":case"cut":case"paste":qe=bf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":qe=nc}var at=(l&4)!==0,Dn=!at&&i==="scroll",de=at?Fe!==null?Fe+"Capture":null:Fe;at=[];for(var ae=be,he;ae!==null;){he=ae;var Be=he.stateNode;if(he.tag===5&&Be!==null&&(he=Be,de!==null&&(Be=Pn(ae,de),Be!=null&&at.push(Rs(ae,Be,he)))),Dn)break;ae=ae.return}0<at.length&&(Fe=new qe(Fe,nt,null,h,Oe),Le.push({event:Fe,listeners:at}))}}if(!(l&7)){e:{if(Fe=i==="mouseover"||i==="pointerover",qe=i==="mouseout"||i==="pointerout",Fe&&h!==W&&(nt=h.relatedTarget||h.fromElement)&&(Ga(nt)||nt[Ur]))break e;if((qe||Fe)&&(Fe=Oe.window===Oe?Oe:(Fe=Oe.ownerDocument)?Fe.defaultView||Fe.parentWindow:window,qe?(nt=h.relatedTarget||h.toElement,qe=be,nt=nt?Ga(nt):null,nt!==null&&(Dn=Ri(nt),nt!==Dn||nt.tag!==5&&nt.tag!==6)&&(nt=null)):(qe=null,nt=be),qe!==nt)){if(at=yf,Be="onMouseLeave",de="onMouseEnter",ae="mouse",(i==="pointerout"||i==="pointerover")&&(at=nc,Be="onPointerLeave",de="onPointerEnter",ae="pointer"),Dn=qe==null?Fe:St(qe),he=nt==null?Fe:St(nt),Fe=new at(Be,ae+"leave",qe,h,Oe),Fe.target=Dn,Fe.relatedTarget=he,Be=null,Ga(Oe)===be&&(at=new at(de,ae+"enter",nt,h,Oe),at.target=he,at.relatedTarget=Dn,Be=at),Dn=Be,qe&&nt)t:{for(at=qe,de=nt,ae=0,he=at;he;he=Bs(he))ae++;for(he=0,Be=de;Be;Be=Bs(Be))he++;for(;0<ae-he;)at=Bs(at),ae--;for(;0<he-ae;)de=Bs(de),he--;for(;ae--;){if(at===de||de!==null&&at===de.alternate)break t;at=Bs(at),de=Bs(de)}at=null}else at=null;qe!==null&&Cn(Le,Fe,qe,at,!1),nt!==null&&Dn!==null&&Cn(Le,Dn,nt,at,!0)}}e:{if(Fe=be?St(be):window,qe=Fe.nodeName&&Fe.nodeName.toLowerCase(),qe==="select"||qe==="input"&&Fe.type==="file")var ot=Bv;else if(rc(Fe))if(zi)ot=ue;else{ot=Hv;var ct=_v}else(qe=Fe.nodeName)&&qe.toLowerCase()==="input"&&(Fe.type==="checkbox"||Fe.type==="radio")&&(ot=Ps);if(ot&&(ot=ot(i,be))){Cf(Le,ot,h,Oe);break e}ct&&ct(i,Fe,be),i==="focusout"&&(ct=Fe._wrapperState)&&ct.controlled&&Fe.type==="number"&&un(Fe,"number",Fe.value)}switch(ct=be?St(be):window,i){case"focusin":(rc(ct)||ct.contentEditable==="true")&&(go=ct,xf=be,Wa=null);break;case"focusout":Wa=xf=go=null;break;case"mousedown":js=!0;break;case"contextmenu":case"mouseup":case"dragend":js=!1,Hl(Le,h,Oe);break;case"selectionchange":if(oa)break;case"keydown":case"keyup":Hl(Le,h,Oe)}var dt;if(Bl)e:{switch(i){case"compositionstart":var wt="onCompositionStart";break e;case"compositionend":wt="onCompositionEnd";break e;case"compositionupdate":wt="onCompositionUpdate";break e}wt=void 0}else Fs?Dm(i,h)&&(wt="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&(wt="onCompositionStart");wt&&(Ef&&h.locale!=="ko"&&(Fs||wt!=="onCompositionStart"?wt==="onCompositionEnd"&&Fs&&(dt=pf()):(sn=Oe,Rl="value"in sn?sn.value:sn.textContent,Fs=!0)),ct=fc(be,wt),0<ct.length&&(wt=new fm(wt,i,null,h,Oe),Le.push({event:wt,listeners:ct}),dt?wt.data=dt:(dt=Sm(h),dt!==null&&(wt.data=dt)))),(dt=vm?Os(i,h):jv(i,h))&&(be=fc(be,"onBeforeInput"),0<be.length&&(Oe=new fm("onBeforeInput","beforeinput",null,h,Oe),Le.push({event:Oe,listeners:be}),Oe.data=dt))}Nm(Le,l)})}function Rs(i,l,h){return{instance:i,listener:l,currentTarget:h}}function fc(i,l){for(var h=l+"Capture",y=[];i!==null;){var I=i,x=I.stateNode;I.tag===5&&x!==null&&(I=x,x=Pn(i,h),x!=null&&y.unshift(Rs(i,x,I)),x=Pn(i,l),x!=null&&y.push(Rs(i,x,I))),i=i.return}return y}function Bs(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function Cn(i,l,h,y,I){for(var x=l._reactName,L=[];h!==null&&h!==y;){var q=h,ee=q.alternate,be=q.stateNode;if(ee!==null&&ee===y)break;q.tag===5&&be!==null&&(q=be,I?(ee=Pn(h,x),ee!=null&&L.unshift(Rs(h,ee,q))):I||(ee=Pn(h,x),ee!=null&&L.push(Rs(h,ee,q)))),h=h.return}L.length!==0&&i.push({event:l,listeners:L})}var rr=/\r\n?/g,zv=/\u0000|\uFFFD/g;function km(i){return(typeof i=="string"?i:""+i).replace(rr,`
`).replace(zv,"")}function Zl(i,l,h){if(l=km(l),km(i)!==l&&h)throw Error(n(425))}function hc(){}var Wl=null,Zi=null;function $l(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Ko=typeof setTimeout=="function"?setTimeout:void 0,Gl=typeof clearTimeout=="function"?clearTimeout:void 0,_s=typeof Promise=="function"?Promise:void 0,pc=typeof queueMicrotask=="function"?queueMicrotask:typeof _s<"u"?function(i){return _s.resolve(null).then(i).catch(Hs)}:Ko;function Hs(i){setTimeout(function(){throw i})}function Af(i,l){var h=l,y=0;do{var I=h.nextSibling;if(i.removeChild(h),I&&I.nodeType===8)if(h=I.data,h==="/$"){if(y===0){i.removeChild(I),zt(l);return}y--}else h!=="$"&&h!=="$?"&&h!=="$!"||y++;h=I}while(h);zt(l)}function Qo(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function Am(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return i;l--}else h==="/$"&&l++}i=i.previousSibling}return null}var Ys=Math.random().toString(36).slice(2),$a="__reactFiber$"+Ys,Xo="__reactProps$"+Ys,Ur="__reactContainer$"+Ys,mc="__reactEvents$"+Ys,_="__reactListeners$"+Ys,zs="__reactHandles$"+Ys;function Ga(i){var l=i[$a];if(l)return l;for(var h=i.parentNode;h;){if(l=h[Ur]||h[$a]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(i=Am(i);i!==null;){if(h=i[$a])return h;i=Am(i)}return l}i=h,h=i.parentNode}return null}function ar(i){return i=i[$a]||i[Ur],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function St(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function gc(i){return i[Xo]||null}var Ff=[],Us=-1;function Ar(i){return{current:i}}function en(i){0>Us||(i.current=Ff[Us],Ff[Us]=null,Us--)}function Kt(i,l){Us++,Ff[Us]=i.current,i.current=l}var ei={},or=Ar(ei),Fr=Ar(!1),Sr=ei;function Vs(i,l){var h=i.type.contextTypes;if(!h)return ei;var y=i.stateNode;if(y&&y.__reactInternalMemoizedUnmaskedChildContext===l)return y.__reactInternalMemoizedMaskedChildContext;var I={},x;for(x in h)I[x]=l[x];return y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=I),I}function Or(i){return i=i.childContextTypes,i!=null}function yc(){en(Fr),en(or)}function Fm(i,l,h){if(or.current!==ei)throw Error(n(168));Kt(or,l),Kt(Fr,h)}function Om(i,l,h){var y=i.stateNode;if(l=l.childContextTypes,typeof y.getChildContext!="function")return h;y=y.getChildContext();for(var I in y)if(!(I in l))throw Error(n(108,Ye(i)||"Unknown",I));return Z({},h,y)}function ia(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||ei,Sr=or.current,Kt(or,i),Kt(Fr,Fr.current),!0}function Pm(i,l,h){var y=i.stateNode;if(!y)throw Error(n(169));h?(i=Om(i,l,Sr),y.__reactInternalMemoizedMergedChildContext=i,en(Fr),en(or),Kt(or,i)):en(Fr),Kt(Fr,h)}var wo=null,vc=!1,Of=!1;function jm(i){wo===null?wo=[i]:wo.push(i)}function Wi(i){vc=!0,jm(i)}function ti(){if(!Of&&wo!==null){Of=!0;var i=0,l=Yt;try{var h=wo;for(Yt=1;i<h.length;i++){var y=h[i];do y=y(!0);while(y!==null)}wo=null,vc=!1}catch(I){throw wo!==null&&(wo=wo.slice(i+1)),Kp(sf,ti),I}finally{Yt=l,Of=!1}}return null}var Zs=[],ir=0,wc=null,bc=0,sa=[],la=0,$i=null,qa=1,Ja="";function Gi(i,l){Zs[ir++]=bc,Zs[ir++]=wc,wc=i,bc=l}function Lm(i,l,h){sa[la++]=qa,sa[la++]=Ja,sa[la++]=$i,$i=i;var y=qa;i=Ja;var I=32-xa(y)-1;y&=~(1<<I),h+=1;var x=32-xa(l)+I;if(30<x){var L=I-I%5;x=(y&(1<<L)-1).toString(32),y>>=L,I-=L,qa=1<<32-xa(l)+I|h<<I|y,Ja=x+i}else qa=1<<x|h<<I|y,Ja=i}function ql(i){i.return!==null&&(Gi(i,1),Lm(i,1,0))}function qi(i){for(;i===wc;)wc=Zs[--ir],Zs[ir]=null,bc=Zs[--ir],Zs[ir]=null;for(;i===$i;)$i=sa[--la],sa[la]=null,Ja=sa[--la],sa[la]=null,qa=sa[--la],sa[la]=null}var sr=null,Vr=null,tn=!1,Na=null;function Ka(i,l){var h=qr(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=i,l=i.deletions,l===null?(i.deletions=[h],i.flags|=16):l.push(h)}function Dc(i,l){switch(i.tag){case 5:var h=i.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,sr=i,Vr=Qo(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,sr=i,Vr=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=$i!==null?{id:qa,overflow:Ja}:null,i.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=qr(18,null,null,0),h.stateNode=l,h.return=i,i.child=h,sr=i,Vr=null,!0):!1;default:return!1}}function bo(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Pr(i){if(tn){var l=Vr;if(l){var h=l;if(!Dc(i,l)){if(bo(i))throw Error(n(418));l=Qo(h.nextSibling);var y=sr;l&&Dc(i,l)?Ka(y,h):(i.flags=i.flags&-4097|2,tn=!1,sr=i)}}else{if(bo(i))throw Error(n(418));i.flags=i.flags&-4097|2,tn=!1,sr=i}}}function Rm(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;sr=i}function Jl(i){if(i!==sr)return!1;if(!tn)return Rm(i),tn=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!$l(i.type,i.memoizedProps)),l&&(l=Vr)){if(bo(i))throw Pf(),Error(n(418));for(;l;)Ka(i,l),l=Qo(l.nextSibling)}if(Rm(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(l===0){Vr=Qo(i.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}i=i.nextSibling}Vr=null}}else Vr=sr?Qo(i.stateNode.nextSibling):null;return!0}function Pf(){for(var i=Vr;i;)i=Qo(i.nextSibling)}function Qa(){Vr=sr=null,tn=!1}function Xa(i){Na===null?Na=[i]:Na.push(i)}var Bm=F.ReactCurrentBatchConfig;function ka(i,l){if(i&&i.defaultProps){l=Z({},l),i=i.defaultProps;for(var h in i)l[h]===void 0&&(l[h]=i[h]);return l}return l}var Ji=Ar(null),Sc=null,Ki=null,jn=null;function Kl(){jn=Ki=Sc=null}function Ic(i){var l=Ji.current;en(Ji),i._currentValue=l}function ua(i,l,h){for(;i!==null;){var y=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,y!==null&&(y.childLanes|=l)):y!==null&&(y.childLanes&l)!==l&&(y.childLanes|=l),i===h)break;i=i.return}}function ni(i,l){Sc=i,jn=Ki=null,i=i.dependencies,i!==null&&i.firstContext!==null&&(i.lanes&l&&(cr=!0),i.firstContext=null)}function Ir(i){var l=i._currentValue;if(jn!==i)if(i={context:i,memoizedValue:l,next:null},Ki===null){if(Sc===null)throw Error(n(308));Ki=i,Sc.dependencies={lanes:0,firstContext:i}}else Ki=Ki.next=i;return l}var Zr=null;function Tc(i){Zr===null?Zr=[i]:Zr.push(i)}function lr(i,l,h,y){var I=l.interleaved;return I===null?(h.next=h,Tc(l)):(h.next=I.next,I.next=h),l.interleaved=h,Aa(i,y)}function Aa(i,l){i.lanes|=l;var h=i.alternate;for(h!==null&&(h.lanes|=l),h=i,i=i.return;i!==null;)i.childLanes|=l,h=i.alternate,h!==null&&(h.childLanes|=l),h=i,i=i.return;return h.tag===3?h.stateNode:null}var ri=!1;function jf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _m(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function Fa(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function ai(i,l,h){var y=i.updateQueue;if(y===null)return null;if(y=y.shared,Pt&2){var I=y.pending;return I===null?l.next=l:(l.next=I.next,I.next=l),y.pending=l,Aa(i,h)}return I=y.interleaved,I===null?(l.next=l,Tc(y)):(l.next=I.next,I.next=l),y.interleaved=l,Aa(i,h)}function oi(i,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var y=l.lanes;y&=i.pendingLanes,h|=y,l.lanes=h,Pl(i,h)}}function Lf(i,l){var h=i.updateQueue,y=i.alternate;if(y!==null&&(y=y.updateQueue,h===y)){var I=null,x=null;if(h=h.firstBaseUpdate,h!==null){do{var L={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};x===null?I=x=L:x=x.next=L,h=h.next}while(h!==null);x===null?I=x=l:x=x.next=l}else I=x=l;h={baseState:y.baseState,firstBaseUpdate:I,lastBaseUpdate:x,shared:y.shared,effects:y.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=l:i.next=l,h.lastBaseUpdate=l}function Ec(i,l,h,y){var I=i.updateQueue;ri=!1;var x=I.firstBaseUpdate,L=I.lastBaseUpdate,q=I.shared.pending;if(q!==null){I.shared.pending=null;var ee=q,be=ee.next;ee.next=null,L===null?x=be:L.next=be,L=ee;var Oe=i.alternate;Oe!==null&&(Oe=Oe.updateQueue,q=Oe.lastBaseUpdate,q!==L&&(q===null?Oe.firstBaseUpdate=be:q.next=be,Oe.lastBaseUpdate=ee))}if(x!==null){var Le=I.baseState;L=0,Oe=be=ee=null,q=x;do{var Fe=q.lane,qe=q.eventTime;if((y&Fe)===Fe){Oe!==null&&(Oe=Oe.next={eventTime:qe,lane:0,tag:q.tag,payload:q.payload,callback:q.callback,next:null});e:{var nt=i,at=q;switch(Fe=l,qe=h,at.tag){case 1:if(nt=at.payload,typeof nt=="function"){Le=nt.call(qe,Le,Fe);break e}Le=nt;break e;case 3:nt.flags=nt.flags&-65537|128;case 0:if(nt=at.payload,Fe=typeof nt=="function"?nt.call(qe,Le,Fe):nt,Fe==null)break e;Le=Z({},Le,Fe);break e;case 2:ri=!0}}q.callback!==null&&q.lane!==0&&(i.flags|=64,Fe=I.effects,Fe===null?I.effects=[q]:Fe.push(q))}else qe={eventTime:qe,lane:Fe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Oe===null?(be=Oe=qe,ee=Le):Oe=Oe.next=qe,L|=Fe;if(q=q.next,q===null){if(q=I.shared.pending,q===null)break;Fe=q,q=Fe.next,Fe.next=null,I.lastBaseUpdate=Fe,I.shared.pending=null}}while(!0);if(Oe===null&&(ee=Le),I.baseState=ee,I.firstBaseUpdate=be,I.lastBaseUpdate=Oe,l=I.shared.interleaved,l!==null){I=l;do L|=I.lane,I=I.next;while(I!==l)}else x===null&&(I.shared.lanes=0);fi|=L,i.lanes=L,i.memoizedState=Le}}function Hm(i,l,h){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var y=i[l],I=y.callback;if(I!==null){if(y.callback=null,y=h,typeof I!="function")throw Error(n(191,I));I.call(y)}}}var Ws=new e.Component().refs;function Rf(i,l,h,y){l=i.memoizedState,h=h(y,l),h=h==null?l:Z({},l,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var Cc={isMounted:function(i){return(i=i._reactInternals)?Ri(i)===i:!1},enqueueSetState:function(i,l,h){i=i._reactInternals;var y=Cr(),I=pi(i),x=Fa(y,I);x.payload=l,h!=null&&(x.callback=h),l=ai(i,x,I),l!==null&&(La(l,i,I,y),oi(l,i,I))},enqueueReplaceState:function(i,l,h){i=i._reactInternals;var y=Cr(),I=pi(i),x=Fa(y,I);x.tag=1,x.payload=l,h!=null&&(x.callback=h),l=ai(i,x,I),l!==null&&(La(l,i,I,y),oi(l,i,I))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var h=Cr(),y=pi(i),I=Fa(h,y);I.tag=2,l!=null&&(I.callback=l),l=ai(i,I,y),l!==null&&(La(l,i,y,h),oi(l,i,y))}};function xc(i,l,h,y,I,x,L){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(y,x,L):l.prototype&&l.prototype.isPureReactComponent?!Ge(h,y)||!Ge(I,x):!0}function Bf(i,l,h){var y=!1,I=ei,x=l.contextType;return typeof x=="object"&&x!==null?x=Ir(x):(I=Or(l)?Sr:or.current,y=l.contextTypes,x=(y=y!=null)?Vs(i,I):ei),l=new l(h,x),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=Cc,i.stateNode=l,l._reactInternals=i,y&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=I,i.__reactInternalMemoizedMaskedChildContext=x),l}function Ym(i,l,h,y){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,y),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,y),l.state!==i&&Cc.enqueueReplaceState(l,l.state,null)}function _f(i,l,h,y){var I=i.stateNode;I.props=h,I.state=i.memoizedState,I.refs=Ws,jf(i);var x=l.contextType;typeof x=="object"&&x!==null?I.context=Ir(x):(x=Or(l)?Sr:or.current,I.context=Vs(i,x)),I.state=i.memoizedState,x=l.getDerivedStateFromProps,typeof x=="function"&&(Rf(i,l,x,h),I.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof I.getSnapshotBeforeUpdate=="function"||typeof I.UNSAFE_componentWillMount!="function"&&typeof I.componentWillMount!="function"||(l=I.state,typeof I.componentWillMount=="function"&&I.componentWillMount(),typeof I.UNSAFE_componentWillMount=="function"&&I.UNSAFE_componentWillMount(),l!==I.state&&Cc.enqueueReplaceState(I,I.state,null),Ec(i,h,I,y),I.state=i.memoizedState),typeof I.componentDidMount=="function"&&(i.flags|=4194308)}function Ql(i,l,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var y=h.stateNode}if(!y)throw Error(n(147,i));var I=y,x=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===x?l.ref:(l=function(L){var q=I.refs;q===Ws&&(q=I.refs={}),L===null?delete q[x]:q[x]=L},l._stringRef=x,l)}if(typeof i!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,i))}return i}function Xl(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function Mc(i){var l=i._init;return l(i._payload)}function zm(i){function l(de,ae){if(i){var he=de.deletions;he===null?(de.deletions=[ae],de.flags|=16):he.push(ae)}}function h(de,ae){if(!i)return null;for(;ae!==null;)l(de,ae),ae=ae.sibling;return null}function y(de,ae){for(de=new Map;ae!==null;)ae.key!==null?de.set(ae.key,ae):de.set(ae.index,ae),ae=ae.sibling;return de}function I(de,ae){return de=yi(de,ae),de.index=0,de.sibling=null,de}function x(de,ae,he){return de.index=he,i?(he=de.alternate,he!==null?(he=he.index,he<ae?(de.flags|=2,ae):he):(de.flags|=2,ae)):(de.flags|=1048576,ae)}function L(de){return i&&de.alternate===null&&(de.flags|=2),de}function q(de,ae,he,Be){return ae===null||ae.tag!==6?(ae=Sh(he,de.mode,Be),ae.return=de,ae):(ae=I(ae,he),ae.return=de,ae)}function ee(de,ae,he,Be){var ot=he.type;return ot===z?Oe(de,ae,he.props.children,Be,he.key):ae!==null&&(ae.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===se&&Mc(ot)===ae.type)?(Be=I(ae,he.props),Be.ref=Ql(de,ae,he),Be.return=de,Be):(Be=rd(he.type,he.key,he.props,null,de.mode,Be),Be.ref=Ql(de,ae,he),Be.return=de,Be)}function be(de,ae,he,Be){return ae===null||ae.tag!==4||ae.stateNode.containerInfo!==he.containerInfo||ae.stateNode.implementation!==he.implementation?(ae=Ih(he,de.mode,Be),ae.return=de,ae):(ae=I(ae,he.children||[]),ae.return=de,ae)}function Oe(de,ae,he,Be,ot){return ae===null||ae.tag!==7?(ae=as(he,de.mode,Be,ot),ae.return=de,ae):(ae=I(ae,he),ae.return=de,ae)}function Le(de,ae,he){if(typeof ae=="string"&&ae!==""||typeof ae=="number")return ae=Sh(""+ae,de.mode,he),ae.return=de,ae;if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case B:return he=rd(ae.type,ae.key,ae.props,null,de.mode,he),he.ref=Ql(de,null,ae),he.return=de,he;case R:return ae=Ih(ae,de.mode,he),ae.return=de,ae;case se:var Be=ae._init;return Le(de,Be(ae._payload),he)}if(Ft(ae)||we(ae))return ae=as(ae,de.mode,he,null),ae.return=de,ae;Xl(de,ae)}return null}function Fe(de,ae,he,Be){var ot=ae!==null?ae.key:null;if(typeof he=="string"&&he!==""||typeof he=="number")return ot!==null?null:q(de,ae,""+he,Be);if(typeof he=="object"&&he!==null){switch(he.$$typeof){case B:return he.key===ot?ee(de,ae,he,Be):null;case R:return he.key===ot?be(de,ae,he,Be):null;case se:return ot=he._init,Fe(de,ae,ot(he._payload),Be)}if(Ft(he)||we(he))return ot!==null?null:Oe(de,ae,he,Be,null);Xl(de,he)}return null}function qe(de,ae,he,Be,ot){if(typeof Be=="string"&&Be!==""||typeof Be=="number")return de=de.get(he)||null,q(ae,de,""+Be,ot);if(typeof Be=="object"&&Be!==null){switch(Be.$$typeof){case B:return de=de.get(Be.key===null?he:Be.key)||null,ee(ae,de,Be,ot);case R:return de=de.get(Be.key===null?he:Be.key)||null,be(ae,de,Be,ot);case se:var ct=Be._init;return qe(de,ae,he,ct(Be._payload),ot)}if(Ft(Be)||we(Be))return de=de.get(he)||null,Oe(ae,de,Be,ot,null);Xl(ae,Be)}return null}function nt(de,ae,he,Be){for(var ot=null,ct=null,dt=ae,wt=ae=0,Vn=null;dt!==null&&wt<he.length;wt++){dt.index>wt?(Vn=dt,dt=null):Vn=dt.sibling;var Bt=Fe(de,dt,he[wt],Be);if(Bt===null){dt===null&&(dt=Vn);break}i&&dt&&Bt.alternate===null&&l(de,dt),ae=x(Bt,ae,wt),ct===null?ot=Bt:ct.sibling=Bt,ct=Bt,dt=Vn}if(wt===he.length)return h(de,dt),tn&&Gi(de,wt),ot;if(dt===null){for(;wt<he.length;wt++)dt=Le(de,he[wt],Be),dt!==null&&(ae=x(dt,ae,wt),ct===null?ot=dt:ct.sibling=dt,ct=dt);return tn&&Gi(de,wt),ot}for(dt=y(de,dt);wt<he.length;wt++)Vn=qe(dt,de,wt,he[wt],Be),Vn!==null&&(i&&Vn.alternate!==null&&dt.delete(Vn.key===null?wt:Vn.key),ae=x(Vn,ae,wt),ct===null?ot=Vn:ct.sibling=Vn,ct=Vn);return i&&dt.forEach(function(vi){return l(de,vi)}),tn&&Gi(de,wt),ot}function at(de,ae,he,Be){var ot=we(he);if(typeof ot!="function")throw Error(n(150));if(he=ot.call(he),he==null)throw Error(n(151));for(var ct=ot=null,dt=ae,wt=ae=0,Vn=null,Bt=he.next();dt!==null&&!Bt.done;wt++,Bt=he.next()){dt.index>wt?(Vn=dt,dt=null):Vn=dt.sibling;var vi=Fe(de,dt,Bt.value,Be);if(vi===null){dt===null&&(dt=Vn);break}i&&dt&&vi.alternate===null&&l(de,dt),ae=x(vi,ae,wt),ct===null?ot=vi:ct.sibling=vi,ct=vi,dt=Vn}if(Bt.done)return h(de,dt),tn&&Gi(de,wt),ot;if(dt===null){for(;!Bt.done;wt++,Bt=he.next())Bt=Le(de,Bt.value,Be),Bt!==null&&(ae=x(Bt,ae,wt),ct===null?ot=Bt:ct.sibling=Bt,ct=Bt);return tn&&Gi(de,wt),ot}for(dt=y(de,dt);!Bt.done;wt++,Bt=he.next())Bt=qe(dt,de,wt,Bt.value,Be),Bt!==null&&(i&&Bt.alternate!==null&&dt.delete(Bt.key===null?wt:Bt.key),ae=x(Bt,ae,wt),ct===null?ot=Bt:ct.sibling=Bt,ct=Bt);return i&&dt.forEach(function(l0){return l(de,l0)}),tn&&Gi(de,wt),ot}function Dn(de,ae,he,Be){if(typeof he=="object"&&he!==null&&he.type===z&&he.key===null&&(he=he.props.children),typeof he=="object"&&he!==null){switch(he.$$typeof){case B:e:{for(var ot=he.key,ct=ae;ct!==null;){if(ct.key===ot){if(ot=he.type,ot===z){if(ct.tag===7){h(de,ct.sibling),ae=I(ct,he.props.children),ae.return=de,de=ae;break e}}else if(ct.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===se&&Mc(ot)===ct.type){h(de,ct.sibling),ae=I(ct,he.props),ae.ref=Ql(de,ct,he),ae.return=de,de=ae;break e}h(de,ct);break}else l(de,ct);ct=ct.sibling}he.type===z?(ae=as(he.props.children,de.mode,Be,he.key),ae.return=de,de=ae):(Be=rd(he.type,he.key,he.props,null,de.mode,Be),Be.ref=Ql(de,ae,he),Be.return=de,de=Be)}return L(de);case R:e:{for(ct=he.key;ae!==null;){if(ae.key===ct)if(ae.tag===4&&ae.stateNode.containerInfo===he.containerInfo&&ae.stateNode.implementation===he.implementation){h(de,ae.sibling),ae=I(ae,he.children||[]),ae.return=de,de=ae;break e}else{h(de,ae);break}else l(de,ae);ae=ae.sibling}ae=Ih(he,de.mode,Be),ae.return=de,de=ae}return L(de);case se:return ct=he._init,Dn(de,ae,ct(he._payload),Be)}if(Ft(he))return nt(de,ae,he,Be);if(we(he))return at(de,ae,he,Be);Xl(de,he)}return typeof he=="string"&&he!==""||typeof he=="number"?(he=""+he,ae!==null&&ae.tag===6?(h(de,ae.sibling),ae=I(ae,he),ae.return=de,de=ae):(h(de,ae),ae=Sh(he,de.mode,Be),ae.return=de,de=ae),L(de)):h(de,ae)}return Dn}var ii=zm(!0),Hf=zm(!1),$s={},Oa=Ar($s),si=Ar($s),eu=Ar($s);function li(i){if(i===$s)throw Error(n(174));return i}function Nc(i,l){switch(Kt(eu,l),Kt(si,i),Kt(Oa,$s),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:tr(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=tr(l,i)}en(Oa),Kt(Oa,l)}function Gs(){en(Oa),en(si),en(eu)}function Yf(i){li(eu.current);var l=li(Oa.current),h=tr(l,i.type);l!==h&&(Kt(si,i),Kt(Oa,h))}function zf(i){si.current===i&&(en(Oa),en(si))}var nn=Ar(0);function tu(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if(l.flags&128)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var nu=[];function Uf(){for(var i=0;i<nu.length;i++)nu[i]._workInProgressVersionPrimary=null;nu.length=0}var qs=F.ReactCurrentDispatcher,It=F.ReactCurrentBatchConfig,Qi=0,cn=null,dn=null,Ln=null,kc=!1,ru=!1,ur=0,Uv=0;function Rn(){throw Error(n(321))}function au(i,l){if(l===null)return!1;for(var h=0;h<l.length&&h<i.length;h++)if(!ve(i[h],l[h]))return!1;return!0}function Ac(i,l,h,y,I,x){if(Qi=x,cn=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,qs.current=i===null||i.memoizedState===null?iu:Zv,i=h(y,I),ru){x=0;do{if(ru=!1,ur=0,25<=x)throw Error(n(301));x+=1,Ln=dn=null,l.updateQueue=null,qs.current=qm,i=h(y,I)}while(ru)}if(qs.current=Io,l=dn!==null&&dn.next!==null,Qi=0,Ln=dn=cn=null,kc=!1,l)throw Error(n(300));return i}function Fc(){var i=ur!==0;return ur=0,i}function pn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ln===null?cn.memoizedState=Ln=i:Ln=Ln.next=i,Ln}function Bn(){if(dn===null){var i=cn.alternate;i=i!==null?i.memoizedState:null}else i=dn.next;var l=Ln===null?cn.memoizedState:Ln.next;if(l!==null)Ln=l,dn=i;else{if(i===null)throw Error(n(310));dn=i,i={memoizedState:dn.memoizedState,baseState:dn.baseState,baseQueue:dn.baseQueue,queue:dn.queue,next:null},Ln===null?cn.memoizedState=Ln=i:Ln=Ln.next=i}return Ln}function Xi(i,l){return typeof l=="function"?l(i):l}function Oc(i){var l=Bn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var y=dn,I=y.baseQueue,x=h.pending;if(x!==null){if(I!==null){var L=I.next;I.next=x.next,x.next=L}y.baseQueue=I=x,h.pending=null}if(I!==null){x=I.next,y=y.baseState;var q=L=null,ee=null,be=x;do{var Oe=be.lane;if((Qi&Oe)===Oe)ee!==null&&(ee=ee.next={lane:0,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null}),y=be.hasEagerState?be.eagerState:i(y,be.action);else{var Le={lane:Oe,action:be.action,hasEagerState:be.hasEagerState,eagerState:be.eagerState,next:null};ee===null?(q=ee=Le,L=y):ee=ee.next=Le,cn.lanes|=Oe,fi|=Oe}be=be.next}while(be!==null&&be!==x);ee===null?L=y:ee.next=q,ve(y,l.memoizedState)||(cr=!0),l.memoizedState=y,l.baseState=L,l.baseQueue=ee,h.lastRenderedState=y}if(i=h.interleaved,i!==null){I=i;do x=I.lane,cn.lanes|=x,fi|=x,I=I.next;while(I!==i)}else I===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function Js(i){var l=Bn(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var y=h.dispatch,I=h.pending,x=l.memoizedState;if(I!==null){h.pending=null;var L=I=I.next;do x=i(x,L.action),L=L.next;while(L!==I);ve(x,l.memoizedState)||(cr=!0),l.memoizedState=x,l.baseQueue===null&&(l.baseState=x),h.lastRenderedState=x}return[x,y]}function Vf(){}function Pc(i,l){var h=cn,y=Bn(),I=l(),x=!ve(y.memoizedState,I);if(x&&(y.memoizedState=I,cr=!0),y=y.queue,$f(Lc.bind(null,h,y,i),[i]),y.getSnapshot!==l||x||Ln!==null&&Ln.memoizedState.tag&1){if(h.flags|=2048,Ks(9,jc.bind(null,h,y,I,l),void 0,null),Un===null)throw Error(n(349));Qi&30||Zf(h,l,I)}return I}function Zf(i,l,h){i.flags|=16384,i={getSnapshot:l,value:h},l=cn.updateQueue,l===null?(l={lastEffect:null,stores:null},cn.updateQueue=l,l.stores=[i]):(h=l.stores,h===null?l.stores=[i]:h.push(i))}function jc(i,l,h,y){l.value=h,l.getSnapshot=y,Do(l)&&Um(i)}function Lc(i,l,h){return h(function(){Do(l)&&Um(i)})}function Do(i){var l=i.getSnapshot;i=i.value;try{var h=l();return!ve(i,h)}catch{return!0}}function Um(i){var l=Aa(i,1);l!==null&&La(l,i,1,-1)}function So(i){var l=pn();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Xi,lastRenderedState:i},l.queue=i,i=i.dispatch=$m.bind(null,cn,i),[l.memoizedState,i]}function Ks(i,l,h,y){return i={tag:i,create:l,destroy:h,deps:y,next:null},l=cn.updateQueue,l===null?(l={lastEffect:null,stores:null},cn.updateQueue=l,l.lastEffect=i.next=i):(h=l.lastEffect,h===null?l.lastEffect=i.next=i:(y=h.next,h.next=i,i.next=y,l.lastEffect=i)),i}function Wf(){return Bn().memoizedState}function Qs(i,l,h,y){var I=pn();cn.flags|=i,I.memoizedState=Ks(1|l,h,void 0,y===void 0?null:y)}function Rc(i,l,h,y){var I=Bn();y=y===void 0?null:y;var x=void 0;if(dn!==null){var L=dn.memoizedState;if(x=L.destroy,y!==null&&au(y,L.deps)){I.memoizedState=Ks(l,h,x,y);return}}cn.flags|=i,I.memoizedState=Ks(1|l,h,x,y)}function Vm(i,l){return Qs(8390656,8,i,l)}function $f(i,l){return Rc(2048,8,i,l)}function Gf(i,l){return Rc(4,2,i,l)}function qf(i,l){return Rc(4,4,i,l)}function Zm(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function Jf(i,l,h){return h=h!=null?h.concat([i]):null,Rc(4,4,Zm.bind(null,l,i),h)}function Bc(){}function Tr(i,l){var h=Bn();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&au(l,y[1])?y[0]:(h.memoizedState=[i,l],i)}function Pa(i,l){var h=Bn();l=l===void 0?null:l;var y=h.memoizedState;return y!==null&&l!==null&&au(l,y[1])?y[0]:(i=i(),h.memoizedState=[i,l],i)}function Wm(i,l,h){return Qi&21?(ve(h,l)||(h=uf(),cn.lanes|=h,fi|=h,i.baseState=!0),l):(i.baseState&&(i.baseState=!1,cr=!0),i.memoizedState=h)}function Vv(i,l){var h=Yt;Yt=h!==0&&4>h?h:4,i(!0);var y=It.transition;It.transition={};try{i(!1),l()}finally{Yt=h,It.transition=y}}function ou(){return Bn().memoizedState}function Xs(i,l,h){var y=pi(i);if(h={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null},Kf(i))Gm(l,h);else if(h=lr(i,l,h,y),h!==null){var I=Cr();La(h,i,y,I),Qf(h,l,y)}}function $m(i,l,h){var y=pi(i),I={lane:y,action:h,hasEagerState:!1,eagerState:null,next:null};if(Kf(i))Gm(l,I);else{var x=i.alternate;if(i.lanes===0&&(x===null||x.lanes===0)&&(x=l.lastRenderedReducer,x!==null))try{var L=l.lastRenderedState,q=x(L,h);if(I.hasEagerState=!0,I.eagerState=q,ve(q,L)){var ee=l.interleaved;ee===null?(I.next=I,Tc(l)):(I.next=ee.next,ee.next=I),l.interleaved=I;return}}catch{}h=lr(i,l,I,y),h!==null&&(I=Cr(),La(h,i,y,I),Qf(h,l,y))}}function Kf(i){var l=i.alternate;return i===cn||l!==null&&l===cn}function Gm(i,l){ru=kc=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function Qf(i,l,h){if(h&4194240){var y=l.lanes;y&=i.pendingLanes,h|=y,l.lanes=h,Pl(i,h)}}var Io={readContext:Ir,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useInsertionEffect:Rn,useLayoutEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useMutableSource:Rn,useSyncExternalStore:Rn,useId:Rn,unstable_isNewReconciler:!1},iu={readContext:Ir,useCallback:function(i,l){return pn().memoizedState=[i,l===void 0?null:l],i},useContext:Ir,useEffect:Vm,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,Qs(4194308,4,Zm.bind(null,l,i),h)},useLayoutEffect:function(i,l){return Qs(4194308,4,i,l)},useInsertionEffect:function(i,l){return Qs(4,2,i,l)},useMemo:function(i,l){var h=pn();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var y=pn();return l=h!==void 0?h(l):l,y.memoizedState=y.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},y.queue=i,i=i.dispatch=Xs.bind(null,cn,i),[y.memoizedState,i]},useRef:function(i){var l=pn();return i={current:i},l.memoizedState=i},useState:So,useDebugValue:Bc,useDeferredValue:function(i){return pn().memoizedState=i},useTransition:function(){var i=So(!1),l=i[0];return i=Vv.bind(null,i[1]),pn().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var y=cn,I=pn();if(tn){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),Un===null)throw Error(n(349));Qi&30||Zf(y,l,h)}I.memoizedState=h;var x={value:h,getSnapshot:l};return I.queue=x,Vm(Lc.bind(null,y,x,i),[i]),y.flags|=2048,Ks(9,jc.bind(null,y,x,h,l),void 0,null),h},useId:function(){var i=pn(),l=Un.identifierPrefix;if(tn){var h=Ja,y=qa;h=(y&~(1<<32-xa(y)-1)).toString(32)+h,l=":"+l+"R"+h,h=ur++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=Uv++,l=":"+l+"r"+h.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},Zv={readContext:Ir,useCallback:Tr,useContext:Ir,useEffect:$f,useImperativeHandle:Jf,useInsertionEffect:Gf,useLayoutEffect:qf,useMemo:Pa,useReducer:Oc,useRef:Wf,useState:function(){return Oc(Xi)},useDebugValue:Bc,useDeferredValue:function(i){var l=Bn();return Wm(l,dn.memoizedState,i)},useTransition:function(){var i=Oc(Xi)[0],l=Bn().memoizedState;return[i,l]},useMutableSource:Vf,useSyncExternalStore:Pc,useId:ou,unstable_isNewReconciler:!1},qm={readContext:Ir,useCallback:Tr,useContext:Ir,useEffect:$f,useImperativeHandle:Jf,useInsertionEffect:Gf,useLayoutEffect:qf,useMemo:Pa,useReducer:Js,useRef:Wf,useState:function(){return Js(Xi)},useDebugValue:Bc,useDeferredValue:function(i){var l=Bn();return dn===null?l.memoizedState=i:Wm(l,dn.memoizedState,i)},useTransition:function(){var i=Js(Xi)[0],l=Bn().memoizedState;return[i,l]},useMutableSource:Vf,useSyncExternalStore:Pc,useId:ou,unstable_isNewReconciler:!1};function es(i,l){try{var h="",y=l;do h+=De(y),y=y.return;while(y);var I=h}catch(x){I=`
Error generating stack: `+x.message+`
`+x.stack}return{value:i,source:l,stack:I,digest:null}}function el(i,l,h){return{value:i,source:null,stack:h??null,digest:l??null}}function _c(i,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var Hc=typeof WeakMap=="function"?WeakMap:Map;function Yc(i,l,h){h=Fa(-1,h),h.tag=3,h.payload={element:null};var y=l.value;return h.callback=function(){Kc||(Kc=!0,hh=y),_c(i,l)},h}function su(i,l,h){h=Fa(-1,h),h.tag=3;var y=i.type.getDerivedStateFromError;if(typeof y=="function"){var I=l.value;h.payload=function(){return y(I)},h.callback=function(){_c(i,l)}}var x=i.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(h.callback=function(){_c(i,l),typeof y!="function"&&(hi===null?hi=new Set([this]):hi.add(this));var L=l.stack;this.componentDidCatch(l.value,{componentStack:L!==null?L:""})}),h}function Jm(i,l,h){var y=i.pingCache;if(y===null){y=i.pingCache=new Hc;var I=new Set;y.set(l,I)}else I=y.get(l),I===void 0&&(I=new Set,y.set(l,I));I.has(h)||(I.add(h),i=Xv.bind(null,i,l,h),l.then(i,i))}function Xf(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function lu(i,l,h,y,I){return i.mode&1?(i.flags|=65536,i.lanes=I,i):(i===l?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=Fa(-1,1),l.tag=2,ai(h,l,1))),h.lanes|=1),i)}var Km=F.ReactCurrentOwner,cr=!1;function Er(i,l,h,y){l.child=i===null?Hf(l,null,h,y):ii(l,i.child,h,y)}function eh(i,l,h,y,I){h=h.render;var x=l.ref;return ni(l,I),y=Ac(i,l,h,y,x,I),h=Fc(),i!==null&&!cr?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~I,no(i,l,I)):(tn&&h&&ql(l),l.flags|=1,Er(i,l,y,I),l.child)}function eo(i,l,h,y,I){if(i===null){var x=h.type;return typeof x=="function"&&!Dh(x)&&x.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=x,th(i,l,x,y,I)):(i=rd(h.type,null,y,l,l.mode,I),i.ref=l.ref,i.return=l,l.child=i)}if(x=i.child,!(i.lanes&I)){var L=x.memoizedProps;if(h=h.compare,h=h!==null?h:Ge,h(L,y)&&i.ref===l.ref)return no(i,l,I)}return l.flags|=1,i=yi(x,y),i.ref=l.ref,i.return=l,l.child=i}function th(i,l,h,y,I){if(i!==null){var x=i.memoizedProps;if(Ge(x,y)&&i.ref===l.ref)if(cr=!1,l.pendingProps=y=x,(i.lanes&I)!==0)i.flags&131072&&(cr=!0);else return l.lanes=i.lanes,no(i,l,I)}return zc(i,l,h,y,I)}function nh(i,l,h){var y=l.pendingProps,I=y.children,x=i!==null?i.memoizedState:null;if(y.mode==="hidden")if(!(l.mode&1))l.memoizedState={baseLanes:0,cachePool:null,transitions:null},Kt(ol,Gr),Gr|=h;else{if(!(h&1073741824))return i=x!==null?x.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,Kt(ol,Gr),Gr|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},y=x!==null?x.baseLanes:h,Kt(ol,Gr),Gr|=y}else x!==null?(y=x.baseLanes|h,l.memoizedState=null):y=h,Kt(ol,Gr),Gr|=y;return Er(i,l,I,h),l.child}function Qm(i,l){var h=l.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function zc(i,l,h,y,I){var x=Or(h)?Sr:or.current;return x=Vs(l,x),ni(l,I),h=Ac(i,l,h,y,x,I),y=Fc(),i!==null&&!cr?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~I,no(i,l,I)):(tn&&y&&ql(l),l.flags|=1,Er(i,l,h,I),l.child)}function Xm(i,l,h,y,I){if(Or(h)){var x=!0;ia(l)}else x=!1;if(ni(l,I),l.stateNode===null)tl(i,l),Bf(l,h,y),_f(l,h,y,I),y=!0;else if(i===null){var L=l.stateNode,q=l.memoizedProps;L.props=q;var ee=L.context,be=h.contextType;typeof be=="object"&&be!==null?be=Ir(be):(be=Or(h)?Sr:or.current,be=Vs(l,be));var Oe=h.getDerivedStateFromProps,Le=typeof Oe=="function"||typeof L.getSnapshotBeforeUpdate=="function";Le||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(q!==y||ee!==be)&&Ym(l,L,y,be),ri=!1;var Fe=l.memoizedState;L.state=Fe,Ec(l,y,L,I),ee=l.memoizedState,q!==y||Fe!==ee||Fr.current||ri?(typeof Oe=="function"&&(Rf(l,h,Oe,y),ee=l.memoizedState),(q=ri||xc(l,h,q,y,Fe,ee,be))?(Le||typeof L.UNSAFE_componentWillMount!="function"&&typeof L.componentWillMount!="function"||(typeof L.componentWillMount=="function"&&L.componentWillMount(),typeof L.UNSAFE_componentWillMount=="function"&&L.UNSAFE_componentWillMount()),typeof L.componentDidMount=="function"&&(l.flags|=4194308)):(typeof L.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=y,l.memoizedState=ee),L.props=y,L.state=ee,L.context=be,y=q):(typeof L.componentDidMount=="function"&&(l.flags|=4194308),y=!1)}else{L=l.stateNode,_m(i,l),q=l.memoizedProps,be=l.type===l.elementType?q:ka(l.type,q),L.props=be,Le=l.pendingProps,Fe=L.context,ee=h.contextType,typeof ee=="object"&&ee!==null?ee=Ir(ee):(ee=Or(h)?Sr:or.current,ee=Vs(l,ee));var qe=h.getDerivedStateFromProps;(Oe=typeof qe=="function"||typeof L.getSnapshotBeforeUpdate=="function")||typeof L.UNSAFE_componentWillReceiveProps!="function"&&typeof L.componentWillReceiveProps!="function"||(q!==Le||Fe!==ee)&&Ym(l,L,y,ee),ri=!1,Fe=l.memoizedState,L.state=Fe,Ec(l,y,L,I);var nt=l.memoizedState;q!==Le||Fe!==nt||Fr.current||ri?(typeof qe=="function"&&(Rf(l,h,qe,y),nt=l.memoizedState),(be=ri||xc(l,h,be,y,Fe,nt,ee)||!1)?(Oe||typeof L.UNSAFE_componentWillUpdate!="function"&&typeof L.componentWillUpdate!="function"||(typeof L.componentWillUpdate=="function"&&L.componentWillUpdate(y,nt,ee),typeof L.UNSAFE_componentWillUpdate=="function"&&L.UNSAFE_componentWillUpdate(y,nt,ee)),typeof L.componentDidUpdate=="function"&&(l.flags|=4),typeof L.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof L.componentDidUpdate!="function"||q===i.memoizedProps&&Fe===i.memoizedState||(l.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||q===i.memoizedProps&&Fe===i.memoizedState||(l.flags|=1024),l.memoizedProps=y,l.memoizedState=nt),L.props=y,L.state=nt,L.context=ee,y=be):(typeof L.componentDidUpdate!="function"||q===i.memoizedProps&&Fe===i.memoizedState||(l.flags|=4),typeof L.getSnapshotBeforeUpdate!="function"||q===i.memoizedProps&&Fe===i.memoizedState||(l.flags|=1024),y=!1)}return rh(i,l,h,y,x,I)}function rh(i,l,h,y,I,x){Qm(i,l);var L=(l.flags&128)!==0;if(!y&&!L)return I&&Pm(l,h,!1),no(i,l,x);y=l.stateNode,Km.current=l;var q=L&&typeof h.getDerivedStateFromError!="function"?null:y.render();return l.flags|=1,i!==null&&L?(l.child=ii(l,i.child,null,x),l.child=ii(l,null,q,x)):Er(i,l,q,x),l.memoizedState=y.state,I&&Pm(l,h,!0),l.child}function to(i){var l=i.stateNode;l.pendingContext?Fm(i,l.pendingContext,l.pendingContext!==l.context):l.context&&Fm(i,l.context,!1),Nc(i,l.containerInfo)}function Uc(i,l,h,y,I){return Qa(),Xa(I),l.flags|=256,Er(i,l,h,y),l.child}var uu={dehydrated:null,treeContext:null,retryLane:0};function cu(i){return{baseLanes:i,cachePool:null,transitions:null}}function du(i,l,h){var y=l.pendingProps,I=nn.current,x=!1,L=(l.flags&128)!==0,q;if((q=L)||(q=i!==null&&i.memoizedState===null?!1:(I&2)!==0),q?(x=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(I|=1),Kt(nn,I&1),i===null)return Pr(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?(l.mode&1?i.data==="$!"?l.lanes=8:l.lanes=1073741824:l.lanes=1,null):(L=y.children,i=y.fallback,x?(y=l.mode,x=l.child,L={mode:"hidden",children:L},!(y&1)&&x!==null?(x.childLanes=0,x.pendingProps=L):x=ad(L,y,0,null),i=as(i,y,h,null),x.return=l,i.return=l,x.sibling=i,l.child=x,l.child.memoizedState=cu(h),l.memoizedState=uu,i):ui(l,L));if(I=i.memoizedState,I!==null&&(q=I.dehydrated,q!==null))return Vc(i,l,L,y,q,I,h);if(x){x=y.fallback,L=l.mode,I=i.child,q=I.sibling;var ee={mode:"hidden",children:y.children};return!(L&1)&&l.child!==I?(y=l.child,y.childLanes=0,y.pendingProps=ee,l.deletions=null):(y=yi(I,ee),y.subtreeFlags=I.subtreeFlags&14680064),q!==null?x=yi(q,x):(x=as(x,L,h,null),x.flags|=2),x.return=l,y.return=l,y.sibling=x,l.child=y,y=x,x=l.child,L=i.child.memoizedState,L=L===null?cu(h):{baseLanes:L.baseLanes|h,cachePool:null,transitions:L.transitions},x.memoizedState=L,x.childLanes=i.childLanes&~h,l.memoizedState=uu,y}return x=i.child,i=x.sibling,y=yi(x,{mode:"visible",children:y.children}),!(l.mode&1)&&(y.lanes=h),y.return=l,y.sibling=null,i!==null&&(h=l.deletions,h===null?(l.deletions=[i],l.flags|=16):h.push(i)),l.child=y,l.memoizedState=null,y}function ui(i,l){return l=ad({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function ut(i,l,h,y){return y!==null&&Xa(y),ii(l,i.child,null,h),i=ui(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function Vc(i,l,h,y,I,x,L){if(h)return l.flags&256?(l.flags&=-257,y=el(Error(n(422))),ut(i,l,L,y)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(x=y.fallback,I=l.mode,y=ad({mode:"visible",children:y.children},I,0,null),x=as(x,I,L,null),x.flags|=2,y.return=l,x.return=l,y.sibling=x,l.child=y,l.mode&1&&ii(l,i.child,null,L),l.child.memoizedState=cu(L),l.memoizedState=uu,x);if(!(l.mode&1))return ut(i,l,L,null);if(I.data==="$!"){if(y=I.nextSibling&&I.nextSibling.dataset,y)var q=y.dgst;return y=q,x=Error(n(419)),y=el(x,y,void 0),ut(i,l,L,y)}if(q=(L&i.childLanes)!==0,cr||q){if(y=Un,y!==null){switch(L&-L){case 4:I=2;break;case 16:I=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:I=32;break;case 536870912:I=268435456;break;default:I=0}I=I&(y.suspendedLanes|L)?0:I,I!==0&&I!==x.retryLane&&(x.retryLane=I,Aa(i,I),La(y,i,I,-1))}return wh(),y=el(Error(n(421))),ut(i,l,L,y)}return I.data==="$?"?(l.flags|=128,l.child=i.child,l=e0.bind(null,i),I._reactRetry=l,null):(i=x.treeContext,Vr=Qo(I.nextSibling),sr=l,tn=!0,Na=null,i!==null&&(sa[la++]=qa,sa[la++]=Ja,sa[la++]=$i,qa=i.id,Ja=i.overflow,$i=l),l=ui(l,y.children),l.flags|=4096,l)}function Zc(i,l,h){i.lanes|=l;var y=i.alternate;y!==null&&(y.lanes|=l),ua(i.return,l,h)}function To(i,l,h,y,I){var x=i.memoizedState;x===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:y,tail:h,tailMode:I}:(x.isBackwards=l,x.rendering=null,x.renderingStartTime=0,x.last=y,x.tail=h,x.tailMode=I)}function eg(i,l,h){var y=l.pendingProps,I=y.revealOrder,x=y.tail;if(Er(i,l,y.children,h),y=nn.current,y&2)y=y&1|2,l.flags|=128;else{if(i!==null&&i.flags&128)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Zc(i,h,l);else if(i.tag===19)Zc(i,h,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}y&=1}if(Kt(nn,y),!(l.mode&1))l.memoizedState=null;else switch(I){case"forwards":for(h=l.child,I=null;h!==null;)i=h.alternate,i!==null&&tu(i)===null&&(I=h),h=h.sibling;h=I,h===null?(I=l.child,l.child=null):(I=h.sibling,h.sibling=null),To(l,!1,I,h,x);break;case"backwards":for(h=null,I=l.child,l.child=null;I!==null;){if(i=I.alternate,i!==null&&tu(i)===null){l.child=I;break}i=I.sibling,I.sibling=h,h=I,I=i}To(l,!0,h,null,x);break;case"together":To(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function tl(i,l){!(l.mode&1)&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function no(i,l,h){if(i!==null&&(l.dependencies=i.dependencies),fi|=l.lanes,!(h&l.childLanes))return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,h=yi(i,i.pendingProps),l.child=h,h.return=l;i.sibling!==null;)i=i.sibling,h=h.sibling=yi(i,i.pendingProps),h.return=l;h.sibling=null}return l.child}function dr(i,l,h){switch(l.tag){case 3:to(l),Qa();break;case 5:Yf(l);break;case 1:Or(l.type)&&ia(l);break;case 4:Nc(l,l.stateNode.containerInfo);break;case 10:var y=l.type._context,I=l.memoizedProps.value;Kt(Ji,y._currentValue),y._currentValue=I;break;case 13:if(y=l.memoizedState,y!==null)return y.dehydrated!==null?(Kt(nn,nn.current&1),l.flags|=128,null):h&l.child.childLanes?du(i,l,h):(Kt(nn,nn.current&1),i=no(i,l,h),i!==null?i.sibling:null);Kt(nn,nn.current&1);break;case 19:if(y=(h&l.childLanes)!==0,i.flags&128){if(y)return eg(i,l,h);l.flags|=128}if(I=l.memoizedState,I!==null&&(I.rendering=null,I.tail=null,I.lastEffect=null),Kt(nn,nn.current),y)break;return null;case 22:case 23:return l.lanes=0,nh(i,l,h)}return no(i,l,h)}var tg,ah,oh,ng;tg=function(i,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},ah=function(){},oh=function(i,l,h,y){var I=i.memoizedProps;if(I!==y){i=l.stateNode,li(Oa.current);var x=null;switch(h){case"input":I=Je(i,I),y=Je(i,y),x=[];break;case"select":I=Z({},I,{value:void 0}),y=Z({},y,{value:void 0}),x=[];break;case"textarea":I=an(i,I),y=an(i,y),x=[];break;default:typeof I.onClick!="function"&&typeof y.onClick=="function"&&(i.onclick=hc)}Ho(h,y);var L;h=null;for(be in I)if(!y.hasOwnProperty(be)&&I.hasOwnProperty(be)&&I[be]!=null)if(be==="style"){var q=I[be];for(L in q)q.hasOwnProperty(L)&&(h||(h={}),h[L]="")}else be!=="dangerouslySetInnerHTML"&&be!=="children"&&be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&be!=="autoFocus"&&(a.hasOwnProperty(be)?x||(x=[]):(x=x||[]).push(be,null));for(be in y){var ee=y[be];if(q=I!=null?I[be]:void 0,y.hasOwnProperty(be)&&ee!==q&&(ee!=null||q!=null))if(be==="style")if(q){for(L in q)!q.hasOwnProperty(L)||ee&&ee.hasOwnProperty(L)||(h||(h={}),h[L]="");for(L in ee)ee.hasOwnProperty(L)&&q[L]!==ee[L]&&(h||(h={}),h[L]=ee[L])}else h||(x||(x=[]),x.push(be,h)),h=ee;else be==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,q=q?q.__html:void 0,ee!=null&&q!==ee&&(x=x||[]).push(be,ee)):be==="children"?typeof ee!="string"&&typeof ee!="number"||(x=x||[]).push(be,""+ee):be!=="suppressContentEditableWarning"&&be!=="suppressHydrationWarning"&&(a.hasOwnProperty(be)?(ee!=null&&be==="onScroll"&&Xt("scroll",i),x||q===ee||(x=[])):(x=x||[]).push(be,ee))}h&&(x=x||[]).push("style",h);var be=x;(l.updateQueue=be)&&(l.flags|=4)}},ng=function(i,l,h,y){h!==y&&(l.flags|=4)};function nl(i,l){if(!tn)switch(i.tailMode){case"hidden":l=i.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var y=null;h!==null;)h.alternate!==null&&(y=h),h=h.sibling;y===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:y.sibling=null}}function fr(i){var l=i.alternate!==null&&i.alternate.child===i.child,h=0,y=0;if(l)for(var I=i.child;I!==null;)h|=I.lanes|I.childLanes,y|=I.subtreeFlags&14680064,y|=I.flags&14680064,I.return=i,I=I.sibling;else for(I=i.child;I!==null;)h|=I.lanes|I.childLanes,y|=I.subtreeFlags,y|=I.flags,I.return=i,I=I.sibling;return i.subtreeFlags|=y,i.childLanes=h,l}function Wv(i,l,h){var y=l.pendingProps;switch(qi(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return fr(l),null;case 1:return Or(l.type)&&yc(),fr(l),null;case 3:return y=l.stateNode,Gs(),en(Fr),en(or),Uf(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(i===null||i.child===null)&&(Jl(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&!(l.flags&256)||(l.flags|=1024,Na!==null&&(gh(Na),Na=null))),ah(i,l),fr(l),null;case 5:zf(l);var I=li(eu.current);if(h=l.type,i!==null&&l.stateNode!=null)oh(i,l,h,y,I),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!y){if(l.stateNode===null)throw Error(n(166));return fr(l),null}if(i=li(Oa.current),Jl(l)){y=l.stateNode,h=l.type;var x=l.memoizedProps;switch(y[$a]=l,y[Xo]=x,i=(l.mode&1)!==0,h){case"dialog":Xt("cancel",y),Xt("close",y);break;case"iframe":case"object":case"embed":Xt("load",y);break;case"video":case"audio":for(I=0;I<vo.length;I++)Xt(vo[I],y);break;case"source":Xt("error",y);break;case"img":case"image":case"link":Xt("error",y),Xt("load",y);break;case"details":Xt("toggle",y);break;case"input":lt(y,x),Xt("invalid",y);break;case"select":y._wrapperState={wasMultiple:!!x.multiple},Xt("invalid",y);break;case"textarea":wn(y,x),Xt("invalid",y)}Ho(h,x),I=null;for(var L in x)if(x.hasOwnProperty(L)){var q=x[L];L==="children"?typeof q=="string"?y.textContent!==q&&(x.suppressHydrationWarning!==!0&&Zl(y.textContent,q,i),I=["children",q]):typeof q=="number"&&y.textContent!==""+q&&(x.suppressHydrationWarning!==!0&&Zl(y.textContent,q,i),I=["children",""+q]):a.hasOwnProperty(L)&&q!=null&&L==="onScroll"&&Xt("scroll",y)}switch(h){case"input":Se(y),Ct(y,x,!0);break;case"textarea":Se(y),vr(y);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(y.onclick=hc)}y=I,l.updateQueue=y,y!==null&&(l.flags|=4)}else{L=I.nodeType===9?I:I.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Ia(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=L.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof y.is=="string"?i=L.createElement(h,{is:y.is}):(i=L.createElement(h),h==="select"&&(L=i,y.multiple?L.multiple=!0:y.size&&(L.size=y.size))):i=L.createElementNS(i,h),i[$a]=l,i[Xo]=y,tg(i,l,!1,!1),l.stateNode=i;e:{switch(L=Li(h,y),h){case"dialog":Xt("cancel",i),Xt("close",i),I=y;break;case"iframe":case"object":case"embed":Xt("load",i),I=y;break;case"video":case"audio":for(I=0;I<vo.length;I++)Xt(vo[I],i);I=y;break;case"source":Xt("error",i),I=y;break;case"img":case"image":case"link":Xt("error",i),Xt("load",i),I=y;break;case"details":Xt("toggle",i),I=y;break;case"input":lt(i,y),I=Je(i,y),Xt("invalid",i);break;case"option":I=y;break;case"select":i._wrapperState={wasMultiple:!!y.multiple},I=Z({},y,{value:void 0}),Xt("invalid",i);break;case"textarea":wn(i,y),I=an(i,y),Xt("invalid",i);break;default:I=y}Ho(h,I),q=I;for(x in q)if(q.hasOwnProperty(x)){var ee=q[x];x==="style"?ji(i,ee):x==="dangerouslySetInnerHTML"?(ee=ee?ee.__html:void 0,ee!=null&&Is(i,ee)):x==="children"?typeof ee=="string"?(h!=="textarea"||ee!=="")&&ho(i,ee):typeof ee=="number"&&ho(i,""+ee):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(a.hasOwnProperty(x)?ee!=null&&x==="onScroll"&&Xt("scroll",i):ee!=null&&j(i,x,ee,L))}switch(h){case"input":Se(i),Ct(i,y,!1);break;case"textarea":Se(i),vr(i);break;case"option":y.value!=null&&i.setAttribute("value",""+Re(y.value));break;case"select":i.multiple=!!y.multiple,x=y.value,x!=null?Ot(i,!!y.multiple,x,!1):y.defaultValue!=null&&Ot(i,!!y.multiple,y.defaultValue,!0);break;default:typeof I.onClick=="function"&&(i.onclick=hc)}switch(h){case"button":case"input":case"select":case"textarea":y=!!y.autoFocus;break e;case"img":y=!0;break e;default:y=!1}}y&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return fr(l),null;case 6:if(i&&l.stateNode!=null)ng(i,l,i.memoizedProps,y);else{if(typeof y!="string"&&l.stateNode===null)throw Error(n(166));if(h=li(eu.current),li(Oa.current),Jl(l)){if(y=l.stateNode,h=l.memoizedProps,y[$a]=l,(x=y.nodeValue!==h)&&(i=sr,i!==null))switch(i.tag){case 3:Zl(y.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Zl(y.nodeValue,h,(i.mode&1)!==0)}x&&(l.flags|=4)}else y=(h.nodeType===9?h:h.ownerDocument).createTextNode(y),y[$a]=l,l.stateNode=y}return fr(l),null;case 13:if(en(nn),y=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(tn&&Vr!==null&&l.mode&1&&!(l.flags&128))Pf(),Qa(),l.flags|=98560,x=!1;else if(x=Jl(l),y!==null&&y.dehydrated!==null){if(i===null){if(!x)throw Error(n(318));if(x=l.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(n(317));x[$a]=l}else Qa(),!(l.flags&128)&&(l.memoizedState=null),l.flags|=4;fr(l),x=!1}else Na!==null&&(gh(Na),Na=null),x=!0;if(!x)return l.flags&65536?l:null}return l.flags&128?(l.lanes=h,l):(y=y!==null,y!==(i!==null&&i.memoizedState!==null)&&y&&(l.child.flags|=8192,l.mode&1&&(i===null||nn.current&1?_n===0&&(_n=3):wh())),l.updateQueue!==null&&(l.flags|=4),fr(l),null);case 4:return Gs(),ah(i,l),i===null&&Jo(l.stateNode.containerInfo),fr(l),null;case 10:return Ic(l.type._context),fr(l),null;case 17:return Or(l.type)&&yc(),fr(l),null;case 19:if(en(nn),x=l.memoizedState,x===null)return fr(l),null;if(y=(l.flags&128)!==0,L=x.rendering,L===null)if(y)nl(x,!1);else{if(_n!==0||i!==null&&i.flags&128)for(i=l.child;i!==null;){if(L=tu(i),L!==null){for(l.flags|=128,nl(x,!1),y=L.updateQueue,y!==null&&(l.updateQueue=y,l.flags|=4),l.subtreeFlags=0,y=h,h=l.child;h!==null;)x=h,i=y,x.flags&=14680066,L=x.alternate,L===null?(x.childLanes=0,x.lanes=i,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=L.childLanes,x.lanes=L.lanes,x.child=L.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=L.memoizedProps,x.memoizedState=L.memoizedState,x.updateQueue=L.updateQueue,x.type=L.type,i=L.dependencies,x.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return Kt(nn,nn.current&1|2),l.child}i=i.sibling}x.tail!==null&&on()>sl&&(l.flags|=128,y=!0,nl(x,!1),l.lanes=4194304)}else{if(!y)if(i=tu(L),i!==null){if(l.flags|=128,y=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),nl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!L.alternate&&!tn)return fr(l),null}else 2*on()-x.renderingStartTime>sl&&h!==1073741824&&(l.flags|=128,y=!0,nl(x,!1),l.lanes=4194304);x.isBackwards?(L.sibling=l.child,l.child=L):(h=x.last,h!==null?h.sibling=L:l.child=L,x.last=L)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=on(),l.sibling=null,h=nn.current,Kt(nn,y?h&1|2:h&1),l):(fr(l),null);case 22:case 23:return vh(),y=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==y&&(l.flags|=8192),y&&l.mode&1?Gr&1073741824&&(fr(l),l.subtreeFlags&6&&(l.flags|=8192)):fr(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function $v(i,l){switch(qi(l),l.tag){case 1:return Or(l.type)&&yc(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return Gs(),en(Fr),en(or),Uf(),i=l.flags,i&65536&&!(i&128)?(l.flags=i&-65537|128,l):null;case 5:return zf(l),null;case 13:if(en(nn),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));Qa()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return en(nn),null;case 4:return Gs(),null;case 10:return Ic(l.type._context),null;case 22:case 23:return vh(),null;case 24:return null;default:return null}}var ca=!1,Ut=!1,ih=typeof WeakSet=="function"?WeakSet:Set,et=null;function ci(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(y){mn(i,l,y)}else h.current=null}function sh(i,l,h){try{h()}catch(y){mn(i,l,y)}}var rg=!1;function fu(i,l){if(Wl=qu,i=$t(),_l(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var y=h.getSelection&&h.getSelection();if(y&&y.rangeCount!==0){h=y.anchorNode;var I=y.anchorOffset,x=y.focusNode;y=y.focusOffset;try{h.nodeType,x.nodeType}catch{h=null;break e}var L=0,q=-1,ee=-1,be=0,Oe=0,Le=i,Fe=null;t:for(;;){for(var qe;Le!==h||I!==0&&Le.nodeType!==3||(q=L+I),Le!==x||y!==0&&Le.nodeType!==3||(ee=L+y),Le.nodeType===3&&(L+=Le.nodeValue.length),(qe=Le.firstChild)!==null;)Fe=Le,Le=qe;for(;;){if(Le===i)break t;if(Fe===h&&++be===I&&(q=L),Fe===x&&++Oe===y&&(ee=L),(qe=Le.nextSibling)!==null)break;Le=Fe,Fe=Le.parentNode}Le=qe}h=q===-1||ee===-1?null:{start:q,end:ee}}else h=null}h=h||{start:0,end:0}}else h=null;for(Zi={focusedElem:i,selectionRange:h},qu=!1,et=l;et!==null;)if(l=et,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,et=i;else for(;et!==null;){l=et;try{var nt=l.alternate;if(l.flags&1024)switch(l.tag){case 0:case 11:case 15:break;case 1:if(nt!==null){var at=nt.memoizedProps,Dn=nt.memoizedState,de=l.stateNode,ae=de.getSnapshotBeforeUpdate(l.elementType===l.type?at:ka(l.type,at),Dn);de.__reactInternalSnapshotBeforeUpdate=ae}break;case 3:var he=l.stateNode.containerInfo;he.nodeType===1?he.textContent="":he.nodeType===9&&he.documentElement&&he.removeChild(he.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Be){mn(l,l.return,Be)}if(i=l.sibling,i!==null){i.return=l.return,et=i;break}et=l.return}return nt=rg,rg=!1,nt}function rl(i,l,h){var y=l.updateQueue;if(y=y!==null?y.lastEffect:null,y!==null){var I=y=y.next;do{if((I.tag&i)===i){var x=I.destroy;I.destroy=void 0,x!==void 0&&sh(l,h,x)}I=I.next}while(I!==y)}}function hu(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var y=h.create;h.destroy=y()}h=h.next}while(h!==l)}}function lh(i){var l=i.ref;if(l!==null){var h=i.stateNode;switch(i.tag){case 5:i=h;break;default:i=h}typeof l=="function"?l(i):l.current=i}}function ag(i){var l=i.alternate;l!==null&&(i.alternate=null,ag(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[$a],delete l[Xo],delete l[mc],delete l[_],delete l[zs])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function og(i){return i.tag===5||i.tag===3||i.tag===4}function ig(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||og(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Wc(i,l,h){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=hc));else if(y!==4&&(i=i.child,i!==null))for(Wc(i,l,h),i=i.sibling;i!==null;)Wc(i,l,h),i=i.sibling}function $c(i,l,h){var y=i.tag;if(y===5||y===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(y!==4&&(i=i.child,i!==null))for($c(i,l,h),i=i.sibling;i!==null;)$c(i,l,h),i=i.sibling}var Gn=null,Wr=!1;function Eo(i,l,h){for(h=h.child;h!==null;)al(i,l,h),h=h.sibling}function al(i,l,h){if(Va&&typeof Va.onCommitFiberUnmount=="function")try{Va.onCommitFiberUnmount(Uu,h)}catch{}switch(h.tag){case 5:Ut||ci(h,l);case 6:var y=Gn,I=Wr;Gn=null,Eo(i,l,h),Gn=y,Wr=I,Gn!==null&&(Wr?(i=Gn,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Gn.removeChild(h.stateNode));break;case 18:Gn!==null&&(Wr?(i=Gn,h=h.stateNode,i.nodeType===8?Af(i.parentNode,h):i.nodeType===1&&Af(i,h),zt(i)):Af(Gn,h.stateNode));break;case 4:y=Gn,I=Wr,Gn=h.stateNode.containerInfo,Wr=!0,Eo(i,l,h),Gn=y,Wr=I;break;case 0:case 11:case 14:case 15:if(!Ut&&(y=h.updateQueue,y!==null&&(y=y.lastEffect,y!==null))){I=y=y.next;do{var x=I,L=x.destroy;x=x.tag,L!==void 0&&(x&2||x&4)&&sh(h,l,L),I=I.next}while(I!==y)}Eo(i,l,h);break;case 1:if(!Ut&&(ci(h,l),y=h.stateNode,typeof y.componentWillUnmount=="function"))try{y.props=h.memoizedProps,y.state=h.memoizedState,y.componentWillUnmount()}catch(q){mn(h,l,q)}Eo(i,l,h);break;case 21:Eo(i,l,h);break;case 22:h.mode&1?(Ut=(y=Ut)||h.memoizedState!==null,Eo(i,l,h),Ut=y):Eo(i,l,h);break;default:Eo(i,l,h)}}function Gc(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new ih),l.forEach(function(y){var I=t0.bind(null,i,y);h.has(y)||(h.add(y),y.then(I,I))})}}function da(i,l){var h=l.deletions;if(h!==null)for(var y=0;y<h.length;y++){var I=h[y];try{var x=i,L=l,q=L;e:for(;q!==null;){switch(q.tag){case 5:Gn=q.stateNode,Wr=!1;break e;case 3:Gn=q.stateNode.containerInfo,Wr=!0;break e;case 4:Gn=q.stateNode.containerInfo,Wr=!0;break e}q=q.return}if(Gn===null)throw Error(n(160));al(x,L,I),Gn=null,Wr=!1;var ee=I.alternate;ee!==null&&(ee.return=null),I.return=null}catch(be){mn(I,l,be)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)uh(l,i),l=l.sibling}function uh(i,l){var h=i.alternate,y=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(da(l,i),$r(i),y&4){try{rl(3,i,i.return),hu(3,i)}catch(at){mn(i,i.return,at)}try{rl(5,i,i.return)}catch(at){mn(i,i.return,at)}}break;case 1:da(l,i),$r(i),y&512&&h!==null&&ci(h,h.return);break;case 5:if(da(l,i),$r(i),y&512&&h!==null&&ci(h,h.return),i.flags&32){var I=i.stateNode;try{ho(I,"")}catch(at){mn(i,i.return,at)}}if(y&4&&(I=i.stateNode,I!=null)){var x=i.memoizedProps,L=h!==null?h.memoizedProps:x,q=i.type,ee=i.updateQueue;if(i.updateQueue=null,ee!==null)try{q==="input"&&x.type==="radio"&&x.name!=null&&ft(I,x),Li(q,L);var be=Li(q,x);for(L=0;L<ee.length;L+=2){var Oe=ee[L],Le=ee[L+1];Oe==="style"?ji(I,Le):Oe==="dangerouslySetInnerHTML"?Is(I,Le):Oe==="children"?ho(I,Le):j(I,Oe,Le,be)}switch(q){case"input":Dt(I,x);break;case"textarea":Tn(I,x);break;case"select":var Fe=I._wrapperState.wasMultiple;I._wrapperState.wasMultiple=!!x.multiple;var qe=x.value;qe!=null?Ot(I,!!x.multiple,qe,!1):Fe!==!!x.multiple&&(x.defaultValue!=null?Ot(I,!!x.multiple,x.defaultValue,!0):Ot(I,!!x.multiple,x.multiple?[]:"",!1))}I[Xo]=x}catch(at){mn(i,i.return,at)}}break;case 6:if(da(l,i),$r(i),y&4){if(i.stateNode===null)throw Error(n(162));I=i.stateNode,x=i.memoizedProps;try{I.nodeValue=x}catch(at){mn(i,i.return,at)}}break;case 3:if(da(l,i),$r(i),y&4&&h!==null&&h.memoizedState.isDehydrated)try{zt(l.containerInfo)}catch(at){mn(i,i.return,at)}break;case 4:da(l,i),$r(i);break;case 13:da(l,i),$r(i),I=i.child,I.flags&8192&&(x=I.memoizedState!==null,I.stateNode.isHidden=x,!x||I.alternate!==null&&I.alternate.memoizedState!==null||(Jc=on())),y&4&&Gc(i);break;case 22:if(Oe=h!==null&&h.memoizedState!==null,i.mode&1?(Ut=(be=Ut)||Oe,da(l,i),Ut=be):da(l,i),$r(i),y&8192){if(be=i.memoizedState!==null,(i.stateNode.isHidden=be)&&!Oe&&i.mode&1)for(et=i,Oe=i.child;Oe!==null;){for(Le=et=Oe;et!==null;){switch(Fe=et,qe=Fe.child,Fe.tag){case 0:case 11:case 14:case 15:rl(4,Fe,Fe.return);break;case 1:ci(Fe,Fe.return);var nt=Fe.stateNode;if(typeof nt.componentWillUnmount=="function"){y=Fe,h=Fe.return;try{l=y,nt.props=l.memoizedProps,nt.state=l.memoizedState,nt.componentWillUnmount()}catch(at){mn(y,h,at)}}break;case 5:ci(Fe,Fe.return);break;case 22:if(Fe.memoizedState!==null){lg(Le);continue}}qe!==null?(qe.return=Fe,et=qe):lg(Le)}Oe=Oe.sibling}e:for(Oe=null,Le=i;;){if(Le.tag===5){if(Oe===null){Oe=Le;try{I=Le.stateNode,be?(x=I.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(q=Le.stateNode,ee=Le.memoizedProps.style,L=ee!=null&&ee.hasOwnProperty("display")?ee.display:null,q.style.display=Pi("display",L))}catch(at){mn(i,i.return,at)}}}else if(Le.tag===6){if(Oe===null)try{Le.stateNode.nodeValue=be?"":Le.memoizedProps}catch(at){mn(i,i.return,at)}}else if((Le.tag!==22&&Le.tag!==23||Le.memoizedState===null||Le===i)&&Le.child!==null){Le.child.return=Le,Le=Le.child;continue}if(Le===i)break e;for(;Le.sibling===null;){if(Le.return===null||Le.return===i)break e;Oe===Le&&(Oe=null),Le=Le.return}Oe===Le&&(Oe=null),Le.sibling.return=Le.return,Le=Le.sibling}}break;case 19:da(l,i),$r(i),y&4&&Gc(i);break;case 21:break;default:da(l,i),$r(i)}}function $r(i){var l=i.flags;if(l&2){try{e:{for(var h=i.return;h!==null;){if(og(h)){var y=h;break e}h=h.return}throw Error(n(160))}switch(y.tag){case 5:var I=y.stateNode;y.flags&32&&(ho(I,""),y.flags&=-33);var x=ig(i);$c(i,x,I);break;case 3:case 4:var L=y.stateNode.containerInfo,q=ig(i);Wc(i,q,L);break;default:throw Error(n(161))}}catch(ee){mn(i,i.return,ee)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function sg(i,l,h){et=i,ja(i)}function ja(i,l,h){for(var y=(i.mode&1)!==0;et!==null;){var I=et,x=I.child;if(I.tag===22&&y){var L=I.memoizedState!==null||ca;if(!L){var q=I.alternate,ee=q!==null&&q.memoizedState!==null||Ut;q=ca;var be=Ut;if(ca=L,(Ut=ee)&&!be)for(et=I;et!==null;)L=et,ee=L.child,L.tag===22&&L.memoizedState!==null?ch(I):ee!==null?(ee.return=L,et=ee):ch(I);for(;x!==null;)et=x,ja(x),x=x.sibling;et=I,ca=q,Ut=be}di(i)}else I.subtreeFlags&8772&&x!==null?(x.return=I,et=x):di(i)}}function di(i){for(;et!==null;){var l=et;if(l.flags&8772){var h=l.alternate;try{if(l.flags&8772)switch(l.tag){case 0:case 11:case 15:Ut||hu(5,l);break;case 1:var y=l.stateNode;if(l.flags&4&&!Ut)if(h===null)y.componentDidMount();else{var I=l.elementType===l.type?h.memoizedProps:ka(l.type,h.memoizedProps);y.componentDidUpdate(I,h.memoizedState,y.__reactInternalSnapshotBeforeUpdate)}var x=l.updateQueue;x!==null&&Hm(l,x,y);break;case 3:var L=l.updateQueue;if(L!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}Hm(l,L,h)}break;case 5:var q=l.stateNode;if(h===null&&l.flags&4){h=q;var ee=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":ee.autoFocus&&h.focus();break;case"img":ee.src&&(h.src=ee.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var be=l.alternate;if(be!==null){var Oe=be.memoizedState;if(Oe!==null){var Le=Oe.dehydrated;Le!==null&&zt(Le)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Ut||l.flags&512&&lh(l)}catch(Fe){mn(l,l.return,Fe)}}if(l===i){et=null;break}if(h=l.sibling,h!==null){h.return=l.return,et=h;break}et=l.return}}function lg(i){for(;et!==null;){var l=et;if(l===i){et=null;break}var h=l.sibling;if(h!==null){h.return=l.return,et=h;break}et=l.return}}function ch(i){for(;et!==null;){var l=et;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{hu(4,l)}catch(ee){mn(l,h,ee)}break;case 1:var y=l.stateNode;if(typeof y.componentDidMount=="function"){var I=l.return;try{y.componentDidMount()}catch(ee){mn(l,I,ee)}}var x=l.return;try{lh(l)}catch(ee){mn(l,x,ee)}break;case 5:var L=l.return;try{lh(l)}catch(ee){mn(l,L,ee)}}}catch(ee){mn(l,l.return,ee)}if(l===i){et=null;break}var q=l.sibling;if(q!==null){q.return=l.return,et=q;break}et=l.return}}var Gv=Math.ceil,qc=F.ReactCurrentDispatcher,dh=F.ReactCurrentOwner,fa=F.ReactCurrentBatchConfig,Pt=0,Un=null,xn=null,qn=0,Gr=0,ol=Ar(0),_n=0,il=null,fi=0,pu=0,fh=0,mu=null,jr=null,Jc=0,sl=1/0,Co=null,Kc=!1,hh=null,hi=null,Qc=!1,Hn=null,Xc=0,gu=0,ph=null,yu=-1,ed=0;function Cr(){return Pt&6?on():yu!==-1?yu:yu=on()}function pi(i){return i.mode&1?Pt&2&&qn!==0?qn&-qn:Bm.transition!==null?(ed===0&&(ed=uf()),ed):(i=Yt,i!==0||(i=window.event,i=i===void 0?16:cm(i.type)),i):1}function La(i,l,h,y){if(50<gu)throw gu=0,ph=null,Error(n(185));Ol(i,h,y),(!(Pt&2)||i!==Un)&&(i===Un&&(!(Pt&2)&&(pu|=h),_n===4&&mi(i,qn)),hr(i,y),h===1&&Pt===0&&!(l.mode&1)&&(sl=on()+500,vc&&ti()))}function hr(i,l){var h=i.callbackNode;Tv(i,l);var y=Bi(i,i===Un?qn:0);if(y===0)h!==null&&Qp(h),i.callbackNode=null,i.callbackPriority=0;else if(l=y&-y,i.callbackPriority!==l){if(h!=null&&Qp(h),l===1)i.tag===0?Wi(cg.bind(null,i)):jm(cg.bind(null,i)),pc(function(){!(Pt&6)&&ti()}),h=null;else{switch(_i(y)){case 1:h=sf;break;case 4:h=Xp;break;case 16:h=Al;break;case 536870912:h=lf;break;default:h=Al}h=yg(h,ug.bind(null,i))}i.callbackPriority=l,i.callbackNode=h}}function ug(i,l){if(yu=-1,ed=0,Pt&6)throw Error(n(327));var h=i.callbackNode;if(gi()&&i.callbackNode!==h)return null;var y=Bi(i,i===Un?qn:0);if(y===0)return null;if(y&30||y&i.expiredLanes||l)l=td(i,y);else{l=y;var I=Pt;Pt|=2;var x=fg();(Un!==i||qn!==l)&&(Co=null,sl=on()+500,ns(i,l));do try{Kv();break}catch(q){dg(i,q)}while(!0);Kl(),qc.current=x,Pt=I,xn!==null?l=0:(Un=null,qn=0,l=_n)}if(l!==0){if(l===2&&(I=Zu(i),I!==0&&(y=I,l=mh(i,I))),l===1)throw h=il,ns(i,0),mi(i,y),hr(i,on()),h;if(l===6)mi(i,y);else{if(I=i.current.alternate,!(y&30)&&!qv(I)&&(l=td(i,y),l===2&&(x=Zu(i),x!==0&&(y=x,l=mh(i,x))),l===1))throw h=il,ns(i,0),mi(i,y),hr(i,on()),h;switch(i.finishedWork=I,i.finishedLanes=y,l){case 0:case 1:throw Error(n(345));case 2:rs(i,jr,Co);break;case 3:if(mi(i,y),(y&130023424)===y&&(l=Jc+500-on(),10<l)){if(Bi(i,0)!==0)break;if(I=i.suspendedLanes,(I&y)!==y){Cr(),i.pingedLanes|=i.suspendedLanes&I;break}i.timeoutHandle=Ko(rs.bind(null,i,jr,Co),l);break}rs(i,jr,Co);break;case 4:if(mi(i,y),(y&4194240)===y)break;for(l=i.eventTimes,I=-1;0<y;){var L=31-xa(y);x=1<<L,L=l[L],L>I&&(I=L),y&=~x}if(y=I,y=on()-y,y=(120>y?120:480>y?480:1080>y?1080:1920>y?1920:3e3>y?3e3:4320>y?4320:1960*Gv(y/1960))-y,10<y){i.timeoutHandle=Ko(rs.bind(null,i,jr,Co),y);break}rs(i,jr,Co);break;case 5:rs(i,jr,Co);break;default:throw Error(n(329))}}}return hr(i,on()),i.callbackNode===h?ug.bind(null,i):null}function mh(i,l){var h=mu;return i.current.memoizedState.isDehydrated&&(ns(i,l).flags|=256),i=td(i,l),i!==2&&(l=jr,jr=h,l!==null&&gh(l)),i}function gh(i){jr===null?jr=i:jr.push.apply(jr,i)}function qv(i){for(var l=i;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var y=0;y<h.length;y++){var I=h[y],x=I.getSnapshot;I=I.value;try{if(!ve(x(),I))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function mi(i,l){for(l&=~fh,l&=~pu,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var h=31-xa(l),y=1<<h;i[h]=-1,l&=~y}}function cg(i){if(Pt&6)throw Error(n(327));gi();var l=Bi(i,0);if(!(l&1))return hr(i,on()),null;var h=td(i,l);if(i.tag!==0&&h===2){var y=Zu(i);y!==0&&(l=y,h=mh(i,y))}if(h===1)throw h=il,ns(i,0),mi(i,l),hr(i,on()),h;if(h===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,rs(i,jr,Co),hr(i,on()),null}function yh(i,l){var h=Pt;Pt|=1;try{return i(l)}finally{Pt=h,Pt===0&&(sl=on()+500,vc&&ti())}}function ts(i){Hn!==null&&Hn.tag===0&&!(Pt&6)&&gi();var l=Pt;Pt|=1;var h=fa.transition,y=Yt;try{if(fa.transition=null,Yt=1,i)return i()}finally{Yt=y,fa.transition=h,Pt=l,!(Pt&6)&&ti()}}function vh(){Gr=ol.current,en(ol)}function ns(i,l){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,Gl(h)),xn!==null)for(h=xn.return;h!==null;){var y=h;switch(qi(y),y.tag){case 1:y=y.type.childContextTypes,y!=null&&yc();break;case 3:Gs(),en(Fr),en(or),Uf();break;case 5:zf(y);break;case 4:Gs();break;case 13:en(nn);break;case 19:en(nn);break;case 10:Ic(y.type._context);break;case 22:case 23:vh()}h=h.return}if(Un=i,xn=i=yi(i.current,null),qn=Gr=l,_n=0,il=null,fh=pu=fi=0,jr=mu=null,Zr!==null){for(l=0;l<Zr.length;l++)if(h=Zr[l],y=h.interleaved,y!==null){h.interleaved=null;var I=y.next,x=h.pending;if(x!==null){var L=x.next;x.next=I,y.next=L}h.pending=y}Zr=null}return i}function dg(i,l){do{var h=xn;try{if(Kl(),qs.current=Io,kc){for(var y=cn.memoizedState;y!==null;){var I=y.queue;I!==null&&(I.pending=null),y=y.next}kc=!1}if(Qi=0,Ln=dn=cn=null,ru=!1,ur=0,dh.current=null,h===null||h.return===null){_n=1,il=l,xn=null;break}e:{var x=i,L=h.return,q=h,ee=l;if(l=qn,q.flags|=32768,ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var be=ee,Oe=q,Le=Oe.tag;if(!(Oe.mode&1)&&(Le===0||Le===11||Le===15)){var Fe=Oe.alternate;Fe?(Oe.updateQueue=Fe.updateQueue,Oe.memoizedState=Fe.memoizedState,Oe.lanes=Fe.lanes):(Oe.updateQueue=null,Oe.memoizedState=null)}var qe=Xf(L);if(qe!==null){qe.flags&=-257,lu(qe,L,q,x,l),qe.mode&1&&Jm(x,be,l),l=qe,ee=be;var nt=l.updateQueue;if(nt===null){var at=new Set;at.add(ee),l.updateQueue=at}else nt.add(ee);break e}else{if(!(l&1)){Jm(x,be,l),wh();break e}ee=Error(n(426))}}else if(tn&&q.mode&1){var Dn=Xf(L);if(Dn!==null){!(Dn.flags&65536)&&(Dn.flags|=256),lu(Dn,L,q,x,l),Xa(es(ee,q));break e}}x=ee=es(ee,q),_n!==4&&(_n=2),mu===null?mu=[x]:mu.push(x),x=L;do{switch(x.tag){case 3:x.flags|=65536,l&=-l,x.lanes|=l;var de=Yc(x,ee,l);Lf(x,de);break e;case 1:q=ee;var ae=x.type,he=x.stateNode;if(!(x.flags&128)&&(typeof ae.getDerivedStateFromError=="function"||he!==null&&typeof he.componentDidCatch=="function"&&(hi===null||!hi.has(he)))){x.flags|=65536,l&=-l,x.lanes|=l;var Be=su(x,q,l);Lf(x,Be);break e}}x=x.return}while(x!==null)}pg(h)}catch(ot){l=ot,xn===h&&h!==null&&(xn=h=h.return);continue}break}while(!0)}function fg(){var i=qc.current;return qc.current=Io,i===null?Io:i}function wh(){(_n===0||_n===3||_n===2)&&(_n=4),Un===null||!(fi&268435455)&&!(pu&268435455)||mi(Un,qn)}function td(i,l){var h=Pt;Pt|=2;var y=fg();(Un!==i||qn!==l)&&(Co=null,ns(i,l));do try{Jv();break}catch(I){dg(i,I)}while(!0);if(Kl(),Pt=h,qc.current=y,xn!==null)throw Error(n(261));return Un=null,qn=0,_n}function Jv(){for(;xn!==null;)hg(xn)}function Kv(){for(;xn!==null&&!zu();)hg(xn)}function hg(i){var l=gg(i.alternate,i,Gr);i.memoizedProps=i.pendingProps,l===null?pg(i):xn=l,dh.current=null}function pg(i){var l=i;do{var h=l.alternate;if(i=l.return,l.flags&32768){if(h=$v(h,l),h!==null){h.flags&=32767,xn=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{_n=6,xn=null;return}}else if(h=Wv(h,l,Gr),h!==null){xn=h;return}if(l=l.sibling,l!==null){xn=l;return}xn=l=i}while(l!==null);_n===0&&(_n=5)}function rs(i,l,h){var y=Yt,I=fa.transition;try{fa.transition=null,Yt=1,Qv(i,l,h,y)}finally{fa.transition=I,Yt=y}return null}function Qv(i,l,h,y){do gi();while(Hn!==null);if(Pt&6)throw Error(n(327));h=i.finishedWork;var I=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var x=h.lanes|h.childLanes;if(om(i,x),i===Un&&(xn=Un=null,qn=0),!(h.subtreeFlags&2064)&&!(h.flags&2064)||Qc||(Qc=!0,yg(Al,function(){return gi(),null})),x=(h.flags&15990)!==0,h.subtreeFlags&15990||x){x=fa.transition,fa.transition=null;var L=Yt;Yt=1;var q=Pt;Pt|=4,dh.current=null,fu(i,h),uh(h,i),Yv(Zi),qu=!!Wl,Zi=Wl=null,i.current=h,sg(h),Dv(),Pt=q,Yt=L,fa.transition=x}else i.current=h;if(Qc&&(Qc=!1,Hn=i,Xc=I),x=i.pendingLanes,x===0&&(hi=null),Iv(h.stateNode),hr(i,on()),l!==null)for(y=i.onRecoverableError,h=0;h<l.length;h++)I=l[h],y(I.value,{componentStack:I.stack,digest:I.digest});if(Kc)throw Kc=!1,i=hh,hh=null,i;return Xc&1&&i.tag!==0&&gi(),x=i.pendingLanes,x&1?i===ph?gu++:(gu=0,ph=i):gu=0,ti(),null}function gi(){if(Hn!==null){var i=_i(Xc),l=fa.transition,h=Yt;try{if(fa.transition=null,Yt=16>i?16:i,Hn===null)var y=!1;else{if(i=Hn,Hn=null,Xc=0,Pt&6)throw Error(n(331));var I=Pt;for(Pt|=4,et=i.current;et!==null;){var x=et,L=x.child;if(et.flags&16){var q=x.deletions;if(q!==null){for(var ee=0;ee<q.length;ee++){var be=q[ee];for(et=be;et!==null;){var Oe=et;switch(Oe.tag){case 0:case 11:case 15:rl(8,Oe,x)}var Le=Oe.child;if(Le!==null)Le.return=Oe,et=Le;else for(;et!==null;){Oe=et;var Fe=Oe.sibling,qe=Oe.return;if(ag(Oe),Oe===be){et=null;break}if(Fe!==null){Fe.return=qe,et=Fe;break}et=qe}}}var nt=x.alternate;if(nt!==null){var at=nt.child;if(at!==null){nt.child=null;do{var Dn=at.sibling;at.sibling=null,at=Dn}while(at!==null)}}et=x}}if(x.subtreeFlags&2064&&L!==null)L.return=x,et=L;else e:for(;et!==null;){if(x=et,x.flags&2048)switch(x.tag){case 0:case 11:case 15:rl(9,x,x.return)}var de=x.sibling;if(de!==null){de.return=x.return,et=de;break e}et=x.return}}var ae=i.current;for(et=ae;et!==null;){L=et;var he=L.child;if(L.subtreeFlags&2064&&he!==null)he.return=L,et=he;else e:for(L=ae;et!==null;){if(q=et,q.flags&2048)try{switch(q.tag){case 0:case 11:case 15:hu(9,q)}}catch(ot){mn(q,q.return,ot)}if(q===L){et=null;break e}var Be=q.sibling;if(Be!==null){Be.return=q.return,et=Be;break e}et=q.return}}if(Pt=I,ti(),Va&&typeof Va.onPostCommitFiberRoot=="function")try{Va.onPostCommitFiberRoot(Uu,i)}catch{}y=!0}return y}finally{Yt=h,fa.transition=l}}return!1}function bh(i,l,h){l=es(h,l),l=Yc(i,l,1),i=ai(i,l,1),l=Cr(),i!==null&&(Ol(i,1,l),hr(i,l))}function mn(i,l,h){if(i.tag===3)bh(i,i,h);else for(;l!==null;){if(l.tag===3){bh(l,i,h);break}else if(l.tag===1){var y=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof y.componentDidCatch=="function"&&(hi===null||!hi.has(y))){i=es(h,i),i=su(l,i,1),l=ai(l,i,1),i=Cr(),l!==null&&(Ol(l,1,i),hr(l,i));break}}l=l.return}}function Xv(i,l,h){var y=i.pingCache;y!==null&&y.delete(l),l=Cr(),i.pingedLanes|=i.suspendedLanes&h,Un===i&&(qn&h)===h&&(_n===4||_n===3&&(qn&130023424)===qn&&500>on()-Jc?ns(i,0):fh|=h),hr(i,l)}function mg(i,l){l===0&&(i.mode&1?(l=Vu,Vu<<=1,!(Vu&130023424)&&(Vu=4194304)):l=1);var h=Cr();i=Aa(i,l),i!==null&&(Ol(i,l,h),hr(i,h))}function e0(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),mg(i,h)}function t0(i,l){var h=0;switch(i.tag){case 13:var y=i.stateNode,I=i.memoizedState;I!==null&&(h=I.retryLane);break;case 19:y=i.stateNode;break;default:throw Error(n(314))}y!==null&&y.delete(l),mg(i,h)}var gg;gg=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||Fr.current)cr=!0;else{if(!(i.lanes&h)&&!(l.flags&128))return cr=!1,dr(i,l,h);cr=!!(i.flags&131072)}else cr=!1,tn&&l.flags&1048576&&Lm(l,bc,l.index);switch(l.lanes=0,l.tag){case 2:var y=l.type;tl(i,l),i=l.pendingProps;var I=Vs(l,or.current);ni(l,h),I=Ac(null,l,y,i,I,h);var x=Fc();return l.flags|=1,typeof I=="object"&&I!==null&&typeof I.render=="function"&&I.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,Or(y)?(x=!0,ia(l)):x=!1,l.memoizedState=I.state!==null&&I.state!==void 0?I.state:null,jf(l),I.updater=Cc,l.stateNode=I,I._reactInternals=l,_f(l,y,i,h),l=rh(null,l,y,!0,x,h)):(l.tag=0,tn&&x&&ql(l),Er(null,l,I,h),l=l.child),l;case 16:y=l.elementType;e:{switch(tl(i,l),i=l.pendingProps,I=y._init,y=I(y._payload),l.type=y,I=l.tag=nd(y),i=ka(y,i),I){case 0:l=zc(null,l,y,i,h);break e;case 1:l=Xm(null,l,y,i,h);break e;case 11:l=eh(null,l,y,i,h);break e;case 14:l=eo(null,l,y,ka(y.type,i),h);break e}throw Error(n(306,y,""))}return l;case 0:return y=l.type,I=l.pendingProps,I=l.elementType===y?I:ka(y,I),zc(i,l,y,I,h);case 1:return y=l.type,I=l.pendingProps,I=l.elementType===y?I:ka(y,I),Xm(i,l,y,I,h);case 3:e:{if(to(l),i===null)throw Error(n(387));y=l.pendingProps,x=l.memoizedState,I=x.element,_m(i,l),Ec(l,y,null,h);var L=l.memoizedState;if(y=L.element,x.isDehydrated)if(x={element:y,isDehydrated:!1,cache:L.cache,pendingSuspenseBoundaries:L.pendingSuspenseBoundaries,transitions:L.transitions},l.updateQueue.baseState=x,l.memoizedState=x,l.flags&256){I=es(Error(n(423)),l),l=Uc(i,l,y,h,I);break e}else if(y!==I){I=es(Error(n(424)),l),l=Uc(i,l,y,h,I);break e}else for(Vr=Qo(l.stateNode.containerInfo.firstChild),sr=l,tn=!0,Na=null,h=Hf(l,null,y,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(Qa(),y===I){l=no(i,l,h);break e}Er(i,l,y,h)}l=l.child}return l;case 5:return Yf(l),i===null&&Pr(l),y=l.type,I=l.pendingProps,x=i!==null?i.memoizedProps:null,L=I.children,$l(y,I)?L=null:x!==null&&$l(y,x)&&(l.flags|=32),Qm(i,l),Er(i,l,L,h),l.child;case 6:return i===null&&Pr(l),null;case 13:return du(i,l,h);case 4:return Nc(l,l.stateNode.containerInfo),y=l.pendingProps,i===null?l.child=ii(l,null,y,h):Er(i,l,y,h),l.child;case 11:return y=l.type,I=l.pendingProps,I=l.elementType===y?I:ka(y,I),eh(i,l,y,I,h);case 7:return Er(i,l,l.pendingProps,h),l.child;case 8:return Er(i,l,l.pendingProps.children,h),l.child;case 12:return Er(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(y=l.type._context,I=l.pendingProps,x=l.memoizedProps,L=I.value,Kt(Ji,y._currentValue),y._currentValue=L,x!==null)if(ve(x.value,L)){if(x.children===I.children&&!Fr.current){l=no(i,l,h);break e}}else for(x=l.child,x!==null&&(x.return=l);x!==null;){var q=x.dependencies;if(q!==null){L=x.child;for(var ee=q.firstContext;ee!==null;){if(ee.context===y){if(x.tag===1){ee=Fa(-1,h&-h),ee.tag=2;var be=x.updateQueue;if(be!==null){be=be.shared;var Oe=be.pending;Oe===null?ee.next=ee:(ee.next=Oe.next,Oe.next=ee),be.pending=ee}}x.lanes|=h,ee=x.alternate,ee!==null&&(ee.lanes|=h),ua(x.return,h,l),q.lanes|=h;break}ee=ee.next}}else if(x.tag===10)L=x.type===l.type?null:x.child;else if(x.tag===18){if(L=x.return,L===null)throw Error(n(341));L.lanes|=h,q=L.alternate,q!==null&&(q.lanes|=h),ua(L,h,l),L=x.sibling}else L=x.child;if(L!==null)L.return=x;else for(L=x;L!==null;){if(L===l){L=null;break}if(x=L.sibling,x!==null){x.return=L.return,L=x;break}L=L.return}x=L}Er(i,l,I.children,h),l=l.child}return l;case 9:return I=l.type,y=l.pendingProps.children,ni(l,h),I=Ir(I),y=y(I),l.flags|=1,Er(i,l,y,h),l.child;case 14:return y=l.type,I=ka(y,l.pendingProps),I=ka(y.type,I),eo(i,l,y,I,h);case 15:return th(i,l,l.type,l.pendingProps,h);case 17:return y=l.type,I=l.pendingProps,I=l.elementType===y?I:ka(y,I),tl(i,l),l.tag=1,Or(y)?(i=!0,ia(l)):i=!1,ni(l,h),Bf(l,y,I),_f(l,y,I,h),rh(null,l,y,!0,i,h);case 19:return eg(i,l,h);case 22:return nh(i,l,h)}throw Error(n(156,l.tag))};function yg(i,l){return Kp(i,l)}function n0(i,l,h,y){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=y,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(i,l,h,y){return new n0(i,l,h,y)}function Dh(i){return i=i.prototype,!(!i||!i.isReactComponent)}function nd(i){if(typeof i=="function")return Dh(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Q)return 11;if(i===ie)return 14}return 2}function yi(i,l){var h=i.alternate;return h===null?(h=qr(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function rd(i,l,h,y,I,x){var L=2;if(y=i,typeof i=="function")Dh(i)&&(L=1);else if(typeof i=="string")L=5;else e:switch(i){case z:return as(h.children,I,x,l);case H:L=8,I|=8;break;case Y:return i=qr(12,h,l,I|2),i.elementType=Y,i.lanes=x,i;case le:return i=qr(13,h,l,I),i.elementType=le,i.lanes=x,i;case pe:return i=qr(19,h,l,I),i.elementType=pe,i.lanes=x,i;case fe:return ad(h,I,x,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case U:L=10;break e;case J:L=9;break e;case Q:L=11;break e;case ie:L=14;break e;case se:L=16,y=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=qr(L,h,l,I),l.elementType=i,l.type=y,l.lanes=x,l}function as(i,l,h,y){return i=qr(7,i,y,l),i.lanes=h,i}function ad(i,l,h,y){return i=qr(22,i,y,l),i.elementType=fe,i.lanes=h,i.stateNode={isHidden:!1},i}function Sh(i,l,h){return i=qr(6,i,null,l),i.lanes=h,i}function Ih(i,l,h){return l=qr(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function r0(i,l,h,y,I){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Fl(0),this.expirationTimes=Fl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fl(0),this.identifierPrefix=y,this.onRecoverableError=I,this.mutableSourceEagerHydrationData=null}function Th(i,l,h,y,I,x,L,q,ee){return i=new r0(i,l,h,q,ee),l===1?(l=1,x===!0&&(l|=8)):l=0,x=qr(3,null,null,l),i.current=x,x.stateNode=i,x.memoizedState={element:y,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},jf(x),i}function a0(i,l,h){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:R,key:y==null?null:""+y,children:i,containerInfo:l,implementation:h}}function vg(i){if(!i)return ei;i=i._reactInternals;e:{if(Ri(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(Or(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var h=i.type;if(Or(h))return Om(i,h,l)}return l}function wg(i,l,h,y,I,x,L,q,ee){return i=Th(h,y,!0,i,I,x,L,q,ee),i.context=vg(null),h=i.current,y=Cr(),I=pi(h),x=Fa(y,I),x.callback=l??null,ai(h,x,I),i.current.lanes=I,Ol(i,I,y),hr(i,y),i}function od(i,l,h,y){var I=l.current,x=Cr(),L=pi(I);return h=vg(h),l.context===null?l.context=h:l.pendingContext=h,l=Fa(x,L),l.payload={element:i},y=y===void 0?null:y,y!==null&&(l.callback=y),i=ai(I,l,L),i!==null&&(La(i,I,L,x),oi(i,I,L)),L}function id(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 5:return i.child.stateNode;default:return i.child.stateNode}}function bg(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<l?h:l}}function Eh(i,l){bg(i,l),(i=i.alternate)&&bg(i,l)}function o0(){return null}var Ch=typeof reportError=="function"?reportError:function(i){console.error(i)};function sd(i){this._internalRoot=i}ld.prototype.render=sd.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));od(i,l,null,null)},ld.prototype.unmount=sd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;ts(function(){od(null,i,null,null)}),l[Ur]=null}};function ld(i){this._internalRoot=i}ld.prototype.unstable_scheduleHydration=function(i){if(i){var l=df();i={blockedOn:null,target:i,priority:l};for(var h=0;h<Wo.length&&l!==0&&l<Wo[h].priority;h++);Wo.splice(h,0,i),h===0&&lm(i)}};function xh(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function ud(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Dg(){}function cd(i,l,h,y,I){if(I){if(typeof y=="function"){var x=y;y=function(){var be=id(L);x.call(be)}}var L=wg(l,y,i,0,null,!1,!1,"",Dg);return i._reactRootContainer=L,i[Ur]=L.current,Jo(i.nodeType===8?i.parentNode:i),ts(),L}for(;I=i.lastChild;)i.removeChild(I);if(typeof y=="function"){var q=y;y=function(){var be=id(ee);q.call(be)}}var ee=Th(i,0,!1,null,null,!1,!1,"",Dg);return i._reactRootContainer=ee,i[Ur]=ee.current,Jo(i.nodeType===8?i.parentNode:i),ts(function(){od(l,ee,h,y)}),ee}function dd(i,l,h,y,I){var x=h._reactRootContainer;if(x){var L=x;if(typeof I=="function"){var q=I;I=function(){var ee=id(L);q.call(ee)}}od(l,L,i,I)}else L=cd(h,l,i,I,y);return id(L)}cf=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var h=Cs(l.pendingLanes);h!==0&&(Pl(l,h|1),hr(l,on()),!(Pt&6)&&(sl=on()+500,ti()))}break;case 13:ts(function(){var y=Aa(i,1);if(y!==null){var I=Cr();La(y,i,1,I)}}),Eh(i,1)}},Wu=function(i){if(i.tag===13){var l=Aa(i,134217728);if(l!==null){var h=Cr();La(l,i,134217728,h)}Eh(i,134217728)}},im=function(i){if(i.tag===13){var l=pi(i),h=Aa(i,l);if(h!==null){var y=Cr();La(h,i,l,y)}Eh(i,l)}},df=function(){return Yt},ff=function(i,l){var h=Yt;try{return Yt=i,l()}finally{Yt=h}},ye=function(i,l,h){switch(l){case"input":if(Dt(i,h),l=h.name,h.type==="radio"&&l!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var y=h[l];if(y!==i&&y.form===i.form){var I=gc(y);if(!I)throw Error(n(90));Ze(y),Dt(y,I)}}}break;case"textarea":Tn(i,h);break;case"select":l=h.value,l!=null&&Ot(i,!!h.multiple,l,!1)}},Vt=yh,On=ts;var i0={usingClientEntryPoint:!1,Events:[ar,St,gc,ze,gt,yh]},vu={findFiberByHostInstance:Ga,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},s0={bundleType:vu.bundleType,version:vu.version,rendererPackageName:vu.rendererPackageName,rendererConfig:vu.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:F.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=qp(i),i===null?null:i.stateNode},findFiberByHostInstance:vu.findFiberByHostInstance||o0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var fd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!fd.isDisabled&&fd.supportsFiber)try{Uu=fd.inject(s0),Va=fd}catch{}}return ga.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i0,ga.createPortal=function(i,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!xh(l))throw Error(n(200));return a0(i,l,null,h)},ga.createRoot=function(i,l){if(!xh(i))throw Error(n(299));var h=!1,y="",I=Ch;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(y=l.identifierPrefix),l.onRecoverableError!==void 0&&(I=l.onRecoverableError)),l=Th(i,1,!1,null,null,h,!1,y,I),i[Ur]=l.current,Jo(i.nodeType===8?i.parentNode:i),new sd(l)},ga.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=qp(l),i=i===null?null:i.stateNode,i},ga.flushSync=function(i){return ts(i)},ga.hydrate=function(i,l,h){if(!ud(l))throw Error(n(200));return dd(null,i,l,!0,h)},ga.hydrateRoot=function(i,l,h){if(!xh(i))throw Error(n(405));var y=h!=null&&h.hydratedSources||null,I=!1,x="",L=Ch;if(h!=null&&(h.unstable_strictMode===!0&&(I=!0),h.identifierPrefix!==void 0&&(x=h.identifierPrefix),h.onRecoverableError!==void 0&&(L=h.onRecoverableError)),l=wg(l,null,i,1,h??null,I,!1,x,L),i[Ur]=l.current,Jo(i),y)for(i=0;i<y.length;i++)h=y[i],I=h._getVersion,I=I(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,I]:l.mutableSourceEagerHydrationData.push(h,I);return new ld(l)},ga.render=function(i,l,h){if(!ud(l))throw Error(n(200));return dd(null,i,l,!1,h)},ga.unmountComponentAtNode=function(i){if(!ud(i))throw Error(n(40));return i._reactRootContainer?(ts(function(){dd(null,null,i,!1,function(){i._reactRootContainer=null,i[Ur]=null})}),!0):!1},ga.unstable_batchedUpdates=yh,ga.unstable_renderSubtreeIntoContainer=function(i,l,h,y){if(!ud(h))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return dd(i,l,h,!1,y)},ga.version="18.2.0-next-9e3b772b8-20220608",ga}function HT(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(HT)}catch(e){console.error(e)}}HT();_T.exports=n8();var I1=_T.exports;const T1=er(I1);var Ap,YT=I1;Ap=Lo.createRoot=YT.createRoot;Lo.hydrateRoot=YT.hydrateRoot;const r8=e=>{const{children:t,className:n,clickSpaceDestroy:r,destroy:a}=e,o=()=>{r&&a()},s=c=>{(c.key==="Escape"||(c.ctrlKey||c.metaKey)&&c.key.toLowerCase()==="w")&&a()};return w.jsx("div",{className:`dialog-wrapper ${n}`,onClick:o,onKeyDown:c=>s(c),children:w.jsx("div",{className:"dialog-container",onClick:c=>c.stopPropagation(),children:t})})};function By(e,t,n){const r=document.createElement("div");document.body.append(r),setTimeout(()=>{var d;(d=r.firstElementChild)==null||d.classList.add("showup")},0);const a={destroy:()=>{var d,p;(d=r.firstElementChild)==null||d.classList.remove("showup"),(p=r.firstElementChild)==null||p.classList.add("showoff"),setTimeout(()=>{r.detach(),c.unmount()},MI)}},o={...n,destroy:a.destroy};let s=w.jsx(r8,{destroy:a.destroy,clickSpaceDestroy:!0,...e,children:w.jsx(t,{...o})});s=w.jsx(Bo,{store:Ee,context:mt,children:s});const c=Lo.createRoot(r);return c.render(s),a}const a8=e=>{const{shownStatus:t,setShownStatus:n}=e,{dailyNotesState:{app:r,settings:a},globalState:{manifest:o}}=A.useContext(mt),s=A.useRef(null);A.useEffect(()=>{if(t){const v=D=>{var S;(S=s.current)!=null&&S.contains(D.target)||D.stopPropagation(),n(!1)};window.addEventListener("click",v,{capture:!0,once:!0})}},[t]);const c=A.useCallback(async v=>{const{type:D}=v;if(D.startsWith("text"))try{return`${await S1.parseHtml(v)}`}catch(S){new C.Notice(S)}},[]),d=A.useCallback(()=>{const v=document.createElement("input");document.body.appendChild(v),v.type="file",v.multiple=!1,v.accept="text/html",v.onchange=async()=>{if(!v.files||v.files.length===0)return;const D=v.files[0];await c(D),document.body.removeChild(v)},v.click()},[]),p=()=>{r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},m=()=>{if(a!=null&&a.needVerify){Qe.setLocked(!0);return}else new C.Notice(N("You have not set a password or enable this feature yet")),r.setting.open(),r.setting.openTabById(o.id||"obsidian-memos")},g=()=>{new Db(r,o.version).open()};return w.jsxs("div",{className:`menu-btns-popup ${t?"":"hidden"}`,ref:s,children:[w.jsxs("div",{className:"btn action-btn",onClick:p,children:[w.jsx("span",{ref:v=>{v&&C.setIcon(v,"user")},className:"icon"}),N("Settings")]}),(a==null?void 0:a.needVerify)&&w.jsxs("div",{className:"btn action-btn",onClick:m,children:[w.jsx("span",{ref:v=>{v&&C.setIcon(v,"lock")},className:"icon"}),N("Lock")]}),w.jsxs("div",{className:"btn action-btn",onClick:d,children:[w.jsx("span",{ref:v=>{v&&C.setIcon(v,"import")},className:"icon"}),N("Import")]}),w.jsxs("div",{className:"btn action-btn",onClick:g,children:[w.jsx("span",{ref:v=>{v&&C.setIcon(v,"file-text")},className:"icon"}),N("ChangeLog")]})]})};function zT(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(n=zT(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Xn(){for(var e,t,n=0,r="",a=arguments.length;n<a;n++)(e=arguments[n])&&(t=zT(e))&&(r&&(r+=" "),r+=t);return r}const o8=e=>{const t={};return e.forEach(n=>{const r=Ue.getDateString(n.createdAt);t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},i8=e=>{const t={};return e.forEach(n=>{const r=Ue.getTimeString(n.createdAt).split(":")[0];t[r]?t[r]++:t[r]=1}),Object.keys(t).sort((n,r)=>t[r]-t[n])[0]},E1=({statusType:e})=>{const{memoState:{memos:t,tags:n},locationState:{pathname:r},dailyNotesState:{settings:a,app:o}}=A.useContext(mt),[s,c]=A.useState(0),[d,p]=A.useState(0),[m,g]=A.useState(0),[v,D]=A.useState(null),[S,T]=A.useState(!1),E=$.useRef(null),[O,k]=A.useState(0),[j,F]=A.useState(0),[B,R]=A.useState(0),[z,H]=A.useState(""),[Y,U]=A.useState(""),[J,Q]=A.useState(!1),[le,pe]=A.useState(null);A.useEffect(()=>{const oe=t.filter(we=>!we.deletedAt&&we.rowStatus!=="ARCHIVED");R(oe.filter(we=>{var Z;return(Z=we.thinoType)==null?void 0:Z.startsWith("TASK")}).length),H(o8(t)),U(i8(t))},[t]),A.useLayoutEffect(()=>{if(!o)return;const{tags:oe,memos:we,days:Z}=s8(o);g(oe),c(we),p(Z)},[o]),A.useEffect(()=>{let oe=0;const we=s-O,Z=1e3,G=te=>{oe||(oe=te);const ge=te-oe;if(ge<Z){const Ie=ge/Z;k(O+we*Ie),requestAnimationFrame(G)}else k(s)};requestAnimationFrame(G)},[s]),A.useEffect(()=>{let oe=0;const we=d-j,Z=1e3,G=te=>{oe||(oe=te);const ge=te-oe;if(ge<Z){const Ie=ge/Z;F(j+we*Ie),requestAnimationFrame(G)}else F(d)};requestAnimationFrame(G)},[d]),A.useEffect(()=>{!a||!o||(T(s>9999||m>999||d>999),l8({tags:m,memos:s,days:d},o))},[s,m,d]),A.useEffect(()=>{Te.initialized&&t&&r==="/"&&(g(n.length),c(t.filter(oe=>!(oe.deletedAt!==""&&oe.deletedAt)).length),D(t.length>0?t[t.length-1]:null))},[n,t,r]),A.useEffect(()=>{if(!Te.initialized)return;if(!v){p(0);return}if(!E.current||!(v!=null&&v.createdAt))return;C.requireApiVersion("1.4.4")&&C.setTooltip(E.current,N("Started from")+" "+Ue.getDateTimeString((v==null?void 0:v.createdAt)??""));const oe=Math.ceil((Date.now()-Ue.getTimeStampByDate(v==null?void 0:v.createdAt))/1e3/3600/24);p(t?oe:0)},[v]);const ie=(oe,we)=>{if(J&&we===le){He.setMemoFilter(""),Q(!1);return}const Z=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([oe]));Et.pushQuery(Z),He.setMemoFilter(Z.id),Q(!0),pe(we)},se=()=>{ie({type:"LIST",value:{operator:"IS_NOT",value:"LIST"},relation:"AND"},"LIST")},fe=()=>{ie({type:"TYPE",value:{operator:"IS_NOT",value:"NOT_TAGGED"},relation:"AND"},"TYPE")};return w.jsx("div",{className:Xn("status-text-container",S?"text-overflow":"",e),children:e==="banner"?w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"status-text memos-text",children:[w.jsx("span",{className:"amount-text",children:Math.round(O)}),w.jsx("span",{className:"type-text",children:"THINO"})]}),w.jsxs("div",{className:"status-text tags-text",children:[w.jsx("span",{className:"amount-text",children:m}),w.jsx("span",{className:"type-text",children:N("TAG")})]}),w.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),He.setPathname("/daily")},children:[w.jsx("span",{className:"amount-text",children:Math.round(j)??0}),w.jsx("span",{className:"type-text",children:N("DAY")})]})]}):w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"status-sidebar-header title-text",children:w.jsx("span",{className:"normal-text",children:N("Thino status")})}),w.jsxs("div",{className:"status-sidebar-wrapper",children:[w.jsxs("div",{className:"status-text memos-text",children:[w.jsx("span",{className:"type-text",children:N("Thino amount")}),w.jsx("span",{className:"amount-text",children:Math.round(O)})]}),w.jsxs("div",{className:"status-text memos-text",onClick:se,children:[w.jsx("span",{className:"type-text",children:N("Task amount")}),w.jsx("span",{className:"amount-text",children:Math.round(B)??0})]}),w.jsxs("div",{className:"status-text tags-text",onClick:fe,children:[w.jsx("span",{className:"type-text",children:N("Used tags")}),w.jsx("span",{className:"amount-text",children:m})]}),w.jsxs("div",{ref:E,className:"status-text duration-text",onClick:()=>{Qe.setShowSiderbarInMobileView(!1),He.setPathname("/daily")},children:[w.jsx("span",{className:"type-text",children:N("Used days")}),w.jsx("span",{className:"amount-text",children:Math.round(j)??0})]}),w.jsxs("div",{className:"status-text most-active-day-text",onClick:()=>{const oe=C.moment(z,"YYYY/MM/DD").startOf("day").valueOf(),we=C.moment(z,"YYYY/MM/DD").endOf("day").valueOf();He.setFromAndToQuery(oe,we)},children:[w.jsx("span",{className:"type-text",children:N("Most active day")}),w.jsx("span",{className:"amount-text",children:z})]}),w.jsxs("div",{className:"status-text most-active-hour-text",children:[w.jsx("span",{className:"type-text",children:N("Most active hour")}),w.jsx("span",{className:"amount-text",children:Y})]})]})]})})};function UT(e){return`userBannerCache:${e}`}function s8(e){try{const t=UT(e==null?void 0:e.appId),n=Kn.get([t])[t];return n?JSON.parse(n):{tags:0,memos:0,days:0}}catch(t){return console.error(t),{tags:0,memos:0,days:0}}}function l8({tags:e,memos:t,days:n},r){try{const a={tags:e,memos:t,days:n},o=UT(r==null?void 0:r.appId);Kn.set({[o]:JSON.stringify(a)})}catch(a){console.error(a)}}const u8=[{text:N("AND"),value:"AND"},{text:N("OR"),value:"OR"}],pl={TAG:{value:"TAG",text:N("TAG"),operators:[{text:N("INCLUDE"),value:"CONTAIN"},{text:N("EXCLUDE"),value:"NOT_CONTAIN"}]},TYPE:{value:"TYPE",text:N("TYPE"),operators:[{value:"IS",text:N("IS")},{value:"IS_NOT",text:N("ISNOT")}],values:[{value:"CONNECTED",text:N("LINKED")},{value:"NOT_TAGGED",text:N("NO TAGS")},{value:"LINKED",text:N("HAS LINKS")},{value:"IMAGED",text:N("HAS IMAGES")}]},TEXT:{value:"TEXT",text:N("TEXT"),operators:[{value:"CONTAIN",text:N("INCLUDE")},{value:"NOT_CONTAIN",text:N("EXCLUDE")}]},DATE:{value:"DATE",text:N("DATE"),operators:[{value:"NOT_CONTAIN",text:N("BEFORE")},{value:"CONTAIN",text:N("AFTER")}]},LIST:{value:"LIST",text:N("LIST"),operators:[{value:"IS",text:N("IS")},{value:"IS_NOT",text:N("ISNOT")}],values:[{value:"TODO",text:N("TODO")},{value:"DONE",text:N("DONE")},{value:"LIST",text:N("JOURNAL")},{value:"OTHER",text:N("OTHER")}]},SOURCE:{value:"SOURCE",text:N("SOURCE"),operators:[{value:"IS",text:N("IS")},{value:"IS_NOT",text:N("ISNOT")}],values:[{value:"DAILY",text:N("DAILY")},{value:"MULTI",text:N("MULTI")},{value:"FILE",text:N("FILE")},{value:"CANVAS",text:N("CANVAS")}]}},Mw=pl.TYPE.values,c8=e=>{for(const t of Mw)if(t.value===e)return t.text;return""},kD=()=>({type:"TAG",value:{operator:"CONTAIN",value:""},relation:"AND"}),Wd=(e,t)=>{let n=!0;for(const r of t){const{relation:a}=r,o=d8(e,r);a==="OR"?n=n||o:n=n&&o}return n},d8=(e,t)=>{const{type:n,value:{operator:r,value:a}}=t;if(a==="")return!0;let o=!0;if(n==="TAG"){let s=!0;const c=new Set;for(const d of Array.from(e.content.match(Fn)||[])){const m=d.replace(Fn,"$1").trim().split("/");let g="";for(const v of m)g+=v,c.add(g),g+="/"}for(const d of Array.from(e.content.match($n)||[])){const m=d.replace($n,"$1").trim().split("/");let g="";for(const v of m)g+=v,c.add(g),g+="/"}c.has(a)||(s=!1),r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="TYPE"){let s=!1;(a==="NOT_TAGGED"&&e.content.match(Fn)===null&&e.content.match(mr)===null||a==="LINKED"&&e.content.match(Bu)!==null||a==="IMAGED"&&e.content.match(_u)!==null||a==="CONNECTED"&&e.content.match(Il)!==null)&&(s=!0),r==="IS_NOT"&&(s=!s),o=s}else if(n==="TEXT"){let s=e.content.toLowerCase().includes(a.toLowerCase());r==="NOT_CONTAIN"&&(s=!s),o=s}else if(n==="LIST"){let c=(e.thinoType==="JOURNAL"?"LIST":e.thinoType==="TASK-TODO"?"TODO":e.thinoType==="TASK-DONE"?"DONE":"OTHER").contains(a);r==="IS_NOT"&&(c=!c),o=c}else if(n==="SOURCE"){let s=e.sourceType===a;r==="IS_NOT"&&(s=!s),o=s}else if(n==="DATE"){const s=C.moment(a,"YYYY-MM-DD").isValid();let c,d;if(s)c=C.moment(a,"YYYY-MM-DD"),d=c.isBefore(C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss"),"day");else{const m=(app.plugins.enabledPlugins.has("nldates-obsidian")&&app.plugins.getPlugin("nldates-obsidian")).parseDate(a);m.date!==null&&(d=m.moment.isBefore(C.moment(e.createdAt),"day"))}r==="NOT_CONTAIN"&&(d=!d),o=d}return o=e.linkId===""?o:!1,o};function ki(e){const[t,n]=A.useState(()=>!!e),r=A.useCallback(a=>{n(typeof a=="boolean"?a:o=>!o)},[]);return[t,r]}const Fp=()=>{const{dailyNotesState:{app:e,view:t},locationState:{query:{type:n}}}=A.useContext(mt),r=$.useRef(null),a=$.useRef(null),[o,s]=ki(!1);A.useEffect(()=>{!r||!t||!e||(t.registerEvent(e.workspace.on("blur-on-memos",()=>{var g;(g=r.current)==null||g.blur()})),t.registerEvent(e.workspace.on("focus-on-searchBar",()=>{var g;(g=r.current)==null||g.focus()})))},[r,e,t]),A.useEffect(()=>{a&&C.setIcon(a.current,"search")},[a]);const c=g=>{const{type:v}=He.getState().query;g===v&&(g=""),He.setMemoTypeQuery(g)},d=g=>{const v=g.currentTarget.value;if(!v.contains(" -time: ")){He.setTextQuery(v);return}const D=v.split(" -time: ")[1],S=D.length>10?D.match(/\d{4}-\d{2}-\d{2}/g):null;if(S==null){He.setTextQuery(v.split(" -time: ")[0]);return}if(S.length===1){const T=C.moment(S[0]);He.setTimeQuery({from:T.startOf("day").valueOf(),to:T.endOf("day").valueOf()})}else if(S.length===2){const T=C.moment(S[0]),E=C.moment(S[1]);He.setTimeQuery({from:T.startOf("day").valueOf(),to:E.endOf("day").valueOf()})}He.setTextQuery(v.split(" -time: ")[0])},p=()=>{s(!0)},m=()=>{s(!1)};return w.jsxs("div",{className:"search-bar-container",children:[w.jsxs("div",{className:"search-bar-inputer",children:[w.jsx("span",{ref:a,className:"btn icon-img"}),w.jsx("input",{ref:r,className:"text-input",type:"text",onMouseOver:p,onMouseOut:m,placeholder:o?N("Type here"):"",onChange:d})]}),w.jsx("div",{className:"quickly-action-wrapper",children:w.jsxs("div",{className:"quickly-action-container",children:[w.jsx("span",{className:"title-text",children:N("Quick filter")}),w.jsxs("div",{className:"section-container types-container",children:[w.jsxs("span",{className:"section-text",children:[N("TYPE"),":"]}),w.jsx("div",{className:"values-container",children:Mw.map((g,v)=>w.jsxs("div",{children:[w.jsx("span",{className:`type-item ${n===g.value?"selected":""}`,onClick:()=>{c(g.value)},children:g.text}),v+1<Mw.length?w.jsx("span",{className:"split-text",children:"/"}):null]},g.value))})]})]})})]})},f8=e=>{const{children:t,when:n}=e;return n?w.jsx(w.Fragment,{children:t}):null},so=f8;function qt(){const e=document.createDocumentFragment();e.createEl("div",{cls:"thino-info"}).createEl("div",{text:N("This is a pro feature, please upgrade to pro version to use it.")});const r=e.createEl("div",{cls:"thino-link"}).createEl("div",{text:N("You can get pro version from: ")}),a=localStorage.getItem("language");let o="https://pkmer.cn/products/UserProfile/";a&&a==="zh"?o="https://pkmer.cn/products/thino/":o="https://thino.pkmer.net/en/",r.createEl("a",{text:"PKMer",attr:{href:o}}),new C.Notice(e,5e3)}const{exec:h8,execSync:yX}=C.Platform.isDesktop&&require("child_process"),{createHash:p8}=C.Platform.isDesktop&&require("crypto"),m8={native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"},g8=C.Platform.isDesktop&&{darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:`${m8[y8()]}\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid`,linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"};function y8(){return process.platform!=="win32"?"":process.arch==="ia32"&&Object.hasOwnProperty.call(process.env,"PROCESSOR_ARCHITEW6432")?"mixed":"native"}function v8(e){return p8("sha256").update(e).digest("hex")}function w8(e){switch(process.platform){case"darwin":return e.split("IOPlatformUUID")[1].split(`
`)[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return e.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"freebsd":return e.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw new Error(`Unsupported platform: ${process.platform}`)}}function vn(e=!1){return new Promise((t,n)=>{h8(g8[process.platform],{},(r,a)=>{if(r)return n(new Error(`Error while obtaining machine id: ${r.stack}`));const o=w8(a.toString());return t(e?o:v8(o))})})}const AD={list:"align-left",waterfall:"layout-grid",calendar:"calendar",minimal:"list",table:"table",chat:"message-square",moments:"chrome"},b8=e=>{const{dailyNotesState:{app:t,view:n,verifyState:r,settings:a},globalState:{manifest:o,isMobileView:s}}=A.useContext(mt),c=A.useRef(null),d=A.useRef(null),[p,m]=A.useState((window.app||t).loadLocalStorage("thinoListView")),[g,v]=A.useState(null);A.useEffect(()=>{if(!o||!t)return;const S=t==null?void 0:t.plugins.getPlugin(o.id);v(S),m(S==null?void 0:S.settings.MemoListView),Qe.setMemoListView(S==null?void 0:S.settings.MemoListView)},[o,t]),A.useEffect(()=>{if(!t||!n||!g||!g.settings)return;const S=()=>{var E;if(n.leaf.height===0)return;const T=(E=g==null?void 0:g.settings)==null?void 0:E.MemoListView;T==="chat"||T==="moments"||(n.leaf.width>950?(m(T),Qe.setMemoListView(T)):n.leaf.width<=950&&(Qe.setMemoListView("list"),m("list")))};S(),d.current||(d.current=t.workspace.on("resize",S),n.registerEvent(d.current))},[t,n,g]),A.useEffect(()=>{c&&(C.setIcon(c.current,AD[p||"list"]),Qe.setMemoListView(p),C.requireApiVersion("1.4.4")&&C.setTooltip(c.current,N("Switch view")))},[p]);const D=async S=>{var F;const T=!C.Platform.isDesktop&&await((F=window.Capacitor)==null?void 0:F.Plugins.Device.getId()),E=C.Platform.isDesktop?await vn():T.identifier||T.uuid;if(!r||(r==null?void 0:r.appId)!==E){qt();return}const O=async B=>{Qe.setMemoListView(B),g&&(g.settings.MemoListView=B,await g.saveSettings()),m(B)},k=[{view:"list",title:N("List")},{view:"chat",title:N("Chat")},{view:"moments",title:N("Moments")}];s||k.push({view:"waterfall",title:N("Waterfall")},{view:"calendar",title:N("Calendar")},{view:"table",title:N("Table")});const j=new C.Menu;k.forEach(({view:B,title:R})=>{j.addItem(z=>{z.setChecked(p===B).setIcon(AD[B]).setTitle(R).onClick(()=>{p!==B&&O(B)})})}),j.showAtMouseEvent(S.nativeEvent)};return w.jsx("div",{className:`memos-view-switcher-wrapper ${e.className?e.className:""} pro`,ref:c,onClick:D})},D8=()=>{const e=A.useRef(null);return A.useEffect(()=>{e&&(C.setIcon(e.current,"calendar-check"),C.setTooltip&&C.setTooltip(e.current,N("Daily Memos")))},[e]),w.jsx("div",{className:"memos-review-entry-wrapper",ref:e,onClick:()=>{He.setPathname("/daily")}})},O0=()=>({type:"initialText",value:"",timestamp:Date.now(),selectionStart:0,selectionEnd:0}),FD={initialValue:"",interval:300};class S8{constructor(t,n=FD){this.listeners=[],this.runUndo=()=>{const r=this.actions[this.currentIndex].selectionStart;this.currentIndex>0&&this.currentIndex--,this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.runRedo=()=>{this.currentIndex<this.actions.length-1&&this.currentIndex++;const r=this.actions[this.currentIndex].selectionEnd;this.element.value=this.actions[this.currentIndex].value,this.element.setSelectionRange(r,r),this.dispatchChange()},this.getActions=()=>this.actions,this.setState=(r,a)=>{this.actions=[...r],this.currentIndex=a<this.actions.length?a:this.actions.length-1,this.dispatchChange()},this.resetState=()=>{this.actions=[O0()],this.currentIndex=0,this.dispatchChange()},this.destroy=()=>{this.rmEventListeners()},this.subscribe=r=>{this.listeners.push(r)},this.handleElementKeydown=r=>{const a=r;a.key==="z"&&!a.shiftKey&&(a.metaKey||a.ctrlKey)?(r.preventDefault(),this.runUndo()):(a.key==="z"&&a.shiftKey&&(a.metaKey||a.ctrlKey)||a.key==="y"&&(a.metaKey||a.ctrlKey))&&(r.preventDefault(),this.runRedo())},this.handleElementInput=r=>{const a=r,o=this.actions[this.currentIndex];this.pushNewAction({type:a.inputType,value:this.element.value,timestamp:Date.now(),selectionStart:this.element.selectionEnd-(this.element.value.length-o.value.length),selectionEnd:this.element.selectionEnd})},this.addEventListeners=()=>{this.element.addEventListener("keydown",this.handleElementKeydown),this.element.addEventListener("input",this.handleElementInput)},this.rmEventListeners=()=>{this.element.removeEventListener("keydown",this.handleElementKeydown),this.element.removeEventListener("input",this.handleElementInput)},this.pushNewAction=r=>{const a=this.actions[this.currentIndex];a&&a.type===r.type&&r.timestamp-a.timestamp<this.config.interval?this.actions[this.currentIndex]=Object.assign(Object.assign({},a),{value:r.value,selectionEnd:r.selectionEnd,timestamp:r.timestamp}):(this.config.maxSize&&this.currentIndex>=this.config.maxSize?(this.actions.shift(),this.actions[0]=O0()):this.currentIndex++,this.actions[this.currentIndex]=r,this.actions=this.actions.slice(0,this.currentIndex+1)),this.dispatchChange()},this.dispatchChange=()=>{for(const r of this.listeners)r([...this.actions],this.currentIndex)},this.element=t,this.config=Object.assign(Object.assign({},FD),n),this.config.initialActions&&this.config.initialActions.length>0?(this.actions=this.config.initialActions,this.config.initialIndex!==void 0&&this.config.initialIndex<this.actions.length?this.currentIndex=this.config.initialIndex:this.currentIndex=this.actions.length-1):(this.actions=[O0()],this.currentIndex=0,this.config.initialValue!==""&&(this.actions.push({type:"insertText",value:this.config.initialValue,timestamp:Date.now(),selectionStart:0,selectionEnd:this.config.initialValue.length}),this.currentIndex++)),this.element.value=this.actions[this.currentIndex].value,this.addEventListeners()}}function I8(){const[,e]=A.useState(!1);return A.useCallback(()=>{e(n=>!n)},[])}var VT={exports:{}};(function(e){(function(){var t=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n=typeof window<"u",r=n&&window.mozInnerScreenX!=null;function a(o,s,c){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var d=c&&c.debug||!1;if(d){var p=document.querySelector("#input-textarea-caret-position-mirror-div");p&&p.parentNode.removeChild(p)}var m=document.createElement("div");m.id="input-textarea-caret-position-mirror-div",document.body.appendChild(m);var g=m.style,v=window.getComputedStyle?getComputedStyle(o):o.currentStyle;g.whiteSpace="pre-wrap",o.nodeName!=="INPUT"&&(g.wordWrap="break-word"),g.position="absolute",d||(g.visibility="hidden"),t.forEach(function(T){g[T]=v[T]}),r?o.scrollHeight>parseInt(v.height)&&(g.overflowY="scroll"):g.overflow="hidden",m.textContent=o.value.substring(0,s),o.nodeName==="INPUT"&&(m.textContent=m.textContent.replace(/\s/g," "));var D=document.createElement("span");D.textContent=o.value.substring(s)||".",m.appendChild(D);var S={top:D.offsetTop+parseInt(v.borderTopWidth),left:D.offsetLeft+parseInt(v.borderLeftWidth)};return d?D.style.backgroundColor="#aaa":document.body.removeChild(m),S}e.exports=a})()})(VT);var T8=VT.exports;const E8=er(T8);var ZT=Jn.CustomEvent;function C8(){try{var e=new ZT("cat",{detail:{foo:"bar"}});return e.type==="cat"&&e.detail.foo==="bar"}catch{}return!1}var x8=C8()?ZT:typeof document<"u"&&typeof document.createEvent=="function"?function(t,n){var r=document.createEvent("CustomEvent");return n?r.initCustomEvent(t,n.bubbles,n.cancelable,n.detail):r.initCustomEvent(t,!1,!1,void 0),r}:function(t,n){var r=document.createEventObject();return r.type=t,n?(r.bubbles=!!n.bubbles,r.cancelable=!!n.cancelable,r.detail=n.detail):(r.bubbles=!1,r.cancelable=!1,r.detail=void 0),r};const M8=er(x8);function N8(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function k8(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{},r=Object.keys(n);typeof Object.getOwnPropertySymbols=="function"&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),r.forEach(function(a){N8(e,a,n[a])})}return e}function Op(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function OD(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function _y(e,t,n){return t&&OD(e.prototype,t),n&&OD(e,n),e}function Cd(e){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cd=function(n){return typeof n}:Cd=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Cd(e)}function Jg(e){return typeof Symbol=="function"&&Cd(Symbol.iterator)==="symbol"?Jg=function(n){return Cd(n)}:Jg=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":Cd(n)},Jg(e)}function A8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Hy(e,t){return t&&(Jg(t)==="object"||typeof t=="function")?t:A8(e)}function Nd(e){return Nd=Object.setPrototypeOf?Object.getPrototypeOf:function(n){return n.__proto__||Object.getPrototypeOf(n)},Nd(e)}function Nw(e,t){return Nw=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r},Nw(e,t)}function Yy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&Nw(e,t)}function F8(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}function O8(e){if(Symbol.iterator in Object(e)||Object.prototype.toString.call(e)==="[object Arguments]")return Array.from(e)}function P8(){throw new TypeError("Invalid attempt to spread non-iterable instance")}function j8(e){return F8(e)||O8(e)||P8()}var Ha={ESC:27,UP:38,DOWN:40,LEFT:37,RIGHT:39,ENTER:13,TAB:9},L8=function e(){var t=this;Op(this,e),this.startListen=function(n){n&&n.addEventListener("keydown",t.f)},this.stopListen=function(n){n&&n.removeEventListener("keydown",t.f)},this.add=function(n,r){var a=n;return typeof a!="object"&&(a=[a]),t.listeners[t.index]={keyCode:a,fn:r},t.index++},this.remove=function(n){delete t.listeners[n]},this.removeAll=function(){t.listeners={},t.index=1},this.index=1,this.listeners={},this.f=function(n){if(n){var r=n.keyCode||n.which;Object.values(t.listeners).forEach(function(a){var o=a.keyCode,s=a.fn;o.includes(r)&&(n.stopPropagation(),n.preventDefault(),s(n))})}}},Eu=new L8,R8=function(e){Yy(t,e);function t(){var n,r;Op(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return r=Hy(this,(n=Nd(t)).call.apply(n,[this].concat(o))),r.selectItem=function(){var c=r.props,d=c.item,p=c.onSelectHandler;p(d)},r}return _y(t,[{key:"shouldComponentUpdate",value:function(r){return this.props.item!==r.item||this.props.selected!==r.selected||this.props.style!==r.style||this.props.className!==r.className}},{key:"render",value:function(){var r=this,a=this.props,o=a.component,s=a.style,c=a.onClickHandler,d=a.item,p=a.selected,m=a.className,g=a.innerRef;return $.createElement("li",{className:"rta__item ".concat(p===!0?"rta__item--selected":""," ").concat(m||""),style:s},$.createElement("div",{className:"rta__entity ".concat(p===!0?"rta__entity--selected":""),role:"button",tabIndex:0,onClick:c,onFocus:this.selectItem,onMouseEnter:this.selectItem,onTouchStart:function(){r.clicked=!0,r.selectItem()},onTouchEnd:function(D){D.preventDefault(),r.clicked&&c(D)},onTouchMove:function(){r.clicked=!1},onTouchCancel:function(){r.clicked=!1},ref:g},$.createElement(o,{selected:p,entity:d})))}}]),t}($.Component),B8=function(e){Yy(t,e);function t(){var n,r;Op(this,t);for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];return r=Hy(this,(n=Nd(t)).call.apply(n,[this].concat(o))),r.state={selectedItem:null},r.cachedIdOfItems=new Map,r.onPressEnter=function(c){typeof c<"u"&&c.preventDefault();var d=r.props.values;r.modifyText(d[r.getPositionInList()])},r.getPositionInList=function(){var c=r.props.values,d=r.state.selectedItem;return d?c.findIndex(function(p){return r.getId(p)===r.getId(d)}):0},r.getId=function(c){if(r.cachedIdOfItems.has(c))return r.cachedIdOfItems.get(c);var d=r.props.getTextToReplace(c),p=function(){if(d){if(d.key)return d.key;if(typeof c=="string"||!c.key)return d.text}if(!c.key)throw new Error("Item ".concat(JSON.stringify(c),' has to have defined "key" property'));return c.key},m=p();return r.cachedIdOfItems.set(c,m),m},r.listeners=[],r.itemsRef={},r.modifyText=function(c){if(c){var d=r.props.onSelect;d(c)}},r.selectItem=function(c){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,p=r.props.onItemHighlighted;r.state.selectedItem!==c&&r.setState({selectedItem:c},function(){p(c),d&&r.props.dropdownScroll(r.itemsRef[r.getId(c)])})},r.scroll=function(c){c.preventDefault();var d=r.props.values,p=c.keyCode||c.which,m=r.getPositionInList(),g;switch(p){case Ha.DOWN:g=m+1;break;case Ha.UP:g=m-1;break;default:g=m;break}g=(g%d.length+d.length)%d.length,r.selectItem(d[g],[Ha.DOWN,Ha.UP].includes(p))},r.isSelected=function(c){var d=r.state.selectedItem;return d?r.getId(d)===r.getId(c):!1},r}return _y(t,[{key:"componentDidMount",value:function(){this.listeners.push(Eu.add([Ha.DOWN,Ha.UP],this.scroll),Eu.add([Ha.ENTER,Ha.TAB],this.onPressEnter));var r=this.props.values;r&&r[0]&&this.selectItem(r[0])}},{key:"componentDidUpdate",value:function(r){var a=this,o=r.values,s=this.props.values,c=o.map(function(p){return a.getId(p)}).join(""),d=s.map(function(p){return a.getId(p)}).join("");c!==d&&s&&s[0]&&this.selectItem(s[0])}},{key:"componentWillUnmount",value:function(){for(var r;this.listeners.length;)r=this.listeners.pop(),Eu.remove(r)}},{key:"render",value:function(){var r=this,a=this.props,o=a.values,s=a.component,c=a.style,d=a.itemClassName,p=a.className,m=a.itemStyle;return $.createElement("ul",{className:"rta__list ".concat(p||""),style:c},o.map(function(g){return $.createElement(R8,{key:r.getId(g),innerRef:function(D){r.itemsRef[r.getId(g)]=D},selected:r.isSelected(g),item:g,className:d,style:m,onClickHandler:r.onPressEnter,onSelectHandler:r.selectItem,component:s})}))}}]),t}($.Component);function _8(e,t){var n=parseInt(getComputedStyle(t).getPropertyValue("height"),10),r=parseInt(getComputedStyle(e).getPropertyValue("height"),10)-n,a=t.offsetTop,o=e.scrollTop;a<o+r&&o<a||(e.scrollTop=a)}var PD="next",dl={X:{LEFT:"rta__autocomplete--left",RIGHT:"rta__autocomplete--right"},Y:{TOP:"rta__autocomplete--top",BOTTOM:"rta__autocomplete--bottom"}},jD=function(t){return console.error("RTA: dataProvider fails: ".concat(t,`
Check the documentation or create issue if you think it's bug. https://github.com/webscopeio/react-textarea-autocomplete/issues`))},H8=[".","^","$","*","+","-","?","(",")","[","]","{","}","\\","|"],Ag=function(t){return j8(t).map(function(n){return H8.includes(n)?"\\".concat(n):n}).join("")},Y8=function(e){Yy(t,e);function t(){return Op(this,t),Hy(this,Nd(t).apply(this,arguments))}return _y(t,[{key:"componentDidMount",value:function(){var r=this.props.boundariesElement;if(typeof r=="string"){var a=document.querySelector(r);if(!a)throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");this.containerElem=a}else if(r instanceof HTMLElement)this.containerElem=r;else throw new Error("RTA: Invalid prop boundariesElement: it has to be string or HTMLElement.");if(!this.containerElem||!this.containerElem.contains(this.ref))throw new Error("RTA: Invalid prop boundariesElement: it has to be one of the parents of the RTA.")}},{key:"componentDidUpdate",value:function(){var r,a,o=this.props.top||0,s=this.props.left||0,c=[],d=[],p=0,m=0,g=this.containerElem.getBoundingClientRect(),v=this.ref.getBoundingClientRect(),D=this.props.textareaRef.getBoundingClientRect(),S=window.getComputedStyle(this.ref),T=parseInt(S.getPropertyValue("margin-top"),10),E=parseInt(S.getPropertyValue("margin-bottom"),10),O=parseInt(S.getPropertyValue("margin-left"),10),k=parseInt(S.getPropertyValue("margin-right"),10),j=T+E+D.top+o+v.height,F=O+k+D.left+s+v.width;F>g.right&&D.left+s>v.width?(m=s-v.width,c.push(dl.X.LEFT),d.push(dl.X.RIGHT)):(m=s,c.push(dl.X.RIGHT),d.push(dl.X.LEFT)),j>g.bottom&&D.top+o>v.height?(p=o-v.height,c.push(dl.Y.TOP),d.push(dl.Y.BOTTOM)):(p=o,c.push(dl.Y.BOTTOM),d.push(dl.Y.TOP)),this.props.renderToBody&&(p+=D.top,m+=D.left),this.ref.style.top="".concat(p,"px"),this.ref.style.left="".concat(m,"px"),(r=this.ref.classList).remove.apply(r,d),(a=this.ref.classList).add.apply(a,c)}},{key:"render",value:function(){var r=this,a=this.props,o=a.style,s=a.className,c=a.innerRef,d=a.children,p=a.renderToBody,m=document.body,g=$.createElement("div",{ref:function(D){r.ref=D,c(D)},className:"rta__autocomplete ".concat(s||""),style:o},d);return p&&m!==null?T1.createPortal(g,m):g}}]),t}($.Component),WT=function(e){Yy(t,e);function t(n){var r;Op(this,t),r=Hy(this,Nd(t).call(this,n)),r.state={top:null,left:null,currentTrigger:null,actualToken:"",data:null,value:"",dataLoading:!1,selectionEnd:0,component:null,textToReplace:null},r.escListenerInit=function(){r.escListener||(r.escListener=Eu.add(Ha.ESC,r._closeAutocomplete))},r.escListenerDestroy=function(){r.escListener&&(Eu.remove(r.escListener),r.escListener=null)},r.getSelectionPosition=function(){return r.textareaRef?{selectionStart:r.textareaRef.selectionStart,selectionEnd:r.textareaRef.selectionEnd}:null},r.getSelectedText=function(){if(!r.textareaRef)return null;var d=r.textareaRef,p=d.selectionStart,m=d.selectionEnd;return p===m?null:r.state.value.substr(p,m-p)},r.setCaretPosition=function(){var d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;r.textareaRef&&(r.textareaRef.focus(),r.textareaRef.setSelectionRange(d,d))},r.getCaretPosition=function(){if(!r.textareaRef)return 0;var d=r.textareaRef.selectionEnd;return d},r._handleCaretChange=function(d){var p=function(){var v=r.getCaretPosition()-1;r.lastTrigger=r.lastTrigger?v:0};if(d.type==="keydown"){var m=d.keyCode||d.which;switch(m){case Ha.UP:case Ha.DOWN:r._isAutocompleteOpen()||p();break;case Ha.LEFT:case Ha.RIGHT:p();break}return}p()},r._onSelect=function(d){var p=r.state,m=p.selectionEnd,g=p.currentTrigger,v=p.value,D=r.props.onItemSelected;if(g){var S=r._getTextToReplace(g);if(!S){r._closeAutocomplete();return}var T=S(d);if(!T){r._closeAutocomplete();return}D&&D({currentTrigger:g,item:d});var E=function(U,J,Q){switch(U){case"start":return Q;case"next":case"end":return Q+J.length;default:if(!Number.isInteger(U))throw new Error('RTA: caretPosition should be "start", "next", "end" or number.');return U}},O=v.slice(0,m),k=Ag(g),j=O.length-O.lastIndexOf(g),F=O.search(new RegExp("(?!".concat(k,")$")))-j,B=T.caretPosition==="next"?"".concat(T.text," "):T.text,R=E(T.caretPosition,B,F),z=O.substring(0,F)+B,H=v.replace(O,z);r.setState({value:H,dataLoading:!1},function(){var Y=r.tokenRegExpEnding.exec(B),U=Y?Y[0].length:1;r.lastTrigger=R&&R-U,r.textareaRef.value=H,r.textareaRef.selectionEnd=R,r._changeHandler();var J=r.textareaRef.scrollTop;r.setCaretPosition(R),window.chrome&&(r.textareaRef.scrollTop=J)})}},r._getTextToReplace=function(d){var p=r.props.trigger[d];if(!d||!p)return null;var m=p.output;return function(g){if(typeof g=="object"&&(!m||typeof m!="function"))throw new Error('Output functor is not defined! If you are using items as object you have to define "output" function. https://github.com/webscopeio/react-textarea-autocomplete#trigger-type');if(m){var v=m(g,d);if(v===void 0||typeof v=="number")throw new Error(`Output functor should return string or object in shape {text: string, caretPosition: string | number}.
Got "`.concat(String(v),'". Check the implementation for trigger "').concat(d,`"
See https://github.com/webscopeio/react-textarea-autocomplete#trigger-type for more information.
`));if(v===null)return null;if(typeof v=="string")return{text:v,caretPosition:PD};if(!v.text&&typeof v.text!="string")throw new Error('Output "text" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`"
`));if(!v.caretPosition)throw new Error('Output "caretPosition" is not defined! Object should has shape {text: string, caretPosition: string | number}. Check the implementation for trigger "'.concat(d,`"
`));return v}if(typeof g!="string")throw new Error(`Output item should be string
`);return{text:"".concat(d).concat(g).concat(d),caretPosition:PD}}},r._getCurrentTriggerSettings=function(){var d=r.state.currentTrigger;return d?r.props.trigger[d]:null},r._getValuesFromProvider=function(){var d=r.state,p=d.currentTrigger,m=d.actualToken,g=r._getCurrentTriggerSettings();if(!(!p||!g)){var v=g.dataProvider,D=g.component;if(typeof v!="function")throw new Error("Trigger provider has to be a function!");r.setState({dataLoading:!0});var S=v(m);S instanceof Promise||(S=Promise.resolve(S)),S.then(function(T){if(!Array.isArray(T))throw new Error("Trigger provider has to provide an array!");if(typeof D!="function")throw new Error("Component should be defined!");if(p===r.state.currentTrigger){if(!T.length){r._closeAutocomplete();return}r.setState({dataLoading:!1,data:T,component:D})}}).catch(function(T){return jD(T.message)})}},r._getSuggestions=function(){var d=r.state,p=d.currentTrigger,m=d.data;return!p||!m||m&&!m.length?null:m},r._createRegExp=function(){var d=r.props.trigger;r.tokenRegExp=new RegExp("(".concat(Object.keys(d).sort(function(p,m){return p<m?1:p>m?-1:0}).map(function(p){return Ag(p)}).join("|"),")((?:(?!\\1)[^\\s])*$)")),r.tokenRegExpEnding=new RegExp("(".concat(Object.keys(d).sort(function(p,m){return p<m?1:p>m?-1:0}).map(function(p){return Ag(p)}).join("|"),")$"))},r._closeAutocomplete=function(){var d=r.state.currentTrigger;r.escListenerDestroy(),r.setState({data:null,dataLoading:!1,currentTrigger:null},function(){d&&r._onItemHighlightedHandler(null)})},r._cleanUpProps=function(){var d=k8({},r.props),p=["loadingComponent","boundariesElement","containerStyle","minChar","scrollToItem","ref","innerRef","onChange","onCaretPositionChange","className","value","trigger","listStyle","itemStyle","containerStyle","loaderStyle","className","containerClassName","listClassName","itemClassName","loaderClassName","dropdownStyle","dropdownClassName","movePopupAsYouType","textAreaComponent","renderToBody","onItemSelected","onItemHighlighted"];for(var m in d)p.includes(m)&&delete d[m];return d},r._changeHandler=function(d){var p=r.props,m=p.trigger,g=p.onChange,v=p.minChar,D=p.onCaretPositionChange,S=p.movePopupAsYouType,T=r.state,E=T.top,O=T.left,k=d;k||(k=new M8("change",{bubbles:!0}),r.textareaRef.dispatchEvent(k));var j=k.target||r.textareaRef,F=j.selectionEnd,B=j.value;if(r.lastValueBubbledEvent=B,g&&k&&(k.persist&&k.persist(),g(new Proxy(k,{get:function(Z,G,te){return G==="target"?j:Reflect.get(Z,G,te)}}))),D){var R=r.getCaretPosition();D(R)}r.setState({value:B});var z=function(){var Z=E8(j,F),G=Z.top,te=Z.left;r.setState({top:G-r.textareaRef.scrollTop||0,left:te})},H=function(Z){r.lastTrigger=F-Z,r._closeAutocomplete(),z()};if(F<=r.lastTrigger){var Y=B.slice(0,F),U=r.tokenRegExp.exec(Y);H(U?U[0].length:0)}var J=B.slice(r.lastTrigger,F),Q=r.tokenRegExp.exec(J),le=Q&&Q[0],pe=Q&&Q[1]||null,ie=pe?pe.length-1:0,se=r.tokenRegExpEnding.exec(J);if(se?H(se[0].length):r._isAutocompleteOpen()||r._closeAutocomplete(),(!le||le.length<=v+ie)&&(r.state.currentTrigger&&!m[r.state.currentTrigger].allowWhitespace||!r.state.currentTrigger)){r._closeAutocomplete();return}if(pe&&m[pe].afterWhitespace&&!/\s/.test(B[F-le.length-1])&&B[F-le.length-1]!==void 0){r._closeAutocomplete();return}if(r.state.currentTrigger&&m[r.state.currentTrigger].allowWhitespace){if(Q=new RegExp("".concat(Ag(r.state.currentTrigger),".*$")).exec(B.slice(0,F)),le=Q&&Q[0],!le){r._closeAutocomplete();return}pe=Object.keys(m).find(function(we){return we.slice(0,ie+1)===le.slice(0,ie+1)})||null}var fe=le.slice(1);if(pe){(S||E===null&&O===null||r.state.currentTrigger!==pe)&&z(),r.escListenerInit();var oe=r._getTextToReplace(pe);r.setState({selectionEnd:F,currentTrigger:pe,textToReplace:oe,actualToken:fe},function(){try{r._getValuesFromProvider()}catch(we){jD(we.message)}})}},r._selectHandler=function(d){var p=r.props,m=p.onCaretPositionChange,g=p.onSelect;if(m){var v=r.getCaretPosition();m(v)}g&&(d.persist(),g(d))},r._shouldStayOpen=function(d){var p=d.relatedTarget;return p===null&&(p=document.activeElement),!!(r.dropdownRef&&p instanceof Node&&r.dropdownRef.contains(p))},r._onClick=function(d){var p=r.props.onClick;p&&(d.persist(),p(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onBlur=function(d){var p=r.props.onBlur;p&&(d.persist(),p(d)),!r._shouldStayOpen(d)&&r._closeAutocomplete()},r._onScrollHandler=function(){r._closeAutocomplete()},r._onItemHighlightedHandler=function(d){var p=r.props.onItemHighlighted,m=r.state.currentTrigger;if(p)if(typeof p=="function")p({currentTrigger:m,item:d});else throw new Error("`onItemHighlighted` has to be a function")},r._dropdownScroll=function(d){var p=r.props.scrollToItem;if(p){if(p===!0){_8(r.dropdownRef,d);return}if(typeof p!="function"||p.length!==2)throw new Error("`scrollToItem` has to be boolean (true for default implementation) or function with two parameters: container, item.");p(r.dropdownRef,d)}},r._isAutocompleteOpen=function(){var d=r.state,p=d.dataLoading,m=d.currentTrigger,g=r._getSuggestions();return!!((p||g)&&m)},r._textareaRef=function(d){r.props.innerRef&&r.props.innerRef(d),r.textareaRef=d},r.lastTrigger=0,r.escListener=null;var a=r.props,o=a.loadingComponent,s=a.trigger,c=a.value;if(c&&(r.state.value=c),r._createRegExp(),!o)throw new Error("RTA: loadingComponent is not defined");if(!s)throw new Error("RTA: trigger is not defined");return r}return _y(t,[{key:"componentDidMount",value:function(){Eu.startListen(this.textareaRef),this.textareaRef&&this.textareaRef.addEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.addEventListener("keydown",this._handleCaretChange)}},{key:"componentDidUpdate",value:function(r){var a=r.trigger,o=r.value,s=this.props,c=s.trigger,d=s.value;Object.keys(c).join("")!==Object.keys(a).join("")&&this._createRegExp(),o!==d&&this.lastValueBubbledEvent!==d&&(this.lastTrigger=0,this._changeHandler())}},{key:"componentWillUnmount",value:function(){this.escListenerDestroy(),Eu.stopListen(this.textareaRef),this.textareaRef&&this.textareaRef.removeEventListener("focus",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("click",this._handleCaretChange),this.textareaRef&&this.textareaRef.removeEventListener("keydown",this._handleCaretChange)}},{key:"render",value:function(){var r=this,a=this.props,o=a.loadingComponent,s=a.style,c=a.className,d=a.listStyle,p=a.itemStyle,m=a.boundariesElement,g=a.movePopupAsYouType,v=a.listClassName,D=a.itemClassName,S=a.dropdownClassName,T=a.dropdownStyle,E=a.containerStyle,O=a.containerClassName,k=a.loaderStyle,j=a.loaderClassName,F=a.textAreaComponent,B=a.renderToBody,R=this.state,z=R.left,H=R.top,Y=R.dataLoading,U=R.component,J=R.value,Q=R.textToReplace,le=this._isAutocompleteOpen(),pe=this._getSuggestions(),ie={},se;return F.component?(se=F.component,ie[F.ref]=this._textareaRef):(se=F,ie.ref=this._textareaRef),$.createElement("div",{className:"rta ".concat(Y===!0?"rta--loading":""," ").concat(O||""),style:E},$.createElement(se,Object.assign({},this._cleanUpProps(),{className:"rta__textarea ".concat(c||""),onChange:this._changeHandler,onSelect:this._selectHandler,onScroll:this._onScrollHandler,onClick:this._onClick,onBlur:this._onBlur,value:J,style:s},ie)),le&&$.createElement(Y8,{innerRef:function(oe){r.dropdownRef=oe},top:H,left:z,style:T,className:S,movePopupAsYouType:g,boundariesElement:m,textareaRef:this.textareaRef,renderToBody:B},pe&&U&&Q&&$.createElement(B8,{values:pe,component:U,style:d,className:v,itemClassName:D,itemStyle:p,getTextToReplace:Q,onItemHighlighted:this._onItemHighlightedHandler,onSelect:this._onSelect,dropdownScroll:this._dropdownScroll}),Y&&$.createElement("div",{className:"rta__loader ".concat(pe!==null?"rta__loader--suggestion-data":"rta__loader--empty-suggestion-data"," ").concat(j||""),style:k},$.createElement(o,{data:pe}))))}}],[{key:"getDerivedStateFromProps",value:function(r){var a=r.value;return a==null?null:{value:a}}}]),t}($.Component);WT.defaultProps={movePopupAsYouType:!1,value:null,minChar:1,boundariesElement:"body",scrollToItem:!0,textAreaComponent:"textarea",renderToBody:!1};const z8=()=>{const{app:e}=Xe.getState(),t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())},U8=e=>{let t=[];const n=Xe.getState().settings;if(n&&(n!=null&&n.UseVaultTags))t=z8();else{const{tags:o}=Te.getState();t=o}const r=e.toLowerCase(),a=[];return t.forEach(o=>{o&&o.toLowerCase().contains(r)&&a.push({name:o,char:o})}),a},V8=e=>{const{app:t}=Xe.getState(),n=t.vault.getAllLoadedFiles(),r=[];let a;return n.forEach(o=>{e==="["?a="":e.contains("[")&&(a=e.slice(1));const s=a.toLowerCase();o instanceof C.TFile&&["md","png","jpg","canvas","jpeg","gif"].contains(o.extension)&&o.path.toLowerCase().contains(s)&&r.push({name:o.basename,char:o.name,file:o})}),r};var P0=A,Z8=function(e){return typeof e=="function"},W8=function(e){var t=P0.useState(e),n=t[0],r=t[1],a=P0.useRef(n),o=P0.useCallback(function(s){a.current=Z8(s)?s(a.current):s,r(a.current)},[]);return[n,o,a]},$8=W8;const Kr=er($8);function qh(e,t){const n=Object.keys(t).map(r=>G8(e,r,t[r]));return n.length===1?n[0]:function(){n.forEach(r=>r())}}function G8(e,t,n){const r=e[t],a=e.hasOwnProperty(t);let o=n(r);return r&&Object.setPrototypeOf(o,r),Object.setPrototypeOf(s,o),e[t]=s,c;function s(...d){return o===r&&e[t]===s&&c(),o.apply(this,d)}function c(){e[t]===s&&(a?e[t]=r:delete e[t]),o!==r&&(o=r,Object.setPrototypeOf(s,r||Function))}}function q8(e){return e.containerEl.matches(".memos-list-view")}const J8=e=>{const{dailyNotesState:{app:t,plugin:n,editor:r,view:a,dailyNotes:o}}=A.useContext(mt),[s,c]=A.useState(null),[d,p]=A.useState(!1),[m,g]=A.useState(""),[v,D]=A.useState(null),S=A.useRef(C.debounce((z,H)=>{Q8(z,H)},100));A.useEffect(()=>{var z;if(!v){if(!o){const H=(z=t||window.app)==null?void 0:z.vault.getMarkdownFiles();D(H[0]);return}for(const H in o)if(o[H]instanceof C.TFile){D(o[H]);break}}},[o]),A.useEffect(()=>{if(!(!e||!r)&&!d)return k(e),()=>{p(!1),s==null||s.destroy()}},[r,e]),A.useEffect(()=>{if(!s||!t)return;const z=K8(t);g(z),(s==null?void 0:s.editor).replaceSelection(z)},[s,t]),A.useEffect(()=>{!s||!t||S.current(m,t)},[m,t]);const T=()=>{s&&s.toggleSource()},E=C.debounce((z,H)=>O(z,H),500,!0),O=(z,H)=>{z&&g(H)},k=z=>{if(!a){new C.Notice(N("Please open thino first"));return}if(r&&a){a.register(qh(r.constructor.prototype,{onUpdate:Y=>function(...U){if(Y.call(this,U),this.owner.getViewType()==="thino_view"||this.owner instanceof wl){const J=this.get();E(this.owner,J)}},getMode:()=>function(){return"source"}})),a.register(qh(C.Workspace.prototype,{getActiveViewOfType:Y=>function(U){const J=Y.call(this,U);if(!J&&(U==null?void 0:U.VIEW_TYPE)==="markdown"){const Q=this.activeLeaf;if(Q.view instanceof wl)return Q.view}return J},setActiveLeaf:Y=>function(U,J){if(q8(U)&&(Y.call(this,U,J),U.activeTime=17e11),Y.call(this,U,J),U.view instanceof wl){const Q=Qe.getState().instanceList.get(U.id);if(!Q)return;self.app.workspace.activeEditor=Q.owner,U.view.editor=Q.editor}},getActiveFile:Y=>function(){var J;const U=Y.call(this);return((J=this.activeLeaf)==null?void 0:J.view)instanceof wl&&v||U}}));const H=new r.constructor(a.app,z,a);H.owner.editor=H.editor,H.set&&H.set("",!0),H.owner.onMarkdownScroll=()=>{},t.workspace.trigger("thino-editor-created",z,H.editor),p(!0),c(H),Qe.setInstance(`${a.leaf.id}`,H)}};return{instance:s,value:m,set:z=>{try{s&&((s==null?void 0:s.editor).replaceSelection(z),g(z))}catch(H){console.error(H)}},get:()=>s?s.get():"",append:(z,H)=>{if(!s||H&&H!==s.owner.leaf.id)return;const U=(s.get()||"")+z;(s==null?void 0:s.editor).replaceSelection(z),g(U)},clear:()=>{s&&(s.clear(),g(""))},toggleSource:T}};function $T(e){return`thinoEditorContentCache:${e}`}function K8(e){try{const t=$T(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function Q8(e,t){try{const n=$T(t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}function X8(e,t){return{line:e.line,ch:e.ch+t}}const LD=({entity:{name:e,char:t,file:n}})=>w.jsx("div",{children:`${t}`}),e9=({data:e})=>w.jsx("div",{children:"Loading"});let wi;const t9=A.forwardRef((e,t)=>{var Ie;const{globalState:{useTinyUndoHistoryCache:n,globalEditorShown:r,memoListView:a},dailyNotesState:{settings:o,app:s}}=A.useContext(mt),{SaveMemoButtonLabel:c,SaveMemoButtonIcon:d}=o,{className:p,inputerType:m,initialContent:g,placeholder:v,showConfirmBtn:D,showCancelBtn:S,onConfirmBtnClick:T,onCancelBtnClick:E,onContentChange:O}=e,k=A.useRef(null),j=A.useRef(null),F=A.useRef(null),B=I8(),{instance:R,value:z,set:H,get:Y,append:U,clear:J,toggleSource:Q}=J8(j.current),[,le,pe]=Kr(0),[ie,se]=Kr(!1);A.useEffect(()=>{var De,ke;if(o&&o.FocusOnEditor)switch(m){case"minimal":case"memos":(De=k.current)==null||De.focus();break;case"obsidian":R&&((ke=R.editor)==null||ke.focus())}},[o,R]),A.useEffect(()=>{if(!s)return;const De=s.workspace.getLeavesOfType(_r);let ke,Ye;De.length>0?(Ye=De[0].view.containerEl,ke=Ye.offsetHeight):(Ye=document,ke=window.outerHeight),le(ke)},[s]),A.useEffect(()=>{!k.current||m==="obsidian"||g&&(k.current.value=g,B())},[]),A.useEffect(()=>{var De;if(m!=="obsidian")if(n){if(!k.current)return;const{tinyUndoActionsCache:ke,tinyUndoIndexCache:Ye}=Kn.get(["tinyUndoActionsCache","tinyUndoIndexCache"]);return F.current=new S8(k.current,{interval:5e3,initialActions:ke,initialIndex:Ye}),F.current.subscribe((Re,rt)=>{Kn.set({tinyUndoActionsCache:Re,tinyUndoIndexCache:rt})}),()=>{var Re;(Re=F.current)==null||Re.destroy()}}else(De=F.current)==null||De.destroy(),F.current=null,Kn.remove(["tinyUndoActionsCache","tinyUndoIndexCache"])},[n]),A.useEffect(()=>{k.current&&(k.current.style.height="auto",k.current.style.height=(k.current.scrollHeight??0)+"px")},[(Ie=k.current)==null?void 0:Ie.value]),A.useImperativeHandle(t,()=>({element:k.current,blur:()=>{var De,ke;switch(m){case"minimal":case"memos":(De=k.current)==null||De.blur();break;case"obsidian":R&&((ke=R.editor)==null||ke.blur())}},focus:De=>{var ke,Ye,Re,rt,Ht;switch(m){case"minimal":case"memos":(ke=k.current)==null||ke.focus();break;case"obsidian":if(R){if(De&&De!==((rt=(Re=(Ye=R==null?void 0:R.owner)==null?void 0:Ye.view)==null?void 0:Re.leaf)==null?void 0:rt.id))return;(Ht=R.editor)==null||Ht.focus()}}},insertTag:De=>{var ke,Ye,Re;switch(m){case"minimal":case"memos":{if(!k.current)return;const rt=k.current.value;k.current.value=rt.slice(0,k.current.selectionStart)+"# "+rt.slice(k.current.selectionStart),O(k.current.value),B();break}case"obsidian":if(De&&De!==((Re=(Ye=(ke=R==null?void 0:R.owner)==null?void 0:ke.view)==null?void 0:Ye.leaf)==null?void 0:Re.id))return;if(R){const rt=R.editor,Ht=rt.getCursor("from");rt.replaceRange("#",Ht),rt.setSelection(X8(Ht,1))}break}},insertText:(De,ke)=>{switch(m){case"minimal":case"memos":{if(!k.current)return;const Ye=k.current.value;k.current.value=Ye.slice(0,k.current.selectionStart)+De+Ye.slice(k.current.selectionStart),O(k.current.value),B()}break;case"obsidian":R&&U(De,ke);break}},setContent:De=>{switch(m){case"minimal":case"memos":k.current&&(k.current.value=De,O(k.current.value),B());break;case"obsidian":R&&H(De);break}},getContent:()=>{switch(m){case"minimal":case"memos":return k.current?k.current.value:"";case"obsidian":return Y()}},toggleSource:()=>{switch(m){case"minimal":case"memos":break;case"obsidian":Q();break}},clear:()=>{switch(m){case"minimal":case"memos":k.current&&(k.current.value="",O(k.current.value),B());break;case"obsidian":J();break}}}),[R,m]);const fe=De=>{if(!k.current)return;const{fileManager:ke}=Ee.getState().dailyNotesState.app;if(De.currentTrigger==="#"){const Ye=k.current.value;let Re;wi!=null?Re=wi.length:Re=0;let rt=k.current.selectionStart;for(let Ht=0;Ht<Ye.length;Ht++)/\s/g.test(Ye[rt])||rt++;k.current.value=Ye.slice(0,k.current.selectionStart-Re)+De.item.char+Ye.slice(rt),O(k.current.value),B()}else if(De.currentTrigger==="[["){const Ye=ke.generateMarkdownLink(De.item.file,De.item.file.path,"",""),Re=k.current.value;let rt;wi!=null?Ye.contains("[[")||De.item.file.extension!=="md"?rt=wi.length+1:rt=wi.length+2:rt=2;let Ht=k.current.selectionStart;for(let Se=0;Se<Re.length;Se++)/\s/g.test(Re[Ht])||Ht++;k.current.value=Re.slice(0,k.current.selectionStart-rt)+Ye+Re.slice(Ht),O(k.current.value),B()}},oe=A.useCallback(()=>{var De;O(((De=k.current)==null?void 0:De.value)||""),B()},[]),we=()=>{var De;switch(m){case"minimal":case"memos":if(!k.current)return;k.current.value=G(),T(k.current.value),k.current.value="",B(),(De=F.current)==null||De.resetState();break;case"obsidian":T(Y()),J(),B();break}},Z=A.useCallback(()=>{switch(m){case"minimal":case"memos":k.current&&(k.current.value="",O(k.current.value),B());break;case"obsidian":J();break}E()},[m,R,k]),G=()=>Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache||"",te=()=>{if(k.current)return k.current.value=G(),k.current.value},ge=De=>{switch(De){case"memos":return w.jsx(WT,{className:`common-editor-inputer scroll ${ie?" editing":""}`,loadingComponent:e9,placeholder:v,movePopupAsYouType:!0,value:te(),innerRef:ke=>{k.current=ke},onFocus:()=>{se(!0)},onBlur:()=>{se(!1)},onInput:oe,style:{maxHeight:`${pe.current>400?pe.current-400:100}px`},dropdownStyle:{minWidth:180,maxHeight:250,overflowY:"auto"},minChar:0,onItemSelected:fe,scrollToItem:!0,trigger:{"#":{dataProvider:ke=>(wi=ke,U8(ke).map(({name:Ye,char:Re})=>({name:Ye,char:Re}))),component:LD,afterWhitespace:!0,output:ke=>ke.char},"[[":{dataProvider:ke=>(wi=ke,V8(ke).slice(0,10).map(({name:Ye,char:Re,file:rt})=>({name:Ye,char:Re,file:rt}))),component:LD,afterWhitespace:!0,output:ke=>ke.char}}});case"minimal":return w.jsx("textarea",{style:{minHeight:48},className:"common-editor-inputer scroll",rows:1,placeholder:v,ref:k,onInput:oe});case"obsidian":return w.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:j});default:return w.jsx("div",{className:"common-editor-inputer common-editor-mod-cm6",ref:j})}};return w.jsxs("div",{className:"common-editor-wrapper "+p,children:[ge(m),w.jsxs("div",{className:"common-tools-wrapper",children:[w.jsx("div",{className:"common-tools-container",children:w.jsx(so,{when:e.tools!==void 0,children:e.tools})}),w.jsxs("div",{className:"btns-container",children:[w.jsx(so,{when:S,children:w.jsx("button",{className:"action-btn cancel-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&Z()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&Z()},children:He.getState().pathname==="/"&&a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":N("CANCEL EDIT")})}),w.jsx(so,{when:D,children:w.jsxs("button",{title:"Ctrl/Cmd + Enter to save thino",className:"action-btn confirm-btn",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r&&we()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r)&&we()},children:[a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?"":c,w.jsx("span",{className:"icon-text",children:a==="chat"&&((o==null?void 0:o.chatViewStyle)==="fluent"||(o==null?void 0:o.chatViewStyle)==="inline")?null:d})]})})]})]})]})}),n9=typeof window<"u"?A.useLayoutEffect:A.useEffect;function r9(e,t,n,r){const a=A.useRef(t);n9(()=>{a.current=t},[t]),A.useEffect(()=>{const o=(n==null?void 0:n.current)||window;if(!(o&&o.addEventListener))return;const s=c=>{a.current(c)};return o.addEventListener(e,s,r),()=>{o.removeEventListener(e,s,r)}},[e,n,r])}function Pp(e,t,n="mousedown"){r9(n,r=>{const a=r.target;if(!a||!a.isConnected||a.closest(".suggestion-container")||a.closest(".menu"))return;(Array.isArray(e)?e.every(s=>s.current&&!s.current.contains(a)):e.current&&!e.current.contains(a))&&t(r)})}const GT=e=>{const{year:t,handleYearChange:n}=e,[r,a]=A.useState([]),[o,s]=A.useState(t),c=A.useRef(null),d=A.useRef(null),[p,m]=$.useState(!1),g=$.useRef(null);Pp(g,()=>{m(!1)}),A.useEffect(()=>{c.current&&C.setIcon(c.current,"chevron-left"),d.current&&C.setIcon(d.current,"chevron-right")},[c,d,p]),A.useEffect(()=>{D(o)},[t]);const D=S=>{const T=parseInt(S),E=T-T%10,O=[];for(let k=0;k<10;k++)O.push(`${E+k}`);a(O)};return w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"btn year-btn",onClick:()=>{m(!p)},children:[w.jsx("span",{children:t}),w.jsx("span",{children:N("year")})]}),p&&w.jsxs("div",{ref:g,className:"year-picker-wrapper",children:[w.jsxs("div",{className:"year-picker-header",children:[w.jsxs("div",{className:"year-picker-header-title",children:[o," "+(N("year")||"")]}),w.jsxs("div",{className:"year-picker-header-btns",children:[w.jsx("span",{className:"btn",ref:c,onClick:()=>{const S=parseInt(o)-10;s(S.toString()),D(S.toString())}}),w.jsx("span",{className:"btn",ref:d,onClick:()=>{const S=parseInt(o)+10;s(S.toString()),D(S.toString())}})]})]}),w.jsx("div",{className:"year-picker-body",children:w.jsx("div",{className:"year-picker-body-list",children:r.map(S=>w.jsx("div",{className:`year-picker-body-item ${S===o?"selected":""}`,onClick:()=>{s(S),n(S),m(!1)},children:S},S))})})]})]})},qT=e=>{const{month:t,handleMonthChange:n}=e,[r,a]=A.useState([]),[o,s]=A.useState((parseInt(t)+1).toString()),[c,d]=$.useState(!1),p=$.useRef(null);Pp(p,()=>{d(!1)}),A.useEffect(()=>{g()},[t]);const g=()=>{const v=[];for(let D=1;D<=12;D++)v.push(`${D}`);a(v)};return w.jsxs(w.Fragment,{children:[w.jsxs("span",{className:"btn month-btn",onClick:()=>{d(!c)},children:[w.jsxs("span",{children:[N("monthsShort")[parseInt(t)]||parseInt(t)+1," "]}),w.jsx("span",{children:N("month")||""})]}),c&&w.jsxs("div",{ref:p,className:"month-picker-wrapper",children:[w.jsxs("div",{className:"month-picker-header",children:[w.jsxs("div",{className:"month-picker-header-title",children:[o," "+(N("month")||"")]}),w.jsx("div",{className:"month-picker-header-btns"})]}),w.jsx("div",{className:"month-picker-body",children:w.jsx("div",{className:"month-picker-body-list",children:r.map(v=>w.jsx("div",{className:`month-picker-body-item ${v===o?"selected":""}`,onClick:()=>{s(v),n(v),d(!1)},children:v},v))})})]})]})},zy=e=>{const{className:t,datestamp:n,handleDateStampChange:r}=e,[a,o]=A.useState(Ph(n)),[s,c]=A.useState(n);A.useEffect(()=>{o(Ph(n))},[n]);const d=new Date(a),p=d.getDay(),m=[];for(let S=0;S<p;S++)m.push({date:0,datestamp:d.getTime()-Mi*(7-S)});const g=a9(a);for(let S=1;S<=g;S++)m.push({date:S,datestamp:d.getTime()+Mi*(S-1)});const v=(S,T)=>{r(T,S.nativeEvent),c(T)},D=S=>{const T=d.getFullYear(),E=d.getMonth()+1;let O=0;E===1&&S===-1?O=new Date(`${T-1}/12/1`).getTime():E===12&&S===1?O=new Date(`${T+1}/1/1`).getTime():O=new Date(`${T}/${E+S}/1`).getTime(),o(Ph(O))};return w.jsxs("div",{className:`date-picker-wrapper ${t}`,children:[w.jsxs("div",{className:"date-picker-header",children:[w.jsx("span",{ref:S=>{S&&C.setIcon(S,"chevron-left")},className:"btn btn-text",onClick:()=>D(-1)}),w.jsxs("span",{className:"normal-text",children:[w.jsx(GT,{year:d.getFullYear().toString(),handleYearChange:S=>{o(Ph(new Date(`${S}/${d.getMonth()+1}/1`).getTime()))}}),w.jsx(qT,{month:d.getMonth().toString(),handleMonthChange:S=>{o(Ph(new Date(`${d.getFullYear()}/${parseInt(S)}/1`).getTime()))}})]}),w.jsx("span",{ref:S=>{S&&C.setIcon(S,"chevron-right")},className:"btn btn-text",onClick:()=>D(1)})]}),w.jsxs("div",{className:"date-picker-day-container",children:[w.jsx("div",{className:"date-picker-day-header",children:N("weekDaysShort").map(S=>w.jsx("span",{className:"day-item",children:S},S))}),w.jsx("div",{className:"date-picker-day-content",children:m.map(S=>S.date===0?w.jsx("span",{className:"day-item null",children:""},S.datestamp):w.jsx("span",{className:`day-item ${S.datestamp===n?"current":""} ${S.datestamp===s?"selected":""}`,onClick:T=>v(T,S.datestamp),children:w.jsx("span",{className:"day-item-text",children:S.date})},S.datestamp))})]})]})};function a9(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Mi}function Ph(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}var RD=function(t){return t.reduce(function(n,r){var a=r[0],o=r[1];return n[a]=o,n},{})},BD=typeof window<"u"&&window.document&&window.document.createElement?A.useLayoutEffect:A.useEffect,wa="top",uo="bottom",co="right",ba="left",C1="auto",jp=[wa,uo,co,ba],kd="start",rp="end",o9="clippingParents",JT="viewport",jh="popper",i9="reference",_D=jp.reduce(function(e,t){return e.concat([t+"-"+kd,t+"-"+rp])},[]),x1=[].concat(jp,[C1]).reduce(function(e,t){return e.concat([t,t+"-"+kd,t+"-"+rp])},[]),s9="beforeRead",l9="read",u9="afterRead",c9="beforeMain",d9="main",f9="afterMain",h9="beforeWrite",p9="write",m9="afterWrite",g9=[s9,l9,u9,c9,d9,f9,h9,p9,m9];function Ai(e){return e?(e.nodeName||"").toLowerCase():null}function za(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Au(e){var t=za(e).Element;return e instanceof t||e instanceof Element}function lo(e){var t=za(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function M1(e){if(typeof ShadowRoot>"u")return!1;var t=za(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function y9(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},a=t.attributes[n]||{},o=t.elements[n];!lo(o)||!Ai(o)||(Object.assign(o.style,r),Object.keys(a).forEach(function(s){var c=a[s];c===!1?o.removeAttribute(s):o.setAttribute(s,c===!0?"":c)}))})}function v9(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var a=t.elements[r],o=t.attributes[r]||{},s=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),c=s.reduce(function(d,p){return d[p]="",d},{});!lo(a)||!Ai(a)||(Object.assign(a.style,c),Object.keys(o).forEach(function(d){a.removeAttribute(d)}))})}}const w9={name:"applyStyles",enabled:!0,phase:"write",fn:y9,effect:v9,requires:["computeStyles"]};function Ni(e){return e.split("-")[0]}var Mu=Math.max,hy=Math.min,Ad=Math.round;function kw(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function KT(){return!/^((?!chrome|android).)*safari/i.test(kw())}function Fd(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),a=1,o=1;t&&lo(e)&&(a=e.offsetWidth>0&&Ad(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Ad(r.height)/e.offsetHeight||1);var s=Au(e)?za(e):window,c=s.visualViewport,d=!KT()&&n,p=(r.left+(d&&c?c.offsetLeft:0))/a,m=(r.top+(d&&c?c.offsetTop:0))/o,g=r.width/a,v=r.height/o;return{width:g,height:v,top:m,right:p+g,bottom:m+v,left:p,x:p,y:m}}function N1(e){var t=Fd(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function QT(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&M1(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function ms(e){return za(e).getComputedStyle(e)}function b9(e){return["table","td","th"].indexOf(Ai(e))>=0}function Tl(e){return((Au(e)?e.ownerDocument:e.document)||window.document).documentElement}function Uy(e){return Ai(e)==="html"?e:e.assignedSlot||e.parentNode||(M1(e)?e.host:null)||Tl(e)}function HD(e){return!lo(e)||ms(e).position==="fixed"?null:e.offsetParent}function D9(e){var t=/firefox/i.test(kw()),n=/Trident/i.test(kw());if(n&&lo(e)){var r=ms(e);if(r.position==="fixed")return null}var a=Uy(e);for(M1(a)&&(a=a.host);lo(a)&&["html","body"].indexOf(Ai(a))<0;){var o=ms(a);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return a;a=a.parentNode}return null}function Lp(e){for(var t=za(e),n=HD(e);n&&b9(n)&&ms(n).position==="static";)n=HD(n);return n&&(Ai(n)==="html"||Ai(n)==="body"&&ms(n).position==="static")?t:n||D9(e)||t}function k1(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Jh(e,t,n){return Mu(e,hy(t,n))}function S9(e,t,n){var r=Jh(e,t,n);return r>n?n:r}function XT(){return{top:0,right:0,bottom:0,left:0}}function eE(e){return Object.assign({},XT(),e)}function tE(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var I9=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,eE(typeof t!="number"?t:tE(t,jp))};function T9(e){var t,n=e.state,r=e.name,a=e.options,o=n.elements.arrow,s=n.modifiersData.popperOffsets,c=Ni(n.placement),d=k1(c),p=[ba,co].indexOf(c)>=0,m=p?"height":"width";if(!(!o||!s)){var g=I9(a.padding,n),v=N1(o),D=d==="y"?wa:ba,S=d==="y"?uo:co,T=n.rects.reference[m]+n.rects.reference[d]-s[d]-n.rects.popper[m],E=s[d]-n.rects.reference[d],O=Lp(o),k=O?d==="y"?O.clientHeight||0:O.clientWidth||0:0,j=T/2-E/2,F=g[D],B=k-v[m]-g[S],R=k/2-v[m]/2+j,z=Jh(F,R,B),H=d;n.modifiersData[r]=(t={},t[H]=z,t.centerOffset=z-R,t)}}function E9(e){var t=e.state,n=e.options,r=n.element,a=r===void 0?"[data-popper-arrow]":r;a!=null&&(typeof a=="string"&&(a=t.elements.popper.querySelector(a),!a)||QT(t.elements.popper,a)&&(t.elements.arrow=a))}const nE={name:"arrow",enabled:!0,phase:"main",fn:T9,effect:E9,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Od(e){return e.split("-")[1]}var C9={top:"auto",right:"auto",bottom:"auto",left:"auto"};function x9(e,t){var n=e.x,r=e.y,a=t.devicePixelRatio||1;return{x:Ad(n*a)/a||0,y:Ad(r*a)/a||0}}function YD(e){var t,n=e.popper,r=e.popperRect,a=e.placement,o=e.variation,s=e.offsets,c=e.position,d=e.gpuAcceleration,p=e.adaptive,m=e.roundOffsets,g=e.isFixed,v=s.x,D=v===void 0?0:v,S=s.y,T=S===void 0?0:S,E=typeof m=="function"?m({x:D,y:T}):{x:D,y:T};D=E.x,T=E.y;var O=s.hasOwnProperty("x"),k=s.hasOwnProperty("y"),j=ba,F=wa,B=window;if(p){var R=Lp(n),z="clientHeight",H="clientWidth";if(R===za(n)&&(R=Tl(n),ms(R).position!=="static"&&c==="absolute"&&(z="scrollHeight",H="scrollWidth")),a===wa||(a===ba||a===co)&&o===rp){F=uo;var Y=g&&R===B&&B.visualViewport?B.visualViewport.height:R[z];T-=Y-r.height,T*=d?1:-1}if(a===ba||(a===wa||a===uo)&&o===rp){j=co;var U=g&&R===B&&B.visualViewport?B.visualViewport.width:R[H];D-=U-r.width,D*=d?1:-1}}var J=Object.assign({position:c},p&&C9),Q=m===!0?x9({x:D,y:T},za(n)):{x:D,y:T};if(D=Q.x,T=Q.y,d){var le;return Object.assign({},J,(le={},le[F]=k?"0":"",le[j]=O?"0":"",le.transform=(B.devicePixelRatio||1)<=1?"translate("+D+"px, "+T+"px)":"translate3d("+D+"px, "+T+"px, 0)",le))}return Object.assign({},J,(t={},t[F]=k?T+"px":"",t[j]=O?D+"px":"",t.transform="",t))}function M9(e){var t=e.state,n=e.options,r=n.gpuAcceleration,a=r===void 0?!0:r,o=n.adaptive,s=o===void 0?!0:o,c=n.roundOffsets,d=c===void 0?!0:c,p={placement:Ni(t.placement),variation:Od(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:a,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,YD(Object.assign({},p,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:s,roundOffsets:d})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,YD(Object.assign({},p,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:d})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const rE={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:M9,data:{}};var Fg={passive:!0};function N9(e){var t=e.state,n=e.instance,r=e.options,a=r.scroll,o=a===void 0?!0:a,s=r.resize,c=s===void 0?!0:s,d=za(t.elements.popper),p=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&p.forEach(function(m){m.addEventListener("scroll",n.update,Fg)}),c&&d.addEventListener("resize",n.update,Fg),function(){o&&p.forEach(function(m){m.removeEventListener("scroll",n.update,Fg)}),c&&d.removeEventListener("resize",n.update,Fg)}}const aE={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:N9,data:{}};var k9={left:"right",right:"left",bottom:"top",top:"bottom"};function Kg(e){return e.replace(/left|right|bottom|top/g,function(t){return k9[t]})}var A9={start:"end",end:"start"};function zD(e){return e.replace(/start|end/g,function(t){return A9[t]})}function A1(e){var t=za(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function F1(e){return Fd(Tl(e)).left+A1(e).scrollLeft}function F9(e,t){var n=za(e),r=Tl(e),a=n.visualViewport,o=r.clientWidth,s=r.clientHeight,c=0,d=0;if(a){o=a.width,s=a.height;var p=KT();(p||!p&&t==="fixed")&&(c=a.offsetLeft,d=a.offsetTop)}return{width:o,height:s,x:c+F1(e),y:d}}function O9(e){var t,n=Tl(e),r=A1(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Mu(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Mu(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),c=-r.scrollLeft+F1(e),d=-r.scrollTop;return ms(a||n).direction==="rtl"&&(c+=Mu(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:c,y:d}}function O1(e){var t=ms(e),n=t.overflow,r=t.overflowX,a=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+a+r)}function oE(e){return["html","body","#document"].indexOf(Ai(e))>=0?e.ownerDocument.body:lo(e)&&O1(e)?e:oE(Uy(e))}function Kh(e,t){var n;t===void 0&&(t=[]);var r=oE(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=za(r),s=a?[o].concat(o.visualViewport||[],O1(r)?r:[]):r,c=t.concat(s);return a?c:c.concat(Kh(Uy(s)))}function Aw(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function P9(e,t){var n=Fd(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function UD(e,t,n){return t===JT?Aw(F9(e,n)):Au(t)?P9(t,n):Aw(O9(Tl(e)))}function j9(e){var t=Kh(Uy(e)),n=["absolute","fixed"].indexOf(ms(e).position)>=0,r=n&&lo(e)?Lp(e):e;return Au(r)?t.filter(function(a){return Au(a)&&QT(a,r)&&Ai(a)!=="body"}):[]}function L9(e,t,n,r){var a=t==="clippingParents"?j9(e):[].concat(t),o=[].concat(a,[n]),s=o[0],c=o.reduce(function(d,p){var m=UD(e,p,r);return d.top=Mu(m.top,d.top),d.right=hy(m.right,d.right),d.bottom=hy(m.bottom,d.bottom),d.left=Mu(m.left,d.left),d},UD(e,s,r));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}function iE(e){var t=e.reference,n=e.element,r=e.placement,a=r?Ni(r):null,o=r?Od(r):null,s=t.x+t.width/2-n.width/2,c=t.y+t.height/2-n.height/2,d;switch(a){case wa:d={x:s,y:t.y-n.height};break;case uo:d={x:s,y:t.y+t.height};break;case co:d={x:t.x+t.width,y:c};break;case ba:d={x:t.x-n.width,y:c};break;default:d={x:t.x,y:t.y}}var p=a?k1(a):null;if(p!=null){var m=p==="y"?"height":"width";switch(o){case kd:d[p]=d[p]-(t[m]/2-n[m]/2);break;case rp:d[p]=d[p]+(t[m]/2-n[m]/2);break}}return d}function ap(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=r===void 0?e.placement:r,o=n.strategy,s=o===void 0?e.strategy:o,c=n.boundary,d=c===void 0?o9:c,p=n.rootBoundary,m=p===void 0?JT:p,g=n.elementContext,v=g===void 0?jh:g,D=n.altBoundary,S=D===void 0?!1:D,T=n.padding,E=T===void 0?0:T,O=eE(typeof E!="number"?E:tE(E,jp)),k=v===jh?i9:jh,j=e.rects.popper,F=e.elements[S?k:v],B=L9(Au(F)?F:F.contextElement||Tl(e.elements.popper),d,m,s),R=Fd(e.elements.reference),z=iE({reference:R,element:j,strategy:"absolute",placement:a}),H=Aw(Object.assign({},j,z)),Y=v===jh?H:R,U={top:B.top-Y.top+O.top,bottom:Y.bottom-B.bottom+O.bottom,left:B.left-Y.left+O.left,right:Y.right-B.right+O.right},J=e.modifiersData.offset;if(v===jh&&J){var Q=J[a];Object.keys(U).forEach(function(le){var pe=[co,uo].indexOf(le)>=0?1:-1,ie=[wa,uo].indexOf(le)>=0?"y":"x";U[le]+=Q[ie]*pe})}return U}function R9(e,t){t===void 0&&(t={});var n=t,r=n.placement,a=n.boundary,o=n.rootBoundary,s=n.padding,c=n.flipVariations,d=n.allowedAutoPlacements,p=d===void 0?x1:d,m=Od(r),g=m?c?_D:_D.filter(function(S){return Od(S)===m}):jp,v=g.filter(function(S){return p.indexOf(S)>=0});v.length===0&&(v=g);var D=v.reduce(function(S,T){return S[T]=ap(e,{placement:T,boundary:a,rootBoundary:o,padding:s})[Ni(T)],S},{});return Object.keys(D).sort(function(S,T){return D[S]-D[T]})}function B9(e){if(Ni(e)===C1)return[];var t=Kg(e);return[zD(e),t,zD(t)]}function _9(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,c=s===void 0?!0:s,d=n.fallbackPlacements,p=n.padding,m=n.boundary,g=n.rootBoundary,v=n.altBoundary,D=n.flipVariations,S=D===void 0?!0:D,T=n.allowedAutoPlacements,E=t.options.placement,O=Ni(E),k=O===E,j=d||(k||!S?[Kg(E)]:B9(E)),F=[E].concat(j).reduce(function(Ie,De){return Ie.concat(Ni(De)===C1?R9(t,{placement:De,boundary:m,rootBoundary:g,padding:p,flipVariations:S,allowedAutoPlacements:T}):De)},[]),B=t.rects.reference,R=t.rects.popper,z=new Map,H=!0,Y=F[0],U=0;U<F.length;U++){var J=F[U],Q=Ni(J),le=Od(J)===kd,pe=[wa,uo].indexOf(Q)>=0,ie=pe?"width":"height",se=ap(t,{placement:J,boundary:m,rootBoundary:g,altBoundary:v,padding:p}),fe=pe?le?co:ba:le?uo:wa;B[ie]>R[ie]&&(fe=Kg(fe));var oe=Kg(fe),we=[];if(o&&we.push(se[Q]<=0),c&&we.push(se[fe]<=0,se[oe]<=0),we.every(function(Ie){return Ie})){Y=J,H=!1;break}z.set(J,we)}if(H)for(var Z=S?3:1,G=function(De){var ke=F.find(function(Ye){var Re=z.get(Ye);if(Re)return Re.slice(0,De).every(function(rt){return rt})});if(ke)return Y=ke,"break"},te=Z;te>0;te--){var ge=G(te);if(ge==="break")break}t.placement!==Y&&(t.modifiersData[r]._skip=!0,t.placement=Y,t.reset=!0)}}const sE={name:"flip",enabled:!0,phase:"main",fn:_9,requiresIfExists:["offset"],data:{_skip:!1}};function VD(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function ZD(e){return[wa,co,uo,ba].some(function(t){return e[t]>=0})}function H9(e){var t=e.state,n=e.name,r=t.rects.reference,a=t.rects.popper,o=t.modifiersData.preventOverflow,s=ap(t,{elementContext:"reference"}),c=ap(t,{altBoundary:!0}),d=VD(s,r),p=VD(c,a,o),m=ZD(d),g=ZD(p);t.modifiersData[n]={referenceClippingOffsets:d,popperEscapeOffsets:p,isReferenceHidden:m,hasPopperEscaped:g},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":m,"data-popper-escaped":g})}const lE={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:H9};function Y9(e,t,n){var r=Ni(e),a=[ba,wa].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,s=o[0],c=o[1];return s=s||0,c=(c||0)*a,[ba,co].indexOf(r)>=0?{x:c,y:s}:{x:s,y:c}}function z9(e){var t=e.state,n=e.options,r=e.name,a=n.offset,o=a===void 0?[0,0]:a,s=x1.reduce(function(m,g){return m[g]=Y9(g,t.rects,o),m},{}),c=s[t.placement],d=c.x,p=c.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=d,t.modifiersData.popperOffsets.y+=p),t.modifiersData[r]=s}const uE={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:z9};function U9(e){var t=e.state,n=e.name;t.modifiersData[n]=iE({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const cE={name:"popperOffsets",enabled:!0,phase:"read",fn:U9,data:{}};function V9(e){return e==="x"?"y":"x"}function Z9(e){var t=e.state,n=e.options,r=e.name,a=n.mainAxis,o=a===void 0?!0:a,s=n.altAxis,c=s===void 0?!1:s,d=n.boundary,p=n.rootBoundary,m=n.altBoundary,g=n.padding,v=n.tether,D=v===void 0?!0:v,S=n.tetherOffset,T=S===void 0?0:S,E=ap(t,{boundary:d,rootBoundary:p,padding:g,altBoundary:m}),O=Ni(t.placement),k=Od(t.placement),j=!k,F=k1(O),B=V9(F),R=t.modifiersData.popperOffsets,z=t.rects.reference,H=t.rects.popper,Y=typeof T=="function"?T(Object.assign({},t.rects,{placement:t.placement})):T,U=typeof Y=="number"?{mainAxis:Y,altAxis:Y}:Object.assign({mainAxis:0,altAxis:0},Y),J=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,Q={x:0,y:0};if(R){if(o){var le,pe=F==="y"?wa:ba,ie=F==="y"?uo:co,se=F==="y"?"height":"width",fe=R[F],oe=fe+E[pe],we=fe-E[ie],Z=D?-H[se]/2:0,G=k===kd?z[se]:H[se],te=k===kd?-H[se]:-z[se],ge=t.elements.arrow,Ie=D&&ge?N1(ge):{width:0,height:0},De=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:XT(),ke=De[pe],Ye=De[ie],Re=Jh(0,z[se],Ie[se]),rt=j?z[se]/2-Z-Re-ke-U.mainAxis:G-Re-ke-U.mainAxis,Ht=j?-z[se]/2+Z+Re+Ye+U.mainAxis:te+Re+Ye+U.mainAxis,Se=t.elements.arrow&&Lp(t.elements.arrow),Ze=Se?F==="y"?Se.clientTop||0:Se.clientLeft||0:0,Ke=(le=J==null?void 0:J[F])!=null?le:0,Je=fe+rt-Ke-Ze,lt=fe+Ht-Ke,ft=Jh(D?hy(oe,Je):oe,fe,D?Mu(we,lt):we);R[F]=ft,Q[F]=ft-fe}if(c){var Dt,Ct=F==="x"?wa:ba,un=F==="x"?uo:co,Ft=R[B],Ot=B==="y"?"height":"width",an=Ft+E[Ct],wn=Ft-E[un],Tn=[wa,ba].indexOf(O)!==-1,vr=(Dt=J==null?void 0:J[B])!=null?Dt:0,Ia=Tn?an:Ft-z[Ot]-H[Ot]-vr+U.altAxis,tr=Tn?Ft+z[Ot]+H[Ot]-vr-U.altAxis:wn,Nr=D&&Tn?S9(Ia,Ft,tr):Jh(D?Ia:an,Ft,D?tr:wn);R[B]=Nr,Q[B]=Nr-Ft}t.modifiersData[r]=Q}}const dE={name:"preventOverflow",enabled:!0,phase:"main",fn:Z9,requiresIfExists:["offset"]};function W9(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function $9(e){return e===za(e)||!lo(e)?A1(e):W9(e)}function G9(e){var t=e.getBoundingClientRect(),n=Ad(t.width)/e.offsetWidth||1,r=Ad(t.height)/e.offsetHeight||1;return n!==1||r!==1}function q9(e,t,n){n===void 0&&(n=!1);var r=lo(t),a=lo(t)&&G9(t),o=Tl(t),s=Fd(e,a,n),c={scrollLeft:0,scrollTop:0},d={x:0,y:0};return(r||!r&&!n)&&((Ai(t)!=="body"||O1(o))&&(c=$9(t)),lo(t)?(d=Fd(t,!0),d.x+=t.clientLeft,d.y+=t.clientTop):o&&(d.x=F1(o))),{x:s.left+c.scrollLeft-d.x,y:s.top+c.scrollTop-d.y,width:s.width,height:s.height}}function J9(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function a(o){n.add(o.name);var s=[].concat(o.requires||[],o.requiresIfExists||[]);s.forEach(function(c){if(!n.has(c)){var d=t.get(c);d&&a(d)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||a(o)}),r}function K9(e){var t=J9(e);return g9.reduce(function(n,r){return n.concat(t.filter(function(a){return a.phase===r}))},[])}function Q9(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function X9(e){var t=e.reduce(function(n,r){var a=n[r.name];return n[r.name]=a?Object.assign({},a,r,{options:Object.assign({},a.options,r.options),data:Object.assign({},a.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var WD={placement:"bottom",modifiers:[],strategy:"absolute"};function $D(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return!t.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function fE(e){e===void 0&&(e={});var t=e,n=t.defaultModifiers,r=n===void 0?[]:n,a=t.defaultOptions,o=a===void 0?WD:a;return function(c,d,p){p===void 0&&(p=o);var m={placement:"bottom",orderedModifiers:[],options:Object.assign({},WD,o),modifiersData:{},elements:{reference:c,popper:d},attributes:{},styles:{}},g=[],v=!1,D={state:m,setOptions:function(O){var k=typeof O=="function"?O(m.options):O;T(),m.options=Object.assign({},o,m.options,k),m.scrollParents={reference:Au(c)?Kh(c):c.contextElement?Kh(c.contextElement):[],popper:Kh(d)};var j=K9(X9([].concat(r,m.options.modifiers)));return m.orderedModifiers=j.filter(function(F){return F.enabled}),S(),D.update()},forceUpdate:function(){if(!v){var O=m.elements,k=O.reference,j=O.popper;if($D(k,j)){m.rects={reference:q9(k,Lp(j),m.options.strategy==="fixed"),popper:N1(j)},m.reset=!1,m.placement=m.options.placement,m.orderedModifiers.forEach(function(U){return m.modifiersData[U.name]=Object.assign({},U.data)});for(var F=0;F<m.orderedModifiers.length;F++){if(m.reset===!0){m.reset=!1,F=-1;continue}var B=m.orderedModifiers[F],R=B.fn,z=B.options,H=z===void 0?{}:z,Y=B.name;typeof R=="function"&&(m=R({state:m,options:H,name:Y,instance:D})||m)}}}},update:Q9(function(){return new Promise(function(E){D.forceUpdate(),E(m)})}),destroy:function(){T(),v=!0}};if(!$D(c,d))return D;D.setOptions(p).then(function(E){!v&&p.onFirstUpdate&&p.onFirstUpdate(E)});function S(){m.orderedModifiers.forEach(function(E){var O=E.name,k=E.options,j=k===void 0?{}:k,F=E.effect;if(typeof F=="function"){var B=F({state:m,name:O,instance:D,options:j}),R=function(){};g.push(B||R)}})}function T(){g.forEach(function(E){return E()}),g=[]}return D}}var e5=[aE,cE,rE,w9,uE,sE,dE,nE,lE],hE=fE({defaultModifiers:e5}),t5=typeof Element<"u",n5=typeof Map=="function",r5=typeof Set=="function",a5=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Qg(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;var n,r,a;if(Array.isArray(e)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(!Qg(e[r],t[r]))return!1;return!0}var o;if(n5&&e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;for(o=e.entries();!(r=o.next()).done;)if(!Qg(r.value[1],t.get(r.value[0])))return!1;return!0}if(r5&&e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o=e.entries();!(r=o.next()).done;)if(!t.has(r.value[0]))return!1;return!0}if(a5&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(n=e.length,n!=t.length)return!1;for(r=n;r--!==0;)if(e[r]!==t[r])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&typeof e.valueOf=="function"&&typeof t.valueOf=="function")return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&typeof e.toString=="function"&&typeof t.toString=="function")return e.toString()===t.toString();if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!Object.prototype.hasOwnProperty.call(t,a[r]))return!1;if(t5&&e instanceof Element)return!1;for(r=n;r--!==0;)if(!((a[r]==="_owner"||a[r]==="__v"||a[r]==="__o")&&e.$$typeof)&&!Qg(e[a[r]],t[a[r]]))return!1;return!0}return e!==e&&t!==t}var o5=function(t,n){try{return Qg(t,n)}catch(r){if((r.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw r}};const i5=er(o5);var s5=[],Vy=function(t,n,r){r===void 0&&(r={});var a=A.useRef(null),o={onFirstUpdate:r.onFirstUpdate,placement:r.placement||"bottom",strategy:r.strategy||"absolute",modifiers:r.modifiers||s5},s=A.useState({styles:{popper:{position:o.strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),c=s[0],d=s[1],p=A.useMemo(function(){return{name:"updateState",enabled:!0,phase:"write",fn:function(D){var S=D.state,T=Object.keys(S.elements);I1.flushSync(function(){d({styles:RD(T.map(function(E){return[E,S.styles[E]||{}]})),attributes:RD(T.map(function(E){return[E,S.attributes[E]]}))})})},requires:["computeStyles"]}},[]),m=A.useMemo(function(){var v={onFirstUpdate:o.onFirstUpdate,placement:o.placement,strategy:o.strategy,modifiers:[].concat(o.modifiers,[p,{name:"applyStyles",enabled:!1}])};return i5(a.current,v)?a.current||v:(a.current=v,v)},[o.onFirstUpdate,o.placement,o.strategy,o.modifiers,p]),g=A.useRef();return BD(function(){g.current&&g.current.setOptions(m)},[m]),BD(function(){if(!(t==null||n==null)){var v=r.createPopper||hE,D=v(t,n,m);return g.current=D,function(){D.destroy(),g.current=null}}},[t,n,r.createPopper]),{state:g.current?g.current.state:null,styles:c.styles,attributes:c.attributes,update:g.current?g.current.update:null,forceUpdate:g.current?g.current.forceUpdate:null}},l5=function(){},u5=l5;const c5=er(u5),d5=(e,t)=>({placement:e,modifiers:[{name:"flip",options:{allowedAutoPlacements:t,rootBoundary:"document"}},{name:"preventOverflow",options:{rootBoundary:"document"}}]}),f5=e=>{const n=A.useRef(null),[r,a]=A.useState(null),[o,s]=A.useState(0);let c,d;const p=()=>{if(C.Platform.isMobile){c="right-end",d=["bottom"];return}const g=window.innerWidth-o>280*1.2,v=window.innerWidth-o<280,D=window.innerWidth>280*1.5;if(e.DefaultEditorLocation!=="Bottom"){g?(c="right-end",d=["left-end"]):v&&D?(c="left-end",d=["right-end"]):(c="bottom",d=["bottom"]);return}g?(c="top-end",d=["top-start"]):v&&o>280?(c="top-start",d=["top-end"]):(c="top",d=["top"])};A.useEffect(()=>{e&&p()},[o,e==null?void 0:e.DefaultEditorLocation]);const m=Vy(n.current,r,d5(c,d));return{setPosX:s,popperRef:n,setPopperElement:a,popper:m}},h5=()=>{const e=new Set,t=He.getState().query.filter,n=He.getState().query.tag,r=Et.getQueryById(t||"");if(r&&r.querystring){const a=JSON.parse(r.querystring);if(Array.isArray(a))for(const o of a)o.type==="TAG"&&o.value&&o.value.operator==="CONTAIN"&&e.add(o.value.value)}return n&&e.add(n),Array.from(e)},p5=e=>{const{offsetLeft:t,offsetTop:n,offsetHeight:r,offsetWidth:a,selectionEnd:o}=e,s=document.createElement("div"),c=window.getComputedStyle(e);for(const T of c)s.style.setProperty(T,c.getPropertyValue(T));s.style.position="fixed",s.style.visibility="hidden",s.style.whiteSpace="pre-wrap";const p=e.tagName==="INPUT"?e.value.replace(/ /g,"."):e.value;s.textContent=p.substring(0,o||0),e.tagName==="TEXTAREA"&&(s.style.height="auto");const m=document.createElement("span");m.textContent=p.substring(o||0)||".",s.appendChild(m),document.body.appendChild(s);const{offsetLeft:g,offsetTop:v,offsetHeight:D,offsetWidth:S}=m;return document.body.removeChild(s),{x:t+g,y:n+v,h:r+D,w:a+S}},Nu=({className:e,editorType:t,destroy:n})=>{const{globalState:r,dailyNotesState:{app:a,settings:o,view:s,verifyState:c}}=A.useContext(mt),[d,p]=ki(!0),m=A.useRef(d),[g,v]=Kr(!0),D=A.useRef(null),S=A.useRef(null),T=A.useRef(r),[E,O]=Kr(!1),[k,j]=Kr(!1),{setPosX:F,popperRef:B,setPopperElement:R,popper:z}=f5(o),[H]=Kr(parseInt(C.moment().format("x"))),Y=A.useRef(null),[U,J]=Kr((o==null?void 0:o.EnabledLocationList.length)===1?o==null?void 0:o.EnabledLocationList[0].value:(o==null?void 0:o.MemoSaveLocation)||"DAILY"),Q=A.useRef(o.MemoSaveLocation||"DAILY");A.useEffect(()=>{m.current=d},[d]),A.useEffect(()=>{!S.current||!a||!s||(s.registerEvent(a.workspace.on("focus-on-textarea",Se=>{var Ze;(Ze=S.current)==null||Ze.focus(Se==null?void 0:Se.id)})),s.registerEvent(a.workspace.on("blur-on-memos",()=>{var Se;(Se=S.current)==null||Se.blur()})),s.registerEvent(a.workspace.on("send-to-thino",async(Se,Ze)=>{var Ke,Je;if(typeof Se=="string")(Ke=S.current)==null||Ke.insertText(Se+`
`,Ze.id);else{const lt=Se.toPNG(),ft=new Blob([lt],{type:"image/png"}),Dt=new File([ft],"image.png",{type:"image/png",lastModified:Date.now()});if(!Dt)return;const Ct=await oe(Dt);Ct&&((Je=S.current)==null||Je.insertText(Ct+`
`,Ze.id))}})))},[S,s,a]),A.useEffect(()=>{o&&p(o.DefaultPrefix==="List")},[o==null?void 0:o.DefaultPrefix]),A.useEffect(()=>{if(o){if(o.EnabledLocationList.length===1){J(o.EnabledLocationList[0].value);return}J(o.MemoSaveLocation||"DAILY")}},[o==null?void 0:o.MemoSaveLocation,o==null?void 0:o.EnabledLocationList]),A.useEffect(()=>{var Ke;if(!o||!Y.current)return;const Se=(Ke=tp.find(Je=>Je.title===U))==null?void 0:Ke.icon;C.setIcon(Y.current,Se),C.requireApiVersion("1.4.4")&&C.setTooltip(Y.current,N("Thino Save To: ")+U),Q.current=U;const Ze=r.manifest;if(Ze){const Je=a==null?void 0:a.plugins.getPlugin(Ze.id);if(Je){if(Je.settings.MemoSaveLocation===U)return;Je.settings.MemoSaveLocation=U,Je.saveSettings()}}},[U,g]),A.useEffect(()=>{S.current&&o.MemoSaveLocation&&J(o.MemoSaveLocation)},[Y,o]),A.useEffect(()=>{if(!S.current||!o||C.Platform.isDesktop||r.globalEditorShown)return;const Se=o.UseButtonToShowEditor&&o.DefaultEditorLocation==="Bottom";if(C.Platform.isDesktop){v(!0);return}if(t&&t==="inline"){v(!0);return}if(v(C.Platform.isMobile&&!Se),!Se||r.memoListView==="chat")return;const Ze=document.body.find(".memolist-wrapper");Ze&&(Ze.onscroll=()=>{if(r.globalEditorShown)return;if(!r.memoListView&&Qe.getState().memoListView==="chat"){Ze.onscroll=null;return}const Ke=S.current.getContent();C.Platform.isMobile&&Se&&!Ke&&v(!1)})},[r.globalEditorShown,t,S]);const le=()=>{j(!1)};A.useEffect(()=>{var Se,Ze,Ke,Je,lt,ft,Dt,Ct,un;if(a&&(r.markMemoId||(Se=r.editMemoId)!=null&&Se.trim()&&r.editMemoId!==T.current.editMemoId)){const Ft=a.workspace.getLeavesOfType("thino_view");Ft.length>0&&a.workspace.revealLeaf(Ft[0])}if(r.markMemoId){const Ft=`${N("MARK")}: [@THINO](${r.markMemoId})`;(Ze=S.current)==null||Ze.insertText(Ft),(Ke=S.current)==null||Ke.focus(),Qe.setMarkMemoId("");return}if((Je=r.editMemoId)!=null&&Je.trim()&&r.editMemoId!==T.current.editMemoId){const Ft=Te.getMemoById(r.editMemoId);if(Ft)switch(p(Ft.thinoType==="JOURNAL"),o.EditorType){case"memos":(lt=S.current)==null||lt.setContent(Ft.content.replace(/ \^\S{6}$/,"")||""),(ft=S.current)==null||ft.focus();break;case"obsidian":(Dt=S.current)==null||Dt.clear(),(Ct=S.current)==null||Ct.setContent(Ft.content.replace(/ \^\S{6}$/,"")||""),(un=S.current)==null||un.focus();break}}T.current=r},[r.markMemoId,r.editMemoId]),A.useEffect(()=>{var Se,Ze,Ke;!S.current||E||o.EditorType==="memos"&&((Se=S.current)==null||Se.element.addEventListener("paste",pe),(Ze=S.current)==null||Ze.element.addEventListener("drop",ie),(Ke=S.current)==null||Ke.element.addEventListener("click",se),O(!0))},[S.current]);const pe=async Se=>{var Ze;if(Se.clipboardData&&Se.clipboardData.files.length>0){Se.preventDefault();const Ke=Se.clipboardData.files;for(const Je of Ke){const lt=await oe(Je);lt&&((Ze=S.current)==null||Ze.insertText(lt))}}},ie=async Se=>{var Ze;if(Se.dataTransfer&&Se.dataTransfer.files.length>0){Se.preventDefault();const Ke=Se.dataTransfer.files;for(const Je of Ke){const lt=await oe(Je);lt&&((Ze=S.current)==null||Ze.insertText(lt))}}},se=()=>{var Se;G(((Se=S.current)==null?void 0:Se.element.value)||"")},fe=async(Se,Ze)=>{var lt,ft,Dt;const Ke=Se.ctrlKey||Se.metaKey,Je=Se.altKey;if(Se.key==="Escape"&&r.globalEditorShown&&(Qe.setGlobalEditorShown(!1),Se.preventDefault()),Ke&&Se.key==="Enter"){Se.preventDefault(),Se.stopPropagation(),Ze?(await we((ft=S.current)==null?void 0:ft.getContent()),(Dt=S.current)==null||Dt.clear()):await we((lt=S.current)==null?void 0:lt.element.value);return}if(Je)for(let Ct=0;Ct<o.EnabledLocationList.length;Ct++)Se.key===(Ct+1).toString()&&J(o.EnabledLocationList[Ct].value);setTimeout(()=>{var Ct;Ze||G(((Ct=S.current)==null?void 0:Ct.element.value)||"")})},oe=A.useCallback(async Se=>{const{type:Ze}=Se;if(Ze.startsWith("image"))try{return`${await S1.upload(Se)}`}catch(Ke){new C.Notice(Ke)}},[]),we=async Se=>{if(!Se||Se.trim()===""){new C.Notice(N("Content cannot be empty"));return}const Ze=Xe.getState().settings,Ke=Ze==null?void 0:Ze.addTagAutomatically,Je=Ze==null?void 0:Ze.addTagWithNewline,lt=Ze==null?void 0:Ze.addTagPosition,Dt=(h5()||[]).filter(Ot=>!Se.includes(`#${Ot}`)),Ct=async(Ot,an)=>{an=an.replaceAll("&nbsp;"," "),Og("");try{if(!Ot){let Tn;switch(Q.current){case"CANVAS":Tn=await Te.createMemoCanvas({text:an,isList:m.current});break;case"MULTI":Tn=await Te.createMemoMultiFile({content:an,isList:m.current});break;case"DAILY":Tn=await Te.createMemoDaily(an,m.current);break;case"FILE":Tn=await Te.createMemoSingleFile({content:an,isList:m.current});break}if(!Tn)return;Te.pushMemo(Tn),(!Ke||Dt.length===0)&&He.clearQuery();const vr=a||Xe.getState().app,Ia=vr==null?void 0:vr.loadLocalStorage("tokenForSync");Tn&&Ia&&o.startSync&&setTimeout(async()=>{try{const tr=await RT({content:an,thinoType:Q.current==="DAILY"?"DAILY":"FILE"});await Te.updateMemoById(Tn.id,tr,!0)}catch(tr){console.error(tr)}},200);return}const wn=Te.getMemoById(Ot);if(wn&&(wn.content!==an||wn.thinoType!==(m.current?"JOURNAL":"TASK-TODO"))){const Tn=await Te.updateMemo(wn.id,an,m.current?"JOURNAL":"TASK-TODO");Tn.updatedAt=Ue.getDateTimeString(Date.now()),Te.editMemo(Tn)}Qe.setEditMemoId("")}catch(wn){new C.Notice(wn.message)}},{editMemoId:un}=Qe.getState(),Ft=Dt&&Dt.length>0&&Ke?lt==="Beginning"?`${Dt.map(Ot=>`#${Ot}`).join(" ")} ${Je?`
`:""}${Se}`:`${Se} ${Je?`
`:""}${Dt.map(Ot=>`#${Ot}`).join(" ")}`:Se;await Ct(un,Ft),n&&n(),Og("")},Z=A.useCallback(()=>{var Se;Qe.setEditMemoId(""),(Se=S.current)==null||Se.setContent(""),Og("")},[]),G=A.useCallback(Se=>{if(Og(Se??""),!S.current)return;const Ze=S.current.getContent(),Ke=S.current.element.selectionStart,Je=Ze.slice(0,Ke),lt=Ze.slice(Ke);(Je.endsWith("@")||Je.endsWith("📆"))&&lt.startsWith(" ")||(Je.endsWith("@")||Je.endsWith("📆"))&&lt===""?(Ye(),j(!0)):j(!1),setTimeout(()=>{var ft;(ft=S.current)==null||ft.focus()})},[o.EditorType]),te=Se=>{if(!S.current||!o)return;Se&&(le(),p(!1));const Ze=S.current.getContent(),Ke=S.current.element.selectionStart,Je=Ze.slice(0,Ke),lt=Ze.slice(Ke),ft=C.moment(Se);if(Je.endsWith("@"))switch(o.InsertDateFormat){case"Dataview":S.current.element.value=Ze.slice(0,S.current.element.selectionStart-1)+"[due::"+ft.format("YYYY-MM-DD")+"]"+lt,S.current.element.setSelectionRange(Ke+17,Ke+17),S.current.focus(),G(S.current.element.value);break;case"Tasks":S.current.element.value=Ze.slice(0,S.current.element.selectionStart-1)+"📆"+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Ke+11,Ke+11),S.current.focus(),G(S.current.element.value)}else{S.current.element.value=Je+ft.format("YYYY-MM-DD")+lt,S.current.element.setSelectionRange(Ke+10,Ke+10),S.current.focus(),G(S.current.element.value);return}},ge=()=>{S.current&&p()},Ie=async()=>{var Ke;const Se=!C.Platform.isDesktop&&await((Ke=window.Capacitor)==null?void 0:Ke.Plugins.Device.getId()),Ze=C.Platform.isDesktop?await vn():Se.identifier||Se.uuid;return!c||(c==null?void 0:c.appId)!==Ze?(qt(),!1):!0},De=async Se=>{if(!await Ie())return;const Ze=new C.Menu;o.EnabledLocationList.forEach(ft=>{Ze.addItem(Dt=>{var Ct;Dt.setTitle(N(ft.value)).setIcon(((Ct=tp.find(un=>un.title===ft.value))==null?void 0:Ct.icon)??"file").setChecked(U===ft.value).onClick(()=>{J(ft.value)})})});let Ke=Se.target,Je=null;for(;!Ke.hasClass("location-wrapper")&&(Je=Ke.parentElement,Je);)Ke=Je;const lt=Ke.getBoundingClientRect();setTimeout(()=>{Ze.showAtPosition({x:lt.x,y:lt.bottom,width:lt.width,left:!1,overlap:!0})},200)},ke=A.useCallback(()=>{var Se,Ze;if(!(!S.current&&o.EditorType==="memos"))switch(o.EditorType){case"obsidian":(Se=S.current)==null||Se.focus(),(Ze=S.current)==null||Ze.insertTag();break;case"memos":{const Ke=S.current.getContent(),Je=S.current.element.selectionStart,lt=Ke.slice(0,Je),ft=Ke.slice(Je);let Dt=lt+"# "+ft,Ct=lt.length+1;lt.endsWith("#")&&ft.startsWith(" ")&&(Dt=lt.slice(0,lt.length-1)+ft.slice(1),Ct=lt.length-1),S.current.element.value=Dt,S.current.element.setSelectionRange(Ct,Ct),S.current.focus();const un=new Event("input",{bubbles:!0,cancelable:!0});S.current.element.dispatchEvent(un),G(S.current.element.value)}}},[a]),Ye=A.useCallback(()=>{if(!S.current||!B.current||!o||!a)return;const Ke=a.workspace.getLeavesOfType(_r)[0].view.containerEl,Je=280,lt=Ke.clientWidth,{x:ft,y:Dt}=p5(S.current.element);let Ct,un;C.Platform.isMobile?(window.innerWidth-ft>Je?Ct=(ft+Je+16>lt,ft+18):window.innerWidth-ft<Je?Ct=(ft+Je+16>lt,ft+34):Ct=S.current.element.clientWidth/2,o.DefaultEditorLocation==="Bottom"&&window.innerWidth>875?un=Dt+4:o.DefaultEditorLocation==="Bottom"&&window.innerWidth<=875?un=Dt+19:o.DefaultEditorLocation==="Top"&&window.innerWidth<=875&&(un=Dt+36)):(Ct=(ft+Je+16>lt,ft+18),un=Dt+34),F(ft),B.current.style.left=`${Ct}px`,B.current.style.top=`${un}px`},[o,a]),Re=A.useCallback(()=>{const Se=document.createElement("input");document.body.appendChild(Se),Se.type="file",Se.multiple=!1,Se.accept="image/png, image/gif, image/jpeg",Se.onchange=async()=>{var Je;if(!Se.files||Se.files.length===0)return;const Ze=Se.files[0],Ke=await oe(Ze);Ke&&((Je=S.current)==null||Je.insertText(Ke)),document.body.removeChild(Se)},Se.click()},[]),rt=!!r.editMemoId,Ht=A.useMemo(()=>({className:"memo-editor",inputerType:o.EditorType||"obsidian",initialContent:m5(),placeholder:N("What do you think now..."),showConfirmBtn:!0,showCancelBtn:rt,showTools:!0,onConfirmBtnClick:we,onCancelBtnClick:Z,onContentChange:G}),[rt,o.EditorType]);return w.jsxs(w.Fragment,{children:[!r.globalEditorShown&&t==="block"&&w.jsx("div",{ref:Se=>{D.current=Se,Se&&C.setIcon&&C.setIcon(Se,"plus-circle")},className:`memo-show-editor-button ${g?"hidden":""}`,onClick:()=>{var Se;(Se=D.current.firstElementChild)==null||Se.toggleClass("rotate-hidden",!0),setTimeout(()=>{v(!0),D.current.firstElementChild.toggleClass("rotate-hidden",!1)},500),setTimeout(()=>{var Ze;(Ze=S.current)==null||Ze.focus()},600)}}),w.jsxs("div",{className:`memo-editor-wrapper ${e||""} ${rt?"edit-ing":""} ${r.globalEditorShown?"fullscreen-editor":""} ${g?"":"hidden"}`,onKeyDownCapture:Se=>fe(Se,!0),children:[w.jsx("span",{className:`tip-text ${rt?"":"hidden"}`,children:"Modifying..."}),w.jsx(t9,{ref:S,...Ht,tools:w.jsxs(w.Fragment,{children:[w.jsx("span",{ref:Se=>{Se&&C.setIcon(Se,"hash")},className:"btn action-btn add-tag",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ke()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ke()}}),w.jsx("span",{ref:Se=>{Se&&C.setIcon(Se,"paperclip")},className:"btn action-btn file-upload",onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&Re()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&Re()}}),w.jsx("span",{ref:Se=>{Se&&C.setIcon(Se,d?"layout-list":"check-square")},className:Xn("btn action-btn list-or-task",d?"list":"task"),onClick:()=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&ge()},onPointerDown:()=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&ge()}}),w.jsx("div",{ref:Se=>{Se&&(C.setIcon&&C.setIcon(Se,r.globalEditorShown?"shrink":"expand"),C.setTooltip&&C.setTooltip(Se,r.globalEditorShown?N("Exit fullscreen mode"):N("Enter fullscreen mode")))},className:"action-btn show-editor pro",onPointerDown:async()=>{await Ie()&&(v(!0),Qe.setGlobalEditorShown(!r.globalEditorShown))}}),w.jsx("div",{className:"action-btn split-line pro"}),w.jsx("div",{className:"action-btn location-wrapper pro",onClick:async Se=>{o&&o.DefaultEditorLocation==="Top"&&!r.globalEditorShown&&await De(Se)},onPointerDown:async Se=>{(o&&o.DefaultEditorLocation==="Bottom"||r.globalEditorShown)&&await De(Se)},children:w.jsx("div",{ref:Y,className:"action-btn file-location-btn"})})]})}),w.jsx("div",{ref:B,className:"date-picker",children:k&&w.jsx("div",{tabIndex:-1,style:z.styles.popper,...z.attributes.popper,ref:R,role:"dialog",children:w.jsx(zy,{className:`editor-date-picker ${k?"":"hidden"}`,datestamp:H,handleDateStampChange:te})})})]})]})};function m5(){return Kn.get(["thinoEditorContentCache"]).thinoEditorContentCache??""}function Og(e){Kn.set({thinoEditorContentCache:e})}const g5=e=>{const t=[];return e.map(n=>{t.length==0?t.push({date:C.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]}):t.some(a=>{if(a.date==C.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"))return a.have.push(n),!0})||t.push({date:C.moment(n.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),have:[n]})}),t},y5=e=>Te.getState().commentMemos.filter(t=>t.linkId===e.hasId).sort((t,n)=>Ue.getTimeStampByDate(t.createdAt)-Ue.getTimeStampByDate(n.createdAt)).map(t=>({...t,createdAtStr:Ue.getDateTimeString(t.createdAt),dateStr:Ue.getDateString(t.createdAt)})),v5=e=>{const t=Xe.getState().settings,n=DN(),r=t!=null&&t.ShowDate?" ":"",a="YYYY/MM/DD HH:mm:ss",o=/comment:(.*)$/g,s=/^\d{14}/g,c=(g,v,D)=>{const S=C.moment(g.createdAt,a).format("HH:mm");return D?D.replace(/{TIME}/g,S).replace(/{CONTENT}/g,v):`${S} ${v}`},d=g=>{const v=g.match(/TASK-(.*)?/g);return v?v[1]:""},p=g=>g==="TASK-TODO"?"- [ ] ":g==="TASK-DONE"?"- [x] ":g.match(/TASK-(.*)?/g)?`- [${d(g)}] `:"- ",m=g=>g.reduce((v,D)=>{const S=D.sourceType!=="MULTI"?`${D.content}`:`[[${D.path}]]`,T=t!=null&&t.ShowTime?c(D,S,t==null?void 0:t.DefaultMemoComposition):S,E=`${p(D.thinoType)}${T}`;let O="";return t.CommentOnMemos&&D.hasId!==void 0&&D.hasId!==""&&(O=y5(D).reduce((j,F)=>{const B=p(F.thinoType),R=F.content.replace(o,"").replace(s,""),z=t!=null&&t.ShowDate?`${B}[[${C.moment(F.createdAt).format(n)}]] ${C.moment(F.createdAt).format("HH:mm")} ${R}`:`${B}${R}`;return j+r+" "+z+`
`},"")),v+r+E.replace(/ \^\S{6}/g,"")+`
`+O},"");return e.reduce((g,v)=>{const D=t!=null&&t.ShowDate?`- [[${C.moment(v.date,"YYYY-MM-DD").format(n)}]]
`:"",S=m(v.have),T=t!=null&&t.ShowDate&&(t!=null&&t.AddBlankLineWhenDate)&&!(t!=null&&t.CommentOnMemos)?`
`:"";return g+D+S+T},"").replace(/<br>/g,`
`)},w5=[{label:N("Today"),value:C.moment().format("YYYY-MM-DD")},{label:N("Yesterday"),value:C.moment().subtract(1,"days").format("YYYY-MM-DD")},{label:N("Last 7 days"),value:C.moment().subtract(7,"days").format("YYYY-MM-DD")},{label:N("Last 30 days"),value:C.moment().subtract(30,"days").format("YYYY-MM-DD")},{label:N("Last 90 days"),value:C.moment().subtract(90,"days").format("YYYY-MM-DD")},{label:N("Last 180 days"),value:C.moment().subtract(180,"days").format("YYYY-MM-DD")},{label:N("Last 365 days"),value:C.moment().subtract(365,"days").format("YYYY-MM-DD")}],pE=e=>{const{handleValueChange:t,setShownStatus:n}=e;return w.jsxs(w.Fragment,{children:[e.type==="icon"&&w.jsx("div",{className:"quick-date-btn-group",children:w5.map((r,a)=>w.jsx("div",{className:"btn action-btn quick-date-btn",onClick:()=>{t(r.value),n&&n(!1)},children:r.label},a))}),w.jsx(zy,{className:"calendar-date-picker",datestamp:(e==null?void 0:e.defaultValue)||C.moment().startOf("day").valueOf(),handleDateStampChange:(r,a)=>{t(e.type==="icon"?C.moment(r).format("YYYY-MM-DD"):r.toString()),n&&n(!1)}})]})},py=e=>{const{handleValueChange:t}=e,[n,r]=$.useState(!1),a=$.useRef(null),o=$.useRef(null),s=Vy(o.current,a.current,{placement:"bottom-start"});return Pp(a,()=>{r(!1)}),w.jsxs(w.Fragment,{children:[w.jsx("span",{ref:d=>{o.current=d,d&&e.type==="icon"&&C.setIcon(d,"calendar")},className:`btn calendar-btn ${e.type==="icon"?"icon-btn":"text-btn"}`,onClick:()=>{!C.Platform.isMobile&&r(!n),!C.Platform.isMobile&&(s!=null&&s.update)&&(s==null||s.update()),C.Platform.isMobile&&new mE(Xe.getState().app,e.type,t).open()},children:e.type==="text"&&e.defaultValue?e.defaultText?e.defaultText:C.moment(e.defaultValue,"x").subtract(e.startOrEnd==="end"?1:0,"days").format("YYYY/MM/DD"):""}),w.jsx("div",{className:`menu-btns-popup ${n?"":"hidden"}`,ref:a,style:s.styles.popper,children:w.jsx(pE,{type:e.defaultText?"icon":e.type,handleValueChange:t,setShownStatus:r})})]})};class mE extends C.Modal{constructor(n,r,a){super(n);me(this,"root");me(this,"type");me(this,"handleValueChange");this.type=r,this.handleValueChange=a}onOpen(){const{contentEl:n}=this;this.root=Ap(n),this.root.render(w.jsx(pE,{type:this.type,handleValueChange:this.handleValueChange.bind(this),setShownStatus:r=>{!r&&this.close()}}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const b5=(e,t)=>(e%t+t)%t;class D5{constructor(t,n,r){me(this,"owner");me(this,"values");me(this,"suggestions");me(this,"selectedItem");me(this,"containerEl");this.owner=t,this.containerEl=n,n.on("click",".suggestion-item",this.onSuggestionClick.bind(this)),n.on("mousemove",".suggestion-item",this.onSuggestionMouseover.bind(this)),r.register([],"ArrowUp",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem-1,!0),!1}),r.register([],"ArrowDown",a=>{if(!a.isComposing)return this.setSelectedItem(this.selectedItem+1,!0),!1}),r.register([],"Enter",a=>{if(!a.isComposing)return this.useSelectedItem(a),!1})}onSuggestionClick(t,n){t.preventDefault();const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1),this.useSelectedItem(t)}onSuggestionMouseover(t,n){const r=this.suggestions.indexOf(n);this.setSelectedItem(r,!1)}setSuggestions(t){this.containerEl.empty();const n=[];t.forEach(r=>{const a=this.containerEl.createDiv("suggestion-item");this.owner.renderSuggestion(r,a),n.push(a)}),this.values=t,this.suggestions=n,this.setSelectedItem(0,!1)}useSelectedItem(t){const n=this.values[this.selectedItem];n&&this.owner.selectSuggestion(n,t)}setSelectedItem(t,n){const r=b5(t,this.suggestions.length),a=this.suggestions[this.selectedItem],o=this.suggestions[r];a==null||a.removeClass("is-selected"),o==null||o.addClass("is-selected"),this.selectedItem=r,n&&o.scrollIntoView(!1)}}class gE{constructor(t,n){me(this,"inputEl");me(this,"popper");me(this,"scope");me(this,"suggestEl");me(this,"suggest");me(this,"cb");this.inputEl=t,this.scope=new C.Scope,this.cb=n,this.suggestEl=createDiv("suggestion-container");const r=this.suggestEl.createDiv("suggestion");this.suggest=new D5(this,r,this.scope),this.scope.register([],"Escape",this.close.bind(this)),this.inputEl.addEventListener("input",this.onInputChanged.bind(this)),this.inputEl.addEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.addEventListener("click",this.onInputChanged.bind(this)),this.inputEl.addEventListener("blur",this.close.bind(this)),this.suggestEl.on("mousedown",".suggestion-container",a=>{a.preventDefault()})}clearInput(){this.inputEl.value="",this.inputEl.trigger("blur"),this.inputEl.trigger("focus"),this.inputEl.trigger("input"),this.onInputChanged()}onInputChanged(){const t=this.inputEl.value,n=this.getSuggestions(t);if(!n){this.close();return}n.length>0?(this.suggest.setSuggestions(n),this.open(app.dom.appContainerEl,this.inputEl)):this.close()}open(t,n){app.keymap.pushScope(this.scope),t.appendChild(this.suggestEl),this.popper=hE(n,this.suggestEl,{placement:"bottom-start",modifiers:[{name:"sameWidth",enabled:!0,fn:({state:r,instance:a})=>{const o=`${r.rects.reference.width}px`;r.styles.popper.width!==o&&(r.styles.popper.width=o,a.update())},phase:"beforeWrite",requires:["computeStyles"]}]})}close(){app.keymap.popScope(this.scope),this.suggest.setSuggestions([]),this.popper&&this.popper.destroy(),this.suggestEl.detach()}destroy(){this.inputEl.removeEventListener("input",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("focus",this.onInputChanged.bind(this)),this.inputEl.removeEventListener("blur",this.close.bind(this)),this.close()}updateCb(t){this.cb=t}}const S5=e=>{const t=e.metadataCache.getTags();return[...Object.keys(t)].map(n=>n.split("#").pop())};let yE=class extends gE{fuzzySearchItemsOptimized(t,n){const r=C.prepareFuzzySearch(t);return n.map(a=>{const o=r(a);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const{settings:n,app:r}=Xe.getState(),a=t.toLocaleLowerCase(),o=n.UseVaultTags?S5(r):Te.getState().tags;return this.fuzzySearchItemsOptimized(a,o).map(s=>s.item)}renderSuggestion(t,n){n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:t})}selectSuggestion(t){this.inputEl.value=t,this.inputEl.dispatchEvent(new Event("change")),this.cb&&this.cb(t),this.close()}};const I5=e=>{const t=new Set;return e.forEach(n=>{const r=new RegExp(Fn).exec(n.content),a=new RegExp($n).exec(n.content);if(r)for(let o=1;o<r.length;o++)t.add(r[o]);if(a)for(let o=1;o<a.length;o++)t.add(a[o])}),Array.from(t)},T5=({app:e,thinos:t,closeDialog:n})=>{const[r,a]=$.useState([]),[o,s]=$.useState([]),[c,d]=$.useState([]),p=$.useRef(null),m=$.useRef(null),g=$.useRef(null),v=$.useRef("End"),D=$.useRef(!1),S=$.useRef(null);A.useEffect(()=>{t&&t.length&&a(I5(t))},[t]),A.useEffect(()=>{!g.current||!m.current||(new C.Setting(m.current).setName(N("Add tag position")).addDropdown(k=>{k.addOption("End",N("End")),k.addOption("Beginning",N("Beginning")),k.setValue("End").onChange(async j=>{v.current=j})}),new C.Setting(g.current).setName(N("Add tag with new line")).addToggle(k=>{k.setValue(!1).onChange(async j=>{D.current=j})}))},[]);const T=k=>{if(!k)return;const j=new Set(o);j.add(k),s(Array.from(j)),p.current.clearInput()};A.useEffect(()=>{if(S.current){if(p.current){p.current.updateCb(T);return}p.current=new yE(S.current,T)}},[S.current,o]);const E=()=>{n(),O({remove:c,add:o,targetThinos:t})},O=async({remove:k,add:j,targetThinos:F})=>{const B=D.current||!1,R=[];for(const z of F){let H=z.content;for(const Y of k)H=H.replace(new RegExp(`#${Y}`,"g"),"");if(H=H.trim(),j.length>0&&(H=v.current==="Beginning"?`${j.map(Y=>`#${Y}`).join(" ")} ${B?`
`:""}${H}`:`${H} ${B?`
`:""}${j.map(Y=>`#${Y}`).join(" ")}`),z&&z.content!==H){const Y=await Te.updateMemo(z.id,H==null?void 0:H.trim());R.push(Y)}}R.length>0&&Te.editMemoBulk(R),R.length>0&&He.clearQuery()};return w.jsxs("div",{className:"thino-tag-operation",children:[w.jsx("div",{className:"tag-operation-title",children:N("Tag Bulk Edit")}),w.jsxs("div",{className:"tag-operation-content",children:[w.jsxs("div",{className:"tag-operation-content-title exist-tags",children:[w.jsx("div",{className:"name",children:N("Exist Tags")}),w.jsx("div",{className:"desc",children:N("Click to remove exist tag")})]}),w.jsx("div",{className:"tag-operation-content-tags exist-tags",children:r.map(k=>w.jsx("div",{className:Xn("tag-operation-content-tag",c.includes(k)&&"tag-operation-content-tag-removed"),onClick:()=>{c.includes(k)||d([...c,k]),c.includes(k)&&d(c.filter(j=>j!==k)),o.includes(k)&&s(o.filter(j=>j!==k))},children:k},k))}),w.jsxs("div",{className:"tag-operation-content-title selected-tags",children:[w.jsx("div",{className:"name",children:N("Selected Tags")}),w.jsx("div",{className:"desc",children:N("Click to remove selected tag")})]}),w.jsx("div",{className:"tag-operation-content-tags selected-tags",children:o.map(k=>w.jsx("div",{className:"tag-operation-content-tag",onClick:()=>{s(o.filter(j=>j!==k))},children:k},k))}),w.jsx("div",{className:"tag-operation-content-inputer",children:w.jsx("input",{placeholder:N("Input to select exist tag"),ref:S,onKeyDown:k=>{k.key==="Enter"&&T(S.current.value)}})}),w.jsxs("div",{className:"tag-operation-settings",children:[w.jsx("div",{ref:m}),w.jsx("div",{ref:g})]}),w.jsxs("div",{className:"tag-operation-content-btn-group",children:[w.jsx("button",{className:"cancel-btn",onClick:n,children:N("Cancel")}),w.jsx("button",{className:"save-btn",onClick:E,children:N("Save")})]})]})]})},Fw=new Map,xd=async(e,t=!0)=>{const{vault:n,metadataCache:r}=Xe.getState().app;if(t&&Fw.has(e))return Promise.resolve(Fw.get(e));if(e.contains("data:image"))return e;let a;const o=await n.adapter.exists(e);let s="";try{if(!o&&!/(http|https)/g.test(e)&&!e.includes("data:image")){const c=r.getFirstLinkpathDest(e,"");if(!c){new C.Notice(N("File not exist"));return}s=c.path}else s=e}catch(c){console.error(c)}if(s){if(/(http|https)/g.test(s))try{const c=await C.requestUrl(e),d=new Uint8Array(c.arrayBuffer);a=new Blob([d],{type:"image/png"})}catch{}else if(s){const c=await n.adapter.readBinary(s),d=new Uint8Array(c);a=new Blob([d],{type:"image/png"})}return a?await E5(a,e):""}},E5=(e,t)=>new Promise(n=>{const r=new FileReader;r.onloadend=()=>{const a=r.result;Fw.set(t,a),n(a)},r.readAsDataURL(e)}),Uh=async e=>{if(!e.style.backgroundImage.includes("url(")&&!e.style.backgroundImage.includes("http"))return;const t=e.style.backgroundImage.includes("url(")?e.style.backgroundImage.slice(5,-2):e.style.backgroundImage;return await xd(t)},C5=async e=>{const t=document.createElement(e.tagName);t.innerHTML=e.innerHTML;const n=async(r,a)=>{if(!r||!a)return;const o=window.getComputedStyle(r);if(r.tagName==="IMG")try{let s="";const c=r.getAttribute("src");c!=null&&c.startsWith("http")&&!c.startsWith("http://localhost")?s=await xd(r==null?void 0:r.getAttribute("src")):s=await xd(r.getAttribute("path")||C.normalizePath(r==null?void 0:r.parentElement.getAttribute("src"))),a.src=s}catch(s){console.error(s)}else if(r.hasClass("property-image")||r.hasClass("moments-view-background"))try{const s=r.style.backgroundImage.includes("url(")?r.style.backgroundImage.slice(5,-2):r.style.backgroundImage,c=await xd(s);a.style.backgroundImage=`url(${c})`}catch(s){console.error(s)}for(const s of o)a.style.setProperty(s,o.getPropertyValue(s),o.getPropertyPriority(s));for(let s=0;s<a.childElementCount;s++)await n(r.children[s],a.children[s])};return await n(e,t),t},x5=async e=>{const t=e.ownerDocument.styleSheets,n=[];for(const a of t)for(const o of a.cssRules)o.constructor.name==="CSSFontFaceRule"&&n.push(o.style);return document.createElement("style")},vE=e=>{const{width:t,height:n}=window.getComputedStyle(e);return{width:parseInt(t.replace("px","")),height:parseInt(n.replace("px",""))}},M5=e=>{const t=new XMLSerializer().serializeToString(e);return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`},N5=(e,t,n)=>{const r="http://www.w3.org/2000/svg",a=document.createElementNS(r,"svg");a.setAttribute("width",`${e}`),a.setAttribute("height",`${t}`),a.setAttribute("viewBox",`0 0 ${e} ${t}`);const o=document.createElementNS(r,"foreignObject");return o.setAttribute("width","100%"),o.setAttribute("height","100%"),o.setAttribute("x","0"),o.setAttribute("y","0"),o.setAttribute("externalResourcesRequired","true"),o.appendChild(n),a.appendChild(o),a},k5=async(e,t)=>{const{width:n,height:r}=vE(e),a=await C5(e);t!=null&&t.backgroundColor&&(a.style.backgroundColor=t.backgroundColor);const o=N5(n,r,a);return o.prepend(await x5(e)),M5(o)},A5=async(e,t)=>{const n=await k5(e,t),r=new Image;r.src=n;const a=(t==null?void 0:t.pixelRatio)||1,{width:o,height:s}=vE(e),c=document.createElement("canvas"),d=c.getContext("2d");return d?(c.width=o*a,c.height=s*a,c.style.width=`${o}`,c.style.height=`${s}`,(t!=null&&t.backgroundColor||document.body.className.contains("theme-dark"))&&(d.fillStyle=t.backgroundColor||"#1f1f1f",d.fillRect(0,0,c.width,c.height)),new Promise(p=>{r.onload=()=>{d.drawImage(r,0,0,c.width,c.height),p(c)}})):Promise.reject("Canvas error")},Zy=async(e,t)=>(await A5(e,t)).toDataURL(),GD=async e=>{e.startsWith("http")&&(e=await xd(e));const t=e.split("base64,")[1],n=Oy(t,"image/png");await wE(n),new C.Notice(N("Send to clipboard successfully"))},F5=async(e,t)=>{const n=await e.vault.adapter.exists(t);let r="";if(n)r=t;else{const c=e.metadataCache.getFirstLinkpathDest(t,"");if(!c){new C.Notice(N("File not exist"));return}r=c.path}const a=await e.vault.adapter.readBinary(r),o=new Uint8Array(a),s=new Blob([o],{type:"image/png"});await wE(s)},wE=async e=>{const t=new ClipboardItem({"image/png":e});await window.navigator.clipboard.write([t])},qD=1.1,JD=300,KD=20,O5=({destroy:e,imgUrl:t,filepath:n,otherIMGEls:r,currentIndex:a})=>{const o=A.useRef(null),[s,c]=A.useState(-1),d=Ee.getState().dailyNotesState.app,[p,m]=A.useState(a),[g,v]=A.useState(t),D={close:A.useRef(null),previous:A.useRef(null),next:A.useRef(null),decrease:A.useRef(null),increase:A.useRef(null),zoom:A.useRef(null),copy:A.useRef(null)};A.useEffect(()=>{!n&&!t||(C.setIcon(D.close.current,"x"),D.previous.current&&C.setIcon(D.previous.current,"arrow-left"),D.next.current&&C.setIcon(D.next.current,"arrow-right"),C.setIcon(D.decrease.current,"zoom-out"),C.setIcon(D.increase.current,"zoom-in"),C.setIcon(D.zoom.current,"circle"),C.setIcon(D.copy.current,"clipboard"))},[D]),A.useEffect(()=>{Ue.getImageSize(g).then(({width:R})=>{c(R!==0?40:0)})},[g]);const S=()=>{let R=p-1;R<0&&(R=r.length-1),m(R),v(r[R].src)},T=()=>{let R=p+1;R>=r.length&&(R=0),m(R),v(r[R].src)},E=()=>{e()},O=()=>{s>30&&c(s-10)},k=()=>{c(s+10)},j=R=>{R.target!==o.current&&R.target===o.current.parentElement&&E()},F=R=>{if(R.ctrlKey){R.preventDefault();const z=o.current,H=R.nativeEvent.offsetX,Y=R.nativeEvent.offsetY,U=H/z.clientWidth,J=Y/z.clientHeight;let Q;R.deltaY>0?Q=s/qD:Q=s*qD,Q>JD?Q=JD:Q<KD&&(Q=KD);const le=s;c(Q);const pe=R.currentTarget;pe.scrollLeft+=(Q-le)*U,pe.scrollTop+=(Q-le)*J}else R.deltaX!==0&&(R.currentTarget.scrollLeft+=R.deltaX)},B=async()=>{if(g&&!n)await GD(t);else if(n){const z=r[p].parentElement.getAttribute("src");if(!z){await GD(g);return}await F5(d,z)}};return w.jsxs(w.Fragment,{children:[w.jsx("button",{ref:D.close,className:"btn close-btn",onClick:E}),w.jsxs("div",{className:"img-container internal-embed image-embed is-loaded",onClick:j,onWheel:F,children:[w.jsx("img",{className:s<=0?"hidden":"",ref:o,height:s+"%",src:g}),w.jsx("span",{className:"loading-text "+(s===-1?"":"hidden"),children:N("Image is loading...")}),w.jsx("span",{className:"loading-text "+(s===0?"":"hidden"),children:N("😟 Cannot load image, image link maybe broken")})]}),w.jsxs("div",{className:"action-btns-container",children:[r&&(r==null?void 0:r.length)>1&&w.jsxs(w.Fragment,{children:[w.jsx("button",{ref:D.previous,className:"btn",onClick:S}),w.jsx("button",{ref:D.next,className:"btn",onClick:T})]}),w.jsx("button",{ref:D.decrease,className:"btn",onClick:O}),w.jsx("button",{ref:D.increase,className:"btn",onClick:k}),w.jsx("button",{ref:D.zoom,className:"btn",onClick:()=>c(80)}),w.jsx("button",{ref:D.copy,className:"btn",onClick:B})]})]})};function Wy({imgUrl:e,filepath:t,otherIMGEls:n,currentIndex:r}){By({className:"preview-image-dialog"},O5,{...{imgUrl:e,otherIMGEls:n,currentIndex:r},filepath:t})}const yd=async()=>{var r;const{verifyState:e}=Xe.getState(),t=!C.Platform.isDesktop&&await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId()),n=C.Platform.isDesktop?await vn():t.identifier||t.uuid;return e&&(e==null?void 0:e.appId)===n},P5=async(e,t)=>{if(!(t!=="chat"&&t!=="moments")){if(t==="moments"){const n=e.querySelectorAll(".thino-moment-icon"),r=e.find(".moments-view-user-icon"),a=e.find(".moments-view-background");for(const o of n){const s=await Uh(o);o.style.backgroundImage=`url(${s})`}if(r){const o=await Uh(r);r.style.backgroundImage=`url(${o})`}if(a){const o=await Uh(a);a.style.backgroundImage=`url(${o})`}}else if(t==="chat"){const n=e.querySelectorAll(".icon-img");for(const r of n){const a=await Uh(r);r.style.backgroundImage=`url(${a})`}}}};class vd extends C.Modal{constructor(t,n,r){super(t),this.title=n,this.cb=r}onOpen(){super.onOpen(),this.containerEl.toggleClass("thino-bulk-action-dialog",!0),this.titleEl.setText(this.title+N("Confirm?")),this.contentEl.createEl("button",{text:N("Confirm?").replace(/\?|/,"")}).onclick=()=>{this.cb("confirm"),this.close()},this.contentEl.createEl("button",{text:N("Cancel")}).onclick=()=>{this.cb("cancel"),this.close()}}onClose(){super.onClose()}}class j5 extends C.Modal{constructor(n,r){super(n);me(this,"root");this.thinos=r}onOpen(){super.onOpen(),this.containerEl.toggleClass(["thino-bulk-action-dialog","tag-actions"],!0),this.root=Lo.createRoot(this.contentEl),this.root.render(w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(T5,{app:this.app,closeDialog:this.close.bind(this),thinos:this.thinos})}))}onClose(){var n;super.onClose(),(n=this.root)==null||n.unmount()}}const Rp=({thinosCount:e,thinos:t})=>{const{globalState:{memoListView:n},locationState:{query:r,pathname:a},dailyNotesState:{settings:o,app:s}}=A.useContext(mt),{tag:c,duration:d,type:p,text:m,filter:g}=r,v=Et.getQueryById(g),D=!!(c||d&&d.from<d.to||p||m||v),S=A.useRef(null);A.useEffect(()=>{S&&C.setIcon(S.current,"more-horizontal")},[S]);const T=async()=>{if(!((t==null?void 0:t.length)>0))return;const H=g5(t),Y=v5(H);await Ue.copyTextToClipboard(Y),new C.Notice(N("Copied to clipboard Successfully"))},E=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await yd()){qt();return}const H=[...t],Y=o.DeleteThinoDirectly;try{for(const U of H)if(Y)await Te.deleteMemoById(U.id);else{const J=await Te.hideMemoById(U.id);J&&Te.editMemo(J)}He.clearQuery()}catch(U){console.error("error",U),new C.Notice(U.message)}},O=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await yd()){qt();return}const H=[...t];try{for(const Y of H)await Te.deleteMemoById(Y.id);He.clearQuery(),new C.Notice(N("DELETE SUCCEED"))}catch(Y){console.error("error",Y),new C.Notice(Y.message)}},k=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await yd()){qt();return}const H=[...t];try{const Y=await Te.unarchiveThinoBulk(H);for(const U of Y)U&&Te.editMemo(U);new C.Notice(N("RESTORE SUCCEED")),He.clearQuery()}catch(Y){console.error("error",Y),new C.Notice(Y.message)}},j=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await yd()){qt();return}const H=[...t],Y=Xe.getState().settings.startSync;try{for(const U of H){const J=await Te.restoreMemoById(U.id),Q=Xe.getState().app,le=Q==null?void 0:Q.loadLocalStorage("tokenForSync");J&&J.webId&&le&&Y&&await BT(J.webId),J&&Te.editMemo(J)}He.clearQuery(),new C.Notice(N("RESTORE SUCCEED"))}catch(U){new C.Notice(U.message)}},F=async()=>{if(!((t==null?void 0:t.length)>0))return;if(!await yd()){qt();return}const H=[...t];try{const Y=await Te.archiveThinoBulk(H);for(const U of Y)U&&Te.editMemo(U);He.clearQuery()}catch(Y){console.error("error",Y),new C.Notice(Y.message)}},B=async()=>{if((t==null?void 0:t.length)>0){if(!await yd()){qt();return}new j5(s,t).open()}},R=async H=>{setTimeout(async()=>{if(new C.Notice(N("Image is generating...")),!H){new C.Notice(N("No content to generate."));return}await P5(H,n);let Y;document.body.hasClass("theme-dark")?Y="#232323":Y="#eaeaea",Zy(H,{backgroundColor:Y,pixelRatio:window.devicePixelRatio*2}).then(U=>{if(o!=null&&o.AutoSaveWhenOnMobile&&C.Platform.isMobile){const J=U.split("base64,")[1];Oy(J,"image/png").arrayBuffer().then(async le=>{let pe;const ie="png",se=bs();for(const fe in se)if(se[fe]instanceof C.TFile){pe=se[fe];break}pe!==void 0&&await s.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,ie,pe),le)})}Wy({imgUrl:U}),new C.Notice(N("Image generated successfully.")),H.hasClass("share-image")?H.toggleClass("share-image",!1):H.closest(".share-image").toggleClass("share-image",!1)}).catch(U=>{console.error(U)})},0)},z=H=>{const Y=new C.Menu;switch(Y.addItem(U=>{U.setTitle(N("Copy filtered thinos")).setIcon("copy").onClick(async()=>{await T()})}),Y.addItem(U=>{U.setTitle(N("Share filtered thinos as image")).setIcon("image").onClick(async()=>{const J=document.querySelector(".memolist-container");J.toggleClass("share-image",!0);try{if(n==="calendar"){if(J.find(".rbc-agenda-table")){const Q=J.find(".rbc-agenda-table");await R(Q)}}else if(n==="table"){if(J.find(".thino-table")){const Q=J.find(".thino-table");await R(Q)}}else await R(J)}catch(Q){console.error(Q),new C.Notice(N("Failed to generate image.")),J.toggleClass("share-image",!1)}})}),Y.addSeparator(),a){case"/":Y.addItem(U=>{U.setTitle(N("Bulk tag operation")).setIcon("hash").onClick(async()=>{await B()})}).addItem(U=>{U.setTitle(N("Bulk archive")).setIcon("archive").onClick(async()=>{new vd(s,N("ARCHIVE"),async J=>{J==="confirm"&&await F()}).open()})}).addItem(U=>{U.setTitle(N("Bulk delete")).setIcon("trash").onClick(async()=>{new vd(s,N("DELETE"),async J=>{J==="confirm"&&await E()}).open()})});break;case"/archive":Y.addItem(U=>{U.setTitle(N("Bulk restore")).setIcon("archive").onClick(async()=>{new vd(s,N("RESTORE"),async J=>{J==="confirm"&&await k()}).open()})}).addItem(U=>{U.setTitle(N("Bulk delete")).setIcon("trash").onClick(async()=>{new vd(s,N("DELETE"),async J=>{J==="confirm"&&await E()}).open()})});break;case"/recycle":Y.addItem(U=>{U.setTitle(N("Bulk restore")).setIcon("archive-restore").onClick(async()=>{new vd(s,N("RESTORE"),async J=>{J==="confirm"&&await j()}).open()})}).addItem(U=>{U.setTitle(N("Bulk delete")).setIcon("trash").onClick(async()=>{new vd(s,N("DELETE"),async J=>{J==="confirm"&&await O()}).open()})});break}Y.showAtMouseEvent(H.nativeEvent)};return w.jsxs("div",{className:`filter-query-container ${D?"":"hidden"}`,children:[w.jsxs("div",{className:"filter-query",children:[w.jsx("span",{className:"tip-text",children:N("FILTER")}),w.jsxs("div",{"data-filter-type":"query",className:"filter-item-container "+(v?"":"hidden"),onClick:()=>{He.setMemoFilter("")},children:[w.jsx("span",{className:"icon-text",children:"🔖"})," ",v==null?void 0:v.title]}),w.jsxs("div",{"data-filter-type":"tag",className:"filter-item-container "+(c?"":"hidden"),onClick:()=>{He.setTagQuery("")},children:[w.jsx("span",{className:"icon-text",children:"🏷️"})," ",c]}),w.jsxs("div",{"data-filter-type":"type",className:"filter-item-container "+(p?"":"hidden"),onClick:()=>{He.setMemoTypeQuery("")},children:[w.jsx("span",{className:"icon-text",children:"📦"})," ",c8(p)]}),d&&d.from<d.to&&w.jsxs("div",{"data-filter-type":"date",className:"filter-item-container",children:[w.jsxs("div",{className:"day-picker-component-group",children:[w.jsx("span",{className:"icon-text",children:"🗓️"})," ",w.jsx(py,{type:"text",startOrEnd:"start",defaultValue:C.moment(d.from,"x").valueOf(),handleValueChange:H=>{const Y=C.moment(d.to,"x"),U=C.moment(H,"x"),J=U.isAfter(Y)||U.isSame(Y);He.setFromAndToQuery(J?Y.startOf("day").valueOf():C.moment(H,"x").startOf("day").valueOf(),d.to)}}),w.jsx("span",{children:N("to")}),w.jsx(py,{type:"text",startOrEnd:"end",defaultValue:C.moment(d.to,"x").add(1,"days").valueOf(),handleValueChange:H=>{const Y=C.moment(d.from,"x"),U=C.moment(H,"x"),J=U.isBefore(Y)||U.isSame(Y),Q=C.moment(H,"x").endOf("day").valueOf();He.setFromAndToQuery(d.from,J?Y.endOf("day").valueOf():Q)}})]}),w.jsx("div",{ref:H=>H&&C.setIcon(H,"x"),className:"btn close-btn",onClick:()=>{He.setFromAndToQuery(0,0)}})]}),w.jsxs("div",{className:"filter-item-container "+(m?"":"hidden"),onClick:()=>{He.setTextQuery("")},children:[w.jsx("span",{className:"icon-text",children:"🔍"})," ",m]})]}),w.jsxs("div",{className:"thino-filter-items",children:[e&&w.jsx("div",{className:"thinos-count",children:`${e?`${e} Thinos `:""}`}),w.jsx("div",{ref:S,className:"btn memo-action-menu",onClick:z})]})]})},L5=e=>{const{dailyNotesState:{app:t,view:n}}=A.useContext(mt),{memo:r,handleMemoContentClick:a,handleMemoDoubleClick:o}=e,s=$.useRef(null),[c,d]=$.useState("");return A.useEffect(()=>{if(!s.current||s.current.hasChildNodes()&&r.content===c||!n||!t)return;d(r.content),s.current.hasChildNodes()&&s.current.empty(),(async()=>{var g,v;await C.MarkdownRenderer.render(t,r.content+`
`,s.current,r.path,n),(g=s.current)==null||g.toggleClass(["markdown-rendered"],!0);const m=(v=s.current)==null?void 0:v.querySelectorAll(".internal-link");m==null||m.forEach(D=>{const S=D,T=S.getAttribute("data-href");if(!T)return;t.metadataCache.getFirstLinkpathDest(T,r.path)||D.classList.add("is-unresolved"),S.addEventListener("mouseover",O=>{O.stopPropagation(),t.workspace.trigger("hover-link",{event:O,source:"thino",hoverParent:n.containerEl,targetEl:S,linktext:T,sourcePath:S.href})})})})()},[r.content,n,t]),w.jsx("div",{ref:s,className:"memo-content-text",onClick:p=>a(p,r),onDoubleClick:o,onContextMenu:p=>{p.preventDefault()}})},bE=A.memo(L5),R5=e=>{const[t,n]=A.useState({...e.memo,createdAtStr:Ue.getDateTimeString(e.memo.createdAt)}),[r,a]=A.useState([]),[o,s]=A.useState([]);A.useEffect(()=>{(async()=>{try{const g=[],v=[...t.content.matchAll(Il)];for(const S of v)if(S&&S.length===3){const T=S[2],E=Te.getMemoById(T);E&&g.push({...E,createdAtStr:Ue.getDateTimeString(E.createdAt),dateStr:Ue.getDateString(E.createdAt)})}a([...g]);const D=await Te.getLinkedMemos(t.id);s(D.sort((S,T)=>Ue.getTimeStampByDate(T.createdAt)-Ue.getTimeStampByDate(S.createdAt)).map(S=>({...S,createdAtStr:Ue.getDateTimeString(S.createdAt),dateStr:Ue.getDateString(S.createdAt)})))}catch(g){console.error(g)}})()},[t.id]);const c=A.useCallback(async m=>{var v;const g=m.target;if(g.className==="memo-link-text"){const D=(v=g.dataset)==null?void 0:v.value,S=Te.getMemoById(D??"");if(S){const T={...S,createdAtStr:Ue.getDateTimeString(S.createdAt)};a([]),s([]),n(T)}else new C.Notice(N("Thino not found")),g.classList.remove("memo-link-text")}},[]),d=A.useCallback(m=>{a([]),s([]),n({...m,createdAtStr:Ue.getDateTimeString(m.createdAt)})},[t.id]),p=A.useCallback(()=>{e.destroy(),Qe.setEditMemoId(t.id)},[t.id]);return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"memo-card-container",children:[w.jsxs("div",{className:"header-container",children:[w.jsx("span",{className:"time-text",children:t.createdAtStr}),w.jsxs("div",{className:"btns-container",children:[w.jsx("button",{ref:m=>{m&&C.setIcon(m,"edit")},className:"btn edit-btn",onClick:p}),w.jsx("button",{ref:m=>{m&&C.setIcon(m,"x")},className:"btn close-btn",onClick:e.destroy})]})]}),w.jsx("div",{className:"memo-container",children:w.jsx("div",{className:"memo-content-text",children:w.jsx(bE,{memo:t,handleMemoContentClick:c,handleMemoDoubleClick:()=>{}})})}),w.jsx("div",{className:"layer-container"})]}),r.length>0?w.jsxs("div",{className:"linked-memos-wrapper",children:[w.jsxs("span",{className:"normal-text",children:[N("LINKED")," ",r.length," THINO"," "]}),r.map(m=>{const g=Vb(pw(m.content)).replaceAll(`
`," ");return w.jsxs("div",{className:"linked-memo-container",onClick:()=>d(m),children:[w.jsxs("span",{className:"time-text",children:[m.dateStr," "]}),g]},m.id)})]}):null,o.length>0?w.jsxs("div",{className:"linked-memos-wrapper",children:[w.jsxs("span",{className:"normal-text",children:[o.length," THINO ",N("LINK TO THE")," THINO"]}),o.map(m=>{const g=Vb(pw(m.content)).replaceAll(`
`," ");return w.jsxs("div",{className:"linked-memo-container",onClick:()=>d(m),children:[w.jsxs("span",{className:"time-text",children:[m.dateStr," "]}),g]},m.id)})]}):null]})};function $d(e){By({className:"memo-card-dialog"},R5,{memo:e})}const B5='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="1146.31828" height="801.00361" viewBox="0 0 1146.31828 801.00361" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M1050.69918,514.5082a456.24913,456.24913,0,0,1-37.38013-261.87c3.6001-23.1,9.44006-46.85,24.43018-64.79,14.38989-17.23,39.34985-27.37,60.0299-19.29-13.56994-29.61-47.76-46.5-80.59-47.33-34.09-.86-66.92,12.5-97.25,28.1-30.33,15.6-59.65,33.81006-92.21,43.99-53.5,16.72-111.91,10.34-165.5-6.09-53.58-16.44-103.62-42.47-154.62-65.71-51.01-23.24-104.17-44.03-160.01-48.91-55.84-4.87-115.25,7.89-157.24,45.01s-61.87,101.28-38.27,152.11c14.25,30.7,42.22,54.32,52.04,86.7,12.32,40.65-7.08,83.96-30.41,119.45-23.34,35.49-51.8,69.58-60.47,111.16-8.01,38.38,2.72,78.02,24.05,111.38a197.34468,197.34468,0,0,0,35.74,41.61c43.09,37.91,98.77,58.15,154.17,73.13,200.27,54.17,416.13,49.29,613.75-13.88,34.99-11.18,69.95-24.43,99.32-46.48,19.16-14.38,35.83-33.02,46.39-54.35a114.10574,114.10574,0,0,0,11.13-36.18005C1104.43917,610.17819,1072.9692,562.05819,1050.69918,514.5082Z" transform="translate(-26.84086 -49.49819)" fill="#6c63ff"/><g opacity="0.17"><path d="M890.75032,246.45145c9.64171-4.20394-9.91163-6.65119-32.09585-7.45582s-49.02061-.76011-63.19756-3.04875c-13.71114-2.21343-12.7009-6.14907-13.85427-9.71489s-6.42446-7.222-27.81928-8.0147c-26.6607-.98774-70.62581,2.81434-90.75171.53173-18.78121-2.13011-7.61723-8.81182-35.00344-9.06755-15.63837-.146-35.7849,2.05682-53.18577,2.58844-16.33647.49909-28.42216-.53441-36.90357-1.924s-14.38875-3.15126-23.93413-4.37864c-25.06068-3.2224-74.09133-2.13925-117.853,1.99071s-81.27344,10.89816-102.42889,17.60175-27.00029,13.30376-22.07239,18.90071c3.14674,3.574,11.19915,6.91585,30.73235,8.352,36.53555,2.68621,101.58387-1.9375,139.33713.50645,21.0415,1.36213,30.3764,4.73924,48.83812,6.58716,19.83407,1.98528,48.86935,2.09051,77.39656,2.04341,59.39721-.09807,120.3137-.70829,182.42994-1.82747,25.94486-.46745,53.13-1.0752,80.73761-3.30289s55.76623-6.52591,61.59076-10.5553" transform="translate(-26.84086 -49.49819)" fill="#fff"/></g><path d="M1099.25911,172.04818c-.46-1.18-.96-2.35-1.48-3.49.84.33,1.68006.69,2.51,1.08Z" transform="translate(-26.84086 -49.49819)" fill="#6c63ff"/><path d="M648.74482,314.5843c-7.66935-12.68445-16.75721-26.22767-30.98955-30.36953-16.482-4.7965-33.41319,4.73193-47.77473,14.13453a1392.15692,1392.15692,0,0,0-123.89338,91.28311l.04331.49239q46.22556-3.18781,92.451-6.37555c22.26532-1.53546,45.29557-3.2827,64.97195-13.8156,7.46652-3.99683,14.74475-9.33579,23.20555-9.70782,10.51175-.46217,19.67733,6.87923,26.8802,14.54931,42.60732,45.371,54.937,114.7541,102.73817,154.61592A1516.99458,1516.99458,0,0,0,648.74482,314.5843Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M910.64576,699.4127c-4.71168-5.94958-6.63691-7.343-11.28457-13.34761Q842.5968,612.64872,792.65327,534.27272q-33.92353-53.23005-64.48275-108.50439-14.54863-26.27808-28.29961-52.96872-10.67043-20.6952-20.8646-41.63793c-1.94357-3.98781-3.83209-7.99393-5.71122-12.00922-4.42788-9.44232-8.7734-18.93047-13.43942-28.24449-5.31687-10.61571-11.78905-21.74485-21.55259-28.877a29.4049,29.4049,0,0,0-15.31855-5.89457c-7.948-.51337-15.28185,2.76854-22.17569,6.35294-50.43858,26.301-97.65921,59.27589-140.36959,96.79771A730.77781,730.77781,0,0,0,346.39748,485.87843c-1.008,1.43927-3.39163.06418-2.37419-1.38422q6.00935-8.49818,12.25681-16.81288A734.81742,734.81742,0,0,1,543.87972,292.6956q18.24825-11.82579,37.18269-22.54245c6.36206-3.60275,12.75188-7.15967,19.25136-10.49653,6.37147-3.27274,13.13684-6.21547,20.41563-6.32547,24.77011-.385,37.5954,27.667,46.40506,46.54248q4.15283,8.9106,8.40636,17.76626,16.07481,33.62106,33.38729,66.628,10.68453,20.379,21.83683,40.51955,34.7071,62.71816,73.77854,122.897c34.5059,53.1429,68.73651,100.08874,108.04586,149.78473C913.67124,698.84433,911.73706,700.80615,910.64576,699.4127Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M457.9912,345.4352c-1.43911-1.60428-2.86926-3.20856-4.31777-4.81284-11.42244-12.63259-23.6788-25.11847-39.3644-32.36067a57.11021,57.11021,0,0,0-23.92678-5.54622c-8.56213.02753-16.93178,2.27348-24.84307,5.41792-3.74034,1.49428-7.39831,3.19021-11.00078,4.99614-4.11634,2.07182-8.15927,4.28118-12.1834,6.50883q-11.33112,6.27044-22.36816,13.0909-21.9606,13.5722-42.54565,29.21623-10.67111,8.11311-20.90175,16.75788-9.51557,8.03052-18.64618,16.492c-1.30168,1.20091-3.24526-.74255-1.94358-1.94347,1.60428-1.49428,3.22692-2.97938,4.84955-4.44612q6.87549-6.21547,13.9712-12.19258,12.93921-10.91827,26.54851-20.99312,21.16295-15.67614,43.78289-29.2254,11.3036-6.76547,22.91829-12.9626c2.33793-1.24674,4.70317-2.466,7.09571-3.6211a113.11435,113.11435,0,0,1,16.86778-6.86631,60.00626,60.00626,0,0,1,25.476-2.50266,66.32725,66.32725,0,0,1,23.50512,8.1314c15.40091,8.60812,27.34573,21.919,38.97005,34.90916C461.10844,344.80265,459.17382,346.75529,457.9912,345.4352Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M773.55166,476.34216l36.90462-13.498,18.32327-6.70182c5.96758-2.18267,11.92082-4.66747,18.08989-6.23037a28.53868,28.53868,0,0,1,16.37355.20862,37.73731,37.73731,0,0,1,12.771,7.91667,103.63871,103.63871,0,0,1,10.47488,11.18642c3.98932,4.79426,7.9197,9.63878,11.86772,14.46706q24.44135,29.89093,48.56306,60.04134,24.12118,30.14991,47.91981,60.556,23.85681,30.48042,47.38548,61.21573,2.8823,3.76519,5.75967,7.53415c1.0598,1.38809,3.44948.01962,2.37471-1.38807q-23.70225-31.04441-47.73491-61.83464-24.09177-30.86383-48.51646-61.46586-24.42423-30.60142-49.17854-60.93744-6.167-7.5576-12.35444-15.09858c-3.47954-4.24072-6.91984-8.52718-10.73629-12.47426-7.00538-7.24516-15.75772-13.64794-26.23437-13.82167-6.15972-.10214-12.121,1.85248-17.844,3.92288-6.16967,2.232-12.32455,4.50571-18.48632,6.7594L782.11123,470.2921l-9.29068,3.39811c-1.64874.603-.9365,3.26189.73111,2.65195Z" transform="translate(-26.84086 -49.49819)" fill="#e4e4e4"/><path d="M409.45248,324.15733c-18.75411-9.63866-42.77137-7.75087-60.00507,4.29119A855.84532,855.84532,0,0,1,446.818,351.17434C433.53537,343.3904,423.14521,331.19475,409.45248,324.15733Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M349.26282,328.41534,345.6524,331.35c1.22123-1.02713,2.4908-1.99013,3.795-2.90144C349.3858,328.43789,349.32442,328.426,349.26282,328.41534Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M874.62436,476.477c-3.63279-4.42206-7.56046-9.05222-12.99421-10.84836l-5.07308.20009a575.43629,575.43629,0,0,0,153.26729,175.22056Q942.22437,558.76317,874.62436,476.477Z" transform="translate(-26.84086 -49.49819)" fill="#f2f2f2"/><path d="M1086.66915,698.4482c-10.56006,21.33-27.23,39.97-46.39,54.35-29.37,22.05-64.33,35.3-99.32,46.48-197.62,63.17-413.48,68.05-613.75,13.88-55.4-14.98-111.08-35.22-154.17-73.13a197.34468,197.34468,0,0,1-35.74-41.61c57.35-31.52,126.86-43.4,193.19-41.95,95.09,2.08,187.96,27.46,282.16,40.59a1102.669,1102.669,0,0,0,334.04-4.6c38.31994-6.43,77.98-14.84,115.49-4.66A95.14954,95.14954,0,0,1,1086.66915,698.4482Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><circle cx="179.31828" cy="51" r="51" fill="#ccc"/><path d="M362.30892,97.84042C348.81185,83.6816,333.13643,70.765,314.57961,63.93948a76.71521,76.71521,0,0,0-15.98633-4.01734c-.04388-.006-.08545.00287-.12909-.00067a2.35576,2.35576,0,0,0-.26965-.05292,61.5388,61.5388,0,0,0-22.84131,1.379,63.10735,63.10735,0,0,0-10.63519,3.7049,93.00467,93.00467,0,0,0-9.97943,5.65557A64.90832,64.90832,0,0,1,232.6863,78.8348a74.1877,74.1877,0,0,1-11.84406,1.16248c-3.44714.06915-6.698.1889-9.964,1.43426a23.91573,23.91573,0,0,0-14.56494,15.77051,1.55078,1.55078,0,0,0,.68933,1.694c.88349.63275,1.74476,1.35065,2.673,1.91437a8.33922,8.33922,0,0,0,2.611.71209q2.21366.46711,4.43292.90693,8.17584,1.61992,16.41962,2.86792,16.681,2.5252,33.54217,3.55755a373.48132,373.48132,0,0,0,67.51026-2.029A374.77144,374.77144,0,0,0,361.647,100.3475,1.5139,1.5139,0,0,0,362.30892,97.84042Z" transform="translate(-26.84086 -49.49819)" fill="#f0f0f0"/><path d="M208.57961,131.93948a76.71521,76.71521,0,0,0-15.98633-4.01734c-.04388-.006-.08545.00287-.12909-.00067a2.35576,2.35576,0,0,0-.26965-.05292,61.5388,61.5388,0,0,0-22.84131,1.379,63.10735,63.10735,0,0,0-10.63519,3.7049,93.00467,93.00467,0,0,0-9.97943,5.65557,64.90832,64.90832,0,0,1-22.05231,8.22681,74.1877,74.1877,0,0,1-11.84406,1.16248c-3.44714.06915-6.698.1889-9.964,1.43426a23.91573,23.91573,0,0,0-14.56494,15.77051,1.55078,1.55078,0,0,0,.68933,1.694c.88349.63275,1.74476,1.35065,2.673,1.91437a8.33922,8.33922,0,0,0,2.611.71209q2.21366.46712,4.43292.90693,8.17584,1.61992,16.41962,2.86792,16.681,2.5252,33.54217,3.55755a373.48132,373.48132,0,0,0,67.51026-2.029A374.77144,374.77144,0,0,0,255.647,168.3475a1.5139,1.5139,0,0,0,.66193-2.50708C242.81185,151.6816,227.13643,138.765,208.57961,131.93948Z" transform="translate(-26.84086 -49.49819)" fill="#f0f0f0"/><polygon points="1047.411 588.142 1074.576 567.518 1087.816 580.759 1043.563 611.042 1047.411 588.142" fill="#2f2e41"/><path d="M1048.91635,694.42781H955.99269l3.25907-10.55987,0,0c20.1993-7.31227,8.85333-23.02957,28.06751-32.63666,46.9968-23.4984,65.19118-93.62006,58.30932-121.33935l30.798-1.30221S1118.95877,649.37476,1048.91635,694.42781Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M1128.24653,644.78888a15.61893,15.61893,0,0,1-20.18272.37759l-.0604-.04961-.00207-.07767a14.96483,14.96483,0,0,0-.6-3.81936,10.69077,10.69077,0,0,1-.38818,2.64366l-.07784.28991-.20873-.21549c-.18027-.18589-.35474-.37472-.51859-.561a15.75088,15.75088,0,0,1-2.399-3.63269,45.91623,45.91623,0,0,0-12.74-15.87972,22.29237,22.29237,0,0,1-2.6727-2.57172,22.03415,22.03415,0,0,1,27.66955-33.56911l.13767.0806-.07148.1425a11.47756,11.47756,0,0,1-2.04788,2.954,14.96829,14.96829,0,0,0,3.15395-2.27865l.10006-.09436.11337.07818a22.12793,22.12793,0,0,1,4.0294,3.5867l.12844.14726a9.83643,9.83643,0,0,0,7.28375,3.36123,15.614,15.614,0,0,1,15.11947,18.29291l-.01769.10315-.10034.0304a13.39866,13.39866,0,0,1-5.45694.68088,15.22208,15.22208,0,0,0,4.86061,1.2174l.21654.01718-.06874.20619a15.6035,15.6035,0,0,1-4.50339,6.79l-.05928.05187-.06294.05509a15.3329,15.3329,0,0,0-5.297,10.64272A15.73345,15.73345,0,0,1,1128.24653,644.78888Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M1131.089,639.76934a15.57418,15.57418,0,0,1-.1756,1.67894,15.78521,15.78521,0,0,0,2.53772-7.82047c.02071-.42637.06546-.8511.12549-1.27393A14.8141,14.8141,0,0,0,1131.089,639.76934Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1136.00331,620.789a15.19815,15.19815,0,0,0,3.88418,1.09822,15.63,15.63,0,0,0,1.42322-1.73647A13.24363,13.24363,0,0,1,1136.00331,620.789Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1141.72736,615.66082a15.70907,15.70907,0,0,1-.11112,4.05194,15.52908,15.52908,0,0,0,1.75758-3.62455l.06874-.2062-.21655-.01718A15.09472,15.09472,0,0,1,1141.72736,615.66082Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1140.28241,600.83967a15.65079,15.65079,0,0,0-11.46149-5.29958,9.83649,9.83649,0,0,1-7.28378-3.36124l-.12843-.14726a22.12785,22.12785,0,0,0-4.02939-3.58669l-.11338-.07817-.10005.09434a14.9676,14.9676,0,0,1-3.154,2.27865,11.47832,11.47832,0,0,0,2.04794-2.954l.07146-.1425-.13766-.08059a22.01777,22.01777,0,0,0-32.62113,14.2542,22.02182,22.02182,0,0,1,30.259-8.11268l.13765.08059-.07145.1425a11.47814,11.47814,0,0,1-2.04794,2.954,14.96754,14.96754,0,0,0,3.154-2.27865l.10006-.09434.11338.07817a22.12857,22.12857,0,0,1,4.02939,3.5867l.12843.14725a9.83643,9.83643,0,0,0,7.28377,3.36124,15.61675,15.61675,0,0,1,15.10347,12.83488,18.92714,18.92714,0,0,0,2.26005-.55l.10034-.03039.01776-.10314A15.554,15.554,0,0,0,1140.28241,600.83967Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M1173.15913,536.54065a50.29141,50.29141,0,0,1-42.007,49.59965l-.2484.04053-.19219-.16016a48.18565,48.18565,0,0,0-10.51008-6.67159,34.42316,34.42316,0,0,1,5.5662,6.56047l.53537.80469-.96485.04641c-.8328.04053-1.66038.0608-2.45919.0608a50.71554,50.71554,0,0,1-13.88445-1.92513c-20.51748-5.83748-42.55022-6.83567-65.48571-2.96711a71.77856,71.77856,0,0,1-11.90147.993A70.94787,70.94787,0,0,1,1009.287,444.63723l.48765-.16146.19251.47589a36.95659,36.95659,0,0,1,2.787,11.23306,48.19635,48.19635,0,0,0,1.19789-12.47116l-.01536-.44255.43013-.10786a71.24939,71.24939,0,0,1,17.24051-2.1147l.62918.00262a31.67228,31.67228,0,0,0,23.616-10.46237,50.27568,50.27568,0,0,1,76.38016,2.34611l.2118.26213-.1399.30723c-2.93769,6.47484-6.13818,11.19189-9.95836,14.64143a49.01343,49.01343,0,0,0,13.27978-9.16282l.502-.487.35234.60466A50.24214,50.24214,0,0,1,1143.32,464.4278l-.00065.25363c-.00065.08956-.00065.17977-.00065.26932,0,13.61317,5.26419,26.51577,14.46689,35.43934A50.66021,50.66021,0,0,1,1173.15913,536.54065Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><g opacity="0.15"><path d="M1111.68868,417.71713a35.519,35.519,0,0,1-6.33509,7.77159,48.88929,48.88929,0,0,0,9.89823-6.1865Q1113.50228,418.44038,1111.68868,417.71713Z" transform="translate(-26.84086 -49.49819)"/><path d="M1140.79293,477.73323a50.48191,50.48191,0,0,1,7.22981,8.80775,51.39288,51.39288,0,0,1-4.70405-21.59022c0-.08957,0-.17978.00065-.26932l.00064-.25364a50.24245,50.24245,0,0,0-6.83956-25.32735l-.35235-.60468-.50207.487a49.12616,49.12616,0,0,1-9.17043,6.983A48.97185,48.97185,0,0,0,1140.79293,477.73323Z" transform="translate(-26.84086 -49.49819)"/><path d="M1126.32733,441.77093l-.00065.25364c-.00064.08954-.00064.17975-.00064.26931,0,.49355.00894.98585.02272,1.47739a52.3648,52.3648,0,0,0,5.95587-10.26709l.13985-.30725-.21176-.26212a50.68811,50.68811,0,0,0-9.096-8.79733A50.35621,50.35621,0,0,1,1126.32733,441.77093Z" transform="translate(-26.84086 -49.49819)"/><path d="M1157.78559,500.3901a45.45934,45.45934,0,0,1-6.40838-7.79666,50.2297,50.2297,0,0,1-37.21772,70.89l-.24841.04054-.19217-.16016a48.188,48.188,0,0,0-10.5101-6.67159,34.42262,34.42262,0,0,1,5.56617,6.56046l.5354.80471-.96482.0464c-.83286.04054-1.66041.0608-2.4592.0608a50.71549,50.71549,0,0,1-13.88448-1.92514c-20.51749-5.83747-42.55022-6.83566-65.4857-2.9671a71.7793,71.7793,0,0,1-11.90145.993,70.62389,70.62389,0,0,1-47.12-17.969,71.01118,71.01118,0,0,0,64.1127,40.6259,71.77947,71.77947,0,0,0,11.90145-.99294c22.93547-3.86857,44.96821-2.87037,65.4857,2.96709a50.71543,50.71543,0,0,0,13.88448,1.92514c.79878,0,1.62634-.02026,2.45919-.0608l.96483-.0464-.5354-.80471a34.42263,34.42263,0,0,0-5.56618-6.56045,48.18774,48.18774,0,0,1,10.51011,6.67159l.19217.16016.24841-.04055a50.25392,50.25392,0,0,0,26.63344-85.75019Z" transform="translate(-26.84086 -49.49819)"/></g><polygon points="134.035 560.973 97.223 533.025 79.28 550.968 139.25 592.007 134.035 560.973" fill="#2f2e41"/><path d="M195.21,687.42781h125.9266L316.72,673.11747l0,0c-27.37332-9.9093-11.99769-31.20879-38.036-44.228-63.68827-31.84414-88.3446-126.87035-79.01856-164.43447l-41.73625-1.76471S100.29113,626.37364,195.21,687.42781Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M80.55365,605.25219a20.7786,20.7786,0,0,0-7.17833-14.42261c-.0283-.02489-.05681-.05-.08529-.07465l-.08034-.0703a21.14539,21.14539,0,0,1-6.10283-9.20148l-.09315-.27942.29345-.02329a20.6283,20.6283,0,0,0,6.58691-1.64977,18.15726,18.15726,0,0,1-7.395-.9227l-.136-.0412-.024-.13979a21.15953,21.15953,0,0,1,20.48932-24.78985,13.32987,13.32987,0,0,0,9.87066-4.555l.17406-.19956a29.9868,29.9868,0,0,1,5.46049-4.86055l.15364-.106.13559.12786a20.2845,20.2845,0,0,0,4.27411,3.088,15.554,15.554,0,0,1-2.77519-4.00312l-.09688-.19312.18657-.10923A29.85984,29.85984,0,0,1,141.70818,588.318a30.209,30.209,0,0,1-3.62195,3.48511,62.224,62.224,0,0,0-17.26483,21.51959,21.34447,21.34447,0,0,1-3.251,4.92289c-.222.25244-.45848.50834-.70277.76026l-.28286.292-.10549-.39287a14.48742,14.48742,0,0,1-.526-3.58259,20.27961,20.27961,0,0,0-.813,5.17585l-.00281.10525-.08185.06724a21.15037,21.15037,0,0,1-34.50192-15.41853Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M83.85266,613.35673a21.10374,21.10374,0,0,0,.238,2.27524,21.39156,21.39156,0,0,1-3.439-10.598c-.02806-.57781-.08871-1.15339-.17006-1.72639A20.07562,20.07562,0,0,1,83.85266,613.35673Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M77.193,587.63524a20.59681,20.59681,0,0,1-5.2637,1.48826,21.18029,21.18029,0,0,1-1.92868-2.3532A17.94731,17.94731,0,0,0,77.193,587.63524Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M69.436,580.68579a21.28893,21.28893,0,0,0,.1506,5.491,21.04389,21.04389,0,0,1-2.3818-4.91186l-.09316-.27943.29346-.02329A20.4517,20.4517,0,0,0,69.436,580.68579Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M71.39415,560.60073a21.20931,21.20931,0,0,1,15.53218-7.18179,13.33,13.33,0,0,0,9.87069-4.555l.174-.19955a29.98717,29.98717,0,0,1,5.46048-4.86056l.15364-.10593.13559.12785a20.28377,20.28377,0,0,0,4.27415,3.08794,15.55474,15.55474,0,0,1-2.77529-4.00312l-.09683-.19312.18655-.10921A29.83764,29.83764,0,0,1,148.51627,561.925a29.84315,29.84315,0,0,0-41.00585-10.994l-.18655.10921.09683.19311a15.5548,15.5548,0,0,0,2.77529,4.00313,20.28412,20.28412,0,0,1-4.27415-3.08794l-.13559-.12786-.15364.10594a29.98711,29.98711,0,0,0-5.46048,4.86055l-.174.19956a13.33,13.33,0,0,1-9.87069,4.555A21.16316,21.16316,0,0,0,69.65975,579.135a25.64845,25.64845,0,0,1-3.06273-.74529l-.136-.04118-.02407-.13978A21.07824,21.07824,0,0,1,71.39415,560.60073Z" transform="translate(-26.84086 -49.49819)" opacity="0.15"/><path d="M47.67454,424.47529c12.47114-12.09289,19.605-29.578,19.605-48.026,0-.12136,0-.24361-.00089-.365l-.00088-.34372a68.08611,68.08611,0,0,1,9.26876-34.32266l.47748-.81942.68034.66a66.42122,66.42122,0,0,0,17.99625,12.41711c-5.177-4.67469-9.51414-11.06706-13.4952-19.8415l-.18957-.41636.287-.35523a68.13168,68.13168,0,0,1,103.50749-3.17935,42.9211,42.9211,0,0,0,32.00348,14.1782l.85264-.00355a96.55467,96.55467,0,0,1,23.36369,2.86576l.58289.14617-.02081.59973a65.31307,65.31307,0,0,0,1.62334,16.90044,50.08227,50.08227,0,0,1,3.77686-15.22262l.26089-.64491.66085.21881a96.14585,96.14585,0,0,1-30.24771,187.39848A97.27192,97.27192,0,0,1,202.538,534.974c-31.0813-5.24253-60.93923-3.88982-88.74374,4.02092a68.72787,68.72787,0,0,1-18.81567,2.60886c-1.08252,0-2.204-.02747-3.33261-.08239l-1.30753-.0629L91.064,540.368a46.64968,46.64968,0,0,1,7.5431-8.8905,65.29981,65.29981,0,0,0-14.24286,9.0411l-.26045.217-.33662-.05492A68.10219,68.10219,0,0,1,47.67454,424.47529Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><g opacity="0.15"><path d="M110.14328,312.44a48.13438,48.13438,0,0,0,8.58508,10.53176,66.25283,66.25283,0,0,1-13.4137-8.38371Q107.68556,313.42016,110.14328,312.44Z" transform="translate(-26.84086 -49.49819)"/><path d="M70.70231,393.77157a68.411,68.411,0,0,0-9.79756,11.93592,69.64577,69.64577,0,0,0,6.37475-29.25825c0-.12137,0-.24362-.00088-.365l-.00087-.34372a68.08661,68.08661,0,0,1,9.26871-34.32266l.4775-.81944.68039.66a66.5738,66.5738,0,0,0,12.42741,9.46305C88.97194,367.31049,82.046,382.77189,70.70231,393.77157Z" transform="translate(-26.84086 -49.49819)"/><path d="M90.30555,345.03683l.00087.34372c.00088.12134.00088.24359.00088.365,0,.66884-.01212,1.336-.0308,2.0021A70.9624,70.9624,0,0,1,82.20534,333.834l-.18953-.41637.287-.35522a68.69044,68.69044,0,0,1,12.32659-11.92181A68.24086,68.24086,0,0,0,90.30555,345.03683Z" transform="translate(-26.84086 -49.49819)"/><path d="M47.67451,424.4753a61.60525,61.60525,0,0,0,8.6844-10.56575,68.06938,68.06938,0,0,0,50.436,96.06741l.33664.05494.26042-.217a65.30253,65.30253,0,0,1,14.24289-9.04108,46.64767,46.64767,0,0,0-7.54306,8.89047l-.72556,1.09052,1.3075.06287c1.12865.05494,2.25012.08239,3.33261.08239a68.72762,68.72762,0,0,0,18.81572-2.60886c27.80451-7.91072,57.66244-9.26344,88.74372-4.0209a97.27262,97.27262,0,0,0,16.12839,1.3456,95.7069,95.7069,0,0,0,63.8553-24.35094,96.23165,96.23165,0,0,1-86.88309,55.05467A97.27245,97.27245,0,0,1,202.538,534.974c-31.08129-5.24254-60.93922-3.88982-88.74373,4.0209a68.72763,68.72763,0,0,1-18.81572,2.60887c-1.08249,0-2.204-.02746-3.33261-.0824l-1.30749-.06287L91.064,540.368a46.64834,46.64834,0,0,1,7.54306-8.89047,65.30253,65.30253,0,0,0-14.24289,9.04108l-.26042.217-.33663-.05494A68.10219,68.10219,0,0,1,47.67451,424.4753Z" transform="translate(-26.84086 -49.49819)"/></g><circle cx="460.31828" cy="185" r="5" fill="#fff"/><circle cx="834.31828" cy="305" r="3" fill="#fff"/><circle cx="892.31828" cy="170" r="3" fill="#fff"/><circle cx="355.31828" cy="80" r="3" fill="#fff"/><circle cx="325.31828" cy="201" r="3" fill="#fff"/><circle cx="179.31828" cy="170" r="3" fill="#fff"/><circle cx="696.31828" cy="195" r="3" fill="#fff"/><circle cx="1003.31828" cy="98" r="3" fill="#fff"/><path d="M328.95929,413.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C339.30268,425.75443,332.75886,420.59829,328.95929,413.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M910.95929,612.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.795,4.95494l-.13433.50325C921.30268,624.75443,914.75886,619.59829,910.95929,612.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M591.95929,449.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.795,4.95494l-.13433.50325C602.30268,461.75443,595.75886,456.59829,591.95929,449.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M287.95929,565.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C298.30268,577.75443,291.75886,572.59829,287.95929,565.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><path d="M249.95929,651.56327c-3.79958-7.035-4.33-16.25537.33531-22.74859a36.83843,36.83843,0,0,0,14.67507,20.5993c2.77181,1.88719,6.05124,3.69758,6.99947,6.914a8.23488,8.23488,0,0,1-.85864,6.04445,24.4571,24.4571,0,0,1-3.79505,4.95494l-.13433.50325C260.30268,663.75443,253.75886,658.59829,249.95929,651.56327Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/><rect x="843.31828" y="68" width="11" height="589" fill="#3f3d56"/><rect x="813.31828" y="20" width="72" height="72" rx="35.99996" fill="#ff6582"/><path d="M418.64263,424.1385c0,11.47771,12.51572,21.67823,23.99344,21.67823s17.571-10.20052,17.571-21.67823a20.78224,20.78224,0,0,0-41.56448,0Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><polygon points="398.471 484.489 437.067 483.005 439.294 442.925 394.76 442.925 398.471 484.489" fill="#ffb8b8"/><path d="M400.81364,561.4928a6.18231,6.18231,0,0,0-.36494-9.4728l7.00739-20.82235-11.03775,2.917-4.96213,19.32605a6.21581,6.21581,0,0,0,9.35743,8.05215Z" transform="translate(-26.84086 -49.49819)" fill="#ffb6b6"/><circle cx="415.75835" cy="381.62478" r="14.69804" fill="#ffb8b8"/><path d="M442.96047,429.64379l-10.73253-.28426a1.504,1.504,0,0,1-1.28014-.78738l-3.58787-6.65514a1.49783,1.49783,0,0,1,.39563-1.89138L441.79818,409.047a1.49679,1.49679,0,0,1,1.25618-.28037l11.34184,2.58422a1.499,1.499,0,0,1,1.1066,1.04314l4.4413,15.29492a1.49935,1.49935,0,0,1-1.51389,1.916l-5.5602-.27779a1.50724,1.50724,0,0,1-1.34747-1.0276l-.23052-.69867a.17342.17342,0,0,0-.338.05439,1.49974,1.49974,0,0,1-1.57346,1.4977l-1.84088-.09194a1.4954,1.4954,0,0,1-1.396-1.205l-.79385-3.99256a.1732.1732,0,0,0-.34188.01359l-.51866,4.442a1.492,1.492,0,0,1-1.48734,1.32546Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M432.2515,449.58079l19.00323.25331,6.18481,7.85346,9.95684,2.3481,2.5878,14.95427c1.29375,7.47624-.07979,12.21089-3.88076,18.77751l0,0-.45522,12.91771.503.91426a2.09364,2.09364,0,0,1-.63119,2.72267h0a4.27726,4.27726,0,0,1,.11752,2.81491l-.24528.81046s-.70783,5.66261-40.83239-.29293a3.95632,3.95632,0,0,1-3.34345-3.3986h0a2.95406,2.95406,0,0,1-.547-3.4038l.08175-.16348-.412-.48529a3.177,3.177,0,0,1-.1608-3.90659h0l-5.76652-41.25217,11.91192-3.71Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M419.16862,464.99288l-4.75684-3.94828s-4.22952,1.25013-7.18334,9.58077-13.08957,71.52656-13.08957,71.52656l11.87557-5.93778,16.8392-46.43085Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M524.81946,532.274a6.18228,6.18228,0,0,1-7.09116-6.29147l-20.54147-7.79242,9.257-6.682,18.08733,8.42424a6.21581,6.21581,0,0,1,.28831,12.34162Z" transform="translate(-26.84086 -49.49819)" fill="#ffb6b6"/><path d="M461.88061,464.63253l3.22471-5.27425s4.40655-.18456,9.89528,6.74353c2.81373,3.55161,21.04874,34.01719,21.04874,34.01719l16.86311,14.05546-13.80628,4.93081-16.27169-6.90314-18.244-30.078Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><polygon points="435.555 666.81 444.739 666.81 449.108 631.385 435.553 631.386 435.555 666.81" fill="#ffb6b6"/><polygon points="355.157 661.099 364.044 663.415 377.208 630.238 364.091 626.819 355.157 661.099" fill="#ffb6b6"/><path d="M460.11787,711.77763l14.51826-.86655v6.22026l13.80293,9.53279a3.88541,3.88541,0,0,1-2.20782,7.08274H468.9467l-2.97925-6.15279-1.16325,6.15279h-6.517Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M380.13111,705.42858l14.2674,2.8235-1.569,6.01913,10.95211,12.70615a3.88541,3.88541,0,0,1-3.923,6.29683L383.133,728.91441l-1.331-6.70531-2.67759,5.66043-6.30624-1.64381Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M383.1248,688.31931l26.92081-55.33021,2.11353-65.49091C406.33233,556.677,423.491,532.805,423.491,532.805v-9.24491l41.91852,7.90812v0a201.21489,201.21489,0,0,1,12.26151,73.06026L475.982,694.04734h.52987a3.31527,3.31527,0,1,1,0,6.63053H459.9355a3.31527,3.31527,0,1,1,0-6.63053h.4274L448.4631,580.16351l-13.83654,56.19881L401.189,688.1066a3.3069,3.3069,0,0,1-.26524,6.60379H384.34739a3.31182,3.31182,0,0,1-1.22259-6.39108Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M382.75841,426.29647c6.19395-6.05935,10.09279-14.02773,15.22255-21.01108,5.1296-6.98327,12.35472-13.3824,21.01083-13.77026a13.03786,13.03786,0,0,1,8.16579,2.129,8.30541,8.30541,0,0,1,3.60455,7.36741c.9138-2.56674,4.99718-3.1453,6.588-.93331,1.59062,2.21191-.25722,5.89893-2.98115,5.94838l-.2671-1.05666a18.24877,18.24877,0,0,1-11.80141,7.83613,2.9783,2.9783,0,0,1-3.35526-3.85425C409.59087,410.80666,412.56052,428.25234,407,436s-21.45259,6.99551-30.82907,8.7353c-9.05466,1.68-17.85857-3.34756-25.69931-8.178A38.2715,38.2715,0,0,0,382.75841,426.29647Z" transform="translate(-26.84086 -49.49819)" fill="#2f2e41"/><path d="M732.68989,636.90373,704.47275,624.455V613.75265l10.0561-.05651a7.46918,7.46918,0,0,0,7.044-5.10714l7.06437-21.19305a7.46924,7.46924,0,0,0-7.086-9.83122H704.47275v-9.959H725.913a7.46925,7.46925,0,0,0,7.27937-5.79584l4.865-21.16286a7.46923,7.46923,0,0,0-7.27937-9.14265H704.47275v-2.48975a4.97949,4.97949,0,0,0-9.959,0v2.48975H518.1566v-2.48975a4.9795,4.9795,0,0,0-9.959,0v2.48975H487.2868a7.46923,7.46923,0,0,0-7.27937,9.14265l4.865,21.16286a7.46925,7.46925,0,0,0,7.27937,5.79584H508.1976v9.959H496.51328a7.46923,7.46923,0,0,0-7.10927,9.76l7.21041,22.37711a7.46925,7.46925,0,0,0,7.15123,5.17837l4.432-.0249V624.455l-22.82269,12.44874a7.46922,7.46922,0,0,0-7.46924,7.46922v0a7.46925,7.46925,0,0,0,7.46924,7.46925H508.1976v54.77446a4.9795,4.9795,0,0,0,9.959,0V651.84222H694.51376v54.77446a4.97949,4.97949,0,0,0,9.959,0V651.84222h28.21714a7.46925,7.46925,0,0,0,7.46925-7.46925v0A7.46922,7.46922,0,0,0,732.68989,636.90373Zm-214.53329-69.298H694.51376v9.959H518.1566Zm0,56.84925v-9.65563l176.35716-.99076V624.455Z" transform="translate(-26.84086 -49.49819)" fill="#3f3d56"/></svg>',_5='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" width="855.93958" height="630.06608" viewBox="0 0 855.93958 630.06608" xmlns:xlink="http://www.w3.org/1999/xlink"><path d="M935.43234,472.55767c-3.73,43.08-22.51,84.71-49.3,119.14q-1.68,2.16-3.4,4.28-3.87,4.77-7.94,9.36-4.98,5.655-10.25,11.05005-4.29,4.43994-8.78,8.68994-3.465,3.315-7.01,6.5c-28.43,25.69-61.09,46.89-94.74,65.43005-65.67,36.17-137.65,63.56995-212.52,67.56-74.86,3.98-153.01-17.46-207.91-68.52-73.99-68.81-94.63995-183.58-64.6-280.05,19.98-64.18,60.76-122.24,116.26-160.16,55.02-37.59,124.43-54.51,190.12-43.44995,52.44-31.87006,121.09-32.48,178.1-8.89,30.42,12.59,57.72,31.31,81.67,53.93a339.34337,339.34337,0,0,1,30.72,33.23q1.455,1.785,2.88,3.6,5.97,7.545,11.55,15.4,8.01,11.265,15.21,23.03c1.32,2.16,2.63,4.33,3.91,6.52.86,1.47,1.73,2.95,2.58,4.44a.29776.29776,0,0,1,.04.1c13.31,23.41,24.19,48.39,29.86005,74.5,1,4.62,1.84,9.26,2.49,13.94v.01q.855,5.955,1.29,11.97A176.97711,176.97711,0,0,1,935.43234,472.55767Z" transform="translate(-172.03021 -134.96696)" fill="#3f3d56"/><path d="M740.07386,537.68412,591.61233,414.00627,735.84027,542.638a3.44161,3.44161,0,1,0,4.23359-4.95386Z" transform="translate(-172.03021 -134.96696)" fill="#f0f0f0" opacity="0.3"/><circle cx="227.58212" cy="250.78071" r="89" fill="#f2f2f2"/><path d="M478.61233,379.74767a80.99369,80.99369,0,0,1-81,81,81.57161,81.57161,0,0,1-27.8-4.9,81.05489,81.05489,0,1,1,108.8-76.1Z" transform="translate(-172.03021 -134.96696)" fill="#fff"/><circle cx="211.58212" cy="217.78071" r="25" fill="#e4e4e4"/><path d="M475.45236,357.27764a25.00115,25.00115,0,0,1-27.6-41.08A81.05279,81.05279,0,0,1,475.45236,357.27764Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><circle cx="252.58212" cy="271.78071" r="9" fill="#e4e4e4"/><path d="M387.61233,457.74767a9.04581,9.04581,0,0,1-.31,2.34,79.52774,79.52774,0,0,1-17.49-4.24,9.00157,9.00157,0,0,1,17.8,1.9Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><path d="M334.61233,375.74767a18.002,18.002,0,0,1-16.8,17.96,81.54773,81.54773,0,0,1,1.76-35.71A18.00026,18.00026,0,0,1,334.61233,375.74767Z" transform="translate(-172.03021 -134.96696)" fill="#f2f2f2"/><circle cx="606.45653" cy="208.48305" r="3.70234" fill="#6c63ff"/><circle cx="572.30231" cy="119.94851" r="2.16307" fill="#f0f0f0"/><circle cx="225.30231" cy="543.94851" r="2.16307" fill="#f0f0f0"/><circle cx="584.58144" cy="331.59402" r="2.16307" fill="#f0f0f0"/><circle cx="305.45653" cy="350.48305" r="3.70234" fill="#6c63ff"/><circle cx="171.45653" cy="416.48305" r="17.48305" fill="#6c63ff"/><circle cx="267.30231" cy="435.94851" r="2.16307" fill="#f0f0f0"/><circle cx="487.30231" cy="97.94851" r="2.16307" fill="#f0f0f0"/><circle cx="358.30231" cy="558.94851" r="2.16307" fill="#f0f0f0"/><circle cx="326.30231" cy="117.94851" r="2.16307" fill="#f0f0f0"/><circle cx="382.30231" cy="222.94851" r="2.16307" fill="#f0f0f0"/><circle cx="296.58144" cy="480.59402" r="2.16307" fill="#f0f0f0"/><circle cx="549.58144" cy="494.59402" r="2.16307" fill="#f0f0f0"/><circle cx="437.58144" cy="368.59402" r="2.16307" fill="#f0f0f0"/><circle cx="494.58144" cy="222.59402" r="2.16307" fill="#f0f0f0"/><circle cx="598.21204" cy="292.65473" r="4.28889" fill="#ff6584"/><circle cx="424.21204" cy="150.65473" r="4.28889" fill="#ff6584"/><circle cx="424.21204" cy="445.65473" r="4.28889" fill="#ff6584"/><path d="M863.45236,605.33764a7.694,7.694,0,0,0-7.39,5.58,7.3896,7.3896,0,0,0-.3,2.12v12.04q4.485-4.24494,8.78-8.68994,5.265-5.40006,10.25-11.05005Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><path d="M890.68118,667.89806q-19.36816,0-42.45654-1.46386c-79.61377-5.05567-182.7378-22.63282-290.376-49.49219-107.6377-26.85938-206.93018-59.79395-279.58545-92.73438-35.39258-16.04687-62.55615-31.23632-80.73535-45.14746-19.24707-14.72705-27.666-27.564-25.02393-38.15283,5.148-20.62891,50.731-25.14209,88.064-25.29541l.01269,3c-51.26806.21045-81.51367,8.38672-85.16552,23.022-4.65186,18.64014,33.28662,47.74073,104.08691,79.84131,72.49561,32.86817,171.60547,65.73926,279.07324,92.55664,107.46729,26.81641,210.40137,44.36328,289.83985,49.40821,77.57861,4.92773,124.74316-2.9375,129.39453-21.57813,3.86181-15.47656-21.59815-38.27539-71.68946-64.19824l1.37891-2.66406c36.397,18.83593,78.64551,45.85156,73.22168,67.58886-2.64258,10.58887-16.10547,17.96485-40.01514,21.92285C927.0762,666.7672,910.33548,667.89806,890.68118,667.89806Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><circle cx="714.58212" cy="208.78071" r="100.5" fill="#fff"/><path d="M886.61233,241.74767a102,102,0,1,0,102,102A101.635,101.635,0,0,0,886.61233,241.74767Zm0,201a99,99,0,1,1,99-99A98.61767,98.61767,0,0,1,886.61233,442.74767Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M798.417,367.81847a2.00078,2.00078,0,0,1-1.957-1.59765,97.66924,97.66924,0,0,1,22.34082-83.13526,2,2,0,0,1,2.98633,2.66114A93.59682,93.59682,0,0,0,800.378,365.41515a2.00228,2.00228,0,0,1-1.96094,2.40332Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><circle cx="714.51924" cy="238.27373" r="63.87702" fill="#6c63ff"/><path d="M866.24805,397.35666c-4.14062-.115-9.29385-.25869-13.26384-3.15874a10.18618,10.18618,0,0,1-4.00806-7.60607,6.85213,6.85213,0,0,1,2.33007-5.62763c2.07352-1.75216,5.10139-2.16313,8.36441-1.2042l-3.38076-24.7061,2.48174-.34,3.97444,29.04518-2.07245-.951c-2.4027-1.10205-5.70088-1.66285-7.7504.06911a4.40263,4.40263,0,0,0-1.44375,3.62659,7.69887,7.69887,0,0,0,2.98246,5.67107c3.08949,2.25668,7.19708,2.54779,11.85585,2.678Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><rect x="658.49493" y="222.21767" width="13.49133" height="2.50498" fill="#2f2e41"/><rect x="701.07961" y="222.21765" width="13.49133" height="2.50498" fill="#2f2e41"/><path d="M889.23233,452.90765h-57.9a8.14716,8.14716,0,0,0-8.13995,8.14v128.33a47.66955,47.66955,0,0,0,25.56,42.19995q3.555-3.18,7.01-6.5,4.485-4.24494,8.78-8.68994,5.265-5.40006,10.25-11.05005,4.08006-4.59,7.94-9.36,1.725-2.115,3.4-4.28c26.79-34.43,45.57-76.06,49.3-119.14A64.04854,64.04854,0,0,0,889.23233,452.90765Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M891.34231,479.68767a14.61136,14.61136,0,0,0-10.43-4.17,14.465,14.465,0,0,0-9.16,3.36005,13.12263,13.12263,0,0,0-1.17,1.07l-47.38995,48.6-34.37,35.25a6.80061,6.80061,0,0,0-1.28,1.8,7.29573,7.29573,0,0,0-.77,3.32,7.16751,7.16751,0,0,0,2.18006,5.07l1.35,1.32,9.8,9.55.01-.01a7.29073,7.29073,0,0,0,4.66,1.63,7.167,7.167,0,0,0,5.07-2.18l1.59-1.62,11.38-11.67.38-.39,68.41-70.16a14.69128,14.69128,0,0,0-.26-20.77Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><path d="M890.86152,343.44c2.1124-4.46658-.05349-9.23761-3.76378-12.09072-4.67557-3.59539-10.7221-3.00085-16.04008-1.29905-5.82238,1.8632-11.51366,5.21608-17.80383,5.02337a11.13058,11.13058,0,0,1-10.24407-7.27764c-3.3687-8.639.43561-18.29488,6.29971-24.84681a34.26766,34.26766,0,0,1,26.544-11.586,34.64989,34.64989,0,0,1,28.068,16.9026,1.54079,1.54079,0,0,0,2.05229.53813,36.88225,36.88225,0,0,1,28.39377-.71432,36.28984,36.28984,0,0,1,22.58042,34.49188c-.05,1.93122,2.95005,1.9301,3,0a39.89155,39.89155,0,0,0-10.59928-27.81249,38.71871,38.71871,0,0,0-27.56681-12.16772,39.33641,39.33641,0,0,0-17.32226,3.61223l2.05229.53813a37.69886,37.69886,0,0,0-25.0988-17.728,36.48542,36.48542,0,0,0-29.42384,7.32772c-7.70165,6.02707-13.53849,15.38016-13.17519,25.41071.15721,4.34047,1.44713,8.796,4.4606,12.03051,3.85981,4.14287,9.62229,4.85944,14.94631,3.798,7.07554-1.41071,13.53533-6.06449,20.91133-5.92113a10.21164,10.21164,0,0,1,7.6417,3.4453c1.62455,1.83335,2.6042,4.47042,1.49716,6.81122-.82094,1.73585,1.76463,3.26026,2.59041,1.51416Z" transform="translate(-172.03021 -134.96696)" fill="#2f2e41"/><path d="M412.09426,704.32287c-35.59912.001-68.69433-1.22071-98.32226-3.68555-38.72656-3.22266-69.41455-8.40332-91.21045-15.39648-23.07666-7.40528-35.31934-16.667-36.38818-27.52832-2.083-21.15821,39.334-40.72461,74.44531-53.41309l1.01953,2.82227c-48.2168,17.42382-73.957,35.28613-72.47949,50.29785,1.88183,19.11914,47.39209,33.78125,124.86181,40.22754,79.3252,6.60058,183.71729,4.26172,293.94727-6.58985,110.23-10.84863,213.07568-28.90625,289.59131-50.8457,74.72607-21.42578,116.50488-44.67969,114.623-63.79883-1.5625-15.874-33.20264-28.793-89.0918-36.3789l.40332-2.97266c40.60986,5.51172,89.47949,16.76172,91.67383,39.05762,1.06933,10.86132-9.1333,22.332-30.32276,34.09375-20.01465,11.10937-49.10351,22.17285-86.45849,32.88281-76.68506,21.98828-179.71973,40.08105-290.12451,50.94824C539.00247,700.86,472.01663,704.32287,412.09426,704.32287Z" transform="translate(-172.03021 -134.96696)" fill="#6c63ff"/><circle cx="838.45653" cy="434.48305" r="17.48305" fill="#6c63ff"/><circle cx="331.45653" cy="17.48305" r="17.48305" fill="#e6e6e6"/><circle cx="19.45653" cy="433.48305" r="17.48305" fill="#e6e6e6"/><circle cx="127.45653" cy="108.48305" r="10.70234" fill="#ff6584"/><circle cx="77.45653" cy="514.48305" r="10.70234" fill="#ff6584"/><circle cx="807.45653" cy="339.48305" r="10.70234" fill="#ff6584"/><circle cx="645.45653" cy="598.48305" r="17.48305" fill="#e6e6e6"/></svg>',QD=(e,t)=>{const n=window.atob(e),r=new ArrayBuffer(n.length),a=new Uint8Array(r);for(let o=0;o<n.length;o++)a[o]=n.charCodeAt(o);return new Blob([r],{type:t})},H5=async e=>{const{vault:t}=Xe.getState().app,n=await t.adapter.readBinary(e),r=new Uint8Array(n),a=new Blob([r],{type:"image/png"});return new Promise(o=>{const s=new FileReader;s.onloadend=()=>{const c=s.result;o(c)},s.readAsDataURL(a)})},Y5=async e=>{const t=e.find(".thino-user-icon");if(t){const n=await Uh(t);t.style.backgroundImage=`url(${n})`}},z5=async()=>{const{app:e,settings:t}=Xe.getState();let n,r;const a=document.body.hasClass("theme-light"),o=a?t==null?void 0:t.DefaultLightBackgroundImage:t==null?void 0:t.DefaultDarkBackgroundImage,s=await e.vault.adapter.exists(t==null?void 0:t.DefaultLightBackgroundImage)&&/\.(png|svg|jpg|jpeg)/g.test(t==null?void 0:t.DefaultLightBackgroundImage),c=o==null?void 0:o.startsWith("http");s||c?(r=o,n=c?await xd(o):await H5(r)):n="data:image/svg+xml;base64,"+btoa(a?B5:_5);const d=document.querySelector(".dialog-wrapper .memo-background .property-image");d.style.backgroundImage="url('"+n+"')",document.body.className.contains("theme-dark")&&(d.style.backgroundColor="#1f1f1f")},U5=e=>{const{memo:t,destroy:n}=e,{memos:r}=Ee.getState().memoState,{view:a,app:o,settings:s}=Ee.getState().dailyNotesState,c={...t,createdAtStr:Ue.getDateTimeString(t.createdAt)},[d,p]=A.useState(!1),[m,g]=A.useState(c.content),[v,D]=A.useState(!1),S=A.useRef(null),T=A.useRef(null),E=A.useRef(null),[O,k]=A.useState(""),j=A.useRef(null),F=A.useRef(null);let B,R;r.length&&(B=r.length>0?r[r.length-1]:null,B?R=r?Math.ceil((Date.now()-Ue.getTimeStampByDate(B==null?void 0:B.createdAt))/1e3/3600/24)+1:0:R=0),s==null||s.ShareFooterEnd.replace("{UserName}",s==null?void 0:s.UserName);const z=s==null?void 0:s.ShareFooterStart.replace("{ThinoNum}",r.length.toString()).replace("{UsedDay}",R.toString());A.useEffect(()=>{!S.current||!T.current||(C.setIcon(S.current,"copy"),C.setIcon(T.current,"x"))},[S,T]),A.useEffect(()=>{E.current&&C.setIcon(E.current,"file-down")},[E]),A.useEffect(()=>{C.setIcon(S.current,v?"loader":"copy"),S.current.disabled=v,S.current.toggleClass("copying",v)},[v]),A.useEffect(()=>{if(!F.current||!a||d)return;g(t.content),F.current.hasChildNodes()&&F.current.empty();async function Q(){var le;(le=F.current)==null||le.toggleClass(["markdown-rendered"],!0),await C.MarkdownRenderer.render(o,t.content+`
`,F.current,t.path,a)}Q(),setTimeout(async()=>{if(await z5(),await Y5(j.current),!j.current)return;let le;document.body.hasClass("theme-dark")?le="#727171":le="#eaeaea",Zy(j.current,{backgroundColor:le,pixelRatio:window.devicePixelRatio*2}).then(pe=>{k(pe),p(!0)}).catch(()=>{})},MI)},[j,F,c]);const H=()=>{n()},Y=A.useCallback(Q=>{D(Q)},[v]),U=async()=>{const{vault:Q}=Ee.getState().dailyNotesState.app,le=j.current.querySelector(".memo-shortcut-img");if(!le)return;const pe=le==null?void 0:le.getAttribute("src").split("base64,")[1],ie=QD(pe,"image/png");let se;ie.arrayBuffer().then(async fe=>{const oe="png",we=bs();for(const Z in we)if(we[Z]instanceof C.TFile){se=we[Z];break}if(se!==void 0){const Z=await Q.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,oe,se);await Q.createBinary(Z,fe),new C.Notice(N("Save image successfully"))}})},J=async()=>{Y(!0);const Q=j.current.querySelector(".memo-shortcut-img");if(!Q)return;const le=Q==null?void 0:Q.getAttribute("src").split("base64,")[1],pe=QD(le,"image/png");if(!pe){new C.Notice("Copy to clipboard failed");return}const ie=new ClipboardItem({"image/png":pe});window.navigator.clipboard.write([ie]).then(()=>{setTimeout(()=>{Y(!1)},500)}),new C.Notice("Copy to clipboard successfully")};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"dialog-header-container",children:[w.jsxs("p",{className:"title-text",children:[w.jsx("span",{className:"icon-text",children:"🥰"}),N("Share Memo Image")]}),w.jsxs("div",{className:"btn-group",children:[C.Platform.isMobile&&w.jsx("button",{ref:E,className:"btn download-btn",onClick:U}),w.jsx("button",{ref:S,className:"btn copy-btn",onClick:J}),w.jsx("button",{ref:T,className:"btn close-btn",onClick:H})]})]}),w.jsxs("div",{className:"dialog-content-container",children:[w.jsx("div",{className:`tip-words-container ${O?"finish":"loading"}`,children:w.jsx("p",{className:"tip-text",children:N(O?"↗Click the button to save":"Image is generating...")})}),w.jsxs("div",{className:"memo-container",ref:j,children:[w.jsx(so,{when:O!=="",children:w.jsx("img",{className:"memo-shortcut-img",onClick:J,src:O})}),w.jsxs("div",{className:"memo-background",children:[w.jsx("div",{className:"property-image",style:{backgroundSize:"cover",backgroundRepeat:"no-repeat",backgroundPosition:"center"}}),w.jsx("span",{className:"background-container"}),w.jsxs("div",{className:"thino-user-header",children:[w.jsx("div",{className:"thino-user-icon",ref:Q=>{if(s!=null&&s.MomentsIcon){Q==null||Q.empty();return}s!=null&&s.MomentsIcon||Q&&C.setIcon(Q,"Memos")},style:{backgroundImage:`url(${s==null?void 0:s.MomentsIcon})`}}),w.jsxs("div",{className:"thino-user-info",children:[w.jsx("div",{className:"thino-user-name",children:s==null?void 0:s.UserName}),(s==null?void 0:s.MomentsQuote)&&w.jsx("div",{className:"thino-user-quote",children:s==null?void 0:s.MomentsQuote})]})]}),w.jsx("div",{ref:F,className:"memo-content-text"}),w.jsx("div",{className:"thino-time-footer",children:c.createdAt}),w.jsxs("div",{className:"watermark-container",children:[w.jsxs("span",{className:"normal-text footer-start",children:[w.jsx("div",{className:"property-social-icons"}),w.jsx("span",{className:"name-text",children:z})]}),w.jsx("span",{className:"normal-text footer-end",children:w.jsx("span",{className:"name-text",children:"THINO"})})]})]})]})]})]})};function V5(e){By({className:"share-memo-image-dialog"},U5,{memo:e})}const Z5=A.forwardRef((e,t)=>{const{memo:n,handlePinMemoClick:r,handleFixMemoClick:a,handleSourceMemoClick:o,handleShowMemoStoryDialog:s,handleCopyMemoClick:c,handleEditMemoClick:d,handleGenMemoImageBtnClick:p,handleMarkMemoClick:m,handleArchiveMemo:g,handleDeleteMemoClick:v}=e,D=A.useRef(null),S=Ee.getState().dailyNotesState.settings,[T,E]=ki(!1),O=A.useRef(null),k={pinRef:A.useRef(null),fixRef:A.useRef(null),typeRef:A.useRef(null),moreRef:A.useRef(null)},j={copy:A.useRef(null),read:A.useRef(null),mark:A.useRef(null),share:A.useRef(null),edit:A.useRef(null),source:A.useRef(null),archive:A.useRef(null),delete:A.useRef(null)};return A.useEffect(()=>{O.current&&(C.setIcon(j.copy.current,"copy"),C.setIcon(j.read.current,"book-open"),C.setIcon(j.mark.current,"bookmark"),C.setIcon(j.share.current,"share-2"),C.setIcon(j.edit.current,"pencil"),C.setIcon(j.source.current,"home"),C.setIcon(j.archive.current,"archive"),C.setIcon(j.delete.current,"trash"))},[O]),A.useEffect(()=>{if(!k.typeRef)return;const F=tp.find(B=>B.title===n.sourceType);C.setIcon(k.typeRef.current,F.icon),C.requireApiVersion("1.4.4")&&C.setTooltip(k.typeRef.current,n.path),k.fixRef&&(C.setIcon(k.fixRef.current,"shield-alert"),C.requireApiVersion("1.4.4")&&C.setTooltip(k.fixRef.current,"Update Thino property"))},[k.typeRef]),A.useEffect(()=>{k.pinRef&&(n.pinned?(C.setIcon(k.pinRef.current,"pin-off"),C.requireApiVersion("1.4.4")&&C.setTooltip(k.pinRef.current,N("UNPIN"))):(C.setIcon(k.pinRef.current,"pin"),C.requireApiVersion("1.4.4")&&C.setTooltip(k.pinRef.current,N("PIN"))))},[k.pinRef,n.pinned]),A.useImperativeHandle(t,()=>({toggleConfirm:F=>E(F),confirmStatus:T})),w.jsx("div",{ref:O,className:"memo-top-right-wrapper",children:w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{ref:k.fixRef,className:`btn ${n.sourceType!=="MULTI"||n.id!==""?"hidden":""} fix-memo-btn`,onClick:()=>a(n)}),w.jsx("span",{ref:k.typeRef,className:`btn ${n.sourceType==="DAILY"?"hidden":""} source-type-btn`,onClick:()=>o(n)}),w.jsx("span",{ref:k.pinRef,className:`btn ${e.memo.pinned?"pinned-btn":"unpinned-btn"} pro`,onClick:r}),w.jsx("span",{ref:F=>{k.moreRef.current=F,F&&C.setIcon(F,"more-horizontal")},className:"btn more-action-btn"}),w.jsx("div",{ref:D,className:"more-action-btns-wrapper",children:w.jsxs("div",{className:"more-action-btns-container",children:[w.jsxs("div",{className:"more-action-btn-group more-action-menu-item",children:[w.jsx("span",{ref:j.copy,className:"more-action-item-icon",onClick:c}),w.jsx("span",{ref:j.edit,className:"more-action-item-icon",onClick:d}),w.jsx("span",{ref:j.share,className:"more-action-item-icon",onClick:p})]}),w.jsx("hr",{className:"menu-hr"}),w.jsxs("div",{className:"more-action-menu-item",onClick:s,children:[w.jsx("span",{ref:j.read,className:"more-action-item-icon"}),w.jsx("span",{className:"btn",children:N("READ")})]}),w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:j.mark,className:"more-action-item-icon"}),w.jsx("span",{className:"btn",onClick:m,children:N("MARK")})]}),w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:j.source,className:"more-action-item-icon"}),w.jsx("span",{className:"btn",onClick:()=>o(n),children:N("SOURCE")})]}),w.jsx("hr",{className:"menu-hr"}),w.jsxs("div",{className:"more-action-menu-item archive-menu-item",children:[w.jsx("span",{ref:j.archive,className:"more-action-item-icon"}),w.jsx("span",{className:"btn delete-btn",onClick:()=>g(n),children:N("ARCHIVE").toUpperCase()})]}),w.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[w.jsx("span",{ref:j.delete,className:"more-action-item-icon"}),w.jsx("span",{className:`btn delete-btn ${T?"final-confirm":""}`,onClick:async F=>{F.stopPropagation(),F.preventDefault(),await v(F)},children:T?N("CONFIRM"):S.DeleteThinoDirectly?N("DELETE"):N("Recycle bin").toUpperCase()})]}),w.jsx("hr",{className:"menu-hr"}),w.jsx("div",{className:"text-count-item more-action-menu-item",children:w.jsx("span",{className:"btn text-count-btn",children:Ue.getWordCount(n.content.replace(/```[^\S\r\n]*[a-z]*\n.*?\n```/g,""))+` ${N("words")}`})})]})})]})})}),W5=e=>{const{memo:t,handleMemoTypeToggle:n,handleShowMemoStoryDialog:r,settings:a}=e;return w.jsxs("div",{className:"memo-top-left-wrapper",children:[e.children,w.jsx("span",{title:t.createdAt,className:"time-text",onClick:r,children:t.createdAt}),w.jsx("div",{className:`btn memo-type-img ${a!=null&&a.ShowTaskLabel?"":"hidden"}`,onClick:n,children:t.thinoType!=="JOURNAL"&&w.jsx("input",{className:"task-list-item-checkbox",type:"checkbox",checked:t.thinoType!=="TASK-TODO","data-task":t.thinoType==="TASK-TODO"?"":t.thinoType==="TASK-DONE"?"x":t.thinoType.slice(5)})})]})},$5=async(e,t,n)=>{const r=n.getAttribute("href"),a=n.className;if(a.contains("tag"))G5(n.innerText.slice(1));else if(a.contains("internal-link")){const o=n.getAttribute("data-href"),s=Te.getMemoById(o??"");s?$d(s):await e.workspace.openLinkText(o,o,!C.Platform.isMobile&&t.navigation!==!0)}else r&&window.open(r,"_blank")},G5=e=>{const t=He.getState().query.tag;He.setTagQuery(t.contains(",")?t.split(",").includes(e)?t.split(",").filter(n=>n!==e).join(","):t+","+e:t===e?"":e)},q5=(e,t)=>{const n=t==null?void 0:t.getAttribute("src"),r=t==null?void 0:t.parentElement.getAttribute("src"),a=[...(e==null?void 0:e.querySelectorAll("img"))||[]],o=a.indexOf(t);Wy({imgUrl:n,filepath:n.startsWith("app")?r:void 0,otherIMGEls:a,currentIndex:o})},J5=e=>{var r;const t=(r=e.dataset)==null?void 0:r.value,n=Te.getMemoById(t??"");n?$d(n):(new C.Notice("Thino Not Found"),e.classList.remove("memo-link-text"))},K5=async(e,t,n)=>{var o;const r=((o=n.parentElement.dataset)==null?void 0:o.task)==="x"?"DONE":"TODO",a=[...(t==null?void 0:t.querySelectorAll("li.task-list-item"))||[]];for(const s of a)if(s===n||s===n.closest("li.task-list-item")){const c=a.indexOf(s),d=e.content.split(/\n/),p=[];for(let S=0;S<d.length;S++)(d[S].trim().startsWith("- [ ]")||d[S].trim().startsWith("- [x]"))&&p.push(S);const m=p[c],v=d[m].replace(/- \[ \] |- \[x\] /g,r==="TODO"?"- [x] ":"- [ ] ");d[m]=v;const D=d.join(`
`).trim();if(e&&e.content!==D){const S=await Te.updateMemo(e.id,D);Te.editMemo(S)}}},Q5=e=>{const{globalState:{editMemoId:t},dailyNotesState:{app:n,view:r,settings:a,verifyState:o},locationState:{pathname:s}}=A.useContext(mt),{memo:c,type:d="inline"}=e,p=A.useRef(null),m=A.useRef(null),[g,v]=A.useState(!1);A.useEffect(()=>{g&&setTimeout(()=>{Qe.setEditMemoId(c.id)},100)},[g]),A.useEffect(()=>{(s==="/review"||s==="/daily")&&t!==c.id&&g&&v(!1)},[t]);const D=()=>{$d(c)},S=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}Qe.setMarkMemoId(c.id)},T=async()=>{var fe;const ie=!C.Platform.isDesktop&&await((fe=window.Capacitor)==null?void 0:fe.Plugins.Device.getId()),se=C.Platform.isDesktop?await vn():ie.identifier||ie.uuid;if(!o||(o==null?void 0:o.appId)!==se){qt();return}c.pinned?await Te.unpinMemoById(c.id):await Te.pinMemoById(c.id)},E=()=>{if(a!=null&&a.UseButtonToShowEditor&&(a==null?void 0:a.DefaultEditorLocation)==="Bottom"&&C.Platform.isMobile){const ie=document.querySelector("div[data-type='thino_view'] .view-content .memo-show-editor-button:not(.hidden)");ie&&ie.trigger("click")}(s==="/review"||s==="/daily")&&v(!0),s!=="/review"&&s!=="/daily"&&Qe.setEditMemoId(c.id)},O=async ie=>{ie.sourceType==="MULTI"&&ie.id.trim()===""&&await Te.updateMemoProperty(ie)},k=async ie=>{await Te.openThinoByID(ie.id)},j=async ie=>{try{const se=await Te.archiveMemo(ie);se&&Te.editMemo(se)}catch(se){console.error(se),new C.Notice(se.message)}},F=async(ie,se)=>{if(!se&&m.current&&!m.current.confirmStatus){m.current&&m.current.toggleConfirm();return}try{if(a.DeleteThinoDirectly)await Te.deleteMemoById(c.id);else{const fe=await Te.hideMemoById(c.id);fe&&Te.editMemo(fe)}}catch(fe){new C.Notice(fe.message)}Qe.getState().editMemoId===c.id&&Qe.setEditMemoId("")},B=()=>{if(m.current&&!m.current.confirmStatus){m.current&&m.current.toggleConfirm(!1);return}},R=()=>{V5(c)},z=async()=>{const ie=await Te.updateMemo(c.id,c.content,c.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");ie&&Te.editMemo(ie)},H=async ie=>{ie.stopPropagation(),navigator.clipboard.writeText(c.content).then(()=>{new C.Notice(N("COPY SUCCEED"))}).catch(()=>{new C.Notice(N("COPY FAILED"))})},Y=ie=>{ie&&ie.target.tagName!=="INPUT"&&E()},U=async(ie,se)=>{ie.preventDefault(),ie.stopPropagation();const fe=ie.target;if(ie.ctrlKey||ie.metaKey){await k(se);return}if(fe.tagName==="A"){await $5(n,r,fe);return}if(fe.tagName==="IMG"){q5(p.current,fe);return}if(fe.tagName==="A"&&fe.getAttribute("href")){const oe=fe.getAttribute("href");window.open(oe,"_blank");return}if(fe.className==="memo-link-text"){J5(fe);return}if(fe.tagName==="INPUT"&&fe.hasClass("task-list-item-checkbox")){await K5(se,p.current,fe);return}},J=ie=>{const se=new C.Menu;se.dom.toggleClass("memo-context-menu",!0);const fe=window.getSelection();(fe==null?void 0:fe.toString().length)>0&&se.addItem(oe=>{oe.setIcon("copy").setTitle(N("Copy selected text")).onClick(()=>{navigator.clipboard.writeText(fe.toString()).then(()=>{new C.Notice(N("COPY SUCCEED"))}).catch(()=>{new C.Notice(N("COPY FAILED"))})})}).addSeparator(),se.addItem(oe=>{oe.setIcon("copy").setTitle(N("Copy thino").toLocaleUpperCase()).onClick(async we=>{await H(we),se.close()})}).addItem(oe=>{oe.setIcon("book-open").setTitle(N("READ")).onClick(D)}).addItem(oe=>{oe.setIcon(c.pinned?"pin-off":"pin").setTitle(c.pinned?N("UNPIN"):N("PIN")).onClick(T)}).addItem(oe=>{oe.setIcon("bookmark").setTitle(N("MARK")).onClick(S)}).addItem(oe=>{oe.setIcon("share-2").setTitle(N("SHARE")).onClick(R)}).addItem(oe=>{oe.setIcon("pencil").setTitle(N("EDIT")).onClick(E)}).addItem(oe=>{oe.setIcon("home").setTitle(N("SOURCE")).onClick(()=>k(c))}).addSeparator().addItem(oe=>{oe.setIcon("archive").setTitle(N("ARCHIVE").toLocaleUpperCase()).onClick(()=>j(c))}).addItem(oe=>{oe.setIcon("trash").setTitle(N("DELETE")).onClick(async we=>{await F(we,!0)})}),se.showAtMouseEvent(ie.nativeEvent)},Q=A.useMemo(()=>({memo:c,handlePinMemoClick:T,handleFixMemoClick:O,handleSourceMemoClick:k,handleArchiveMemo:j,handleDeleteMemoClick:F,handleGenMemoImageBtnClick:R,handleMarkMemoClick:S,handleEditMemoClick:E,handleCopyMemoClick:H,handleShowMemoStoryDialog:D}),[c]),le=A.useMemo(()=>({memo:c,handleMemoTypeToggle:z,handleShowMemoStoryDialog:D,settings:a}),[c,a]),pe=A.useMemo(()=>w.jsxs("div",{ref:p,className:`memo-wrapper ${c.pinned?"pinned":""}`,"data-source-type":c.sourceType,"data-thino-type":c.thinoType,"data-thino-id":c.id,onMouseLeave:B,onMouseOver:ie=>{ie.shiftKey&&(ie.stopPropagation(),n.workspace.trigger("hover-link",{event:ie,source:"thino",hoverParent:r.containerEl,targetEl:p.current,linktext:c.path,sourcePath:c.path,state:{scroll:c.sourceType==="DAILY"?parseInt(c.id.slice(14)):0}}))},onContextMenu:J,children:[g&&w.jsx(Nu,{editorType:"inline"}),!g&&w.jsxs(w.Fragment,{children:[d==="inline"&&w.jsxs("div",{className:"memo-top-wrapper",draggable:!0,onDragStart:ie=>{ie.target.classList.add("dragging"),ie.dataTransfer.setDragImage(p.current,0,0),ie.dataTransfer.setData("text/plain",c.content)},onDragEnd:ie=>{ie.target.classList.remove("dragging")},children:[w.jsx(W5,{...le}),w.jsx(Z5,{ref:m,...Q})]}),w.jsx(bE,{memo:c,handleMemoContentClick:U,handleMemoDoubleClick:Y})]})]}),[c,g]);return w.jsx(w.Fragment,{children:pe})},Sa=A.memo(Q5);function X5(e,t){if(e==null)return{};var n=eF(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function eF(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function my(){return my=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},my.apply(this,arguments)}function XD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Lh(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?XD(Object(n),!0).forEach(function(r){tF(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XD(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function tF(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const nF={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0},j0=2;class gy extends $.Component{constructor(t){super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this);let n;this.props.breakpointCols&&this.props.breakpointCols.default?n=this.props.breakpointCols.default:n=parseInt(this.props.breakpointCols)||j0,this.state={columnCount:n}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){if(!window||!window.requestAnimationFrame){this.reCalculateColumnCount();return}window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame(()=>{this.reCalculateColumnCount()})}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let n=this.props.breakpointCols;typeof n!="object"&&(n={default:parseInt(n)||j0});let r=1/0,a=n.default||j0;for(let o in n){const s=parseInt(o);s>0&&t<=s&&s<r&&(r=s,a=n[o])}a=Math.max(1,parseInt(a)||1),this.state.columnCount!==a&&this.setState({columnCount:a})}itemsInColumns(){const t=this.state.columnCount,n=new Array(t),r=$.Children.toArray(this.props.children);for(let a=0;a<r.length;a++){const o=a%t;n[o]||(n[o]=[]),n[o].push(r[a])}return n}renderColumns(){const{column:t,columnAttrs:n={},columnClassName:r}=this.props,a=this.itemsInColumns(),o=`${100/a.length}%`;let s=r;s&&typeof s!="string"&&(this.logDeprecated('The property "columnClassName" requires a string'),typeof s>"u"&&(s="my-masonry-grid_column"));const c=Lh(Lh(Lh({},t),n),{},{style:Lh(Lh({},n.style),{},{width:o}),className:s});return a.map((d,p)=>$.createElement("div",my({},c,{key:p}),d))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:n,breakpointCols:r,columnClassName:a,columnAttrs:o,column:s,className:c}=t,d=X5(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let p=c;return typeof c!="string"&&(this.logDeprecated('The property "className" requires a string'),typeof c>"u"&&(p="my-masonry-grid")),$.createElement("div",my({},d,{className:p}),this.renderColumns())}}gy.defaultProps=nF;const Ow=e=>{const t=Ee.getState().dailyNotesState.settings,{thinos:n,dayMark:r,dayMarkRange:a="day",thinoWrapper:o}=e,[s,c]=$.useState(!(t!=null&&t.hidePinnedGroup&&r==="PINNED")),d=$.useRef(null);A.useEffect(()=>{d&&C.setTooltip&&C.setTooltip(d.current,N("Click to expand or fold, Cmd+Click to show all thinos of the day"))},[d]);const p=g=>{if(C.Keymap.isModifier(g.nativeEvent,"Mod")){const v={day:"YYYY-MM-DD",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]Q",year:"YYYY"},D=C.moment(r,v[a]);He.setFromAndToQuery(D.startOf(a).valueOf(),D.endOf(a).valueOf());return}c(!s)},m=A.useMemo(()=>w.jsx(w.Fragment,{children:e.type==="list"?w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:d,className:`day-mark ${s?"":"folded"} PINNED`,onClick:p,children:w.jsxs("span",{className:"day-mark-text",children:[s?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),s&&n.map((g,v)=>o?o({thino:g}):w.jsx(Sa,{memo:g},`${g.id}-${C.moment(g.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${v}`))]}):w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:d,className:`day-mark ${s?"":"folded"}`,onClick:p,children:w.jsxs("span",{className:"day-mark-text",children:[s?"▼ ":"▶ ",r==="PINNED"?r+" 📌":r]})},r),w.jsx(gy,{breakpointCols:e.type==="waterfall"?3:1,className:`${e.type}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:s&&n.map((g,v)=>o?o({thino:g}):w.jsx(Sa,{memo:g},`${g.id}-${C.moment(g.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${v}`))})]})}),[n,s]);return w.jsx(w.Fragment,{children:m})};function gs(e){"@babel/helpers - typeof";return gs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},gs(e)}function rF(e,t){if(gs(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(gs(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function DE(e){var t=rF(e,"string");return gs(t)=="symbol"?t:String(t)}function Iu(e,t,n){return t=DE(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function eS(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function rn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?eS(Object(n),!0).forEach(function(r){Iu(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):eS(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function $y(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}function Fi(e,t){if(e==null)return{};var n=$y(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a<o.length;a++)r=o[a],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function gr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function tS(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,DE(r.key),r)}}function yr(e,t,n){return t&&tS(e.prototype,t),n&&tS(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function yy(e){return yy=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},yy(e)}function SE(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(SE=function(){return!!e})()}function IE(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function aF(e,t){if(t&&(gs(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return IE(e)}function ea(e,t,n){return t=yy(t),aF(e,SE()?Reflect.construct(t,n||[],yy(e).constructor):t.apply(e,n))}function vy(e,t){return vy=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,a){return r.__proto__=a,r},vy(e,t)}function ta(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&vy(e,t)}function TE(e){if(Array.isArray(e))return e}function oF(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,a,o,s,c=[],d=!0,p=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;d=!1}else for(;!(d=(r=o.call(n)).done)&&(c.push(r.value),c.length!==t);d=!0);}catch(m){p=!0,a=m}finally{try{if(!d&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(p)throw a}}return c}}function Pw(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function P1(e,t){if(e){if(typeof e=="string")return Pw(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Pw(e,t)}}function EE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fs(e,t){return TE(e)||oF(e,t)||P1(e,t)||EE()}function An(){return An=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},An.apply(this,arguments)}var iF=function(e,t,n,r,a,o,s,c){if(!e){var d;if(t===void 0)d=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var p=[n,r,a,o,s,c],m=0;d=new Error(t.replace(/%s/g,function(){return p[m++]})),d.name="Invariant Violation"}throw d.framesToPop=1,d}},sF=iF;const op=er(sF);var lF=function(){};function uF(e,t){var n={};return Object.keys(e).forEach(function(r){n[Xg(r)]=lF}),n}function nS(e,t){return e[t]!==void 0}function Xg(e){return"default"+e.charAt(0).toUpperCase()+e.substr(1)}function cF(e){return!!e&&(typeof e!="function"||e.prototype&&e.prototype.isReactComponent)}function dF(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,vy(e,t)}function CE(){var e=this.constructor.getDerivedStateFromProps(this.props,this.state);e!=null&&this.setState(e)}function xE(e){function t(n){var r=this.constructor.getDerivedStateFromProps(e,n);return r??null}this.setState(t.bind(this))}function ME(e,t){try{var n=this.props,r=this.state;this.props=e,this.state=t,this.__reactInternalSnapshotFlag=!0,this.__reactInternalSnapshot=this.getSnapshotBeforeUpdate(n,r)}finally{this.props=n,this.state=r}}CE.__suppressDeprecationWarning=!0;xE.__suppressDeprecationWarning=!0;ME.__suppressDeprecationWarning=!0;function fF(e){var t=e.prototype;if(!t||!t.isReactComponent)throw new Error("Can only polyfill class components");if(typeof e.getDerivedStateFromProps!="function"&&typeof t.getSnapshotBeforeUpdate!="function")return e;var n=null,r=null,a=null;if(typeof t.componentWillMount=="function"?n="componentWillMount":typeof t.UNSAFE_componentWillMount=="function"&&(n="UNSAFE_componentWillMount"),typeof t.componentWillReceiveProps=="function"?r="componentWillReceiveProps":typeof t.UNSAFE_componentWillReceiveProps=="function"&&(r="UNSAFE_componentWillReceiveProps"),typeof t.componentWillUpdate=="function"?a="componentWillUpdate":typeof t.UNSAFE_componentWillUpdate=="function"&&(a="UNSAFE_componentWillUpdate"),n!==null||r!==null||a!==null){var o=e.displayName||e.name,s=typeof e.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";throw Error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
`+o+" uses "+s+" but also contains the following legacy lifecycles:"+(n!==null?`
`+n:"")+(r!==null?`
`+r:"")+(a!==null?`
`+a:"")+`
The above lifecycles should be removed. Learn more about this warning here:
https://fb.me/react-async-component-lifecycle-hooks`)}if(typeof e.getDerivedStateFromProps=="function"&&(t.componentWillMount=CE,t.componentWillReceiveProps=xE),typeof t.getSnapshotBeforeUpdate=="function"){if(typeof t.componentDidUpdate!="function")throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");t.componentWillUpdate=ME;var c=t.componentDidUpdate;t.componentDidUpdate=function(p,m,g){var v=this.__reactInternalSnapshotFlag?this.__reactInternalSnapshot:g;c.call(this,p,m,v)}}return e}var hF="/Users/jquense/src/uncontrollable/src/uncontrollable.js";function NE(e,t,n){n===void 0&&(n=[]);var r=e.displayName||e.name||"Component",a=cF(e),o=Object.keys(t),s=o.map(Xg);a||!n.length||op(!1);var c=function(p){dF(m,p);function m(){for(var v,D=arguments.length,S=new Array(D),T=0;T<D;T++)S[T]=arguments[T];v=p.call.apply(p,[this].concat(S))||this,v.handlers=Object.create(null),o.forEach(function(O){var k=t[O],j=function(B){if(v.props[k]){var R;v._notifying=!0;for(var z=arguments.length,H=new Array(z>1?z-1:0),Y=1;Y<z;Y++)H[Y-1]=arguments[Y];(R=v.props)[k].apply(R,[B].concat(H)),v._notifying=!1}v.unmounted||v.setState(function(U){var J,Q=U.values;return{values:An(Object.create(null),Q,(J={},J[O]=B,J))}})};v.handlers[k]=j}),n.length&&(v.attachRef=function(O){v.inner=O});var E=Object.create(null);return o.forEach(function(O){E[O]=v.props[Xg(O)]}),v.state={values:E,prevProps:{}},v}var g=m.prototype;return g.shouldComponentUpdate=function(){return!this._notifying},m.getDerivedStateFromProps=function(D,S){var T=S.values,E=S.prevProps,O={values:An(Object.create(null),T),prevProps:{}};return o.forEach(function(k){O.prevProps[k]=D[k],!nS(D,k)&&nS(E,k)&&(O.values[k]=D[Xg(k)])}),O},g.componentWillUnmount=function(){this.unmounted=!0},g.render=function(){var D=this,S=this.props,T=S.innerRef,E=$y(S,["innerRef"]);s.forEach(function(k){delete E[k]});var O={};return o.forEach(function(k){var j=D.props[k];O[k]=j!==void 0?j:D.state.values[k]}),$.createElement(e,An({},E,O,this.handlers,{ref:T||this.attachRef}))},m}($.Component);fF(c),c.displayName="Uncontrolled("+r+")",c.propTypes=An({innerRef:function(){}},uF(t)),n.forEach(function(p){c.prototype[p]=function(){var g;return(g=this.inner)[p].apply(g,arguments)}});var d=c;return $.forwardRef&&(d=$.forwardRef(function(p,m){return $.createElement(c,An({},p,{innerRef:m,__source:{fileName:hF,lineNumber:128},__self:this}))}),d.propTypes=c.propTypes),d.ControlledComponent=e,d.deferControlTo=function(p,m,g){return m===void 0&&(m={}),NE(p,An({},t,m),g)},d}function kE(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=kE(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Qn(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=kE(e))&&(r&&(r+=" "),r+=t);return r}var AE={exports:{}},L0,rS;function pF(){if(rS)return L0;rS=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return L0=e,L0}var R0,aS;function mF(){if(aS)return R0;aS=1;var e=pF();function t(){}function n(){}return n.resetWarningCache=t,R0=function(){function r(s,c,d,p,m,g){if(g!==e){var v=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw v.name="Invariant Violation",v}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},R0}AE.exports=mF()();var gF=AE.exports;const Ae=er(gF);var wy="milliseconds",ip="seconds",sp="minutes",lp="hours",Fu="day",Pd="week",up="month",Ou="year",Pu="decade",ju="century",FE={milliseconds:1,seconds:1e3,minutes:60*1e3,hours:60*60*1e3,day:24*60*60*1e3,week:7*24*60*60*1e3},yF={month:1,year:12,decade:10*12,century:100*12};function vF(e){return[31,wF(e),31,30,31,30,31,31,30,31,30,31]}function wF(e){return e%4===0&&e%100!==0||e%400===0?29:28}function Ro(e,t,n){switch(e=new Date(e),n){case wy:case ip:case sp:case lp:case Fu:case Pd:return bF(e,t*FE[n]);case up:case Ou:case Pu:case ju:return DF(e,t*yF[n])}throw new TypeError('Invalid units: "'+n+'"')}function bF(e,t){var n=new Date(+e+t);return SF(e,n)}function DF(e,t){var n=e.getFullYear(),r=e.getMonth(),a=e.getDate(),o=n*12+r+t,s=Math.trunc(o/12),c=o%12,d=Math.min(a,vF(s)[c]),p=new Date(e);return p.setFullYear(s),p.setDate(1),p.setMonth(c),p.setDate(d),p}function SF(e,t){var n=e.getTimezoneOffset(),r=t.getTimezoneOffset(),a=r-n;return new Date(+t+a*FE.minutes)}function cp(e,t,n){return Ro(e,-t,n)}function Mr(e,t,n){switch(e=new Date(e),t){case ju:case Pu:case Ou:e=Dy(e,0);case up:e=RE(e,1);case Pd:case Fu:e=hp(e,0);case lp:e=jd(e,0);case sp:e=fp(e,0);case ip:e=dp(e,0)}return t===Pu&&(e=cp(e,Lu(e)%10,"year")),t===ju&&(e=cp(e,Lu(e)%100,"year")),t===Pd&&(e=BE(e,0,n)),e}function by(e,t,n){switch(e=new Date(e),e=Mr(e,t,n),t){case ju:case Pu:case Ou:case up:case Pd:e=Ro(e,1,t),e=cp(e,1,Fu),e.setHours(23,59,59,999);break;case Fu:e.setHours(23,59,59,999);break;case lp:case sp:case ip:e=Ro(e,1,t),e=cp(e,1,wy)}return e}var Bp=qd(function(e,t){return e===t}),j1=qd(function(e,t){return e!==t}),Gy=qd(function(e,t){return e>t}),_p=qd(function(e,t){return e>=t}),L1=qd(function(e,t){return e<t}),Gd=qd(function(e,t){return e<=t});function OE(){return new Date(Math.min.apply(Math,arguments))}function PE(){return new Date(Math.max.apply(Math,arguments))}function jE(e,t,n,r){return r=r||"day",(!t||_p(e,t,r))&&(!n||Gd(e,n,r))}var dp=El("Milliseconds"),fp=El("Seconds"),jd=El("Minutes"),hp=El("Hours"),LE=El("Day"),RE=El("Date"),Dy=El("Month"),Lu=El("FullYear");function IF(e,t){return t===void 0?Lu(Mr(e,Pu)):Ro(e,t+10,Ou)}function TF(e,t){return t===void 0?Lu(Mr(e,ju)):Ro(e,t+100,Ou)}function BE(e,t,n){var r=(LE(e)+7-(n||0))%7;return t===void 0?r:Ro(e,t-r,Fu)}function EF(e,t,n,r){var a,o,s;switch(n){case wy:case ip:case sp:case lp:case Fu:case Pd:a=t.getTime()-e.getTime();break;case up:case Ou:case Pu:case ju:a=(Lu(t)-Lu(e))*12+Dy(t)-Dy(e);break;default:throw new TypeError('Invalid units: "'+n+'"')}switch(n){case wy:o=1;break;case ip:o=1e3;break;case sp:o=1e3*60;break;case lp:o=1e3*60*60;break;case Fu:o=1e3*60*60*24;break;case Pd:o=1e3*60*60*24*7;break;case up:o=1;break;case Ou:o=12;break;case Pu:o=120;break;case ju:o=1200;break;default:throw new TypeError('Invalid units: "'+n+'"')}return s=a/o,r?s:Math.round(s)}function El(e){var t=function(n){switch(n){case"Milliseconds":return 36e5;case"Seconds":return 3600;case"Minutes":return 60;case"Hours":return 1;default:return null}}(e);return function(n,r){if(r===void 0)return n["get"+e]();var a=new Date(n);return a["set"+e](r),t&&a["get"+e]()!=r&&(e==="Hours"||r>=t&&a.getHours()-n.getHours()<Math.floor(r/t))&&a["set"+e](r+t),a}}function qd(e){return function(t,n,r){return e(+Mr(t,r),+Mr(n,r))}}const oS=Object.freeze(Object.defineProperty({__proto__:null,add:Ro,century:TF,date:RE,day:LE,decade:IF,diff:EF,endOf:by,eq:Bp,gt:Gy,gte:_p,hours:hp,inRange:jE,lt:L1,lte:Gd,max:PE,milliseconds:dp,min:OE,minutes:jd,month:Dy,neq:j1,seconds:fp,startOf:Mr,subtract:cp,weekday:BE,year:Lu},Symbol.toStringTag,{value:"Module"}));function CF(e){if(Array.isArray(e))return Pw(e)}function _E(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function xF(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ey(e){return CF(e)||_E(e)||P1(e)||xF()}function MF(e,t,n){var r=-1,a=e.length;t<0&&(t=-t>a?0:a+t),n=n>a?a:n,n<0&&(n+=a),a=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(a);++r<a;)o[r]=e[r+t];return o}var HE=MF;function NF(e,t){return e===t||e!==e&&t!==t}var Hp=NF,kF=typeof Jn=="object"&&Jn&&Jn.Object===Object&&Jn,YE=kF,AF=YE,FF=typeof self=="object"&&self&&self.Object===Object&&self,OF=AF||FF||Function("return this")(),Oi=OF,PF=Oi,jF=PF.Symbol,Jd=jF,iS=Jd,zE=Object.prototype,LF=zE.hasOwnProperty,RF=zE.toString,Rh=iS?iS.toStringTag:void 0;function BF(e){var t=LF.call(e,Rh),n=e[Rh];try{e[Rh]=void 0;var r=!0}catch{}var a=RF.call(e);return r&&(t?e[Rh]=n:delete e[Rh]),a}var _F=BF,HF=Object.prototype,YF=HF.toString;function zF(e){return YF.call(e)}var UF=zF,sS=Jd,VF=_F,ZF=UF,WF="[object Null]",$F="[object Undefined]",lS=sS?sS.toStringTag:void 0;function GF(e){return e==null?e===void 0?$F:WF:lS&&lS in Object(e)?VF(e):ZF(e)}var Kd=GF;function qF(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Ss=qF,JF=Kd,KF=Ss,QF="[object AsyncFunction]",XF="[object Function]",eO="[object GeneratorFunction]",tO="[object Proxy]";function nO(e){if(!KF(e))return!1;var t=JF(e);return t==XF||t==eO||t==QF||t==tO}var R1=nO,rO=9007199254740991;function aO(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=rO}var B1=aO,oO=R1,iO=B1;function sO(e){return e!=null&&iO(e.length)&&!oO(e)}var Yp=sO,lO=9007199254740991,uO=/^(?:0|[1-9]\d*)$/;function cO(e,t){var n=typeof e;return t=t??lO,!!t&&(n=="number"||n!="symbol"&&uO.test(e))&&e>-1&&e%1==0&&e<t}var _1=cO,dO=Hp,fO=Yp,hO=_1,pO=Ss;function mO(e,t,n){if(!pO(n))return!1;var r=typeof t;return(r=="number"?fO(n)&&hO(t,n.length):r=="string"&&t in n)?dO(n[t],e):!1}var qy=mO,gO=/\s/;function yO(e){for(var t=e.length;t--&&gO.test(e.charAt(t)););return t}var vO=yO,wO=vO,bO=/^\s+/;function DO(e){return e&&e.slice(0,wO(e)+1).replace(bO,"")}var SO=DO;function IO(e){return e!=null&&typeof e=="object"}var Cl=IO,TO=Kd,EO=Cl,CO="[object Symbol]";function xO(e){return typeof e=="symbol"||EO(e)&&TO(e)==CO}var zp=xO,MO=SO,uS=Ss,NO=zp,cS=NaN,kO=/^[-+]0x[0-9a-f]+$/i,AO=/^0b[01]+$/i,FO=/^0o[0-7]+$/i,OO=parseInt;function PO(e){if(typeof e=="number")return e;if(NO(e))return cS;if(uS(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=uS(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=MO(e);var n=AO.test(e);return n||FO.test(e)?OO(e.slice(2),n?2:8):kO.test(e)?cS:+e}var jO=PO,LO=jO,dS=1/0,RO=17976931348623157e292;function BO(e){if(!e)return e===0?e:0;if(e=LO(e),e===dS||e===-dS){var t=e<0?-1:1;return t*RO}return e===e?e:0}var UE=BO,_O=UE;function HO(e){var t=_O(e),n=t%1;return t===t?n?t-n:t:0}var VE=HO,YO=HE,zO=qy,UO=VE,VO=Math.ceil,ZO=Math.max;function WO(e,t,n){(n?zO(e,t,n):t===void 0)?t=1:t=ZO(UO(t),0);var r=e==null?0:e.length;if(!r||t<1)return[];for(var a=0,o=0,s=Array(VO(r/t));a<r;)s[o++]=YO(e,a,a+=t);return s}var $O=WO;const GO=er($O);function Up(e){return e&&e.ownerDocument||document}function qO(e){var t=Up(e);return t&&t.defaultView||window}function JO(e,t){return qO(e).getComputedStyle(e,t)}var KO=/([A-Z])/g;function QO(e){return e.replace(KO,"-$1").toLowerCase()}var XO=/^ms-/;function Pg(e){return QO(e).replace(XO,"-ms-")}var e7=/^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;function t7(e){return!!(e&&e7.test(e))}function Sd(e,t){var n="",r="";if(typeof t=="string")return e.style.getPropertyValue(Pg(t))||JO(e).getPropertyValue(Pg(t));Object.keys(t).forEach(function(a){var o=t[a];!o&&o!==0?e.style.removeProperty(Pg(a)):t7(a)?r+=a+"("+o+") ":n+=Pg(a)+": "+o+";"}),r&&(n+="transform: "+r+";"),e.style.cssText+=";"+n}function pp(e,t){if(e.contains)return e.contains(t);if(e.compareDocumentPosition)return e===t||!!(e.compareDocumentPosition(t)&16)}function n7(e){return"nodeType"in e&&e.nodeType===document.DOCUMENT_NODE}function H1(e){return"window"in e&&e.window===e?e:n7(e)&&e.defaultView||!1}function ZE(e){var t=e==="pageXOffset"?"scrollLeft":"scrollTop";function n(r,a){var o=H1(r);if(a===void 0)return o?o[e]:r[t];o?o.scrollTo(o[e],a):r[t]=a}return n}const WE=ZE("pageXOffset"),$E=ZE("pageYOffset");function ku(e){var t=Up(e),n={top:0,left:0,height:0,width:0},r=t&&t.documentElement;return!r||!pp(r,e)||(e.getBoundingClientRect!==void 0&&(n=e.getBoundingClientRect()),n={top:n.top+$E(r)-(r.clientTop||0),left:n.left+WE(r)-(r.clientLeft||0),width:n.width,height:n.height}),n}var r7=function(t){return!!t&&"offsetParent"in t};function a7(e){for(var t=Up(e),n=e&&e.offsetParent;r7(n)&&n.nodeName!=="HTML"&&Sd(n,"position")==="static";)n=n.offsetParent;return n||t.documentElement}var o7=function(t){return t.nodeName&&t.nodeName.toLowerCase()};function GE(e,t){var n={top:0,left:0},r;if(Sd(e,"position")==="fixed")r=e.getBoundingClientRect();else{var a=t||a7(e);r=ku(e),o7(a)!=="html"&&(n=ku(a));var o=String(Sd(a,"borderTopWidth")||0);n.top+=parseInt(o,10)-$E(a)||0;var s=String(Sd(a,"borderLeftWidth")||0);n.left+=parseInt(s,10)-WE(a)||0}var c=String(Sd(e,"marginTop")||0),d=String(Sd(e,"marginLeft")||0);return An({},r,{top:r.top-n.top-(parseInt(c,10)||0),left:r.left-n.left-(parseInt(d,10)||0)})}const Y1=!!(typeof window<"u"&&window.document&&window.document.createElement);var fS=new Date().getTime();function i7(e){var t=new Date().getTime(),n=Math.max(0,16-(t-fS)),r=setTimeout(e,n);return fS=t,r}var s7=["","webkit","moz","o","ms"],jw="clearTimeout",Lw=i7,hS=function(t,n){return t+(t?n[0].toUpperCase()+n.substr(1):n)+"AnimationFrame"};Y1&&s7.some(function(e){var t=hS(e,"request");return t in window&&(jw=hS(e,"cancel"),Lw=function(r){return window[t](r)}),!!Lw});var pS=function(t){typeof window[jw]=="function"&&window[jw](t)},qE=Lw,B0;function l7(e,t){if(!B0){var n=document.body,r=n.matches||n.matchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector||n.msMatchesSelector;B0=function(o,s){return r.call(o,s)}}return B0(e,t)}var u7=Function.prototype.bind.call(Function.prototype.call,[].slice);function c7(e,t){return u7(e.querySelectorAll(t))}var Rw=!1,Bw=!1;try{var _0={get passive(){return Rw=!0},get once(){return Bw=Rw=!0}};Y1&&(window.addEventListener("test",_0,_0),window.removeEventListener("test",_0,!0))}catch{}function d7(e,t,n,r){if(r&&typeof r!="boolean"&&!Bw){var a=r.once,o=r.capture,s=n;!Bw&&a&&(s=n.__once||function c(d){this.removeEventListener(t,c,o),n.call(this,d)},n.__once=s),e.addEventListener(t,s,Rw?r:o)}e.addEventListener(t,n,r)}function f7(e){const t=A.useRef(e);return A.useEffect(()=>{t.current=e},[e]),t}function mS(e){const t=f7(e);return A.useCallback(function(...n){return t.current&&t.current(...n)},[t])}function gS(){return A.useState(null)}function h7(){const e=A.useRef(!0),t=A.useRef(()=>e.current);return A.useEffect(()=>(e.current=!0,()=>{e.current=!1}),[]),t.current}function p7(e){const t=h7();return[e[0],A.useCallback(n=>{if(t())return e[1](n)},[t,e[1]])]}var m7=fE({defaultModifiers:[lE,cE,rE,aE,uE,sE,dE,nE]}),yS=function(t){return{position:t,top:"0",left:"0",opacity:"0",pointerEvents:"none"}},g7={name:"applyStyles",enabled:!1},y7={name:"ariaDescribedBy",enabled:!0,phase:"afterWrite",effect:function(t){var n=t.state;return function(){var r=n.elements,a=r.reference,o=r.popper;if("removeAttribute"in a){var s=(a.getAttribute("aria-describedby")||"").split(",").filter(function(c){return c.trim()!==o.id});s.length?a.setAttribute("aria-describedby",s.join(",")):a.removeAttribute("aria-describedby")}}},fn:function(t){var n,r=t.state,a=r.elements,o=a.popper,s=a.reference,c=(n=o.getAttribute("role"))==null?void 0:n.toLowerCase();if(o.id&&c==="tooltip"&&"setAttribute"in s){var d=s.getAttribute("aria-describedby");if(d&&d.split(",").indexOf(o.id)!==-1)return;s.setAttribute("aria-describedby",d?d+","+o.id:o.id)}}},v7=[];function w7(e,t,n){var r=n===void 0?{}:n,a=r.enabled,o=a===void 0?!0:a,s=r.placement,c=s===void 0?"bottom":s,d=r.strategy,p=d===void 0?"absolute":d,m=r.modifiers,g=m===void 0?v7:m,v=$y(r,["enabled","placement","strategy","modifiers"]),D=A.useRef(),S=A.useCallback(function(){var F;(F=D.current)==null||F.update()},[]),T=A.useCallback(function(){var F;(F=D.current)==null||F.forceUpdate()},[]),E=p7(A.useState({placement:c,update:S,forceUpdate:T,attributes:{},styles:{popper:yS(p),arrow:{}}})),O=E[0],k=E[1],j=A.useMemo(function(){return{name:"updateStateModifier",enabled:!0,phase:"write",requires:["computeStyles"],fn:function(B){var R=B.state,z={},H={};Object.keys(R.elements).forEach(function(Y){z[Y]=R.styles[Y],H[Y]=R.attributes[Y]}),k({state:R,styles:z,attributes:H,update:S,forceUpdate:T,placement:R.placement})}}},[S,T,k]);return A.useEffect(function(){!D.current||!o||D.current.setOptions({placement:c,strategy:p,modifiers:[].concat(g,[j,g7])})},[p,c,j,o]),A.useEffect(function(){if(!(!o||e==null||t==null))return D.current=m7(e,t,An({},v,{placement:c,strategy:p,modifiers:[].concat(g,[y7,j])})),function(){D.current!=null&&(D.current.destroy(),D.current=void 0,k(function(F){return An({},F,{attributes:{},styles:{popper:yS(p)}})}))}},[o,e,t]),O}function b7(e,t,n,r){var a=r&&typeof r!="boolean"?r.capture:r;e.removeEventListener(t,n,a),n.__once&&e.removeEventListener(t,n.__once,a)}function Vh(e,t,n,r){return d7(e,t,n,r),function(){b7(e,t,n,r)}}function D7(e){return e&&"setState"in e?T1.findDOMNode(e):e??null}const S7=function(e){return Up(D7(e))};var I7=27,vS=function(){};function T7(e){return e.button===0}function E7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var wS=function(t){return t&&("current"in t?t.current:t)};function C7(e,t,n){var r=n===void 0?{}:n,a=r.disabled,o=r.clickTrigger,s=o===void 0?"click":o,c=A.useRef(!1),d=t||vS,p=A.useCallback(function(v){var D,S=wS(e);c5(!!S,"RootClose captured a close event but does not have a ref to compare it to. useRootClose(), should be passed a ref that resolves to a DOM node"),c.current=!S||E7(v)||!T7(v)||!!pp(S,(D=v.composedPath==null?void 0:v.composedPath()[0])!=null?D:v.target)},[e]),m=mS(function(v){c.current||d(v)}),g=mS(function(v){v.keyCode===I7&&d(v)});A.useEffect(function(){if(!(a||e==null)){var v=window.event,D=S7(wS(e)),S=Vh(D,s,p,!0),T=Vh(D,s,function(k){if(k===v){v=void 0;return}m(k)}),E=Vh(D,"keyup",function(k){if(k===v){v=void 0;return}g(k)}),O=[];return"ontouchstart"in D.documentElement&&(O=[].slice.call(D.body.children).map(function(k){return Vh(k,"mousemove",vS)})),function(){S(),T(),E(),O.forEach(function(k){return k()})}}},[e,a,s,p,m,g])}function x7(e){var t={};return Array.isArray(e)?(e==null||e.forEach(function(n){t[n.name]=n}),t):e||t}function M7(e){return e===void 0&&(e={}),Array.isArray(e)?e:Object.keys(e).map(function(t){return e[t].name=t,e[t]})}function N7(e){var t,n,r,a,o=e.enabled,s=e.enableEvents,c=e.placement,d=e.flip,p=e.offset,m=e.fixed,g=e.containerPadding,v=e.arrowElement,D=e.popperConfig,S=D===void 0?{}:D,T=x7(S.modifiers);return An({},S,{placement:c,enabled:o,strategy:m?"fixed":S.strategy,modifiers:M7(An({},T,{eventListeners:{enabled:s},preventOverflow:An({},T.preventOverflow,{options:g?An({padding:g},(t=T.preventOverflow)==null?void 0:t.options):(n=T.preventOverflow)==null?void 0:n.options}),offset:{options:An({offset:p},(r=T.offset)==null?void 0:r.options)},arrow:An({},T.arrow,{enabled:!!v,options:An({},(a=T.arrow)==null?void 0:a.options,{element:v})}),flip:An({enabled:!!d},T.flip)}))})}function k7(e,t){return e.classList?!!t&&e.classList.contains(t):(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" ")!==-1}function A7(e,t){e.classList?e.classList.add(t):k7(e,t)||(typeof e.className=="string"?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}function bS(e,t){return e.replace(new RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function F7(e,t){e.classList?e.classList.remove(t):typeof e.className=="string"?e.className=bS(e.className,t):e.setAttribute("class",bS(e.className&&e.className.baseVal||"",t))}var jg;function JE(e){if((!jg&&jg!==0||e)&&Y1){var t=document.createElement("div");t.style.position="absolute",t.style.top="-9999px",t.style.width="50px",t.style.height="50px",t.style.overflow="scroll",document.body.appendChild(t),jg=t.offsetWidth-t.clientWidth,document.body.removeChild(t)}return jg}var H0=function(t){var n;return typeof document>"u"?null:t==null?Up().body:(typeof t=="function"&&(t=t()),t&&"current"in t&&(t=t.current),(n=t)!=null&&n.nodeType&&t||null)};function DS(e,t){var n=A.useState(function(){return H0(e)}),r=n[0],a=n[1];if(!r){var o=H0(e);o&&a(o)}return A.useEffect(function(){t&&r&&t(r)},[t,r]),A.useEffect(function(){var s=H0(e);s!==r&&a(s)},[e,r]),r}const SS=e=>!e||typeof e=="function"?e:t=>{e.current=t};function O7(e,t){const n=SS(e),r=SS(t);return a=>{n&&n(a),r&&r(a)}}function P7(e,t){return A.useMemo(()=>O7(e,t),[e,t])}var z1=$.forwardRef(function(e,t){var n=e.flip,r=e.offset,a=e.placement,o=e.containerPadding,s=o===void 0?5:o,c=e.popperConfig,d=c===void 0?{}:c,p=e.transition,m=gS(),g=m[0],v=m[1],D=gS(),S=D[0],T=D[1],E=P7(v,t),O=DS(e.container),k=DS(e.target),j=A.useState(!e.show),F=j[0],B=j[1],R=w7(k,g,N7({placement:a,enableEvents:!!e.show,containerPadding:s||5,flip:n,offset:r,arrowElement:S,popperConfig:d})),z=R.styles,H=R.attributes,Y=$y(R,["styles","attributes"]);e.show?F&&B(!1):!e.transition&&!F&&B(!0);var U=function(){B(!0),e.onExited&&e.onExited.apply(e,arguments)},J=e.show||p&&!F;if(C7(g,e.onHide,{disabled:!e.rootClose||e.rootCloseDisabled,clickTrigger:e.rootCloseEvent}),!J)return null;var Q=e.children(An({},Y,{show:!!e.show,props:An({},H.popper,{style:z.popper,ref:E}),arrowProps:An({},H.arrow,{style:z.arrow,ref:T})}));if(p){var le=e.onExit,pe=e.onExiting,ie=e.onEnter,se=e.onEntering,fe=e.onEntered;Q=$.createElement(p,{in:e.show,appear:!0,onExit:le,onExiting:pe,onExited:U,onEnter:ie,onEntering:se,onEntered:fe},Q)}return O?T1.createPortal(Q,O):null});z1.displayName="Overlay";z1.propTypes={show:Ae.bool,placement:Ae.oneOf(x1),target:Ae.any,container:Ae.any,flip:Ae.bool,children:Ae.func.isRequired,containerPadding:Ae.number,popperConfig:Ae.object,rootClose:Ae.bool,rootCloseEvent:Ae.oneOf(["click","mousedown"]),rootCloseDisabled:Ae.bool,onHide:function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),a=1;a<n;a++)r[a-1]=arguments[a];if(t.rootClose){var o;return(o=Ae.func).isRequired.apply(o,[t].concat(r))}return Ae.func.apply(Ae,[t].concat(r))},transition:Ae.elementType,onEnter:Ae.func,onEntering:Ae.func,onEntered:Ae.func,onExit:Ae.func,onExiting:Ae.func,onExited:Ae.func};const j7=z1;function L7(){this.__data__=[],this.size=0}var R7=L7,B7=Hp;function _7(e,t){for(var n=e.length;n--;)if(B7(e[n][0],t))return n;return-1}var Jy=_7,H7=Jy,Y7=Array.prototype,z7=Y7.splice;function U7(e){var t=this.__data__,n=H7(t,e);if(n<0)return!1;var r=t.length-1;return n==r?t.pop():z7.call(t,n,1),--this.size,!0}var V7=U7,Z7=Jy;function W7(e){var t=this.__data__,n=Z7(t,e);return n<0?void 0:t[n][1]}var $7=W7,G7=Jy;function q7(e){return G7(this.__data__,e)>-1}var J7=q7,K7=Jy;function Q7(e,t){var n=this.__data__,r=K7(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}var X7=Q7,eP=R7,tP=V7,nP=$7,rP=J7,aP=X7;function Qd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Qd.prototype.clear=eP;Qd.prototype.delete=tP;Qd.prototype.get=nP;Qd.prototype.has=rP;Qd.prototype.set=aP;var Ky=Qd,oP=Ky;function iP(){this.__data__=new oP,this.size=0}var sP=iP;function lP(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}var uP=lP;function cP(e){return this.__data__.get(e)}var dP=cP;function fP(e){return this.__data__.has(e)}var hP=fP,pP=Oi,mP=pP["__core-js_shared__"],gP=mP,Y0=gP,IS=function(){var e=/[^.]+$/.exec(Y0&&Y0.keys&&Y0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}();function yP(e){return!!IS&&IS in e}var vP=yP,wP=Function.prototype,bP=wP.toString;function DP(e){if(e!=null){try{return bP.call(e)}catch{}try{return e+""}catch{}}return""}var KE=DP,SP=R1,IP=vP,TP=Ss,EP=KE,CP=/[\\^$.*+?()[\]{}|]/g,xP=/^\[object .+?Constructor\]$/,MP=Function.prototype,NP=Object.prototype,kP=MP.toString,AP=NP.hasOwnProperty,FP=RegExp("^"+kP.call(AP).replace(CP,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function OP(e){if(!TP(e)||IP(e))return!1;var t=SP(e)?FP:xP;return t.test(EP(e))}var PP=OP;function jP(e,t){return e==null?void 0:e[t]}var LP=jP,RP=PP,BP=LP;function _P(e,t){var n=BP(e,t);return RP(n)?n:void 0}var Yu=_P,HP=Yu,YP=Oi,zP=HP(YP,"Map"),U1=zP,UP=Yu,VP=UP(Object,"create"),Qy=VP,TS=Qy;function ZP(){this.__data__=TS?TS(null):{},this.size=0}var WP=ZP;function $P(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var GP=$P,qP=Qy,JP="__lodash_hash_undefined__",KP=Object.prototype,QP=KP.hasOwnProperty;function XP(e){var t=this.__data__;if(qP){var n=t[e];return n===JP?void 0:n}return QP.call(t,e)?t[e]:void 0}var ej=XP,tj=Qy,nj=Object.prototype,rj=nj.hasOwnProperty;function aj(e){var t=this.__data__;return tj?t[e]!==void 0:rj.call(t,e)}var oj=aj,ij=Qy,sj="__lodash_hash_undefined__";function lj(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=ij&&t===void 0?sj:t,this}var uj=lj,cj=WP,dj=GP,fj=ej,hj=oj,pj=uj;function Xd(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Xd.prototype.clear=cj;Xd.prototype.delete=dj;Xd.prototype.get=fj;Xd.prototype.has=hj;Xd.prototype.set=pj;var mj=Xd,ES=mj,gj=Ky,yj=U1;function vj(){this.size=0,this.__data__={hash:new ES,map:new(yj||gj),string:new ES}}var wj=vj;function bj(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}var Dj=bj,Sj=Dj;function Ij(e,t){var n=e.__data__;return Sj(t)?n[typeof t=="string"?"string":"hash"]:n.map}var Xy=Ij,Tj=Xy;function Ej(e){var t=Tj(this,e).delete(e);return this.size-=t?1:0,t}var Cj=Ej,xj=Xy;function Mj(e){return xj(this,e).get(e)}var Nj=Mj,kj=Xy;function Aj(e){return kj(this,e).has(e)}var Fj=Aj,Oj=Xy;function Pj(e,t){var n=Oj(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}var jj=Pj,Lj=wj,Rj=Cj,Bj=Nj,_j=Fj,Hj=jj;function ef(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ef.prototype.clear=Lj;ef.prototype.delete=Rj;ef.prototype.get=Bj;ef.prototype.has=_j;ef.prototype.set=Hj;var V1=ef,Yj=Ky,zj=U1,Uj=V1,Vj=200;function Zj(e,t){var n=this.__data__;if(n instanceof Yj){var r=n.__data__;if(!zj||r.length<Vj-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Uj(r)}return n.set(e,t),this.size=n.size,this}var Wj=Zj,$j=Ky,Gj=sP,qj=uP,Jj=dP,Kj=hP,Qj=Wj;function tf(e){var t=this.__data__=new $j(e);this.size=t.size}tf.prototype.clear=Gj;tf.prototype.delete=qj;tf.prototype.get=Jj;tf.prototype.has=Kj;tf.prototype.set=Qj;var Z1=tf,Xj="__lodash_hash_undefined__";function eL(e){return this.__data__.set(e,Xj),this}var tL=eL;function nL(e){return this.__data__.has(e)}var rL=nL,aL=V1,oL=tL,iL=rL;function Sy(e){var t=-1,n=e==null?0:e.length;for(this.__data__=new aL;++t<n;)this.add(e[t])}Sy.prototype.add=Sy.prototype.push=oL;Sy.prototype.has=iL;var sL=Sy;function lL(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}var uL=lL;function cL(e,t){return e.has(t)}var dL=cL,fL=sL,hL=uL,pL=dL,mL=1,gL=2;function yL(e,t,n,r,a,o){var s=n&mL,c=e.length,d=t.length;if(c!=d&&!(s&&d>c))return!1;var p=o.get(e),m=o.get(t);if(p&&m)return p==t&&m==e;var g=-1,v=!0,D=n&gL?new fL:void 0;for(o.set(e,t),o.set(t,e);++g<c;){var S=e[g],T=t[g];if(r)var E=s?r(T,S,g,t,e,o):r(S,T,g,e,t,o);if(E!==void 0){if(E)continue;v=!1;break}if(D){if(!hL(t,function(O,k){if(!pL(D,k)&&(S===O||a(S,O,n,r,o)))return D.push(k)})){v=!1;break}}else if(!(S===T||a(S,T,n,r,o))){v=!1;break}}return o.delete(e),o.delete(t),v}var QE=yL,vL=Oi,wL=vL.Uint8Array,XE=wL;function bL(e){var t=-1,n=Array(e.size);return e.forEach(function(r,a){n[++t]=[a,r]}),n}var DL=bL;function SL(e){var t=-1,n=Array(e.size);return e.forEach(function(r){n[++t]=r}),n}var IL=SL,CS=Jd,xS=XE,TL=Hp,EL=QE,CL=DL,xL=IL,ML=1,NL=2,kL="[object Boolean]",AL="[object Date]",FL="[object Error]",OL="[object Map]",PL="[object Number]",jL="[object RegExp]",LL="[object Set]",RL="[object String]",BL="[object Symbol]",_L="[object ArrayBuffer]",HL="[object DataView]",MS=CS?CS.prototype:void 0,z0=MS?MS.valueOf:void 0;function YL(e,t,n,r,a,o,s){switch(n){case HL:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case _L:return!(e.byteLength!=t.byteLength||!o(new xS(e),new xS(t)));case kL:case AL:case PL:return TL(+e,+t);case FL:return e.name==t.name&&e.message==t.message;case jL:case RL:return e==t+"";case OL:var c=CL;case LL:var d=r&ML;if(c||(c=xL),e.size!=t.size&&!d)return!1;var p=s.get(e);if(p)return p==t;r|=NL,s.set(e,t);var m=EL(c(e),c(t),r,a,o,s);return s.delete(e),m;case BL:if(z0)return z0.call(e)==z0.call(t)}return!1}var zL=YL;function UL(e,t){for(var n=-1,r=t.length,a=e.length;++n<r;)e[a+n]=t[n];return e}var W1=UL,VL=Array.isArray,fo=VL,ZL=W1,WL=fo;function $L(e,t,n){var r=t(e);return WL(e)?r:ZL(r,n(e))}var eC=$L;function GL(e,t){for(var n=-1,r=e==null?0:e.length,a=0,o=[];++n<r;){var s=e[n];t(s,n,e)&&(o[a++]=s)}return o}var qL=GL;function JL(){return[]}var tC=JL,KL=qL,QL=tC,XL=Object.prototype,eR=XL.propertyIsEnumerable,NS=Object.getOwnPropertySymbols,tR=NS?function(e){return e==null?[]:(e=Object(e),KL(NS(e),function(t){return eR.call(e,t)}))}:QL,$1=tR;function nR(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var rR=nR,aR=Kd,oR=Cl,iR="[object Arguments]";function sR(e){return oR(e)&&aR(e)==iR}var lR=sR,kS=lR,uR=Cl,nC=Object.prototype,cR=nC.hasOwnProperty,dR=nC.propertyIsEnumerable,fR=kS(function(){return arguments}())?kS:function(e){return uR(e)&&cR.call(e,"callee")&&!dR.call(e,"callee")},G1=fR,Iy={exports:{}};function hR(){return!1}var pR=hR;Iy.exports;(function(e,t){var n=Oi,r=pR,a=t&&!t.nodeType&&t,o=a&&!0&&e&&!e.nodeType&&e,s=o&&o.exports===a,c=s?n.Buffer:void 0,d=c?c.isBuffer:void 0,p=d||r;e.exports=p})(Iy,Iy.exports);var ev=Iy.exports,mR=Kd,gR=B1,yR=Cl,vR="[object Arguments]",wR="[object Array]",bR="[object Boolean]",DR="[object Date]",SR="[object Error]",IR="[object Function]",TR="[object Map]",ER="[object Number]",CR="[object Object]",xR="[object RegExp]",MR="[object Set]",NR="[object String]",kR="[object WeakMap]",AR="[object ArrayBuffer]",FR="[object DataView]",OR="[object Float32Array]",PR="[object Float64Array]",jR="[object Int8Array]",LR="[object Int16Array]",RR="[object Int32Array]",BR="[object Uint8Array]",_R="[object Uint8ClampedArray]",HR="[object Uint16Array]",YR="[object Uint32Array]",fn={};fn[OR]=fn[PR]=fn[jR]=fn[LR]=fn[RR]=fn[BR]=fn[_R]=fn[HR]=fn[YR]=!0;fn[vR]=fn[wR]=fn[AR]=fn[bR]=fn[FR]=fn[DR]=fn[SR]=fn[IR]=fn[TR]=fn[ER]=fn[CR]=fn[xR]=fn[MR]=fn[NR]=fn[kR]=!1;function zR(e){return yR(e)&&gR(e.length)&&!!fn[mR(e)]}var UR=zR;function VR(e){return function(t){return e(t)}}var tv=VR,Ty={exports:{}};Ty.exports;(function(e,t){var n=YE,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,s=o&&n.process,c=function(){try{var d=a&&a.require&&a.require("util").types;return d||s&&s.binding&&s.binding("util")}catch{}}();e.exports=c})(Ty,Ty.exports);var q1=Ty.exports,ZR=UR,WR=tv,AS=q1,FS=AS&&AS.isTypedArray,$R=FS?WR(FS):ZR,J1=$R,GR=rR,qR=G1,JR=fo,KR=ev,QR=_1,XR=J1,eB=Object.prototype,tB=eB.hasOwnProperty;function nB(e,t){var n=JR(e),r=!n&&qR(e),a=!n&&!r&&KR(e),o=!n&&!r&&!a&&XR(e),s=n||r||a||o,c=s?GR(e.length,String):[],d=c.length;for(var p in e)(t||tB.call(e,p))&&!(s&&(p=="length"||a&&(p=="offset"||p=="parent")||o&&(p=="buffer"||p=="byteLength"||p=="byteOffset")||QR(p,d)))&&c.push(p);return c}var rC=nB,rB=Object.prototype;function aB(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||rB;return e===n}var K1=aB;function oB(e,t){return function(n){return e(t(n))}}var aC=oB,iB=aC,sB=iB(Object.keys,Object),lB=sB,uB=K1,cB=lB,dB=Object.prototype,fB=dB.hasOwnProperty;function hB(e){if(!uB(e))return cB(e);var t=[];for(var n in Object(e))fB.call(e,n)&&n!="constructor"&&t.push(n);return t}var pB=hB,mB=rC,gB=pB,yB=Yp;function vB(e){return yB(e)?mB(e):gB(e)}var Vp=vB,wB=eC,bB=$1,DB=Vp;function SB(e){return wB(e,DB,bB)}var oC=SB,OS=oC,IB=1,TB=Object.prototype,EB=TB.hasOwnProperty;function CB(e,t,n,r,a,o){var s=n&IB,c=OS(e),d=c.length,p=OS(t),m=p.length;if(d!=m&&!s)return!1;for(var g=d;g--;){var v=c[g];if(!(s?v in t:EB.call(t,v)))return!1}var D=o.get(e),S=o.get(t);if(D&&S)return D==t&&S==e;var T=!0;o.set(e,t),o.set(t,e);for(var E=s;++g<d;){v=c[g];var O=e[v],k=t[v];if(r)var j=s?r(k,O,v,t,e,o):r(O,k,v,e,t,o);if(!(j===void 0?O===k||a(O,k,n,r,o):j)){T=!1;break}E||(E=v=="constructor")}if(T&&!E){var F=e.constructor,B=t.constructor;F!=B&&"constructor"in e&&"constructor"in t&&!(typeof F=="function"&&F instanceof F&&typeof B=="function"&&B instanceof B)&&(T=!1)}return o.delete(e),o.delete(t),T}var xB=CB,MB=Yu,NB=Oi,kB=MB(NB,"DataView"),AB=kB,FB=Yu,OB=Oi,PB=FB(OB,"Promise"),jB=PB,LB=Yu,RB=Oi,BB=LB(RB,"Set"),_B=BB,HB=Yu,YB=Oi,zB=HB(YB,"WeakMap"),UB=zB,_w=AB,Hw=U1,Yw=jB,zw=_B,Uw=UB,iC=Kd,nf=KE,PS="[object Map]",VB="[object Object]",jS="[object Promise]",LS="[object Set]",RS="[object WeakMap]",BS="[object DataView]",ZB=nf(_w),WB=nf(Hw),$B=nf(Yw),GB=nf(zw),qB=nf(Uw),Su=iC;(_w&&Su(new _w(new ArrayBuffer(1)))!=BS||Hw&&Su(new Hw)!=PS||Yw&&Su(Yw.resolve())!=jS||zw&&Su(new zw)!=LS||Uw&&Su(new Uw)!=RS)&&(Su=function(e){var t=iC(e),n=t==VB?e.constructor:void 0,r=n?nf(n):"";if(r)switch(r){case ZB:return BS;case WB:return PS;case $B:return jS;case GB:return LS;case qB:return RS}return t});var nv=Su,U0=Z1,JB=QE,KB=zL,QB=xB,_S=nv,HS=fo,YS=ev,XB=J1,e_=1,zS="[object Arguments]",US="[object Array]",Lg="[object Object]",t_=Object.prototype,VS=t_.hasOwnProperty;function n_(e,t,n,r,a,o){var s=HS(e),c=HS(t),d=s?US:_S(e),p=c?US:_S(t);d=d==zS?Lg:d,p=p==zS?Lg:p;var m=d==Lg,g=p==Lg,v=d==p;if(v&&YS(e)){if(!YS(t))return!1;s=!0,m=!1}if(v&&!m)return o||(o=new U0),s||XB(e)?JB(e,t,n,r,a,o):KB(e,t,d,n,r,a,o);if(!(n&e_)){var D=m&&VS.call(e,"__wrapped__"),S=g&&VS.call(t,"__wrapped__");if(D||S){var T=D?e.value():e,E=S?t.value():t;return o||(o=new U0),a(T,E,n,r,o)}}return v?(o||(o=new U0),QB(e,t,n,r,a,o)):!1}var r_=n_,a_=r_,ZS=Cl;function sC(e,t,n,r,a){return e===t?!0:e==null||t==null||!ZS(e)&&!ZS(t)?e!==e&&t!==t:a_(e,t,n,r,sC,a)}var Q1=sC,o_=Q1;function i_(e,t){return o_(e,t)}var s_=i_;const l_=er(s_);function V0(e,t){var n=H1(e);return n?n.innerHeight:t?e.clientHeight:ku(e).height}function lC(e,t,n){e.closest&&!n&&e.closest(t);var r=e;do{if(l7(r,t))return r;r=r.parentElement}while(r&&r!==n&&r.nodeType===document.ELEMENT_NODE);return null}function u_(e,t,n,r){for(var a=e.length,o=n+(r?1:-1);r?o--:++o<a;)if(t(e[o],o,e))return o;return-1}var c_=u_,d_=Z1,f_=Q1,h_=1,p_=2;function m_(e,t,n,r){var a=n.length,o=a,s=!r;if(e==null)return!o;for(e=Object(e);a--;){var c=n[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){c=n[a];var d=c[0],p=e[d],m=c[1];if(s&&c[2]){if(p===void 0&&!(d in e))return!1}else{var g=new d_;if(r)var v=r(p,m,d,e,t,g);if(!(v===void 0?f_(m,p,h_|p_,r,g):v))return!1}}return!0}var g_=m_,y_=Ss;function v_(e){return e===e&&!y_(e)}var uC=v_,w_=uC,b_=Vp;function D_(e){for(var t=b_(e),n=t.length;n--;){var r=t[n],a=e[r];t[n]=[r,a,w_(a)]}return t}var S_=D_;function I_(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}var cC=I_,T_=g_,E_=S_,C_=cC;function x_(e){var t=E_(e);return t.length==1&&t[0][2]?C_(t[0][0],t[0][1]):function(n){return n===e||T_(n,e,t)}}var M_=x_,N_=fo,k_=zp,A_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,F_=/^\w*$/;function O_(e,t){if(N_(e))return!1;var n=typeof e;return n=="number"||n=="symbol"||n=="boolean"||e==null||k_(e)?!0:F_.test(e)||!A_.test(e)||t!=null&&e in Object(t)}var X1=O_,dC=V1,P_="Expected a function";function eb(e,t){if(typeof e!="function"||t!=null&&typeof t!="function")throw new TypeError(P_);var n=function(){var r=arguments,a=t?t.apply(this,r):r[0],o=n.cache;if(o.has(a))return o.get(a);var s=e.apply(this,r);return n.cache=o.set(a,s)||o,s};return n.cache=new(eb.Cache||dC),n}eb.Cache=dC;var j_=eb,L_=j_,R_=500;function B_(e){var t=L_(e,function(r){return n.size===R_&&n.clear(),r}),n=t.cache;return t}var __=B_,H_=__,Y_=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,z_=/\\(\\)?/g,U_=H_(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(Y_,function(n,r,a,o){t.push(a?o.replace(z_,"$1"):r||n)}),t}),V_=U_;function Z_(e,t){for(var n=-1,r=e==null?0:e.length,a=Array(r);++n<r;)a[n]=t(e[n],n,e);return a}var tb=Z_,WS=Jd,W_=tb,$_=fo,G_=zp,q_=1/0,$S=WS?WS.prototype:void 0,GS=$S?$S.toString:void 0;function fC(e){if(typeof e=="string")return e;if($_(e))return W_(e,fC)+"";if(G_(e))return GS?GS.call(e):"";var t=e+"";return t=="0"&&1/e==-q_?"-0":t}var J_=fC,K_=J_;function Q_(e){return e==null?"":K_(e)}var X_=Q_,eH=fo,tH=X1,nH=V_,rH=X_;function aH(e,t){return eH(e)?e:tH(e,t)?[e]:nH(rH(e))}var rv=aH,oH=zp,iH=1/0;function sH(e){if(typeof e=="string"||oH(e))return e;var t=e+"";return t=="0"&&1/e==-iH?"-0":t}var Zp=sH,lH=rv,uH=Zp;function cH(e,t){t=lH(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[uH(t[n++])];return n&&n==r?e:void 0}var av=cH,dH=av;function fH(e,t,n){var r=e==null?void 0:dH(e,t);return r===void 0?n:r}var hH=fH;function pH(e,t){return e!=null&&t in Object(e)}var mH=pH,gH=rv,yH=G1,vH=fo,wH=_1,bH=B1,DH=Zp;function SH(e,t,n){t=gH(t,e);for(var r=-1,a=t.length,o=!1;++r<a;){var s=DH(t[r]);if(!(o=e!=null&&n(e,s)))break;e=e[s]}return o||++r!=a?o:(a=e==null?0:e.length,!!a&&bH(a)&&wH(s,a)&&(vH(e)||yH(e)))}var IH=SH,TH=mH,EH=IH;function CH(e,t){return e!=null&&EH(e,t,TH)}var xH=CH,MH=Q1,NH=hH,kH=xH,AH=X1,FH=uC,OH=cC,PH=Zp,jH=1,LH=2;function RH(e,t){return AH(e)&&FH(t)?OH(PH(e),t):function(n){var r=NH(n,e);return r===void 0&&r===t?kH(n,e):MH(t,r,jH|LH)}}var BH=RH;function _H(e){return e}var ov=_H;function HH(e){return function(t){return t==null?void 0:t[e]}}var YH=HH,zH=av;function UH(e){return function(t){return zH(t,e)}}var VH=UH,ZH=YH,WH=VH,$H=X1,GH=Zp;function qH(e){return $H(e)?ZH(GH(e)):WH(e)}var JH=qH,KH=M_,QH=BH,XH=ov,eY=fo,tY=JH;function nY(e){return typeof e=="function"?e:e==null?XH:typeof e=="object"?eY(e)?QH(e[0],e[1]):KH(e):tY(e)}var iv=nY,rY=c_,aY=iv,oY=VE,iY=Math.max;function sY(e,t,n){var r=e==null?0:e.length;if(!r)return-1;var a=n==null?0:oY(n);return a<0&&(a=iY(r+a,0)),rY(e,aY(t),a)}var lY=sY;const uY=er(lY);var cY=Math.ceil,dY=Math.max;function fY(e,t,n,r){for(var a=-1,o=dY(cY((t-e)/(n||1)),0),s=Array(o);o--;)s[r?o:++a]=e,e+=n;return s}var hY=fY,pY=hY,mY=qy,Z0=UE;function gY(e){return function(t,n,r){return r&&typeof r!="number"&&mY(t,n,r)&&(n=r=void 0),t=Z0(t),n===void 0?(n=t,t=0):n=Z0(n),r=r===void 0?t<n?1:-1:Z0(r),pY(t,n,r,e)}}var yY=gY,vY=yY,wY=vY(),bY=wY;const DY=er(bY);var qS=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function SY(e,t){return!!(e===t||qS(e)&&qS(t))}function IY(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!SY(e[n],t[n]))return!1;return!0}function hC(e,t){t===void 0&&(t=IY);var n=null;function r(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];if(n&&n.lastThis===this&&t(a,n.lastArgs))return n.lastResult;var s=e.apply(this,a);return n={lastResult:s,lastArgs:a,lastThis:this},s}return r.clear=function(){n=null},r}var JS=Jd,TY=G1,EY=fo,KS=JS?JS.isConcatSpreadable:void 0;function CY(e){return EY(e)||TY(e)||!!(KS&&e&&e[KS])}var xY=CY,MY=W1,NY=xY;function pC(e,t,n,r,a){var o=-1,s=e.length;for(n||(n=NY),a||(a=[]);++o<s;){var c=e[o];t>0&&n(c)?t>1?pC(c,t-1,n,r,a):MY(a,c):r||(a[a.length]=c)}return a}var mC=pC;function kY(e){return function(t,n,r){for(var a=-1,o=Object(t),s=r(t),c=s.length;c--;){var d=s[e?c:++a];if(n(o[d],d,o)===!1)break}return t}}var AY=kY,FY=AY,OY=FY(),PY=OY,jY=PY,LY=Vp;function RY(e,t){return e&&jY(e,t,LY)}var nb=RY,BY=Yp;function _Y(e,t){return function(n,r){if(n==null)return n;if(!BY(n))return e(n,r);for(var a=n.length,o=t?a:-1,s=Object(n);(t?o--:++o<a)&&r(s[o],o,s)!==!1;);return n}}var HY=_Y,YY=nb,zY=HY,UY=zY(YY),VY=UY,ZY=VY,WY=Yp;function $Y(e,t){var n=-1,r=WY(e)?Array(e.length):[];return ZY(e,function(a,o,s){r[++n]=t(a,o,s)}),r}var GY=$Y;function qY(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}var JY=qY,QS=zp;function KY(e,t){if(e!==t){var n=e!==void 0,r=e===null,a=e===e,o=QS(e),s=t!==void 0,c=t===null,d=t===t,p=QS(t);if(!c&&!p&&!o&&e>t||o&&s&&d&&!c&&!p||r&&s&&d||!n&&d||!a)return 1;if(!r&&!o&&!p&&e<t||p&&n&&a&&!r&&!o||c&&n&&a||!s&&a||!d)return-1}return 0}var QY=KY,XY=QY;function ez(e,t,n){for(var r=-1,a=e.criteria,o=t.criteria,s=a.length,c=n.length;++r<s;){var d=XY(a[r],o[r]);if(d){if(r>=c)return d;var p=n[r];return d*(p=="desc"?-1:1)}}return e.index-t.index}var tz=ez,W0=tb,nz=av,rz=iv,az=GY,oz=JY,iz=tv,sz=tz,lz=ov,uz=fo;function cz(e,t,n){t.length?t=W0(t,function(o){return uz(o)?function(s){return nz(s,o.length===1?o[0]:o)}:o}):t=[lz];var r=-1;t=W0(t,iz(rz));var a=az(e,function(o,s,c){var d=W0(t,function(p){return p(o)});return{criteria:d,index:++r,value:o}});return oz(a,function(o,s){return sz(o,s,n)})}var dz=cz;function fz(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}var hz=fz,pz=hz,XS=Math.max;function mz(e,t,n){return t=XS(t===void 0?e.length-1:t,0),function(){for(var r=arguments,a=-1,o=XS(r.length-t,0),s=Array(o);++a<o;)s[a]=r[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=r[a];return c[t]=n(s),pz(e,this,c)}}var gC=mz;function gz(e){return function(){return e}}var yz=gz,vz=Yu,wz=function(){try{var e=vz(Object,"defineProperty");return e({},"",{}),e}catch{}}(),yC=wz,bz=yz,e2=yC,Dz=ov,Sz=e2?function(e,t){return e2(e,"toString",{configurable:!0,enumerable:!1,value:bz(t),writable:!0})}:Dz,Iz=Sz,Tz=800,Ez=16,Cz=Date.now;function xz(e){var t=0,n=0;return function(){var r=Cz(),a=Ez-(r-n);if(n=r,a>0){if(++t>=Tz)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}var Mz=xz,Nz=Iz,kz=Mz,Az=kz(Nz),vC=Az,Fz=ov,Oz=gC,Pz=vC;function jz(e,t){return Pz(Oz(e,t,Fz),e+"")}var wC=jz,Lz=mC,Rz=dz,Bz=wC,t2=qy,_z=Bz(function(e,t){if(e==null)return[];var n=t.length;return n>1&&t2(e,t[0],t[1])?t=[]:n>2&&t2(t[0],t[1],t[2])&&(t=[t[0]]),Rz(e,Lz(t,1),[])}),Hz=_z;const Yz=er(Hz);function Vw(e,t){var n=H1(e);return n?n.innerWidth:t?e.clientWidth:ku(e).width}function bC(e){return TE(e)||_E(e)||P1(e)||EE()}function zz(e,t){for(var n=-1,r=e==null?0:e.length;++n<r&&t(e[n],n,e)!==!1;);return e}var DC=zz,n2=yC;function Uz(e,t,n){t=="__proto__"&&n2?n2(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}var rb=Uz,Vz=rb,Zz=Hp,Wz=Object.prototype,$z=Wz.hasOwnProperty;function Gz(e,t,n){var r=e[t];(!($z.call(e,t)&&Zz(r,n))||n===void 0&&!(t in e))&&Vz(e,t,n)}var SC=Gz,qz=SC,Jz=rb;function Kz(e,t,n,r){var a=!n;n||(n={});for(var o=-1,s=t.length;++o<s;){var c=t[o],d=r?r(n[c],e[c],c,n,e):void 0;d===void 0&&(d=e[c]),a?Jz(n,c,d):qz(n,c,d)}return n}var Wp=Kz,Qz=Wp,Xz=Vp;function eU(e,t){return e&&Qz(t,Xz(t),e)}var tU=eU;function nU(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var rU=nU,aU=Ss,oU=K1,iU=rU,sU=Object.prototype,lU=sU.hasOwnProperty;function uU(e){if(!aU(e))return iU(e);var t=oU(e),n=[];for(var r in e)r=="constructor"&&(t||!lU.call(e,r))||n.push(r);return n}var cU=uU,dU=rC,fU=cU,hU=Yp;function pU(e){return hU(e)?dU(e,!0):fU(e)}var sv=pU,mU=Wp,gU=sv;function yU(e,t){return e&&mU(t,gU(t),e)}var vU=yU,Ey={exports:{}};Ey.exports;(function(e,t){var n=Oi,r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,s=o?n.Buffer:void 0,c=s?s.allocUnsafe:void 0;function d(p,m){if(m)return p.slice();var g=p.length,v=c?c(g):new p.constructor(g);return p.copy(v),v}e.exports=d})(Ey,Ey.exports);var wU=Ey.exports;function bU(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}var DU=bU,SU=Wp,IU=$1;function TU(e,t){return SU(e,IU(e),t)}var EU=TU,CU=aC,xU=CU(Object.getPrototypeOf,Object),lv=xU,MU=W1,NU=lv,kU=$1,AU=tC,FU=Object.getOwnPropertySymbols,OU=FU?function(e){for(var t=[];e;)MU(t,kU(e)),e=NU(e);return t}:AU,IC=OU,PU=Wp,jU=IC;function LU(e,t){return PU(e,jU(e),t)}var RU=LU,BU=eC,_U=IC,HU=sv;function YU(e){return BU(e,HU,_U)}var TC=YU,zU=Object.prototype,UU=zU.hasOwnProperty;function VU(e){var t=e.length,n=new e.constructor(t);return t&&typeof e[0]=="string"&&UU.call(e,"index")&&(n.index=e.index,n.input=e.input),n}var ZU=VU,r2=XE;function WU(e){var t=new e.constructor(e.byteLength);return new r2(t).set(new r2(e)),t}var ab=WU,$U=ab;function GU(e,t){var n=t?$U(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}var qU=GU,JU=/\w*$/;function KU(e){var t=new e.constructor(e.source,JU.exec(e));return t.lastIndex=e.lastIndex,t}var QU=KU,a2=Jd,o2=a2?a2.prototype:void 0,i2=o2?o2.valueOf:void 0;function XU(e){return i2?Object(i2.call(e)):{}}var eV=XU,tV=ab;function nV(e,t){var n=t?tV(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}var rV=nV,aV=ab,oV=qU,iV=QU,sV=eV,lV=rV,uV="[object Boolean]",cV="[object Date]",dV="[object Map]",fV="[object Number]",hV="[object RegExp]",pV="[object Set]",mV="[object String]",gV="[object Symbol]",yV="[object ArrayBuffer]",vV="[object DataView]",wV="[object Float32Array]",bV="[object Float64Array]",DV="[object Int8Array]",SV="[object Int16Array]",IV="[object Int32Array]",TV="[object Uint8Array]",EV="[object Uint8ClampedArray]",CV="[object Uint16Array]",xV="[object Uint32Array]";function MV(e,t,n){var r=e.constructor;switch(t){case yV:return aV(e);case uV:case cV:return new r(+e);case vV:return oV(e,n);case wV:case bV:case DV:case SV:case IV:case TV:case EV:case CV:case xV:return lV(e,n);case dV:return new r;case fV:case mV:return new r(e);case hV:return iV(e);case pV:return new r;case gV:return sV(e)}}var NV=MV,kV=Ss,s2=Object.create,AV=function(){function e(){}return function(t){if(!kV(t))return{};if(s2)return s2(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}(),EC=AV,FV=EC,OV=lv,PV=K1;function jV(e){return typeof e.constructor=="function"&&!PV(e)?FV(OV(e)):{}}var LV=jV,RV=nv,BV=Cl,_V="[object Map]";function HV(e){return BV(e)&&RV(e)==_V}var YV=HV,zV=YV,UV=tv,l2=q1,u2=l2&&l2.isMap,VV=u2?UV(u2):zV,ZV=VV,WV=nv,$V=Cl,GV="[object Set]";function qV(e){return $V(e)&&WV(e)==GV}var JV=qV,KV=JV,QV=tv,c2=q1,d2=c2&&c2.isSet,XV=d2?QV(d2):KV,eZ=XV,tZ=Z1,nZ=DC,rZ=SC,aZ=tU,oZ=vU,iZ=wU,sZ=DU,lZ=EU,uZ=RU,cZ=oC,dZ=TC,fZ=nv,hZ=ZU,pZ=NV,mZ=LV,gZ=fo,yZ=ev,vZ=ZV,wZ=Ss,bZ=eZ,DZ=Vp,SZ=sv,IZ=1,TZ=2,EZ=4,CC="[object Arguments]",CZ="[object Array]",xZ="[object Boolean]",MZ="[object Date]",NZ="[object Error]",xC="[object Function]",kZ="[object GeneratorFunction]",AZ="[object Map]",FZ="[object Number]",MC="[object Object]",OZ="[object RegExp]",PZ="[object Set]",jZ="[object String]",LZ="[object Symbol]",RZ="[object WeakMap]",BZ="[object ArrayBuffer]",_Z="[object DataView]",HZ="[object Float32Array]",YZ="[object Float64Array]",zZ="[object Int8Array]",UZ="[object Int16Array]",VZ="[object Int32Array]",ZZ="[object Uint8Array]",WZ="[object Uint8ClampedArray]",$Z="[object Uint16Array]",GZ="[object Uint32Array]",ln={};ln[CC]=ln[CZ]=ln[BZ]=ln[_Z]=ln[xZ]=ln[MZ]=ln[HZ]=ln[YZ]=ln[zZ]=ln[UZ]=ln[VZ]=ln[AZ]=ln[FZ]=ln[MC]=ln[OZ]=ln[PZ]=ln[jZ]=ln[LZ]=ln[ZZ]=ln[WZ]=ln[$Z]=ln[GZ]=!0;ln[NZ]=ln[xC]=ln[RZ]=!1;function ty(e,t,n,r,a,o){var s,c=t&IZ,d=t&TZ,p=t&EZ;if(n&&(s=a?n(e,r,a,o):n(e)),s!==void 0)return s;if(!wZ(e))return e;var m=gZ(e);if(m){if(s=hZ(e),!c)return sZ(e,s)}else{var g=fZ(e),v=g==xC||g==kZ;if(yZ(e))return iZ(e,c);if(g==MC||g==CC||v&&!a){if(s=d||v?{}:mZ(e),!c)return d?uZ(e,oZ(s,e)):lZ(e,aZ(s,e))}else{if(!ln[g])return a?e:{};s=pZ(e,g,c)}}o||(o=new tZ);var D=o.get(e);if(D)return D;o.set(e,s),bZ(e)?e.forEach(function(E){s.add(ty(E,t,n,E,e,o))}):vZ(e)&&e.forEach(function(E,O){s.set(O,ty(E,t,n,O,e,o))});var S=p?d?dZ:cZ:d?SZ:DZ,T=m?void 0:S(e);return nZ(T||e,function(E,O){T&&(O=E,E=e[O]),rZ(s,O,ty(E,t,n,O,e,o))}),s}var qZ=ty;function JZ(e){var t=e==null?0:e.length;return t?e[t-1]:void 0}var KZ=JZ,QZ=av,XZ=HE;function eW(e,t){return t.length<2?e:QZ(e,XZ(t,0,-1))}var tW=eW,nW=rv,rW=KZ,aW=tW,oW=Zp;function iW(e,t){return t=nW(t,e),e=aW(e,t),e==null||delete e[oW(rW(t))]}var sW=iW,lW=Kd,uW=lv,cW=Cl,dW="[object Object]",fW=Function.prototype,hW=Object.prototype,NC=fW.toString,pW=hW.hasOwnProperty,mW=NC.call(Object);function gW(e){if(!cW(e)||lW(e)!=dW)return!1;var t=uW(e);if(t===null)return!0;var n=pW.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&NC.call(n)==mW}var yW=gW,vW=yW;function wW(e){return vW(e)?void 0:e}var bW=wW,DW=mC;function SW(e){var t=e==null?0:e.length;return t?DW(e,1):[]}var IW=SW,TW=IW,EW=gC,CW=vC;function xW(e){return CW(EW(e,void 0,TW),e+"")}var MW=xW,NW=tb,kW=qZ,AW=sW,FW=rv,OW=Wp,PW=bW,jW=MW,LW=TC,RW=1,BW=2,_W=4,HW=jW(function(e,t){var n={};if(e==null)return n;var r=!1;t=NW(t,function(o){return o=FW(o,e),r||(r=o.length>1),o}),OW(e,LW(e),n),r&&(n=kW(n,RW|BW|_W,PW));for(var a=t.length;a--;)AW(n,t[a]);return n}),YW=HW;const zW=er(YW);var UW=wC,VW=Hp,ZW=qy,WW=sv,kC=Object.prototype,$W=kC.hasOwnProperty,GW=UW(function(e,t){e=Object(e);var n=-1,r=t.length,a=r>2?t[2]:void 0;for(a&&ZW(t[0],t[1],a)&&(r=1);++n<r;)for(var o=t[n],s=WW(o),c=-1,d=s.length;++c<d;){var p=s[c],m=e[p];(m===void 0||VW(m,kC[p])&&!$W.call(e,p))&&(e[p]=o[p])}return e}),qW=GW;const JW=er(qW);var KW=DC,QW=EC,XW=nb,e$=iv,t$=lv,n$=fo,r$=ev,a$=R1,o$=Ss,i$=J1;function s$(e,t,n){var r=n$(e),a=r||r$(e)||i$(e);if(t=e$(t),n==null){var o=e&&e.constructor;a?n=r?new o:[]:o$(e)?n=a$(o)?QW(t$(e)):{}:n={}}return(a?KW:XW)(e,function(s,c,d){return t(n,s,c,d)}),n}var l$=s$;const u$=er(l$);var c$=rb,d$=nb,f$=iv;function h$(e,t){var n={};return t=f$(t),d$(e,function(r,a,o){c$(n,a,t(r,a,o))}),n}var p$=h$;const m$=er(p$);var g$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){r.prototype.isBetween=function(o,s,c,d){var p=a(o),m=a(s),g=(d=d||"()")[0]==="(",v=d[1]===")";return(g?this.isAfter(p,c):!this.isBefore(p,c))&&(v?this.isBefore(m,c):!this.isAfter(m,c))||(g?this.isBefore(p,c):!this.isAfter(p,c))&&(v?this.isAfter(m,c):!this.isBefore(m,c))}}})})(g$);var y$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r){r.prototype.isSameOrAfter=function(a,o){return this.isSame(a,o)||this.isAfter(a,o)}}})})(y$);var v$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r){r.prototype.isSameOrBefore=function(a,o){return this.isSame(a,o)||this.isBefore(a,o)}}})})(v$);var w$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){var o=r.prototype,s=function(g){return g&&(g.indexOf?g:g.s)},c=function(g,v,D,S,T){var E=g.name?g:g.$locale(),O=s(E[v]),k=s(E[D]),j=O||k.map(function(B){return B.slice(0,S)});if(!T)return j;var F=E.weekStart;return j.map(function(B,R){return j[(R+(F||0))%7]})},d=function(){return a.Ls[a.locale()]},p=function(g,v){return g.formats[v]||function(D){return D.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(S,T,E){return T||E.slice(1)})}(g.formats[v.toUpperCase()])},m=function(){var g=this;return{months:function(v){return v?v.format("MMMM"):c(g,"months")},monthsShort:function(v){return v?v.format("MMM"):c(g,"monthsShort","months",3)},firstDayOfWeek:function(){return g.$locale().weekStart||0},weekdays:function(v){return v?v.format("dddd"):c(g,"weekdays")},weekdaysMin:function(v){return v?v.format("dd"):c(g,"weekdaysMin","weekdays",2)},weekdaysShort:function(v){return v?v.format("ddd"):c(g,"weekdaysShort","weekdays",3)},longDateFormat:function(v){return p(g.$locale(),v)},meridiem:this.$locale().meridiem,ordinal:this.$locale().ordinal}};o.localeData=function(){return m.bind(this)()},a.localeData=function(){var g=d();return{firstDayOfWeek:function(){return g.weekStart||0},weekdays:function(){return a.weekdays()},weekdaysShort:function(){return a.weekdaysShort()},weekdaysMin:function(){return a.weekdaysMin()},months:function(){return a.months()},monthsShort:function(){return a.monthsShort()},longDateFormat:function(v){return p(g,v)},meridiem:g.meridiem,ordinal:g.ordinal}},a.months=function(){return c(d(),"months")},a.monthsShort=function(){return c(d(),"monthsShort","months",3)},a.weekdays=function(g){return c(d(),"weekdays",null,null,g)},a.weekdaysShort=function(g){return c(d(),"weekdaysShort","weekdays",3,g)},a.weekdaysMin=function(g){return c(d(),"weekdaysMin","weekdays",2,g)}}})})(w$);var b$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(r,a,o){var s=a.prototype,c=s.format;o.en.formats=n,s.format=function(d){d===void 0&&(d="YYYY-MM-DDTHH:mm:ssZ");var p=this.$locale().formats,m=function(g,v){return g.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,S,T){var E=T&&T.toUpperCase();return S||v[T]||n[T]||v[E].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,k,j){return k||j.slice(1)})})}(d,p===void 0?{}:p);return c.call(this,m)}}})})(b$);var D$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){return function(n,r,a){var o=function(s,c){if(!c||!c.length||c.length===1&&!c[0]||c.length===1&&Array.isArray(c[0])&&!c[0].length)return null;var d;c.length===1&&c[0].length>0&&(c=c[0]),d=(c=c.filter(function(m){return m}))[0];for(var p=1;p<c.length;p+=1)c[p].isValid()&&!c[p][s](d)||(d=c[p]);return d};a.max=function(){var s=[].slice.call(arguments,0);return o("isAfter",s)},a.min=function(){var s=[].slice.call(arguments,0);return o("isBefore",s)}}})})(D$);var S$={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Jn,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,a=/([+-]|\d\d)/g;return function(o,s,c){var d=s.prototype;c.utc=function(T){var E={date:T,utc:!0,args:arguments};return new s(E)},d.utc=function(T){var E=c(this.toDate(),{locale:this.$L,utc:!0});return T?E.add(this.utcOffset(),n):E},d.local=function(){return c(this.toDate(),{locale:this.$L,utc:!1})};var p=d.parse;d.parse=function(T){T.utc&&(this.$u=!0),this.$utils().u(T.$offset)||(this.$offset=T.$offset),p.call(this,T)};var m=d.init;d.init=function(){if(this.$u){var T=this.$d;this.$y=T.getUTCFullYear(),this.$M=T.getUTCMonth(),this.$D=T.getUTCDate(),this.$W=T.getUTCDay(),this.$H=T.getUTCHours(),this.$m=T.getUTCMinutes(),this.$s=T.getUTCSeconds(),this.$ms=T.getUTCMilliseconds()}else m.call(this)};var g=d.utcOffset;d.utcOffset=function(T,E){var O=this.$utils().u;if(O(T))return this.$u?0:O(this.$offset)?g.call(this):this.$offset;if(typeof T=="string"&&(T=function(B){B===void 0&&(B="");var R=B.match(r);if(!R)return null;var z=(""+R[0]).match(a)||["-",0,0],H=z[0],Y=60*+z[1]+ +z[2];return Y===0?0:H==="+"?Y:-Y}(T),T===null))return this;var k=Math.abs(T)<=16?60*T:T,j=this;if(E)return j.$offset=k,j.$u=T===0,j;if(T!==0){var F=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(j=this.local().add(k+F,n)).$offset=k,j.$x.$localOffset=F}else j=this.utc();return j};var v=d.format;d.format=function(T){var E=T||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return v.call(this,E)},d.valueOf=function(){var T=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*T},d.isUTC=function(){return!!this.$u},d.toISOString=function(){return this.toDate().toISOString()},d.toString=function(){return this.toDate().toUTCString()};var D=d.toDate;d.toDate=function(T){return T==="s"&&this.$offset?c(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():D.call(this)};var S=d.diff;d.diff=function(T,E,O){if(T&&this.$u===T.$u)return S.call(this,T,E,O);var k=this.local(),j=c(T).local();return S.call(k,j,E,O)}}})})(S$);function ds(e){return e.children}var Da={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"},Qr={MONTH:"month",WEEK:"week",WORK_WEEK:"work_week",DAY:"day",AGENDA:"agenda"},f2=Object.keys(Qr).map(function(e){return Qr[e]});Ae.oneOfType([Ae.string,Ae.func]);Ae.any;Ae.func;Ae.oneOfType([Ae.arrayOf(Ae.oneOf(f2)),Ae.objectOf(function(e,t){var n=f2.indexOf(t)!==-1&&typeof e[t]=="boolean";if(n)return null;for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;o<r;o++)a[o-2]=arguments[o];return Ae.elementType.apply(Ae,[e,t].concat(a))})]);Ae.oneOfType([Ae.oneOf(["overlap","no-overlap"]),Ae.func]);function yn(e,t){e&&e.apply(null,[].concat(t))}var h2={seconds:1e3,minutes:1e3*60,hours:1e3*60*60,day:1e3*60*60*24};function AC(e,t){var n=Mr(e,"month");return Mr(n,"week",t.startOfWeek())}function FC(e,t){var n=by(e,"month");return by(n,"week",t.startOfWeek())}function I$(e,t){for(var n=AC(e,t),r=FC(e,t),a=[];Gd(n,r,"day");)a.push(n),n=Ro(n,1,"day");return a}function T$(e,t){var n=Mr(e,t);return Bp(n,e)?n:Ro(n,1,t)}function E$(e,t){for(var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",r=e,a=[];Gd(r,t,n);)a.push(r),r=Ro(r,1,n);return a}function C$(e,t){return t==null&&e==null?null:(t==null&&(t=new Date),e==null&&(e=new Date),e=Mr(e,"day"),e=hp(e,hp(t)),e=jd(e,jd(t)),e=fp(e,fp(t)),dp(e,dp(t)))}function p2(e){return hp(e)===0&&jd(e)===0&&fp(e)===0&&dp(e)===0}function x$(e,t,n,r){return n==="day"&&(n="date"),Math.abs(oS[n](e,void 0,r)-oS[n](t,void 0,r))}function ob(e,t,n){return!n||n==="milliseconds"?Math.abs(+e-+t):Math.round(Math.abs(+Mr(e,n)/h2[n]-+Mr(t,n)/h2[n]))}var M$=Ae.oneOfType([Ae.string,Ae.func]);function N$(e,t,n,r,a){var o=typeof r=="function"?r(n,a,e):t.call(e,n,r,a);return op(o==null||typeof o=="string","`localizer format(..)` must return a string, null, or undefined"),o}function k$(e,t,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),0,t+n,0,0)}function ib(e,t){return e.getTimezoneOffset()-t.getTimezoneOffset()}function A$(e,t){return ob(e,t,"minutes")+ib(e,t)}function F$(e){var t=Mr(e,"day");return ob(t,e,"minutes")+ib(t,e)}function O$(e,t){return L1(e,t,"day")}function P$(e,t,n){var r=Bp(e,t,"minutes");return r?_p(t,n,"minutes"):Gy(t,n,"minutes")}function Zw(e,t){return x$(e,t,"day")}function j$(e){var t=e.evtA,n=t.start,r=t.end,a=t.allDay,o=e.evtB,s=o.start,c=o.end,d=o.allDay,p=+Mr(n,"day")-+Mr(s,"day"),m=Zw(n,r),g=Zw(s,c);return p||g-m||!!d-!!a||+n-+s||+r-+c}function L$(e){var t=e.event,n=t.start,r=t.end,a=e.range,o=a.start,s=a.end,c=Mr(n,"day"),d=Gd(c,s,"day"),p=j1(c,r,"minutes"),m=p?Gy(r,o,"minutes"):_p(r,o,"minutes");return d&&m}function R$(e,t){return Bp(e,t,"day")}function B$(e,t){return p2(e)&&p2(t)}var _$=yr(function e(t){var n=this;gr(this,e),op(typeof t.format=="function","date localizer `format(..)` must be a function"),op(typeof t.firstOfWeek=="function","date localizer `firstOfWeek(..)` must be a function"),this.propType=t.propType||M$,this.formats=t.formats,this.format=function(){for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return N$.apply(void 0,[n,t.format].concat(a))},this.startOfWeek=t.firstOfWeek,this.merge=t.merge||C$,this.inRange=t.inRange||jE,this.lt=t.lt||L1,this.lte=t.lte||Gd,this.gt=t.gt||Gy,this.gte=t.gte||_p,this.eq=t.eq||Bp,this.neq=t.neq||j1,this.startOf=t.startOf||Mr,this.endOf=t.endOf||by,this.add=t.add||Ro,this.range=t.range||E$,this.diff=t.diff||ob,this.ceil=t.ceil||T$,this.min=t.min||OE,this.max=t.max||PE,this.minutes=t.minutes||jd,this.daySpan=t.daySpan||Zw,this.firstVisibleDay=t.firstVisibleDay||AC,this.lastVisibleDay=t.lastVisibleDay||FC,this.visibleDays=t.visibleDays||I$,this.getSlotDate=t.getSlotDate||k$,this.getTimezoneOffset=t.getTimezoneOffset||function(r){return r.getTimezoneOffset()},this.getDstOffset=t.getDstOffset||ib,this.getTotalMin=t.getTotalMin||A$,this.getMinutesFromMidnight=t.getMinutesFromMidnight||F$,this.continuesPrior=t.continuesPrior||O$,this.continuesAfter=t.continuesAfter||P$,this.sortEvents=t.sortEvents||j$,this.inEventRange=t.inEventRange||L$,this.isSameDate=t.isSameDate||R$,this.startAndEndAreDateOnly=t.startAndEndAreDateOnly||B$,this.segmentOffset=t.browserTZOffset?t.browserTZOffset():0});function H$(e,t,n,r){var a=rn(rn({},e.formats),n);return rn(rn({},e),{},{messages:r,startOfWeek:function(){return e.startOfWeek(t)},format:function(s,c){return e.format(s,a[c]||c,t)}})}var Y$={date:"Date",time:"Time",event:"Event",allDay:"All Day",week:"Week",work_week:"Work Week",day:"Day",month:"Month",previous:"Back",next:"Next",yesterday:"Yesterday",tomorrow:"Tomorrow",today:"Today",agenda:"Agenda",noEventsInRange:"There are no events in this range.",showMore:function(t){return"+".concat(t," more")}};function z$(e){return rn(rn({},Y$),e)}function U$(e){var t=e.ref,n=e.callback;A.useEffect(function(){var r=function(o){t.current&&!t.current.contains(o.target)&&n()};return document.addEventListener("mousedown",r),function(){document.removeEventListener("mousedown",r)}},[t,n])}var V$=["style","className","event","selected","isAllDay","onSelect","onDoubleClick","onKeyPress","localizer","continuesPrior","continuesAfter","accessors","getters","children","components","slotStart","slotEnd"],OC=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.style,o=r.className,s=r.event,c=r.selected,d=r.isAllDay,p=r.onSelect,m=r.onDoubleClick,g=r.onKeyPress,v=r.localizer,D=r.continuesPrior,S=r.continuesAfter,T=r.accessors,E=r.getters,O=r.children,k=r.components,j=k.event,F=k.eventWrapper,B=r.slotStart,R=r.slotEnd,z=Fi(r,V$);delete z.resizable;var H=T.title(s),Y=T.tooltip(s),U=T.end(s),J=T.start(s),Q=T.allDay(s),le=d||Q||v.diff(J,v.ceil(U,"day"),"day")>1,pe=E.eventProp(s,J,U,c),ie=$.createElement("div",{className:"rbc-event-content",title:Y||void 0},j?$.createElement(j,{event:s,continuesPrior:D,continuesAfter:S,title:H,isAllDay:Q,localizer:v,slotStart:B,slotEnd:R}):H);return $.createElement(F,Object.assign({},this.props,{type:"date"}),$.createElement("div",Object.assign({},z,{style:rn(rn({},pe.style),a),className:Qn("rbc-event",o,pe.className,{"rbc-selected":c,"rbc-event-allday":le,"rbc-event-continues-prior":D,"rbc-event-continues-after":S}),onClick:function(fe){return p&&p(s,fe)},onDoubleClick:function(fe){return m&&m(s,fe)},onKeyDown:function(fe){return g&&g(s,fe)}}),typeof O=="function"?O(ie):ie))}}]),t}($.Component);function uv(e,t){return!e||t==null?!1:l_(e,t)}function PC(e,t){var n=e.right-e.left,r=n/t;return r}function jC(e,t,n,r){var a=PC(e,r);return n?r-1-Math.floor((t-e.left)/a):Math.floor((t-e.left)/a)}function Z$(e,t){var n=t.x,r=t.y;return r>=e.top&&r<=e.bottom&&n>=e.left&&n<=e.right}function W$(e,t,n,r,a){var o=-1,s=-1,c=r-1,d=PC(t,r),p=jC(t,n.x,a,r),m=t.top<n.y&&t.bottom>n.y,g=t.top<e.y&&t.bottom>e.y,v=e.y>t.bottom,D=t.top>e.y,S=n.top<t.top&&n.bottom>t.bottom;return S&&(o=0,s=c),m&&(D?(o=0,s=p):v&&(o=p,s=c)),g&&(o=s=a?c-Math.floor((e.x-t.left)/d):Math.floor((e.x-t.left)/d),m?p<o?o=p:s=p:e.y<n.y?s=c:o=0),{startIdx:o,endIdx:s}}function $$(e){var t=e.target,n=e.offset,r=e.container,a=e.box,o=ku(t),s=o.top,c=o.left,d=o.width,p=o.height,m=ku(r),g=m.top,v=m.left,D=m.width,S=m.height,T=ku(a),E=T.width,O=T.height,k=g+S,j=v+D,F=s+O,B=c+E,R=n.x,z=n.y,H=F>k?s-O-z:s+z+p,Y=B>j?c+R-E+d:c+R;return{topOffset:H,leftOffset:Y}}function G$(e){var t=e.containerRef,n=e.accessors,r=e.getters,a=e.selected,o=e.components,s=e.localizer,c=e.position,d=e.show,p=e.events,m=e.slotStart,g=e.slotEnd,v=e.onSelect,D=e.onDoubleClick,S=e.onKeyPress,T=e.handleDragStart,E=e.popperRef,O=e.target,k=e.offset;U$({ref:E,callback:d}),A.useLayoutEffect(function(){var B=$$({target:O,offset:k,container:t.current,box:E.current}),R=B.topOffset,z=B.leftOffset;E.current.style.top="".concat(R,"px"),E.current.style.left="".concat(z,"px")},[k.x,k.y,O]);var j=c.width,F={minWidth:j+j/2};return $.createElement("div",{style:F,className:"rbc-overlay",ref:E},$.createElement("div",{className:"rbc-overlay-header"},s.format(m,"dayHeaderFormat")),p.map(function(B,R){return $.createElement(OC,{key:R,type:"popup",localizer:s,event:B,getters:r,onSelect:v,accessors:n,components:o,onDoubleClick:D,onKeyPress:S,continuesPrior:s.lt(n.end(B),m,"day"),continuesAfter:s.gte(n.start(B),g,"day"),slotStart:m,slotEnd:g,selected:uv(B,a),draggable:!0,onDragStart:function(){return T(B)},onDragEnd:function(){return d()}})}))}var LC=$.forwardRef(function(e,t){return $.createElement(G$,Object.assign({},e,{popperRef:t}))});LC.propTypes={accessors:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,components:Ae.object.isRequired,localizer:Ae.object.isRequired,position:Ae.object.isRequired,show:Ae.func.isRequired,events:Ae.array.isRequired,slotStart:Ae.instanceOf(Date).isRequired,slotEnd:Ae.instanceOf(Date),onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func,handleDragStart:Ae.func,style:Ae.object,offset:Ae.shape({x:Ae.number,y:Ae.number})};function q$(e){var t=e.containerRef,n=e.popupOffset,r=n===void 0?5:n,a=e.overlay,o=e.accessors,s=e.localizer,c=e.components,d=e.getters,p=e.selected,m=e.handleSelectEvent,g=e.handleDoubleClickEvent,v=e.handleKeyPressEvent,D=e.handleDragStart,S=e.onHide,T=e.overlayDisplay,E=A.useRef(null);if(!a.position)return null;var O=r;isNaN(r)||(O={x:r,y:r});var k=a.position,j=a.events,F=a.date,B=a.end;return $.createElement(j7,{rootClose:!0,flip:!0,show:!0,placement:"bottom",onHide:S,target:a.target},function(R){var z=R.props;return $.createElement(LC,Object.assign({},z,{containerRef:t,ref:E,target:a.target,offset:O,accessors:o,getters:d,selected:p,components:c,localizer:s,position:k,show:T,events:j,slotStart:F,slotEnd:B,onSelect:m,onDoubleClick:g,onKeyPress:v,handleDragStart:D}))})}var sb=$.forwardRef(function(e,t){return $.createElement(q$,Object.assign({},e,{containerRef:t}))});sb.propTypes={popupOffset:Ae.oneOfType([Ae.number,Ae.shape({x:Ae.number,y:Ae.number})]),overlay:Ae.shape({position:Ae.object,events:Ae.array,date:Ae.instanceOf(Date),end:Ae.instanceOf(Date)}),accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,selected:Ae.object,handleSelectEvent:Ae.func,handleDoubleClickEvent:Ae.func,handleKeyPressEvent:Ae.func,handleDragStart:Ae.func,onHide:Ae.func,overlayDisplay:Ae.func};function Lr(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:document;return Vh(n,e,t,{passive:!1})}function J$(e,t,n){return!e||pp(e,document.elementFromPoint(t,n))}function K$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return lC(a,".rbc-event",e)}function Q$(e,t){var n=t.clientX,r=t.clientY,a=document.elementFromPoint(n,r);return lC(a,".rbc-show-more",e)}function Cy(e,t){return!!K$(e,t)}function X$(e,t){return!!Q$(e,t)}function wd(e){var t=e;return e.touches&&e.touches.length&&(t=e.touches[0]),{clientX:t.clientX,clientY:t.clientY,pageX:t.pageX,pageY:t.pageY}}var m2=5,eG=250,RC=function(){function e(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=n.global,a=r===void 0?!1:r,o=n.longPressThreshold,s=o===void 0?250:o,c=n.validContainers,d=c===void 0?[]:c;gr(this,e),this.isDetached=!1,this.container=t,this.globalMouse=!t||a,this.longPressThreshold=s,this.validContainers=d,this._listeners=Object.create(null),this._handleInitialEvent=this._handleInitialEvent.bind(this),this._handleMoveEvent=this._handleMoveEvent.bind(this),this._handleTerminatingEvent=this._handleTerminatingEvent.bind(this),this._keyListener=this._keyListener.bind(this),this._dropFromOutsideListener=this._dropFromOutsideListener.bind(this),this._dragOverFromOutsideListener=this._dragOverFromOutsideListener.bind(this),this._removeTouchMoveWindowListener=Lr("touchmove",function(){},window),this._removeKeyDownListener=Lr("keydown",this._keyListener),this._removeKeyUpListener=Lr("keyup",this._keyListener),this._removeDropFromOutsideListener=Lr("drop",this._dropFromOutsideListener),this._removeDragOverFromOutsideListener=Lr("dragover",this._dragOverFromOutsideListener),this._addInitialEventListener()}return yr(e,[{key:"on",value:function(n,r){var a=this._listeners[n]||(this._listeners[n]=[]);return a.push(r),{remove:function(){var s=a.indexOf(r);s!==-1&&a.splice(s,1)}}}},{key:"emit",value:function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];var s,c=this._listeners[n]||[];return c.forEach(function(d){s===void 0&&(s=d.apply(void 0,a))}),s}},{key:"teardown",value:function(){this.isDetached=!0,this._listeners=Object.create(null),this._removeTouchMoveWindowListener&&this._removeTouchMoveWindowListener(),this._removeInitialEventListener&&this._removeInitialEventListener(),this._removeEndListener&&this._removeEndListener(),this._onEscListener&&this._onEscListener(),this._removeMoveListener&&this._removeMoveListener(),this._removeKeyUpListener&&this._removeKeyUpListener(),this._removeKeyDownListener&&this._removeKeyDownListener(),this._removeDropFromOutsideListener&&this._removeDropFromOutsideListener(),this._removeDragOverFromOutsideListener&&this._removeDragOverFromOutsideListener()}},{key:"isSelected",value:function(n){var r=this._selectRect;return!r||!this.selecting?!1:g2(r,Ru(n))}},{key:"filter",value:function(n){var r=this._selectRect;return!r||!this.selecting?[]:n.filter(this.isSelected,this)}},{key:"_addLongPressListener",value:function(n,r){var a=this,o=null,s=null,c=null,d=function(v){o=setTimeout(function(){m(),n(v)},a.longPressThreshold),s=Lr("touchmove",function(){return m()}),c=Lr("touchend",function(){return m()})},p=Lr("touchstart",d),m=function(){o&&clearTimeout(o),s&&s(),c&&c(),o=null,s=null,c=null};return r&&d(r),function(){m(),p()}}},{key:"_addInitialEventListener",value:function(){var n=this,r=Lr("mousedown",function(o){n._removeInitialEventListener(),n._handleInitialEvent(o),n._removeInitialEventListener=Lr("mousedown",n._handleInitialEvent)}),a=Lr("touchstart",function(o){n._removeInitialEventListener(),n._removeInitialEventListener=n._addLongPressListener(n._handleInitialEvent,o)});this._removeInitialEventListener=function(){r(),a()}}},{key:"_dropFromOutsideListener",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,c=r.clientY;this.emit("dropFromOutside",{x:a,y:o,clientX:s,clientY:c}),n.preventDefault()}},{key:"_dragOverFromOutsideListener",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,c=r.clientY;this.emit("dragOverFromOutside",{x:a,y:o,clientX:s,clientY:c}),n.preventDefault()}},{key:"_handleInitialEvent",value:function(n){if(!this.isDetached){var r=wd(n),a=r.clientX,o=r.clientY,s=r.pageX,c=r.pageY,d=this.container(),p,m;if(!(n.which===3||n.button===2||!J$(d,a,o))){if(!this.globalMouse&&d&&!pp(d,n.target)){var g=tG(0),v=g.top,D=g.left,S=g.bottom,T=g.right;if(m=Ru(d),p=g2({top:m.top-v,left:m.left-D,bottom:m.bottom+S,right:m.right+T},{top:c,left:s}),!p)return}var E=this.emit("beforeSelect",this._initialEventData={isTouch:/^touch/.test(n.type),x:s,y:c,clientX:a,clientY:o});if(E!==!1)switch(n.type){case"mousedown":this._removeEndListener=Lr("mouseup",this._handleTerminatingEvent),this._onEscListener=Lr("keydown",this._handleTerminatingEvent),this._removeMoveListener=Lr("mousemove",this._handleMoveEvent);break;case"touchstart":this._handleMoveEvent(n),this._removeEndListener=Lr("touchend",this._handleTerminatingEvent),this._removeMoveListener=Lr("touchmove",this._handleMoveEvent);break}}}}},{key:"_isWithinValidContainer",value:function(n){var r=n.target,a=this.validContainers;return!a||!a.length||!r?!0:a.some(function(o){return!!r.closest(o)})}},{key:"_handleTerminatingEvent",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY;if(this.selecting=!1,this._removeEndListener&&this._removeEndListener(),this._removeMoveListener&&this._removeMoveListener(),!!this._initialEventData){var s=!this.container||pp(this.container(),n.target),c=this._isWithinValidContainer(n),d=this._selectRect,p=this.isClick(a,o);return this._initialEventData=null,n.key==="Escape"||!c?this.emit("reset"):p&&s?this._handleClickEvent(n):p?this.emit("reset"):this.emit("select",d)}}},{key:"_handleClickEvent",value:function(n){var r=wd(n),a=r.pageX,o=r.pageY,s=r.clientX,c=r.clientY,d=new Date().getTime();return this._lastClickData&&d-this._lastClickData.timestamp<eG?(this._lastClickData=null,this.emit("doubleClick",{x:a,y:o,clientX:s,clientY:c})):(this._lastClickData={timestamp:d},this.emit("click",{x:a,y:o,clientX:s,clientY:c}))}},{key:"_handleMoveEvent",value:function(n){if(!(this._initialEventData===null||this.isDetached)){var r=this._initialEventData,a=r.x,o=r.y,s=wd(n),c=s.pageX,d=s.pageY,p=Math.abs(a-c),m=Math.abs(o-d),g=Math.min(c,a),v=Math.min(d,o),D=this.selecting;this.isClick(c,d)&&!D&&!(p||m)||(this.selecting=!0,this._selectRect={top:v,left:g,x:c,y:d,right:g+p,bottom:v+m},D||this.emit("selectStart",this._initialEventData),this.isClick(c,d)||this.emit("selecting",this._selectRect),n.preventDefault())}}},{key:"_keyListener",value:function(n){this.ctrl=n.metaKey||n.ctrlKey}},{key:"isClick",value:function(n,r){var a=this._initialEventData,o=a.x,s=a.y,c=a.isTouch;return!c&&Math.abs(n-o)<=m2&&Math.abs(r-s)<=m2}}]),e}();function tG(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return gs(e)!=="object"&&(e={top:e,left:e,right:e,bottom:e}),e}function g2(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,r=Ru(e),a=r.top,o=r.left,s=r.right,c=s===void 0?o:s,d=r.bottom,p=d===void 0?a:d,m=Ru(t),g=m.top,v=m.left,D=m.right,S=D===void 0?v:D,T=m.bottom,E=T===void 0?g:T;return!(p-n<g||a+n>E||c-n<v||o+n>S)}function Ru(e){if(!e.getBoundingClientRect)return e;var t=e.getBoundingClientRect(),n=t.left+y2("left"),r=t.top+y2("top");return{top:r,left:n,right:(e.offsetWidth||0)+n,bottom:(e.offsetHeight||0)+r}}function y2(e){if(e==="left")return window.pageXOffset||document.body.scrollLeft||0;if(e==="top")return window.pageYOffset||document.body.scrollTop||0}var nG=function(e){ta(t,e);function t(n,r){var a;return gr(this,t),a=ea(this,t,[n,r]),a.state={selecting:!1},a.containerRef=A.createRef(),a}return yr(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable()}},{key:"componentDidUpdate",value:function(r){!r.selectable&&this.props.selectable&&this._selectable(),r.selectable&&!this.props.selectable&&this._teardownSelectable()}},{key:"render",value:function(){var r=this.props,a=r.range,o=r.getNow,s=r.getters,c=r.date,d=r.components.dateCellWrapper,p=r.localizer,m=this.state,g=m.selecting,v=m.startIdx,D=m.endIdx,S=o();return $.createElement("div",{className:"rbc-row-bg",ref:this.containerRef},a.map(function(T,E){var O=g&&E>=v&&E<=D,k=s.dayProp(T),j=k.className,F=k.style;return $.createElement(d,{key:E,value:T,range:a},$.createElement("div",{style:F,className:Qn("rbc-day-bg",j,O&&"rbc-selected-cell",p.isSameDate(T,S)&&"rbc-today",c&&p.neq(c,T,"month")&&"rbc-off-range-bg")}))}))}},{key:"_selectable",value:function(){var r=this,a=this.containerRef.current,o=this._selector=new RC(this.props.container,{longPressThreshold:this.props.longPressThreshold}),s=function(d,p){if(!Cy(a,d)&&!X$(a,d)){var m=Ru(a),g=r.props,v=g.range,D=g.rtl;if(Z$(m,d)){var S=jC(m,d.x,D,v.length);r._selectSlot({startIdx:S,endIdx:S,action:p,box:d})}}r._initial={},r.setState({selecting:!1})};o.on("selecting",function(c){var d=r.props,p=d.range,m=d.rtl,g=-1,v=-1;if(r.state.selecting||(yn(r.props.onSelectStart,[c]),r._initial={x:c.x,y:c.y}),o.isSelected(a)){var D=Ru(a),S=W$(r._initial,D,c,p.length,m);g=S.startIdx,v=S.endIdx}r.setState({selecting:!0,startIdx:g,endIdx:v})}),o.on("beforeSelect",function(c){if(r.props.selectable==="ignoreEvents")return!Cy(r.containerRef.current,c)}),o.on("click",function(c){return s(c,"click")}),o.on("doubleClick",function(c){return s(c,"doubleClick")}),o.on("select",function(c){r._selectSlot(rn(rn({},r.state),{},{action:"select",bounds:c})),r._initial={},r.setState({selecting:!1}),yn(r.props.onSelectEnd,[r.state])})}},{key:"_teardownSelectable",value:function(){this._selector&&(this._selector.teardown(),this._selector=null)}},{key:"_selectSlot",value:function(r){var a=r.endIdx,o=r.startIdx,s=r.action,c=r.bounds,d=r.box;a!==-1&&o!==-1&&this.props.onSelectSlot&&this.props.onSelectSlot({start:o,end:a,action:s,bounds:c,box:d,resourceId:this.props.resourceId})}}]),t}($.Component),xi={propTypes:{slotMetrics:Ae.object.isRequired,selected:Ae.object,isAllDay:Ae.bool,accessors:Ae.object.isRequired,localizer:Ae.object.isRequired,components:Ae.object.isRequired,getters:Ae.object.isRequired,onSelect:Ae.func,onDoubleClick:Ae.func,onKeyPress:Ae.func},defaultProps:{segments:[],selected:{}},renderEvent:function(t,n){var r=t.selected;t.isAllDay;var a=t.accessors,o=t.getters,s=t.onSelect,c=t.onDoubleClick,d=t.onKeyPress,p=t.localizer,m=t.slotMetrics,g=t.components,v=t.resizable,D=m.continuesPrior(n),S=m.continuesAfter(n);return $.createElement(OC,{event:n,getters:o,localizer:p,accessors:a,components:g,onSelect:s,onDoubleClick:c,onKeyPress:d,continuesPrior:D,continuesAfter:S,slotStart:m.first,slotEnd:m.last,selected:uv(n,r),resizable:v})},renderSpan:function(t,n,r){var a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:" ",o=Math.abs(n)/t*100+"%";return $.createElement("div",{key:r,className:"rbc-row-segment",style:{WebkitFlexBasis:o,flexBasis:o,maxWidth:o}},a)}},BC=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this,a=this.props,o=a.segments,s=a.slotMetrics.slots,c=a.className,d=1;return $.createElement("div",{className:Qn(c,"rbc-row")},o.reduce(function(p,m,g){var v=m.event,D=m.left,S=m.right,T=m.span,E="_lvl_"+g,O=D-d,k=xi.renderEvent(r.props,v);return O&&p.push(xi.renderSpan(s,O,"".concat(E,"_gap"))),p.push(xi.renderSpan(s,T,E,k)),d=S+1,p},[]))}}]),t}($.Component);BC.defaultProps=rn({},xi.defaultProps);function _C(e){var t=e.dateRange,n=e.unit,r=n===void 0?"day":n,a=e.localizer;return{first:t[0],last:a.add(t[t.length-1],1,r)}}function rG(e,t,n,r){var a=_C({dateRange:t,localizer:r}),o=a.first,s=a.last,c=r.diff(o,s,"day"),d=r.max(r.startOf(n.start(e),"day"),o),p=r.min(r.ceil(n.end(e),"day"),s),m=uY(t,function(v){return r.isSameDate(v,d)}),g=r.diff(d,p,"day");return g=Math.min(g,c),g=Math.max(g-r.segmentOffset,1),{event:e,span:g,left:m+1,right:Math.max(m+g,1)}}function HC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1/0,n,r,a,o=[],s=[];for(n=0;n<e.length;n++){for(a=e[n],r=0;r<o.length&&aG(a,o[r]);r++);r>=t?s.push(a):(o[r]||(o[r]=[])).push(a)}for(n=0;n<o.length;n++)o[n].sort(function(c,d){return c.left-d.left});return{levels:o,extra:s}}function mp(e,t,n,r,a){var o={start:r.start(e),end:r.end(e)},s={start:t,end:n};return a.inEventRange({event:o,range:s})}function aG(e,t){return t.some(function(n){return n.left<=e.right&&n.right>=e.left})}function oG(e,t,n){var r=ey(e),a=[],o=[];r.forEach(function(d){var p=t.start(d),m=t.end(d);n.daySpan(p,m)>1?a.push(d):o.push(d)});var s=a.sort(function(d,p){return Ww(d,p,t,n)}),c=o.sort(function(d,p){return Ww(d,p,t,n)});return[].concat(ey(s),ey(c))}function Ww(e,t,n,r){var a={start:n.start(e),end:n.end(e),allDay:n.allDay(e)},o={start:n.start(t),end:n.end(t),allDay:n.allDay(t)};return r.sortEvents({evtA:a,evtB:o})}var YC=function(t,n){return t.left<=n&&t.right>=n},v2=function(t,n){return t.filter(function(r){return YC(r,n)}).map(function(r){return r.event})},zC=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){for(var r=this.props,a=r.segments,o=r.slotMetrics.slots,s=HC(a).levels[0],c=1,d=1,p=[];c<=o;){var m="_lvl_"+c,g=s.filter(function(k){return YC(k,c)})[0]||{},v=g.event,D=g.left,S=g.right,T=g.span;if(!v){c++;continue}var E=Math.max(0,D-d);if(this.canRenderSlotEvent(D,T)){var O=xi.renderEvent(this.props,v);E&&p.push(xi.renderSpan(o,E,m+"_gap")),p.push(xi.renderSpan(o,T,m,O)),d=c=S+1}else E&&p.push(xi.renderSpan(o,E,m+"_gap")),p.push(xi.renderSpan(o,1,m,this.renderShowMore(a,c))),d=c+=1}return $.createElement("div",{className:"rbc-row"},p)}},{key:"canRenderSlotEvent",value:function(r,a){var o=this.props.segments;return DY(r,r+a).every(function(s){var c=v2(o,s).length;return c===1})}},{key:"renderShowMore",value:function(r,a){var o=this,s=this.props,c=s.localizer,d=s.slotMetrics,p=d.getEventsForSlot(a),m=v2(r,a),g=m.length;return g?$.createElement("button",{type:"button",key:"sm_"+a,className:Qn("rbc-button-link","rbc-show-more"),onClick:function(D){return o.showMore(a,D)}},c.messages.showMore(g,m,p)):!1}},{key:"showMore",value:function(r,a){a.preventDefault(),a.stopPropagation(),this.props.onShowMore(r,a.target)}}]),t}($.Component);zC.defaultProps=rn({},xi.defaultProps);var iG=function(t){var n=t.children;return $.createElement("div",{className:"rbc-row-content-scroll-container"},n)},sG=function(t,n){return t.left<=n&&t.right>=n},lG=function(t,n){return t[0].range===n[0].range&&t[0].events===n[0].events};function UC(){return hC(function(e){for(var t=e.range,n=e.events,r=e.maxRows,a=e.minRows,o=e.accessors,s=e.localizer,c=_C({dateRange:t,localizer:s}),d=c.first,p=c.last,m=n.map(function(T){return rG(T,t,o,s)}),g=HC(m,Math.max(r-1,1)),v=g.levels,D=g.extra,S=D.length>0?a-1:a;v.length<S;)v.push([]);return{first:d,last:p,levels:v,extra:D,range:t,slots:t.length,clone:function(E){var O=UC();return O(rn(rn({},e),E))},getDateForSlot:function(E){return t[E]},getSlotForDate:function(E){return t.find(function(O){return s.isSameDate(O,E)})},getEventsForSlot:function(E){return m.filter(function(O){return sG(O,E)}).map(function(O){return O.event})},continuesPrior:function(E){return s.continuesPrior(o.start(E),d)},continuesAfter:function(E){var O=o.start(E),k=o.end(E);return s.continuesAfter(O,k,p)}}},lG)}var xy=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.handleSelectSlot=function(s){var c=n.props,d=c.range,p=c.onSelectSlot;p(d.slice(s.start,s.end+1),s)},n.handleShowMore=function(s,c){var d=n.props,p=d.range,m=d.onShowMore,g=n.slotMetrics(n.props),v=c7(n.containerRef.current,".rbc-row-bg")[0],D;v&&(D=v.children[s-1]);var S=g.getEventsForSlot(s);m(S,p[s-1],D,s,c)},n.getContainer=function(){var s=n.props.container;return s?s():n.containerRef.current},n.renderHeadingCell=function(s,c){var d=n.props,p=d.renderHeader,m=d.getNow,g=d.localizer;return p({date:s,key:"header_".concat(c),className:Qn("rbc-date-cell",g.isSameDate(s,m())&&"rbc-now")})},n.renderDummy=function(){var s=n.props,c=s.className,d=s.range,p=s.renderHeader,m=s.showAllEvents;return $.createElement("div",{className:c,ref:n.containerRef},$.createElement("div",{className:Qn("rbc-row-content",m&&"rbc-row-content-scrollable")},p&&$.createElement("div",{className:"rbc-row",ref:n.headingRowRef},d.map(n.renderHeadingCell)),$.createElement("div",{className:"rbc-row",ref:n.eventRowRef},$.createElement("div",{className:"rbc-row-segment"},$.createElement("div",{className:"rbc-event"},$.createElement("div",{className:"rbc-event-content"}," "))))))},n.containerRef=A.createRef(),n.headingRowRef=A.createRef(),n.eventRowRef=A.createRef(),n.slotMetrics=UC(),n}return yr(t,[{key:"getRowLimit",value:function(){var r,a=V0(this.eventRowRef.current),o=(r=this.headingRowRef)!==null&&r!==void 0&&r.current?V0(this.headingRowRef.current):0,s=V0(this.containerRef.current)-o;return Math.max(Math.floor(s/a),1)}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.rtl,s=r.range,c=r.className,d=r.selected,p=r.selectable,m=r.renderForMeasure,g=r.accessors,v=r.getters,D=r.components,S=r.getNow,T=r.renderHeader,E=r.onSelect,O=r.localizer,k=r.onSelectStart,j=r.onSelectEnd,F=r.onDoubleClick,B=r.onKeyPress,R=r.resourceId,z=r.longPressThreshold,H=r.isAllDay,Y=r.resizable,U=r.showAllEvents;if(m)return this.renderDummy();var J=this.slotMetrics(this.props),Q=J.levels,le=J.extra,pe=U?iG:ds,ie=D.weekWrapper,se={selected:d,accessors:g,getters:v,localizer:O,components:D,onSelect:E,onDoubleClick:F,onKeyPress:B,resourceId:R,slotMetrics:J,resizable:Y};return $.createElement("div",{className:c,role:"rowgroup",ref:this.containerRef},$.createElement(nG,{localizer:O,date:a,getNow:S,rtl:o,range:s,selectable:p,container:this.getContainer,getters:v,onSelectStart:k,onSelectEnd:j,onSelectSlot:this.handleSelectSlot,components:D,longPressThreshold:z,resourceId:R}),$.createElement("div",{className:Qn("rbc-row-content",U&&"rbc-row-content-scrollable"),role:"row"},T&&$.createElement("div",{className:"rbc-row ",ref:this.headingRowRef},s.map(this.renderHeadingCell)),$.createElement(pe,null,$.createElement(ie,Object.assign({isAllDay:H},se,{rtl:this.props.rtl}),Q.map(function(fe,oe){return $.createElement(BC,Object.assign({key:oe,segments:fe},se))}),!!le.length&&$.createElement(zC,Object.assign({segments:le,onShowMore:this.handleShowMore},se))))))}}]),t}($.Component);xy.defaultProps={minRows:0,maxRows:1/0};var VC=function(t){var n=t.label;return $.createElement("span",{role:"columnheader","aria-sort":"none"},n)},uG=function(t){var n=t.label,r=t.drilldownView,a=t.onDrillDown;return r?$.createElement("button",{type:"button",className:"rbc-button-link",onClick:a,role:"cell"},n):$.createElement("span",null,n)},cG=["date","className"],dG=function(t,n,r,a,o){return t.filter(function(s){return mp(s,n,r,a,o)})},cv=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.getContainer=function(){return n.containerRef.current},n.renderWeek=function(s,c){var d=n.props,p=d.events,m=d.components,g=d.selectable,v=d.getNow,D=d.selected,S=d.date,T=d.localizer,E=d.longPressThreshold,O=d.accessors,k=d.getters,j=d.showAllEvents,F=n.state,B=F.needLimitMeasure,R=F.rowLimit,z=dG(ey(p),s[0],s[s.length-1],O,T),H=oG(z,O,T);return $.createElement(xy,{key:c,ref:c===0?n.slotRowRef:void 0,container:n.getContainer,className:"rbc-month-row",getNow:v,date:S,range:s,events:H,maxRows:j?1/0:R,selected:D,selectable:g,components:m,accessors:O,getters:k,localizer:T,renderHeader:n.readerDateHeading,renderForMeasure:B,onShowMore:n.handleShowMore,onSelect:n.handleSelectEvent,onDoubleClick:n.handleDoubleClickEvent,onKeyPress:n.handleKeyPressEvent,onSelectSlot:n.handleSelectSlot,longPressThreshold:E,rtl:n.props.rtl,resizable:n.props.resizable,showAllEvents:j})},n.readerDateHeading=function(s){var c=s.date,d=s.className,p=Fi(s,cG),m=n.props,g=m.date,v=m.getDrilldownView,D=m.localizer,S=D.neq(c,g,"month"),T=D.isSameDate(c,g),E=v(c),O=D.format(c,"dateFormat"),k=n.props.components.dateHeader||uG;return $.createElement("div",Object.assign({},p,{className:Qn(d,S&&"rbc-off-range",T&&"rbc-current"),role:"cell"}),$.createElement(k,{label:O,date:c,drilldownView:E,isOffRange:S,onDrillDown:function(F){return n.handleHeadingClick(c,E,F)}}))},n.handleSelectSlot=function(s,c){n._pendingSelection=n._pendingSelection.concat(s),clearTimeout(n._selectTimer),n._selectTimer=setTimeout(function(){return n.selectDates(c)})},n.handleHeadingClick=function(s,c,d){d.preventDefault(),n.clearSelection(),yn(n.props.onDrillDown,[s,c])},n.handleSelectEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onSelectEvent,c)},n.handleDoubleClickEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onDoubleClickEvent,c)},n.handleKeyPressEvent=function(){n.clearSelection();for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onKeyPressEvent,c)},n.handleShowMore=function(s,c,d,p,m){var g=n.props,v=g.popup,D=g.onDrillDown,S=g.onShowMore,T=g.getDrilldownView,E=g.doShowMoreDrillDown;if(n.clearSelection(),v){var O=GE(d,n.containerRef.current);n.setState({overlay:{date:c,events:s,position:O,target:m}})}else E&&yn(D,[c,T(c)||Qr.DAY]);yn(S,[s,c,p])},n.overlayDisplay=function(){n.setState({overlay:null})},n.state={rowLimit:5,needLimitMeasure:!0,date:null},n.containerRef=A.createRef(),n.slotRowRef=A.createRef(),n._bgRows=[],n._pendingSelection=[],n}return yr(t,[{key:"componentDidMount",value:function(){var r=this,a;this.state.needLimitMeasure&&this.measureRowLimit(this.props),window.addEventListener("resize",this._resizeListener=function(){a||qE(function(){a=!1,r.setState({needLimitMeasure:!0})})},!1)}},{key:"componentDidUpdate",value:function(){this.state.needLimitMeasure&&this.measureRowLimit(this.props)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this._resizeListener,!1)}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.className,c=o.visibleDays(a,o),d=GO(c,7);return this._weekCount=d.length,$.createElement("div",{className:Qn("rbc-month-view",s),role:"table","aria-label":"Month View",ref:this.containerRef},$.createElement("div",{className:"rbc-row rbc-month-header",role:"row"},this.renderHeaders(d[0])),d.map(this.renderWeek),this.props.popup&&this.renderOverlay())}},{key:"renderHeaders",value:function(r){var a=this.props,o=a.localizer,s=a.components,c=r[0],d=r[r.length-1],p=s.header||VC;return o.range(c,d,"day").map(function(m,g){return $.createElement("div",{key:"header_"+g,className:"rbc-header"},$.createElement(p,{date:m,localizer:o,label:o.format(m,"weekdayFormat")}))})}},{key:"renderOverlay",value:function(){var r,a,o=this,s=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},c=this.props,d=c.accessors,p=c.localizer,m=c.components,g=c.getters,v=c.selected,D=c.popupOffset,S=c.handleDragStart,T=function(){return o.setState({overlay:null})};return $.createElement(sb,{overlay:s,accessors:d,localizer:p,components:m,getters:g,selected:v,popupOffset:D,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:T})}},{key:"measureRowLimit",value:function(){this.setState({needLimitMeasure:!1,rowLimit:this.slotRowRef.current.getRowLimit()})}},{key:"selectDates",value:function(r){var a=this._pendingSelection.slice();this._pendingSelection=[],a.sort(function(c,d){return+c-+d});var o=new Date(a[0]),s=new Date(a[a.length-1]);s.setDate(a[a.length-1].getDate()+1),yn(this.props.onSelectSlot,{slots:a,start:o,end:s,action:r.action,bounds:r.bounds,box:r.box})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}}],[{key:"getDerivedStateFromProps",value:function(r,a){var o=r.date,s=r.localizer;return{date:o,needLimitMeasure:s.neq(o,a.date,"month")}}}]),t}($.Component);cv.range=function(e,t){var n=t.localizer,r=n.firstVisibleDay(e,n),a=n.lastVisibleDay(e,n);return{start:r,end:a}};cv.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"month");case Da.NEXT:return r.add(e,1,"month");default:return e}};cv.title=function(e,t){var n=t.localizer;return n.format(e,"monthHeaderFormat")};var w2=function(t){var n=t.min,r=t.max,a=t.step,o=t.slots,s=t.localizer;return"".concat(+s.startOf(n,"minutes"))+"".concat(+s.startOf(r,"minutes"))+"".concat(a,"-").concat(o)};function lb(e){for(var t=e.min,n=e.max,r=e.step,a=e.timeslots,o=e.localizer,s=w2({start:t,end:n,step:r,timeslots:a,localizer:o}),c=1+o.getTotalMin(t,n),d=o.getMinutesFromMidnight(t),p=Math.ceil((c-1)/(r*a)),m=p*a,g=new Array(p),v=new Array(m),D=0;D<p;D++){g[D]=new Array(a);for(var S=0;S<a;S++){var T=D*a+S,E=T*r;v[T]=g[D][S]=o.getSlotDate(t,d,E)}}var O=v.length*r;v.push(o.getSlotDate(t,d,O));function k(j){var F=o.diff(t,j,"minutes")+o.getDstOffset(t,j);return Math.min(F,c)}return{groups:g,update:function(F){return w2(F)!==s?lb(F):this},dateIsInGroup:function(F,B){var R=g[B+1];return o.inRange(F,g[B][0],R?R[0]:n,"minutes")},nextSlot:function(F){var B=v[Math.min(v.indexOf(F)+1,v.length-1)];return B===F&&(B=o.add(F,r,"minutes")),B},closestSlotToPosition:function(F){var B=Math.min(v.length-1,Math.max(0,Math.floor(F*m)));return v[B]},closestSlotFromPoint:function(F,B){var R=Math.abs(B.top-B.bottom);return this.closestSlotToPosition((F.y-B.top)/R)},closestSlotFromDate:function(F){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(o.lt(F,t,"minutes"))return v[0];if(o.gt(F,n,"minutes"))return v[v.length-1];var R=o.diff(t,F,"minutes");return v[(R-R%r)/r+B]},startsBeforeDay:function(F){return o.lt(F,t,"day")},startsAfterDay:function(F){return o.gt(F,n,"day")},startsBefore:function(F){return o.lt(o.merge(t,F),t,"minutes")},startsAfter:function(F){return o.gt(o.merge(n,F),n,"minutes")},getRange:function(F,B,R,z){R||(F=o.min(n,o.max(t,F))),z||(B=o.min(n,o.max(t,B)));var H=k(F),Y=k(B),U=Y>r*m&&!o.eq(n,B)?(H-r)/(r*m)*100:H/(r*m)*100;return{top:U,height:Y/(r*m)*100-U,start:k(F),startDate:F,end:k(B),endDate:B}},getCurrentTimePosition:function(F){var B=k(F),R=B/(r*m)*100;return R}}}var fG=function(){function e(t,n){var r=n.accessors,a=n.slotMetrics;gr(this,e);var o=a.getRange(r.start(t),r.end(t)),s=o.start,c=o.startDate,d=o.end,p=o.endDate,m=o.top,g=o.height;this.start=s,this.end=d,this.startMs=+c,this.endMs=+p,this.top=m,this.height=g,this.data=t}return yr(e,[{key:"_width",get:function(){if(this.rows){var n=this.rows.reduce(function(a,o){return Math.max(a,o.leaves.length+1)},0)+1;return 100/n}if(this.leaves){var r=100-this.container._width;return r/(this.leaves.length+1)}return this.row._width}},{key:"width",get:function(){var n=this._width,r=Math.min(100,this._width*1.7);if(this.rows)return r;if(this.leaves)return this.leaves.length>0?r:n;var a=this.row.leaves,o=a.indexOf(this);return o===a.length-1?n:r}},{key:"xOffset",get:function(){if(this.rows)return 0;if(this.leaves)return this.container._width;var n=this.row,r=n.leaves,a=n.xOffset,o=n._width,s=r.indexOf(this)+1;return a+s*o}}]),e}();function hG(e,t,n){return Math.abs(t.start-e.start)<n||t.start>e.start&&t.start<e.end}function pG(e){for(var t=Yz(e,["startMs",function(c){return-c.endMs}]),n=[];t.length>0;){var r=t.shift();n.push(r);for(var a=0;a<t.length;a++){var o=t[a];if(!(r.endMs>o.startMs)){if(a>0){var s=t.splice(a,1)[0];n.push(s)}break}}}return n}function ZC(e){for(var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=t.map(function(m){return new fG(m,{slotMetrics:r,accessors:a})}),s=pG(o),c=[],d=function(){var g=s[p],v=c.find(function(T){return T.end>g.start||Math.abs(g.start-T.start)<n});if(!v)return g.rows=[],c.push(g),1;g.container=v;for(var D=null,S=v.rows.length-1;!D&&S>=0;S--)hG(v.rows[S],g,n)&&(D=v.rows[S]);D?(D.leaves.push(g),g.row=D):(g.leaves=[],v.rows.push(g))},p=0;p<s.length;p++)d();return s.map(function(m){return{event:m.data,style:{top:m.top,height:m.height,width:m.width,xOffset:Math.max(0,m.xOffset)}}})}function WC(e,t,n){for(var r=0;r<e.friends.length;++r)if(!(n.indexOf(e.friends[r])>-1)){t=t>e.friends[r].idx?t:e.friends[r].idx,n.push(e.friends[r]);var a=WC(e.friends[r],t,n);t=t>a?t:a}return t}function mG(e){var t=e.events,n=e.minimumStartDifference,r=e.slotMetrics,a=e.accessors,o=ZC({events:t,minimumStartDifference:n,slotMetrics:r,accessors:a});o.sort(function(ie,se){return ie=ie.style,se=se.style,ie.top!==se.top?ie.top>se.top?1:-1:ie.height!==se.height?ie.top+ie.height<se.top+se.height?1:-1:0});for(var s=0;s<o.length;++s)o[s].friends=[],delete o[s].style.left,delete o[s].style.left,delete o[s].idx,delete o[s].size;for(var c=0;c<o.length-1;++c)for(var d=o[c],p=d.style.top,m=d.style.top+d.style.height,g=c+1;g<o.length;++g){var v=o[g],D=v.style.top,S=v.style.top+v.style.height;(D>=p&&S<=m||S>p&&S<=m||D>=p&&D<m)&&(d.friends.push(v),v.friends.push(d))}for(var T=0;T<o.length;++T){for(var E=o[T],O=[],k=0;k<100;++k)O.push(1);for(var j=0;j<E.friends.length;++j)E.friends[j].idx!==void 0&&(O[E.friends[j].idx]=0);E.idx=O.indexOf(1)}for(var F=0;F<o.length;++F){var B=0;if(!o[F].size){var R=[],z=WC(o[F],0,R);B=100/(z+1),o[F].size=B;for(var H=0;H<R.length;++H)R[H].size=B}}for(var Y=0;Y<o.length;++Y){var U=o[Y];U.style.left=U.idx*U.size;for(var J=0,Q=0;Q<U.friends.length;++Q){var le=U.friends[Q].idx;J=J>le?J:le}J<=U.idx&&(U.size=100-U.idx*U.size);var pe=U.idx===0?0:3;U.style.width="calc(".concat(U.size,"% - ").concat(pe,"px)"),U.style.height="calc(".concat(U.style.height,"% - 2px)"),U.style.xOffset="calc(".concat(U.style.left,"% + ").concat(pe,"px)")}return o}var b2={overlap:ZC,"no-overlap":mG};function gG(e){return!!(e&&e.constructor&&e.call&&e.apply)}function yG(e){e.events,e.minimumStartDifference,e.slotMetrics,e.accessors;var t=e.dayLayoutAlgorithm,n=t;return t in b2&&(n=b2[t]),gG(n)?n.apply(this,arguments):[]}var $C=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.renderSlot,o=r.resource,s=r.group,c=r.getters,d=r.components,p=d===void 0?{}:d,m=p.timeSlotWrapper,g=m===void 0?ds:m,v=c?c.slotGroupProp(s):{};return $.createElement("div",Object.assign({className:"rbc-timeslot-group"},v),s.map(function(D,S){var T=c?c.slotProp(D,o):{};return $.createElement(g,{key:S,value:D,resource:o},$.createElement("div",Object.assign({},T,{className:Qn("rbc-time-slot",T.className)}),a&&a(D,S)))}))}}]),t}(A.Component);function Rg(e){return typeof e=="string"?e:e+"%"}function vG(e){var t=e.style,n=e.className,r=e.event,a=e.accessors,o=e.rtl,s=e.selected,c=e.label,d=e.continuesPrior,p=e.continuesAfter,m=e.getters,g=e.onClick,v=e.onDoubleClick,D=e.isBackgroundEvent,S=e.onKeyPress,T=e.components,E=T.event,O=T.eventWrapper,k=a.title(r),j=a.tooltip(r),F=a.end(r),B=a.start(r),R=m.eventProp(r,B,F,s),z=[$.createElement("div",{key:"1",className:"rbc-event-label"},c),$.createElement("div",{key:"2",className:"rbc-event-content"},E?$.createElement(E,{event:r,title:k}):k)],H=t.height,Y=t.top,U=t.width,J=t.xOffset,Q=rn(rn({},R.style),{},Iu({top:Rg(Y),height:Rg(H),width:Rg(U)},o?"right":"left",Rg(J)));return $.createElement(O,Object.assign({type:"time"},e),$.createElement("div",{role:"button",tabIndex:0,onClick:g,onDoubleClick:v,style:Q,onKeyDown:S,title:j?(typeof c=="string"?c+": ":"")+j:void 0,className:Qn(D?"rbc-background-event":"rbc-event",n,R.className,{"rbc-selected":s,"rbc-event-continues-earlier":d,"rbc-event-continues-later":p})},z))}var wG=function(t){var n=t.children,r=t.className,a=t.style,o=t.innerRef;return $.createElement("div",{className:r,style:a,ref:o},n)},bG=$.forwardRef(function(e,t){return $.createElement(wG,Object.assign({},e,{innerRef:t}))}),DG=["dayProp"],SG=["eventContainerWrapper"],GC=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.state={selecting:!1,timeIndicatorPosition:null},n.intervalTriggered=!1,n.renderEvents=function(s){var c=s.events,d=s.isBackgroundEvent,p=n.props,m=p.rtl,g=p.selected,v=p.accessors,D=p.localizer,S=p.getters,T=p.components,E=p.step,O=p.timeslots,k=p.dayLayoutAlgorithm,j=p.resizable,F=IE(n),B=F.slotMetrics,R=D.messages,z=yG({events:c,accessors:v,slotMetrics:B,minimumStartDifference:Math.ceil(E*O/2),dayLayoutAlgorithm:k});return z.map(function(H,Y){var U=H.event,J=H.style,Q=v.end(U),le=v.start(U),pe="eventTimeRangeFormat",ie,se=B.startsBeforeDay(le),fe=B.startsAfterDay(Q);se?pe="eventTimeRangeEndFormat":fe&&(pe="eventTimeRangeStartFormat"),se&&fe?ie=R.allDay:ie=D.format({start:le,end:Q},pe);var oe=se||B.startsBefore(le),we=fe||B.startsAfter(Q);return $.createElement(vG,{style:J,event:U,label:ie,key:"evt_"+Y,getters:S,rtl:m,components:T,continuesPrior:oe,continuesAfter:we,accessors:v,resource:n.props.resource,selected:uv(U,g),onClick:function(G){return n._select(rn(rn(rn({},U),n.props.resource&&{sourceResource:n.props.resource}),d&&{isBackgroundEvent:!0}),G)},onDoubleClick:function(G){return n._doubleClick(U,G)},isBackgroundEvent:d,onKeyPress:function(G){return n._keyPress(U,G)},resizable:j})})},n._selectable=function(){var s=n.containerRef.current,c=n.props,d=c.longPressThreshold,p=c.localizer,m=n._selector=new RC(function(){return s},{longPressThreshold:d}),g=function(T){var E=n.props.onSelecting,O=n.state||{},k=v(T),j=k.startDate,F=k.endDate;E&&(p.eq(O.startDate,j,"minutes")&&p.eq(O.endDate,F,"minutes")||E({start:j,end:F,resourceId:n.props.resource})===!1)||(n.state.start!==k.start||n.state.end!==k.end||n.state.selecting!==k.selecting)&&n.setState(k)},v=function(T){var E=n.slotMetrics.closestSlotFromPoint(T,Ru(s));n.state.selecting||(n._initialSlot=E);var O=n._initialSlot;p.lte(O,E)?E=n.slotMetrics.nextSlot(E):p.gt(O,E)&&(O=n.slotMetrics.nextSlot(O));var k=n.slotMetrics.getRange(p.min(O,E),p.max(O,E));return rn(rn({},k),{},{selecting:!0,top:"".concat(k.top,"%"),height:"".concat(k.height,"%")})},D=function(T,E){if(!Cy(n.containerRef.current,T)){var O=v(T),k=O.startDate,j=O.endDate;n._selectSlot({startDate:k,endDate:j,action:E,box:T})}n.setState({selecting:!1})};m.on("selecting",g),m.on("selectStart",g),m.on("beforeSelect",function(S){if(n.props.selectable==="ignoreEvents")return!Cy(n.containerRef.current,S)}),m.on("click",function(S){return D(S,"click")}),m.on("doubleClick",function(S){return D(S,"doubleClick")}),m.on("select",function(S){n.state.selecting&&(n._selectSlot(rn(rn({},n.state),{},{action:"select",bounds:S})),n.setState({selecting:!1}))}),m.on("reset",function(){n.state.selecting&&n.setState({selecting:!1})})},n._teardownSelectable=function(){n._selector&&(n._selector.teardown(),n._selector=null)},n._selectSlot=function(s){for(var c=s.startDate,d=s.endDate,p=s.action,m=s.bounds,g=s.box,v=c,D=[];n.props.localizer.lte(v,d);)D.push(v),v=new Date(+v+n.props.step*60*1e3);yn(n.props.onSelectSlot,{slots:D,start:c,end:d,resourceId:n.props.resource,action:p,bounds:m,box:g})},n._select=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onSelectEvent,c)},n._doubleClick=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onDoubleClickEvent,c)},n._keyPress=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onKeyPressEvent,c)},n.slotMetrics=lb(n.props),n.containerRef=A.createRef(),n}return yr(t,[{key:"componentDidMount",value:function(){this.props.selectable&&this._selectable(),this.props.isNow&&this.setTimeIndicatorPositionUpdateInterval()}},{key:"componentWillUnmount",value:function(){this._teardownSelectable(),this.clearTimeIndicatorInterval()}},{key:"componentDidUpdate",value:function(r,a){this.props.selectable&&!r.selectable&&this._selectable(),!this.props.selectable&&r.selectable&&this._teardownSelectable(),this.slotMetrics=this.slotMetrics.update(this.props);var o=this.props,s=o.getNow,c=o.isNow,d=o.localizer,p=o.date,m=o.min,g=o.max,v=d.neq(r.getNow(),s(),"minutes");if(r.isNow!==c||v){if(this.clearTimeIndicatorInterval(),c){var D=!v&&d.eq(r.date,p,"minutes")&&a.timeIndicatorPosition===this.state.timeIndicatorPosition;this.setTimeIndicatorPositionUpdateInterval(D)}}else c&&(d.neq(r.min,m,"minutes")||d.neq(r.max,g,"minutes"))&&this.positionTimeIndicator()}},{key:"setTimeIndicatorPositionUpdateInterval",value:function(){var r=this,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;!this.intervalTriggered&&!a&&this.positionTimeIndicator(),this._timeIndicatorTimeout=window.setTimeout(function(){r.intervalTriggered=!0,r.positionTimeIndicator(),r.setTimeIndicatorPositionUpdateInterval()},6e4)}},{key:"clearTimeIndicatorInterval",value:function(){this.intervalTriggered=!1,window.clearTimeout(this._timeIndicatorTimeout)}},{key:"positionTimeIndicator",value:function(){var r=this.props,a=r.min,o=r.max,s=r.getNow,c=s();if(c>=a&&c<=o){var d=this.slotMetrics.getCurrentTimePosition(c);this.intervalTriggered=!0,this.setState({timeIndicatorPosition:d})}else this.clearTimeIndicatorInterval()}},{key:"render",value:function(){var r=this.props,a=r.date,o=r.max,s=r.rtl,c=r.isNow,d=r.resource,p=r.accessors,m=r.localizer,g=r.getters,v=g.dayProp,D=Fi(g,DG),S=r.components,T=S.eventContainerWrapper,E=Fi(S,SG),O=this.slotMetrics,k=this.state,j=k.selecting,F=k.top,B=k.height,R=k.startDate,z=k.endDate,H={start:R,end:z},Y=v(o),U=Y.className,J=Y.style,Q=E.dayColumnWrapper||bG;return $.createElement(Q,{ref:this.containerRef,date:a,style:J,className:Qn(U,"rbc-day-slot","rbc-time-column",c&&"rbc-now",c&&"rbc-today",j&&"rbc-slot-selecting"),slotMetrics:O},O.groups.map(function(le,pe){return $.createElement($C,{key:pe,group:le,resource:d,getters:D,components:E})}),$.createElement(T,{localizer:m,resource:d,accessors:p,getters:D,components:E,slotMetrics:O},$.createElement("div",{className:Qn("rbc-events-container",s&&"rtl")},this.renderEvents({events:this.props.backgroundEvents,isBackgroundEvent:!0}),this.renderEvents({events:this.props.events}))),j&&$.createElement("div",{className:"rbc-slot-selection",style:{top:F,height:B}},$.createElement("span",null,m.format(H,"selectRangeFormat"))),c&&this.intervalTriggered&&$.createElement("div",{className:"rbc-current-time-indicator",style:{top:"".concat(this.state.timeIndicatorPosition,"%")}}))}}]),t}($.Component);GC.defaultProps={dragThroughEvents:!0,timeslots:2};function IG(e){var t=e.min,n=e.max,r=e.localizer;return r.getTimezoneOffset(t)!==r.getTimezoneOffset(n)?{start:r.add(t,-1,"day"),end:r.add(n,-1,"day")}:{start:t,end:n}}var TG=function(t){var n=t.min,r=t.max,a=t.timeslots,o=t.step,s=t.localizer,c=t.getNow,d=t.resource,p=t.components,m=t.getters,g=t.gutterRef,v=p.timeGutterWrapper,D=A.useMemo(function(){return IG({min:n,max:r,localizer:s})},[n==null?void 0:n.toISOString(),r==null?void 0:r.toISOString(),s]),S=D.start,T=D.end,E=A.useState(lb({min:S,max:T,timeslots:a,step:o,localizer:s})),O=fs(E,2),k=O[0],j=O[1];A.useEffect(function(){k&&j(k.update({min:S,max:T,timeslots:a,step:o,localizer:s}))},[S==null?void 0:S.toISOString(),T==null?void 0:T.toISOString(),a,o]);var F=A.useCallback(function(B,R){if(R)return null;var z=k.dateIsInGroup(c(),R);return $.createElement("span",{className:Qn("rbc-label",z&&"rbc-now")},s.format(B,"timeGutterFormat"))},[k,s,c]);return $.createElement(v,{slotMetrics:k},$.createElement("div",{className:"rbc-time-gutter rbc-time-column",ref:g},k.groups.map(function(B,R){return $.createElement($C,{key:R,group:B,resource:d,components:p,renderSlot:F,getters:m})})))},EG=$.forwardRef(function(e,t){return $.createElement(TG,Object.assign({gutterRef:t},e))}),CG=function(t){var n=t.label;return $.createElement($.Fragment,null,n)},xG=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.handleHeaderClick=function(s,c,d){d.preventDefault(),yn(n.props.onDrillDown,[s,c])},n.renderRow=function(s){var c=n.props,d=c.events,p=c.rtl,m=c.selectable,g=c.getNow,v=c.range,D=c.getters,S=c.localizer,T=c.accessors,E=c.components,O=c.resizable,k=T.resourceId(s),j=s?d.filter(function(F){return T.resource(F)===k}):d;return $.createElement(xy,{isAllDay:!0,rtl:p,getNow:g,minRows:2,maxRows:n.props.allDayMaxRows+1,range:v,events:j,resourceId:k,className:"rbc-allday-cell",selectable:m,selected:n.props.selected,components:E,accessors:T,getters:D,localizer:S,onSelect:n.props.onSelectEvent,onShowMore:n.props.onShowMore,onDoubleClick:n.props.onDoubleClickEvent,onKeyPress:n.props.onKeyPressEvent,onSelectSlot:n.props.onSelectSlot,longPressThreshold:n.props.longPressThreshold,resizable:O})},n}return yr(t,[{key:"renderHeaderCells",value:function(r){var a=this,o=this.props,s=o.localizer,c=o.getDrilldownView,d=o.getNow,p=o.getters.dayProp,m=o.components.header,g=m===void 0?VC:m,v=d();return r.map(function(D,S){var T=c(D),E=s.format(D,"dayFormat"),O=p(D),k=O.className,j=O.style,F=$.createElement(g,{date:D,label:E,localizer:s});return $.createElement("div",{key:S,style:j,className:Qn("rbc-header",k,s.isSameDate(D,v)&&"rbc-today")},T?$.createElement("button",{type:"button",className:"rbc-button-link",onClick:function(R){return a.handleHeaderClick(D,T,R)}},F):$.createElement("span",null,F))})}},{key:"render",value:function(){var r=this,a=this.props,o=a.width,s=a.rtl,c=a.resources,d=a.range,p=a.events,m=a.getNow,g=a.accessors,v=a.selectable,D=a.components,S=a.getters,T=a.scrollRef,E=a.localizer,O=a.isOverflowing,k=a.components,j=k.timeGutterHeader,F=k.resourceHeader,B=F===void 0?CG:F,R=a.resizable,z={};O&&(z[s?"marginLeft":"marginRight"]="".concat(JE()-1,"px"));var H=c.groupEvents(p);return $.createElement("div",{style:z,ref:T,className:Qn("rbc-time-header",O&&"rbc-overflowing")},$.createElement("div",{className:"rbc-label rbc-time-header-gutter",style:{width:o,minWidth:o,maxWidth:o}},j&&$.createElement(j,null)),c.map(function(Y,U){var J=fs(Y,2),Q=J[0],le=J[1];return $.createElement("div",{className:"rbc-time-header-content",key:Q||U},le&&$.createElement("div",{className:"rbc-row rbc-row-resource",key:"resource_".concat(U)},$.createElement("div",{className:"rbc-header"},$.createElement(B,{index:U,label:g.resourceTitle(le),resource:le}))),$.createElement("div",{className:"rbc-row rbc-time-header-cell".concat(d.length<=1?" rbc-time-header-cell-single-day":"")},r.renderHeaderCells(d)),$.createElement(xy,{isAllDay:!0,rtl:s,getNow:m,minRows:2,maxRows:r.props.allDayMaxRows+1,range:d,events:H.get(Q)||[],resourceId:le&&Q,className:"rbc-allday-cell",selectable:v,selected:r.props.selected,components:D,accessors:g,getters:S,localizer:E,onSelect:r.props.onSelectEvent,onShowMore:r.props.onShowMore,onDoubleClick:r.props.onDoubleClickEvent,onKeyDown:r.props.onKeyPressEvent,onSelectSlot:r.props.onSelectSlot,longPressThreshold:r.props.longPressThreshold,resizable:R}))}))}}]),t}($.Component),$0={};function MG(e,t){return{map:function(r){return e?e.map(function(a,o){return r([t.resourceId(a),a],o)}):[r([$0,null],0)]},groupEvents:function(r){var a=new Map;return e?(r.forEach(function(o){var s=t.resource(o)||$0;if(Array.isArray(s))s.forEach(function(d){var p=a.get(d)||[];p.push(o),a.set(d,p)});else{var c=a.get(s)||[];c.push(o),a.set(s,c)}}),a):(a.set($0,r),a)}}}var rf=function(e){ta(t,e);function t(n){var r;return gr(this,t),r=ea(this,t,[n]),r.handleScroll=function(a){r.scrollRef.current&&(r.scrollRef.current.scrollLeft=a.target.scrollLeft)},r.handleResize=function(){pS(r.rafHandle),r.rafHandle=qE(r.checkOverflow)},r.handleKeyPressEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];yn(r.props.onKeyPressEvent,o)},r.handleSelectEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];yn(r.props.onSelectEvent,o)},r.handleDoubleClickEvent=function(){r.clearSelection();for(var a=arguments.length,o=new Array(a),s=0;s<a;s++)o[s]=arguments[s];yn(r.props.onDoubleClickEvent,o)},r.handleShowMore=function(a,o,s,c,d){var p=r.props,m=p.popup,g=p.onDrillDown,v=p.onShowMore,D=p.getDrilldownView,S=p.doShowMoreDrillDown;if(r.clearSelection(),m){var T=GE(s,r.containerRef.current);r.setState({overlay:{date:o,events:a,position:rn(rn({},T),{},{width:"200px"}),target:d}})}else S&&yn(g,[o,D(o)||Qr.DAY]);yn(v,[a,o,c])},r.handleSelectAllDaySlot=function(a,o){var s=r.props.onSelectSlot,c=new Date(a[0]),d=new Date(a[a.length-1]);d.setDate(a[a.length-1].getDate()+1),yn(s,{slots:a,start:c,end:d,action:o.action,resourceId:o.resourceId})},r.overlayDisplay=function(){r.setState({overlay:null})},r.checkOverflow=function(){if(!r._updatingOverflow){var a=r.contentRef.current;if(a!=null&&a.scrollHeight){var o=a.scrollHeight>a.clientHeight;r.state.isOverflowing!==o&&(r._updatingOverflow=!0,r.setState({isOverflowing:o},function(){r._updatingOverflow=!1}))}}},r.memoizedResources=hC(function(a,o){return MG(a,o)}),r.state={gutterWidth:void 0,isOverflowing:null},r.scrollRef=$.createRef(),r.contentRef=$.createRef(),r.containerRef=$.createRef(),r._scrollRatio=null,r.gutterRef=A.createRef(),r}return yr(t,[{key:"getSnapshotBeforeUpdate",value:function(){return this.checkOverflow(),null}},{key:"componentDidMount",value:function(){this.props.width==null&&this.measureGutter(),this.calculateScroll(),this.applyScroll(),window.addEventListener("resize",this.handleResize)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("resize",this.handleResize),pS(this.rafHandle),this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest)}},{key:"componentDidUpdate",value:function(){this.applyScroll()}},{key:"renderEvents",value:function(r,a,o,s){var c=this,d=this.props,p=d.min,m=d.max,g=d.components,v=d.accessors,D=d.localizer,S=d.dayLayoutAlgorithm,T=this.memoizedResources(this.props.resources,v),E=T.groupEvents(a),O=T.groupEvents(o);return T.map(function(k,j){var F=fs(k,2),B=F[0],R=F[1];return r.map(function(z,H){var Y=(E.get(B)||[]).filter(function(J){return D.inRange(z,v.start(J),v.end(J),"day")}),U=(O.get(B)||[]).filter(function(J){return D.inRange(z,v.start(J),v.end(J),"day")});return $.createElement(GC,Object.assign({},c.props,{localizer:D,min:D.merge(z,p),max:D.merge(z,m),resource:R&&B,components:g,isNow:D.isSameDate(z,s),key:j+"-"+H,date:z,events:Y,backgroundEvents:U,dayLayoutAlgorithm:S}))})})}},{key:"render",value:function(){var r,a=this.props,o=a.events,s=a.backgroundEvents,c=a.range,d=a.width,p=a.rtl,m=a.selected,g=a.getNow,v=a.resources,D=a.components,S=a.accessors,T=a.getters,E=a.localizer,O=a.min,k=a.max,j=a.showMultiDayTimes,F=a.longPressThreshold,B=a.resizable;d=d||this.state.gutterWidth;var R=c[0],z=c[c.length-1];this.slots=c.length;var H=[],Y=[],U=[];return o.forEach(function(J){if(mp(J,R,z,S,E)){var Q=S.start(J),le=S.end(J);S.allDay(J)||E.startAndEndAreDateOnly(Q,le)||!j&&!E.isSameDate(Q,le)?H.push(J):Y.push(J)}}),s.forEach(function(J){mp(J,R,z,S,E)&&U.push(J)}),H.sort(function(J,Q){return Ww(J,Q,S,E)}),$.createElement("div",{className:Qn("rbc-time-view",v&&"rbc-time-view-resources"),ref:this.containerRef},$.createElement(xG,{range:c,events:H,width:d,rtl:p,getNow:g,localizer:E,selected:m,allDayMaxRows:this.props.showAllEvents?1/0:(r=this.props.allDayMaxRows)!==null&&r!==void 0?r:1/0,resources:this.memoizedResources(v,S),selectable:this.props.selectable,accessors:S,getters:T,components:D,scrollRef:this.scrollRef,isOverflowing:this.state.isOverflowing,longPressThreshold:F,onSelectSlot:this.handleSelectAllDaySlot,onSelectEvent:this.handleSelectEvent,onShowMore:this.handleShowMore,onDoubleClickEvent:this.props.onDoubleClickEvent,onKeyPressEvent:this.props.onKeyPressEvent,onDrillDown:this.props.onDrillDown,getDrilldownView:this.props.getDrilldownView,resizable:B}),this.props.popup&&this.renderOverlay(),$.createElement("div",{ref:this.contentRef,className:"rbc-time-content",onScroll:this.handleScroll},$.createElement(EG,{date:R,ref:this.gutterRef,localizer:E,min:E.merge(R,O),max:E.merge(R,k),step:this.props.step,getNow:this.props.getNow,timeslots:this.props.timeslots,components:D,className:"rbc-time-gutter",getters:T}),this.renderEvents(c,Y,U,g())))}},{key:"renderOverlay",value:function(){var r,a,o=this,s=(r=(a=this.state)===null||a===void 0?void 0:a.overlay)!==null&&r!==void 0?r:{},c=this.props,d=c.accessors,p=c.localizer,m=c.components,g=c.getters,v=c.selected,D=c.popupOffset,S=c.handleDragStart,T=function(){return o.setState({overlay:null})};return $.createElement(sb,{overlay:s,accessors:d,localizer:p,components:m,getters:g,selected:v,popupOffset:D,ref:this.containerRef,handleKeyPressEvent:this.handleKeyPressEvent,handleSelectEvent:this.handleSelectEvent,handleDoubleClickEvent:this.handleDoubleClickEvent,handleDragStart:S,show:!!s.position,overlayDisplay:this.overlayDisplay,onHide:T})}},{key:"clearSelection",value:function(){clearTimeout(this._selectTimer),this._pendingSelection=[]}},{key:"measureGutter",value:function(){var r=this;this.measureGutterAnimationFrameRequest&&window.cancelAnimationFrame(this.measureGutterAnimationFrameRequest),this.measureGutterAnimationFrameRequest=window.requestAnimationFrame(function(){var a,o=(a=r.gutterRef)!==null&&a!==void 0&&a.current?Vw(r.gutterRef.current):void 0;o&&r.state.gutterWidth!==o&&r.setState({gutterWidth:o})})}},{key:"applyScroll",value:function(){if(this._scrollRatio!=null&&this.props.enableAutoScroll===!0){var r=this.contentRef.current;r.scrollTop=r.scrollHeight*this._scrollRatio,this._scrollRatio=null}}},{key:"calculateScroll",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props,a=r.min,o=r.max,s=r.scrollToTime,c=r.localizer,d=c.diff(c.merge(s,a),s,"milliseconds"),p=c.diff(a,o,"milliseconds");this._scrollRatio=d/p}}]),t}(A.Component);rf.defaultProps={step:30,timeslots:2};var NG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],dv=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,c=s===void 0?o.startOf(new Date,"day"):s,d=r.max,p=d===void 0?o.endOf(new Date,"day"):d,m=r.scrollToTime,g=m===void 0?o.startOf(new Date,"day"):m,v=r.enableAutoScroll,D=v===void 0?!0:v,S=Fi(r,NG),T=t.range(a,{localizer:o});return $.createElement(rf,Object.assign({},S,{range:T,eventOffset:10,localizer:o,min:c,max:p,scrollToTime:g,enableAutoScroll:D}))}}]),t}($.Component);dv.range=function(e,t){var n=t.localizer;return[n.startOf(e,"day")]};dv.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"day");case Da.NEXT:return r.add(e,1,"day");default:return e}};dv.title=function(e,t){var n=t.localizer;return n.format(e,"dayHeaderFormat")};var kG=["date","localizer","min","max","scrollToTime","enableAutoScroll"],bl=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,c=s===void 0?o.startOf(new Date,"day"):s,d=r.max,p=d===void 0?o.endOf(new Date,"day"):d,m=r.scrollToTime,g=m===void 0?o.startOf(new Date,"day"):m,v=r.enableAutoScroll,D=v===void 0?!0:v,S=Fi(r,kG),T=t.range(a,this.props);return $.createElement(rf,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:c,max:p,scrollToTime:g,enableAutoScroll:D}))}}]),t}($.Component);bl.defaultProps=rf.defaultProps;bl.navigate=function(e,t,n){var r=n.localizer;switch(t){case Da.PREVIOUS:return r.add(e,-1,"week");case Da.NEXT:return r.add(e,1,"week");default:return e}};bl.range=function(e,t){var n=t.localizer,r=n.startOfWeek(),a=n.startOf(e,"week",r),o=n.endOf(e,"week",r);return n.range(a,o)};bl.title=function(e,t){var n=t.localizer,r=bl.range(e,{localizer:n}),a=bC(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};var AG=["date","localizer","min","max","scrollToTime","enableAutoScroll"];function ub(e,t){return bl.range(e,t).filter(function(n){return[6,0].indexOf(n.getDay())===-1})}var $p=function(e){ta(t,e);function t(){return gr(this,t),ea(this,t,arguments)}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.date,o=r.localizer,s=r.min,c=s===void 0?o.startOf(new Date,"day"):s,d=r.max,p=d===void 0?o.endOf(new Date,"day"):d,m=r.scrollToTime,g=m===void 0?o.startOf(new Date,"day"):m,v=r.enableAutoScroll,D=v===void 0?!0:v,S=Fi(r,AG),T=ub(a,this.props);return $.createElement(rf,Object.assign({},S,{range:T,eventOffset:15,localizer:o,min:c,max:p,scrollToTime:g,enableAutoScroll:D}))}}]),t}($.Component);$p.defaultProps=rf.defaultProps;$p.range=ub;$p.navigate=bl.navigate;$p.title=function(e,t){var n=t.localizer,r=ub(e,{localizer:n}),a=bC(r),o=a[0],s=a.slice(1);return n.format({start:o,end:s.pop()},"dayRangeHeaderFormat")};function Dl(e){var t=e.accessors,n=e.components,r=e.date,a=e.events,o=e.getters,s=e.length,c=e.localizer,d=e.onDoubleClickEvent,p=e.onSelectEvent,m=e.selected,g=A.useRef(null),v=A.useRef(null),D=A.useRef(null),S=A.useRef(null),T=A.useRef(null);A.useEffect(function(){k()});var E=function(z,H,Y){var U=n.event,J=n.date;return H=H.filter(function(Q){return mp(Q,c.startOf(z,"day"),c.endOf(z,"day"),t,c)}),H.map(function(Q,le){var pe=t.title(Q),ie=t.end(Q),se=t.start(Q),fe=o.eventProp(Q,se,ie,uv(Q,m)),oe=le===0&&c.format(z,"agendaDateFormat"),we=le===0?$.createElement("td",{rowSpan:H.length,className:"rbc-agenda-date-cell"},J?$.createElement(J,{day:z,label:oe}):oe):!1;return $.createElement("tr",{key:Y+"_"+le,className:fe.className,style:fe.style},we,$.createElement("td",{className:"rbc-agenda-time-cell"},O(z,Q)),$.createElement("td",{className:"rbc-agenda-event-cell",onClick:function(G){return p&&p(Q,G)},onDoubleClick:function(G){return d&&d(Q,G)}},U?$.createElement(U,{event:Q,title:pe}):pe))},[])},O=function(z,H){var Y="",U=n.time,J=c.messages.allDay,Q=t.end(H),le=t.start(H);return t.allDay(H)||(c.eq(le,Q)?J=c.format(le,"agendaTimeFormat"):c.isSameDate(le,Q)?J=c.format({start:le,end:Q},"agendaTimeRangeFormat"):c.isSameDate(z,le)?J=c.format(le,"agendaTimeFormat"):c.isSameDate(z,Q)&&(J=c.format(Q,"agendaTimeFormat"))),c.gt(z,le,"day")&&(Y="rbc-continues-prior"),c.lt(z,Q,"day")&&(Y+=" rbc-continues-after"),$.createElement("span",{className:Y.trim()},U?$.createElement(U,{event:H,day:z,label:J}):J)},k=function(){if(T.current){var z=g.current,H=T.current.firstChild;if(H){var Y=S.current.scrollHeight>S.current.clientHeight,U=[],J=U;U=[Vw(H.children[0]),Vw(H.children[1])],(J[0]!==U[0]||J[1]!==U[1])&&(v.current.style.width=U[0]+"px",D.current.style.width=U[1]+"px"),Y?(A7(z,"rbc-header-overflowing"),z.style.marginRight=JE()+"px"):F7(z,"rbc-header-overflowing")}}},j=c.messages,F=c.add(r,s,"day"),B=c.range(r,F,"day");return a=a.filter(function(R){return mp(R,c.startOf(r,"day"),c.endOf(F,"day"),t,c)}),a.sort(function(R,z){return+t.start(R)-+t.start(z)}),$.createElement("div",{className:"rbc-agenda-view"},a.length!==0?$.createElement($.Fragment,null,$.createElement("table",{ref:g,className:"rbc-agenda-table"},$.createElement("thead",null,$.createElement("tr",null,$.createElement("th",{className:"rbc-header",ref:v},j.date),$.createElement("th",{className:"rbc-header",ref:D},j.time),$.createElement("th",{className:"rbc-header"},j.event)))),$.createElement("div",{className:"rbc-agenda-content",ref:S},$.createElement("table",{className:"rbc-agenda-table"},$.createElement("tbody",{ref:T},B.map(function(R,z){return E(R,a,z)}))))):$.createElement("span",{className:"rbc-agenda-empty"},j.noEventsInRange))}Dl.defaultProps={length:30};Dl.range=function(e,t){var n=t.length,r=n===void 0?Dl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return{start:e,end:o}};Dl.navigate=function(e,t,n){var r=n.length,a=r===void 0?Dl.defaultProps.length:r,o=n.localizer;switch(t){case Da.PREVIOUS:return o.add(e,-a,"day");case Da.NEXT:return o.add(e,a,"day");default:return e}};Dl.title=function(e,t){var n=t.length,r=n===void 0?Dl.defaultProps.length:n,a=t.localizer,o=a.add(e,r,"day");return a.format({start:e,end:o},"agendaHeaderFormat")};var ny=Iu(Iu(Iu(Iu(Iu({},Qr.MONTH,cv),Qr.WEEK,bl),Qr.WORK_WEEK,$p),Qr.DAY,dv),Qr.AGENDA,Dl),FG=["action","date","today"];function OG(e,t){var n=t.action,r=t.date,a=t.today,o=Fi(t,FG);switch(e=typeof e=="string"?ny[e]:e,n){case Da.TODAY:r=a||new Date;break;case Da.DATE:break;default:op(e&&typeof e.navigate=="function","Calendar View components must implement a static `.navigate(date, action)` method.s"),r=e.navigate(r,n,o)}return r}var PG=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.navigate=function(s){n.props.onNavigate(s)},n.view=function(s){n.props.onView(s)},n}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.localizer.messages,o=r.label;return $.createElement("div",{className:"rbc-toolbar"},$.createElement("span",{className:"rbc-btn-group"},$.createElement("button",{type:"button",onClick:this.navigate.bind(null,Da.TODAY)},a.today),$.createElement("button",{type:"button",onClick:this.navigate.bind(null,Da.PREVIOUS)},a.previous),$.createElement("button",{type:"button",onClick:this.navigate.bind(null,Da.NEXT)},a.next)),$.createElement("span",{className:"rbc-toolbar-label"},o),$.createElement("span",{className:"rbc-btn-group"},this.viewNamesGroup(a)))}},{key:"viewNamesGroup",value:function(r){var a=this,o=this.props.views,s=this.props.view;if(o.length>1)return o.map(function(c){return $.createElement("button",{type:"button",key:c,className:Qn({"rbc-active":s===c}),onClick:a.view.bind(null,c)},r[c])})}}]),t}($.Component);function jG(e,t){var n=null;return typeof t=="function"?n=t(e):typeof t=="string"&&gs(e)==="object"&&e!=null&&t in e&&(n=e[t]),n}var fl=function(t){return function(n){return jG(n,t)}},LG=["view","date","getNow","onNavigate"],RG=["view","toolbar","events","backgroundEvents","style","className","elementProps","date","getNow","length","showMultiDayTimes","onShowMore","doShowMoreDrillDown","components","formats","messages","culture"];function qC(e){if(Array.isArray(e))return e;for(var t=[],n=0,r=Object.entries(e);n<r.length;n++){var a=fs(r[n],2),o=a[0],s=a[1];s&&t.push(o)}return t}function BG(e,t){var n=t.views,r=qC(n);return r.indexOf(e)!==-1}var JC=function(e){ta(t,e);function t(){var n;gr(this,t);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return n=ea(this,t,[].concat(a)),n.getViews=function(){var s=n.props.views;return Array.isArray(s)?u$(s,function(c,d){return c[d]=ny[d]},{}):gs(s)==="object"?m$(s,function(c,d){return c===!0?ny[d]:c}):ny},n.getView=function(){var s=n.getViews();return s[n.props.view]},n.getDrilldownView=function(s){var c=n.props,d=c.view,p=c.drilldownView,m=c.getDrilldownView;return m?m(s,d,Object.keys(n.getViews())):p},n.handleRangeChange=function(s,c,d){var p=n.props,m=p.onRangeChange,g=p.localizer;m&&c.range&&m(c.range(s,{localizer:g}),d)},n.handleNavigate=function(s,c){var d=n.props,p=d.view,m=d.date,g=d.getNow,v=d.onNavigate,D=Fi(d,LG),S=n.getView(),T=g();m=OG(S,rn(rn({},D),{},{action:s,date:c||m||T,today:T})),v(m,p,s),n.handleRangeChange(m,S)},n.handleViewChange=function(s){s!==n.props.view&&BG(s,n.props)&&n.props.onView(s);var c=n.getViews();n.handleRangeChange(n.props.date||n.props.getNow(),c[s],s)},n.handleSelectEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onSelectEvent,c)},n.handleDoubleClickEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onDoubleClickEvent,c)},n.handleKeyPressEvent=function(){for(var s=arguments.length,c=new Array(s),d=0;d<s;d++)c[d]=arguments[d];yn(n.props.onKeyPressEvent,c)},n.handleSelectSlot=function(s){yn(n.props.onSelectSlot,s)},n.handleDrillDown=function(s,c){var d=n.props.onDrillDown;if(d){d(s,c,n.drilldownView);return}c&&n.handleViewChange(c),n.handleNavigate(Da.DATE,s)},n.state={context:t.getContext(n.props)},n}return yr(t,[{key:"render",value:function(){var r=this.props,a=r.view,o=r.toolbar,s=r.events,c=r.backgroundEvents,d=r.style,p=r.className,m=r.elementProps,g=r.date,v=r.getNow,D=r.length,S=r.showMultiDayTimes,T=r.onShowMore,E=r.doShowMoreDrillDown;r.components,r.formats,r.messages,r.culture;var O=Fi(r,RG);g=g||v();var k=this.getView(),j=this.state.context,F=j.accessors,B=j.components,R=j.getters,z=j.localizer,H=j.viewNames,Y=B.toolbar||PG,U=k.title(g,{localizer:z,length:D});return $.createElement("div",Object.assign({},m,{className:Qn(p,"rbc-calendar",O.rtl&&"rbc-rtl"),style:d}),o&&$.createElement(Y,{date:g,view:a,views:H,label:U,onView:this.handleViewChange,onNavigate:this.handleNavigate,localizer:z}),$.createElement(k,Object.assign({},O,{events:s,backgroundEvents:c,date:g,getNow:v,length:D,localizer:z,getters:R,components:B,accessors:F,showMultiDayTimes:S,getDrilldownView:this.getDrilldownView,onNavigate:this.handleNavigate,onDrillDown:this.handleDrillDown,onSelectEvent:this.handleSelectEvent,onDoubleClickEvent:this.handleDoubleClickEvent,onKeyPressEvent:this.handleKeyPressEvent,onSelectSlot:this.handleSelectSlot,onShowMore:T,doShowMoreDrillDown:E})))}}],[{key:"getDerivedStateFromProps",value:function(r){return{context:t.getContext(r)}}},{key:"getContext",value:function(r){var a=r.startAccessor,o=r.endAccessor,s=r.allDayAccessor,c=r.tooltipAccessor,d=r.titleAccessor,p=r.resourceAccessor,m=r.resourceIdAccessor,g=r.resourceTitleAccessor,v=r.eventPropGetter,D=r.backgroundEventPropGetter,S=r.slotPropGetter,T=r.slotGroupPropGetter,E=r.dayPropGetter,O=r.view,k=r.views,j=r.localizer,F=r.culture,B=r.messages,R=B===void 0?{}:B,z=r.components,H=z===void 0?{}:z,Y=r.formats,U=Y===void 0?{}:Y,J=qC(k),Q=z$(R);return{viewNames:J,localizer:H$(j,F,U,Q),getters:{eventProp:function(){return v&&v.apply(void 0,arguments)||{}},backgroundEventProp:function(){return D&&D.apply(void 0,arguments)||{}},slotProp:function(){return S&&S.apply(void 0,arguments)||{}},slotGroupProp:function(){return T&&T.apply(void 0,arguments)||{}},dayProp:function(){return E&&E.apply(void 0,arguments)||{}}},components:JW(H[O]||{},zW(H,J),{eventWrapper:ds,backgroundEventWrapper:ds,eventContainerWrapper:ds,dateCellWrapper:ds,weekWrapper:ds,timeSlotWrapper:ds,timeGutterWrapper:ds}),accessors:{start:fl(a),end:fl(o),allDay:fl(s),tooltip:fl(c),title:fl(d),resource:fl(p),resourceId:fl(m),resourceTitle:fl(g)}}}}]),t}($.Component);JC.defaultProps={events:[],backgroundEvents:[],elementProps:{},popup:!1,toolbar:!0,view:Qr.MONTH,views:[Qr.MONTH,Qr.WEEK,Qr.DAY,Qr.AGENDA],step:30,length:30,allDayMaxRows:1/0,doShowMoreDrillDown:!0,drilldownView:Qr.DAY,titleAccessor:"title",tooltipAccessor:"title",allDayAccessor:"allDay",startAccessor:"start",endAccessor:"end",resourceAccessor:"resourceId",resourceIdAccessor:"id",resourceTitleAccessor:"title",longPressThreshold:250,getNow:function(){return new Date},dayLayoutAlgorithm:"overlap"};var _G=NE(JC,{view:"onView",date:"onNavigate",selected:"onSelectEvent"}),HG=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"MMMM DD",n)+" "+r.format(o,r.eq(a,o,"month")?"DD":"MMMM DD",n)},YG=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"L",n)+" "+r.format(o,"L",n)},G0=function(t,n,r){var a=t.start,o=t.end;return r.format(a,"LT",n)+" "+r.format(o,"LT",n)},zG=function(t,n,r){var a=t.start;return r.format(a,"LT",n)+" "},UG=function(t,n,r){var a=t.end;return" "+r.format(a,"LT",n)},VG={dateFormat:"DD",dayFormat:"DD ddd",weekdayFormat:"ddd",selectRangeFormat:G0,eventTimeRangeFormat:G0,eventTimeRangeStartFormat:zG,eventTimeRangeEndFormat:UG,timeGutterFormat:"LT",monthHeaderFormat:"MMMM YYYY",dayHeaderFormat:"dddd MMM DD",dayRangeHeaderFormat:HG,agendaHeaderFormat:YG,agendaDateFormat:"ddd MMM DD",agendaTimeFormat:"LT",agendaTimeRangeFormat:G0};function hl(e){var t=e&&e.toLowerCase();return t==="FullYear"?t="year":t||(t=void 0),t}function ZG(e){var t=function(te,ge){return ge?te.locale(ge):te};function n(G){return e(G).toDate().getTimezoneOffset()}function r(G,te){var ge,Ie,De=e(G).local(),ke=e(te).local();if(!e.tz)return De.toDate().getTimezoneOffset()-ke.toDate().getTimezoneOffset();var Ye=(ge=De==null||(Ie=De._z)===null||Ie===void 0?void 0:Ie.name)!==null&&ge!==void 0?ge:e.tz.guess(),Re=e.tz.zone(Ye).utcOffset(+De),rt=e.tz.zone(Ye).utcOffset(+ke);return Re-rt}function a(G){var te=e(G).startOf("day");return r(te,G)}function o(G,te,ge){var Ie=hl(ge),De=Ie?e(G).startOf(Ie):e(G),ke=Ie?e(te).startOf(Ie):e(te);return[De,ke,Ie]}function s(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,te=arguments.length>1?arguments[1]:void 0,ge=hl(te);return ge?e(G).startOf(ge).toDate():e(G).toDate()}function c(){var G=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,te=arguments.length>1?arguments[1]:void 0,ge=hl(te);return ge?e(G).endOf(ge).toDate():e(G).toDate()}function d(G,te,ge){var Ie=o(G,te,ge),De=fs(Ie,3),ke=De[0],Ye=De[1],Re=De[2];return ke.isSame(Ye,Re)}function p(G,te,ge){return!d(G,te,ge)}function m(G,te,ge){var Ie=o(G,te,ge),De=fs(Ie,3),ke=De[0],Ye=De[1],Re=De[2];return ke.isAfter(Ye,Re)}function g(G,te,ge){var Ie=o(G,te,ge),De=fs(Ie,3),ke=De[0],Ye=De[1],Re=De[2];return ke.isBefore(Ye,Re)}function v(G,te,ge){var Ie=o(G,te,ge),De=fs(Ie,3),ke=De[0],Ye=De[1],Re=De[2];return ke.isSameOrBefore(Ye,Re)}function D(G,te,ge){var Ie=o(G,te,ge),De=fs(Ie,3),ke=De[0],Ye=De[1],Re=De[2];return ke.isSameOrBefore(Ye,Re)}function S(G,te,ge){var Ie=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"day",De=hl(Ie),ke=e(G),Ye=e(te),Re=e(ge);return ke.isBetween(Ye,Re,De,"[]")}function T(G,te){var ge=e(G),Ie=e(te),De=e.min(ge,Ie);return De.toDate()}function E(G,te){var ge=e(G),Ie=e(te),De=e.max(ge,Ie);return De.toDate()}function O(G,te){if(!G&&!te)return null;var ge=e(te).format("HH:mm:ss"),Ie=e(G).startOf("day").format("MM/DD/YYYY");return e("".concat(Ie," ").concat(ge),"MM/DD/YYYY HH:mm:ss").toDate()}function k(G,te,ge){var Ie=hl(ge);return e(G).add(te,Ie).toDate()}function j(G,te){for(var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Ie=hl(ge),De=e(G).toDate(),ke=[];D(De,te);)ke.push(De),De=k(De,1,Ie);return ke}function F(G,te){var ge=hl(te),Ie=s(G,ge);return d(Ie,G)?Ie:k(Ie,1,ge)}function B(G,te){var ge=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"day",Ie=hl(ge),De=e(G),ke=e(te);return ke.diff(De,Ie)}function R(G){var te=e(G);return te.minutes()}function z(G){var te=G?e.localeData(G):e.localeData();return te?te.firstDayOfWeek():0}function H(G){return e(G).startOf("month").startOf("week").toDate()}function Y(G){return e(G).endOf("month").endOf("week").toDate()}function U(G){for(var te=H(G),ge=Y(G),Ie=[];D(te,ge);)Ie.push(te),te=k(te,1,"d");return Ie}function J(G,te,ge){return e(G).startOf("day").minute(te+ge).toDate()}function Q(G,te){return B(G,te,"minutes")}function le(G){var te=e(G).startOf("day"),ge=e(G);return ge.diff(te,"minutes")+a(G)}function pe(G,te){var ge=e(G),Ie=e(te);return ge.isBefore(Ie,"day")}function ie(G,te,ge){var Ie=e(te),De=e(ge);return Ie.isSameOrAfter(De,"minutes")}function se(G,te){var ge=e(G),Ie=e(te),De=e.duration(Ie.diff(ge));return De.days()}function fe(G){var te=G.evtA,ge=te.start,Ie=te.end,De=te.allDay,ke=G.evtB,Ye=ke.start,Re=ke.end,rt=ke.allDay,Ht=+s(ge,"day")-+s(Ye,"day"),Se=se(ge,Ie),Ze=se(Ye,Re);return Ht||Ze-Se||!!rt-!!De||+ge-+Ye||+Ie-+Re}function oe(G){var te=G.event,ge=te.start,Ie=te.end,De=G.range,ke=De.start,Ye=De.end,Re=e(ge).startOf("day"),rt=e(Ie),Ht=e(ke),Se=e(Ye),Ze=Re.isSameOrBefore(Se,"day"),Ke=!Re.isSame(rt,"minutes"),Je=Ke?rt.isAfter(Ht,"minutes"):rt.isSameOrAfter(Ht,"minutes");return Ze&&Je}function we(G,te){var ge=e(G),Ie=e(te);return ge.isSame(Ie,"day")}function Z(){var G=new Date,te=/-/.test(G.toString())?"-":"",ge=G.getTimezoneOffset(),Ie=Number("".concat(te).concat(Math.abs(ge))),De=e().utcOffset();return De>Ie?1:0}return new _$({formats:VG,firstOfWeek:z,firstVisibleDay:H,lastVisibleDay:Y,visibleDays:U,format:function(te,ge,Ie){return t(e(te),Ie).format(ge)},lt:g,lte:D,gt:m,gte:v,eq:d,neq:p,merge:O,inRange:S,startOf:s,endOf:c,range:j,add:k,diff:B,ceil:F,min:T,max:E,minutes:R,getSlotDate:J,getTimezoneOffset:n,getDstOffset:r,getTotalMin:Q,getMinutesFromMidnight:le,continuesPrior:pe,continuesAfter:ie,sortEvents:fe,inEventRange:oe,isSameDate:we,daySpan:se,browserTZOffset:Z})}function D2(e,t,n,r,a){const o={start:r.start(e),end:r.end(e)},s={start:t,end:n};return a.inEventRange({event:o,range:s})}function WG(e,t){return!e||t==null?!1:FI.isEqual(e,t)}const Td={PREVIOUS:"PREV",NEXT:"NEXT",TODAY:"TODAY",DATE:"DATE"};function ys({accessors:e,components:t,date:n,events:r,getters:a,length:o,localizer:s,onDoubleClickEvent:c,onSelectEvent:d,selected:p}){A.useRef(null);const m=A.useRef(null),g=A.useRef(null),v=A.useRef(null),D=A.useRef(null),[S,T]=A.useState(!1),[E,O]=A.useState(!1),k=(U,J,Q)=>{const{event:le,date:pe}=t;return J=J.filter(ie=>D2(ie,s.startOf(U,"day"),s.endOf(U,"day"),e,s)),J.map((ie,se)=>{const fe=e.title(ie),oe=e.end(ie),we=e.start(ie),Z=a.eventProp(ie,we,oe,WG(ie,p)),G=se===0&&s.format(U,"agendaDateFormat"),te=se===0?w.jsx("td",{rowSpan:J.length,className:"rbc-agenda-date-cell",children:pe?w.jsx(pe,{day:U,label:G}):G}):!1;return w.jsxs("tr",{className:Z.className,style:Z.style,children:[te,w.jsx("td",{className:"rbc-agenda-time-cell",children:j(U,ie)}),w.jsx("td",{className:"rbc-agenda-event-cell",onClick:ge=>d&&d(ie,ge),onDoubleClick:ge=>c&&c(ie,ge),children:le?w.jsx(le,{event:ie,title:fe}):fe})]},Q+"_"+se)},[])},j=(U,J)=>{const Q=t.time;let le="",pe=s.messages.allDay;const ie=e.end(J),se=e.start(J);return e.allDay(J)||(s.eq(se,ie)?pe=s.format(se,"agendaTimeFormat"):s.isSameDate(se,ie)?pe=s.format({start:se,end:ie},"agendaTimeRangeFormat"):s.isSameDate(U,se)?pe=s.format(se,"agendaTimeFormat"):s.isSameDate(U,ie)&&(pe=s.format(ie,"agendaTimeFormat"))),s.gt(U,se,"day")&&(le="rbc-continues-prior"),s.lt(U,ie,"day")&&(le+=" rbc-continues-after"),w.jsx("span",{className:le.trim(),children:Q?w.jsx(Q,{event:J,day:U,label:pe}):pe})},{messages:F}=s,B=s.add(n,-o/2,"day"),R=s.add(n,o/2,"day"),z=s.range(B,R,"day");S&&z.reverse(),r=r.filter(U=>D2(U,s.startOf(B,"day"),s.endOf(R,"day"),e,s)),r.sort((U,J)=>+e.start(U)-+e.start(J)),E&&r.reverse();const H=A.useCallback(()=>setTimeout(()=>{D.current&&Zy(D.current,{backgroundColor:"#ffffff",pixelRatio:window.devicePixelRatio*2}).then(U=>{new C.Notice(N("Image is generating..."));const J=Xe.getState().settings.AutoSaveWhenOnMobile,Q=Xe.getState().app.vault;if(J&&C.Platform.isMobile){const le=U.split("base64,")[1];Oy(le,"image/png").arrayBuffer().then(async ie=>{let se;const fe="png",oe=bs();for(const we in oe)if(oe[we]instanceof C.TFile){se=oe[we];break}se!==void 0&&await Q.createBinary(await Q.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,fe,se),ie)})}Wy({imgUrl:U})}).catch(U=>{console.error(U)})},0),[D.current,z]),Y=A.useCallback(U=>{const J=new C.Menu;J.addItem(Q=>{Q.setIcon("share-2").setTitle(N("Share")).onClick(()=>{H()})}),J.showAtMouseEvent(U.nativeEvent)},[D.current,z,H]);return w.jsx("div",{className:"rbc-agenda-view",children:r.length!==0?w.jsx($.Fragment,{children:w.jsxs("table",{ref:D,className:"rbc-agenda-table",children:[w.jsx("thead",{onContextMenu:Y,children:w.jsxs("tr",{children:[w.jsx("th",{className:"rbc-header",ref:m,onClick:()=>{T(!S)},children:F.date+(S?" 🔼":" 🔽")}),w.jsx("th",{className:"rbc-header",ref:g,onClick:()=>{O(!E)},children:F.time+(E?" 🔼":" 🔽")}),w.jsx("th",{className:"rbc-header",children:F.event})]})}),w.jsx("tbody",{ref:v,children:z.map((U,J)=>k(U,r,J))})]})}):w.jsx("span",{className:"rbc-agenda-empty",children:F.noEventsInRange})})}ys.propTypes={accessors:Ae.object.isRequired,components:Ae.object.isRequired,date:Ae.instanceOf(Date),events:Ae.array,getters:Ae.object.isRequired,length:Ae.number.isRequired,localizer:Ae.object.isRequired,onSelectEvent:Ae.func,onDoubleClickEvent:Ae.func,selected:Ae.object};ys.defaultProps={length:30};ys.range=(e,{length:t=ys.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return{customStart:r,customEnd:a}};ys.navigate=(e,t,{length:n=ys.defaultProps.length,localizer:r})=>{switch(t){case Td.PREVIOUS:return r.add(e,-n,"day");case Td.NEXT:return r.add(e,n,"day");default:return e}};ys.title=(e,{length:t=ys.defaultProps.length,localizer:n})=>{const r=n.add(e,-t/2,"day"),a=n.add(e,t/2,"day");return n.format({start:r,end:a},"agendaHeaderFormat")};function $G(e,t){e.hoverEl.toggleClass("thino-hover-popover",!0);const n=Ap(e.hoverEl);return n.render(w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(Sa,{memo:t})})),n}function GG({event:e}){const t=e.resource,n=t.content.split(`
`)[0].slice(0,20),r=$.useRef(null),a=$.useRef(null),o=$.useRef(null);A.useEffect(()=>{if(a.current)return C.setIcon(a.current,"calendar"),()=>{r.current&&(r.current=null)}},[r]);const s=A.useCallback(d=>{o.current&&(o.current.unmount(),o.current=null),o.current=d},[]),c=A.useCallback(d=>{if(!r.current||!C.Keymap.isModifier(d.nativeEvent,"Mod"))return;const p=new C.HoverPopover(Xe.getState().view,r.current,100),m=$G(p,t);s(m)},[r.current]);return w.jsxs("span",{className:"rbc-event-renderer","data-source-type":t.sourceType,"data-thino-type":t.thinoType,"data-thino-id":t.id,ref:r,"aria-label":t.path,onMouseOver:c,children:[w.jsx(qG,{event:e}),w.jsx("strong",{children:n})]})}const qG=({event:e})=>{const t=$.useRef(null),n=e.resource;A.useEffect(()=>{t.current&&C.setIcon(t.current,n.thinoType==="JOURNAL"?"calendar":n.thinoType==="TASK-TODO"?"square":"check-square")},[n==null?void 0:n.thinoType,t]);const r=A.useCallback(async a=>{a.stopPropagation(),a.preventDefault(),await(async()=>{const s=await Te.updateMemo(n.id,n.content,n.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");s&&Te.editMemo(s)})()},[n==null?void 0:n.thinoType,n==null?void 0:n.id,n==null?void 0:n.content]);return w.jsx(w.Fragment,{children:w.jsxs("span",{className:"rbc-event-icon-group",children:[w.jsx("span",{className:"rbc-event-icon",ref:t,onClick:r}),w.jsx("span",{className:Xn("rbc-event-time","hidden"),children:w.jsx("span",{className:"rbc-event-time-text",children:C.moment(e.start).format("HH:mm")})})]})})};function KC({views:e,view:t,messages:n,onView:r}){return e.map(a=>w.jsx("button",{type:"button",className:Xn({"rbc-active":t===a}),onClick:()=>r(a),children:n[a]},a))}KC.propTypes={messages:Ae.object,onView:Ae.func,view:Ae.string,views:Ae.array};function QC({date:e,label:t,localizer:{messages:n},onNavigate:r,onView:a,view:o,views:s}){const c={previous:A.useRef(null),today:A.useRef(null),next:A.useRef(null)};A.useEffect(()=>{c&&(C.setIcon(c.previous.current,"chevron-left"),C.setIcon(c.today.current,"dot"),C.setIcon(c.next.current,"chevron-right"))},[c]);const d=A.useMemo(()=>w.jsxs(w.Fragment,{children:[w.jsx("button",{ref:c.previous,type:"button",onClick:()=>r(Td.PREVIOUS),"aria-label":n.previous,children:"<"}),w.jsx("button",{ref:c.today,type:"button",onClick:()=>r(Td.TODAY),"aria-label":n.today,children:"•"}),w.jsx("button",{ref:c.next,type:"button",onClick:()=>r(Td.NEXT),"aria-label":n.next,children:">"})]}),[n]);return w.jsxs("div",{className:"rbc-toolbar",children:[w.jsx("span",{className:Xn("rbc-btn-group","thino-view-custom-toolbar"),children:d}),w.jsx("span",{className:"rbc-toolbar-label",children:w.jsx(py,{type:"text",handleValueChange:p=>{r(Td.DATE,C.moment(p,"YYYY-MM-DD").format("YYYY-MM-DDTHH:mm:ssZ"))},defaultText:t+(o==="week"?C.moment(e.valueOf(),"x").format(" [W]WW"):""),defaultValue:C.moment(e.valueOf(),"x").valueOf()})}),w.jsx("span",{className:"rbc-btn-group",children:w.jsx(KC,{view:o,views:s,messages:n,onView:a})})]})}QC.propTypes={date:Ae.instanceOf(Date),label:Ae.string,localizer:Ae.object,messages:Ae.object,onNavigate:Ae.func,onView:Ae.func,view:Ae.string,views:Ae.array};function JG({event:e,children:t,showPopup:n,callRender:r,...a}){const o=A.useRef(null),s=A.useRef(null),c=A.useCallback(d=>{if(!d.isTrusted){r();return}s.current=d.nativeEvent.target,s.current&&(s.current.hasClass("rbc-event")||(s.current=s.current.closest(".rbc-event")),o.current!==null?(window.clearTimeout(o.current),o.current=null):o.current=window.setTimeout(()=>{n(e,s.current),o.current=null},250))},[e,n]);return w.jsx(w.Fragment,{children:w.jsx("div",{className:"rbc-event-wrapper","aria-describedby":"thino",onClick:c,children:t})})}const KG=ZG(C.moment),QG=({event:e})=>{const t=e.resource;return w.jsx(w.Fragment,{children:w.jsx(Sa,{memo:t})})},XG=e=>{var Q;const{thinos:t}=e,[n,r]=$.useState([]),[a,o]=$.useState((app==null?void 0:app.loadLocalStorage("thino-calendar-view"))||"month"),[s,c]=$.useState(null),d=$.useRef(null),p=$.useRef(null),[m,g]=$.useState(!1),v=A.useRef(null),[D,S]=A.useState(new Date);A.useEffect(()=>()=>{d.current&&(d.current=null),p.current&&(p.current=null),v.current&&(v.current=null)},[]),A.useEffect(()=>{const le=t.map(pe=>{const ie=C.moment(pe.createdAt,"YYYY/MM/DD HH:mm:ss"),se=ie.clone().add(1,"minute");return{title:pe.content,start:new Date(ie.format("YYYY-MM-DDTHH:mm:ss")),end:new Date(se.format("YYYY-MM-DDTHH:mm:ss")),resource:pe}});r(le)},[t]),A.useEffect(()=>{app==null||app.saveLocalStorage("thino-calendar-view",a)},[a]),A.useEffect(()=>{m&&c(t.find(le=>le.id===s.id))},[t]),A.useEffect(()=>{s&&v.current.update()},[s]),v.current=Vy(d.current,p.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,4]}}]});const T=A.useCallback(()=>{v.current.update(),v.current.update()},[]),E=A.useCallback((le,pe)=>{c(null),F(),v.current.state.elements.reference=pe,c(le.resource),B()},[]),O=A.useCallback(()=>{F(),c(null)},[]),k=A.useCallback((le,pe,ie)=>{var se;if(j(le),pe==="week"||pe==="day"){const fe=d.current.find(".rbc-event-wrapper");if(d.current.closest(".memolist-wrapper"),fe){(se=fe.children[0])==null||se.click();return}else{setTimeout(()=>{var we,Z;const oe=d.current.find(".rbc-event-wrapper");(Z=(we=oe==null?void 0:oe.children)==null?void 0:we[0])==null||Z.click()},0);return}}},[]),j=A.useCallback(le=>{S(le)},[S]);Pp(p,O);const F=A.useCallback(()=>{g(!1)},[g]),B=A.useCallback(()=>{v.current.update(),g(!0)},[g]),R=A.useCallback(le=>{const pe=le.resource;Qe.setEditMemoId(pe.id)},[]),z=A.useCallback(le=>{o(le)},[o]),{components:H,views:Y,messages:U}=A.useMemo(()=>({components:{toolbar:QC,eventWrapper:le=>w.jsx(JG,{...le,callRender:T,showPopup:E}),agenda:{event:QG},event:GG},views:{month:!0,agenda:ys,week:!0,day:!0},messages:{month:N("Month"),day:N("Day"),next:N("Next"),previous:N("Previous"),today:N("Today"),agenda:N("Agenda"),week:N("Week"),yesterday:N("Yesterday"),tomorrow:N("Tomorrow"),noEventsInRange:N("No thinos in range"),date:N("date"),time:N("time"),event:N("event")}}),[]),J=A.useMemo(()=>({timeGutterFormat:(le,pe,ie)=>ie.format(le,"HH:mm",pe),agendaTimeRangeFormat:({start:le,end:pe},ie,se)=>se.format(le,"HH:mm",ie)+" — "+se.format(pe,"HH:mm",ie),agendaHeaderFormat:({start:le,end:pe},ie,se)=>se.format(le,"YYYY-MM-DD")+" — "+se.format(pe,"YYYY-MM-DD")}),[]);return w.jsxs("div",{ref:d,className:"calendar-view",children:[w.jsx(_G,{date:D,messages:U,components:H,localizer:KG,events:n,views:Y,onView:z,onDoubleClickEvent:R,onNavigate:k,formats:J,defaultView:a,tooltipAccessor:null,startAccessor:"start",endAccessor:"end"}),w.jsx("div",{ref:p,style:(Q=v.current)==null?void 0:Q.styles.popper,className:Xn("thino-popup-container",m?"":"hidden"),children:s&&w.jsx(Sa,{memo:s})})]})};function vl(e,t){return typeof e=="function"?e(t):e}function Ua(e,t){return n=>{t.setState(r=>({...r,[e]:vl(n,r[e])}))}}function My(e){return e instanceof Function}function eq(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function tq(e,t){const n=[],r=a=>{a.forEach(o=>{n.push(o);const s=t(o);s!=null&&s.length&&r(s)})};return r(e),n}function ht(e,t,n){let r=[],a;return o=>{let s;n.key&&n.debug&&(s=Date.now());const c=e(o);if(!(c.length!==r.length||c.some((m,g)=>r[g]!==m)))return a;r=c;let p;if(n.key&&n.debug&&(p=Date.now()),a=t(...c),n==null||n.onChange==null||n.onChange(a),n.key&&n.debug&&n!=null&&n.debug()){const m=Math.round((Date.now()-s)*100)/100,v=Math.round((Date.now()-p)*100)/100/16,D=(S,T)=>{for(S=String(S);S.length<T;)S=" "+S;return S}}return a}}function pt(e,t,n,r){return{debug:()=>{var a;return(a=e==null?void 0:e.debugAll)!=null?a:e[t]},key:!1,onChange:r}}function nq(e,t,n,r){var a,o;const c={...e._getDefaultColumnDef(),...t},d=c.accessorKey;let p=(a=(o=c.id)!=null?o:d?d.replace(".","_"):void 0)!=null?a:typeof c.header=="string"?c.header:void 0,m;if(c.accessorFn?m=c.accessorFn:d&&(d.includes(".")?m=v=>{let D=v;for(const T of d.split(".")){var S;D=(S=D)==null?void 0:S[T]}return D}:m=v=>v[c.accessorKey]),!p)throw new Error;let g={id:`${String(p)}`,accessorFn:m,parent:r,depth:n,columnDef:c,columns:[],getFlatColumns:ht(()=>[!0],()=>{var v;return[g,...(v=g.columns)==null?void 0:v.flatMap(D=>D.getFlatColumns())]},pt(e.options,"debugColumns")),getLeafColumns:ht(()=>[e._getOrderColumnsFn()],v=>{var D;if((D=g.columns)!=null&&D.length){let S=g.columns.flatMap(T=>T.getLeafColumns());return v(S)}return[g]},pt(e.options,"debugColumns"))};for(const v of e._features)v.createColumn==null||v.createColumn(g,e);return g}const Rr="debugHeaders";function S2(e,t,n){var r;let o={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],c=d=>{d.subHeaders&&d.subHeaders.length&&d.subHeaders.map(c),s.push(d)};return c(o),s},getContext:()=>({table:e,header:o,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(o,e)}),o}const rq={createTable:e=>{e.getHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>{var o,s;const c=(o=r==null?void 0:r.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?o:[],d=(s=a==null?void 0:a.map(g=>n.find(v=>v.id===g)).filter(Boolean))!=null?s:[],p=n.filter(g=>!(r!=null&&r.includes(g.id))&&!(a!=null&&a.includes(g.id)));return Bg(t,[...c,...p,...d],e)},pt(e.options,Rr)),e.getCenterHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,a)=>(n=n.filter(o=>!(r!=null&&r.includes(o.id))&&!(a!=null&&a.includes(o.id))),Bg(t,n,e,"center")),pt(e.options,Rr)),e.getLeftHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(c=>c.id===s)).filter(Boolean))!=null?a:[];return Bg(t,o,e,"left")},pt(e.options,Rr)),e.getRightHeaderGroups=ht(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var a;const o=(a=r==null?void 0:r.map(s=>n.find(c=>c.id===s)).filter(Boolean))!=null?a:[];return Bg(t,o,e,"right")},pt(e.options,Rr)),e.getFooterGroups=ht(()=>[e.getHeaderGroups()],t=>[...t].reverse(),pt(e.options,Rr)),e.getLeftFooterGroups=ht(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),pt(e.options,Rr)),e.getCenterFooterGroups=ht(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),pt(e.options,Rr)),e.getRightFooterGroups=ht(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),pt(e.options,Rr)),e.getFlatHeaders=ht(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),pt(e.options,Rr)),e.getLeftFlatHeaders=ht(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),pt(e.options,Rr)),e.getCenterFlatHeaders=ht(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),pt(e.options,Rr)),e.getRightFlatHeaders=ht(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),pt(e.options,Rr)),e.getCenterLeafHeaders=ht(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(e.options,Rr)),e.getLeftLeafHeaders=ht(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(e.options,Rr)),e.getRightLeafHeaders=ht(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),pt(e.options,Rr)),e.getLeafHeaders=ht(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var a,o,s,c,d,p;return[...(a=(o=t[0])==null?void 0:o.headers)!=null?a:[],...(s=(c=n[0])==null?void 0:c.headers)!=null?s:[],...(d=(p=r[0])==null?void 0:p.headers)!=null?d:[]].map(m=>m.getLeafHeaders()).flat()},pt(e.options,Rr))}};function Bg(e,t,n,r){var a,o;let s=0;const c=function(v,D){D===void 0&&(D=1),s=Math.max(s,D),v.filter(S=>S.getIsVisible()).forEach(S=>{var T;(T=S.columns)!=null&&T.length&&c(S.columns,D+1)},0)};c(e);let d=[];const p=(v,D)=>{const S={depth:D,id:[r,`${D}`].filter(Boolean).join("_"),headers:[]},T=[];v.forEach(E=>{const O=[...T].reverse()[0],k=E.column.depth===S.depth;let j,F=!1;if(k&&E.column.parent?j=E.column.parent:(j=E.column,F=!0),O&&(O==null?void 0:O.column)===j)O.subHeaders.push(E);else{const B=S2(n,j,{id:[r,D,j.id,E==null?void 0:E.id].filter(Boolean).join("_"),isPlaceholder:F,placeholderId:F?`${T.filter(R=>R.column===j).length}`:void 0,depth:D,index:T.length});B.subHeaders.push(E),T.push(B)}S.headers.push(E),E.headerGroup=S}),d.push(S),D>0&&p(T,D-1)},m=t.map((v,D)=>S2(n,v,{depth:s,index:D}));p(m,s-1),d.reverse();const g=v=>v.filter(S=>S.column.getIsVisible()).map(S=>{let T=0,E=0,O=[0];S.subHeaders&&S.subHeaders.length?(O=[],g(S.subHeaders).forEach(j=>{let{colSpan:F,rowSpan:B}=j;T+=F,O.push(B)})):T=1;const k=Math.min(...O);return E+=k,S.colSpan=T,S.rowSpan=E,{colSpan:T,rowSpan:E}});return g((a=(o=d[0])==null?void 0:o.headers)!=null?a:[]),d}const _g={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},q0=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),aq={getDefaultColumnDef:()=>_g,getInitialState:e=>({columnSizing:{},columnSizingInfo:q0(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Ua("columnSizing",e),onColumnSizingInfoChange:Ua("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,a;const o=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:_g.minSize,(r=o??e.columnDef.size)!=null?r:_g.size),(a=e.columnDef.maxSize)!=null?a:_g.maxSize)},e.getStart=ht(n=>[n,Qh(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((a,o)=>a+o.getSize(),0),pt(t.options,"debugColumns")),e.getAfter=ht(n=>[n,Qh(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((a,o)=>a+o.getSize(),0),pt(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...a}=n;return a})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=a=>{if(a.subHeaders.length)a.subHeaders.forEach(r);else{var o;n+=(o=a.column.getSize())!=null?o:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),a=r==null?void 0:r.getCanResize();return o=>{if(!r||!a||(o.persist==null||o.persist(),J0(o)&&o.touches&&o.touches.length>1))return;const s=e.getSize(),c=e?e.getLeafHeaders().map(O=>[O.column.id,O.column.getSize()]):[[r.id,r.getSize()]],d=J0(o)?Math.round(o.touches[0].clientX):o.clientX,p={},m=(O,k)=>{typeof k=="number"&&(t.setColumnSizingInfo(j=>{var F,B;const R=t.options.columnResizeDirection==="rtl"?-1:1,z=(k-((F=j==null?void 0:j.startOffset)!=null?F:0))*R,H=Math.max(z/((B=j==null?void 0:j.startSize)!=null?B:0),-.999999);return j.columnSizingStart.forEach(Y=>{let[U,J]=Y;p[U]=Math.round(Math.max(J+J*H,0)*100)/100}),{...j,deltaOffset:z,deltaPercentage:H}}),(t.options.columnResizeMode==="onChange"||O==="end")&&t.setColumnSizing(j=>({...j,...p})))},g=O=>m("move",O),v=O=>{m("end",O),t.setColumnSizingInfo(k=>({...k,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},D=n||typeof document<"u"?document:null,S={moveHandler:O=>g(O.clientX),upHandler:O=>{D==null||D.removeEventListener("mousemove",S.moveHandler),D==null||D.removeEventListener("mouseup",S.upHandler),v(O.clientX)}},T={moveHandler:O=>(O.cancelable&&(O.preventDefault(),O.stopPropagation()),g(O.touches[0].clientX),!1),upHandler:O=>{var k;D==null||D.removeEventListener("touchmove",T.moveHandler),D==null||D.removeEventListener("touchend",T.upHandler),O.cancelable&&(O.preventDefault(),O.stopPropagation()),v((k=O.touches[0])==null?void 0:k.clientX)}},E=oq()?{passive:!1}:!1;J0(o)?(D==null||D.addEventListener("touchmove",T.moveHandler,E),D==null||D.addEventListener("touchend",T.upHandler,E)):(D==null||D.addEventListener("mousemove",S.moveHandler,E),D==null||D.addEventListener("mouseup",S.upHandler,E)),t.setColumnSizingInfo(O=>({...O,startOffset:d,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:c,isResizingColumn:r.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?q0():(n=e.initialState.columnSizingInfo)!=null?n:q0())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,a)=>r+a.getSize(),0))!=null?t:0}}};let Hg=null;function oq(){if(typeof Hg=="boolean")return Hg;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Hg=e,Hg}function J0(e){return e.type==="touchstart"}const iq={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Ua("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var a,o;e.setExpanded(r?{}:(a=(o=e.initialState)==null?void 0:o.expanded)!=null?a:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(a=>!a.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(o=>{const s=o.split(".");r=Math.max(r,s.length)}),r},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(r=>{var a;const o=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(c=>{s[c]=!0}):s=r,n=(a=n)!=null?a:!o,!o&&n)return{...s,[e.id]:!0};if(o&&!n){const{[e.id]:c,...d}=s;return d}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,a;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((a=e.subRows)!=null&&a.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},XC=(e,t,n)=>{var r;const a=n.toLowerCase();return!!(!((r=e.getValue(t))==null||(r=r.toString())==null||(r=r.toLowerCase())==null)&&r.includes(a))};XC.autoRemove=e=>Po(e);const ex=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};ex.autoRemove=e=>Po(e);const tx=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};tx.autoRemove=e=>Po(e);const nx=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};nx.autoRemove=e=>Po(e)||!(e!=null&&e.length);const rx=(e,t,n)=>!n.some(r=>{var a;return!((a=e.getValue(t))!=null&&a.includes(r))});rx.autoRemove=e=>Po(e)||!(e!=null&&e.length);const ax=(e,t,n)=>n.some(r=>{var a;return(a=e.getValue(t))==null?void 0:a.includes(r)});ax.autoRemove=e=>Po(e)||!(e!=null&&e.length);const ox=(e,t,n)=>e.getValue(t)===n;ox.autoRemove=e=>Po(e);const ix=(e,t,n)=>e.getValue(t)==n;ix.autoRemove=e=>Po(e);const cb=(e,t,n)=>{let[r,a]=n;const o=e.getValue(t);return o>=r&&o<=a};cb.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,a=typeof n!="number"?parseFloat(n):n,o=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(a)?1/0:a;if(o>s){const c=o;o=s,s=c}return[o,s]};cb.autoRemove=e=>Po(e)||Po(e[0])&&Po(e[1]);const ls={includesString:XC,includesStringSensitive:ex,equalsString:tx,arrIncludes:nx,arrIncludesAll:rx,arrIncludesSome:ax,equals:ox,weakEquals:ix,inNumberRange:cb};function Po(e){return e==null||e===""}const sq={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],globalFilter:void 0,...e}),getDefaultOptions:e=>({onColumnFiltersChange:Ua("columnFilters",e),onGlobalFilterChange:Ua("globalFilter",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100,globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?ls.includesString:typeof r=="number"?ls.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?ls.equals:Array.isArray(r)?ls.arrIncludes:ls.weakEquals},e.getFilterFn=()=>{var n,r;return My(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:ls[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,a;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&!!e.accessorFn},e.getCanGlobalFilter=()=>{var n,r,a,o;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((a=t.options.enableFilters)!=null?a:!0)&&((o=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const a=e.getFilterFn(),o=r==null?void 0:r.find(m=>m.id===e.id),s=vl(n,o?o.value:void 0);if(I2(a,s,e)){var c;return(c=r==null?void 0:r.filter(m=>m.id!==e.id))!=null?c:[]}const d={id:e.id,value:s};if(o){var p;return(p=r==null?void 0:r.map(m=>m.id===e.id?d:m))!=null?p:[]}return r!=null&&r.length?[...r,d]:[d]})},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()}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.getGlobalAutoFilterFn=()=>ls.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return My(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:ls[r]},e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=a=>{var o;return(o=vl(t,a))==null?void 0:o.filter(s=>{const c=n.find(d=>d.id===s.id);if(c){const d=c.getFilterFn();if(I2(d,s.value,c))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.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()),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()}}};function I2(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const lq=(e,t,n)=>n.reduce((r,a)=>{const o=a.getValue(e);return r+(typeof o=="number"?o:0)},0),uq=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r>o||r===void 0&&o>=o)&&(r=o)}),r},cq=(e,t,n)=>{let r;return n.forEach(a=>{const o=a.getValue(e);o!=null&&(r<o||r===void 0&&o>=o)&&(r=o)}),r},dq=(e,t,n)=>{let r,a;return n.forEach(o=>{const s=o.getValue(e);s!=null&&(r===void 0?s>=s&&(r=a=s):(r>s&&(r=s),a<s&&(a=s)))}),[r,a]},fq=(e,t)=>{let n=0,r=0;if(t.forEach(a=>{let o=a.getValue(e);o!=null&&(o=+o)>=o&&(++n,r+=o)}),n)return r/n},hq=(e,t)=>{if(!t.length)return;const n=t.map(o=>o.getValue(e));if(!eq(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),a=n.sort((o,s)=>o-s);return n.length%2!==0?a[r]:(a[r-1]+a[r])/2},pq=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),mq=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,gq=(e,t)=>t.length,K0={sum:lq,min:uq,max:cq,extent:dq,mean:fq,median:hq,unique:pq,uniqueCount:mq,count:gq},yq={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:Ua("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r,a,o;return(n=(r=(a=(o=e.columnDef.enableGrouping)!=null?o:!0)!=null?a:t.options.enableGrouping)!=null?r:!0)!=null?n:!!e.accessorFn},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=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return K0.sum;if(Object.prototype.toString.call(r)==="[object Date]")return K0.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return My(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:K0[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.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];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var a;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((a=n.subRows)!=null&&a.length)}}};function vq(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(o=>!t.includes(o.id));return n==="remove"?r:[...t.map(o=>e.find(s=>s.id===o)).filter(Boolean),...r]}const wq={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Ua("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=ht(n=>[Qh(t,n)],n=>n.findIndex(r=>r.id===e.id),pt(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=Qh(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const a=Qh(t,n);return((r=a[a.length-1])==null?void 0:r.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=ht(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>a=>{let o=[];if(!(t!=null&&t.length))o=a;else{const s=[...t],c=[...a];for(;c.length&&s.length;){const d=s.shift(),p=c.findIndex(m=>m.id===d);p>-1&&o.push(c.splice(p,1)[0])}o=[...o,...c]}return vq(o,n,r)},pt(e.options,"debugTable"))}},$w=0,Gw=10,Q0=()=>({pageIndex:$w,pageSize:Gw}),bq={getInitialState:e=>({...e,pagination:{...Q0(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Ua("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,a;if(!t){e._queue(()=>{t=!0});return}if((r=(a=e.options.autoResetAll)!=null?a:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const a=o=>vl(r,o);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(a)},e.resetPagination=r=>{var a;e.setPagination(r?Q0():(a=e.initialState.pagination)!=null?a:Q0())},e.setPageIndex=r=>{e.setPagination(a=>{let o=vl(r,a.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return o=Math.max(0,Math.min(o,s)),{...a,pageIndex:o}})},e.resetPageIndex=r=>{var a,o;e.setPageIndex(r?$w:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageIndex)!=null?a:$w)},e.resetPageSize=r=>{var a,o;e.setPageSize(r?Gw:(a=(o=e.initialState)==null||(o=o.pagination)==null?void 0:o.pageSize)!=null?a:Gw)},e.setPageSize=r=>{e.setPagination(a=>{const o=Math.max(1,vl(r,a.pageSize)),s=a.pageSize*a.pageIndex,c=Math.floor(s/o);return{...a,pageIndex:c,pageSize:o}})},e.setPageCount=r=>e.setPagination(a=>{var o;let s=vl(r,(o=e.options.pageCount)!=null?o:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...a,pageCount:s}}),e.getPageOptions=ht(()=>[e.getPageCount()],r=>{let a=[];return r&&r>0&&(a=[...new Array(r)].fill(null).map((o,s)=>s)),a},pt(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,a=e.getPageCount();return a===-1?!0:a===0?!1:r<a-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+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 r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},X0=()=>({left:[],right:[]}),ew=()=>({top:[],bottom:[]}),Dq={getInitialState:e=>({columnPinning:X0(),rowPinning:ew(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Ua("columnPinning",e),onRowPinningChange:Ua("rowPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(a=>a.id).filter(Boolean);t.setColumnPinning(a=>{var o,s;if(n==="right"){var c,d;return{left:((c=a==null?void 0:a.left)!=null?c:[]).filter(g=>!(r!=null&&r.includes(g))),right:[...((d=a==null?void 0:a.right)!=null?d:[]).filter(g=>!(r!=null&&r.includes(g))),...r]}}if(n==="left"){var p,m;return{left:[...((p=a==null?void 0:a.left)!=null?p:[]).filter(g=>!(r!=null&&r.includes(g))),...r],right:((m=a==null?void 0:a.right)!=null?m:[]).filter(g=>!(r!=null&&r.includes(g)))}}return{left:((o=a==null?void 0:a.left)!=null?o:[]).filter(g=>!(r!=null&&r.includes(g))),right:((s=a==null?void 0:a.right)!=null?s:[]).filter(g=>!(r!=null&&r.includes(g)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var a,o,s;return((a=r.columnDef.enablePinning)!=null?a:!0)&&((o=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?o:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(c=>c.id),{left:r,right:a}=t.getState().columnPinning,o=n.some(c=>r==null?void 0:r.includes(c)),s=n.some(c=>a==null?void 0:a.includes(c));return o?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();return a?(n=(r=t.getState().columnPinning)==null||(r=r[a])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.pin=(n,r,a)=>{const o=r?e.getLeafRows().map(d=>{let{id:p}=d;return p}):[],s=a?e.getParentRows().map(d=>{let{id:p}=d;return p}):[],c=new Set([...s,e.id,...o]);t.setRowPinning(d=>{var p,m;if(n==="bottom"){var g,v;return{top:((g=d==null?void 0:d.top)!=null?g:[]).filter(T=>!(c!=null&&c.has(T))),bottom:[...((v=d==null?void 0:d.bottom)!=null?v:[]).filter(T=>!(c!=null&&c.has(T))),...Array.from(c)]}}if(n==="top"){var D,S;return{top:[...((D=d==null?void 0:d.top)!=null?D:[]).filter(T=>!(c!=null&&c.has(T))),...Array.from(c)],bottom:((S=d==null?void 0:d.bottom)!=null?S:[]).filter(T=>!(c!=null&&c.has(T)))}}return{top:((p=d==null?void 0:d.top)!=null?p:[]).filter(T=>!(c!=null&&c.has(T))),bottom:((m=d==null?void 0:d.bottom)!=null?m:[]).filter(T=>!(c!=null&&c.has(T)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:a}=t.options;return typeof r=="function"?r(e):(n=r??a)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:a}=t.getState().rowPinning,o=n.some(c=>r==null?void 0:r.includes(c)),s=n.some(c=>a==null?void 0:a.includes(c));return o?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const a=e.getIsPinned();if(!a)return-1;const o=(n=t._getPinnedRows(a))==null?void 0:n.map(s=>{let{id:c}=s;return c});return(r=o==null?void 0:o.indexOf(e.id))!=null?r:-1},e.getCenterVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,a)=>{const o=[...r??[],...a??[]];return n.filter(s=>!o.includes(s.column.id))},pt(t.options,"debugRows")),e.getLeftVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"left"})),pt(t.options,"debugRows")),e.getRightVisibleCells=ht(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(o=>n.find(s=>s.column.id===o)).filter(Boolean).map(o=>({...o,position:"right"})),pt(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?X0():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:X0())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var a,o;return!!((a=r.left)!=null&&a.length||(o=r.right)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),pt(e.options,"debugColumns")),e.getRightLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(a=>a.id===r)).filter(Boolean),pt(e.options,"debugColumns")),e.getCenterLeafColumns=ht(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const a=[...n??[],...r??[]];return t.filter(o=>!a.includes(o.id))},pt(e.options,"debugColumns")),e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?ew():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:ew())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var a,o;return!!((a=r.top)!=null&&a.length||(o=r.bottom)!=null&&o.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=ht(t=>[e.getRowModel().rows,e.getState().rowPinning[t],t],(t,n,r)=>{var a;return((a=e.options.keepPinnedRows)==null||a?(n??[]).map(s=>{const c=e.getRow(s,!0);return c.getIsAllParentsExpanded()?c:null}):(n??[]).map(s=>t.find(c=>c.id===s))).filter(Boolean).map(s=>({...s,position:r}))},pt(e.options,"debugRows")),e.getTopRows=()=>e._getPinnedRows("top"),e.getBottomRows=()=>e._getPinnedRows("bottom"),e.getCenterRows=ht(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const a=new Set([...n??[],...r??[]]);return t.filter(o=>!a.has(o.id))},pt(e.options,"debugRows"))}},Sq={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Ua("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();const r={...n},a=e.getPreGroupedRowModel().flatRows;return t?a.forEach(o=>{o.getCanSelect()&&(r[o.id]=!0)}):a.forEach(o=>{delete r[o.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),a={...n};return e.getRowModel().rows.forEach(o=>{qw(a,o.id,r,!0,e)}),a}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?tw(e,n):{rows:[],flatRows:[],rowsById:{}},pt(e.options,"debugTable")),e.getFilteredSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?tw(e,n):{rows:[],flatRows:[],rowsById:{}},pt(e.options,"debugTable")),e.getGroupedSelectedRowModel=ht(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?tw(e,n):{rows:[],flatRows:[],rowsById:{}},pt(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(a=>a.getCanSelect()&&!n[a.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(a=>a.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(a=>!n[a.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const 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,r)=>{const a=e.getIsSelected();t.setRowSelection(o=>{var s;if(n=typeof n<"u"?n:!a,e.getCanSelect()&&a===n)return o;const c={...o};return qw(c,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),c})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return db(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Jw(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Jw(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=()=>{const n=e.getCanSelect();return r=>{var a;n&&e.toggleSelected((a=r.target)==null?void 0:a.checked)}}}},qw=(e,t,n,r,a)=>{var o;const s=a.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(c=>delete e[c]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(o=s.subRows)!=null&&o.length&&s.getCanSelectSubRows()&&s.subRows.forEach(c=>qw(e,c.id,n,r,a))};function tw(e,t){const n=e.getState().rowSelection,r=[],a={},o=function(s,c){return s.map(d=>{var p;const m=db(d,n);if(m&&(r.push(d),a[d.id]=d),(p=d.subRows)!=null&&p.length&&(d={...d,subRows:o(d.subRows)}),m)return d}).filter(Boolean)};return{rows:o(t.rows),flatRows:r,rowsById:a}}function db(e,t){var n;return(n=t[e.id])!=null?n:!1}function Jw(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let a=!0,o=!1;return e.subRows.forEach(s=>{if(!(o&&!a)&&(s.getCanSelect()&&(db(s,t)?o=!0:a=!1),s.subRows&&s.subRows.length)){const c=Jw(s,t);c==="all"?o=!0:(c==="some"&&(o=!0),a=!1)}}),a?"all":o?"some":!1}const Kw=/([0-9]+)/gm,Iq=(e,t,n)=>sx(Sl(e.getValue(n)).toLowerCase(),Sl(t.getValue(n)).toLowerCase()),Tq=(e,t,n)=>sx(Sl(e.getValue(n)),Sl(t.getValue(n))),Eq=(e,t,n)=>fb(Sl(e.getValue(n)).toLowerCase(),Sl(t.getValue(n)).toLowerCase()),Cq=(e,t,n)=>fb(Sl(e.getValue(n)),Sl(t.getValue(n))),xq=(e,t,n)=>{const r=e.getValue(n),a=t.getValue(n);return r>a?1:r<a?-1:0},Mq=(e,t,n)=>fb(e.getValue(n),t.getValue(n));function fb(e,t){return e===t?0:e>t?1:-1}function Sl(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function sx(e,t){const n=e.split(Kw).filter(Boolean),r=t.split(Kw).filter(Boolean);for(;n.length&&r.length;){const a=n.shift(),o=r.shift(),s=parseInt(a,10),c=parseInt(o,10),d=[s,c].sort();if(isNaN(d[0])){if(a>o)return 1;if(o>a)return-1;continue}if(isNaN(d[1]))return isNaN(s)?-1:1;if(s>c)return 1;if(c>s)return-1}return n.length-r.length}const Id={alphanumeric:Iq,alphanumericCaseSensitive:Tq,text:Eq,textCaseSensitive:Cq,datetime:xq,basic:Mq},Nq={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Ua("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const a of n){const o=a==null?void 0:a.getValue(e.id);if(Object.prototype.toString.call(o)==="[object Date]")return Id.datetime;if(typeof o=="string"&&(r=!0,o.split(Kw).length>1))return Id.alphanumeric}return r?Id.text:Id.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return My(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Id[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const a=e.getNextSortingOrder(),o=typeof n<"u"&&n!==null;t.setSorting(s=>{const c=s==null?void 0:s.find(D=>D.id===e.id),d=s==null?void 0:s.findIndex(D=>D.id===e.id);let p=[],m,g=o?n:a==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?c?m="toggle":m="add":s!=null&&s.length&&d!==s.length-1?m="replace":c?m="toggle":m="replace",m==="toggle"&&(o||a||(m="remove")),m==="add"){var v;p=[...s,{id:e.id,desc:g}],p.splice(0,p.length-((v=t.options.maxMultiSortColCount)!=null?v:Number.MAX_SAFE_INTEGER))}else m==="toggle"?p=s.map(D=>D.id===e.id?{...D,desc:g}:D):m==="remove"?p=s.filter(D=>D.id!==e.id):p=[{id:e.id,desc:g}];return p})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,a;const o=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==o&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(a=t.options.enableMultiRemove)!=null)||a)?!1:s==="desc"?"asc":"desc":o},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(a=>a.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(a=>a.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.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())}},kq={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Ua("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const a=e.columns;return(n=a.length?a.some(o=>o.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=ht(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),pt(t.options,"debugRows")),e.getVisibleCells=ht(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,a)=>[...n,...r,...a],pt(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>ht(()=>[r(),r().filter(a=>a.getIsVisible()).map(a=>a.id).join("_")],a=>a.filter(o=>o.getIsVisible==null?void 0:o.getIsVisible()),pt(e.options,"debugColumns"));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 r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((a,o)=>({...a,[o.id]:n||!(o.getCanHide!=null&&o.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 r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function Qh(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const T2=[rq,kq,wq,Dq,sq,Nq,yq,iq,bq,Sq,aq];function Aq(e){var t;e.debugAll||e.debugTable;let n={_features:T2};const r=n._features.reduce((m,g)=>Object.assign(m,g.getDefaultOptions==null?void 0:g.getDefaultOptions(n)),{}),a=m=>n.options.mergeOptions?n.options.mergeOptions(r,m):{...r,...m};let s={...{},...(t=e.initialState)!=null?t:{}};n._features.forEach(m=>{var g;s=(g=m.getInitialState==null?void 0:m.getInitialState(s))!=null?g:s});const c=[];let d=!1;const p={_features:T2,options:{...r,...e},initialState:s,_queue:m=>{c.push(m),d||(d=!0,Promise.resolve().then(()=>{for(;c.length;)c.shift()();d=!1}).catch(g=>setTimeout(()=>{throw g})))},reset:()=>{n.setState(n.initialState)},setOptions:m=>{const g=vl(m,n.options);n.options=a(g)},getState:()=>n.options.state,setState:m=>{n.options.onStateChange==null||n.options.onStateChange(m)},_getRowId:(m,g,v)=>{var D;return(D=n.options.getRowId==null?void 0:n.options.getRowId(m,g,v))!=null?D:`${v?[v.id,g].join("."):g}`},getCoreRowModel:()=>(n._getCoreRowModel||(n._getCoreRowModel=n.options.getCoreRowModel(n)),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(m,g)=>{let v=(g?n.getPrePaginationRowModel():n.getRowModel()).rowsById[m];if(!v&&(v=n.getCoreRowModel().rowsById[m],!v))throw new Error;return v},_getDefaultColumnDef:ht(()=>[n.options.defaultColumn],m=>{var g;return m=(g=m)!=null?g:{},{header:v=>{const D=v.header.column.columnDef;return D.accessorKey?D.accessorKey:D.accessorFn?D.id:null},cell:v=>{var D,S;return(D=(S=v.renderValue())==null||S.toString==null?void 0:S.toString())!=null?D:null},...n._features.reduce((v,D)=>Object.assign(v,D.getDefaultColumnDef==null?void 0:D.getDefaultColumnDef()),{}),...m}},pt(e,"debugColumns")),_getColumnDefs:()=>n.options.columns,getAllColumns:ht(()=>[n._getColumnDefs()],m=>{const g=function(v,D,S){return S===void 0&&(S=0),v.map(T=>{const E=nq(n,T,S,D),O=T;return E.columns=O.columns?g(O.columns,E,S+1):[],E})};return g(m)},pt(e,"debugColumns")),getAllFlatColumns:ht(()=>[n.getAllColumns()],m=>m.flatMap(g=>g.getFlatColumns()),pt(e,"debugColumns")),_getAllFlatColumnsById:ht(()=>[n.getAllFlatColumns()],m=>m.reduce((g,v)=>(g[v.id]=v,g),{}),pt(e,"debugColumns")),getAllLeafColumns:ht(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(m,g)=>{let v=m.flatMap(D=>D.getLeafColumns());return g(v)},pt(e,"debugColumns")),getColumn:m=>n._getAllFlatColumnsById()[m]};Object.assign(n,p);for(let m=0;m<n._features.length;m++){const g=n._features[m];g==null||g.createTable==null||g.createTable(n)}return n}function Fq(e,t,n,r){const a=()=>{var s;return(s=o.getValue())!=null?s:e.options.renderFallbackValue},o={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:a,getContext:ht(()=>[e,n,t,o],(s,c,d,p)=>({table:s,column:c,row:d,cell:p,getValue:p.getValue,renderValue:p.renderValue}),pt(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(o,n,t,e)},{}),o}const hb=(e,t,n,r,a,o,s)=>{let c={id:t,index:r,original:n,depth:a,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:d=>{if(c._valuesCache.hasOwnProperty(d))return c._valuesCache[d];const p=e.getColumn(d);if(p!=null&&p.accessorFn)return c._valuesCache[d]=p.accessorFn(c.original,r),c._valuesCache[d]},getUniqueValues:d=>{if(c._uniqueValuesCache.hasOwnProperty(d))return c._uniqueValuesCache[d];const p=e.getColumn(d);if(p!=null&&p.accessorFn)return p.columnDef.getUniqueValues?(c._uniqueValuesCache[d]=p.columnDef.getUniqueValues(c.original,r),c._uniqueValuesCache[d]):(c._uniqueValuesCache[d]=[c.getValue(d)],c._uniqueValuesCache[d])},renderValue:d=>{var p;return(p=c.getValue(d))!=null?p:e.options.renderFallbackValue},subRows:o??[],getLeafRows:()=>tq(c.subRows,d=>d.subRows),getParentRow:()=>c.parentId?e.getRow(c.parentId,!0):void 0,getParentRows:()=>{let d=[],p=c;for(;;){const m=p.getParentRow();if(!m)break;d.push(m),p=m}return d.reverse()},getAllCells:ht(()=>[e.getAllLeafColumns()],d=>d.map(p=>Fq(e,c,p,p.id)),pt(e.options,"debugRows")),_getAllCellsByColumnId:ht(()=>[c.getAllCells()],d=>d.reduce((p,m)=>(p[m.column.id]=m,p),{}),pt(e.options,"debugRows"))};for(let d=0;d<e._features.length;d++){const p=e._features[d];p==null||p.createRow==null||p.createRow(c,e)}return c};function Oq(){return e=>ht(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(a,o,s){o===void 0&&(o=0);const c=[];for(let p=0;p<a.length;p++){const m=hb(e,e._getRowId(a[p],p,s),a[p],p,o,void 0,s==null?void 0:s.id);if(n.flatRows.push(m),n.rowsById[m.id]=m,c.push(m),e.options.getSubRows){var d;m.originalSubRows=e.options.getSubRows(a[p],p),(d=m.originalSubRows)!=null&&d.length&&(m.subRows=r(m.originalSubRows,o+1,m))}}return c};return n.rows=r(t),n},pt(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function lx(e,t,n){return n.options.filterFromLeafRows?Pq(e,t,n):jq(e,t,n)}function Pq(e,t,n){var r;const a=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,p){p===void 0&&(p=0);const m=[];for(let v=0;v<d.length;v++){var g;let D=d[v];const S=hb(n,D.id,D.original,D.index,D.depth,void 0,D.parentId);if(S.columnFilters=D.columnFilters,(g=D.subRows)!=null&&g.length&&p<s){if(S.subRows=c(D.subRows,p+1),D=S,t(D)&&!S.subRows.length){m.push(D),o[D.id]=D,a.push(D);continue}if(t(D)||S.subRows.length){m.push(D),o[D.id]=D,a.push(D);continue}}else D=S,t(D)&&(m.push(D),o[D.id]=D,a.push(D))}return m};return{rows:c(e),flatRows:a,rowsById:o}}function jq(e,t,n){var r;const a=[],o={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,c=function(d,p){p===void 0&&(p=0);const m=[];for(let v=0;v<d.length;v++){let D=d[v];if(t(D)){var g;if((g=D.subRows)!=null&&g.length&&p<s){const T=hb(n,D.id,D.original,D.index,D.depth,void 0,D.parentId);T.subRows=c(D.subRows,p+1),D=T}m.push(D),a.push(D),o[D.id]=D}}return m};return{rows:c(e),flatRows:a,rowsById:o}}function Lq(){return e=>ht(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let v=0;v<t.flatRows.length;v++)t.flatRows[v].columnFilters={},t.flatRows[v].columnFiltersMeta={};return t}const a=[],o=[];(n??[]).forEach(v=>{var D;const S=e.getColumn(v.id);if(!S)return;const T=S.getFilterFn();T&&a.push({id:v.id,filterFn:T,resolvedValue:(D=T.resolveFilterValue==null?void 0:T.resolveFilterValue(v.value))!=null?D:v.value})});const s=n.map(v=>v.id),c=e.getGlobalFilterFn(),d=e.getAllLeafColumns().filter(v=>v.getCanGlobalFilter());r&&c&&d.length&&(s.push("__global__"),d.forEach(v=>{var D;o.push({id:v.id,filterFn:c,resolvedValue:(D=c.resolveFilterValue==null?void 0:c.resolveFilterValue(r))!=null?D:r})}));let p,m;for(let v=0;v<t.flatRows.length;v++){const D=t.flatRows[v];if(D.columnFilters={},a.length)for(let S=0;S<a.length;S++){p=a[S];const T=p.id;D.columnFilters[T]=p.filterFn(D,T,p.resolvedValue,E=>{D.columnFiltersMeta[T]=E})}if(o.length){for(let S=0;S<o.length;S++){m=o[S];const T=m.id;if(m.filterFn(D,T,m.resolvedValue,E=>{D.columnFiltersMeta[T]=E})){D.columnFilters.__global__=!0;break}}D.columnFilters.__global__!==!0&&(D.columnFilters.__global__=!1)}}const g=v=>{for(let D=0;D<s.length;D++)if(v.columnFilters[s[D]]===!1)return!1;return!0};return lx(t.rows,g,e)},pt(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Rq(){return(e,t)=>ht(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter,e.getFilteredRowModel()],(n,r,a)=>{if(!n.rows.length||!(r!=null&&r.length)&&!a)return n;const o=[...r.map(c=>c.id).filter(c=>c!==t),a?"__global__":void 0].filter(Boolean),s=c=>{for(let d=0;d<o.length;d++)if(c.columnFilters[o[d]]===!1)return!1;return!0};return lx(n.rows,s,e)},pt(e.options,"debugTable"))}function Bq(){return(e,t)=>ht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{if(!n)return new Map;let r=new Map;for(let o=0;o<n.flatRows.length;o++){const s=n.flatRows[o].getUniqueValues(t);for(let c=0;c<s.length;c++){const d=s[c];if(r.has(d)){var a;r.set(d,((a=r.get(d))!=null?a:0)+1)}else r.set(d,1)}}return r},pt(e.options,"debugTable"))}function _q(){return(e,t)=>ht(()=>{var n;return[(n=e.getColumn(t))==null?void 0:n.getFacetedRowModel()]},n=>{var r;if(!n)return;const a=(r=n.flatRows[0])==null?void 0:r.getUniqueValues(t);if(typeof a>"u")return;let o=[a,a];for(let s=0;s<n.flatRows.length;s++){const c=n.flatRows[s].getUniqueValues(t);for(let d=0;d<c.length;d++){const p=c[d];p<o[0]?o[0]=p:p>o[1]&&(o[1]=p)}}return o},pt(e.options,"debugTable"))}function Hq(){return e=>ht(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,a=[],o=r.filter(d=>{var p;return(p=e.getColumn(d.id))==null?void 0:p.getCanSort()}),s={};o.forEach(d=>{const p=e.getColumn(d.id);p&&(s[d.id]={sortUndefined:p.columnDef.sortUndefined,invertSorting:p.columnDef.invertSorting,sortingFn:p.getSortingFn()})});const c=d=>{const p=d.map(m=>({...m}));return p.sort((m,g)=>{for(let D=0;D<o.length;D+=1){var v;const S=o[D],T=s[S.id],E=(v=S==null?void 0:S.desc)!=null?v:!1;let O=0;if(T.sortUndefined){const k=m.getValue(S.id),j=g.getValue(S.id),F=k===void 0,B=j===void 0;(F||B)&&(O=F&&B?0:F?T.sortUndefined:-T.sortUndefined)}if(O===0&&(O=T.sortingFn(m,g,S.id)),O!==0)return E&&(O*=-1),T.invertSorting&&(O*=-1),O}return m.index-g.index}),p.forEach(m=>{var g;a.push(m),(g=m.subRows)!=null&&g.length&&(m.subRows=c(m.subRows))}),p};return{rows:c(n.rows),flatRows:a,rowsById:n.rowsById}},pt(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function Yq(e){const t=[],n=r=>{var a;t.push(r),(a=r.subRows)!=null&&a.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function zq(e){return t=>ht(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:a,pageIndex:o}=n;let{rows:s,flatRows:c,rowsById:d}=r;const p=a*o,m=p+a;s=s.slice(p,m);let g;t.options.paginateExpandedRows?g={rows:s,flatRows:c,rowsById:d}:g=Yq({rows:s,flatRows:c,rowsById:d}),g.flatRows=[];const v=D=>{g.flatRows.push(D),D.subRows.length&&D.subRows.forEach(v)};return g.rows.forEach(v),g},pt(t.options,"debugTable"))}function E2(e,t){return e?Uq(e)?A.createElement(e,t):e:null}function Uq(e){return Vq(e)||typeof e=="function"||Zq(e)}function Vq(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Zq(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function Wq(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=A.useState(()=>({current:Aq(t)})),[r,a]=A.useState(()=>n.current.initialState);return n.current.setOptions(o=>({...o,...e,state:{...r,...e.state},onStateChange:s=>{a(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const ux={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},$q=Object.keys(ux).join("|"),Gq=new RegExp($q,"g");function qq(e){return e.replace(Gq,t=>ux[t])}const va={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0};function Jq(e,t,n){var r;if(n=n||{},n.threshold=(r=n.threshold)!=null?r:va.MATCHES,!n.accessors){const s=C2(e,t,n);return{rankedValue:e,rank:s,accessorIndex:-1,accessorThreshold:n.threshold,passed:s>=n.threshold}}const a=tJ(e,n.accessors),o={rankedValue:e,rank:va.NO_MATCH,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<a.length;s++){const c=a[s];let d=C2(c.itemValue,t,n);const{minRanking:p,maxRanking:m,threshold:g=n.threshold}=c.attributes;d<p&&d>=va.MATCHES?d=p:d>m&&(d=m),d=Math.min(d,m),d>=g&&d>o.rank&&(o.rank=d,o.passed=!0,o.accessorIndex=s,o.accessorThreshold=g,o.rankedValue=c.itemValue)}return o}function C2(e,t,n){return e=x2(e,n),t=x2(t,n),t.length>e.length?va.NO_MATCH:e===t?va.CASE_SENSITIVE_EQUAL:(e=e.toLowerCase(),t=t.toLowerCase(),e===t?va.EQUAL:e.startsWith(t)?va.STARTS_WITH:e.includes(` ${t}`)?va.WORD_STARTS_WITH:e.includes(t)?va.CONTAINS:t.length===1?va.NO_MATCH:Kq(e).includes(t)?va.ACRONYM:Qq(e,t))}function Kq(e){let t="";return e.split(" ").forEach(r=>{r.split("-").forEach(o=>{t+=o.substr(0,1)})}),t}function Qq(e,t){let n=0,r=0;function a(d,p,m){for(let g=m,v=p.length;g<v;g++)if(p[g]===d)return n+=1,g+1;return-1}function o(d){const p=1/d,m=n/t.length;return va.MATCHES+m*p}const s=a(t[0],e,0);if(s<0)return va.NO_MATCH;r=s;for(let d=1,p=t.length;d<p;d++){const m=t[d];if(r=a(m,e,r),!(r>-1))return va.NO_MATCH}const c=r-s;return o(c)}function Xq(e,t){return e.rank===t.rank?0:e.rank>t.rank?-1:1}function x2(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=qq(e)),e}function eJ(e,t){let n=t;typeof t=="object"&&(n=t.accessor);const r=n(e);return r==null?[]:Array.isArray(r)?r:[String(r)]}function tJ(e,t){const n=[];for(let r=0,a=t.length;r<a;r++){const o=t[r],s=nJ(o),c=eJ(e,o);for(let d=0,p=c.length;d<p;d++)n.push({itemValue:c[d],attributes:s})}return n}const M2={maxRanking:1/0,minRanking:-1/0};function nJ(e){return typeof e=="function"?M2:{...M2,...e}}const rJ=({thino:e})=>{const t=A.useRef(null);A.useEffect(()=>(t.current&&C.setIcon(t.current,"pin"),()=>{t.current&&(t.current=null)}),[t]);const n=A.useCallback(async()=>{e.pinned?await Te.unpinMemoById(e.id):await Te.pinMemoById(e.id)},[e]);return w.jsx("span",{ref:t,className:Xn("pinned-status",e.pinned?"pinned":"not-pinned"),onClick:n})},aJ=({thino:e})=>{const t=A.useRef(null);A.useEffect(()=>(t.current&&C.setIcon(t.current,e.thinoType==="JOURNAL"?"calendar":"check-square"),()=>{t.current&&(t.current=null)}),[t,e==null?void 0:e.thinoType]);const n=A.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const r=await Te.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");r&&Te.editMemo(r)},[e]);return w.jsx(w.Fragment,{children:e.thinoType!=="JOURNAL"?w.jsx("input",{className:Xn("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n}):w.jsx("span",{ref:t,className:"thino-type-status"})})},oJ=({id:e,path:t})=>{const n=A.useRef(null);A.useEffect(()=>(n.current&&C.setIcon(n.current,"link"),()=>{n.current&&(n.current=null)}),[]);const r=A.useCallback(()=>{!e||!t||Te.openThinoByID(e)},[e,t]);return w.jsxs("span",{className:"source-thino",onClick:r,children:[w.jsx("span",{children:t}),w.jsx("span",{ref:n,className:"source-thino-icon"})]})},iJ=({id:e,sourceType:t})=>{const n=A.useRef(null);A.useEffect(()=>{var a;return n.current&&C.setIcon(n.current,((a=tp.find(o=>o.title===t))==null?void 0:a.icon)||"list"),()=>{n.current&&(n.current=null)}},[]);const r=A.useCallback(async()=>{e&&await Te.openThinoByID(e)},[e]);return w.jsx("span",{ref:n,className:"source-type-icon",onClick:r})},N2=(e,t,n,r)=>{const a=Jq(e.getValue(t),n);return r({itemRank:a}),a.passed},k2=(e,t,n)=>{var a,o;let r=0;return e.columnFiltersMeta[n]&&(r=Xq((a=e.columnFiltersMeta[n])==null?void 0:a.itemRank,(o=t.columnFiltersMeta[n])==null?void 0:o.itemRank)),r===0?Id.alphanumeric(e,t,n):r};function sJ({thinos:e}){var m;$.useReducer(()=>({}),{})[1];const[t,n]=$.useState([]),[r,a]=$.useState(""),o=$.useMemo(()=>[{header:N("Basic Info"),footer:g=>g.column.id,columns:[{accessorKey:"createdAt",header:()=>w.jsx("span",{className:"create-at-header-cell",children:N("Created At")}),cell:g=>g.getValue(),footer:g=>g.column.id,enableColumnFilter:!1},{accessorFn:g=>g.content,id:"content",header:()=>w.jsx("span",{className:"thino-header-cell",children:N("Thino")}),cell:g=>w.jsx(Sa,{memo:g.row.original,type:"table"}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:k2},{accessorFn:g=>g.thinoType,id:"thinoType",cell:g=>w.jsx(aJ,{thino:g.row.original}),header:()=>w.jsx("span",{children:N("Thino Type")}),footer:g=>g.column.id},{accessorFn:g=>g.sourceType,id:"sourceType",cell:g=>w.jsx(iJ,{id:g.row.original.id,sourceType:g.getValue()}),header:()=>w.jsx("span",{children:N("Source Type")}),footer:g=>g.column.id}]},{header:N("Additional Info"),footer:g=>g.column.id,columns:[{accessorKey:"pinned",header:()=>w.jsx("span",{children:N("Pinned Status")}),cell:g=>w.jsx(rJ,{thino:g.row.original}),footer:g=>g.column.id,filterFn:"fuzzy",sortingFn:k2},{accessorKey:"rowStatus",header:()=>w.jsx("span",{children:N("Row status")}),cell:g=>w.jsx("span",{children:g.getValue()==="NORMAL"?"":g.getValue()}),footer:g=>g.column.id},{accessorKey:"path",header:()=>N("Path"),cell:g=>w.jsx(oJ,{id:g.row.original.id,path:g.getValue()}),footer:g=>g.column.id}]}],[]),[s,c]=$.useState(()=>e),d=()=>c(g=>e);A.useEffect(()=>{d()},[e]);const p=Wq({data:s,columns:o,filterFns:{fuzzy:N2},initialState:{pagination:{pageSize:20}},state:{columnFilters:t,globalFilter:r},onColumnFiltersChange:n,onGlobalFilterChange:a,globalFilterFn:N2,getCoreRowModel:Oq(),getFilteredRowModel:Lq(),getSortedRowModel:Hq(),getPaginationRowModel:zq(),getFacetedRowModel:Rq(),getFacetedUniqueValues:Bq(),getFacetedMinMaxValues:_q(),debugTable:!1,debugHeaders:!1,debugColumns:!1});return $.useEffect(()=>{var g,v;((g=p.getState().columnFilters[0])==null?void 0:g.id)==="createdAt"&&((v=p.getState().sorting[0])==null?void 0:v.id)!=="createdAt"&&p.setSorting([{id:"createdAt",desc:!1}])},[(m=p.getState().columnFilters[0])==null?void 0:m.id]),w.jsxs("div",{className:"table-view",children:[w.jsx("div",{children:w.jsx(ry,{value:r||"",onChange:g=>a(String(g)),className:"table-search-bar",placeholder:N("Search all columns...")})}),w.jsxs("table",{className:"thino-table",children:[w.jsx("thead",{children:p.getHeaderGroups().map(g=>w.jsx("tr",{children:g.headers.map(v=>w.jsx("th",{colSpan:v.colSpan,children:v.isPlaceholder?null:w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:Xn(v.column.getCanSort()?"filter-header":"","table-header",v.column.id==="content"?"content-header":""),onClick:v.column.getToggleSortingHandler(),children:[E2(v.column.columnDef.header,v.getContext()),{asc:" 🔼",desc:" 🔽"}[v.column.getIsSorted()]??null]}),v.column.getCanFilter()?w.jsx(uJ,{column:v.column,table:p}):null]})},v.id))},g.id))}),w.jsx("tbody",{children:p.getRowModel().rows.map(g=>w.jsx("tr",{className:Xn(g.getValue("pinned")?"pinned":""),children:g.getVisibleCells().map(v=>w.jsx("td",{children:E2(v.column.columnDef.cell,v.getContext())},v.id))},g.id))})]}),w.jsxs("div",{className:"table-nav-bar",children:[w.jsx("button",{className:"prev-start-btn",onClick:()=>p.setPageIndex(0),disabled:!p.getCanPreviousPage(),children:"<<"}),w.jsx("button",{className:"prev-btn",onClick:()=>p.previousPage(),disabled:!p.getCanPreviousPage(),children:"<"}),w.jsx("button",{className:"next-btn",onClick:()=>p.nextPage(),disabled:!p.getCanNextPage(),children:">"}),w.jsx("button",{className:"next-end-btn",onClick:()=>p.setPageIndex(p.getPageCount()-1),disabled:!p.getCanNextPage(),children:">>"}),w.jsxs("span",{className:"table-page-info",children:[w.jsx("div",{children:N("Page")}),w.jsxs("strong",{children:[p.getState().pagination.pageIndex+1," of ",p.getPageCount()]})]}),w.jsxs("span",{className:"table-page-jump",children:["| ",N("Go to page"),":",w.jsx("input",{type:"number",defaultValue:p.getState().pagination.pageIndex+1,onChange:g=>{const v=g.target.value?Number(g.target.value)-1:0;p.setPageIndex(v)},className:"jump-inputer"})]}),w.jsx("select",{value:p.getState().pagination.pageSize,onChange:g=>{p.setPageSize(Number(g.target.value))},children:[10,20,30,40,50].map(g=>w.jsxs("option",{value:g,children:[N("Show")," ",g," ",N("rows")]},g))})]})]})}const lJ=e=>e==="sourceType"?["ALL"]:["ALL","ALL-TASK"];function uJ({column:e,table:t}){var o,s,c,d,p,m,g,v,D;const n=(o=t.getPreFilteredRowModel().flatRows[0])==null?void 0:o.getValue(e.id),r=e.getFilterValue(),a=$.useMemo(()=>typeof n=="number"?[]:Array.from(e.getFacetedUniqueValues().keys()).sort(),[e.getFacetedUniqueValues()]);return typeof n=="number"?w.jsx("div",{children:w.jsxs("div",{className:"filter-input-group",children:[w.jsx(ry,{type:"number",min:Number(((s=e.getFacetedMinMaxValues())==null?void 0:s[0])??""),max:Number(((c=e.getFacetedMinMaxValues())==null?void 0:c[1])??""),value:(r==null?void 0:r[0])??"",onChange:S=>e.setFilterValue(T=>[S,T==null?void 0:T[1]]),placeholder:`Min ${(d=e.getFacetedMinMaxValues())!=null&&d[0]?`(${(p=e.getFacetedMinMaxValues())==null?void 0:p[0]})`:""}`,className:"filter-input-short"}),w.jsx(ry,{type:"number",min:Number(((m=e.getFacetedMinMaxValues())==null?void 0:m[0])??""),max:Number(((g=e.getFacetedMinMaxValues())==null?void 0:g[1])??""),value:(r==null?void 0:r[1])??"",onChange:S=>e.setFilterValue(T=>[T==null?void 0:T[0],S]),placeholder:`Max ${(v=e.getFacetedMinMaxValues())!=null&&v[1]?`(${(D=e.getFacetedMinMaxValues())==null?void 0:D[1]})`:""}`,className:"filter-input-short"})]})}):w.jsx(w.Fragment,{children:a.length>1?w.jsxs(w.Fragment,{children:[e.id!=="path"&&e.id!=="content"&&e.id!=="thinoType"&&e.id!=="sourceType"&&w.jsx("datalist",{id:e.id+"list",children:a.slice(0,5e3).map(S=>w.jsx("option",{value:S},S))}),e.id==="thinoType"||e.id==="sourceType"?w.jsx("select",{id:e.id,onChange:S=>e.setFilterValue(S.target.value==="ALL"?"":S.target.value==="ALL-TASK"?"TASK":S.target.value),children:[...lJ(e.id),...a].map(S=>w.jsx("option",{value:S,children:N(S)||S},S))}):"",e.id!=="thinoType"&&e.id!=="sourceType"?w.jsx(ry,{type:"text",value:r??"",onChange:S=>e.setFilterValue(S),placeholder:`Search... (${e.getFacetedUniqueValues().size})`,className:"filter-input-long",list:e.id+"list"}):""]}):""})}function ry({value:e,onChange:t,debounce:n=500,...r}){const[a,o]=$.useState(e);return $.useEffect(()=>{o(e)},[e]),$.useEffect(()=>{const s=setTimeout(()=>{t(a)},n);return()=>clearTimeout(s)},[a]),w.jsx("input",{...r,value:a,onChange:s=>o(s.target.value)})}const cJ=e=>{const{locationState:{query:t},globalState:{memoListView:n,manifest:r},dailyNotesState:{app:a,settings:o}}=A.useContext(mt),{thinos:s}=e,[c,d]=$.useState(yp(s,"day")),p=$.useRef(null),m=A.useRef([]),g=A.useRef(0);A.useEffect(()=>{d(yp(s,"day"))},[s]),A.useEffect(()=>{var k,j;const S=s.filter(F=>F.pinned),T=s.filter(F=>!F.pinned),E=m.current.filter(F=>F.pinned)[0],O=m.current.filter(F=>!F.pinned)[0];if(E&&E.id!==((k=S[0])==null?void 0:k.id)||O&&O.id!==((j=T[0])==null?void 0:j.id)){const F=p.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight}else{const F=p.current.closest(".memolist-wrapper");F.scrollTop=F.scrollHeight-g.current,m.current=s}},[s]),A.useEffect(()=>{if(!p.current)return;const S=p.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight},[t]),A.useEffect(()=>{if(n==="chat"&&p.current){const S=p.current.closest(".memolist-wrapper");S.scrollTop=S.scrollHeight,g.current=S.scrollHeight-S.scrollTop,m.current=s,S.onscrollend=()=>{g.current=S.scrollHeight-S.scrollTop}}},[p.current]);const v=A.useCallback(()=>{a.setting.open(),a.setting.openTabById(r.id||"obsidian-memos")},[a]),D=A.useMemo(()=>w.jsx(w.Fragment,{children:Object.keys(c).map((S,T)=>w.jsx(w.Fragment,{children:w.jsx(dJ,{thinos:c[S],dayMark:S,handleOpenSettings:v},S+T)}))}),[c]);return w.jsx("div",{ref:p,className:Xn("chat-view",`${o==null?void 0:o.chatViewStyle}-style`),children:D})},dJ=({thinos:e,dayMark:t,handleOpenSettings:n})=>{const{dailyNotesState:{settings:r}}=A.useContext(mt),[a,o]=$.useState(!0),s=$.useRef(null),c=m=>{if(C.Keymap.isModifier(m.nativeEvent,"Mod")){const g=C.moment(t,"YYYY-MM-DD");He.setFromAndToQuery(g.startOf("day").valueOf(),g.endOf("day").valueOf());return}o(!a),s.current.scrollIntoView(!0)},d=m=>{$d(m)},p=A.useMemo(()=>e.map((m,g)=>w.jsxs("div",{className:"thino-bubble right",children:[w.jsx(fJ,{icon:r==null?void 0:r.MomentsIcon,handleOpenSettings:n}),w.jsx("div",{className:"wrap",children:w.jsx(hJ,{thino:m,handleClickTimeStamp:d},`${m.id}-${C.moment(m.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${g}`)})]},m.id+g)),[e,r==null?void 0:r.MomentsIcon]);return w.jsxs(w.Fragment,{children:[a&&p,w.jsx("div",{className:`thino-chat-day-mark day-mark ${a?"":"folded"}`,onClick:c,children:w.jsx("div",{className:"day-mark-bubble",children:(t==="PINNED"?t+" 📌":t)+(a?"":"...")})})]})},fJ=({icon:e,handleOpenSettings:t})=>w.jsx("div",{ref:n=>{if(e){n==null||n.empty();return}e||n&&C.setIcon(n,"Memos")},className:"icon-img",style:{backgroundImage:`url(${e})`}}),hJ=({thino:e,handleClickTimeStamp:t})=>{const n=A.useCallback(async()=>{if(e.thinoType==="JOURNAL")return;const o=await Te.updateMemo(e.id,e.content,e.thinoType==="TASK-TODO"?"TASK-DONE":"TASK-TODO");o&&Te.editMemo(o)},[e]),r=A.useMemo(()=>w.jsxs("div",{className:"content",children:[w.jsx("div",{className:"time-stamp","data-date":C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),w.jsx(Sa,{memo:e})]}),[e.content]),a=A.useMemo(()=>w.jsxs("div",{className:"content task",children:[w.jsx("div",{className:"task-inputer",children:w.jsx("input",{className:Xn("thino-type-status","task-list-item-checkbox"),type:"checkbox",checked:e.thinoType!=="TASK-TODO","data-task":e.thinoType==="TASK-TODO"?"":e.thinoType==="TASK-DONE"?"x":e.thinoType.slice(5),onClick:n})}),w.jsx("div",{className:"time-stamp","data-date":C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("YYYY-MM-DD"),"data-time":C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss"),onClick:()=>{t(e)},children:C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm:ss")}),w.jsx(Sa,{memo:e})]}),[e.content,e.thinoType]);return e.thinoType==="JOURNAL"?r:a};class Ve extends C.Setting{constructor(n,r){super(n);me(this,"settingTab");me(this,"name","");me(this,"desc","");this.settingTab=r}setName(n){return super.setName(n),this.name=n,this}setDesc(n){return super.setDesc(n),this.desc=n,this}setTab(n){const r=typeof this.name=="string"?this.name:this.name.textContent||"",a=typeof this.desc=="string"?this.desc:this.desc.textContent||"";return this.settingTab.addSettingToMasterSettingsList(n,this.settingEl,r,a),this}}class pJ extends C.Modal{constructor(n,r,a,o,s){super(n);me(this,"plugin");me(this,"settingTab");me(this,"target",5);me(this,"cb");this.app=n,this.settingTab=r,this.plugin=a,this.target=o,this.cb=s}onOpen(){var c;const{contentEl:n}=this;(c=n.parentElement)==null||c.classList.add("memo-save-location-modal"),n.createEl("h3",{text:N("Thino Daily Target")});const r=n.createDiv("modal-setting");new Ve(r,this.settingTab).setName(N("Target Thino Count")).addSlider(d=>{d.setDynamicTooltip().setValue(this.target).setLimits(1,30,1).onChange(async p=>{this.target=p})});const a=n.createDiv("button-group"),o=a.createEl("button",{text:N("Cancel")}),s=a.createEl("button",{text:N("Save")});s.onclick=async()=>{this.plugin.settings.MemoDailyTarget=this.target,this.settingTab.applySettingsUpdate(),this.cb(this.target),this.close()},o.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}const mJ=({allStat:e,todayTimeStamp:t,calendarType:n,handleCalendarTypeChange:r})=>{const{dailyNotesState:{app:a,settings:o},globalState:{manifest:s}}=A.useContext(mt),[c,d]=A.useState(),[p,m]=A.useState(5),[g,v]=A.useState(0),[D,S]=A.useState(0),[T,E]=A.useState(o.HeatmapColorScheme||"default"),O=A.useRef(null),k=A.useRef(null);A.useEffect(()=>{o.HeatmapColorScheme&&E(o.HeatmapColorScheme)},[o.HeatmapColorScheme]),A.useEffect(()=>{let F,B=5;s&&a&&(F=a==null?void 0:a.plugins.getPlugin(s.id),B=F==null?void 0:F.settings.MemoDailyTarget,d(F)),m(B)},[s,a]),A.useEffect(()=>{const F=e.find(z=>z.timestamp===t),B=F?F.count:0;S(B);const R=Math.min(100,B/p*100);v(R)},[e,p]),A.useEffect(()=>{C.requireApiVersion("1.4.4")&&(C.setTooltip(k.current,g.toFixed(2)+"%"),C.setTooltip(O.current,N("Set daily target")+` (${D}/${p})`))},[g,D]),A.useEffect(()=>{O.current&&(O.current.hasChildNodes()||C.setIcon(O.current,"crosshair"),C.requireApiVersion("1.4.4")&&C.setTooltip(k.current,g+"%"))},[O,p]);const j=A.useCallback(()=>{if(!c)return;new pJ(a,c==null?void 0:c.settingTab,c,p,B=>{m(B)}).open()},[c,p]);return w.jsx(w.Fragment,{children:w.jsxs("div",{className:`usage-daily-progress-wrapper heatmap-${T}`,children:[w.jsx("div",{ref:k,className:"daily-progress-bar",children:w.jsx("div",{className:"daily-progress-bar-inner",style:{width:`${g}%`}})}),w.jsx("div",{ref:O,className:"daily-progress-target",onClick:j}),w.jsx("div",{ref:F=>{F&&C.setIcon(F,n==="basic"?"layout-grid":"calendar"),F&&C.setTooltip&&C.setTooltip(F,N("Switch calendar type"))},className:"switch-calendar-type-btn",onClick:()=>r&&r(n==="basic"?"heatmap":"basic")})]})})},gJ=e=>{const{className:t,view:n,datestamp:r,handleDateStampChange:a,handleDateItemClick:o,handleMonthChange:s,dailyStat:c}=e,d=C.moment().startOf("day").valueOf(),[p,m]=A.useState(Bh(r)),[g,v]=A.useState(null);A.useEffect(()=>{m(Bh(r))},[r]);const D=new Date(p),S=D.getDay(),T=[];for(let k=0;k<S;k++)T.push({date:0,datestamp:D.getTime()-Mi*(7-k)});const E=yJ(p);for(let k=1;k<=E;k++)T.push({date:k,datestamp:D.getTime()+Mi*(k-1)});const O=k=>{const j=D.getFullYear(),F=D.getMonth()+1;let B=0;F===1&&k===-1?B=new Date(`${j-1}/12/1`).getTime():F===12&&k===1?B=new Date(`${j+1}/1/1`).getTime():B=new Date(`${j}/${F+k}/1`).getTime(),m(Bh(B)),s&&s(B)};return w.jsxs("div",{className:`heatmap-date-picker-wrapper ${t}`,children:[w.jsxs("div",{className:"date-picker-header",children:[w.jsx("span",{ref:k=>{k&&C.setIcon(k,"chevron-left")},className:"btn btn-text",onClick:()=>O(-1)}),w.jsxs("span",{className:"normal-text",children:[w.jsx(GT,{year:D.getFullYear().toString(),handleYearChange:k=>{m(Bh(new Date(`${k}/${D.getMonth()+1}/1`).getTime()))}}),w.jsx(qT,{month:D.getMonth().toString(),handleMonthChange:k=>{m(Bh(new Date(`${D.getFullYear()}/${parseInt(k)}/1`).getTime()))}})]}),w.jsx("span",{ref:k=>{k&&C.setIcon(k,"chevron-right")},className:"btn btn-text",onClick:()=>O(1)})]}),w.jsxs("div",{className:"date-picker-day-container",children:[w.jsx("div",{className:"date-picker-day-header",children:N("weekDaysShort").map(k=>w.jsx("span",{className:"day-item",children:k},k))}),w.jsx("div",{className:"date-picker-day-content",children:T.map(k=>{if(k.date===0)return w.jsx("span",{className:"day-item null",children:""},k.datestamp);const j=c.find(R=>R.timestamp===k.datestamp)||{count:0,timestamp:k.datestamp,list:0},F=j.count-j.list,B=j.list;return w.jsxs("span",{className:`day-item ${k.datestamp===d?"current":""} ${k.datestamp===g?"selected":""} ${nw(j.count)}`,onClick:R=>{a(r,R.nativeEvent),v(k.datestamp===g?null:k.datestamp),o&&o(R,j)},onMouseOver:R=>{if(!j||!j.count)return;const z=new C.HoverPopover(n,R.currentTarget,100);cx(z,{d:k,list:B,task:F})},children:[w.jsx("span",{className:"day-item-text",children:k.date}),w.jsx(w.Fragment,{children:j&&j.count!==0&&w.jsxs("span",{className:"day-item-dots",children:[F>0&&w.jsx("div",{className:`day-item-dot thino-task-dot ${nw(F)}`}),B>0&&w.jsx("div",{className:`day-item-dot thino-list-dot ${nw(B)}`})]})})]},k.datestamp)})})]})]})};function cx(e,{d:t,list:n,task:r}){e.hoverEl.toggleClass("thino-hover-popover",!0);const a=e.hoverEl.createDiv({cls:"thino-hover-popover-content"});a.createDiv({cls:"thino-date-item",text:`${C.moment(t.datestamp).format("YYYY-MM-DD")}`});const o=a.createDiv({cls:"thino-task-item"});o.createSpan({cls:"thino-task-item-title-text",text:`${N("Task")}: `}),o.createSpan({cls:"thino-task-item-title-count",text:`${r}`});const s=a.createDiv({cls:"thino-list-item"});s.createSpan({cls:"thino-list-item-title-text",text:`${N("List")}: `}),s.createSpan({cls:"thino-list-item-title-count",text:`${n}`})}function yJ(e){const t=new Date(e),n=new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`);return((n.getMonth()===11?new Date(`${n.getFullYear()+1}/1/1`):new Date(`${n.getFullYear()}/${n.getMonth()+2}/1`)).getTime()-n.getTime())/Mi}function Bh(e){const t=new Date(e);return new Date(`${t.getFullYear()}/${t.getMonth()+1}/1`).getTime()}function nw(e){return e<=0?"":e<=1?"stat-day-L1-bg":e<=2?"stat-day-L2-bg":e<=4?"stat-day-L3-bg":"stat-day-L4-bg"}const A2={width:12,height:7},F2=(e,t)=>{const n=[];for(let r=0;r<=e;r++)n.push({timestamp:parseInt(C.moment(t).add(r,"days").format("x")),count:0,list:0});return n},gp=({initThinos:e,basicType:t})=>{const n=parseInt(C.moment().endOf("day").format("x")),r=new Date(n).getDay()||7,a=parseInt(C.moment().startOf("day").format("x")),o=new Array(7-(r===7?1:r)).fill(0),s=(A2.width-1)*A2.height+r,c=parseInt(C.moment().startOf("day").subtract(s,"days").format("x")),d=C.moment().startOf("day").subtract(s,"days"),{memoState:{memos:p},dailyNotesState:{view:m,app:g,settings:v,verifyState:D}}=A.useContext(mt),[S,T]=Kr(t||wJ(g||window.app)||"heatmap"),[E,O]=Kr(C.moment().startOf("day").valueOf()),[k,j]=Kr(v.HeatmapColorScheme||"default"),[F,B]=Kr(F2(s,c)),[R,z]=Kr(null),[H,Y,U]=Kr(""),J=A.useRef(null);A.useEffect(()=>{const se=F2(s,c),fe=(e||p).filter(oe=>!oe.deletedAt&&oe.rowStatus!=="ARCHIVED");for(const oe of fe){const Z=C.moment(oe.createdAt.replaceAll("/","-"),"YYYY-MM-DD HH:mm:ss").startOf("day").diff(d,"days");Z>=0&&Z<se.length&&(se[Z].count+=1,oe.thinoType==="JOURNAL"&&(se[Z].list+=1))}B([...se])},[p,e]),A.useEffect(()=>{v.HeatmapColorScheme&&j(v.HeatmapColorScheme)},[v.HeatmapColorScheme]);const Q=A.useCallback((se,fe)=>{if(!fe||!fe.count)return;const oe=fe.count-fe.list,we=fe.list,Z={date:fe.timestamp,datestamp:fe.timestamp},G=new C.HoverPopover(m,se.currentTarget,100);cx(G,{d:Z,list:we,task:oe})},[]),le=()=>{T(S==="heatmap"?"basic":"heatmap"),vJ(g,S==="heatmap"?"basic":"heatmap"),O(C.moment().startOf("day").valueOf())},pe=A.useCallback(async(se,fe)=>{if(fe.count===0)return;const oe=He.getState().query.duration,we=oe==null?void 0:oe.from,Z=oe==null?void 0:oe.to,G=C.moment(we).diff(Z,"day")==0;if(we===fe.timestamp&&G)He.setFromAndToQuery(0,0),z(null),Y(null);else if(we!==fe.timestamp&&we>0&&se.shiftKey){const te=C.moment(fe.timestamp).endOf("day").diff(Z,"day");we===0&&se.shiftKey?Y("from"):te<0&&G&&Y("to"),C.moment(we).isBefore(fe.timestamp)?U.current==="to"?te<0?He.setFromAndToQuery(fe.timestamp,Z):(He.setFromAndToQuery(parseInt(C.moment(Z).startOf("day").format("x")),parseInt(C.moment(fe.timestamp).endOf("day").format("x"))),Y("from")):U.current==="from"&&(te<0,He.setFromAndToQuery(we,parseInt(C.moment(fe.timestamp).endOf("day").format("x")))):U.current==="to"?He.setFromAndToQuery(fe.timestamp,Z):U.current==="from"&&(He.setFromAndToQuery(fe.timestamp,parseInt(C.moment(we).endOf("day").format("x"))),Y("to"))}else if(we===0&&se.shiftKey)He.setFromAndToQuery(fe.timestamp,parseInt(C.moment().endOf("day").format("x")));else if(fe.count>0&&(se.ctrlKey||se.metaKey)){const{app:te,dailyNotes:ge}=Xe.getState(),Ie=Fy(C.moment(fe.timestamp),ge);if(!C.Platform.isMobile)await te.workspace.getLeaf(!0).openFile(Ie);else{let De=te.workspace.activeLeaf;De===null&&(De=te.workspace.getLeaf(!0)),De.openFile(Ie)}}else fe.count>0&&!se.shiftKey&&!se.ctrlKey&&!se.metaKey&&(["/","/recycle"].includes(He.getState().pathname)||He.setPathname("/"),He.setFromAndToQuery(fe.timestamp,Ue.getTimeStampByDate(C.moment(fe.timestamp+Mi).subtract(1,"days").endOf("day").format("YYYY-MM-DD HH:mm:ss"))),z(fe))},[]),ie=A.useMemo(()=>w.jsx(gJ,{className:`heatmap-${k}`,view:m,datestamp:E,dailyStat:F,handleMonthChange:se=>{O(se)},handleDateStampChange:se=>{},handleDateItemClick:(se,fe)=>pe(se,fe)}),[JSON.stringify(F),m,E,k]);return w.jsxs(w.Fragment,{children:[S==="basic"&&ie,S==="heatmap"&&w.jsxs("div",{className:`usage-heat-map-wrapper heatmap-${k}`,ref:J,children:[w.jsxs("div",{className:"day-tip-text-container",children:[w.jsx("span",{className:"tip-text",children:N("weekDaysShort")[0]}),w.jsx("span",{className:"tip-text"}),w.jsx("span",{className:"tip-text",children:N("weekDaysShort")[2]}),w.jsx("span",{className:"tip-text"}),w.jsx("span",{className:"tip-text",children:N("weekDaysShort")[4]}),w.jsx("span",{className:"tip-text"}),w.jsx("span",{className:"tip-text",children:N("weekDaysShort")[6]})]}),w.jsxs("div",{className:"usage-heat-map",children:[F.map((se,fe)=>{const oe=se.count,we=oe<=0?"":oe<=1?"stat-day-L1-bg":oe<=2?"stat-day-L2-bg":oe<=4?"stat-day-L3-bg":"stat-day-L4-bg";return w.jsx("span",{className:`stat-container ${we} ${R===se?"current":""} ${a===se.timestamp?"today":""}`,onMouseOver:Z=>Q(Z,se),onClick:Z=>pe(Z,se)},fe)}),o.map((se,fe)=>w.jsx("span",{className:"stat-container null"},fe))]})]}),!t&&D&&w.jsx(mJ,{allStat:F,todayTimeStamp:a,calendarType:S,handleCalendarTypeChange:le})]})};function vJ(e,t){try{e==null||e.saveLocalStorage("calendarType",t)}catch(n){console.error(n)}}function wJ(e){try{return(e==null?void 0:e.loadLocalStorage("calendarType"))||"heatmap"}catch(t){return console.error(t),"heatmap"}}const dx=({type:e,timestamp:t})=>{const{memoState:{memos:n}}=A.useContext(mt),[r,a]=A.useState([]),o=$.useRef(null);return A.useEffect(()=>{if(e==="daily"){if(t){const c=n.filter(d=>C.moment(d.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(C.moment(t,"YYYY/MM/DD HH:mm:ss"),"day"));a(c);return}const s=n.filter(c=>C.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss").isSame(C.moment(),"day"));a(s)}else if(e==="latest"){const s=n.filter(p=>!p.deletedAt&&p.rowStatus!=="ARCHIVED"),c=s.filter(p=>p.pinned),d=s.filter(p=>!p.pinned).slice(0,5);a([...c,...d])}},[n]),A.useEffect(()=>{o.current&&(o.current.scrollTop=0)},[n]),r.length>0?w.jsx("div",{ref:o,className:"thino-list-container",children:r.map(s=>w.jsx(Sa,{memo:s}))}):w.jsx("div",{className:"tip-text-container",children:w.jsx("span",{className:"tip-text",children:N("Here is No Memos.")})})},bJ=(e,t)=>{Lo.createRoot(e).render(w.jsx($.StrictMode,{children:w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(DJ,{plugin:t})})}))},DJ=({plugin:e})=>w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"thino-error-code-block",children:N("Please open thino first")}),w.jsx("button",{className:"thino-open-view",onClick:()=>e.openMemos("center"),children:N("Open thino in center window")})]}),SJ=(e,t)=>{Lo.createRoot(e).render(w.jsx($.StrictMode,{children:w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(IJ,{yaml:t})})}))},IJ=({yaml:e})=>{const t=Object.keys(e).filter(a=>e[a]),n=e.daily?e.daily:"",r=a=>{switch(a){case"editor":return O2;case"heatmap":return EJ;case"calendar":return CJ;case"daily":return MJ;case"list":return NJ;case"status":return xJ;default:return O2}};return w.jsx(w.Fragment,{children:t.map(a=>w.jsx("div",{"data-embed-type":a,className:Xn("thino-embed-container",a==="editor"?"thino-editor-modal":""),children:a==="daily"?r(a)(n):r(a)()}))})};function O2(){return w.jsx(Nu,{editorType:"inline"})}function TJ(e,t){try{const n=Lo.createRoot(e);return n.render(w.jsx($.StrictMode,{children:w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(Nu,{editorType:"inline",destroy:t})})})),n}catch(n){console.error(n)}}function EJ(){return w.jsx(gp,{basicType:"heatmap"})}function CJ(){return w.jsx(gp,{basicType:"basic"})}function xJ(){return w.jsx(E1,{statusType:"banner"})}function MJ(e){return w.jsx(dx,{type:"daily",timestamp:e})}function NJ(){return w.jsx(dx,{type:"latest"})}class fx extends C.Modal{constructor(n){super(n);me(this,"root")}onOpen(){const{contentEl:n,modalEl:r}=this;try{this.root=TJ(n,this.close.bind(this)),r.toggleClass("thino-editor-modal",!0),setTimeout(()=>{var a;(a=n.querySelector("textarea"))==null||a.focus(),this.app.workspace.trigger("focus-on-textarea")},10)}catch(a){console.error(a)}}onClose(){this.root.unmount(),this.containerEl&&this.containerEl.empty()}}const kJ=({userIcon:e})=>w.jsx("div",{className:"moments-view-user-icon",ref:t=>{if(e){t==null||t.empty();return}e||t&&C.setIcon(t,"Memos")},style:{backgroundImage:`url(${e})`}}),P2="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSIjMGUyYTQ3Ij48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODIiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4NiI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODMiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDg1Ij48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjE1MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMTUwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIxNTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMTUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjIxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMjcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjI3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMjcwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzMzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzkwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIzOTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIzOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI0NTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjQ1MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iNDUwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjQ1MCIgeT0iNDUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNDUwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1MTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjUxMCIgeT0iNDUwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjUxMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI1NzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjU3MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjYzMCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjYzMCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE5NywgOTAsIDk5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjYzMCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjY5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTk3LCA5MCwgOTksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjY5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNjkwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxOTcsIDkwLCA5OSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjY5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSg0NywgMTE0LCAxMzEsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDQ3LCAxMTQsIDEzMSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjY5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoNDcsIDExNCwgMTMxLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",rw="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHhtbG5zOnN2Z2pzPSJodHRwOi8vc3ZnanMuZGV2L3N2Z2pzIiB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIHByZXNlcnZlQXNwZWN0UmF0aW89Im5vbmUiIHZpZXdCb3g9IjAgMCAxNDQwIDU2MCI+PGcgbWFzaz0idXJsKCZxdW90OyNTdmdqc01hc2sxMDgwJnF1b3Q7KSIgZmlsbD0ibm9uZSI+PHJlY3Qgd2lkdGg9IjE0NDAiIGhlaWdodD0iNTYwIiB4PSIwIiB5PSIwIiBmaWxsPSJyZ2JhKDIzMSwgMjM4LCAyNDUsIDEpIj48L3JlY3Q+PHVzZSB4bGluazpocmVmPSIjU3ZnanNTeW1ib2wxMDg3IiB4PSIwIiB5PSIwIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1N5bWJvbDEwODciIHg9IjcyMCIgeT0iMCI+PC91c2U+PC9nPjxkZWZzPjxtYXNrIGlkPSJTdmdqc01hc2sxMDgwIj48cmVjdCB3aWR0aD0iMTQ0MCIgaGVpZ2h0PSI1NjAiIGZpbGw9IiNmZmZmZmYiPjwvcmVjdD48L21hc2s+PHBhdGggZD0iTS0xIDAgYTEgMSAwIDEgMCAyIDAgYTEgMSAwIDEgMCAtMiAweiIgaWQ9IlN2Z2pzUGF0aDEwODUiPjwvcGF0aD48cGF0aCBkPSJNLTMgMCBhMyAzIDAgMSAwIDYgMCBhMyAzIDAgMSAwIC02IDB6IiBpZD0iU3ZnanNQYXRoMTA4MyI+PC9wYXRoPjxwYXRoIGQ9Ik0tNSAwIGE1IDUgMCAxIDAgMTAgMCBhNSA1IDAgMSAwIC0xMCAweiIgaWQ9IlN2Z2pzUGF0aDEwODYiPjwvcGF0aD48cGF0aCBkPSJNMiAtMiBMLTIgMnoiIGlkPSJTdmdqc1BhdGgxMDg0Ij48L3BhdGg+PHBhdGggZD0iTTYgLTYgTC02IDZ6IiBpZD0iU3ZnanNQYXRoMTA4MSI+PC9wYXRoPjxwYXRoIGQ9Ik0zMCAtMzAgTC0zMCAzMHoiIGlkPSJTdmdqc1BhdGgxMDgyIj48L3BhdGg+PC9kZWZzPjxzeW1ib2wgaWQ9IlN2Z2pzU3ltYm9sMTA4NyI+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjMwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIzMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIzMCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzMCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjkwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iOTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSI5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iOTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI5MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMTUwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIxNTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIxNTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIxNTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIxNTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODMiIHg9IjE1MCIgeT0iNTEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjE1MCIgeT0iNTcwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMjEwIiB5PSI5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSIyMTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIiBzdHJva2Utd2lkdGg9IjMiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjIxMCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjIxMCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMjEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyMTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyMTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSIyMTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjI3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iMjcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSIyNzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIyNzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIyNzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg0IiB4PSIyNzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSIzMzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjMzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iMzMwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzMwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MyIgeD0iMzMwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzMwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzMwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NSIgeD0iMzkwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSIzOTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMTUwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODEiIHg9IjM5MCIgeT0iMjEwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjM5MCIgeT0iMjcwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODUiIHg9IjM5MCIgeT0iMzMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjM5MCIgeT0iMzkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iMzkwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iMzkwIiB5PSI1NzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNDUwIiB5PSIzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgyIiB4PSI0NTAiIHk9IjkwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiIHN0cm9rZS13aWR0aD0iMyI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNDUwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNDUwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI0NTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI0NTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1MTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODQiIHg9IjUxMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTEwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTEwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTEwIiB5PSI0NTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTEwIiB5PSI1MTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1MTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI1NzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODYiIHg9IjU3MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIxNTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NiIgeD0iNTcwIiB5PSIyMTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MSIgeD0iNTcwIiB5PSIyNzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4NCIgeD0iNTcwIiB5PSIzMzAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSI+PC91c2U+PHVzZSB4bGluazpocmVmPSIjU3ZnanNQYXRoMTA4MiIgeD0iNTcwIiB5PSIzOTAiIHN0cm9rZT0icmdiYSgyMDgsIDIxNywgMjA5LCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI1NzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI1NzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI1NzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjMwIiBzdHJva2U9InJnYmEoMTYsIDUwLCA4MywgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjYzMCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2MzAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2MzAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMwIiBzdHJva2U9InJnYmEoMjA4LCAyMTcsIDIwOSwgMSkiPjwvdXNlPjx1c2UgeGxpbms6aHJlZj0iI1N2Z2pzUGF0aDEwODIiIHg9IjY5MCIgeT0iOTAiIHN0cm9rZT0icmdiYSgxNiwgNTAsIDgzLCAxKSIgc3Ryb2tlLXdpZHRoPSIzIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjE1MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjIxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjI3MCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjMzMCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgzIiB4PSI2OTAiIHk9IjM5MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg1IiB4PSI2OTAiIHk9IjQ1MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDgxIiB4PSI2OTAiIHk9IjUxMCIgc3Ryb2tlPSJyZ2JhKDIwOCwgMjE3LCAyMDksIDEpIj48L3VzZT48dXNlIHhsaW5rOmhyZWY9IiNTdmdqc1BhdGgxMDg2IiB4PSI2OTAiIHk9IjU3MCIgc3Ryb2tlPSJyZ2JhKDE2LCA1MCwgODMsIDEpIj48L3VzZT48L3N5bWJvbD48L3N2Zz4=",AJ=e=>{const{globalState:{memoListView:t,markMemoId:n,manifest:r,editMemoId:a},dailyNotesState:{app:o,settings:s}}=A.useContext(mt),{thinos:c}=e,d=$.useRef(null),p=$.useRef(null),[m,g]=$.useState(!1),[v,D]=A.useState({}),[S,T]=A.useState((o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day");A.useEffect(()=>{s!=null&&s.showDayMark&&D(yp(c,(o==null?void 0:o.loadLocalStorage("dayMarkRange"))||"day"))},[c]),A.useEffect(()=>{d.current.closest(".workspace-window")&&g(!0)},[d.current]),A.useEffect(()=>{n&&g(!0)},[n]),A.useEffect(()=>{a?(g(!0),setTimeout(()=>{o.workspace.trigger("focus-on-textarea")},200)):g(!1)},[a]),A.useEffect(()=>{p.current&&(!m&&C.setIcon(p.current,"camera"),m&&C.setIcon(p.current,"camera-off"))},[p.current,m]);const E=A.useCallback(()=>{o.setting.open(),o.setting.openTabById(r.id||"obsidian-memos")},[o]);return w.jsxs("div",{ref:d,className:Xn("moments-view",m?"show-editor":""),children:[w.jsxs("div",{className:"moments-view-background-wrapper",children:[w.jsx(FJ,{}),w.jsx("div",{ref:p,className:"moments-show-editor-btn",onClick:()=>{(m||a)&&g(!m),!m&&!a&&new fx(o).open()}}),w.jsxs("div",{className:"moments-view-background-overlay",children:[w.jsxs("div",{className:"moments-view-user-info",children:[w.jsx("div",{className:"moments-view-user-name",children:s==null?void 0:s.UserName}),w.jsx(kJ,{userIcon:s==null?void 0:s.MomentsIcon})]}),w.jsx("div",{className:"moments-view-user-idea",children:s.MomentsQuote||" "})]})]}),s!=null&&s.showDayMark?v&&Object.keys(v).length>0&&Object.keys(v).map((O,k)=>w.jsx(Ow,{type:"list",thinos:v[O],dayMark:O,dayMarkRange:S,thinoWrapper:j=>w.jsx(j2,{thino:j.thino,handleOpenSettings:E},j.thino.createdAt+k)},O)):c.map((O,k)=>w.jsx(j2,{thino:O,handleOpenSettings:E},O.createdAt+k))]})},FJ=()=>{const{dailyNotesState:{view:e,settings:t}}=A.useContext(mt),[n,r]=A.useState((t==null?void 0:t.MomentsBackgroundImage)||rw);return A.useEffect(()=>{if(!(t!=null&&t.MomentsBackgroundImage)){r(document.body.hasClass("theme-dark")?P2:rw);return}r(t==null?void 0:t.MomentsBackgroundImage)},[t==null?void 0:t.MomentsBackgroundImage]),A.useEffect(()=>{e&&e.registerEvent(e.app.workspace.on("css-change",()=>{r(document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?P2:!document.body.hasClass("theme-dark")&&!(t!=null&&t.MomentsBackgroundImage)?rw:t==null?void 0:t.MomentsBackgroundImage)}))},[e]),w.jsx("div",{className:"moments-view-background",style:{backgroundImage:`url(${n})`}})},OJ=e=>{const{icon:t}=e,n=A.useCallback(()=>{app.setting.open(),app.setting.openTabById(manifest.id||"obsidian-memos")},[]);return w.jsx("div",{className:"thino-moment-icon",ref:r=>{if(t){r==null||r.empty();return}t||r&&C.setIcon(r,"Memos")},style:{backgroundImage:`url(${t})`},onClick:n})},j2=e=>{const{dailyNotesState:{settings:t}}=A.useContext(mt),n=A.useRef(null),r=A.useRef(null),{thino:a}=e;return A.useEffect(()=>{n.current&&C.setIcon(n.current,"more-horizontal")},[n.current]),w.jsxs("div",{className:"thino-moment-wrapper",children:[w.jsx(OJ,{icon:t==null?void 0:t.MomentsIcon}),w.jsxs("div",{ref:r,className:"thino-moment-container",children:[w.jsx("div",{className:"thino-moment-user-name",children:t==null?void 0:t.UserName}),w.jsx("div",{className:"thino-moment-user-content",children:w.jsx(Sa,{memo:a})})]})]})};function PJ(e){const t=e.filter(r=>r.pinned),n=e.filter(r=>!r.pinned);return[...t,...n]}function yp(e,t){const n={},r={day:"YYYY-MM-DD ddd",week:"YYYY-[W]WW",month:"YYYY-MM",quarter:"YYYY-[Q]1",year:"YYYY"};for(const a of e){const o=C.moment(a.createdAt,"YYYY/MM/DD HH:mm:ss").format(r[t]);if(a.pinned){n.PINNED||(n.PINNED=[]),n.PINNED.push(a);continue}n[o]||(n[o]=[]),n[o].push(a)}return n}function Yg(e){const{tag:t,duration:n,type:r,text:a,filter:o}=e,s=Et.getQueryById(o);return!(!!(t||n&&n.from<n.to||r||a||s)||s)}const jJ=({tempMemos:e,query:t,HideDoneTasks:n})=>{const r=e.filter(g=>g.rowStatus!=="ARCHIVED"&&!(g.deletedAt!==""&&g.deletedAt)),{tag:a,duration:o,type:s,text:c,filter:d}=t,p=Et.getQueryById(d);return!!(a||o&&o.from<o.to||s||c||p)||p||n?r.filter(g=>{let v=!0;if(g.thinoType!==void 0&&n&&g.thinoType==="TASK-DONE"&&(v=!1),g.content.contains("comment:")&&(v=!1),p){const D=JSON.parse(p.querystring);Array.isArray(D)&&(v=Wd(g,D))}if(a){const D=new Set;for(const S of Array.from(g.content.match(Fn)||[])){const E=S.replace(Fn,"$1").trim().split("/");let O="";for(const k of E)O+=k,D.add(O),O+="/"}for(const S of Array.from(g.content.match($n)||[])){const E=S.replace($n,"$1").trim().split("/");let O="";for(const k of E)O+=k,D.add(O),O+="/"}for(const S of Array.from(g.content.match(mr)||[])){const E=S.replace(mr,"$2").trim().split("/");let O="";for(const k of E)O+=k,D.add(O),O+="/"}D.has(a)||(v=!1)}return o&&o.from<o.to&&(Ue.getTimeStampByDate(g.createdAt)<o.from||Ue.getTimeStampByDate(g.createdAt)>o.to)&&(v=!1),s&&(s==="NOT_TAGGED"&&(g.content.match(Fn)!==null||g.content.match(mr)!==null||g.content.match($n)!==null)||s==="LINKED"&&g.content.match(Bu)===null||s==="IMAGED"&&g.content.match(_u)===null||s==="CONNECTED"&&g.content.match(Il)===null)&&(v=!1),c&&!g.content.toLowerCase().includes(c.toLowerCase())&&(v=!1),v}):r.filter(g=>!g.content.contains("comment:"))},LJ=({updateThinos:e})=>{var G;const{locationState:{query:t},memoState:{memos:n},globalState:{memoListView:r},dailyNotesState:{app:a,settings:o,verifyState:s,plugin:c}}=A.useContext(mt),[d,p]=A.useState(!1),[m,g]=A.useState(!1),[v,D,S]=Kr([]),[T,E]=A.useState([]),[O,k]=A.useState({}),[j,F]=A.useState((G=window.app||a)==null?void 0:G.loadLocalStorage("thinoListView")),[B,R]=A.useState((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),[z,H]=A.useState((a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day"),[Y,U,J]=Kr([]),Q=A.useRef(0),le=A.useRef(!1),pe=A.useRef(null),ie=A.useRef(null),se=A.useRef(null),fe=A.useRef(null),oe=A.useRef(!1);A.useEffect(()=>{F(r),a&&a.saveLocalStorage("thinoListView",r),D(Y.slice(0,v.length>20?Math.min(v.length,40):40))},[r]),A.useEffect(()=>()=>{ie.current&&(ie.current=null),se.current&&(se.current=null),fe.current&&(fe.current=null)},[]),A.useLayoutEffect(()=>{if((n.length!==0||!a)&&oe.current===!0)return;const te=RJ(a);!te||te.length===0||(U(te),E(te),R((a==null?void 0:a.loadLocalStorage("showDayMark"))||!1),a!=null&&a.loadLocalStorage("showDayMark")&&k(yp(te,(a==null?void 0:a.loadLocalStorage("dayMarkRange"))||"day")))},[a]),A.useEffect(()=>{if(n.length===0&&!Te.initialized)return;p(!1);const te=PJ(n),ge=jJ({tempMemos:te,query:t,HideDoneTasks:(o==null?void 0:o.HideDoneTasks)||!1});return oe.current=!0,e&&e(ge),U(ge),()=>{oe.current=!1}},[n,t,o==null?void 0:o.HideDoneTasks]),A.useEffect(()=>{D(Y.slice(0,v.length>20?Math.min(v.length,40):40))},[Y]),A.useEffect(()=>{var te;v.length<40&&((te=se.current)==null||te.click())},[Y]),A.useEffect(()=>{(Yg(t)&&v.length<Y.length||v.length<Y.length&&!Yg(t))&&g(!1),(Yg(t)&&v.length===n.length&&n.length>0||!Yg(t)&&v.length===Y.length&&Y.length>0)&&g(!0),BJ(v||[],a),E(v),a==null||a.saveLocalStorage("showDayMark",o==null?void 0:o.showDayMark),a==null||a.saveLocalStorage("dayMarkRange",o==null?void 0:o.dayMarkRange),R((o==null?void 0:o.showDayMark)||!1),H((o==null?void 0:o.dayMarkRange)||"day"),o!=null&&o.showDayMark&&k(yp(v,o==null?void 0:o.dayMarkRange))},[v,o==null?void 0:o.showDayMark,o==null?void 0:o.dayMarkRange]),A.useEffect(()=>{if(!ie.current)return;const te=async()=>{le.current||(Q.current++,await we(),Q.current>=1&&(le.current=!0,setTimeout(()=>{Q.current=0,le.current=!1},3e3)))};v.length<40&&te();const ge=new IntersectionObserver(([Ie])=>{if(Ie.isIntersecting){if(m)return;te()}else Q.current=0,le.current=!1});return ie!=null&&ie.current&&ge.observe(ie.current),()=>{ie!=null&&ie.current&&ge.unobserve(ie.current)}},[d,m,ie.current]),A.useEffect(()=>{var te;(te=fe.current)==null||te.scrollTo({top:0})},[t]);const we=async()=>{try{if(J.current.length>S.current.length){p(!0);const te=Math.min(S.current.length+40,J.current.length)-S.current.length,ge=J.current.slice(S.current.length,S.current.length+te);D(Ie=>[...Ie,...ge]),p(!1),g(ge.length<40)}}catch(te){console.error(te),new C.Notice(te.response.data.message)}},Z=A.useMemo(()=>w.jsx("div",{ref:ie,className:Xn("status-text-container",j==="calendar"||j==="table"?"hidden":""),children:w.jsx("p",{className:"status-text",children:d?N("Fetching data..."):m?Y.length===0?N("Noooop!"):N("All Data is Loaded 🎉"):w.jsx(w.Fragment,{children:w.jsx("span",{ref:se,className:"cursor-pointer hover:text-green-600",onClick:we,children:N("fetch more")})})})}),[j,we,Y,d,m,ie]);return w.jsxs("div",{className:`memolist-wrapper ${m?"completed":""}`,ref:fe,children:[j==="chat"&&Z,w.jsxs("div",{ref:pe,className:"memolist-container",children:[j==="chat"&&w.jsx(cJ,{thinos:T}),j==="calendar"&&w.jsx(XG,{thinos:Y}),j==="table"&&w.jsx(sJ,{thinos:Y}),j==="moments"&&w.jsx(AJ,{thinos:T}),j==="list"&&w.jsx(gy,{breakpointCols:1,className:`${j}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:B?w.jsx(w.Fragment,{children:Object.keys(O).map(te=>w.jsx(Ow,{type:"list",thinos:O[te],dayMark:te,dayMarkRange:z},te))}):T.map((te,ge)=>w.jsx(Sa,{memo:te},`${te.id}-${C.moment(te.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ge}`))}),j==="waterfall"&&w.jsx(w.Fragment,{children:B&&Object.keys(O).length>0?Object.keys(O).map(te=>w.jsx(Ow,{type:"waterfall",thinos:O[te],dayMark:te,dayMarkRange:z},te)):w.jsx(gy,{breakpointCols:3,className:`${j}-view masonry-memolist`,columnClassName:"masonry-memolist-grid_column",children:T.map((te,ge)=>w.jsx(Sa,{memo:te},`${te.id}-${C.moment(te.updatedAt,"YYYY/MM/DD HH:mm:ss").format("x")}-${ge}`))})})]}),j!=="chat"&&Z]})};function hx(e){return`memosListCache:${e}`}function RJ(e){var t;try{const n=hx(e==null?void 0:e.appId),r=Kn.get([n])[n];return r?((t=JSON.parse(r))==null?void 0:t.memos)||[]:[]}catch(n){return console.error(n),[]}}function BJ(e,t){try{if(!e)return;const n=e==null?void 0:e.slice(0,100),r=hx(t==null?void 0:t.appId);Kn.set({[r]:JSON.stringify({memos:n})})}catch(n){console.error(n)}}const Tu=async e=>{const{app:t,settings:n}=Xe.getState();if(!n.startSync||!(t!=null&&t.loadLocalStorage("tokenForSync")))return;const r=await W6(e);if(!r||r.length===0)return;r.sort((s,c)=>C.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").isAfter(C.moment(c.createdAt,"YYYY/MM/DD HH:mm:ss"))?1:-1);const a=r.filter(s=>!s.deleted),o=r.filter(s=>s.deleted);for(let s=0;s<a.length;s++){const c=a[s],d=await Te.createOrPatchThinoFromWeb(c);d&&Te.pushMemo(d)}for(let s=0;s<o.length;s++){const c=o[s],d=Te.getMemoByWebId(c.id);d&&await Te.deleteMemoById(d.id,"local")}Te.updateTagsState(),YJ(t)};function _J(){const{settings:e,app:t,view:n}=Xe.getState(),{globalState:{loaded:r,memoListView:a}}=A.useContext(mt),o=C.Platform.isMobile&&e.DefaultEditorLocation==="Bottom",s=$.useRef(null),[c,d]=$.useState([]);A.useEffect(()=>{if(!t||!r||!n||!(t==null?void 0:t.loadLocalStorage("tokenForSync"))||!e.startSync)return;s.current=window.setInterval(async()=>{const v=Qw(t);await Tu(v)},3e4),n.registerInterval(s.current);const g=Qw(t);return Tu(g),()=>{s.current&&window.clearInterval(s.current)}},[n,t,r,e.startSync]);const p=[w.jsx(Rp,{thinosCount:c.length,thinos:c},"filter"),w.jsx(LJ,{updateThinos:m=>{d(m)}},"list")];return w.jsx(w.Fragment,{children:a==="chat"?w.jsx(w.Fragment,{children:[w.jsx(ay,{syncThino:Tu},"header"),...p.reverse(),w.jsx(Nu,{className:"mod-editor-bottom",editorType:"inline"},"editor")]}):w.jsx(w.Fragment,{children:o?[w.jsx(ay,{syncThino:Tu},"header"),...p,w.jsx(Nu,{className:"mod-editor-bottom",editorType:"block"},"editor")]:[w.jsx(ay,{syncThino:Tu},"header"),w.jsx(Nu,{editorType:"block"},"editor"),...p]})})}function HJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",C.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")))}catch(t){console.error(t)}}function Qw(e){try{const t=(e==null?void 0:e.loadLocalStorage)&&(e==null?void 0:e.loadLocalStorage("thinoLastUpdated"));return t||C.moment("2000-01-01 00:01:00","YYYY-MM-DD HH:mm:ss").format("x")}catch(t){return console.error(t),C.moment().format("x")}}function YJ(e){try{e!=null&&e.saveLocalStorage&&(e==null||e.saveLocalStorage("thinoLastUpdated",C.moment().format("x")))}catch(t){console.error(t)}}function af(e=!0){const[t,n]=A.useState({isLoading:e,isFailed:!1,isSucceed:!1,isPending:!1});return{...t,setLoading:()=>{n({...t,isLoading:!0,isFailed:!1,isPending:!1,isSucceed:!1})},setFinish:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!1,isSucceed:!0})},setError:()=>{n({...t,isLoading:!1,isFailed:!0,isPending:!1,isSucceed:!1})},setPending:()=>{n({...t,isLoading:!1,isFailed:!1,isPending:!0,isSucceed:!1})}}}const zJ={text:N("SELECT"),value:""},UJ=e=>{const{className:t,dataSource:n,handleValueChanged:r,value:a}=e,[o,s]=ki(!1),c=A.useRef(null);let d=zJ;for(const g of n)if(g.value===a){d=g;break}A.useEffect(()=>{if(o){const g=v=>{var D;(D=c.current)!=null&&D.contains(v.target)||s(!1)};window.addEventListener("click",g,{capture:!0,once:!0})}},[o]);const p=g=>{r&&r(g.value),s(!1)},m=g=>{g.stopPropagation(),s()};return w.jsxs("div",{className:`selector-wrapper ${t||""}`,ref:c,children:[w.jsxs("div",{className:`current-value-container ${o?"active":""}`,onClick:m,children:[w.jsx("span",{className:"value-text",children:d.text}),w.jsx("span",{ref:g=>{g&&C.setIcon(g,"chevron-right")},className:"btn arrow-text"})]}),w.jsx("div",{className:`items-wrapper ${o?"":"hidden"}`,children:n.map(g=>w.jsx("div",{className:`item-container ${g.value===a?"selected":""}`,onClick:()=>{p(g)},children:g.text},g.value))})]})},bd=A.memo(UJ),pb=e=>{const{destroy:t,queryId:n,type:r="dialog"}=e,[a,o]=A.useState(""),[s,c]=A.useState(r!=="dialog"?[kD()]:[]),d=af(!1),[p,m]=A.useState(!1),[g,v]=ki(!1),D=Te.getState().memos.filter(R=>!(R.deletedAt!==""&&R.deletedAt)).filter(R=>Wd(R,s)).length;A.useEffect(()=>{S()},[n]);const S=()=>{const R=Et.getQueryById(n??"");if(R){o(R.title);const z=JSON.parse(R.querystring);return Array.isArray(z)&&c(z),R}},T=R=>{const z=R.target.value;o(z)},E=async()=>{if(!a)return new C.Notice(N("TITLE CANNOT BE NULL!")),null;if(s.length===0)return new C.Notice(N("FILTER CANNOT BE NULL!")),null;if(s.length===1&&s[s.length-1].value.value==="")return new C.Notice(N("Please finish the last filter setting first")),null;let R;try{n&&!n.startsWith("Filter [Temp] ")?(R=await Et.updateQuery(n,a,JSON.stringify(s)),Et.editQuery(R),await Et.getMyAllQueries()):(R=await Et.createQuery(a,JSON.stringify(s)),Et.pushQuery(R),await Et.getMyAllQueries())}catch(z){new C.Notice(z.message)}return R},O=async()=>{switch(r){case"modal":case"inline":if(s.length===0){new C.Notice(N("FILTER CANNOT BE NULL!"));return}if(s.length===1&&s[s.length-1].value.value===""){new C.Notice(N("Please finish the last filter setting first"));return}try{const R=Et.getQueryById(n??"");if(R&&JSON.stringify(s)===R.querystring){He.setMemoFilter(R.id),t();return}const z=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));Et.pushQuery(z),He.setMemoFilter(z.id)}catch(R){new C.Notice(R.message)}t();break;case"dialog":try{if(!await E())return}catch(R){console.error(R),new C.Notice(R.message)}t();break}},k=()=>{if(s.length===0){new C.Notice(N("FILTER CANNOT BE NULL!"));return}if(p){He.setMemoFilter(""),m(!1);return}const R=Et.getQueryById(n??"");if(R&&JSON.stringify(s)===R.querystring){He.setMemoFilter(R.id);return}const z=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(s));Et.pushQuery(z),He.setMemoFilter(z.id),e.setPreview&&e.setPreview(z.id),m(!0)},j=()=>{if(s.length>0&&s[s.length-1].value.value===""){new C.Notice(N("Please finish the last filter setting first"));return}c([...s,kD()])},F=A.useCallback((R,z)=>{c(H=>{const Y=[...H];return Y[R]=z,Y})},[]),B=A.useCallback(R=>{c(z=>z.filter((Y,U)=>U!==R))},[]);return w.jsxs(w.Fragment,{children:[r==="dialog"&&w.jsxs("div",{className:"dialog-header-container",children:[w.jsxs("span",{className:"title-text",children:[w.jsx("span",{className:"icon-text",children:"🔖"}),N(n?"EDIT QUERY":"CREATE QUERY")]}),w.jsx("button",{ref:R=>{R&&C.setIcon(R,"x")},className:"btn close-btn",onClick:t})]}),w.jsxs("div",{className:"dialog-content-container",children:[(r==="dialog"||g)&&w.jsxs("div",{className:"form-item-container input-form-container",children:[w.jsx("span",{className:"normal-text",children:N("TITLE")}),w.jsx("input",{className:"title-input",type:"text",value:a,onChange:T})]}),w.jsxs("div",{className:"form-item-container filter-form-container",children:[w.jsx("span",{className:"normal-text",children:N("FILTER")}),w.jsxs("div",{className:"filters-wrapper",children:[s.map((R,z)=>w.jsx(ZJ,{index:z,filter:R,handleFilterChange:F,handleFilterRemove:B},z)),w.jsx("div",{className:"create-filter-btn",onClick:j,children:N("ADD FILTER TERMS")})]})]})]}),w.jsx("div",{className:"dialog-footer-container",children:w.jsxs("div",{className:"btns-container",children:[(r==="inline"||r==="modal")&&w.jsx("button",{className:`btn ${g?"mod-cta":"save-btn"}`,onClick:async()=>{if(!g)v();else{const R=await E();v(!1),t(),R&&He.setMemoFilter(R.id)}},children:N(g?"Set and save":"Save")}),w.jsxs("div",{className:"btns-group-container",children:[w.jsxs("span",{className:`tip-text ${s.length===0&&"hidden"}`,children:[N("MATCH")," Thino ",w.jsx("strong",{children:D})," ",N("TIMES")]}),w.jsx(w.Fragment,{children:r==="inline"&&w.jsx("button",{className:"btn mod-cta",onClick:k,children:N("Preview")})}),w.jsx("button",{className:`btn save-btn ${d.isLoading?"requesting":""}`,onClick:O,children:N(r==="inline"||r==="modal"?"Filter":n?"EDIT":"Save")})]})]})})]})},VJ=e=>{const{index:t,filter:n,handleFilterChange:r,handleFilterRemove:a}=e,{type:o}=n,s=A.useRef(null),c=A.useRef(null),d=A.useRef(n),p=A.useRef(o);A.useEffect(()=>{d.current=e.filter},[n]),A.useEffect(()=>{if(s.current)return o==="TAG"&&!c.current&&(p.current=o,c.current=new yE(s.current,D)),()=>{c.current&&(c.current.destroy(),c.current=null)}},[s,o]);const m=A.useCallback(E=>{["AND","OR"].includes(E)&&r(t,{...n,relation:E})},[n]),g=A.useCallback(async E=>{var O;if(n.type!==E){const{verifyState:k}=Xe.getState(),j=!C.Platform.isDesktop&&await((O=window.Capacitor)==null?void 0:O.Plugins.Device.getId()),F=C.Platform.isDesktop?await vn():j.identifier||j.uuid,B=k&&(k==null?void 0:k.appId)===F;if(E==="SOURCE"&&!B){qt();return}const R=Object.values(pl[E].operators);r(t,{...n,type:E,value:{operator:R[0].value,value:""}})}},[n]),v=A.useCallback(E=>{r(t,{...n,value:{...n.value,operator:E}})},[n]),D=A.useCallback(E=>{r(t,{...d.current,value:{...d.current.value,value:E}})},[n]),S=()=>{a(t)},T={TYPE:w.jsx(bd,{className:"value-selector",dataSource:pl.TYPE.values,value:n.value.value,handleValueChanged:D}),LIST:w.jsx(bd,{className:"value-selector",dataSource:pl.LIST.values,value:n.value.value,handleValueChanged:D}),SOURCE:w.jsx(bd,{className:"value-selector",dataSource:pl.SOURCE.values,value:n.value.value,handleValueChanged:D}),TAG:w.jsx("input",{type:"text",id:Math.random().toString(36).substring(7),className:"value-inputer",ref:s,value:n.value.value,onChange:E=>{D(E.target.value)}}),TEXT:w.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}}),DATE:w.jsxs("div",{className:"date-inputer",children:[w.jsx(py,{type:"icon",handleValueChange:D}),w.jsx("input",{type:"text",className:"value-inputer",value:n.value.value,onChange:E=>{D(E.target.value)}})]})};return w.jsxs("div",{className:"memo-filter-input-wrapper",children:[t>0&&w.jsx(bd,{className:"relation-selector",dataSource:u8,value:n.relation,handleValueChanged:m}),w.jsx(bd,{className:"type-selector",dataSource:Object.values(pl),value:n.type,handleValueChanged:g}),w.jsxs(w.Fragment,{children:[Object.keys(pl).includes(o)&&w.jsx(bd,{className:"operator-selector",dataSource:Object.values(pl[o].operators),value:n.value.operator,handleValueChanged:v}),T[o]]}),w.jsx("div",{ref:E=>{E&&C.setIcon(E,"x")},className:"btn remove-btn",onClick:S})]})},ZJ=A.memo(VJ);function Xw(e){By({className:"create-query-dialog"},pb,{queryId:e})}const mb=e=>{var D,S;const{dailyNotesState:{app:t,verifyState:n},locationState:{query:r}}=A.useContext(mt),a=$.useRef(null),[o,s]=$.useState(!1),c=$.useRef(null),[d,p]=$.useState(""),m=Vy(a.current,c.current,{placement:"bottom-start",modifiers:[{name:"offset",options:{offset:[0,10]}}]});A.useEffect(()=>{o&&m.update&&(m==null||m.update())},[o]),A.useEffect(()=>{a&&C.setIcon(a.current,"filter")},[a]);const g=async()=>{var O;const T=!C.Platform.isDesktop&&await((O=window.Capacitor)==null?void 0:O.Plugins.Device.getId()),E=C.Platform.isDesktop?await vn():T.identifier||T.uuid;return!n||(n==null?void 0:n.appId)!==E?(qt(),!1):!0};return Pp(c,()=>{s(!1),d&&He.getState().query.filter===d&&He.setMemoFilter("")}),w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"thino-inline-filter-wrapper pro",ref:a,onClick:async()=>{await g()&&(C.Platform.isDesktop?(s(!o),await(m==null?void 0:m.update())):new WJ(Xe.getState().app,r.filter,E=>{p(E)}).open())}}),w.jsx("div",{ref:c,className:`thino-inline-filter-container ${o?"":"hidden"}`,style:m.styles.popper,children:o&&w.jsx(pb,{type:"inline",queryId:(D=r.filter)!=null&&D.startsWith("Filter [Temp] ")&&!((S=r.filter)!=null&&S.includes("Filter [Temp]"))?"":r.filter,destroy:()=>{s(!1)},setPreview:T=>{p(T)}})})]})};class WJ extends C.Modal{constructor(n,r,a){super(n);me(this,"root");me(this,"setPreview");this.filter=r,this.setPreview=a}onOpen(){var r,a;const{contentEl:n}=this;this.root=Ap(n),this.root.render(w.jsx(Bo,{store:Ee,context:mt,children:w.jsx("div",{className:"thino-inline-filter-container",children:w.jsx(pb,{type:"modal",queryId:(r=this.filter)!=null&&r.startsWith("Filter [Temp] ")&&!((a=this.filter)!=null&&a.includes("Filter [Temp]"))?"":this.filter,destroy:()=>{this.close()},setPreview:o=>{this.setPreview(o)}})})}))}onClose(){var n;(n=this.root)==null||n.unmount()}}const px=()=>{const{dailyNotesState:{app:e},globalState:{isMobileView:t,showSiderbarInMobileView:n}}=A.useContext(mt),[r]=A.useState($.createRef());A.useEffect(()=>{if(!r.current)return;const o=r.current;C.setIcon(o,"refresh-cw")},[r.current]);const a=A.useCallback(async()=>{if(!(t&&n)){if(Tu){const o=Qw(e);await Tu(o)}await Te.fetchAllMemos()}},[]);return w.jsx("span",{className:"refresh-icon",ref:r,onClick:()=>{a(),r&&r.current.firstElementChild.toggleClass("rotate-hidden",!0),setTimeout(()=>{r&&r.current.firstElementChild.toggleClass("rotate-hidden",!1)},1e3)}})},ay=()=>{const{locationState:{query:{filter:e}},globalState:{isMobileView:t},queryState:{queries:n}}=A.useContext(mt),[r,a]=A.useState("THINO");A.useEffect(()=>{const s=Et.getQueryById(e);a(s?s.title:"THINO")},[e,n]);const o=A.useCallback(s=>{s.stopPropagation(),Qe.setShowSiderbarInMobileView(!0)},[]);return w.jsxs("div",{className:"section-header-container memos-header-container",children:[w.jsxs("div",{className:"title-text",children:[w.jsx(so,{when:t,children:w.jsx("button",{ref:s=>{s&&C.setIcon(s,"menu")},className:"btn action-btn clickable-icon",onClick:o})}),w.jsx("span",{className:"normal-text",children:r}),w.jsx(px,{})]}),w.jsxs("div",{className:"memos-header-search-section",children:[w.jsx(D8,{}),w.jsx(b8,{}),w.jsx(mb,{}),w.jsx(Fp,{})]})]})},$J=()=>{const{dailyNotesState:{settings:e,app:t,verifyState:n},globalState:{manifest:r,showSiderbarInMobileView:a,isMobileView:o}}=A.useContext(mt),[s,c]=A.useState("Memos"),[d,p]=A.useState(!1);A.useEffect(()=>{e&&c(e.UserName)},[e]);const m=A.useCallback(()=>{He.pushHistory("/"),He.clearQuery()},[]),g=()=>{const v=document.querySelector(".memos-sidebar-wrapper"),D=document.querySelector(".menu-btns-popup");D.style.top=70-v.scrollTop+"px",p(!0)};return w.jsxs("div",{className:"user-banner-container",children:[w.jsxs("div",{className:"userinfo-header-container",children:[w.jsxs("div",{className:"userinfo-container",onClick:()=>{t.setting.open(),t.setting.openTabById(r.id||"obsidian-memos")},children:[w.jsx("div",{ref:v=>{if(e!=null&&e.MomentsIcon){v==null||v.empty();return}e!=null&&e.MomentsIcon||v&&C.setIcon(v,"Memos")},className:"thino-user-icon",style:{backgroundImage:`url(${e==null?void 0:e.MomentsIcon})`}}),w.jsxs("div",{className:"thino-user-info",children:[w.jsxs("span",{className:"username-container",children:[w.jsx("span",{"aria-label":s==="MEMO 😉"?"THINO 😉":s||"THINO",className:"username-text",onClick:m,children:s==="MEMO 😉"?"THINO 😉":s||"THINO"}),w.jsx("span",{className:`user-pro-badge ${n?"activated":""}`,onClick:()=>{t.setting.open(),t.setting.openTabById(r.id||"obsidian-memos")},children:"PRO"})]}),(e==null?void 0:e.MomentsQuote)&&w.jsx("span",{className:"thino-user-quote",children:e==null?void 0:e.MomentsQuote})]})]}),w.jsxs("span",{className:"btn-group",children:[(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!o&&w.jsx(px,{}),w.jsx("span",{ref:v=>{v&&v.hasChildNodes()||v&&C.setIcon(v,"more-horizontal")},className:"btn action-btn menu-popup-btn",onClick:g}),a&&w.jsx("span",{ref:v=>{v&&v.hasChildNodes()||v&&C.setIcon(v,"x")},className:"btn action-btn",onClick:()=>{Qe.setShowSiderbarInMobileView(!1)}})]}),w.jsx(a8,{shownStatus:d,setShownStatus:p})]}),w.jsx(E1,{statusType:"banner"})]})},L2=()=>{const{queryState:{queries:e},dailyNotesState:{app:t},locationState:{query:{filter:n}}}=A.useContext(mt),r=af(),[a,o]=A.useState([]);return A.useEffect(()=>{const s=e.filter(c=>{var d,p;return!((d=c.id)!=null&&d.toString().startsWith("Filter [Temp]"))&&!((p=c.id)!=null&&p.toString().includes("Filter [Temp]"))}).sort((c,d)=>{if(d.pinnedAt&&!c.pinnedAt)return 1;if(c.pinnedAt&&!d.pinnedAt)return-1;const p=Ue.getTimeStampByDate(c.pinnedAt||c.createdAt);return Ue.getTimeStampByDate(d.pinnedAt||d.createdAt)-p});o(s)},[e]),A.useEffect(()=>{Et.getMyAllQueries().catch(()=>{}).finally(()=>{r.setFinish()})},[t]),w.jsxs("div",{className:"queries-wrapper",children:[w.jsxs("span",{className:"title-text",children:[w.jsx("span",{className:"normal-text",children:N("QUERY")}),w.jsx("span",{ref:s=>{s&&C.setIcon(s,"plus")},className:"btn create-query-btn",onClick:()=>Xw()})]}),w.jsx(so,{when:r.isSucceed&&a.length===0,children:w.jsx("div",{className:"create-query-btn-container",children:w.jsx("span",{className:"btn",onClick:()=>Xw(),children:N("CREATE FILTER")})})}),w.jsx("div",{className:"queries-container",children:a.map(s=>w.jsx(GJ,{query:s,isActive:s.id===n},`${s.id}-${C.moment(s.createdAt,"YYYY/MM/DD HH:mm:ss").format("x")}`))})]})},GJ=e=>{const{query:t,isActive:n}=e,[r,a]=ki(!1),[o,s]=ki(!1),c=()=>{He.setMemoFilter(n?"":t.id)},d=T=>{T.stopPropagation(),a()},p=()=>{a(!1)},m=async T=>{if(T.stopPropagation(),o)try{await Et.deleteQuery(t.id)}catch(E){new C.Notice(E.message)}else s()},g=T=>{T.stopPropagation(),Xw(t.id)},v=async T=>{T.stopPropagation();try{t.pinnedAt?await Et.unpinQuery(t.id):await Et.pinQuery(t.id),Et.editQuery({...t,pinnedAt:t.pinnedAt?"":Ue.getDateTimeString(Date.now())})}catch(E){console.error(E)}},D=()=>{s(!1)},S=A.useMemo(()=>w.jsxs("div",{className:"action-btns-container",children:[w.jsxs("span",{className:"btn",onClick:v,children:[w.jsx("span",{ref:T=>{T&&C.setIcon(T,t.pinnedAt?"pin-off":"pin")},className:"icon-text"}),w.jsx("span",{className:"normal-text",children:t.pinnedAt?N("UNPIN"):N("PIN")})]}),w.jsxs("span",{className:"btn",onClick:g,children:[w.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&C.setIcon(T,"edit")},className:"icon-text"}),w.jsx("span",{className:"normal-text",children:N("EDIT")})]}),w.jsxs("span",{className:`btn delete-btn ${o?"final-confirm":""}`,onClick:m,onMouseLeave:D,children:[w.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&C.setIcon(T,"trash-2")},className:"icon-text"}),w.jsx("span",{className:"normal-text",children:N(o?"CONFIRM":"DELETE")})]})]}),[t.pinnedAt,o]);return w.jsx(w.Fragment,{children:w.jsxs("div",{className:`query-item-container ${n?"active":""}`,onClick:c,children:[w.jsxs("div",{className:"query-text-container",children:[w.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&C.setIcon(T,"filter")},className:"icon-text"}),w.jsxs("span",{className:"query-text",children:[t.title,t.pinnedAt&&" 📌"]})]}),w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{ref:T=>{T&&!T.hasChildNodes()&&C.setIcon(T,"more-horizontal")},className:"btn action-btn toggle-btn",onClick:d}),w.jsx("div",{className:`action-btns-wrapper ${r?"":"hidden"}`,onMouseLeave:p,children:S})]})]})})},R2=()=>{var v,D;const{locationState:{query:{tag:e,filter:t}},dailyNotesState:{app:n},memoState:{tags:r,tagsNum:a,memos:o}}=A.useContext(mt),s=t&&((v=t==null?void 0:t.toString())==null?void 0:v.startsWith("Filter [Temp] "))&&Et.getQueryById(t),[c,d]=A.useState([]),[p,m]=A.useState(((D=n||app)==null?void 0:D.loadLocalStorage("thino-tag-sort-order"))||"alphabetical");A.useEffect(()=>{var T;const S=(T=n||app)==null?void 0:T.loadLocalStorage("thino-temp-tags");d(S||[])},[]),A.useEffect(()=>{Te.updateTagsState()},[o]),A.useEffect(()=>{const S=Array.from(r).sort(),T={subTags:[]};for(const E of S){const O=E.split("/");let k=T,j="";for(let F=0;F<O.length;F++){const B=O[F];j+=F===0?B:"/"+B;let R=k.subTags.find(z=>z.text===j);if(R||(R={key:B,text:j,count:a[j]||0,subTags:[],parent:k},k.subTags.push(R)),F===O.length-1){let z=R.parent;for(;z;)z.count||(z.count=0),z.count+=a[j]||0,z=z.parent}k=R}}d(T.subTags)},[r]),A.useEffect(()=>{var S;Te.initialized&&((S=n||app)==null||S.saveLocalStorage("thino-temp-tags",c))},[c]);const g=S=>{S.stopPropagation();const T=new C.Menu;for(const E of["alphabetical","alphabeticalReverse","byCount","byCountReverse"])T.addItem(O=>{O.setTitle(N(E)).onClick(()=>{m(E),n==null||n.saveLocalStorage("thino-tag-sort-order",E)}).setChecked(p===E)}),E==="alphabeticalReverse"&&T.addSeparator();T.showAtMouseEvent(S.nativeEvent)};return w.jsxs("div",{className:"tags-wrapper",children:[w.jsxs("div",{className:"tags-header title-text",children:[w.jsx("span",{className:"normal-text",children:N("Frequently Used Tags")}),w.jsx("span",{ref:S=>{S&&C.setIcon(S,"arrow-down-narrow-wide")},className:"tags-sort-btn",onClick:g})]}),w.jsxs("div",{className:"tags-container",children:[c.sort(qJ(p)).map((S,T)=>w.jsx(mx,{tag:S,tagQuery:e,filterQuery:s},S.text+"-"+T)),w.jsx(so,{when:c.length<5&&Te.initialized,children:w.jsxs("span",{className:"tag-tip-container",children:[N("Input")," ",w.jsxs("span",{className:"code-text",children:[N("#Tag")," "]}),N("to create tag"),"..."]})})]})]})},mx=e=>{const{tag:t,tagQuery:n,filterQuery:r}=e,a=n===t.text||r&&JSON.parse(r.querystring).find(m=>m.type==="TAG"&&m.value.value===t.text),o=t.subTags.length>0,[s,c]=ki(!1),d=async m=>{var g;if(m.ctrlKey||m.metaKey){const{verifyState:v}=Xe.getState(),D=!C.Platform.isDesktop&&await((g=window.Capacitor)==null?void 0:g.Plugins.Device.getId()),S=C.Platform.isDesktop?await vn():D.identifier||D.uuid;if(!(v&&(v==null?void 0:v.appId)===S)){qt();return}const E=He.getState().query.filter;if(E&&(E!=null&&E.startsWith("Filter [Temp] "))){const k=Et.getQueryById(E).querystring,j=JSON.parse(k);let F;if(j.some(B=>B.type==="TAG"&&B.value.value===t.text)){if(F=j.filter(R=>R.value.value!==t.text),F.length===0){He.setMemoFilter("");return}const B=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...F[0],relation:"AND"},...F.slice(1)]));Et.pushQuery(B),He.setMemoFilter(B.id)}else{F=[...j,{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"OR"}];const B=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify(F));Et.pushQuery(B),He.setMemoFilter(B.id)}}else if(n){He.setTagQuery("");const O=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:"TAG",value:{value:n,operator:"CONTAIN"},relation:"AND"},{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"OR"}]));Et.pushQuery(O),He.setMemoFilter(O.id)}else if(!n){const O=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{type:"TAG",value:{value:t.text,operator:"CONTAIN"},relation:"AND"}]));Et.pushQuery(O),He.setMemoFilter(O.id)}Ue.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(He.getState().pathname)||He.setPathname("/");return}if(a){if(He.setTagQuery(""),r){const D=JSON.parse(r.querystring).filter(T=>T.value.value!==t.text);if(D.length===0){He.setMemoFilter("");return}const S=Et.createTempQuery(`Filter [Temp] ${Math.random().toString(36).substring(7)}`,JSON.stringify([{...D[0],relation:"AND"},...D.slice(1)]));Et.pushQuery(S),He.setMemoFilter(S.id)}}else await Ue.copyTextToClipboard(`#${t.text} `),["/","/recycle","/archive","/daily"].includes(He.getState().pathname)||He.setPathname("/"),He.setTagQuery(t.text)},p=m=>{m.stopPropagation(),c()};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:`tag-item-container ${a?"active":""}`,onClick:d,children:[w.jsxs("div",{className:"tag-text-container",children:[w.jsx("span",{ref:m=>{m&&C.setIcon(m,"hash")},className:"btn tag-btn"}),w.jsx("span",{className:"tag-text",children:t.key})]}),w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{className:"tag-count",children:t.count}),o?w.jsx("span",{ref:m=>{m&&C.setIcon(m,"chevron-right")},className:`btn action-btn toggle-btn ${s?"shown":""}`,onClick:p}):null]})]}),o?w.jsx("div",{className:`subtags-container ${s?"":"hidden"}`,children:t.subTags.map((m,g)=>w.jsx(mx,{tag:m,tagQuery:n},m.text+"-"+g))}):null]})},B2=new Intl.Collator(void 0,{usage:"sort",sensitivity:"base",numeric:!0}).compare,aw={alphabetical:(e,t)=>B2(e.text,t.text),alphabeticalReverse:(e,t)=>-B2(e.text,t.text),byCount:(e,t)=>t.count-e.count,byCountReverse:(e,t)=>e.count-t.count},qJ=(e="byCount")=>aw.hasOwnProperty(e)?aw[e]:aw.alphabetical,_2=()=>{const{dailyNotesState:{app:e,settings:t,verifyState:n}}=A.useContext(mt),r=[{name:N("Random Review"),path:"/review",iconID:"star"},{name:N("ARCHIVE"),path:"/archive",iconID:"archive"},{name:N("Recycle bin"),path:"/recycle",iconID:"recycle"}],a=A.useRef([]);return A.useEffect(()=>{a.current.forEach((o,s)=>{o&&C.setIcon(o,r[s].iconID)})},[t,a]),w.jsx(w.Fragment,{children:w.jsx("div",{className:"path-entry-wrapper",children:r.map((o,s)=>w.jsx(w.Fragment,{children:w.jsxs("div",{className:`path-entry-container ${He.getState().pathname===o.path?"active":""} ${t.DeleteThinoDirectly&&o.path==="/recycle"?"hidden":""} ${o.path==="/review"&&"pro"}`,onClick:async()=>{var p;const c=!C.Platform.isDesktop&&await((p=window.Capacitor)==null?void 0:p.Plugins.Device.getId()),d=C.Platform.isDesktop?await vn():c.identifier||c.uuid;if(!n&&(n==null?void 0:n.appId)!==d&&o.path==="/review"){qt();return}if(He.setPathname(o.path),o.path==="/review"&&He.getState().pathname==="/review"){e.workspace.trigger("refresh-review-memos");return}He.clearQuery()},children:[w.jsx("span",{ref:c=>a.current[s]=c,className:"path-entry-icon"}),w.jsx("span",{className:"path-entry-text",children:o.name})]},s)}))})})},H2=e=>{const{dailyNotesState:{settings:t},locationState:n,globalState:{isMobileView:r,showSiderbarInMobileView:a}}=A.useContext(mt),o=A.useRef(null),s=A.useMemo(()=>c=>{var p,m,g;const d=Qe.getState().showSiderbarInMobileView;if(!d){window.removeEventListener("click",s,{capture:!0});return}(p=o.current)!=null&&p.contains(c.target)||(g=(m=o.current)==null?void 0:m.parentNode)!=null&&g.contains(c.target)&&(d&&c.stopPropagation(),Qe.setShowSiderbarInMobileView(!1),window.removeEventListener("click",s,{capture:!0}))},[]);return A.useEffect(()=>{Qe.setShowSiderbarInMobileView(!1)},[n]),A.useEffect(()=>{a?document.body.classList.add(Zb):document.body.classList.remove(Zb)},[a]),A.useEffect(()=>{r&&a&&window.addEventListener("click",s,{capture:!0})},[r,a]),w.jsxs("aside",{className:Xn("memos-sidebar-wrapper",e.className),ref:o,children:[e.children,w.jsx($J,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?w.jsx(gp,{}):null:w.jsx(gp,{}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="left"?w.jsxs(w.Fragment,{children:[w.jsx(_2,{}),w.jsx(L2,{}),w.jsx(E1,{statusType:"sidebar"})]}):null:w.jsxs(w.Fragment,{children:[w.jsx(_2,{}),w.jsx(L2,{})]}),(t==null?void 0:t.DefaultThemeForThino)==="modern"&&!r?(e==null?void 0:e.sidebarPosition)==="right"?w.jsx(w.Fragment,{children:w.jsx(R2,{})}):null:w.jsx(w.Fragment,{children:w.jsx(R2,{})})]})},JJ=()=>{const{dailyNotesState:{settings:e}}=A.useContext(mt),[t,n]=$.useState(""),r=a=>{n(a.target.value)};return w.jsx("div",{className:"locked-screen-wrapper",children:w.jsxs("div",{className:"locked-screen-content",children:[w.jsx("div",{className:"locked-screen-header",children:w.jsx("div",{className:"locked-screen-header-title",children:N("Locked")})}),w.jsx("div",{className:"locked-screen-body",children:w.jsxs("div",{className:"locked-screen-body-content",children:[w.jsxs("div",{className:"locked-screen-body-content-text",children:[w.jsx("div",{className:"locked-screen-body-content-text-title",children:N("Thino is locked")}),w.jsx("div",{className:"locked-screen-body-content-text-desc",children:N("Please unlock Thino by input password")})]}),w.jsxs("div",{className:"locked-screen-body-content-inputer",children:[w.jsx("input",{onKeyDown:a=>{a.key==="Enter"&&((e==null?void 0:e.password)===t?Qe.setLocked(!1):new C.Notice(N("Password is incorrect")))},onChange:r,value:t,type:"password",className:"locked-screen-body-content-input"}),w.jsx("button",{className:"locked-screen-body-content-btn",onClick:()=>{(e==null?void 0:e.password)===t?Qe.setLocked(!1):new C.Notice(N("Password is incorrect"))},children:N("Unlock")})]})]})})]})})};function KJ(){const{dailyNotesState:{settings:e,verifyState:t},locationState:{pathname:n},globalState:{isMobileView:r,memoListView:a,globalEditorShown:o,locked:s}}=A.useContext(mt),c=A.useRef(null);return A.useEffect(()=>{if(!e.needVerify){Qe.setLocked(!1);return}Qe.setLocked(!0)},[e==null?void 0:e.needVerify]),A.useEffect(()=>{if(!c.current)return;(async()=>{var g;const p=!C.Platform.isDesktop&&await((g=window.Capacitor)==null?void 0:g.Plugins.Device.getId()),m=C.Platform.isDesktop?await vn():p.identifier||p.uuid;!t||(t==null?void 0:t.appId)!==m?c.current.toggleClass("hide-pro",!0):c.current.toggleClass("hide-pro",!1)})()},[t,c.current]),w.jsxs(w.Fragment,{children:[s&&w.jsx(JJ,{}),!s&&o&&w.jsx(Nu,{editorType:"block"}),!s&&!o&&w.jsx("section",{ref:c,id:"page-wrapper","data-path":n,className:Xn(`memos-${n==="/"?a:"list"}-view`,(e==null?void 0:e.DefaultThemeForThino)==="modern"?"modern":"classic"),children:w.jsxs(w.Fragment,{children:[w.jsx(H2,{sidebarPosition:"left",className:"left-sidebar"}),w.jsx("main",{className:"content-wrapper",children:hK(n)}),(e==null?void 0:e.DefaultThemeForThino)==="modern"&&!r?w.jsx(H2,{sidebarPosition:"right",className:"right-sidebar"}):null]})})]})}const QJ={"*":w.jsx(KJ,{})},XJ=e=>{const{memo:t,handleDeletedMemoAction:n}=e,{dailyNotesState:r}=A.useContext(mt),a={...t,createdAtStr:Ue.getDateTimeString(t.createdAt),deletedAtStr:Ue.getDateTimeString(t.deletedAt||t.createdAt)},o=$.useRef(null),s=$.useRef(null),[c,d]=$.useState(""),[p,m]=ki(!1),g={restore:A.useRef(null),delete:A.useRef(null),source:A.useRef(null)};A.useEffect(()=>{s&&(C.setIcon(g.restore.current,"archive-restore"),C.setIcon(g.delete.current,"trash"),C.setIcon(g.source.current,"home"))},[s]),A.useEffect(()=>{if(!o.current||!s.current||o.current.hasChildNodes()&&t.content===c||!r.view)return;const E=r.view;d(t.content),o.current.hasChildNodes()&&o.current.empty();async function O(){var j;await C.MarkdownRenderer.render(r.app,t.content+`
`,o.current,t.path,E);const k=(j=o.current)==null?void 0:j.querySelectorAll(".internal-link");k==null||k.forEach(F=>{const B=F,R=B.getAttribute("data-href");if(!R)return;r.app.metadataCache.getFirstLinkpathDest(R,t.path)||F.classList.add("is-unresolved"),B.addEventListener("mouseover",H=>{H.stopPropagation(),r.app.workspace.trigger("hover-link",{event:H,source:"thino",hoverParent:E.containerEl,targetEl:B,linktext:R,sourcePath:B.href})})})}O()},[t.content,s]);const v=async()=>{if(p)try{await Te.deleteMemoById(a.id),n(a.id)}catch(E){new C.Notice(E.message)}else m()},D=async()=>{switch(a.sourceType){case"DAILY":await w1(a.id,a.path);break;case"CANVAS":await D1(a.id,a.path);break;case"MULTI":await v1(a.path);break;case"FILE":await b1(a.id,a.path);break}},S=async()=>{try{const E=await Te.restoreMemoById(a.id),O=r.app,k=O==null?void 0:O.loadLocalStorage("tokenForSync");E&&E.webId&&k&&r.settings.startSync&&await BT(E.webId),E&&Te.editMemo(E),n(a.id),new C.Notice(N("RESTORE SUCCEED"))}catch(E){new C.Notice(E.message)}},T=()=>{p&&m(!1)};return w.jsxs("div",{ref:s,className:`memo-wrapper ${"memos-"+a.id}`,onMouseLeave:T,children:[w.jsxs("div",{className:"memo-top-wrapper",children:[w.jsxs("span",{className:"time-text",children:[N("DELETE AT")," ",a.deletedAtStr]}),w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{ref:E=>{E&&C.setIcon(E,"more-horizontal")},className:"btn more-action-btn"}),w.jsx("div",{className:"more-action-btns-wrapper",children:w.jsxs("div",{className:"more-action-btns-container",children:[w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:g.restore,className:"more-action-item-icon"}),w.jsx("span",{className:"btn restore-btn",onClick:S,children:N("RESTORE")})]}),w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:g.source,className:"more-action-item-icon"}),w.jsx("span",{className:"btn",onClick:D,children:N("SOURCE")})]}),w.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[w.jsx("span",{ref:g.delete,className:"more-action-item-icon"}),w.jsx("span",{className:`btn delete-btn ${p?"final-confirm":""}`,onClick:v,children:N(p?"CONFIRM":"DELETE")})]})]})})]})]}),w.jsx("div",{ref:o,className:"memo-content-text",onContextMenu:E=>{E.preventDefault(),E.stopPropagation()}})]})},eK=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:c}=t,d=Et.getQueryById(c);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(m=>{let g=!0;if(m.thinoType!==void 0&&n&&m.thinoType==="TASK-DONE"&&(g=!1),m.content.contains("comment:")&&(g=!1),d){const v=JSON.parse(d.querystring);Array.isArray(v)&&(g=Wd(m,v))}if(r){const v=new Set;for(const D of Array.from(m.content.match(Fn)||[])){const T=D.replace(Fn,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match(mr)||[])){const T=D.replace(mr,"$2").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}v.has(r)||(g=!1)}return a&&a.from<a.to&&(Ue.getTimeStampByDate(m.createdAt)<a.from||Ue.getTimeStampByDate(m.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(m.content.match(Fn)!==null||m.content.match(mr)!==null||m.content.match($n)!==null)||o==="LINKED"&&m.content.match(Bu)===null||o==="IMAGED"&&m.content.match(_u)===null||o==="CONNECTED"&&m.content.match(Il)===null)&&(g=!1),s&&!m.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(m=>!m.content.contains("comment:"))},tK=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=A.useContext(mt),r=af(),[a,o]=A.useState([]),s=$.useRef(null);A.useEffect(()=>{const p=eK({memos:n.filter(m=>m.deletedAt!==""&&m.deletedAt),query:e,HideDoneTasks:!1});o(p),r.setFinish()},[n,s.current,e]);const c=A.useCallback(p=>{o(m=>m.filter(g=>g.id!==p))},[]),d=A.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return w.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[w.jsxs("div",{className:"section-header-container",children:[w.jsxs("div",{className:"title-text",children:[w.jsx(so,{when:t,children:w.jsx("button",{ref:p=>{p&&C.setIcon(p,"menu")},className:"btn action-btn clickable-icon",onClick:d})}),w.jsxs("span",{className:"go-home-btn",onClick:()=>{He.clearQuery(),He.setPathname("/")},children:["🏠 ",N("Return To Home Page")]})]}),w.jsx(Fp,{})]}),w.jsx(Rp,{thinosCount:a.length,thinos:a}),r.isLoading?w.jsx("div",{className:"tip-text-container",children:w.jsx("span",{className:"tip-text",children:N("Fetching data...")})}):a.length===0?w.jsx("div",{className:"tip-text-container",children:w.jsx("span",{className:"tip-text",children:N("Here is No Memos.")})}):w.jsx("div",{className:"deleted-memos-container",children:a.map(p=>w.jsx(XJ,{memo:p,handleDeletedMemoAction:c},`${p.id}-${p.updatedAt}`))})]})},zg="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20height='24px'%20viewBox='0%200%2024%2024'%20width='24px'%20fill='currentColor'%3e%3cpath%20d='M0%200h24v24H0V0z'%20fill='none'/%3e%3cpath%20d='M19%203H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2zm0%2016H5V5h14v14zM17.99%209l-1.41-1.42-6.59%206.59-2.58-2.57-1.42%201.41%204%203.99z'/%3e%3c/svg%3e",Ug="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20width='24'%20height='24'%20fill='currentColor'%20viewBox='0%200%2024%2024'%3e%3cpath%20fill='none'%20d='M0%200h24v24H0V0z'/%3e%3cpath%20d='M19%205v14H5V5h14m0-2H5c-1.1%200-2%20.9-2%202v14c0%201.1.9%202%202%202h14c1.1%200%202-.9%202-2V5c0-1.1-.9-2-2-2z'/%3e%3c/svg%3e",nK=()=>{const{globalState:e}=A.useContext(mt),{useTinyUndoHistoryCache:t,shouldHideImageUrl:n,shouldSplitMemoWord:r,shouldUseMarkdownParser:a}=e,o=`👋 你好呀欢迎使用memos!
* ✨ **开源项目**
* 😋 精美且细节的视觉样式;
* 📑 体验优良的交互逻辑;`,s=()=>{Qe.setAppSetting({useTinyUndoHistoryCache:!t})},c=()=>{Qe.setAppSetting({shouldSplitMemoWord:!r})},d=()=>{Qe.setAppSetting({shouldHideImageUrl:!n})},p=()=>{Qe.setAppSetting({shouldUseMarkdownParser:!a})},m=async()=>{const g=Te.getState().memos.map(S=>({...S})),v=JSON.stringify(g),D=document.createElement("a");D.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(v)),D.setAttribute("download","data.json"),D.style.display="none",document.body.appendChild(D),D.click(),document.body.removeChild(D)};return w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"section-container preferences-section-container",children:[w.jsx("p",{className:"title-text",children:"Memo 显示相关"}),w.jsx("div",{className:"demo-content-container memo-content-text",dangerouslySetInnerHTML:{__html:pw(o)}}),w.jsxs("label",{className:"form-label checkbox-form-label",onClick:c,children:[w.jsx("span",{className:"normal-text",children:"中英文内容自动间隔"}),w.jsx("img",{className:"icon-img",src:r?zg:Ug})]}),w.jsxs("label",{className:"form-label checkbox-form-label",onClick:p,children:[w.jsx("span",{className:"normal-text",children:"部分 markdown 格式解析"}),w.jsx("img",{className:"icon-img",src:a?zg:Ug})]}),w.jsxs("label",{className:"form-label checkbox-form-label",onClick:d,children:[w.jsx("span",{className:"normal-text",children:"隐藏图片链接地址"}),w.jsx("img",{className:"icon-img",src:n?zg:Ug})]})]}),w.jsxs("div",{className:"section-container preferences-section-container",children:[w.jsx("p",{className:"title-text",children:"编辑器"}),w.jsxs("label",{className:"form-label checkbox-form-label",onClick:s,children:[w.jsxs("span",{className:"normal-text",children:["启用"," ",w.jsx("a",{target:"_blank",href:"https://github.com/boojack/tiny-undo",onClick:g=>g.stopPropagation(),rel:"noreferrer",children:"tiny-undo"})]}),w.jsx("img",{className:"icon-img",src:t?zg:Ug})]})]}),w.jsxs("div",{className:"section-container hidden",children:[w.jsx("p",{className:"title-text",children:"其他"}),w.jsx("div",{className:"btn-container",children:w.jsx("button",{className:"btn export-btn",onClick:m,children:"导出数据(JSON)"})})]})]})},rK=()=>{const{globalState:{isMobileView:e}}=A.useContext(mt);A.useEffect(()=>{Te.fetchAllMemos()},[]);const t=A.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return w.jsxs("div",{className:"preference-wrapper",children:[w.jsx("div",{className:"section-header-container",children:w.jsxs("div",{className:"title-text",children:[w.jsx(so,{when:e,children:w.jsx("button",{className:"action-btn",onClick:t})}),w.jsx("span",{className:"normal-text",children:"账号与设置"})]})}),w.jsx("div",{className:"sections-wrapper",children:w.jsx(nK,{})})]})},aK=e=>{const{dailyNotesState:{app:t,settings:n,view:r}}=A.useContext(mt),{memo:a,handleUnarchivedMemoAction:o}=e,s=$.useRef(null),c=$.useRef(null),[d,p]=$.useState(""),m={...a,createdAtStr:Ue.getDateTimeString(a.createdAt),deletedAtStr:Ue.getDateTimeString(a.deletedAt||a.createdAt)},[g,v]=ki(!1),D={restore:A.useRef(null),delete:A.useRef(null),source:A.useRef(null)};A.useEffect(()=>{c&&(C.setIcon(D.restore.current,"archive-restore"),C.setIcon(D.delete.current,"trash"),C.setIcon(D.source.current,"home"))},[c]),A.useEffect(()=>{if(!s.current||!c.current||s.current.hasChildNodes()&&a.content===d||!r)return;p(a.content),s.current.hasChildNodes()&&s.current.empty();async function k(){var F,B;(F=s.current)==null||F.toggleClass(["markdown-rendered"],!0),await C.MarkdownRenderer.render(t,a.content+`
`,s.current,a.path,r);const j=(B=s.current)==null?void 0:B.querySelectorAll(".internal-link");j==null||j.forEach(R=>{const z=R,H=z.getAttribute("data-href");if(!H)return;t.metadataCache.getFirstLinkpathDest(H,a.path)||R.classList.add("is-unresolved"),z.addEventListener("mouseover",U=>{U.stopPropagation(),t.workspace.trigger("hover-link",{event:U,source:"thino",hoverParent:r.containerEl,targetEl:z,linktext:H,sourcePath:z.href})})})}k()},[a.content,c]);const S=async()=>{switch(m.sourceType){case"DAILY":await w1(m.id,m.path);break;case"CANVAS":await D1(m.id,m.path);break;case"MULTI":await v1(m.path);break;case"FILE":await b1(m.id,m.path);break}},T=async()=>{if(g)try{if(n.DeleteThinoDirectly)await Te.deleteMemoById(m.id);else{const k=await Te.hideMemoById(m.id);k&&Te.editMemo(k)}}catch(k){new C.Notice(k.message)}else v()},E=async()=>{try{const k=await Te.unarchiveMemo(m);k&&Te.editMemo(k),o(m.id),new C.Notice(N("RESTORE SUCCEED"))}catch(k){new C.Notice(k.message)}},O=()=>{g&&v(!1)};return w.jsxs("div",{ref:c,className:`memo-wrapper ${"memos-"+m.id}`,onMouseLeave:O,children:[w.jsxs("div",{className:"memo-top-wrapper",children:[w.jsxs("span",{className:"time-text",children:[N("ARCHIVED AT")," ",m.updatedAt]}),w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{ref:k=>{k&&C.setIcon(k,"more-horizontal")},className:"btn more-action-btn"}),w.jsx("div",{className:"more-action-btns-wrapper",children:w.jsxs("div",{className:"more-action-btns-container",children:[w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:D.restore,className:"more-action-item-icon"}),w.jsx("span",{className:"btn restore-btn",onClick:E,children:N("RESTORE")})]}),w.jsxs("div",{className:"more-action-menu-item",children:[w.jsx("span",{ref:D.source,className:"more-action-item-icon"}),w.jsx("span",{className:"btn",onClick:S,children:N("SOURCE")})]}),w.jsxs("div",{className:"more-action-menu-item delete-menu-item",children:[w.jsx("span",{ref:D.delete,className:"more-action-item-icon"}),w.jsx("span",{className:`btn delete-btn ${g?"final-confirm":""}`,onClick:T,children:N(g?"CONFIRM":"DELETE")})]})]})})]})]}),w.jsx("div",{ref:s,className:"memo-content-text"})]})},oK=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:c}=t,d=Et.getQueryById(c);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(m=>{let g=!0;if(m.thinoType!==void 0&&n&&m.thinoType==="TASK-DONE"&&(g=!1),m.content.contains("comment:")&&(g=!1),d){const v=JSON.parse(d.querystring);Array.isArray(v)&&(g=Wd(m,v))}if(r){const v=new Set;for(const D of Array.from(m.content.match(Fn)||[])){const T=D.replace(Fn,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match(mr)||[])){const T=D.replace(mr,"$2").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}v.has(r)||(g=!1)}return a&&a.from<a.to&&(Ue.getTimeStampByDate(m.createdAt)<a.from||Ue.getTimeStampByDate(m.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(m.content.match(Fn)!==null||m.content.match(mr)!==null||m.content.match($n)!==null)||o==="LINKED"&&m.content.match(Bu)===null||o==="IMAGED"&&m.content.match(_u)===null||o==="CONNECTED"&&m.content.match(Il)===null)&&(g=!1),s&&!m.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(m=>!m.content.contains("comment:"))},iK=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n}}=A.useContext(mt),r=af(),[a,o]=A.useState([]),s=$.useRef(null);A.useEffect(()=>{const m=oK({memos:n.filter(g=>g.rowStatus==="ARCHIVED"&&g.deletedAt===""),query:e,HideDoneTasks:!1});o(m),r.setFinish()},[n,s.current,e]);const c=A.useCallback(m=>{o(g=>g.filter(v=>v.id!==m))},[]),d=A.useCallback(m=>{o(g=>g.filter(v=>v.id!==m))},[]),p=A.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]);return w.jsxs("div",{className:"memo-trash-wrapper",ref:s,children:[w.jsxs("div",{className:"section-header-container",children:[w.jsxs("div",{className:"title-text",children:[w.jsx(so,{when:t,children:w.jsx("button",{ref:m=>{m&&C.setIcon(m,"menu")},className:"btn action-btn clickable-icon",onClick:p})}),w.jsxs("span",{className:"go-home-btn",onClick:()=>{He.clearQuery(),He.setPathname("/")},children:["🏠 ",N("Return To Home Page")]})]}),w.jsx(Fp,{})]}),w.jsx(Rp,{thinosCount:a.length,thinos:a}),r.isLoading?w.jsx("div",{className:"tip-text-container",children:w.jsx("p",{className:"tip-text",children:N("Fetching data...")})}):a.length===0?w.jsx("div",{className:"tip-text-container",children:w.jsx("p",{className:"tip-text",children:N("Here is No Memos.")})}):w.jsx("div",{className:"deleted-memos-container",children:a.map(m=>w.jsx(aK,{memo:m,handleUnarchivedMemoAction:d,handleDeletedMemoAction:c},`${m.id}-${m.updatedAt}`))})]})},sK=()=>{const{dailyNotesState:{app:e},locationState:{query:t},globalState:{isMobileView:n,changedByMemos:r},memoState:{memos:a}}=A.useContext(mt),o=af(),[s,c]=A.useState([]),[d,p]=A.useState([]),m=$.useRef(null),g=$.useRef(null),[v,D]=A.useState(!1),[S,T]=A.useState([]),E=$.useRef([]),O=A.useCallback(({memos:F,query:B,HideDoneTasks:R})=>{const{tag:z,duration:H,type:Y,text:U,filter:J}=B,Q=Et.getQueryById(J);return!!(z||H&&H.from<H.to||Y||U||Q)||Q||R?F.filter(pe=>{let ie=!0;if(pe.thinoType!==void 0&&R&&pe.thinoType==="TASK-DONE"&&(ie=!1),pe.content.contains("comment:")&&(ie=!1),Q){const se=JSON.parse(Q.querystring);Array.isArray(se)&&(ie=Wd(pe,se))}if(z){const se=new Set;for(const fe of Array.from(pe.content.match(Fn)||[])){const we=fe.replace(Fn,"$1").trim().split("/");let Z="";for(const G of we)Z+=G,se.add(Z),Z+="/"}for(const fe of Array.from(pe.content.match($n)||[])){const we=fe.replace($n,"$1").trim().split("/");let Z="";for(const G of we)Z+=G,se.add(Z),Z+="/"}for(const fe of Array.from(pe.content.match(mr)||[])){const we=fe.replace(mr,"$2").trim().split("/");let Z="";for(const G of we)Z+=G,se.add(Z),Z+="/"}se.has(z)||(ie=!1)}return H&&H.from<H.to&&(Ue.getTimeStampByDate(pe.createdAt)<H.from||Ue.getTimeStampByDate(pe.createdAt)>H.to)&&(ie=!1),Y&&(Y==="NOT_TAGGED"&&(pe.content.match(Fn)!==null||pe.content.match($n)!==null)||Y==="LINKED"&&pe.content.match(Bu)===null||Y==="IMAGED"&&pe.content.match(_u)===null||Y==="CONNECTED"&&pe.content.match(Il)===null)&&(ie=!1),U&&!pe.content.toLowerCase().includes(U.toLowerCase())&&(ie=!1),ie}):F},[]);A.useEffect(()=>{g.current&&(C.setIcon(g.current,"refresh-cw"),e.workspace.on("refresh-review-memos",j))},[g]),A.useEffect(()=>{if(!v)return;if(t){const R=[...O({memos:a,query:t,HideDoneTasks:!1})].sort(()=>Math.random()-Math.random()).slice(0,10);c(R),D(!1);return}const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);c(F),D(!1)},[v]),A.useEffect(()=>{if(!(S.length>0))return;const F=[...S].sort(()=>Math.random()-Math.random()).slice(0,10);c(F),D(!1)},[S]),A.useEffect(()=>{m.current&&(T(O({memos:a,query:t,HideDoneTasks:!1}).filter(F=>F.rowStatus!=="ARCHIVED"&&!(F.deletedAt!==""&&F.deletedAt))),o.setFinish(),He.clearQuery())},[a,m.current]),A.useEffect(()=>{if(r&&E.current.length>0){const F=S.filter(R=>E.current.includes(R.id)),B=E.current.map(R=>F.find(z=>z.id===R)).filter(R=>R!==void 0);p(B);return}E.current=s.map(F=>F.id),p(s)},[s]),A.useEffect(()=>{if(s.length===0)return;const F=O({memos:s,query:t,HideDoneTasks:!1});p(F)},[t]);const k=A.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),j=()=>{D(!0)};return w.jsxs("div",{className:"memo-review-wrapper",ref:m,children:[w.jsx("div",{className:"section-header-container",children:w.jsxs("div",{className:"title-wrapper",children:[w.jsxs("div",{className:"title-btns-left-wrapper",children:[w.jsx(so,{when:n,children:w.jsx("button",{ref:F=>{F&&C.setIcon(F,"menu")},className:"btn action-btn clickable-icon",onClick:k})}),w.jsx("span",{ref:g,onClick:j,className:"refresh-icon"})]}),w.jsx("div",{className:"title-btns-right-wrapper",children:w.jsxs("span",{className:"go-home-btn",onClick:()=>{He.setPathname("/")},children:["🏠 ",N("Return To Home Page")]})})]})}),w.jsx(Rp,{}),o.isLoading?w.jsx("div",{className:"tip-text-container",children:w.jsx("span",{className:"tip-text",children:N("Fetching data...")})}):a.length===0?w.jsx("div",{className:"tip-text-container",children:w.jsx("span",{className:"tip-text",children:N("Here is No Memos.")})}):w.jsx("div",{className:"review-memos-container",children:d.map(F=>w.jsx(Sa,{memo:F},`${F==null?void 0:F.id}-${F.createdAt}`))})]})},gx=({memos:e,query:t,HideDoneTasks:n})=>{const{tag:r,duration:a,type:o,text:s,filter:c}=t,d=Et.getQueryById(c);return!!(r||a&&a.from<a.to||o||s||d)||d||n?e.filter(m=>{let g=!0;if(m.thinoType!==void 0&&n&&m.thinoType==="TASK-DONE"&&(g=!1),m.content.contains("comment:")&&(g=!1),d){const v=JSON.parse(d.querystring);Array.isArray(v)&&(g=Wd(m,v))}if(r){const v=new Set;for(const D of Array.from(m.content.match(Fn)||[])){const T=D.replace(Fn,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match($n)||[])){const T=D.replace($n,"$1").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}for(const D of Array.from(m.content.match(mr)||[])){const T=D.replace(mr,"$2").trim().split("/");let E="";for(const O of T)E+=O,v.add(E),E+="/"}v.has(r)||(g=!1)}return a&&a.from<a.to&&(Ue.getTimeStampByDate(m.createdAt)<a.from||Ue.getTimeStampByDate(m.createdAt)>a.to)&&(g=!1),o&&(o==="NOT_TAGGED"&&(m.content.match(Fn)!==null||m.content.match(mr)!==null||m.content.match($n)!==null)||o==="LINKED"&&m.content.match(Bu)===null||o==="IMAGED"&&m.content.match(_u)===null||o==="CONNECTED"&&m.content.match(Il)===null)&&(g=!1),s&&!m.content.toLowerCase().includes(s.toLowerCase())&&(g=!1),g}):e.filter(m=>!m.content.contains("comment:"))},lK=A.forwardRef((e,t)=>{const{currentDate:n,setCurrentDateStamp:r}=e,[a,o]=A.useState(!1),s=Ue.getDateStampByDate(Ue.getDateString(n)),c=A.useRef(null);A.useEffect(()=>{c.current&&(!a&&C.setIcon(c.current,"more-horizontal"),a&&C.setIcon(c.current,"x"))},[c.current,a]);const d=p=>{r(p)};return A.useImperativeHandle(t,()=>({closeDatePicker:()=>{o(!1)}})),w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"date-card-container",children:[w.jsxs("div",{className:"date-container-details",children:[w.jsxs("div",{className:"details-text",children:[C.moment(s,"x").format("dddd")+" ",w.jsx("div",{className:"date-text",children:C.moment(s,"x").format("MMM")+" "+C.moment(s,"x").format("DD")})]}),w.jsx("div",{className:"details-logo-text",children:N("Daily Memos")})]}),w.jsxs("div",{className:"date-container-info",children:[w.jsxs("div",{className:"date-container-info-text",children:["Week ",w.jsx("div",{className:"week-text",children:C.moment(s,"x").format("ww")}),"of ",w.jsx("div",{className:"year-text",children:C.moment(s,"x").format("YYYY")})]}),w.jsx("div",{ref:c,onClick:()=>o(!a)})]})]}),w.jsx(zy,{className:`date-picker ${a?"":"hidden"}`,datestamp:s,handleDateStampChange:d})]})}),uK=({thino:e})=>{const t=A.useCallback(()=>{$d(e)},[]);return w.jsxs("div",{className:"daily-thino-wrapper",children:[w.jsx("div",{className:"time-wrapper",onClick:t,children:w.jsx("span",{className:"normal-text",children:C.moment(e.createdAt,"YYYY/MM/DD HH:mm:ss").format("HH:mm")})}),w.jsx("div",{className:"daily-thino-container",children:w.jsx(Sa,{memo:e})})]})},cK=()=>{const{locationState:{query:e},globalState:{isMobileView:t},memoState:{memos:n},dailyNotesState:{settings:r,app:a}}=A.useContext(mt),o=af(),[s,c]=A.useState([]),[d,p]=A.useState(Ue.getDateStampByDate(Ue.getDateString(C.moment().format("YYYY-MM-DD HH:mm:ss")))),m=A.useRef(),g=A.useRef(null),v=$.useRef(null),D=A.useRef(null),[S,T]=A.useState(!1);A.useEffect(()=>{e.duration&&e.duration.from&&e.duration.to&&p(e.duration.from)},[e.duration]),A.useEffect(()=>{D.current&&(C.setIcon&&D&&!S&&C.setIcon(D.current,"share"),C.setIcon&&D&&S&&C.setIcon(D.current,"chrome"))},[D.current,S]),A.useEffect(()=>{const j=gx({memos:n,query:e,HideDoneTasks:!1}).filter(F=>Ue.getTimeStampByDate(F.createdAt)>=d&&Ue.getTimeStampByDate(F.createdAt)<d+Mi).filter(F=>F.deletedAt==="").sort((F,B)=>Ue.getTimeStampByDate(F.createdAt)-Ue.getTimeStampByDate(B.createdAt));c(j),o.setFinish()},[n,d,v.current,e]);const E=A.useCallback(()=>{Qe.setShowSiderbarInMobileView(!0)},[]),O=async()=>{var k;m.current&&((k=m==null?void 0:m.current)==null||k.closeDatePicker()),T(!0),setTimeout(()=>{if(!g.current){T(!1);return}let j;document.body.hasClass("theme-dark")?j="#232323":j="#eaeaea",Zy(g.current,{backgroundColor:j,pixelRatio:window.devicePixelRatio*2}).then(F=>{if(r!=null&&r.AutoSaveWhenOnMobile&&C.Platform.isMobile){const B=F.split("base64,")[1];Oy(B,"image/png").arrayBuffer().then(async z=>{let H;const Y="png",U=bs();for(const J in U)if(U[J]instanceof C.TFile){H=U[J];break}H!==void 0&&await a.vault.createBinary(await vault.getAvailablePathForAttachments(`Pasted Image ${C.moment().format("YYYYMMDDHHmmss")}`,Y,H),z)})}Wy({imgUrl:F}),T(!1)}).catch(()=>{T(!1)})},0)};return w.jsxs("div",{className:"daily-thinos-list-wrapper",ref:v,children:[w.jsxs("div",{className:"section-header-container",children:[w.jsxs("div",{className:"title-text",children:[w.jsx(so,{when:t,children:w.jsx("button",{ref:k=>{k&&C.setIcon(k,"menu")},className:"btn action-btn clickable-icon",onClick:E})}),w.jsxs("span",{className:"go-home-btn",onClick:()=>{He.clearQuery(),He.setPathname("/")},children:["🏠 ",N("Return To Home Page")]})]}),w.jsxs("div",{className:"header-right-section",children:[w.jsxs("div",{className:"btns-container",children:[w.jsx("span",{ref:k=>{C.setIcon&&k&&C.setIcon(k,"chevron-left")},className:"btn btn-text",onClick:()=>p(k=>k-Mi)}),w.jsx("span",{ref:k=>{C.setIcon&&k&&C.setIcon(k,"chevron-right")},className:"btn btn-text",onClick:()=>p(k=>k+Mi)}),w.jsx("span",{ref:D,className:Xn("btn btn-text share-btn",S?"generating":""),onClick:O})]}),w.jsx(mb,{}),w.jsx(Fp,{})]})]}),w.jsx(Rp,{thinosCount:s.length,thinos:s}),w.jsx("div",{className:"daily-thinos-view-wrapper",children:w.jsxs("div",{ref:g,className:"daily-thinos-view-container",children:[w.jsx(lK,{ref:m,currentDate:new Date(d),setCurrentDateStamp:p}),o.isLoading?w.jsx("div",{className:"tip-text-container",children:w.jsx("p",{className:"tip-text",children:N("Fetching data...")})}):s.length===0?w.jsx("div",{className:"tip-container",children:w.jsx("p",{className:"tip-text",children:N("Noooop!")})}):w.jsx("div",{className:"daily-thinos-list-container",children:s.map(k=>w.jsx(uK,{thino:k},`${k.id}-${k.updatedAt}`))})]})})]})},dK={"/recycle":w.jsx(tK,{}),"/setting":w.jsx(rK,{}),"/archive":w.jsx(iK,{}),"/review":w.jsx(sK,{}),"/daily":w.jsx(cK,{}),"*":w.jsx(_J,{})},yx=e=>t=>{for(const n of Object.keys(e))if(n===t)return e[n];return e["*"]},fK=yx(QJ),hK=yx(dK);function pK({app:e}){const{locationState:{pathname:t},dailyNotesState:{settings:n}}=A.useContext(mt);return A.useEffect(()=>{Te.fetchAllMemos()},[]),!a1()&&!e.plugins.getPlugin("periodic-notes")&&(n!=null&&n.EnabledLocationList.find(r=>r.value==="DAILY"))&&new C.Notice(N("Check if you opened Daily Notes Plugin Or Periodic Notes Plugin")),w.jsx(Bo,{store:Ee,context:mt,children:fK(t)})}function mK(e){const t=e.view.canvas;if(!t||!e.view.file.path.endsWith(".thino.canvas")||t.thinoBtn)return;const n=t.wrapperEl.createDiv({cls:"thino-canvas-menu-btn"}),r=Ap(n);r.render(w.jsx($.StrictMode,{children:w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(gK,{leaf:e})})})),t.thinoBtn=r,Xe.getState().view.appendRoot({root:r,canvas:t})}function gK({leaf:e}){const{memoState:{memos:t},locationState:{query:n}}=A.useContext(mt),r=$.useRef(null),a=$.useRef(null),[o,s]=$.useState(!1),[c,d]=$.useState([]),[p,m]=$.useState([]),{tag:g,duration:v,type:D,text:S,filter:T}=n,E=Et.getQueryById(T),O=!!(g||v&&v.from<v.to||D||S||E);return A.useEffect(()=>{a.current&&C.setIcon(a.current,"eraser")},[a.current]),A.useEffect(()=>{r.current&&C.setIcon(r.current,"Memos")},[r.current]),A.useEffect(()=>{const k=e.view.file.path;d(t.filter(j=>j.sourceType==="CANVAS"&&j.path===k))},[t]),A.useEffect(()=>{if(c.length===0||!n)return;const k=gx({memos:c,query:n,HideDoneTasks:!1});m(k)},[n,c]),A.useEffect(()=>{if(!n)return;const k=new Set(p.map(F=>F.id)),j=Array.from(e.view.canvas.nodes.values());j.forEach(F=>{F.nodeEl.toggleVisibility(!0),e.view.canvas.getEdgesForNode(F).forEach(B=>{var R,z,H;(R=B.lineGroupEl)==null||R.toggleClass("hidden",!1),(z=B.lineStartGroupEl)==null||z.toggleClass("hidden",!1),(H=B.lineEndGroupEl)==null||H.toggleClass("hidden",!1)})}),j.filter(F=>!k.has(F.id)).forEach(F=>{F.nodeEl.toggleVisibility(!1),e.view.canvas.getEdgesForNode(F).forEach(B=>{var R,z,H;(R=B.lineGroupEl)==null||R.toggleClass("hidden",!0),(z=B.lineStartGroupEl)==null||z.toggleClass("hidden",!0),(H=B.lineEndGroupEl)==null||H.toggleClass("hidden",!0)})})},[p]),w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:r,className:"btn-container",onClick:()=>s(!o)}),o&&w.jsxs("div",{className:"thino-canvas-menu",children:[w.jsxs("div",{className:"thino-canvas-filter-group",children:[w.jsx(mb,{}),w.jsx(Fp,{}),O&&w.jsx("div",{ref:a,className:"clear-query",onClick:()=>{He.clearQuery()}})]}),w.jsx(gp,{initThinos:p})]})]})}const _r="thino_view";class yK extends C.EditorSuggest{constructor(n,r){super(n);me(this,"root");me(this,"editor");me(this,"cursor");me(this,"plugin");this.plugin=r,this.suggestEl.toggleClass("thino-date-selector",!0)}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}onTrigger(n,r){const o=r.getLine(n.line)[n.ch-1];return this.checkInMemosView(r)&&o==="@"?(this.cursor=n,this.editor=r,C.Platform.isMobile?(new mE(this.app,"text",s=>{this.selectSuggestion(parseInt(s),new MouseEvent("click"))}).open(),null):{start:{line:n.line,ch:n.ch-1},end:n,query:""}):null}getSuggestions(){return[parseInt(C.moment().startOf("day").format("x"))]}renderSuggestion(n,r){r.empty(),this.root=Lo.createRoot(r),this.root.render(w.jsx($.StrictMode,{children:w.jsx(zy,{className:"editor-date-picker",datestamp:n,handleDateStampChange:this.selectSuggestion.bind(this)})}))}selectSuggestion(n,r){var c,d,p;if(r instanceof KeyboardEvent||r instanceof PointerEvent&&!r.target.closest(".day-item"))return;const a=(c=this.app.workspace.getLeavesOfType("thino_view")[0])==null?void 0:c.view;(d=a==null?void 0:a.contentEl.find(".action-btn.list-or-task.list"))==null||d.click();let o="",s="";switch(this.plugin.settings.InsertDateFormat){case"Dataview":o="[due::",s="]";break;case"Tasks":o="📆";break}this.editor.replaceRange(o+C.moment(n).format("YYYY-MM-DD")+s,{line:this.cursor.line,ch:this.cursor.ch-1},this.cursor),(p=this.root)==null||p.unmount(),this.close()}}class vK extends C.EditorSuggest{constructor(n,r){super(n);me(this,"root");me(this,"editor");me(this,"cursor");me(this,"plugin");me(this,"memos",[]);this.plugin=r,this.memos=Te.getState().memos.filter(a=>!a.deletedAt&&a.rowStatus!=="ARCHIVED")}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=C.prepareFuzzySearch(n);return r.map(o=>{const s=a(o.content);return s?{item:o,match:s}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r))return null;const o=r.getLine(n.line).slice(0,n.ch);if(o.lastIndexOf("~")===-1)return null;const s=o.slice(o.lastIndexOf("~")+1,n.ch);if(o[o.lastIndexOf("~")-1]!==" "&&o.lastIndexOf("~")!==0)return null;const c=s.trim();return this.memos=Te.getState().memos.filter(d=>!d.deletedAt&&d.rowStatus!=="ARCHIVED"),{start:{line:n.line,ch:n.ch-c.length},end:n,query:c}}getSuggestions(n){return n.query?this.fuzzySearchItemsOptimized(n.query,this.memos).sort((a,o)=>o.match.score-a.match.score).map(a=>a.item).map(a=>({time:a.createdAt,id:a.id,content:a.content})):this.memos.map(a=>({time:a.createdAt,id:a.id,content:a.content}))}renderSuggestion(n,r){r.toggleClass("thino-suggestion",!0),r.createEl("div",{cls:"thino-suggestion-time",text:n.time}),r.createEl("div",{cls:"thino-suggestion-container"}).createEl("div",{cls:"thino-suggestion-content",text:n.content})}selectSuggestion(n){const r=n.id;this.context.editor.replaceRange("MARK: [@THINO]("+r+")",{line:this.context.end.line,ch:this.context.start.ch-1},this.context.end)}}class wK{constructor(){me(this,"path","/fake-file-that-generated-for-thino.png");me(this,"basename","fake-file-that-generated-for-thino");me(this,"extension","png");me(this,"deleted",!1);me(this,"name","fake-file-that-generated-for-thino.png");me(this,"parent",null);me(this,"stat");me(this,"vault",null)}static[Symbol.hasInstance](t){return t instanceof C.TFile}setPath(t){}getNewPathAfterRename(t){}getShortName(){}cache(t){}updateCacheLimit(){}}class wl extends C.ItemView{constructor(n,r){super(n);me(this,"scope",new C.Scope(this.app.scope));me(this,"root");me(this,"mobileHeaderRoot");me(this,"plugin");me(this,"hoverPopover");me(this,"memosComponent");me(this,"rootList",[]);me(this,"editor",null);me(this,"navigation",!1);me(this,"file",this.app.vault.getMarkdownFiles()[0]||new wK);me(this,"handleUpdateInstance",n=>{this.editor=n.editor});this.plugin=r,this.registerScope()}getDisplayText(){return"Thino"}getIcon(){return"Memos"}getViewType(){return _r}getMode(){return"source"}canToggleBacklinks(){return!1}registerScope(){const{scope:n}=this;n.register(["Mod"],"Enter",()=>{}),n.register([],"i",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-textarea"))}),n.register(["Mod"],"f",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"o",r=>{const a=r.target;a.tagName==="INPUT"||a.tagName==="TEXTAREA"||a.hasClass("cm-line")||a.hasClass("cm-content")||(r.preventDefault(),this.plugin.app.workspace.trigger("focus-on-searchBar"))}),n.register([],"Escape",()=>{setTimeout(()=>{this.plugin.app.workspace.trigger("blur-on-memos")},20)})}async onFileDeleted(n){var d,p,m;const r=Wh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",c=(m=((p=n.parent)==null?void 0:p.path)||n.path)==null?void 0:m.contains(s==null?void 0:s.trim());(r||a&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="CANVAS"))&&(await Te.removeMemosInFile(n),Te.updateTagsState()),c&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="MULTI")&&(await Te.removeMemosInFile(n,s),Te.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(g=>g.value==="FILE")&&(await Te.removeMemosInFile(n),Te.updateTagsState())}async onFileModified(n){var d;if(Qe.getState().changedByMemos){Qe.setChangedByMemos(!1);return}const r=Wh(n,"day"),a=n.path.contains(".thino")&&n.path.contains(".canvas"),o=n.path.contains(".thino")&&n.path.contains(".md"),s=((d=this.plugin.settings)==null?void 0:d.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",c=n.parent.path.contains(s==null?void 0:s.trim());if(r||a&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="CANVAS")){await Te.updateMemosInFile(n),Te.updateTagsState();return}c&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="MULTI")&&(await Te.updateMemosInFile(n,s),Te.updateTagsState()),o&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="FILE")&&(await Te.updateMemosInFile(n),Te.updateTagsState())}async onFileCreated(n){var r;if(this.app.workspace.layoutReady&&this.memosComponent){const a=Wh(n,"day"),o=n.path.contains(".thino")&&n.path.contains(".canvas"),s=n.path.contains(".thino")&&n.path.contains(".md"),c=((r=this.plugin.settings)==null?void 0:r.MemoOtherSaveLocation.MemoDefaultMultiFilePath)||"Thino",d=n.parent.path.contains(c==null?void 0:c.trim());if(a){await Xe.updateDailyNotes(n,!1),await Te.updateMemosInFile(n),Te.updateTagsState();return}if(o&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="CANVAS")){await Te.updateMemosInFile(n),Te.updateTagsState();return}d&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="MULTI")&&(await Te.updateMemosInFile(n,c),Te.updateTagsState()),s&&this.plugin.settings.EnabledLocationList.find(p=>p.value==="FILE")&&(await Te.updateMemosInFile(n),Te.updateTagsState())}}async onResize(){var r;super.onResize();const n=this.leaf;if(n&&n.height!==0){if(n.view.containerEl.toggleClass("tiny-view",n.width<600),n.view.containerEl.toggleClass("waterfall-small-group",n.width<1300),n.width>950){n.view.containerEl.classList.toggle("mobile-view",!1),Qe.setIsMobileView(n.width<=950);return}if((r=this.plugin.settings)!=null&&r.ShowLeftSideBar&&!C.Platform.isMobile)return;n.view.containerEl.classList.toggle("mobile-view",!0),Qe.setIsMobileView(n.width<=950)}}appendToHeader(){const n=this.leaf.view.titleContainerEl;n&&(this.mobileHeaderRoot=Lo.createRoot(n),this.mobileHeaderRoot.render(w.jsx($.StrictMode,{children:w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(ay,{})})})))}appendRoot({root:n,canvas:r}){this.rootList.push({root:n,canvas:r})}async onOpen(){this.navigation=this.plugin.settings.navigation,await this.onResize(),this.onFileCreated=this.onFileCreated.bind(this),this.onFileDeleted=this.onFileDeleted.bind(this),this.onFileModified=this.onFileModified.bind(this),C.Platform.isTablet&&document.body.toggleClass("is-tablet",!0),C.Platform.isMobile&&!C.Platform.isTablet&&this.appendToHeader(),this.registerEvent(this.app.vault.on("create",this.onFileCreated)),this.registerEvent(this.app.vault.on("delete",this.onFileDeleted)),this.registerEvent(this.app.vault.on("modify",C.debounce(this.onFileModified,2e3,!0))),this.registerEvent(this.app.workspace.on("active-leaf-change",n=>{n.view.getViewType()==="canvas"&&mK(n)}));try{this.root=Lo.createRoot(this.contentEl),Xe.setView(this),this.root.render(w.jsx($.StrictMode,{children:w.jsx(pK,{app:this.plugin.app})}))}catch(n){console.error(n)}}onunload(){var n;super.onunload(),this.root.unmount(),(n=this.mobileHeaderRoot)==null||n.unmount(),this.rootList.forEach(r=>{var a,o,s;(a=r==null?void 0:r.root)==null||a.unmount(),(o=r==null?void 0:r.canvas)!=null&&o.thinoBtn&&(r.canvas.thinoBtn=void 0),(s=r==null?void 0:r.canvas)!=null&&s.wrapperEl.find(".thino-canvas-menu-btn")&&r.canvas.wrapperEl.find(".thino-canvas-menu-btn").detach()})}}const Y2={Memos:'<svg t="1641348507339" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2120" width="100" height="100"><path d="M126.692653 478.099639l-90.757281 0c-19.019408 0-34.437336 15.423923-34.437336 34.417356 0 18.992434 15.416929 34.477297 34.437336 34.477297l90.757281 0c19.013414 0 34.42335-15.484863 34.42335-34.477297C161.116003 493.523561 145.706067 478.099639 126.692653 478.099639zM244.662333 243.526943c13.742566-13.110184 14.310011-34.948836 1.185841-48.706388l-62.644762-65.668806c-13.128167-13.762547-34.974811-14.229091-48.717377-1.118906s-14.261059 34.911872-1.132893 48.674419l62.644762 65.668806C209.123074 256.13262 230.919767 256.637127 244.662333 243.526943zM543.066631 957.422083l-60.603757 0c-18.654764 0-33.794964 15.147193-33.794964 33.862898 0 18.661757 15.1402 32.71502 33.794964 32.71502l60.603757 0c18.654764 0 33.794964-14.053262 33.794964-32.71502C576.861595 972.568277 561.721395 957.422083 543.066631 957.422083zM988.076617 479.050709l-90.757281 0c-19.019408 0-34.437336 15.423923-34.437336 34.417356s15.416929 34.477297 34.437336 34.477297l90.757281 0c19.013414 0 34.42335-15.484863 34.42335-34.477297S1007.09003 479.050709 988.076617 479.050709zM512.268737 192.765564c-172.737143 0-312.75527 150.079292-312.75527 322.746503 0 125.630192 74.080583 233.957298 180.936128 283.703669l0 84.51838c0 16.762614 15.410935 31.35435 34.42335 31.35435 0.598415 0 1.193833-0.014985 1.785255-0.042958 0.618395 0.026974 1.239788 0.042958 1.867175 0.042958l187.479731 0c5.905227 0 11.455802-1.220807 16.288078-3.477601 12.231044-4.657447 20.795671-15.383962 20.795671-27.87575l0-84.052835c107.391021-49.534578 181.935151-158.147405 181.935151-284.168214C825.024007 342.843857 684.997888 192.765564 512.268737 192.765564zM574.863548 742.713968l0 80.17063c0 3.159911-0.221783 5.976158-0.642372 8.496694l0 19.092336-124.910895 0 0-17.71768c-0.423586-2.856208-0.642372-6.123015-0.642372-9.870351l0-80.443363c-99.204024-27.75387-171.970892-118.821847-171.970892-226.930167 0-130.094827 105.4689-245.507007 235.571719-245.507007s235.563727 115.41218 235.563727 245.507007C747.832465 623.984031 674.578074 715.293772 574.863548 742.713968zM895.407204 129.328576c-13.429872-13.429872-35.233558-13.439862-48.677416 0.004995l-64.174267 64.175266c-13.448853 13.448853-13.443858 35.257534-0.013986 48.687406 13.429872 13.429872 35.281511 13.477825 48.730364 0.028972l64.175266-64.175266C908.889025 164.605092 908.837076 142.758448 895.407204 129.328576zM511.796199 159.617967c18.992434 0 34.417356-15.410935 34.417356-34.42335l0-90.757281c0-19.019408-15.423923-34.437336-34.417356-34.437336-18.992434 0-34.477297 15.416929-34.477297 34.437336l0 90.757281C477.317903 144.208031 492.802766 159.617967 511.796199 159.617967z" fill="currentColor" p-id="2121"></path></svg>'};function bK(){Object.keys(Y2).forEach(e=>{C.addIcon(e,Y2[e])})}class z2 extends gE{fuzzySearchItemsOptimized(t,n){const r=C.prepareFuzzySearch(t);return n.map(a=>{const o=r(a.path);return o?{item:a,match:o,score:o.score}:null}).sort((a,o)=>(o==null?void 0:o.score)-(a==null?void 0:a.score)).filter(Boolean)}getSuggestions(t){const r=app.vault.getFiles().filter(o=>["png","jpg","jpeg","gif"].includes(o.extension)),a=t.toLowerCase();return this.fuzzySearchItemsOptimized(a,r).map(o=>o.item)}renderSuggestion(t,n){var o;const r=t.basename,a=((o=t.parent)==null?void 0:o.path)||"";n.toggleClass("thino-image-suggest-item",!0),n.createSpan({cls:"suggestion-name",text:r}),n.createSpan({cls:"suggestion-path",text:a})}selectSuggestion(t){this.inputEl.value=t.path,this.inputEl.trigger("input"),this.close()}}const gb=typeof Buffer=="function";typeof TextDecoder=="function"&&new TextDecoder;const U2=typeof TextEncoder=="function"?new TextEncoder:void 0,DK="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Zh=Array.prototype.slice.call(DK);(e=>{let t={};return e.forEach((n,r)=>t[n]=r),t})(Zh);const bi=String.fromCharCode.bind(String);typeof Uint8Array.from=="function"&&Uint8Array.from.bind(Uint8Array);const SK=e=>e.replace(/=/g,"").replace(/[+\/]/g,t=>t=="+"?"-":"_"),IK=e=>{let t,n,r,a,o="";const s=e.length%3;for(let c=0;c<e.length;){if((n=e.charCodeAt(c++))>255||(r=e.charCodeAt(c++))>255||(a=e.charCodeAt(c++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|a,o+=Zh[t>>18&63]+Zh[t>>12&63]+Zh[t>>6&63]+Zh[t&63]}return s?o.slice(0,s-3)+"===".substring(s):o},vx=typeof btoa=="function"?e=>btoa(e):gb?e=>Buffer.from(e,"binary").toString("base64"):IK,TK=gb?e=>Buffer.from(e).toString("base64"):e=>{let n=[];for(let r=0,a=e.length;r<a;r+=4096)n.push(bi.apply(null,e.subarray(r,r+4096)));return vx(n.join(""))},EK=e=>{if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?bi(192|t>>>6)+bi(128|t&63):bi(224|t>>>12&15)+bi(128|t>>>6&63)+bi(128|t&63)}else{var t=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return bi(240|t>>>18&7)+bi(128|t>>>12&63)+bi(128|t>>>6&63)+bi(128|t&63)}},CK=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,xK=e=>e.replace(CK,EK),V2=gb?e=>Buffer.from(e,"utf8").toString("base64"):U2?e=>TK(U2.encode(e)):e=>vx(xK(e)),MK=(e,t=!1)=>t?SK(V2(e)):V2(e),ow=C.Platform.isDesktop&&require("os"),wx=async()=>{var r,a;let e="";if(C.Platform.isDesktop)e=await vn();else{const o=await((r=window.Capacitor)==null?void 0:r.Plugins.Device.getId());e=o.identifier||o.uuid}let t;if(ow)t=JSON.stringify({hostname:ow.hostname(),platform:ow.platform(),machineid:e});else{const o=await((a=window.Capacitor)==null?void 0:a.Plugins.Device.getInfo()),s=o==null?void 0:o.model,c=o==null?void 0:o.platform;t=JSON.stringify({hostname:s||("mobile"+C.Platform.isMobile?Math.random().toString(36).substring(7):""),platform:c||"mobile",machineid:e})}return MK(t)},NK=async()=>{var t;let e="";if(C.Platform.isDesktop)e=await vn();else{const n=await((t=window.Capacitor)==null?void 0:t.Plugins.Device.getId());e=n.identifier||n.uuid}return e},kK={General:"chef-hat",Thino:"Memos",Interface:"brush",Share:"share-2",Advanced:"cog"},bx=[{value:"DAILY",target:"ProcessEntriesBelow",insert:"InsertAfter"},{value:"CANVAS",target:"MemoDefaultCanvasPath"},{value:"MULTI",target:"MemoDefaultMultiFilePath"},{value:"FILE",target:"MemoDefaultSingleFilePath"}],cs={FirstLoaded:!1,StartDate:"Sunday",InsertAfter:"",UserName:"THINO 😉",ProcessEntriesBelow:"",Language:"en",SaveMemoButtonLabel:"NOTE",SaveMemoButtonIcon:"✍️",ShareFooterStart:"{ThinoNum} Thino {UsedDay} Day",ShareFooterEnd:"✍️ by {UserName}",DefaultPrefix:"List",DefaultTimePrefix:"HH:mm",UseDailyOrPeriodic:"Daily",InsertDateFormat:"Tasks",DefaultEditorLocation:"Top",UseButtonToShowEditor:!1,FocusOnEditor:!0,OpenDailyMemosWithMemos:!0,HideDoneTasks:!1,ShowTaskLabel:!1,MobileAndDesktop:"All",OpenMemosAutomatically:!1,ShowTime:!0,ShowDate:!0,AddBlankLineWhenDate:!1,AutoSaveWhenOnMobile:!1,DeleteFileName:"delete",QueryFileName:"query",UseVaultTags:!1,SetCustomBackgroundImage:!1,SetCustomMemoFooter:!1,DefaultLightBackgroundImage:"",DefaultDarkBackgroundImage:"",DefaultMemoComposition:"{TIME} {CONTENT}",CommentOnMemos:!1,CommentsInOriginalNotes:!1,FetchMemosMark:"#memo",FetchMemosFromNote:!1,ShowCommentOnMemos:!1,ShowLeftSideBar:!1,MemoListView:"list",MemoSaveLocation:"DAILY",MemoOtherSaveLocation:{MemoDefaultCanvasPath:"basic.thino.canvas",MemoDefaultMultiFilePath:"Thino",MemoDefaultSingleFilePath:"basic.thino.md"},MemoDailyTarget:5,HeatmapColorScheme:"default",EnabledHttpApi:!1,HttpApiIpType:"localhost",HttpApiPort:"43999",AutoDownloadImage:!1,EditorType:"obsidian",EnabledLocationList:bx,DeleteThinoDirectly:!1,CaptureKey:{EnableCaptureKey:!1,OpenThinoGlobally:"CommandOrControl+Shift+T",ShowNearMouse:!1},startSync:!1,tokenForVerify:{},saveThinoType:"FILE",showDayMark:!1,dayMarkRange:"day",navigation:!1,password:"",needVerify:!1,addTagAutomatically:!1,addTagPosition:"End",addTagWithNewline:!1,chatViewStyle:"default",MomentsBackgroundImage:"https://images.pexels.com/photos/531767/pexels-photo-531767.jpeg",MomentsIcon:"https://images.pexels.com/photos/256514/pexels-photo-256514.jpeg",MomentsQuote:"Share your thino with the world",DefaultThemeForThino:"modern",LastUpdatedVersion:"0.0.0",ShareToThinoWithText:!1,ShareToThinoWithTextAppend:"",ShareToThinoWithTextPrepend:"",ShareToThinoWithTextNewline:"none",hidePinnedGroup:!1,DifferentInsertTarget:!1,InsertAfterForTask:"",ProcessContentTarget:"custom",InsertType:"custom"};function AK({plugin:e}){const{dailyNotesState:{verifyState:t}}=A.useContext(mt),[n,r]=A.useState(!1),[a,o]=A.useState(!1),[s,c]=A.useState(""),[d,p]=A.useState("");A.useEffect(()=>{NK().then(v=>{p(v)})},[]);const m=async()=>{var T;const v=s,D=!C.Platform.isDesktop&&await((T=window.Capacitor)==null?void 0:T.Plugins.Device.getId()),S=C.Platform.isDesktop?await vn():D.identifier||D.uuid;v&&(e.settingTab.updateSettings("tokenForVerify",{...e.settings.tokenForVerify,[S]:v}),e.verify().then(E=>{E&&(r(!0),Qe.setRefresh(!0),setTimeout(()=>{e.settingTab.display()},200),e.registerToolbarCheck()),new C.Notice(N(E?"Verify successfully":"Failed to verify"))}).catch(E=>{new C.Notice(N("Failed to verify"))}))},g=async v=>{c(v)};return w.jsx("div",{className:"thino-verify-component",children:t?w.jsxs("div",{className:"thino-verify-content verified",children:[w.jsx("div",{className:"thino-verified-text",children:N("You have verified your account. Congrats!")}),w.jsx("div",{className:"thino-description-link",children:w.jsxs("p",{children:[N("If you have any questions, please contact us."),w.jsx("span",{className:"thino-url",onClick:()=>{const v=localStorage.getItem("language");v&&(v==="zh"||v==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})})]}):w.jsxs("div",{className:"thino-verify-content",children:[w.jsxs("div",{className:"thino-description-link",children:[N("You can buy a license from")+"->",w.jsxs("span",{className:"thino-url",onClick:()=>{const v=localStorage.getItem("language");v&&(v==="zh"||v==="zh-TW")?window.open("https://pkmer.cn/products/thino"):window.open("https://thino.pkmer.net/en/#price")},children:[" ","PKMer"]})]}),w.jsx("textarea",{className:"thino-verify-textarea",value:s,onChange:v=>g(v.target.value),placeholder:N("Input activation code here")}),w.jsxs("div",{className:"thino-button-container",children:[w.jsxs("div",{className:"thino-button-group",children:[w.jsx("button",{onClick:async()=>{try{const v=await wx();await navigator.clipboard.writeText(v),o(!0)}catch(v){console.error(v),new C.Notice("Failed to copy id");return}new C.Notice(N("Copied to clipboard Successfully"))},children:N("Copy Thino id")}),w.jsx("button",{onClick:()=>{if(!a){new C.Notice(N("Please copy Thino id first"));return}const v=localStorage.getItem("language");v&&(v==="zh"||v==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&getCode"):window.open("https://pkmer.net/en/userprofile/#tab-21&getCode"),r(!0)},children:N("Get activation code")}),s&&w.jsx(w.Fragment,{children:w.jsx("button",{onClick:async()=>{await m()},children:N("Verify")})})]}),n?w.jsx("p",{children:N("After you verify your account, please refresh this page.")}):""]}),w.jsxs("div",{className:"thino-description-link",children:[N("If you have any questions, please contact us."),w.jsx("span",{className:"thino-url",onClick:()=>{const v=localStorage.getItem("language");v&&(v==="zh"||v==="zh-TW")?window.open("https://pkmer.cn"):window.open("https://thino.pkmer.net/en/")},children:"@ PKMer"})]})]})})}class FK extends C.PluginSettingTab{constructor(n,r){super(n,r);me(this,"plugin");me(this,"applyDebounceTimer",0);me(this,"tabContent",new Map);me(this,"selectedTab","General");me(this,"search");me(this,"searchSettingInfo",new Map);me(this,"searchZeroState");me(this,"navigateEl");me(this,"passwordMatched",!1);me(this,"root");me(this,"debounceApplySettingsUpdate",C.debounce(async()=>{await this.plugin.saveSettings()},100,!0));me(this,"debounceDisplay",C.debounce(async()=>{await this.display()},300,!0));this.plugin=r}updateSettings(n,r){this.plugin.settings={...this.plugin.settings,[n]:r},this.applySettingsUpdate()}applySettingsUpdate(){this.debounceApplySettingsUpdate(),Te.updateTagsState()}async hide(){var n;(n=this.root)==null||n.unmount(),this.passwordMatched=!1}async display(){var n;await this.plugin.loadSettings(),this.root&&((n=this.root)==null||n.unmount()),this.containerEl.empty(),this.containerEl.toggleClass("memos-settings",!0),C.Platform.isMobile&&this.containerEl.toggleClass("memos-mobile",!0),this.generateSettingsTitle(),this.addTabHeader()}generateSettingsTitle(){const n=this.containerEl.createDiv("memos-setting-title");n.createEl("h2",{text:"Thino"}),this.generateSearchBar(n)}addTabHeader(){const n=this.containerEl.createEl("nav",{cls:"memos-setting-header"});this.navigateEl=n.createDiv("memos-setting-tab-group");const r=this.containerEl.createDiv("memos-setting-content");this.updateOldData(),this.createTabAndContent("General",this.navigateEl,r,(a,o)=>this.generateGeneralSettings(o,a)),this.createTabAndContent("Thino",this.navigateEl,r,(a,o)=>this.generateMemosSettings(o,a)),this.createTabAndContent("Interface",this.navigateEl,r,(a,o)=>this.generateThemeSettings(o,a)),this.createTabAndContent("Share",this.navigateEl,r,(a,o)=>this.generateShareSettings(o,a)),this.createTabAndContent("Advanced",this.navigateEl,r,(a,o)=>this.generateAdvancedSettings(o,a)),this.createSearchZeroState(r)}updateOldData(){this.plugin.settings.UserName.startsWith("MEMO ")&&(this.plugin.settings.UserName="THINO 😉"),this.plugin.settings.ShareFooterStart.contains("{Memo")&&(this.plugin.settings.ShareFooterStart=this.plugin.settings.ShareFooterStart.replace("{MemosNum}","{ThinoNum}").replace("memos","thino")),this.applySettingsUpdate()}generateSearchBar(n){const r=new C.Setting(n);r.settingEl.style.border="none",r.addSearch(a=>{this.search=a}),this.search.setPlaceholder(N("Search all settings")),this.search.inputEl.oninput=()=>{for(const a of this.tabContent){const o=a[1];o.navButton.removeClass("memos-navigation-item-selected"),o.content.show(),o.heading.show();const s=this.search.getValue();this.selectedTab==""&&s.trim()!=""&&this.searchSettings(s.toLowerCase()),this.selectedTab=""}this.navigateEl.addClass("memos-setting-searching")},this.search.inputEl.onblur=()=>{this.navigateEl.removeClass("memos-setting-searching")},this.search.onChange(a=>{var o;if(a===""){this.triggerTabChange((o=this.tabContent.get("General"))==null?void 0:o.navButton,"General");return}this.searchSettings(a.toLowerCase())})}triggerTabChange(n,r){if(this.selectedTab==r)return;n.toggleClass("memos-navigation-item-selected",!0);const a=this.tabContent.get(r);if((a==null?void 0:a.content).show(),this.selectedTab!=""){const o=this.tabContent.get(this.selectedTab);o==null||o.navButton.removeClass("memos-navigation-item-selected"),(o==null?void 0:o.content).hide()}else{this.searchZeroState.hide();for(const o of this.searchSettingInfo)for(const s of o[1])s.containerEl.show();for(const o of this.tabContent){const s=o[1];s.heading.hide(),r!==o[0]&&s.content.hide()}}this.selectedTab=r}createTabAndContent(n,r,a,o){const s=this.selectedTab===n,c=r.createDiv("memos-navigation-item");c.toggleClass("memos-desktop",!0),C.setIcon(c.createEl("div",{cls:"memos-navigation-item-icon"}),kK[n]),c.createSpan({text:N(n)}),c.onclick=()=>{this.triggerTabChange(c,n)};const d=a.createDiv("memos-tab-settings"),p=d.createEl("h2",{cls:"memos-setting-heading",text:n+" Settings"});p.hide(),d.id=n.toLowerCase().replace(" ","-"),s?c.addClass("memos-navigation-item-selected"):d.hide(),o&&o(d,n),this.tabContent.set(n,{content:d,heading:p,navButton:c})}searchSettings(n){var o;const r=new Set,a=(s,c)=>{s.show(),r.has(c)||r.add(c)};for(const s of this.searchSettingInfo){const c=s[0],d=s[1];for(const p of d)if(n.trim()===""||(o=p.alias)!=null&&o.includes(n)||p.description.includes(n)||p.name.includes(n))a(p.containerEl,c);else if(p.options&&p.options.length>0)for(const m of p.options){if(m.description.toLowerCase().includes(n)||m.name.toLowerCase().includes(n)){a(p.containerEl,c);break}else if(m.options){for(const g of m.options)if(g.description.toLowerCase().includes(n)||g.value.toLowerCase().includes(n)){a(p.containerEl,c);break}}p.containerEl.hide()}else p.containerEl.hide()}for(const s of this.tabContent)r.has(s[0])?s[1].heading.show():s[1].heading.hide();r.size===0?this.searchZeroState.show():this.searchZeroState.hide()}addSettingToMasterSettingsList(n,r,a="",o="",s=[],c=""){var p;const d={containerEl:r,name:a.toLowerCase(),description:o.toLowerCase(),options:s,alias:c};this.searchSettingInfo.has(n)?(p=this.searchSettingInfo.get(n))==null||p.push(d):this.searchSettingInfo.set(n,[d])}createSearchZeroState(n){this.searchZeroState=n.createDiv(),this.searchZeroState.hide(),this.searchZeroState.createEl(C.Platform.isMobile?"h3":"h2",{text:"No settings match search"}).style.textAlign="center"}generateGeneralSettings(n,r){this.customHeading(n,r)}async generateThemeSettings(n,r){var d;const a=Xe.getState().verifyState,o=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=C.Platform.isDesktop?await vn():o.identifier||o.uuid,c=a&&(a==null?void 0:a.appId)===s;await this.customNameAndTheme(n,r,c)}async generateMemosSettings(n,r){var d;const a=Xe.getState().verifyState,o=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=C.Platform.isDesktop?await vn():o.identifier||o.uuid,c=a&&(a==null?void 0:a.appId)===s;this.setPasswordSettings(n,r),this.addMemoSettings(n,r),this.customFileNameSettings(n,r,c),this.addThinoProSettings(n,r,c)}async generateShareSettings(n,r){var d;const a=Xe.getState().verifyState,o=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=C.Platform.isDesktop?await vn():o.identifier||o.uuid,c=a&&(a==null?void 0:a.appId)===s;new Ve(r,this).setHeading().setTab(n).setName(N("Copy filtered results")),this.copyMemosSettings(n,r),new Ve(r,this).setHeading().setTab(n).setName(N("Share image")),this.shareMemosSettings(n,r),C.Platform.isMobile&&this.shareToThinosSettings(n,r,c)}async generateAdvancedSettings(n,r){var d;this.saveDataSettings(n,r),this.fetchDataSettings(n,r),this.navigationSettings(n,r);const a=Xe.getState().verifyState,o=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=C.Platform.isDesktop?await vn():o.identifier||o.uuid,c=a&&(a==null?void 0:a.appId)===s;this.setGlobalSettings(n,r,c)}async customNameAndTheme(n,r,a){new Ve(r,this).setName(N("Theme for Thino")).setDesc(N("Set the theme for Thino")).setTab(n).addDropdown(async s=>{s.addOption("modern","Modern"),s.addOption("classic","Classic"),s.setValue(this.plugin.settings.DefaultThemeForThino).onChange(async c=>{this.plugin.settings.DefaultThemeForThino=c,this.applySettingsUpdate()})}),new Ve(r,this).setTab(n).setHeading().setName(N("Interface Details"));let o;new Ve(r,this).setName(N("Heatmap Color Scheme")).setDesc(N("Set different color scheme for heatmap.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default",N("Default")),o.addOption("gray",N("Gray")),o.addOption("grass",N("Grass")),o.addOption("flame",N("Flame")),o.addOption("olive",N("Olive")),o.addOption("ice",N("Ice")),o.addOption("magenta",N("Magenta")),o.setValue(this.plugin.settings.HeatmapColorScheme).onChange(async c=>{this.plugin.settings.HeatmapColorScheme=c,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Show Tasks Label")).setDesc(N("Show tasks label near the time text. False by default")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowTaskLabel).onChange(async c=>{this.plugin.settings.ShowTaskLabel=c,this.applySettingsUpdate()})),new Ve(r,this).setName(N("Save Memo button label")).setDesc(N("The text shown on the save Memo button in the UI. 'NOTEIT' by default.")).setTab(n).addText(s=>s.setPlaceholder(cs.SaveMemoButtonLabel).setValue(this.plugin.settings.SaveMemoButtonLabel).onChange(async c=>{this.plugin.settings.SaveMemoButtonLabel=c,this.applySettingsUpdate()})),C.Platform.isDesktop&&new Ve(r,this).setName(N("Always Show Leaf Sidebar on PC")).setDesc(N("Show left sidebar on PC even when the leaf width is less than 875px. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.ShowLeftSideBar).onChange(async c=>{this.plugin.settings.ShowLeftSideBar=c,this.applySettingsUpdate()})),await this.getEditorLocation(r,n),new Ve(r,this).setHeading().setTab(n).setName("💎 "+N("Pro features")),this.addThinoDailyMarkSettings(n,r,a),new Ve(r,this).setName(N("Chat view style")).setDesc(N("Set the style of chat view")).setTab(n).addDropdown(async s=>{o=s,o.addOption("default","Default"),o.addOption("fluent","Fluent"),o.addOption("inline","Inline"),o.setValue(this.plugin.settings.chatViewStyle).onChange(async c=>{if(!a){qt();return}this.plugin.settings.chatViewStyle=c,this.applySettingsUpdate()})}),this.addThinoMomentsSettings(n,r,a)}addThinoDailyMarkSettings(n,r,a){let o;new Ve(r,this).setName(N("Show day mark in thino list")).setDesc(N("Show day mark on the top of daily range thino. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.showDayMark).onChange(async c=>{if(!a){qt();return}this.plugin.settings.showDayMark=c,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.showDayMark&&(new Ve(r,this).setName(N("Day mark range")).setDesc(N("Set the range of day mark. Day by default.")).setTab(n).addDropdown(async s=>{o=s,o.addOption("day","day"),o.addOption("week","week"),o.addOption("month","month"),o.addOption("quarter","quarter"),o.addOption("year","year"),o.setValue(this.plugin.settings.dayMarkRange).onChange(async c=>{this.plugin.settings.dayMarkRange=c,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Hide pinned group")).setDesc(N("Hide pinned group in thino list. False by default.")).setTab(n).addToggle(s=>s.setValue(this.plugin.settings.hidePinnedGroup).onChange(async c=>{if(!a){qt();return}this.plugin.settings.hidePinnedGroup=c,this.applySettingsUpdate()})))}addThinoMomentsSettings(n,r,a){new Ve(r,this).setTab(n).setName(N("Background image for moments view")).setDesc(N("Set the background image for moments view")).addText(o=>o.setPlaceholder("URL").setValue(this.plugin.settings.MomentsBackgroundImage).onChange(async s=>{a&&(this.plugin.settings.MomentsBackgroundImage=s,this.applySettingsUpdate())}))}async getEditorLocation(n,r){let a;C.Platform.isMobile&&(new Ve(n,this).setName(N("Default editor position on mobile")).setDesc(N("Set the default editor position on Mobile, 'Top' by default.")).setTab(r).addDropdown(async o=>{a=o,a.addOption("Top",N("Top")),a.addOption("Bottom",N("Bottom")),a.setValue(this.plugin.settings.DefaultEditorLocation).onChange(async s=>{this.plugin.settings.DefaultEditorLocation=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},200)})}),this.plugin.settings.DefaultEditorLocation!=="Top"&&new Ve(n,this).setName(N("Use button to show editor on mobile")).setDesc(N("Set a float button to call editor on mobile. Only when editor located at the bottom works.")).setTab(r).addToggle(o=>o.setValue(this.plugin.settings.UseButtonToShowEditor).onChange(async s=>{this.plugin.settings.UseButtonToShowEditor=s,this.applySettingsUpdate()})))}customHeading(n,r){new Ve(r,this).setHeading().setName(N("User info")).setTab(n),new Ve(r,this).setName(N("User name")).setDesc(N("Set your user name here. 'Memos 😏' By default")).setTab(n).addText(v=>v.setPlaceholder(cs.UserName).setValue(this.plugin.settings.UserName).onChange(async D=>{this.plugin.settings.UserName=D,this.applySettingsUpdate()})),new Ve(r,this).setTab(n).setName(N("User icon")).setDesc(N("Set user icon for thino")).addText(v=>v.setPlaceholder("URL").setValue(this.plugin.settings.MomentsIcon).onChange(async D=>{this.plugin.settings.MomentsIcon=D,this.applySettingsUpdate()})),new Ve(r,this).setTab(n).setName(N("User quote")).setDesc(N("Set user quote for thino")).addText(v=>v.setPlaceholder("Input anything here").setValue(this.plugin.settings.MomentsQuote).onChange(async D=>{this.plugin.settings.MomentsQuote=D,this.applySettingsUpdate()}));let a=!1;const o=document.createDocumentFragment();o.createEl("span",{text:N("Connect to PKMer Sync, you can check it in ")});const s=localStorage.getItem("language");let c;s&&s==="zh"?c="https://pkmer.cn/products/UserProfile/#tab-21&activateSync":c="https://thino.pkmer.net/en/",o.createEl("a",{text:N("PKMer Sync"),attr:{href:c}}),new Ve(r,this).setHeading().setName(N("Pro verification status")).setTab(n);const d=document.createDocumentFragment(),p=d.createEl("div",{cls:"thino-activation"}),m=new Ve(r,this).setName(N("Activate Pro Version")).setDesc(d).setTab(n);m.settingEl.toggleClass("thino-activation-setting",!0),m.nameEl.toggleClass("thino-activation-title",!0),this.root=Lo.createRoot(p),this.root.render(w.jsx(Bo,{store:Ee,context:mt,children:w.jsx(AK,{plugin:this.plugin})}));let g=!1;new Ve(r,this).setName(N("Deactivate")).setTab(n).addButton(v=>{v.setWarning().setButtonText(N("Remove")).onClick(async()=>{var T;if(!g){v.setButtonText(N("Confirm?")),g=!0;return}g=!1;const D=!C.Platform.isDesktop&&await((T=window.Capacitor)==null?void 0:T.Plugins.Device.getId()),S=C.Platform.isDesktop?await vn():D.identifier||D.uuid;this.plugin.settings.tokenForVerify[S]&&(delete this.plugin.settings.tokenForVerify[S],await this.plugin.saveSettings(),new C.Notice(N("Remove successfully"))),await this.plugin.verify(),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),(s==="zh"||s==="zh-TW")&&new Ve(r,this).setHeading().setName(N("Sync service")).setTab(n),(s==="zh"||s==="zh-TW")&&new Ve(r,this).setName(N("Sync Thino via PKMer")).setDesc(o).setTab(n).addButton(v=>{var S;const D=(S=this.plugin.app)==null?void 0:S.loadLocalStorage("tokenForSync");v.setButtonText(N(D?"Unlink":"Link")).onClick(async()=>{var T;if(!D){const E=localStorage.getItem("language");E&&(E==="zh"||E==="zh-TW")?window.open("https://pkmer.cn/products/UserProfile/#tab-21&activateSync"):window.open("https://thino.pkmer.net/en/");return}if(!a){v.setButtonText(N("Confirm?")),a=!0;return}a=!1,D&&((T=this.plugin.app)==null||T.saveLocalStorage("tokenForSync",""),new C.Notice(N("Remove successfully"))),Qe.setRefresh(!0),setTimeout(()=>{this.display()},20)})}),(s==="zh"||s==="zh-TW")&&this.showSyncStatus(r,n)}showSyncStatus(n,r){var o;(o=this.plugin.app)!=null&&o.loadLocalStorage("tokenForSync")&&(new Ve(n,this).setName(N("Save thino type when sync local")).setDesc(N("Set the default save thino type when sync local, FILE by default.")).setTab(r).addDropdown(async s=>{s.addOption("DAILY",N("DAILY")),s.addOption("FILE",N("FILE")),s.setValue(this.plugin.settings.saveThinoType).onChange(async c=>{this.plugin.settings.saveThinoType=c,this.applySettingsUpdate()})}),new Ve(n,this).setName(N("Sync Status")).setDesc(N("Start or stop sync")).setTab(r).addButton(s=>{s.setButtonText(this.plugin.settings.startSync?N("Stop"):N("Start")).onClick(async()=>{this.plugin.settings.startSync=!this.plugin.settings.startSync,await this.plugin.saveSettings(),Qe.setRefresh(!0),new C.Notice(this.plugin.settings.startSync?N("Start sync successfully"):N("Stop sync successfully")),setTimeout(()=>{this.display()},200)})}))}addMemoSettings(n,r){new Ve(r,this).setName(N("Open Memos when obsidian opens")).setDesc(N("When enable this, Memos will open when Obsidian opens. False by default.")).setTab(n).addDropdown(o=>{o.addOption("Desktop","Desktop"),o.addOption("Mobile","Mobile"),o.addOption("All","All"),o.setValue(this.plugin.settings.MobileAndDesktop).onChange(async s=>{this.plugin.settings.MobileAndDesktop=s,this.applySettingsUpdate()})}).addToggle(o=>o.setValue(this.plugin.settings.OpenMemosAutomatically).onChange(async s=>{this.plugin.settings.OpenMemosAutomatically=s,this.applySettingsUpdate()})),new Ve(r,this).setHeading().setTab(n).setName(N("Editor")),new Ve(r,this).setName(N("Use Tags In Vault")).setDesc(N("Use tags in vault rather than only in Memos. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.UseVaultTags).onChange(async s=>{this.plugin.settings.UseVaultTags=s,this.applySettingsUpdate()}));let a;new Ve(r,this).setName(N("Default insert date format")).setDesc(N("Set the default date format when insert date by @, 'Tasks' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Tasks","Tasks"),a.addOption("Dataview","Dataview"),a.setValue(this.plugin.settings.InsertDateFormat).onChange(async s=>{this.plugin.settings.InsertDateFormat=s,this.applySettingsUpdate()})}),new Ve(r,this).setHeading().setTab(n).setName(N("Daily notes")),new Ve(r,this).setName(N("Default prefix when save thino in daily notes")).setDesc(N("Set the default prefix when create memo, 'List' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("List",N("List")),a.addOption("Task",N("Task")),a.setValue(this.plugin.settings.DefaultPrefix).onChange(async s=>{this.plugin.settings.DefaultPrefix=s,this.applySettingsUpdate()})}),this.plugin.settings.EnabledLocationList.some(o=>o.value==="DAILY")&&new Ve(r,this).setName(N("Default time prefix for thino in daily notes")).setDesc(N("Set default time prefix for thino in daily notes.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("HH:mm","HH:mm"),a.addOption("HH:mm:ss","HH:mm:ss"),a.setValue(this.plugin.settings.DefaultTimePrefix).onChange(async s=>{this.plugin.settings.DefaultTimePrefix=s,this.applySettingsUpdate()})})}addThinoProSettings(n,r,a){new Ve(r,this).setHeading().setTab(n).setName("💎 "+N("Pro features")),new Ve(r,this).setName(N("Default save type")).setDesc(N('Set the default save type for thino. "DAILY" by default')).setTab(n).addDropdown(async o=>{for(const s of this.plugin.settings.EnabledLocationList)o.addOption(s.value,N(s.value));o.setValue(this.plugin.settings.MemoSaveLocation||this.plugin.settings.EnabledLocationList[0].value).onChange(async s=>{if(!a){qt();return}this.plugin.settings.MemoSaveLocation=s,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Add tag automatically")).setDesc(N("Add tag to the end or beginning of the thino content when creating a thino and filtering tags")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagAutomatically).onChange(async s=>{if(!a){qt();return}this.plugin.settings.addTagAutomatically=s,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.addTagAutomatically&&(new Ve(r,this).setName(N("Add tag position")).setDesc(N("Set the position of the tag when adding tag automatically")).setTab(n).addDropdown(async o=>{o.addOption("End",N("End")),o.addOption("Beginning",N("Beginning")),o.setValue(this.plugin.settings.addTagPosition).onChange(async s=>{this.plugin.settings.addTagPosition=s,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Add tag with new line")).setDesc(N("Add tag with new line when adding tag automatically")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.addTagWithNewline).onChange(async s=>{this.plugin.settings.addTagWithNewline=s,this.applySettingsUpdate()})))}memosCommentSettings(n,r){new Ve(r,this).setName(N("Allow Comments On Memos")).setDesc(N("You can comment on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentOnMemos).onChange(async o=>{this.plugin.settings.CommentOnMemos=o,this.applySettingsUpdate(),this.display()})),this.plugin.settings.CommentOnMemos&&(new Ve(r,this).setName(N("Always Show Memo Comments")).setDesc(N("Always show memo comments on memos. False by default")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowCommentOnMemos).onChange(async o=>{this.plugin.settings.ShowCommentOnMemos=o,this.applySettingsUpdate()})),new Ve(r,this).setName(N("Comments In Original DailyNotes/Notes")).setDesc(N("You should install Dataview Plugin ver 0.5.9 or later to use this feature.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.CommentsInOriginalNotes).onChange(async o=>{this.plugin.settings.CommentsInOriginalNotes=o,this.applySettingsUpdate()})))}shareToThinosSettings(n,r,a){new Ve(r,this).setHeading().setTab(n).setName("💎 "+N("Pro features")),new Ve(r,this).setTab(n).setName(N("Append/prepend text when share to Thino")).addToggle(o=>{o.setValue(this.plugin.settings.ShareToThinoWithText).onChange(async s=>{if(!a){qt();return}this.plugin.settings.ShareToThinoWithText=s,this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.ShareToThinoWithText&&(new Ve(r,this).setTab(n).setName(N("Append text when share to Thino")).addText(o=>{o.setPlaceholder(N("Input anything here")).setValue(this.plugin.settings.ShareToThinoWithTextAppend).onChange(async s=>{this.plugin.settings.ShareToThinoWithTextAppend=s,this.applySettingsUpdate()})}),new Ve(r,this).setTab(n).setName(N("Prepend text when share to Thino")).addText(o=>{o.setPlaceholder(N("Input anything here")).setValue(this.plugin.settings.ShareToThinoWithTextPrepend).onChange(async s=>{this.plugin.settings.ShareToThinoWithTextPrepend=s,this.applySettingsUpdate()})}),new Ve(r,this).setTab(n).setName(N("Add newline when append/prepend text")).addDropdown(async o=>{o.addOption("prepend",N("Prepend")),o.addOption("append",N("Append")),o.addOption("both",N("Both")),o.addOption("none",N("None")),o.setValue(this.plugin.settings.ShareToThinoWithTextNewline).onChange(async s=>{this.plugin.settings.ShareToThinoWithTextNewline=s,this.applySettingsUpdate()})}))}copyMemosSettings(n,r){new Ve(r,this).setName(N("Show Time When Copy Results")).setDesc(N("Show time when you copy results, like 12:00. Copy time by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowTime).onChange(async o=>{this.plugin.settings.ShowTime=o,this.applySettingsUpdate()})),new Ve(r,this).setName(N("Show Date When Copy Results")).setDesc(N("Show date when you copy results, like [[2022-01-01]]. Copy date by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.ShowDate).onChange(async o=>{this.plugin.settings.ShowDate=o,this.applySettingsUpdate(),this.debounceDisplay()})),this.plugin.settings.ShowDate&&new Ve(r,this).setName(N("Add Blank Line Between Different Date")).setDesc(N("Add blank line when copy result with date. No blank line by default.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.AddBlankLineWhenDate).onChange(async o=>{this.plugin.settings.AddBlankLineWhenDate=o,this.applySettingsUpdate()}))}shareMemosSettings(n,r){this.customMemoFooter(n,r),new Ve(r,this).setName(N("Custom Background Image")).setDesc(N("Set custom background image.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomBackgroundImage).onChange(async o=>{this.plugin.settings.SetCustomBackgroundImage=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomBackgroundImage&&(new Ve(r,this).setName(N("Background Image in Light Theme")).setDesc(N('Set background image in light theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new z2(a.inputEl),a.setPlaceholder(cs.DefaultLightBackgroundImage).setValue(this.plugin.settings.DefaultLightBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultLightBackgroundImage=o,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Background Image in Dark Theme")).setDesc(N('Set background image in dark theme. Set something like "Daily/one.png"')).setTab(n).addText(a=>{new z2(a.inputEl),a.setPlaceholder(cs.DefaultDarkBackgroundImage).setValue(this.plugin.settings.DefaultDarkBackgroundImage).onChange(async o=>{this.plugin.settings.DefaultDarkBackgroundImage=o,this.applySettingsUpdate()})}))}customMemoFooter(n,r){new Ve(r,this).setName(N("Custom Memo Footer")).setDesc(N("Set custom memo footer.")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.SetCustomMemoFooter).onChange(async o=>{this.plugin.settings.SetCustomMemoFooter=o,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.SetCustomMemoFooter&&(new Ve(r,this).setName(N("Share Memos Image Footer Start")).setDesc(N("Set anything you want here, use {ThinoNum} to display Number of thino, {UsedDay} for days. '{ThinoNum} Thino {UsedDay} Days' By default")).setTab(n).addText(a=>a.setPlaceholder(cs.ShareFooterStart).setValue(this.plugin.settings.ShareFooterStart).onChange(async o=>{this.plugin.settings.ShareFooterStart=o,this.applySettingsUpdate()})),new Ve(r,this).setName(N("Share Memos Image Footer End")).setDesc(N("Set anything you want here, use {UserName} as your username. '✍️ By {UserName}' By default")).setTab(n).addText(a=>a.setPlaceholder(cs.ShareFooterEnd).setValue(this.plugin.settings.ShareFooterEnd).onChange(async o=>{this.plugin.settings.ShareFooterEnd=o,this.applySettingsUpdate()})))}saveDataSettings(n,r){let a;new Ve(r,this).setName(N("Default Editor Mode")).setDesc(N("Live-Preview Mode OR Source Mode.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("obsidian",N("Live-preview")),a.addOption("memos",N("Source")),a.setValue(this.plugin.settings.EditorType).onChange(async s=>{this.plugin.settings.EditorType=s,this.applySettingsUpdate()})}),new Ve(r,this).setName(N("Delete Thino Directly")).setDesc(N("When delete thino directly, it will not be moved to trash. False by default.")).setTab(n).addToggle(o=>{o.setValue(this.plugin.settings.DeleteThinoDirectly).onChange(async s=>{this.plugin.settings.DeleteThinoDirectly=s,this.applySettingsUpdate()})})}async initHttpServer(n,r){var d;const a=Xe.getState().verifyState,o=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),s=C.Platform.isDesktop?await vn():o.identifier||o.uuid,c=a&&(a==null?void 0:a.appId)===s;new Ve(n,this).setName(N("Enable Local Http Server")).setTab(r).setDisabled(!c).addToggle(p=>p.setValue(this.plugin.settings.EnabledHttpApi).onChange(async m=>{if(!c){qt();return}this.plugin.settings.EnabledHttpApi=m,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.settings.EnabledHttpApi?this.plugin.initServer():this.plugin.stopServer(),this.display()},100)})),this.plugin.settings.EnabledHttpApi&&(new Ve(n,this).setName(N("Memos Http Server Port")).setDesc(N("Set memos http server port to listen. '43999' by default")).setTab(r).addText(p=>p.setPlaceholder(cs.HttpApiPort).setValue(this.plugin.settings.HttpApiPort).onChange(async m=>{if(!c){qt();return}this.plugin.settings.HttpApiPort=m,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})),new Ve(n,this).setName(N("Auto Download Image")).setDesc(N("Auto download image when save to thino. 'false' by default")).setTab(r).setDisabled(!c).addToggle(p=>{p.setValue(this.plugin.settings.AutoDownloadImage).onChange(async m=>{if(!c){qt();return}this.plugin.settings.AutoDownloadImage=m,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}),new Ve(n,this).setName(N("Thino Http IP Type")).setDesc(N("Set Thino http server ip to listen. 'localhost' by default")).setTab(r).addDropdown(p=>{p.addOption("localhost","localhost"),p.addOption("127.0.0.1","127.0.0.1"),p.setValue(this.plugin.settings.HttpApiIpType).onChange(async m=>{if(!a||(a==null?void 0:a.appId)!==s){qt();return}this.plugin.settings.HttpApiIpType=m,this.applySettingsUpdate(),setTimeout(()=>{this.plugin.stopServer(),this.plugin.initServer()},1e3)})}))}fetchDataSettings(n,r){let a;new Ve(r,this).setName(N("Use which plugin's default configuration")).setDesc(N("Memos use the plugin's default configuration to fetch memos from daily, 'Daily' by default.")).setTab(n).addDropdown(async o=>{a=o,a.addOption("Daily",N("Daily")),a.addOption("Periodic","Periodic"),a.setValue(this.plugin.settings.UseDailyOrPeriodic).onChange(async s=>{this.plugin.settings.UseDailyOrPeriodic=s,this.applySettingsUpdate()})})}navigationSettings(n,r){new Ve(r,this).setName(N("Open link directly in Thino view")).setTab(n).addToggle(a=>a.setValue(this.plugin.settings.navigation).onChange(async o=>{this.plugin.settings.navigation=o,this.applySettingsUpdate()}))}setPasswordSettings(n,r){new Ve(r,this).setName(N("Need password to unlock Thino")).setTab(n).addToggle(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.toggleEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new Z2(this.app,this,this.plugin,s=>{a.setDisabled(!s),this.passwordMatched=s,this.debounceDisplay()}).open(),new C.Notice(N("Please input your password to change password settings")))}),a.setDisabled(this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched).setValue(this.plugin.settings.needVerify).onChange(async o=>{this.plugin.settings.needVerify=o,o&&(this.passwordMatched=!1),this.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.needVerify&&new Ve(r,this).setName(N("Password to lock Thino")).setTab(n).addText(a=>{this.plugin.settings.needVerify&&this.plugin.settings.password&&!this.passwordMatched&&(a.inputEl.onclick=o=>{this.passwordMatched||(o.preventDefault(),new Z2(this.app,this,this.plugin,s=>{a.inputEl.readOnly=!s,this.passwordMatched=s,this.debounceDisplay()}).open(),new C.Notice(N("Please input your password to change password settings")))}),a.inputEl.readOnly=this.plugin.settings.password&&this.plugin.settings.needVerify&&!this.passwordMatched,a.inputEl.oncopy=()=>!1,a.inputEl.type="password",a.setValue(this.plugin.settings.password).onChange(async o=>{this.plugin.settings.password=o,this.applySettingsUpdate()})})}setGlobalSettings(n,r,a){new Ve(r,this).setHeading().setTab(n).setName("💎 "+N("Pro features")),this.initHttpServer(r,n),new Ve(r,this).setName(N("Enable opening thino globally")).setDesc(N("Enable opening thino globally. False by default.")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.EnableCaptureKey).onChange(async s=>{if(!a){qt();return}this.plugin.settings.CaptureKey.EnableCaptureKey=s,this.applySettingsUpdate(),setTimeout(()=>{this.display()},100)})),this.plugin.settings.CaptureKey.EnableCaptureKey&&(new Ve(r,this).setName(N("Key for opening thino globally")).setDesc(N("Set key for opening thino globally. CTRL + SHIFT + T by default.")).setTab(n).addText(o=>o.setPlaceholder(cs.CaptureKey.OpenThinoGlobally).setValue(this.plugin.settings.CaptureKey.OpenThinoGlobally).onChange(async s=>{if(!a){qt();return}this.plugin.settings.CaptureKey.OpenThinoGlobally=s,this.applySettingsUpdate()})),new Ve(r,this).setName(N("Show thino near mouse")).setTab(n).addToggle(o=>o.setValue(this.plugin.settings.CaptureKey.ShowNearMouse).onChange(async s=>{if(!a){qt();return}this.plugin.settings.CaptureKey.ShowNearMouse=s,this.applySettingsUpdate()})))}checkInList(n){return this.plugin.settings.EnabledLocationList.find(r=>r.value===n)!==void 0}customFileNameSettings(n,r,a){var d;const o=document.createDocumentFragment(),s=o.createEl("div",{cls:"memo-save-location-desc"});for(const p of bx){const m=s.createEl("div",{cls:`memo-save-location-desc-item ${p.value}`}),g=m.createEl("span",{cls:"memo-save-location-desc-item-icon"});C.setIcon(g,((d=tp.find(E=>E.title===p.value))==null?void 0:d.icon)||""),m.createEl("span",{cls:"memo-save-location-desc-item-desc",text:`${N(p.value)}`});const v=m.createEl("span",{cls:"memo-save-location-desc-item-toggle"}),D=m.createEl("span",{cls:"memo-save-location-desc-item-setting"});p.value!=="DAILY"&&m.createEl("span",{cls:["memo-save-location-desc-item-pro","user-pro-badge"],text:"PRO"}),new C.ToggleComponent(v).setValue(this.checkInList(p.value)).onChange(async E=>{if(!a){qt();return}E?(await Te.updateTypeMemos(p.value),this.plugin.settings.EnabledLocationList=[...this.plugin.settings.EnabledLocationList,p]):(await Te.removeTypeMemos(p.value),this.plugin.settings.EnabledLocationList=this.plugin.settings.EnabledLocationList.filter(O=>O.value!==p.value)),this.plugin.settings.EnabledLocationList.length===1&&(this.plugin.settings.MemoSaveLocation=p.value),this.applySettingsUpdate(),setTimeout(()=>{this.display()},500)}).setDisabled(this.plugin.settings.EnabledLocationList.length===1&&this.checkInList(p.value)),new C.ExtraButtonComponent(D).setIcon("settings").onClick(()=>{new OK(this.app,this,this.plugin,p,a).open()})}const c=new Ve(r,this).setName(N("Save type for Thino")).setDesc(o).setTab(n);c.settingEl.toggleClass("memo-save-location-setting",!0),c.nameEl.toggleClass("memo-save-location-title",!0)}}class OK extends C.Modal{constructor(n,r,a,o,s){super(n);me(this,"plugin");me(this,"settingTab");me(this,"LocationList");me(this,"target","");me(this,"insertTarget","");me(this,"verified");me(this,"updateValue",C.debounce(n=>{this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target=n.trim()===""?"basic":n.trim():this.target=n.trim()===""&&this.LocationList.value==="MULTI"?"Memos":n.trim()},400,!0));me(this,"debounceDisplay",C.debounce(()=>this.display(),400,!0));this.verified=s,this.app=n,this.settingTab=r,this.plugin=a,this.LocationList=o,this.target=o.target!=="ProcessEntriesBelow"?a.settings.MemoOtherSaveLocation[o.target]:a.settings[o.target],this.insertTarget=a.settings.InsertAfter}onOpen(){this.display()}async display(){var d;const{contentEl:n}=this;this.contentEl.empty(),(d=n.parentElement)==null||d.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(N("Save type for Thino")+` [${N(this.LocationList.value)}]`),(this.LocationList.value==="FILE"||this.LocationList.value==="CANVAS")&&n.createDiv("modal-desc",p=>{p.setText(N('You can set folder name with file name like "folder/file"'))}),this.LocationList.value==="MULTI"&&n.createDiv("modal-desc",p=>{p.setText(N('You can set folder name like "folder1/folder2/folder3" to create sub-folder'))}),this.LocationList.value==="DAILY"&&n.createDiv("modal-desc",p=>{p.setText(N('You can set target heading like "# Heading" to control data location'))});const r=n.createDiv("modal-setting"),a=this.LocationList.value==="DAILY"?N("Process Memos below"):this.LocationList.value==="MULTI"?N("Set the folder name"):N("Set the filename");if(this.LocationList.value==="DAILY"&&(new Ve(r,this.settingTab).setName(N("Set thino insert place")).setDesc(N("Set where to insert thino content")).addDropdown(async p=>{p.addOption("end",N("End of the diary")),p.addOption("custom",N("Custom location")),p.setValue(this.plugin.settings.InsertType).onChange(async m=>{this.plugin.settings.InsertType=m,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})}),this.plugin.settings.InsertType==="custom"&&await this.addDailySettings(r),new Ve(r,this.settingTab).setName(N("Set process target")).setDesc(N("You can set whole diary or only part of it")).addDropdown(async p=>{p.addOption("custom",N("Custom")),p.addOption("whole",N("Whole diary")),p.setValue(this.plugin.settings.ProcessContentTarget).onChange(async m=>{this.plugin.settings.ProcessContentTarget=m,this.settingTab.applySettingsUpdate(),this.debounceDisplay()})})),this.LocationList.value!=="DAILY"||this.plugin.settings.ProcessContentTarget!=="whole"){const p=new Ve(r,this.settingTab).setName(a).addText(m=>m.setPlaceholder(this.LocationList.value==="DAILY"?N("# Heading"):N("Set the filename for current location file")).setValue(this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"?this.target.replace(/\.thino\.(canvas|md)/g,""):this.target).onChange(async g=>{const v=this.LocationList.value==="CANVAS"?".thino.canvas":this.LocationList.value==="FILE"?".thino.md":"";this.updateValue(g.replace(/\.thino\.(canvas|md)/g,"")+v)}));this.LocationList.value==="DAILY"&&p.setDesc(N("If left blank, the Thino interface will display all thino record contents; if a title is provided, the Thino interface will only display the contents under that title, and contents written elsewhere will not be shown.")),this.LocationList.value!=="DAILY"&&this.LocationList.value!=="MULTI"&&p.controlEl.createEl("span",{text:`${this.LocationList.value==="FILE"?".thino.md":".thino.canvas"}`})}const o=n.createDiv("button-group"),s=o.createEl("button",{text:N("Cancel")}),c=o.createEl("button",{text:N("Save")});c.onclick=async()=>{if(!this.verified&&this.LocationList.value!=="DAILY"){this.close(),qt();return}this.LocationList.target!=="ProcessEntriesBelow"?this.plugin.settings.MemoOtherSaveLocation[this.LocationList.target]=this.target:this.plugin.settings[this.LocationList.target]=this.target,this.LocationList.value==="MULTI"&&Ue.checkDailyInMulti(this.plugin.settings),this.LocationList.target==="ProcessEntriesBelow"&&(this.plugin.settings.InsertAfter=this.insertTarget),this.settingTab.applySettingsUpdate(),setTimeout(()=>{Te.updateTypeMemos(this.LocationList.value)},1e3),this.close()},s.onclick=async()=>{this.close()}}async addDailySettings(n){var d,p,m,g;const r=Xe.getState().verifyState,a=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),o=C.Platform.isDesktop?await vn():a.identifier||a.uuid,s=r&&(r==null?void 0:r.appId)===o,c=((p=this.plugin.settings)!=null&&p.DifferentInsertTarget?`[${N("List")}] `:"")+N("Insert after heading");new Ve(n,this.settingTab).setName(c).setDesc(N("If left blank, the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.")).addText(v=>v.setPlaceholder(N("# Heading")).setValue(this.insertTarget).onChange(async D=>{this.insertTarget=D})),(m=this.plugin.settings)!=null&&m.DifferentInsertTarget&&new Ve(n,this.settingTab).setName(((g=this.plugin.settings)!=null&&g.DifferentInsertTarget?`[${N("Task")}] `:"")+N("Insert after heading")).setDesc(N("Set the heading for the task type of thino, by default the recorded thino content will be inserted at the end of the diary; if a title is provided, all recorded thino content will be uniformly categorized under that title.")).addText(v=>{v.setPlaceholder(N("# Heading")).setValue(this.plugin.settings.InsertAfterForTask).onChange(async D=>{this.plugin.settings.InsertAfterForTask=D,this.settingTab.applySettingsUpdate()})}),new Ve(n,this.settingTab).setName(N("Different insert target for different type")).setDesc(N("Toggle this to set different insert target for different type of thino, like task or list type of thino")).addToggle(v=>v.setValue(this.plugin.settings.DifferentInsertTarget).onChange(async D=>{if(!s){qt();return}this.plugin.settings.DifferentInsertTarget=D,this.settingTab.applySettingsUpdate(),this.debounceDisplay()}))}onClose(){const{contentEl:n}=this;n.empty()}}class Z2 extends C.Modal{constructor(n,r,a,o){super(n);me(this,"plugin");me(this,"settingTab");this.cb=o,this.app=n,this.settingTab=r,this.plugin=a}onOpen(){var d;const{contentEl:n}=this;(d=n.parentElement)==null||d.classList.add("memo-save-location-modal"),this.titleEl.toggleClass("modal-title",!0),this.titleEl.setText(N("Password for Thino")),n.createDiv("modal-desc",p=>{p.setText(N("Please input your password to change password settings"))});const r=n.createDiv("modal-setting"),a=new Ve(r,this.settingTab).setName(N("Password")).addText(p=>{p.setPlaceholder(N("Please input your password")).inputEl.type="password"}),o=n.createDiv("button-group"),s=o.createEl("button",{text:N("Cancel")}),c=o.createEl("button",{cls:"thino-password-confirm-btn",text:N("Confirm?").replace(/(\?|)/g,"")});c.onclick=async()=>{var p;a.controlEl.querySelector("input").value===this.plugin.settings.password?((p=this.cb)==null||p.call(this,!0),this.close()):new C.Notice(N("Password is incorrect"))},s.onclick=async()=>{this.close()}}onClose(){const{contentEl:n}=this;n.empty()}}function fv(e){return e.split("-")[0]}function Dx(e){return e.split("-")[1]}function yb(e){return["top","bottom"].includes(fv(e))?"x":"y"}function Sx(e){return e==="y"?"height":"width"}function W2(e){let{reference:t,floating:n,placement:r}=e;const a=t.x+t.width/2-n.width/2,o=t.y+t.height/2-n.height/2;let s;switch(fv(r)){case"top":s={x:a,y:t.y-n.height};break;case"bottom":s={x:a,y:t.y+t.height};break;case"right":s={x:t.x+t.width,y:o};break;case"left":s={x:t.x-n.width,y:o};break;default:s={x:t.x,y:t.y}}const c=yb(r),d=Sx(c);switch(Dx(r)){case"start":s[c]=s[c]-(t[d]/2-n[d]/2);break;case"end":s[c]=s[c]+(t[d]/2-n[d]/2);break}return s}const PK=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:s}=n;let c=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:d,y:p}=W2({...c,placement:r}),m=r,g={};for(let v=0;v<o.length;v++){const{name:D,fn:S}=o[v],{x:T,y:E,data:O,reset:k}=await S({x:d,y:p,initialPlacement:r,placement:m,strategy:a,middlewareData:g,rects:c,platform:s,elements:{reference:e,floating:t}});if(d=T??d,p=E??p,g={...g,[D]:O??{}},k){typeof k=="object"&&(k.placement&&(m=k.placement),k.rects&&(c=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:d,y:p}=W2({...c,placement:m})),v=-1;continue}}return{x:d,y:p,placement:m,strategy:a,middlewareData:g}};function jK(e){return{top:0,right:0,bottom:0,left:0,...e}}function LK(e){return typeof e!="number"?jK(e):{top:e,right:e,bottom:e,left:e}}function e1(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}async function t1(e,t){t===void 0&&(t={});const{x:n,y:r,platform:a,rects:o,elements:s,strategy:c}=e,{boundary:d="clippingParents",rootBoundary:p="viewport",elementContext:m="floating",altBoundary:g=!1,padding:v=0}=t,D=LK(v),T=s[g?m==="floating"?"reference":"floating":m],E=await a.getClippingClientRect({element:await a.isElement(T)?T:T.contextElement||await a.getDocumentElement({element:s.floating}),boundary:d,rootBoundary:p}),O=e1(await a.convertOffsetParentRelativeRectToViewportRelativeRect({rect:m==="floating"?{...o.floating,x:n,y:r}:o.reference,offsetParent:await a.getOffsetParent({element:s.floating}),strategy:c}));return{top:E.top-O.top+D.top,bottom:O.bottom-E.bottom+D.bottom,left:E.left-O.left+D.left,right:O.right-E.right+D.right}}const RK={left:"right",right:"left",bottom:"top",top:"bottom"};function Ny(e){return e.replace(/left|right|bottom|top/g,t=>RK[t])}function BK(e,t){const n=Dx(e)==="start",r=yb(e),a=Sx(r);let o=r==="x"?n?"right":"left":n?"bottom":"top";return t.reference[a]>t.floating[a]&&(o=Ny(o)),{main:o,cross:Ny(o)}}const _K={start:"end",end:"start"};function $2(e){return e.replace(/start|end/g,t=>_K[t])}function HK(e){const t=Ny(e);return[$2(e),t,$2(t)]}const YK=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:s,initialPlacement:c}=t;if((n=o.flip)!=null&&n.skip)return{};const{mainAxis:d=!0,crossAxis:p=!0,fallbackPlacements:m,fallbackStrategy:g="bestFit",flipAlignment:v=!0,...D}=e,S=fv(a),E=m||(S===c||!v?[Ny(c)]:HK(c)),O=[c,...E],k=await t1(t,D),j=[];let F=((r=o.flip)==null?void 0:r.overflows)||[];if(d&&j.push(k[S]),p){const{main:H,cross:Y}=BK(a,s);j.push(k[H],k[Y])}if(F=[...F,{placement:a,overflows:j}],!j.every(H=>H<=0)){var B,R;const H=((B=(R=o.flip)==null?void 0:R.index)!=null?B:0)+1,Y=O[H];if(Y)return{data:{index:H,overflows:F},reset:{placement:Y}};let U="bottom";switch(g){case"bestFit":{var z;const J=(z=F.slice().sort((Q,le)=>Q.overflows.filter(pe=>pe>0).reduce((pe,ie)=>pe+ie,0)-le.overflows.filter(pe=>pe>0).reduce((pe,ie)=>pe+ie,0))[0])==null?void 0:z.placement;J&&(U=J);break}case"initialPlacement":U=c;break}return{data:{skip:!0},reset:{placement:U}}}return{}}}};function zK(e){let{placement:t,rects:n,value:r}=e;const a=fv(t),o=["left","top"].includes(a)?-1:1,s=typeof r=="function"?r({...n,placement:t}):r,{mainAxis:c,crossAxis:d}=typeof s=="number"?{mainAxis:s,crossAxis:0}:{mainAxis:0,crossAxis:0,...s};return yb(a)==="x"?{x:d,y:c*o}:{x:c*o,y:d}}const UK=function(e){return e===void 0&&(e=0),{name:"offset",options:e,fn(t){const{x:n,y:r,placement:a,rects:o}=t,s=zK({placement:a,rects:o,value:e});return{x:n+s.x,y:r+s.y,data:s}}}};function vb(e){return(e==null?void 0:e.toString())==="[object Window]"}function xl(e){if(e==null)return window;if(!vb(e)){const t=e.ownerDocument;return t&&t.defaultView||window}return e}function hv(e){return xl(e).getComputedStyle(e)}function vs(e){return vb(e)?"":e?(e.nodeName||"").toLowerCase():""}function ws(e){return e instanceof xl(e).HTMLElement}function ky(e){return e instanceof xl(e).Element}function VK(e){return e instanceof xl(e).Node}function Ix(e){const t=xl(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function pv(e){const{overflow:t,overflowX:n,overflowY:r}=hv(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function ZK(e){return["table","td","th"].includes(vs(e))}function Tx(e){const t=navigator.userAgent.toLowerCase().includes("firefox"),n=hv(e);return n.transform!=="none"||n.perspective!=="none"||n.contain==="paint"||["transform","perspective"].includes(n.willChange)||t&&n.willChange==="filter"||t&&(n.filter?n.filter!=="none":!1)}const G2=Math.min,Xh=Math.max,Ay=Math.round;function Ld(e,t){t===void 0&&(t=!1);const n=e.getBoundingClientRect();let r=1,a=1;return t&&ws(e)&&(r=e.offsetWidth>0&&Ay(n.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Ay(n.height)/e.offsetHeight||1),{width:n.width/r,height:n.height/a,top:n.top/a,right:n.right/r,bottom:n.bottom/a,left:n.left/r,x:n.left/r,y:n.top/a}}function Ml(e){return((VK(e)?e.ownerDocument:e.document)||window.document).documentElement}function mv(e){return vb(e)?{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}:{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Ex(e){return Ld(Ml(e)).left+mv(e).scrollLeft}function WK(e){const t=Ld(e);return Ay(t.width)!==e.offsetWidth||Ay(t.height)!==e.offsetHeight}function $K(e,t,n){const r=ws(t),a=Ml(t),o=Ld(e,r&&WK(t));let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if(r||!r&&n!=="fixed")if((vs(t)!=="body"||pv(a))&&(s=mv(t)),ws(t)){const d=Ld(t,!0);c.x=d.x+t.clientLeft,c.y=d.y+t.clientTop}else a&&(c.x=Ex(a));return{x:o.left+s.scrollLeft-c.x,y:o.top+s.scrollTop-c.y,width:o.width,height:o.height}}function gv(e){return vs(e)==="html"?e:e.assignedSlot||e.parentNode||(Ix(e)?e.host:null)||Ml(e)}function q2(e){return!ws(e)||getComputedStyle(e).position==="fixed"?null:e.offsetParent}function GK(e){let t=gv(e);for(;ws(t)&&!["html","body"].includes(vs(t));){if(Tx(t))return t;t=t.parentNode}return null}function n1(e){const t=xl(e);let n=q2(e);for(;n&&ZK(n)&&getComputedStyle(n).position==="static";)n=q2(n);return n&&(vs(n)==="html"||vs(n)==="body"&&getComputedStyle(n).position==="static"&&!Tx(n))?t:n||GK(e)||t}function J2(e){return{width:e.offsetWidth,height:e.offsetHeight}}function qK(e){let{rect:t,offsetParent:n,strategy:r}=e;const a=ws(n),o=Ml(n);if(n===o)return t;let s={scrollLeft:0,scrollTop:0};const c={x:0,y:0};if((a||!a&&r!=="fixed")&&((vs(n)!=="body"||pv(o))&&(s=mv(n)),ws(n))){const d=Ld(n,!0);c.x=d.x+n.clientLeft,c.y=d.y+n.clientTop}return{...t,x:t.x-s.scrollLeft+c.x,y:t.y-s.scrollTop+c.y}}function JK(e){const t=xl(e),n=Ml(e),r=t.visualViewport;let a=n.clientWidth,o=n.clientHeight,s=0,c=0;return r&&(a=r.width,o=r.height,Math.abs(t.innerWidth/r.scale-r.width)<.01&&(s=r.offsetLeft,c=r.offsetTop)),{width:a,height:o,x:s,y:c}}function KK(e){var t;const n=Ml(e),r=mv(e),a=(t=e.ownerDocument)==null?void 0:t.body,o=Xh(n.scrollWidth,n.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),s=Xh(n.scrollHeight,n.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0);let c=-r.scrollLeft+Ex(e);const d=-r.scrollTop;return hv(a||n).direction==="rtl"&&(c+=Xh(n.clientWidth,a?a.clientWidth:0)-o),{width:o,height:s,x:c,y:d}}function Cx(e){return["html","body","#document"].includes(vs(e))?e.ownerDocument.body:ws(e)&&pv(e)?e:Cx(gv(e))}function xx(e,t){var n;t===void 0&&(t=[]);const r=Cx(e),a=r===((n=e.ownerDocument)==null?void 0:n.body),o=xl(r),s=a?[o].concat(o.visualViewport||[],pv(r)?r:[]):r,c=t.concat(s);return a?c:c.concat(xx(gv(s)))}function QK(e,t){const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Ix(n)){let r=t;do{if(r&&e===r)return!0;r=r.parentNode||r.host}while(r)}return!1}function XK(e){const t=Ld(e),n=t.top+e.clientTop,r=t.left+e.clientLeft;return{top:n,left:r,x:r,y:n,right:r+e.clientWidth,bottom:n+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}function K2(e,t){return t==="viewport"?e1(JK(e)):ky(t)?XK(t):e1(KK(Ml(e)))}function eQ(e){const t=xx(gv(e)),r=["absolute","fixed"].includes(hv(e).position)&&ws(e)?n1(e):e;return ky(r)?t.filter(a=>ky(a)&&QK(a,r)&&vs(a)!=="body"):[]}function tQ(e){let{element:t,boundary:n,rootBoundary:r}=e;const o=[...n==="clippingParents"?eQ(t):[].concat(n),r],s=o[0],c=o.reduce((d,p)=>{const m=K2(t,p);return d.top=Xh(m.top,d.top),d.right=G2(m.right,d.right),d.bottom=G2(m.bottom,d.bottom),d.left=Xh(m.left,d.left),d},K2(t,s));return c.width=c.right-c.left,c.height=c.bottom-c.top,c.x=c.left,c.y=c.top,c}const nQ={getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:$K(t,n1(n),r),floating:{...J2(n),x:0,y:0}}},convertOffsetParentRelativeRectToViewportRelativeRect:e=>qK(e),getOffsetParent:e=>{let{element:t}=e;return n1(t)},isElement:e=>ky(e),getDocumentElement:e=>{let{element:t}=e;return Ml(t)},getClippingClientRect:e=>tQ(e),getDimensions:e=>{let{element:t}=e;return J2(t)},getClientRects:e=>{let{element:t}=e;return t.getClientRects()}},rQ=(e,t,n)=>PK(e,t,{platform:nQ,...n});var aQ=function e(t,n){if(t===n)return!0;if(t&&n&&typeof t=="object"&&typeof n=="object"){if(t.constructor!==n.constructor)return!1;var r,a,o;if(Array.isArray(t)){if(r=t.length,r!=n.length)return!1;for(a=r;a--!==0;)if(!e(t[a],n[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if(o=Object.keys(t),r=o.length,r!==Object.keys(n).length)return!1;for(a=r;a--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[a]))return!1;for(a=r;a--!==0;){var s=o[a];if(!e(t[s],n[s]))return!1}return!0}return t!==t&&n!==n};const oQ=er(aQ),iw=ep.Facet.define({combine:e=>{var t,n;return{defaultPlacement:((t=e.find(r=>r.defaultPlacement))==null?void 0:t.defaultPlacement)||"top",padding:((n=e.find(r=>r.padding))==null?void 0:n.padding)||8}}}),Mx=e=>e.split("-")[0],iQ=e=>e==="x"?"y":"x",sQ=e=>["top","bottom"].includes(Mx(e))?"x":"y",_h=(e,t,n)=>Math.max(e,Math.min(t,n)),lQ=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r],a)=>[n,t(r,n,a)])),uQ=e=>e===void 0?e:typeof e=="number"?-e:lQ(e,t=>t!==void 0?-t:t),cQ=(e={})=>({name:"shift",fn:async t=>{const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c=({x:E,y:O})=>({x:E,y:O}),editorMenu:d,...p}=e,m={x:n,y:r},g=await t1(t,p),v=sQ(Mx(a)),D=iQ(v);let S=m[v],T=m[D];if(o){const E=v==="y"?"top":"left",O=v==="y"?"bottom":"right",k=S+g[E],j=S-g[O];if(d){const F=await t1(t,{...p,boundary:d.dom,padding:uQ(p.padding)});if((D==="y"?["top","bottom"]:["left","right"]).every(R=>F[R]<=0)){const R=t.rects.floating.width,z=S+F[E]-R,H=S-F[O]+R,Y=Math.abs(g[E]-F[E]),U=Math.abs(g[O]-F[O]);Y>=R||U<Y?S=_h(k,S,z):S=_h(H,S,j)}else S=_h(k,S,j)}else S=_h(k,S,j)}if(s){const E=D==="y"?"top":"left",O=D==="y"?"bottom":"right",k=T+g[E],j=T-g[O];T=_h(k,T,j)}return c({...t,[v]:S,[D]:T})}}),dQ="thino-mini-toolbar",fQ=(e=0,t=0)=>({width:0,height:0,top:t,left:e,bottom:t,right:e,x:e,y:t}),hQ=(e,t)=>{if(!e)return null;const n=Math.min(e.left,(t==null?void 0:t.left)??e.left),r=Math.max(e.right,(t==null?void 0:t.right)??e.right),a=Math.max(e.bottom,(t==null?void 0:t.bottom)??e.bottom)-Math.min(e.top,(t==null?void 0:t.top)??e.top),o=Math.min(e.top,(t==null?void 0:t.top)??e.top),s=o+a,c={left:n,right:r,top:o,bottom:s,width:0,height:a,x:o,y:n};return t&&(c.width=Math.abs(r-n)),c},pQ=fQ();class mQ{constructor(t){me(this,"containerEl");me(this,"virtualEl");me(this,"toolbar",null);me(this,"isThinoView");me(this,"tooltipInfo");me(this,"inView",!0);me(this,"defaultPlacement");me(this,"editorMenu");me(this,"cachedRefRect",null);me(this,"readFromDOM",()=>{if(this.tooltipInfo){const{start:t}=this.tooltipInfo;let{end:n}=this.tooltipInfo;n&&t===n&&(n=void 0);const r=this.view.coordsAtPos(t);let a=n?this.view.coordsAtPos(n):null;if(r&&a&&r.top!==a.top){const s=this.view.contentDOM.getBoundingClientRect();a={left:s.right,right:s.right,top:r.top,bottom:r.bottom}}const o=hQ(r,a);o&&(this.cachedRefRect=o,this.computePosition(o))}});this.view=t,this.containerEl=this.view.dom.parentElement,this.defaultPlacement=this.view.state.facet(iw).defaultPlacement,this.tooltipInfo=t.state.facet(r1),this.virtualEl={rect:pQ,getBoundingClientRect(){return this.rect}},this.maybeMeasure(),this.editorMenu={currMenu:null,evtRef:t.state.field(C.editorInfoField)},this.isThinoView=this.checkThinoView()}get workspace(){return this.view.state.field(C.editorInfoField).app.workspace}checkThinoView(){return this.view.state.field(C.editorInfoField)&&this.view.state.field(C.editorInfoField)instanceof wl}shouldRemoveToolbar(t){const n=t??this.tooltipInfo;return!(n!=null&&n.end||this.editorMenu.currMenu)}onEditorMenuOpen(t){this.editorMenu.currMenu||(this.editorMenu.currMenu=t,this.cachedRefRect?this.computePosition(this.cachedRefRect):this.maybeMeasure(),!C.Platform.isMacOS&&this.tooltipInfo&&(this.createToolbar(),this.maybeMeasure()))}onEditorMenuClose(t){this.editorMenu.currMenu===t&&(this.editorMenu.currMenu=null),!C.Platform.isMacOS&&this.toolbar&&this.shouldRemoveToolbar()&&this.removeToolbar()}createToolbar(t){const n=t??this.tooltipInfo;if(!n)return;this.removeToolbar();const r=n.create(this.containerEl),a=this.view.state.field(C.editorInfoField);if(!a||!(a!=null&&a.editor))return;const o=a.editor.offsetToPos(n.start),s=n.end?a.editor.offsetToPos(n.end):o;this.workspace.trigger(dQ,r,{from:o,to:s},a.editor,a),this.toolbar=r}removeToolbar(){this.toolbar&&(this.toolbar.hide(),this.toolbar=null)}update(t){if(!this.isThinoView)return;const n=t.state.facet(r1),r=n!==this.tooltipInfo&&!oQ(n,this.tooltipInfo);r&&(this.tooltipInfo=n,this.shouldRemoveToolbar()?this.removeToolbar():n&&!this.toolbar&&this.createToolbar(n));const a=r||t.geometryChanged,o=t.state.facet(iw);o.defaultPlacement!=this.defaultPlacement&&(o.defaultPlacement=this.defaultPlacement),a&&this.maybeMeasure()}destroy(){this.editorMenu.currMenu=null,this.removeToolbar(),this.toolbar=null,this.view.state.field(C.editorInfoField).app.workspace.offref(this.editorMenu.evtRef)}async computePosition(t){if(!this.toolbar)return;this.virtualEl.rect=t;const{padding:n}=this.view.state.facet(iw),{x:r,y:a}=await rQ(this.virtualEl,this.toolbar.dom,{placement:this.defaultPlacement,middleware:[UK({mainAxis:5}),YK({padding:n,boundary:this.view.scrollDOM}),cQ({padding:n,boundary:this.view.scrollDOM,editorMenu:this.editorMenu.currMenu})]});Object.assign(this.toolbar.dom.style,{top:"0",left:"0",transform:`translate(${Math.round(r)}px,${Math.round(a)}px)`})}maybeMeasure(){this.view.inView&&this.toolbar&&this.view.requestMeasure({read:this.readFromDOM}),this.inView!=this.view.inView&&(this.inView=this.view.inView,this.inView||this.removeToolbar())}}const gQ=Ci.ViewPlugin.fromClass(mQ,{eventHandlers:{scroll(){this.maybeMeasure()}}}),r1=ep.Facet.define({enables:[gQ],combine:e=>e.filter(t=>t!=null).first()??null}),yQ=e=>{const t=SQ(e);t&&window.navigator.clipboard.writeText(t==null?void 0:t.getSelection())},vQ=e=>{e.commands.executeCommandById("editor:toggle-bold",e)},wQ=e=>{e.commands.executeCommandById("editor:toggle-strikethrough",e)},bQ=e=>{e.commands.executeCommandById("editor:toggle-highlight",e)},DQ=e=>{e.commands.executeCommandById("editor:toggle-italics",e)},SQ=e=>{const{editor:t}=e.field(C.editorInfoField);return t},Q2=(e,t)=>{const n=e.selection.ranges[0];if(!n)return null;const{anchor:r,head:a,empty:o}=n,[s,c]=[r,a].sort();return{start:s,end:o?void 0:c,create:p=>new CQ(p).addSmallButton(g=>g.setClass("clickable-icon").setIcon("copy").onClick(()=>yQ(e))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("bold").onClick(()=>vQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("italic").onClick(()=>DQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("strikethrough").onClick(()=>wQ(t))).addSmallButton(g=>g.setClass("clickable-icon").setIcon("highlighter").onClick(()=>bQ(t)))}},IQ=e=>ep.StateField.define({create:t=>Q2(t,e),update:(t,n)=>!n.docChanged&&!n.selection?t:Q2(n.state,e),provide:t=>r1.from(t)}),TQ=e=>[IQ(e)];class EQ extends C.BaseComponent{constructor(n){super();me(this,"button");me(this,"disabled",!1);me(this,"dropdownOptions",[]);me(this,"menu");me(this,"menuOpened",!1);this.button=new C.ButtonComponent(n)}setDisabled(n){return this.button.setDisabled(n),this.disabled=n,this}setIcon(n){return this.button.setIcon(n),this}setClass(n){return this.button.setClass(n),this}setDropdownText(n){var d;const r=this.button.buttonEl.createDiv("mini-toolbar-text"),a=this.button.buttonEl.createDiv("mini-toolbar-icon-with-text");C.setIcon(a,"chevron-down");const o=(d=n.doc.lineAt(n.selection.ranges[0].from))==null?void 0:d.from,s=b0.syntaxTree(n).resolveInner(o+1),c=s.type.prop(b0.tokenClassNodeProp);return r.setText(this.detectFormat(c,s)||"Text"),this}setDropdownIcon(){const n=this.button.buttonEl.createDiv("mini-toolbar-highlight-icon"),r=this.button.buttonEl.createDiv("mini-toolbar-icon-with-icon");return C.setIcon(n,"highlighter"),C.setIcon(r,"chevron-down"),this}detectFormat(n,r){var a;if(!n)return"Text";if(n.includes("strong"))return"Bold";if(n.includes("em"))return"Italic";if(n.includes("strikethrough"))return"Strike";if(n.contains("hmd-codeblock"))return"CodeBlock";if(n.contains("hmd-inline-code"))return"Code";if(n.contains("formatting-header")){const o=n.match(/header-\d{1,}/);if(o)return"Heading "+o[0].slice(-1)}if(n.contains("formatting-list")||n.contains("hmd-list-indent")){if(r!=null&&r.parent){const o=(a=r.parent)==null?void 0:a.type.prop(b0.lineClassNodeProp);if(o!=null&&o.contains("HyperMD-task-line"))return"To-do list"}if(n.contains("formatting-list-ol"))return"Numbered list";if(n.contains("formatting-list-ul"))return"Bulleted list"}}setTooltip(n){return this.button.setTooltip(n),this}setOptionsList(n){return this.dropdownOptions=n,this}onClick(n){return this.dropdownOptions.length>0?(this.button.onClick(r=>this.showEditMenu(r)),this):(this.button.onClick(n),this)}showEditMenu(n){var s,c;if(this.menuOpened=!this.menuOpened,!this.menuOpened)return;this.menu=new C.Menu,this.menu.onHide(()=>{this.menuOpened=!1});const r=n.currentTarget,a=(s=n.currentTarget)==null?void 0:s.getBoundingClientRect(),o={x:a.left-6,y:a.bottom+6};for(let d=0;d<((c=this.dropdownOptions)==null?void 0:c.length);d++)this.menu.addItem(p=>{p.setIcon("zap").setTitle(this.dropdownOptions[d]).onClick(()=>{})});this.menu.setParentElement(r).showAtPosition(o)}then(n){return n(this),this}}class CQ extends C.Component{constructor(n){super();me(this,"dom");me(this,"smallBtnContainer");me(this,"unloading",!1);this.dom=n==null?void 0:n.createDiv({cls:"cm-mini-toolbar"},r=>r.style.position="absolute"),this.smallBtnContainer=this.dom}addSmallButton(n){return n(new EQ(this.smallBtnContainer)),this}hide(){return this.unload(),this.unloading?this:(this.unloading=!0,this.dom.detach(),this.unloading=!1,this)}}const xQ=Ci.Decoration.line({attributes:{"data-ph":N("What do you think now...")},class:"thino-editor-placeholder"}),MQ=ep.StateField.define({create(){return Ci.Decoration.none},update(e,t){const n=t.state.field(C.editorInfoField);if(!(n!=null&&n.view)&&!((n==null?void 0:n.view)instanceof wl))return e;const r=new ep.RangeSetBuilder,a=t.state.doc.toString(),o=t.state.doc.lineAt(0);return(a==null?void 0:a.length)==0&&r.add(o.from,o.from,xQ),r.finish()},provide:e=>Ci.EditorView.decorations.from(e)});function Nx(e){return`userId:${e}`}function NQ(e,t){return`expiryDate:${t}:${e}`}function kQ(e){try{const t=Nx(e==null?void 0:e.appId);return Kn.get([t])[t]||""}catch(t){return console.error(t),""}}function AQ(e,t){try{const n=Nx(t==null?void 0:t.appId);return Kn.set({[n]:e}),{userId:e,key:n}}catch(n){console.error(n)}}function FQ(e,t){try{const n=NQ(kQ(t),t==null?void 0:t.appId);Kn.set({[n]:e})}catch(n){console.error(n)}}const OQ=Ue.grabImageFromUrl,PQ=require("http"),jQ=require("url");function LQ(e){const t=e.indexOf(";base64,"),n=e.substring(5,t),r=e.substr(t+8),a=atob(r),o=new ArrayBuffer(a.length),s=new Uint8Array(o);for(let d=0;d<a.length;d++)s[d]=a.charCodeAt(d);return new Blob([o],{type:n})}const X2=async e=>{const{type:t}=e;if(t.startsWith("image"))try{return`${await S1.upload(e)}`}catch(n){new C.Notice(n)}};function RQ(e){const t=PQ.createServer(async function(n,r){r.setHeader("Access-Control-Allow-Origin","*"),r.setHeader("Access-Control-Allow-Methods","GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE"),r.setHeader("Access-Control-Allow-Headers","Access-Control-Allow-Headers, Origin, Authorization,Accept,x-client-id, X-Requested-With, Content-Type, Access-Control-Request-Method, Access-Control-Request-Headers, hypothesis-client-version"),r.setHeader("Access-Control-Allow-Credentials","true");try{if(n.url){const a=jQ.parse(n.url,!0);if(a.pathname==="/create"&&n.method==="POST"){let o="";n.on("data",s=>{o+=s}),n.on("end",async()=>{const s=JSON.parse(o),{text:c,isList:d,type:p,imageList:m}=s;let g=c;if(!g){r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:null,link:null}));return}new RegExp(/(<([^>]+)>)/g).test(c)&&(g=C.htmlToMarkdown(c));let D=[];const S=[];if(e.AutoDownloadImage){const E=g.match(_u)||[];if(E.length>0){for(const O of E)try{const k=await OQ(O);if(k.size===0)continue;const j=new File([k],"image.png",{type:"image/png"}),F=await X2(j);S.push({oldUrl:O,newUrl:F})}catch(k){console.error(k)}S.forEach(O=>{g=g.replace(O.oldUrl,O.newUrl)}),m&&m.length>0&&(D=await Promise.all(m.map(async O=>{const k=LQ(O);return new File([k],"image.png",{type:"image/png"})})));for(const O of D){const k=await X2(O);g+=`
${k}`}}}const T=await Te.createThino({content:g,isList:d,type:p});T&&(Te.pushMemo(T),He.clearQuery()),r.statusCode=200,r.setHeader("Content-Type","application/json"),r.end(JSON.stringify({status:"success",thino:T,link:`obsidian://thino?openId=${T.id}`}))})}else if(a.pathname==="/search"&&n.method==="GET"){const o=a.query,{keyword:s}=o,c=Te.getThinoViaKeyword(s);r.statusCode=200,r.setHeader("Content-Type","application/json");const d=JSON.stringify({status:"success",thinos:c});r.end(d)}else r.statusCode=404,r.end()}}catch(a){console.error(a),r.statusCode=500,r.end({status:"error",message:a.message})}});return{listen(n,r){try{t.listen({port:parseInt(r),host:n})}catch(a){console.error(a),new C.Notice(N("Thino - Failed to start HTTP server, please check the port is available."))}new C.Notice(`${N("Thino - Started HTTP server on port")} ${r}`)},close(){t.close(),new C.Notice(N("Thino - Terminated HTTP server"))}}}const{clipboard:gn}=C.Platform.isDesktop?require("electron"):"";class BQ{constructor(){me(this,"eventListeners");this.eventListeners={}}on(t,n){this.eventListeners[t]=this.eventListeners[t]||[],this.eventListeners[t].push(n)}once(t,n){n.$emitOnce=!0,this.on(t,n)}removeListener(t,n){if(this.eventListeners[t]){const r=this.eventListeners[t].findIndex(a=>a===n);r>=0&&this.eventListeners[t].splice(r,1)}}removeAllListeners(t){this.eventListeners[t]&&(this.eventListeners[t].length=0)}emit(t,...n){this.eventListeners[t]&&this.eventListeners[t].forEach(r=>{r.call(this,...n),r.$emitOnce&&this.removeListener(t,r)})}}const Dd=new BQ;let Hh=null,eI=gn==null?void 0:gn.readText(),tI=gn==null?void 0:gn.readImage();gn&&(gn.on=(e,t)=>(Dd.on(e,t),gn),gn.once=(e,t)=>(Dd.once(e,t),gn),gn.off=(e,t)=>(t?Dd.removeListener(e,t):Dd.removeAllListeners(e),gn),gn.startWatching=()=>(Hh||(Hh=setInterval(()=>{_Q(eI,eI=gn==null?void 0:gn.readText())&&Dd.emit("text-changed"),HQ(tI,tI=gn==null?void 0:gn.readImage())&&Dd.emit("image-changed")},500)),gn),gn.stopWatching=()=>(Hh&&clearInterval(Hh),Hh=null,gn));function _Q(e,t){return t&&e!==t}function HQ(e,t){return!t.isEmpty()&&e.toDataURL()!==t.toDataURL()}var sI;const sw=(sI=require("electron"))==null?void 0:sI.remote;var lI,uI;const nI=(uI=(lI=require("electron"))==null?void 0:lI.remote)==null?void 0:uI.screen;class YQ{constructor(t,n){me(this,"isRegisted");me(this,"leaf");me(this,"clipboard");me(this,"isScreenTop",!1);me(this,"currentSplitWindow");me(this,"intervalNum");me(this,"allowsCopy",!1);me(this,"plugin");me(this,"actionEl",null);this.app=t,this.plugin=n,this.isRegisted=!1,this.leaf=null,this.clipboard=gn}async onload(){C.Platform.isDesktop&&(this.initGlobalCopyEvents(),await this.registerAllShortcuts(),this.registerEvents())}registerEvents(){this.plugin.registerEvent(this.app.workspace.on("quit",()=>{sw.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally)}))}initGlobalCopyEvents(){this.plugin.addCommand({id:"init-global-copy-events",name:N("Global copy"),callback:()=>{this.allowsCopy=!this.allowsCopy,!this.allowsCopy&&this.clipboard.stopWatching(),this.allowsCopy&&this.clipboard.startWatching(),this.leaf&&this.allowsCopy&&(this.actionEl=this.leaf.view.addAction("clipboard-x","Stop global copying",()=>{var t;this.allowsCopy=!1,this.clipboard.stopWatching(),(t=this.actionEl)==null||t.remove()}))}})}onunload(){this.isRegisted&&(sw.globalShortcut.unregister(this.plugin.settings.CaptureKey.OpenThinoGlobally),this.clipboard.off("text-changed"),this.clipboard.off("image-changed"),this.clipboard.stopWatching(),this.leaf&&this.leaf.detach())}getCurrentLeaf(){var n;return this.leaf?this.app.workspace.getLeavesOfType("thino_view").length>0&&!!this.app.workspace.getLeafById(this.leaf.id)?!0:((n=this.leaf)==null||n.detach(),this.currentSplitWindow.close(),this.currentSplitWindow=null,this.leaf=null,this.isScreenTop=!1,!1):!1}async registerAllShortcuts(){sw.globalShortcut.register(this.plugin.settings.CaptureKey.OpenThinoGlobally,()=>{this.getCurrentLeaf()?this.showThinoView():this.openThinoView()}),this.isRegisted=!0}showThinoView(){var r,a,o,s;const t=nI.getCursorScreenPoint(),n=(s=(o=(a=(r=this.leaf)==null?void 0:r.parent)==null?void 0:a.parent)==null?void 0:o.win)==null?void 0:s.electronWindow;if(n){if(n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.leaf.view.containerEl.toggleClass("thino-float-window",!0),n.isMinimized()&&n.restore(),n.focus(),this.plugin.settings.CaptureKey.ShowNearMouse){const{width:c,height:d}=n.getBounds();n.setBounds({x:t.x,y:t.y,width:c,height:d})}if(this.app.workspace.trigger("focus-on-textarea"),this.isScreenTop){this.isScreenTop=!1,setTimeout(()=>{n.setAlwaysOnTop(!1,"screen")},200);return}this.isScreenTop=!0}}openThinoView(){var o,s,c,d,p;this.leaf=this.app.workspace.openPopoutLeaf({size:{width:400,height:400}});const t=this.leaf;this.leaf.view.containerEl.toggleClass("thino-float-window",!0),this.leaf.setViewState({type:"thino_view"}),setTimeout(()=>{t.view.containerEl.classList.toggle("mobile-view",!0)},0),this.currentSplitWindow=(s=(o=this.leaf)==null?void 0:o.parent)==null?void 0:s.parent;const n=(p=(d=(c=this.leaf)==null?void 0:c.parent)==null?void 0:d.parent)==null?void 0:p.win.electronWindow;if(!n)return;n.setAlwaysOnTop(!this.isScreenTop,"screen"),this.leaf.setPinned(!this.isScreenTop),this.isScreenTop=!0;const r=this.app,a=m=>{var D,S,T;const g=nI.getCursorScreenPoint(),v=(T=(S=(D=t==null?void 0:t.parent)==null?void 0:D.parent)==null?void 0:S.win)==null?void 0:T.electronWindow;if(v){if(v.isMinimized()&&v.restore(),!this.isScreenTop&&this.plugin.settings.CaptureKey.ShowNearMouse){const{width:E,height:O}=v.getBounds();v.setBounds({x:g.x,y:g.y-200,width:E,height:O})}v.setAlwaysOnTop(!0,"screen"),r.workspace.trigger("focus-on-textarea"),r.workspace.trigger("send-to-thino",m,t)}};this.clipboard.on("text-changed",()=>{const m=this.clipboard.readText();a(m)}).on("image-changed",()=>{const m=this.clipboard.readImage();a(m)})}}class rI extends C.EditorSuggest{constructor(n,r){super(n);me(this,"root");me(this,"editor");me(this,"cursor");me(this,"plugin");me(this,"tags");me(this,"type","customTag");me(this,"HASHTAG_REGEX",/(^|\s)#[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]*$/g);this.plugin=r}checkSettings(){return this.plugin.settings.UseVaultTags}checkInMemosView(n){var o;const r=n.containerEl;if(!r)return!1;const a=(o=r.parentElement)==null?void 0:o.parentElement;return(a==null?void 0:a.classList.contains("common-editor-inputer"))||!1}fuzzySearchItemsOptimized(n,r){const a=C.prepareFuzzySearch(n);return r.map(s=>{const c=a(s);return c?{item:s,match:c}:null}).filter(Boolean)}onTrigger(n,r){if(!this.checkInMemosView(r)||this.checkSettings())return null;this.tags=Te.getState().tags,this.cursor=n,this.editor=r;const a=n.line,o=r.getLine(a),s=o.substr(0,n.ch);if(s.match(this.HASHTAG_REGEX)&&o.substr(n.ch,1)!=="#"){const c=s.lastIndexOf("#"),d=s.substr(c+1);return{start:{line:a,ch:c},end:{line:a,ch:n.ch},query:d}}return null}getSuggestions(n){return this.fuzzySearchItemsOptimized(n.query,this.tags).map(r=>r.item).sort((r,a)=>r.localeCompare(a))||[]}renderSuggestion(n,r){r.setText(n)}selectSuggestion(n){if(this.context){const r=this.context.editor,a=this.context.start,o=this.context.end;r.transaction({changes:[{from:a,to:o,text:"#"+n+" "}]}),setTimeout(function(){return r.focus()})}this.close()}}const wb=crypto,kx=e=>e instanceof CryptoKey,Vg=new TextEncoder,bb=new TextDecoder;function zQ(...e){const t=e.reduce((a,{length:o})=>a+o,0),n=new Uint8Array(t);let r=0;for(const a of e)n.set(a,r),r+=a.length;return n}const UQ=e=>{const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n},lw=e=>{let t=e;t instanceof Uint8Array&&(t=bb.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return UQ(t)}catch{throw new TypeError("The input to be decoded is not correctly encoded.")}};class yv extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(t){var n;super(t),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,(n=Error.captureStackTrace)==null||n.call(Error,this,this.constructor)}}class VQ extends yv{constructor(){super(...arguments),this.code="ERR_JOSE_ALG_NOT_ALLOWED"}static get code(){return"ERR_JOSE_ALG_NOT_ALLOWED"}}class vv extends yv{constructor(){super(...arguments),this.code="ERR_JOSE_NOT_SUPPORTED"}static get code(){return"ERR_JOSE_NOT_SUPPORTED"}}class xr extends yv{constructor(){super(...arguments),this.code="ERR_JWS_INVALID"}static get code(){return"ERR_JWS_INVALID"}}class ZQ extends yv{constructor(){super(...arguments),this.code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED",this.message="signature verification failed"}static get code(){return"ERR_JWS_SIGNATURE_VERIFICATION_FAILED"}}function us(e,t="algorithm.name"){return new TypeError(`CryptoKey does not support this operation, its ${t} must be ${e}`)}function Zg(e,t){return e.name===t}function uw(e){return parseInt(e.name.slice(4),10)}function WQ(e){switch(e){case"ES256":return"P-256";case"ES384":return"P-384";case"ES512":return"P-521";default:throw new Error("unreachable")}}function $Q(e,t){if(t.length&&!t.some(n=>e.usages.includes(n))){let n="CryptoKey does not support this operation, its usages must include ";if(t.length>2){const r=t.pop();n+=`one of ${t.join(", ")}, or ${r}.`}else t.length===2?n+=`one of ${t[0]} or ${t[1]}.`:n+=`${t[0]}.`;throw new TypeError(n)}}function GQ(e,t,...n){switch(t){case"HS256":case"HS384":case"HS512":{if(!Zg(e.algorithm,"HMAC"))throw us("HMAC");const r=parseInt(t.slice(2),10);if(uw(e.algorithm.hash)!==r)throw us(`SHA-${r}`,"algorithm.hash");break}case"RS256":case"RS384":case"RS512":{if(!Zg(e.algorithm,"RSASSA-PKCS1-v1_5"))throw us("RSASSA-PKCS1-v1_5");const r=parseInt(t.slice(2),10);if(uw(e.algorithm.hash)!==r)throw us(`SHA-${r}`,"algorithm.hash");break}case"PS256":case"PS384":case"PS512":{if(!Zg(e.algorithm,"RSA-PSS"))throw us("RSA-PSS");const r=parseInt(t.slice(2),10);if(uw(e.algorithm.hash)!==r)throw us(`SHA-${r}`,"algorithm.hash");break}case"EdDSA":if(e.algorithm.name!=="Ed25519"&&e.algorithm.name!=="Ed448")throw us("Ed25519 or Ed448");break;case"ES256":case"ES384":case"ES512":{if(!Zg(e.algorithm,"ECDSA"))throw us("ECDSA");const r=WQ(t);if(e.algorithm.namedCurve!==r)throw us(r,"algorithm.namedCurve");break}default:throw new TypeError("CryptoKey does not support this operation")}$Q(e,n)}function Ax(e,t,...n){var r;if(n.length>2){const a=n.pop();e+=`one of type ${n.join(", ")}, or ${a}.`}else n.length===2?e+=`one of type ${n[0]} or ${n[1]}.`:e+=`of type ${n[0]}.`;return t==null?e+=` Received ${t}`:typeof t=="function"&&t.name?e+=` Received function ${t.name}`:typeof t=="object"&&t!=null&&(r=t.constructor)!=null&&r.name&&(e+=` Received an instance of ${t.constructor.name}`),e}const aI=(e,...t)=>Ax("Key must be ",e,...t);function Fx(e,t,...n){return Ax(`Key for the ${e} algorithm must be `,t,...n)}const Ox=e=>kx(e),Ei=["CryptoKey"],qQ=(...e)=>{const t=e.filter(Boolean);if(t.length===0||t.length===1)return!0;let n;for(const r of t){const a=Object.keys(r);if(!n||n.size===0){n=new Set(a);continue}for(const o of a){if(n.has(o))return!1;n.add(o)}}return!0};function JQ(e){return typeof e=="object"&&e!==null}function oI(e){if(!JQ(e)||Object.prototype.toString.call(e)!=="[object Object]")return!1;if(Object.getPrototypeOf(e)===null)return!0;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}const KQ=(e,t)=>{if(e.startsWith("RS")||e.startsWith("PS")){const{modulusLength:n}=t.algorithm;if(typeof n!="number"||n<2048)throw new TypeError(`${e} requires key modulusLength to be 2048 bits or larger`)}},ml=(e,t,n=0)=>{n===0&&(t.unshift(t.length),t.unshift(6));const r=e.indexOf(t[0],n);if(r===-1)return!1;const a=e.subarray(r,r+t.length);return a.length!==t.length?!1:a.every((o,s)=>o===t[s])||ml(e,t,r+1)},iI=e=>{switch(!0){case ml(e,[42,134,72,206,61,3,1,7]):return"P-256";case ml(e,[43,129,4,0,34]):return"P-384";case ml(e,[43,129,4,0,35]):return"P-521";case ml(e,[43,101,110]):return"X25519";case ml(e,[43,101,111]):return"X448";case ml(e,[43,101,112]):return"Ed25519";case ml(e,[43,101,113]):return"Ed448";default:throw new vv("Invalid or unsupported EC Key Curve or OKP Key Sub Type")}},QQ=async(e,t,n,r,a)=>{let o,s;const c=new Uint8Array(atob(n.replace(e,"")).split("").map(p=>p.charCodeAt(0))),d=t==="spki";switch(r){case"PS256":case"PS384":case"PS512":o={name:"RSA-PSS",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RS256":case"RS384":case"RS512":o={name:"RSASSA-PKCS1-v1_5",hash:`SHA-${r.slice(-3)}`},s=d?["verify"]:["sign"];break;case"RSA-OAEP":case"RSA-OAEP-256":case"RSA-OAEP-384":case"RSA-OAEP-512":o={name:"RSA-OAEP",hash:`SHA-${parseInt(r.slice(-3),10)||1}`},s=d?["encrypt","wrapKey"]:["decrypt","unwrapKey"];break;case"ES256":o={name:"ECDSA",namedCurve:"P-256"},s=d?["verify"]:["sign"];break;case"ES384":o={name:"ECDSA",namedCurve:"P-384"},s=d?["verify"]:["sign"];break;case"ES512":o={name:"ECDSA",namedCurve:"P-521"},s=d?["verify"]:["sign"];break;case"ECDH-ES":case"ECDH-ES+A128KW":case"ECDH-ES+A192KW":case"ECDH-ES+A256KW":{const p=iI(c);o=p.startsWith("P-")?{name:"ECDH",namedCurve:p}:{name:p},s=d?[]:["deriveBits"];break}case"EdDSA":o={name:iI(c)},s=d?["verify"]:["sign"];break;default:throw new vv('Invalid or unsupported "alg" (Algorithm) value')}return wb.subtle.importKey(t,c,o,(a==null?void 0:a.extractable)??!1,s)},XQ=(e,t,n)=>QQ(/(?:-----(?:BEGIN|END) PUBLIC KEY-----|\s)/g,"spki",e,t,n);async function eX(e,t,n){if(typeof e!="string"||e.indexOf("-----BEGIN PUBLIC KEY-----")!==0)throw new TypeError('"spki" must be SPKI formatted string');return XQ(e,t,n)}const tX=(e,t)=>{if(!(t instanceof Uint8Array)){if(!Ox(t))throw new TypeError(Fx(e,t,...Ei,"Uint8Array"));if(t.type!=="secret")throw new TypeError(`${Ei.join(" or ")} instances for symmetric algorithms must be of type "secret"`)}},nX=(e,t,n)=>{if(!Ox(t))throw new TypeError(Fx(e,t,...Ei));if(t.type==="secret")throw new TypeError(`${Ei.join(" or ")} instances for asymmetric algorithms must not be of type "secret"`);if(n==="sign"&&t.type==="public")throw new TypeError(`${Ei.join(" or ")} instances for asymmetric algorithm signing must be of type "private"`);if(n==="decrypt"&&t.type==="public")throw new TypeError(`${Ei.join(" or ")} instances for asymmetric algorithm decryption must be of type "private"`);if(t.algorithm&&n==="verify"&&t.type==="private")throw new TypeError(`${Ei.join(" or ")} instances for asymmetric algorithm verifying must be of type "public"`);if(t.algorithm&&n==="encrypt"&&t.type==="private")throw new TypeError(`${Ei.join(" or ")} instances for asymmetric algorithm encryption must be of type "public"`)},rX=(e,t,n)=>{e.startsWith("HS")||e==="dir"||e.startsWith("PBES2")||/^A\d{3}(?:GCM)?KW$/.test(e)?tX(e,t):nX(e,t,n)};function aX(e,t,n,r,a){if(a.crit!==void 0&&r.crit===void 0)throw new e('"crit" (Critical) Header Parameter MUST be integrity protected');if(!r||r.crit===void 0)return new Set;if(!Array.isArray(r.crit)||r.crit.length===0||r.crit.some(s=>typeof s!="string"||s.length===0))throw new e('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let o;n!==void 0?o=new Map([...Object.entries(n),...t.entries()]):o=t;for(const s of r.crit){if(!o.has(s))throw new vv(`Extension Header Parameter "${s}" is not recognized`);if(a[s]===void 0)throw new e(`Extension Header Parameter "${s}" is missing`);if(o.get(s)&&r[s]===void 0)throw new e(`Extension Header Parameter "${s}" MUST be integrity protected`)}return new Set(r.crit)}const oX=(e,t)=>{if(t!==void 0&&(!Array.isArray(t)||t.some(n=>typeof n!="string")))throw new TypeError(`"${e}" option must be an array of strings`);if(t)return new Set(t)};function iX(e,t){const n=`SHA-${e.slice(-3)}`;switch(e){case"HS256":case"HS384":case"HS512":return{hash:n,name:"HMAC"};case"PS256":case"PS384":case"PS512":return{hash:n,name:"RSA-PSS",saltLength:e.slice(-3)>>3};case"RS256":case"RS384":case"RS512":return{hash:n,name:"RSASSA-PKCS1-v1_5"};case"ES256":case"ES384":case"ES512":return{hash:n,name:"ECDSA",namedCurve:t.namedCurve};case"EdDSA":return{name:t.name};default:throw new vv(`alg ${e} is not supported either by JOSE or your javascript runtime`)}}function sX(e,t,n){if(kx(t))return GQ(t,e,n),t;if(t instanceof Uint8Array){if(!e.startsWith("HS"))throw new TypeError(aI(t,...Ei));return wb.subtle.importKey("raw",t,{hash:`SHA-${e.slice(-3)}`,name:"HMAC"},!1,[n])}throw new TypeError(aI(t,...Ei,"Uint8Array"))}const lX=async(e,t,n,r)=>{const a=await sX(e,t,"verify");KQ(e,a);const o=iX(e,a.algorithm);try{return await wb.subtle.verify(o,a,n,r)}catch{return!1}};async function uX(e,t,n){if(!oI(e))throw new xr("Flattened JWS must be an object");if(e.protected===void 0&&e.header===void 0)throw new xr('Flattened JWS must have either of the "protected" or "header" members');if(e.protected!==void 0&&typeof e.protected!="string")throw new xr("JWS Protected Header incorrect type");if(e.payload===void 0)throw new xr("JWS Payload missing");if(typeof e.signature!="string")throw new xr("JWS Signature missing or incorrect type");if(e.header!==void 0&&!oI(e.header))throw new xr("JWS Unprotected Header incorrect type");let r={};if(e.protected)try{const T=lw(e.protected);r=JSON.parse(bb.decode(T))}catch{throw new xr("JWS Protected Header is invalid")}if(!qQ(r,e.header))throw new xr("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");const a={...r,...e.header},o=aX(xr,new Map([["b64",!0]]),n==null?void 0:n.crit,r,a);let s=!0;if(o.has("b64")&&(s=r.b64,typeof s!="boolean"))throw new xr('The "b64" (base64url-encode payload) Header Parameter must be a boolean');const{alg:c}=a;if(typeof c!="string"||!c)throw new xr('JWS "alg" (Algorithm) Header Parameter missing or invalid');const d=n&&oX("algorithms",n.algorithms);if(d&&!d.has(c))throw new VQ('"alg" (Algorithm) Header Parameter value not allowed');if(s){if(typeof e.payload!="string")throw new xr("JWS Payload must be a string")}else if(typeof e.payload!="string"&&!(e.payload instanceof Uint8Array))throw new xr("JWS Payload must be a string or an Uint8Array instance");let p=!1;typeof t=="function"&&(t=await t(r,e),p=!0),rX(c,t,"verify");const m=zQ(Vg.encode(e.protected??""),Vg.encode("."),typeof e.payload=="string"?Vg.encode(e.payload):e.payload);let g;try{g=lw(e.signature)}catch{throw new xr("Failed to base64url decode the signature")}if(!await lX(c,t,g,m))throw new ZQ;let D;if(s)try{D=lw(e.payload)}catch{throw new xr("Failed to base64url decode the payload")}else typeof e.payload=="string"?D=Vg.encode(e.payload):D=e.payload;const S={payload:D};return e.protected!==void 0&&(S.protectedHeader=r),e.header!==void 0&&(S.unprotectedHeader=e.header),p?{...S,key:t}:S}async function cX(e,t,n){if(e instanceof Uint8Array&&(e=bb.decode(e)),typeof e!="string")throw new xr("Compact JWS must be a string or Uint8Array");const{0:r,1:a,2:o,length:s}=e.split(".");if(s!==3)throw new xr("Invalid Compact JWS");const c=await uX({payload:a,protected:r,signature:o},t,n),d={payload:c.payload,protectedHeader:c.protectedHeader};return typeof t=="function"?{...d,key:c.key}:d}const dX={webId:"globe-2",pinned:"pin",archived:"archive",visibility:"eye",deleted:"trash"};class fX extends Ci.WidgetType{constructor(n,r,a,o,s){super();me(this,"error",!1);this.view=n,this.plugin=r,this.target=a,this.type=o,this.to=s}eq(n){return this.target===n.target}toDOM(){const n=createSpan();return n.toggleClass("thino-inline-widget",!0),C.setIcon(n,dX[this.type]||"help-circle"),C.setTooltip&&C.setTooltip(n,this.target),n}}function hX(e){class t{constructor(a){me(this,"view");me(this,"match",new Ci.MatchDecorator({regexp:/\[(webId|pinned|archived|visibility|deleted)::([^\]]+)\]/g,decorate:(a,o,s,c,d)=>{this.shouldRender(d,o,s)&&a(o,s,Ci.Decoration.replace({widget:new fX(d,e,c[0],c[1],s)}))}}));me(this,"decorations",Ci.Decoration.none);this.view=a,this.updateDecorations(a)}update(a){this.updateDecorations(a.view,a)}destroy(){this.decorations=Ci.Decoration.none}updateDecorations(a,o){!o||this.decorations.size===0?this.decorations=this.match.createDeco(a):this.decorations=this.match.updateDeco(o,this.decorations)}isLivePreview(a){return a.field(C.editorLivePreviewField)}shouldRender(a,o,s){return!a.state.selection.ranges.some(d=>d.from<=o?d.to>=o:d.from<=s)&&this.isLivePreview(a.state)}}const n={decorations:r=>r.decorations.update({filter:(a,o,s)=>{const c=s.spec.widget;return c&&c.error?!1:a===o||!r.view.state.selection.ranges.filter(d=>{const p=d.from,m=d.to;return p<=a?m>=a:p<=o}).length}})};return Ci.ViewPlugin.fromClass(t,n)}const pX=e=>e.ctrlKey!==void 0||e.metaKey!==void 0||e.shiftKey!==void 0||e.altKey!==void 0,Wg=()=>{new C.Notice(N("Open Memos Successfully"))},$g=[{id:"open-thino-in-left-sidebar",shortName:N("Left sidebar"),name:N("Open thino in left sidebar"),icon:"arrow-left",location:"left",cb:Wg,modKeys:"shift"},{id:"open-thino-in-right-sidebar",shortName:N("Right sidebar"),name:N("Open thino in right sidebar"),icon:"arrow-right",location:"right",cb:Wg,modKeys:["ctrl","meta"]},{id:"open-thino-in-float",shortName:N("Float window"),name:N("Open thino in float window"),icon:"layout",location:"float",cb:Wg,modKeys:"alt"},{id:"open-thino-in-center",shortName:N("Center window"),name:N("Open thino in center window"),icon:"tv-2",location:"center",cb:Wg,modKeys:void 0}];class mX extends C.Plugin{constructor(){super(...arguments);me(this,"settings");me(this,"settingTab");me(this,"triggerBySelf",!1);me(this,"updatedID","");me(this,"debounceTimer",0);me(this,"apiHttpServer",null);me(this,"captureService",null);me(this,"loaded",!1)}async onload(){await this.loadSettings(),bK(),this.registerRibbon(),await this.verify(),this.checkVersionAndShowChangeLog(),this.settingTab=new FK(this.app,this),this.addSettingTab(this.settingTab),this.initEditor(),this.initURIHandler(),this.registerMobileEvent(),this.registerCommands(),this.registerCanvasNodeMemos(),this.registerHoverEvent(),this.registerLinkOpen(),this.registerCodeBlocks(),this.registerEditorSuggest(new yK(this.app,this)),this.registerEditorExtension([MQ]),this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this)),this.registerView(_r,n=>new wl(n,this))}async loadSettings(){this.settings=Object.assign({},cs,await this.loadData()),Xe.setSettings(this.settings)}async saveSettings(){await this.saveData(this.settings),Xe.setSettings(this.settings)}onunload(){var r;this.app.workspace.detachLeavesOfType(_r),Te.clearMemos(),Ee.dispatch({type:"CLEAR_MEMOS",payload:null}),Ee.dispatch({type:"CLEAR_FILES",payload:null}),Ee.dispatch({type:"CLEAR_VIEW",payload:null});const n=document.body.find(".dialog-wrapper");n&&((r=n.parentElement)==null||r.detach()),this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null),this.captureService&&this.captureService.onunload(),new C.Notice(N("Close Memos Successfully"))}initEditor(){const n=()=>{const r=this.app.embedRegistry;if(!r)return!1;const a=r.embedByExtension.md,o=createEl("div"),s=a({app:this.app,containerEl:o},null,null);if(s.editable=!0,s.set(""),s.showEditor(),!s.editMode)return!1;const c=Object.getPrototypeOf(Object.getPrototypeOf(s.editMode));return Xe.setEditor(c),o.detach(),!0};this.app.workspace.onLayoutReady(()=>{n()||this.app.workspace.onLayoutReady(()=>{setTimeout(()=>{n()},100)})}),this.register(qh(C.MetadataCache.prototype,{getFileCache:r=>function(a){return!(a!=null&&a.path)&&!a?null:r.call(this,a)}}))}initApp(){Xe.setApp(this.app)}initURIHandler(){this.registerObsidianProtocolHandler("thino",async n=>{var s,c,d;if(!n)return;if(n.userid)try{const p=n.userid;AQ(p,this.app),FQ(C.moment().add(30,"days").valueOf(),this.app),Qe.setRefresh(!0)}catch(p){console.error(p),new C.Notice(N("Failed to verify"))}if(n.token)try{const p=n.token;(s=this.app)==null||s.saveLocalStorage("tokenForSync",p),setTimeout(()=>{this.app.setting.open(),this.app.setting.openTabById(this.manifest.id||"obsidian-memos"),this.settingTab.display()},200),new C.Notice(N("Saved sync token successfully"))}catch(p){console.error(p),new C.Notice(N("Failed to save"))}if(n.copyToken){this.app.setting.open(),this.app.setting.openTabById(this.manifest.id??"obsidian-memos");const p=await wx();await navigator.clipboard.writeText(p),new C.Notice(N("Copied app id successfully"))}const r=(c=Xe.getState())==null?void 0:c.verifyState,a=!C.Platform.isDesktop&&await((d=window.Capacitor)==null?void 0:d.Plugins.Device.getId()),o=C.Platform.isDesktop?await vn():a.identifier||a.uuid;if(!(!r||(r==null?void 0:r.appId)!==o)){if(n.content){const p=n.type,m=decodeURI(n.content)!==n.content?decodeURI(n.content):n.content,g=n.task,v=await Te.createThino({content:m,type:p,isList:!!g});if(!v)return;Te.pushMemo(v),He.clearQuery()}n.openId&&await Te.openThinoByID(n.openId)}})}initGlobalManifest(){Qe.setPluginManifest(this.manifest)}stopServer(){this.apiHttpServer&&(this.apiHttpServer.close(),this.apiHttpServer=null)}async initServer(){var o,s;if(C.Platform.isMobile||!this.settings.EnabledHttpApi)return;const n=(o=Xe.getState())==null?void 0:o.verifyState,r=!C.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=C.Platform.isDesktop?await vn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.apiHttpServer=RQ(this.settings),this.initServerPort())}initServerPort(){this.apiHttpServer&&this.settings.EnabledHttpApi&&this.apiHttpServer.listen(this.settings.HttpApiIpType,this.settings.HttpApiPort)}async initCaptureService(){var o,s;if(C.Platform.isMobile||!this.settings.CaptureKey.EnableCaptureKey)return;const n=(o=Xe.getState())==null?void 0:o.verifyState,r=!C.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=C.Platform.isDesktop?await vn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.captureService=new YQ(this.app,this),await this.captureService.onload())}registerMobileEvent(){C.Platform.isMobile&&(this.registerEvent(this.app.workspace.on("receive-text-menu",(n,r)=>{n.addItem(a=>{a.setSection("options").setIcon("popup-open").setTitle(N("Insert as Memo")).onClick(async()=>{let o=r;if(this.settings.ShareToThinoWithText){const c=this.settings.ShareToThinoWithTextPrepend+(this.settings.ShareToThinoWithTextNewline==="prepend"||this.settings.ShareToThinoWithTextNewline==="both"?`
`:" "),d=(this.settings.ShareToThinoWithTextNewline==="append"||this.settings.ShareToThinoWithTextNewline==="both"?`
`:" ")+this.settings.ShareToThinoWithTextAppend;o=c+o+d}const s=await Te.createThino({content:o,type:this.settings.MemoSaveLocation||"DAILY",isList:!0});Te.pushMemo(s)})})})),this.registerEvent(this.app.workspace.on("receive-files-menu",(n,r)=>{n.addItem(a=>{a.setIcon("popup-open").setTitle(N("Insert file as memo content")).onClick(async()=>{let s=r.map(d=>this.app.fileManager.generateMarkdownLink(d,d.path)).join(`
`);if(this.settings.ShareToThinoWithText){const d=this.settings.ShareToThinoWithTextPrepend+(this.settings.ShareToThinoWithTextNewline==="prepend"||this.settings.ShareToThinoWithTextNewline==="both"?`
`:" "),p=(this.settings.ShareToThinoWithTextNewline==="append"||this.settings.ShareToThinoWithTextNewline==="both"?`
`:" ")+this.settings.ShareToThinoWithTextAppend;s=d+s+p}const c=await Te.createThino({content:s,type:this.settings.MemoSaveLocation||"DAILY",isList:!0});Te.pushMemo(c)})})})))}registerCommands(){$g.forEach(n=>{this.addCommand({id:n.id,name:n.name,callback:()=>this.openMemos(n.location,n.cb),hotkeys:[]})}),this.addCommand({id:"show-thino-editor",name:N("Show thino editor"),checkCallback:n=>{if(Te.initialized&&Xe.initialized){if(!n){if(!Xe.getState().view){new C.Notice(N("Please open thino first"));return}new fx(this.app).open()}return!0}}}),this.addCommand({id:"lock-thino",name:N("Lock thino"),checkCallback:n=>{if(this.app.workspace.getActiveViewOfType(wl)&&this.settings.needVerify)return n||Qe.setLocked(!0),!0}}),this.addCommand({id:"copy-debug-info",name:N("Copy debug info"),callback:()=>{try{const n=this.app.internalPlugins.plugins["daily-notes"];let r;r={settings:{...this.settings,tokenForVerify:"***"},manifest:this.manifest,platform:C.Platform.resourcePathPrefix},n&&(r={...r,dailyNotePluginInfo:{options:n.instance.options}}),navigator.clipboard.writeText(`\`\`\`json
${JSON.stringify(r,null,2)}
\`\`\``),new C.Notice(N("Debug info copied to clipboard"))}catch(n){console.error(n)}}}),this.addCommand({id:"insert-editor",name:N("Insert editor"),checkCallback:n=>{const r=this.app.workspace.getActiveViewOfType(C.MarkdownView);if(r&&r.getViewType()==="markdown")return n||r.editor.replaceSelection("\n```thino\n{\n editor: false\n}\n```\n"),!0}}),this.addCommand({id:"toggle-minimal-thino",name:N("Toggle minimal mode"),callback:()=>{const n=document.body.hasClass("minimal-thino");document.body.toggleClass("minimal-thino",!n)}}),this.addCommand({id:"focus-on-thino-editor",name:N("Focus on thino editor"),callback:()=>this.focusOnEditor(),hotkeys:[]}),this.addCommand({id:"reinit-thino-sync",name:N("ReSync web thinos to local"),callback:()=>{HJ(this.app)}}),this.addCommand({id:"init-thino-sync",name:N("Sync local thinos to web"),callback:async()=>{var r;if(!((r=this.app)==null?void 0:r.loadLocalStorage("tokenForSync"))){new C.Notice(N("Please input token first"));return}if(!this.settings.startSync){new C.Notice(N("Please enable sync first"));return}try{await Te.initSync()}catch(a){console.error(a),new C.Notice(N("Init Failed"))}}}),this.addCommand({id:"show-daily-thino",name:N("Show daily thino"),callback:()=>this.openDailyMemo(),hotkeys:[]}),this.addCommand({id:"focus-on-search-bar",name:N("Focus on search bar"),callback:()=>this.searchIt(),hotkeys:[]}),this.addCommand({id:"show-thino-in-popover",name:N("Show-thino in popover(Hover editor)"),callback:()=>this.showInPopover(),hotkeys:[]})}async onLayoutReady(){this.initApp(),await this.initServer(),this.initGlobalManifest(),await this.initMemos(),this.autoOpenMemos(),this.registerThinoWidget(),await this.registerToolbarCheck(),await this.initCaptureService(),Xe.setPlugin(this);const n=this.app.workspace.editorSuggest.suggests.findIndex(r=>r.type==="customTag");n!==-1?(this.app.workspace.editorSuggest.suggests.splice(n,1),this.app.workspace.editorSuggest.suggests.unshift(new rI(this.app,this))):this.app.workspace.editorSuggest.suggests.unshift(new rI(this.app,this))}async initMemos(){try{await this.initDailyNotes()}catch(n){console.error(n)}Xe.getState(),Te.getState(),await Te.fetchAllMemos()}async initDailyNotes(){this.settings.EnabledLocationList.find(n=>n.value==="DAILY")&&await Xe.fechLocalDailyNotes()}registerCanvasNodeMemos(){if(!C.requireApiVersion("1.2.0")||!this.settings.EnabledLocationList.find(o=>o.value==="CANVAS"))return;const n=o=>{clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{setTimeout(async()=>{const s=o.canvas.getData(),c=s.nodes.find(d=>d.id===o.id);if(c&&(r(c),o.canvas.setData(s),Te.getMemoById(o.id))){const p=await Te.updateMemo(o.id,c.text,c.thinoType);Te.editMemo(p)}o.canvas.requestSave(!0)},0)},800)},r=o=>{o.createdAt||(o.createdAt=C.moment().format("YYYY-MM-DD HH:mm:ss")),o.updatedAt=C.moment().format("YYYY-MM-DD HH:mm:ss"),o.deletedAt=o.deletedAt?o.deletedAt:"",o.pinned=o.pinned?o.pinned:!1,o.visibility=o.visibility?o.visibility:"PUBLIC",o.rowStatus=o.rowStatus?o.rowStatus:"NORMAL",o.thinoType=o.thinoType?o.thinoType:"JOURNAL",o.hasId=o.hasId?o.hasId:"",o.linkId=o.linkId?o.linkId:"",o.resourceList=[]},a=()=>{var v,D;const o=(v=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:v.view;if(!o||!(o==null?void 0:o.canvas))return!1;const c=((D=this.app.workspace.getLeavesOfType("canvas").first())==null?void 0:D.view).canvas.nodes.values(),p=Array.from(c).filter(S=>S.text!==void 0);if(!p||p.length===0)return!1;const m=p[0].child;if(!m)return!1;const g=qh(m.constructor.prototype,{save:S=>function(...T){S.call(this,...T),this.node.isEditing&&n(this.node)}});return this.register(g),!0};this.app.workspace.onLayoutReady(()=>{if(!a()){const o=this.app.workspace.on("layout-change",()=>{a()&&this.app.workspace.offref(o)});this.registerEvent(o)}})}registerLinkOpen(){qh(C.Workspace.prototype,{openLinkText:n=>async function(r,a,o,s,...c){const d=Te.getState().memos;if(d.find(p=>p.id===r||p.id===a)){const p=d.find(m=>m.id===r||m.id===a);$d(p);return}n.call(this,r,a,o,s,...c)}})}registerHoverEvent(){this.registerHoverLinkSource("thino",{defaultMod:!0,display:"Thino"})}registerCodeBlocks(){this.registerMarkdownCodeBlockProcessor("thino",async(n,r)=>{var a;if(n){if(!((a=this.app.workspace.getLeavesOfType("thino_view"))!=null&&a.length)){r.toggleClass(["thino-editor-codeblock","view-error"],!0),bJ(r,this);return}if(n){const o=C.parseYaml(n);SJ(r,o)}}})}registerRibbon(){this.addRibbonIcon("Memos",N("ribbonIconTitle"),async n=>{if(n.button===2){n.preventDefault();const r=new C.Menu;$g.forEach(a=>{r.addItem(o=>{o.setTitle(a.shortName).setIcon(a.icon).onClick(async()=>{await this.openMemos(a.location,a.cb)})})}),r.showAtMouseEvent(n);return}for(let r=0;r<$g.length;r++){const a=$g[r];if(!a.modKeys){await this.openMemos(a.location,a.cb);break}if(!pX(n))continue;const o=s=>n[`${s}Key`];if(typeof a.modKeys=="string"&&o(a.modKeys)||Array.isArray(a.modKeys)&&a.modKeys.some(o)){await this.openMemos(a.location,a.cb);break}}})}registerThinoWidget(){this.registerEditorExtension([hX(this)])}async registerToolbarCheck(){var o,s;if(this.loaded)return;const n=(o=Xe.getState())==null?void 0:o.verifyState,r=!C.Platform.isDesktop&&await((s=window.Capacitor)==null?void 0:s.Plugins.Device.getId()),a=C.Platform.isDesktop?await vn():r.identifier||r.uuid;!n||(n==null?void 0:n.appId)!==a||(this.registerEditorExtension([TQ(this.app)]),this.registerEditorSuggest(new vK(this.app,this)),this.loaded=!0)}async verify(){var a;let n="";if(C.Platform.isDesktop)n=await vn();else{const o=await((a=window.Capacitor.Plugins.Device)==null?void 0:a.getId());if(!o)return;n=o.identifier||o.uuid}async function r(o){if(!o)return Xe.setVerifyState(null),!1;const d=await eX(`-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAr+i4MLzI40gGFHl7gdRH
UL1mH0NcWEs1/IBYDDbc9ALbvUGwDaUcVIKke+b+F4T7qISexyGd5qV0s1vNYeCk
iCTq4w3+CFDurIFYAgQYTcV6K5pL8Bpb79FEclsTnAcKgiuzKBxPZ1djKxbgnmFj
+PE+EcmX+JJK9hG1O8X+YFJoPJWl225eCoysONickiI7Ndwu9YLR8pIUb1VMyJSy
cMR87z466Nc5Hx2QhwyuiiQYL3Ru4WkNF3AVWgqeOlhBDybFFwDaV7OOMTiYtH46
3iKx6azEVS8W/gYfrW+hKp2VziPPw3oxouP/wCes/4qRlXkwyjSwtfLtpE4Rsa4+
swIDAQAB
-----END PUBLIC KEY-----`,"RS256");try{const{payload:p}=await cX(o,d),m=JSON.parse(new TextDecoder().decode(p));return!m||m.iss!=="pkmer"||m.type!=="thino"||m.appId!==n?!1:(Xe.setVerifyState(m),!0)}catch(p){console.error(p)}}return await r(this.settings.tokenForVerify[n])}async checkVersionAndShowChangeLog(){const n=this.manifest.version,r=this.settings.LastUpdatedVersion;n!==r&&(this.settings.LastUpdatedVersion=n,await this.saveSettings(),this.showChangeLog())}showChangeLog(){new Db(this.app,this.manifest.version).open()}autoOpenMemos(){this.app.workspace.getLeavesOfType(_r).length>0||this.settings.MobileAndDesktop==="Mobile"&&C.Platform.isDesktop||this.settings.MobileAndDesktop==="Desktop"&&C.Platform.isMobile||this.settings.OpenMemosAutomatically&&this.openMemos()}async openDailyMemo(){if(this.app.workspace.getLeavesOfType(_r).length>0){He.setPathname("/daily");return}await this.openMemos(),He.setPathname("/daily")}async openMemos(n="center",r){const a=this.app.workspace;if(a.getLeavesOfType(_r).length>0){const c=a.getLeavesOfType(_r)[0];a.setActiveLeaf(c),a.revealLeaf(c);return}a.detachLeavesOfType(_r);let o;switch(n){case"left":o=a.getLeftLeaf(!1);break;case"right":o=a.getRightLeaf(!1);break;case"float":o=a.getLeaf("window");break;default:o=a.getLeaf(!0);break}o&&(await o.setViewState({type:_r}),a.revealLeaf(o));const s=o.view.containerEl.querySelector("textarea");s&&s.focus(),r==null||r()}async searchIt(){const n=this.app.workspace,r=n.getLeavesOfType(_r);if(!(r.length>0)){await this.openMemos(),this.app.workspace.trigger("focus-on-searchbar");return}const a=r[0];n.revealLeaf(a),this.app.workspace.trigger("focus-on-searchbar")}async focusOnEditor(){if(!(this.app.workspace.getLeavesOfType(_r).length>0)){await this.openMemos();return}this.app.workspace.trigger("focus-on-textarea")}changeStatus(){const n=this.app.workspace,r=n.getLeavesOfType(_r);if(!(r.length>0)){new C.Notice(N("Please Open Memos First"));return}const a=r[0];n.setActiveLeaf(a),a.view.containerEl.querySelector(".list-or-task").click()}async showInPopover(){var o,s,c;const n=this.app.workspace;if(n.detachLeavesOfType(_r),!this.app.plugins.getPlugin("obsidian-hover-editor")){new C.Notice(N("Please install obsidian-hover-editor plugin first"));return}const a=await((o=this.app.plugins.getPlugin("obsidian-hover-editor"))==null?void 0:o.spawnPopover());a&&(await a.setViewState({type:_r}),n.revealLeaf(a),a.view.containerEl.classList.add("mobile-view"),(s=this.settings)!=null&&s.FocusOnEditor&&a.view.containerEl.querySelector("textarea")!==void 0&&((c=a.view.containerEl.querySelector("textarea"))==null||c.focus()))}}class Db extends C.Modal{constructor(n,r){super(n);me(this,"component");this.version=r}async onOpen(){const{contentEl:n}=this;this.containerEl.toggleClass("thino-changelog-modal",!0),n.createEl("h2",{text:N("Thino update info")+` version ${this.version}`});try{n.createEl("h3",{text:N("Latest version")});const r=n.createDiv("current-change-log");n.createEl("hr"),n.createEl("h3",{text:N("Previous version")});const a=n.createDiv("prev-change-log"),s=await C.requestUrl("https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md");this.component=new C.Component;const[c,d]=this.getLatestVersionContent(s.text);await C.MarkdownRenderer.render(this.app,c,r,"",this.component),await C.MarkdownRenderer.render(this.app,d,a,"",this.component)}catch(r){console.error(r),n.createEl("p",{text:N("Failed to load changelog")}),n.createEl("a",{text:N("View online"),attr:{href:"https://raw.githubusercontent.com/Quorafind/Obsidian-Thino/main/CHANGELOG.md",target:"_blank"}})}}getLatestVersionContent(n){const r=/^# .+/gm,a=[...n.matchAll(r)];if(a.length===0)return[n,""];const o=a[0].index||0;let s=n.length;a.length>1&&(s=a[1].index||n.length);const c=n.substring(o,s).trim(),d=n.substring(s).trim();return[c,d]}onClose(){var r;const{contentEl:n}=this;n.empty(),(r=this.component)==null||r.unload()}}exports.ChangeLogModal=Db;exports.default=mX;